/* nato-app.css — 나토 틀 안의 앱을 나토 결(밝은 종이색 · 먹색 · 샴페인 금색)로 (대표 11-23
   「나토는 밝은 계열인데 앱들 중에 검은 계열이 많으니 부자연스럽네」·「나토 사이트와 나토 앱 같이 스타일 시트 통합」·
   「디자인이나 형태도 나토에 맞게 스타일을 통합하고 더 자연스럽게」).

   부르는 곳: web/templates/_ad_banner.html 의 나토 갈래(nato 가 있을 때만 — <body> 바로 뒤라 사이트 <head> 의 스타일보다 늦게 읽힌다).
   나토가 꺼져 있으면 이 파일은 읽히지 않고 앱은 예전 모양 그대로.
   11-23 대표 「늘 밝게」: 기기가 어두운 모드여도 나토·앱 모두 늘 밝은 종이색(예전엔 어두운 모드면 앱을 원래 모양으로 두었다).

   방법: 앱 250여 개가 저마다 페이지 안에 적은 색 이름(--bg·--card·--panel·--text·--muted·--accent …)을 나토 값으로 다시 정하고,
   흔한 겉모양(바탕·입력 칸·카드·공용 조각)만 덮는다. 선택자는 html.nt-framed(특이도 0,1,1 이상)로 시작해 사이트의 :root·body 규칙을 이긴다.
   덜 바뀐 앱은 scripts/themecheck.mjs 로 찾는다(어두운 바탕 넓이 · 대비 낮은 글자). 앱의 그림(canvas·img)은 건드리지 않는다.
   나토 값의 원본은 paper.css :root — 바꾸면 여기도. */
