/* 화면 테마 — 색 묶음(data-palette) × 밝기(data-theme: dark | light)  (2026-10-08 사용자 지시: 여러 테마를 넣어 두고 골라 쓰게)
   <html data-palette="…" data-theme="…"> 는 web/js/theme.js 가 그리기 전에 붙인다. 기본 테마·테마 목록도 theme.js 한 곳
   앱 화면(base.css 다음)과 로그인·계정 화면(auth.css 다음) 모두 이 파일을 싣는다 — 두 파일의 토큰을 한꺼번에 채운다

   테마 더하는 법
     1. 아래에 :root[data-palette="새이름"] (밝게) 와 :root[data-palette="새이름"][data-theme="dark"] (어둡게) 두 덩어리를 더한다
        — 채울 값은 '씨앗' 17개 (바탕·면·선·글자·강조색). 나머지 토큰은 맨 아래 '이어 받기' 가 씨앗에서 만든다
     2. web/js/theme.js 의 LIST 에 { id, name, color } 한 줄
   상태색(위험·완료·주의·오름·내림)은 테마마다 바꾸지 않고 밝기에만 따른다 — 어느 테마에서나 같은 뜻으로 읽히게
   선택자 무게: base.css·auth.css 의 :root[data-theme] 보다 무거워야 이긴다 — 그래서 늘 [data-palette] 를 붙인다 */

/* ───── 금빛 — 따뜻한 회색 바탕 + 금색 ───── */
:root[data-palette="gold"]{
  --bg:#f4f3ef; --surface:#ffffff; --surface-2:#eceae4; --surface-hover:#e4e1d9; --line:#dcd8cf; --line-strong:#c4bfb4;
  --text:#1a1c20; --muted:#4a5058; --subtle:#5a6069; --placeholder:#9a978f;
  --accent:#8a5a00; --accent-hover:#6f4800; --accent-soft:#fbf1dc; --accent-line:#ecd3a0; --on-accent:#ffffff; --accent-ink:#6f4800; --hl:#fffbf0;
}
:root[data-palette="gold"][data-theme="dark"]{
  --bg:#0e1013; --surface:#15181c; --surface-2:#1c2025; --surface-hover:#252a30; --line:#2b3137; --line-strong:#454d56;
  --text:#ebe8e2; --muted:#b4b9bf; --subtle:#9ba1a9; --placeholder:#6b737c;
  --accent:#e0ab45; --accent-hover:#eabb5e; --accent-soft:#2e2412; --accent-line:#5a4520; --on-accent:#17120a; --accent-ink:#f0cf8e; --hl:#1d1a12;
}

/* ───── 파랑 — 차가운 회청색 바탕 + 파랑 (틀의 처음 디자인) ───── */
:root[data-palette="blue"]{
  --bg:#f6f8fb; --surface:#ffffff; --surface-2:#f1f5f9; --surface-hover:#e8edf3; --line:#e2e8f0; --line-strong:#cbd5e1;
  --text:#0f172a; --muted:#475569; --subtle:#64748b; --placeholder:#94a3b8;
  --accent:#2563eb; --accent-hover:#1d4ed8; --accent-soft:#eff6ff; --accent-line:#bfdbfe; --on-accent:#ffffff; --accent-ink:#1e40af; --hl:#fffdf5;
}
:root[data-palette="blue"][data-theme="dark"]{
  --bg:#0b1120; --surface:#111827; --surface-2:#1a2333; --surface-hover:#222d40; --line:#263042; --line-strong:#3b4659;
  --text:#e5e9f0; --muted:#aab4c3; --subtle:#8b96a8; --placeholder:#5f6b7e;
  --accent:#5b8cff; --accent-hover:#7aa2ff; --accent-soft:#15213d; --accent-line:#2c4277; --on-accent:#0b1120; --accent-ink:#a9c2ff; --hl:#1e1c14;
}

/* ───── 초록 — 푸른 기 도는 회색 + 에메랄드 ───── */
:root[data-palette="green"]{
  --bg:#f4f8f6; --surface:#ffffff; --surface-2:#ecf3ef; --surface-hover:#e2ece6; --line:#dae6df; --line-strong:#bfd2c6;
  --text:#10201a; --muted:#42564c; --subtle:#5b6f65; --placeholder:#93a59b;
  --accent:#0b7d55; --accent-hover:#086645; --accent-soft:#e8f6ef; --accent-line:#b4e2cc; --on-accent:#ffffff; --accent-ink:#0b5e41; --hl:#fffdf2;
}
:root[data-palette="green"][data-theme="dark"]{
  --bg:#0b1210; --surface:#111a17; --surface-2:#18231f; --surface-hover:#1f2d28; --line:#24332d; --line-strong:#3a4d45;
  --text:#e3eee9; --muted:#a7bab1; --subtle:#879a91; --placeholder:#5c6e66;
  --accent:#34c88f; --accent-hover:#52d6a2; --accent-soft:#11281f; --accent-line:#23523f; --on-accent:#06140f; --accent-ink:#9be6c5; --hl:#1c1f14;
}

/* ───── 보라 — 보랏빛 회색 + 바이올렛 ───── */
:root[data-palette="violet"]{
  --bg:#f7f6fb; --surface:#ffffff; --surface-2:#f1eff8; --surface-hover:#e8e5f2; --line:#e3e0ee; --line-strong:#cbc6dd;
  --text:#17142a; --muted:#4c4766; --subtle:#645f7d; --placeholder:#9d98b3;
  --accent:#6d4ae0; --accent-hover:#5a39c6; --accent-soft:#f2eeff; --accent-line:#d6ccfb; --on-accent:#ffffff; --accent-ink:#4b2fb0; --hl:#fffdf5;
}
:root[data-palette="violet"][data-theme="dark"]{
  --bg:#0f0d18; --surface:#161321; --surface-2:#1e1a2c; --surface-hover:#262137; --line:#2b263b; --line-strong:#433c58;
  --text:#ebe8f5; --muted:#b4aeca; --subtle:#958fac; --placeholder:#655f7c;
  --accent:#a48bff; --accent-hover:#b8a3ff; --accent-soft:#221a3f; --accent-line:#3f3275; --on-accent:#120c26; --accent-ink:#cfc2ff; --hl:#1f1c14;
}

/* ───── 장미 — 붉은 기 도는 회색 + 장미색 ───── */
:root[data-palette="rose"]{
  --bg:#fbf6f6; --surface:#ffffff; --surface-2:#f6eeee; --surface-hover:#efe3e4; --line:#ecdfe0; --line-strong:#d8c4c6;
  --text:#241416; --muted:#5c4649; --subtle:#765e61; --placeholder:#ab9799;
  --accent:#d6336c; --accent-hover:#b82659; --accent-soft:#fdeef3; --accent-line:#f7c6d6; --on-accent:#ffffff; --accent-ink:#9c1d4a; --hl:#fffbf2;
}
:root[data-palette="rose"][data-theme="dark"]{
  --bg:#140e10; --surface:#1c1416; --surface-2:#251b1e; --surface-hover:#2e2226; --line:#33262a; --line-strong:#4d3b40;
  --text:#f2e8ea; --muted:#c3b0b4; --subtle:#a38f93; --placeholder:#6f5e62;
  --accent:#ff6b9a; --accent-hover:#ff8aae; --accent-soft:#36151f; --accent-line:#6a2a40; --on-accent:#1a0a10; --accent-ink:#ffb3c9; --hl:#201c13;
}