@media all {   /* 11-23 「늘 밝게」 — 기기가 어두운 모드여도 앱을 나토 종이색으로 */
  /* ── 1. 색 이름 — 사이트들이 쓰는 이름 전부를 나토 값으로 ───────────────────── */
  html.nt-framed, html.nt-framed body, html.nt-framed body :where(.xn-app, .xn-app-light, .wrap, .container, main, .app) {
    --nt-paper: #fbfaf7; --nt-ink: #121315; --nt-dim: #6a6d72; --nt-line: #e7e4de; --nt-card: #f3f1ec; --nt-card2: #ebe8e1; --nt-gold: #8a6a3c;
    --bg: var(--nt-paper); --bg2: var(--nt-card); --bg-2: var(--nt-card); --bg3: var(--nt-card2);
    --surface: #fff; --surface-2: var(--nt-card); --surface2: var(--nt-card);
    --card: #fff; --card2: var(--nt-card); --card-2: var(--nt-card); --card-bg: #fff;
    --panel: #fff; --panel2: var(--nt-card); --panel-2: var(--nt-card);
    --border: var(--nt-line); --border2: #d6d2c9; --border-strong: #d6d2c9; --line: var(--nt-line); --grid: var(--nt-line); --rule: var(--nt-line);
    --text: var(--nt-ink); --fg: var(--nt-ink); --ink: var(--nt-ink); --text-sub: #3a3c40; --sub: #3a3c40; --text2: #3a3c40;
    --muted: var(--nt-dim); --dim: var(--nt-dim); --faint: #84878c; --subtle: #84878c;
    --mute: var(--nt-dim); --ink2: #3a3c40; --ink3: var(--nt-dim); --link: var(--nt-ink); --kv-sub: var(--nt-dim);
    --gold-text: var(--nt-gold); --acc: var(--nt-ink); --acc2: var(--nt-gold); --accent-ink: var(--nt-paper);
    --card-solid: #fff; --glass: #fff; --glass-border: var(--nt-line); --border-hover: #d6d2c9;
    --accent: var(--nt-ink); --accent2: var(--nt-gold); --accent-2: var(--nt-gold); --accent-3: var(--nt-gold);
    --grad: linear-gradient(var(--nt-ink), var(--nt-ink)); --on-accent: var(--nt-paper);
    --shadow: 0 1px 2px rgba(18, 19, 21, .06); --ring: 0 0 0 3px rgba(168, 135, 90, .35);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236a6d72' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: light;
  }

  /* ── 2. 바탕 · 글자 ─────────────────────────────────────────────── */
  html.nt-framed { background: var(--nt-paper); }
  html.nt-framed body { background: var(--nt-paper) !important; color: var(--nt-ink); }
  /* 은은한 배경광(_site_theme.html)·별 하늘 같은 바탕 장식은 종이 위에선 얼룩이라 끈다 */
  html.nt-framed body::before, html.nt-framed body::after { background: none !important; box-shadow: none !important; }
  html.nt-framed body :is(.xc-aura, .pr-sky, .bb-sky) { display: none !important; }
  /* 어두운 화면용 글자 번짐(네온 빛)은 종이 위에선 흐림 — 끈다 */
  html.nt-framed body * { text-shadow: none !important; }
  /* 어두운 화면용 그림자(안쪽 빛·큰 번짐)는 종이 위에선 칸 둘레를 지저분하게 한다 — 나토처럼 평평하게(키보드 초점 고리는 남김) */
  html.nt-framed body *:not(:focus-visible) { box-shadow: none !important; }

  /* ── 3. 입력 칸 — 흰 칸에 얇은 선(나토 찾기 칸과 같게) ───────────────────── */
  html.nt-framed body :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=button]):not([type=submit]):not([type=reset]), select, textarea) {
    background-color: #fff; color: var(--nt-ink); border-color: #d6d2c9; color-scheme: light;
  }
  html.nt-framed body :is(input, textarea)::placeholder { color: #84878c; opacity: 1; }
  html.nt-framed body :is(input, select, textarea):focus { border-color: var(--nt-ink); }

  /* ── 4. 앱 공통 조각(xn-ui.css) — 나토 카드·단추 모양 ─────────────────── */
  html.nt-framed body :where(.xn-card) { background: #fff; border: 1px solid var(--nt-line); box-shadow: none; }
  html.nt-framed body :where(.xn-card--inset) { background: var(--nt-card); }
  html.nt-framed body .xn-result { background: #fff; border: 1px solid var(--nt-line); box-shadow: none; }
  html.nt-framed body .xn-result::before { background: var(--nt-gold); }  /* 왼쪽 띠는 나토의 생각 칸처럼 금색 */
  html.nt-framed body :where(.xn-btn) { background: var(--nt-ink); color: var(--nt-paper); box-shadow: none; }
  html.nt-framed body :where(.xn-btn):hover { filter: none; box-shadow: none; background: #2a2c30; }
  html.nt-framed body :where(.xn-btn--ghost) { background: #fff; color: var(--nt-ink); border: 1px solid var(--nt-line); }
  html.nt-framed body :where(.xn-hero__icon) { background: var(--nt-card); color: var(--nt-ink); box-shadow: none; }
  html.nt-framed body :where(.xn-hero__title, .xn-hero h1) { color: var(--nt-ink); -webkit-text-fill-color: currentColor; background: none; }

  /* ── 4b. 앱 아래 공용 조각(_related 「이런 도구도 있어요」 · _site_foot 읽을거리) — 나토 목록처럼 얇은 선, 떠오름·빛 없음 ── */
  html.nt-framed body .xnrel { --xr-grad: linear-gradient(var(--nt-ink), var(--nt-ink)); --xr-b: var(--nt-gold); }
  html.nt-framed body .xnrel-card { background: #fff; border-color: var(--nt-line); }
  html.nt-framed body .xnrel-card::before { display: none; }
  html.nt-framed body .xnrel-card:hover { transform: none; box-shadow: none; border-color: var(--nt-ink); }
  html.nt-framed body .xnrel-card:hover .xnrel-ico { transform: none; }
  html.nt-framed body .xnrel-ico { background: var(--nt-card); }

  /* ── 4d. 책·홍보 갈래(promo.css·bookpage.css — book·aibase·math 등 _book_site): 하늘·보라·분홍 세 색(--a1~3)을 먹색·금색으로, 단추는 먹색 바탕에 종이색 글자 ── */
  html.nt-framed body.pr { --a1: var(--nt-ink); --a2: #3a3c40; --a3: var(--nt-gold); --line: var(--nt-line); }
  html.nt-framed body .bp-btn, html.nt-framed body .pr-gp { background: var(--nt-ink); color: var(--nt-paper); box-shadow: none; }
  html.nt-framed body .pr-steps li > b { box-shadow: none; }
  html.nt-framed body .bp-covers img, html.nt-framed body .pr-cover img { box-shadow: 0 8px 20px -12px rgba(18, 19, 21, .35); }

  /* ── 4e. 바탕색을 숫자로 적은 네온 코인 도구 칸(themecheck 11-23 남은 것) — 칸은 흰 종이 칸으로. 별자리 하늘·차트·알림 띠처럼 일부러 어두운 그림 칸은 그대로 ── */
  html.nt-framed body :is(.cs .xc-card, .cs-deck, .cs-now, .cs-pat, .cv-mon .xc-card, .cn .xc-card, .cn .xc-kpi, .cn .xc-read, .nw .xc-card, .nw-tile, .nw .xc-kpi, .nw-fsum div, .nw .xc-read, .nw-wait, .rs-asset, .rs-tg button, .rs-card, .rs-coach) {
    background: #fff; border-color: var(--nt-line); box-shadow: none;
  }
  html.nt-framed body :is(.cn .xc-table th) { background: var(--nt-card); }
  html.nt-framed body .nw-tile:hover { background: var(--nt-card); }

  /* ── 4f. 코인·주식 도구 공용 칸(_coin_base.html — 주식 도구도 이 틀): 어두운 화면용 윗면 빛·실선 테두리(#262f42)·표 머리 그라데이션을 나토 얇은 선으로 ── */
  html.nt-framed body .xc-kpi { border-color: var(--nt-line); background: var(--nt-card); }
  html.nt-framed body .xc-card { background: #fff; }
  html.nt-framed body :is(.xc-card, .xc-kpi)::before { display: none; }
  html.nt-framed body .xc-table th { background: var(--nt-card); }
  /* 단추 위를 지나가는 반짝임(ego 「테스트 시작하기」 등) — 나토는 무늬 없는 먹색 단추 */
  html.nt-framed body .start-btn::after { display: none; }

  /* ── 4g. 키워드 글·키워드 위키 허브(keyword.html·keyword_hub.html — 대표 11-23 「위키 글이나 등등 모두 나토 방으로 · 스타일도」): 어두운 남색 칸을 종이 칸으로 ── */
  html.nt-framed body :is(.kw-hero, .facts-block, .toc, .live-block, .search-frame, .recent-chip) { background: #fff; border-color: var(--nt-line); }
  html.nt-framed body article.sec ul { background: var(--nt-card); border-color: var(--nt-line); }
  html.nt-framed body > main > .hero, html.nt-framed body .wrap > .hero { background: var(--nt-card); border-color: var(--nt-line); }
  html.nt-framed body .kw-hero h1 { color: var(--nt-ink); -webkit-text-fill-color: currentColor; background: none; }

  /* ── 4c. 앱 모음(/sites)의 큰 칸(_portal_hero.html — 성경·꾸란·불경·법령·코인·주식 · 메타버스 입구) — 색 칸을 나토 단색(흰 칸 · 얇은 선 · 먹색 단추)으로 ── */
  html.nt-framed body .hero-card { --mc: var(--nt-ink); background: #fff; border: 1px solid var(--nt-line); }
  html.nt-framed body .hero-go:hover { background: var(--nt-card); }
  html.nt-framed body .hero-x a { color: var(--nt-ink); }
  html.nt-framed body .hero-x a.hero-meta { background: var(--nt-ink); color: var(--nt-paper); border: 0; box-shadow: none; }
  html.nt-framed body .hero-x a.hero-meta:hover { filter: none; background: #2a2c30; }
  html.nt-framed body .hero-meta::after { display: none; }
  html.nt-framed body .hero-meta .mi { background: rgba(255, 255, 255, .12); }
  html.nt-framed body .hero-meta .m3d, html.nt-framed body .meta-ban-k b { background: var(--nt-paper); color: var(--nt-ink); }
  html.nt-framed body .meta-ban-k { color: #e7d6bb; }
  html.nt-framed body .meta-ban-go { background: var(--nt-paper); color: var(--nt-ink); border: 0; }
}

/* ── 5. 겹치는 것 빼기(밝든 어둡든) — 대표 11-23 「타이틀도 중복」·「언어 전환하는 부분이 중복」 ───────────
   앱 제목·설명 칸(xn-hero 191곳)은 나토 방 머리(앱 이름 · 설명 · 나토의 생각)와 같은 말이라 화면에서 뺀다 — h1 은 읽기 도구·검색을 위해 문서에 남긴다(보이지 않게만).
   앱의 KO·EN 줄(.lang-bar)은 나토 머리의 언어 단추가 이 앱의 언어를 바꾸므로(frame.rs lang_here) 뺀다. */
html.nt-framed body .xn-hero { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.nt-framed body .lang-bar { display: none !important; }
/* 코인·주식 도구(_coin_base·_stock_base)의 머리: 실시간 상태·데이터 출처 줄(.xc-top)은 두고, 제목·설명(방 머리와 같은 말)만 뺀다 */
html.nt-framed body .xc-head h1, html.nt-framed body .xc-leadbox { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* 앱 모음(/sites — portal.html): 「na.to」 제목·KO·EN 줄·아래 법적 링크 줄은 나토 머리(로고·언어 단추)·나토 바닥과 같아 뺀다(대표 11-23 「타이틀도 중복」·「앱 포탈 하단 메뉴도 중복」) */
html.nt-framed body .portal-brand { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.nt-framed body .portal-lang-switch { display: none !important; }
/* 밝게/어둡게 단추도 — 나토 틀 안은 나토처럼 기기 설정(밝음·어두움)을 따른다 */
html.nt-framed body .portal-right-widgets [onclick="toggleTheme()"] { display: none !important; }
html.nt-framed body .wrap > footer { display: none !important; }
/* 앱 모음 큰 칸 — 넓은 화면에서 오른쪽 대화 칸(360px)이 열려 있으면 본문이 좁아져 네 칸 한 줄에서 「교회 들어가기」 글자와 「3D」 표시가 겹쳤다(대표 11-23).
   본문이 1100px 안쪽인 동안(화면 1100~1499px · 대화 칸 열림)은 두 칸씩 */
@media (min-width: 1100px) and (max-width: 1499px) {
  html.nt-framed:not(.dock-shut) body .hero-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 어느 폭에서든 단추 글자가 「3D」 표시 밑으로 들어가지 않게 — 글자 칸이 줄어들고 넘치면 말줄임 */
html.nt-framed body .hero-meta .mt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.nt-framed body .hero-meta .mt small { overflow: hidden; text-overflow: ellipsis; }
/* 카테고리 허브·키워드 위키(base.html 의 header.topbar — 「na.to」 글자 · 카테고리 줄 · KO/EN): 나토 머리·길잡이 줄(⌂ › 분류)·언어 단추가 같은 일을 해서 뺀다(대표 11-23 허브도 나토 방처럼) */
html.nt-framed body > header.topbar { display: none !important; }
html.nt-framed { color-scheme: only light; }   /* 브라우저 자동 어둡게(강제 다크) 막기 */