/* ───── 먹색 — 색 없는 회색 + 검정/흰 강조 ───── */
:root[data-palette="mono"]{
  --bg:#f5f5f5; --surface:#ffffff; --surface-2:#efefef; --surface-hover:#e6e6e6; --line:#e2e2e2; --line-strong:#c8c8c8;
  --text:#141414; --muted:#4a4a4a; --subtle:#666666; --placeholder:#9a9a9a;
  --accent:#222222; --accent-hover:#000000; --accent-soft:#ededed; --accent-line:#cfcfcf; --on-accent:#ffffff; --accent-ink:#222222; --hl:#fffcf0;
}
:root[data-palette="mono"][data-theme="dark"]{
  --bg:#0e0e0e; --surface:#161616; --surface-2:#1e1e1e; --surface-hover:#262626; --line:#2a2a2a; --line-strong:#444444;
  --text:#ececec; --muted:#b8b8b8; --subtle:#949494; --placeholder:#666666;
  --accent:#f2f2f2; --accent-hover:#ffffff; --accent-soft:#262626; --accent-line:#444444; --on-accent:#111111; --accent-ink:#ffffff; --hl:#1f1d16;
}

/* ───── 이어 받기 — 씨앗에서 base.css(앱)·auth.css(로그인) 토큰을 만든다 ───── */
:root[data-palette]{
  /* 앱 화면 (base.css) — 강조색 이름이 --gold 인 것은 처음 앱(하오문)에서 온 이름이라서. 테마에 따라 파랑·초록도 된다 */
  --surface-raised:var(--surface-2); --ink:var(--text); --ink-muted:var(--subtle);
  --gold:var(--accent); --gold-soft:var(--accent-soft); --on-gold:var(--on-accent);
  --focus-ring:0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  /* 로그인·계정 화면 (auth.css) */
  --primary:var(--accent); --primary-hover:var(--accent-hover); --primary-soft:var(--accent-soft); --primary-line:var(--accent-line);
  --on-primary:var(--on-accent); --info-ink:var(--accent-ink); --focus:var(--accent);
  /* 상태색 — 밝게 */
  --danger:#dc2626; --danger-soft:#fef2f2; --danger-line:#fecaca; --danger-ink:#991b1b;
  --ok:#16a34a; --ok-soft:#f0fdf4; --ok-line:#bbf7d0; --ok-ink:#166534;
  --warn:#b45309; --warn-soft:#fffbeb; --warn-line:#fde68a; --warn-ink:#92400e;
  --good:#16a34a; --bad:#dc2626; --up:#bd1e1e; --up-soft:#fde4e2; --down:#1d5fd0; --down-soft:#e1ecfd;
  --admin:#4338ca; --admin-soft:#eef2ff;
  color-scheme:light;
}
:root[data-palette][data-theme="dark"]{
  --danger:#ff6b66; --danger-soft:#2d1717; --danger-line:#6b2b2a; --danger-ink:#ffb3b0;
  --ok:#4fcf85; --ok-soft:#12251a; --ok-line:#28553a; --ok-ink:#9de3b8;
  --warn:#ffab40; --warn-soft:#2a1f10; --warn-line:#5c4420; --warn-ink:#ffd08a;
  --good:#4fcf85; --bad:#ff6b66; --up:#ff6b66; --up-soft:#3a1a1a; --down:#5ea5ff; --down-soft:#14253d;
  --admin:#c9a2ff; --admin-soft:#261c38;
  color-scheme:dark;
}

/* ───── 테마 고르기 창 (web/js/shell.js 의 테마 단추) ───── */
.theme-pick h3{margin:0 40px 4px 0}
.theme-pick .theme-sub{margin:0 0 var(--space-3, 12px);color:var(--ink-muted);font-size:12px}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,140px),1fr));gap:8px;min-width:min(480px,80vw)}
.theme-opt{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;cursor:pointer;text-align:left}
.theme-opt:hover{border-color:var(--line-strong)}
.theme-opt[aria-pressed="true"]{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.theme-dot{flex:none;width:22px;height:22px;border-radius:50%;border:1px solid var(--line-strong);background:var(--c)}
.theme-modes{display:flex;gap:8px;margin-top:var(--space-3, 12px)}
.theme-modes .theme-opt{flex:1;justify-content:center}
