/* 디자인 토큰. 라이트(:root)와 다크(@media + [data-theme="dark"]) 두 곳에 모두 정의한다.
   [data-theme="light"] 는 시스템이 다크여도 라이트를 강제한다. */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eceff4;
  --text: #1b1f27;
  --text-muted: #566070;
  --border: #d3d8e0;
  --accent: #1f5fbf;
  --accent-contrast: #ffffff;
  --accent-soft: #e3edfb;
  --focus: #1f5fbf;
  --tour-bg: #faf4c0; --tour-btn: #cefbc9; --tour-fg: #1b1f27; /* 자동 학습 설명창: 라이트·다크 같은 색 */
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.12), 0 4px 12px rgba(20, 30, 50, 0.08);

  --tone-neutral-fg: #3f4856;  --tone-neutral-bg: #e9ecf1;
  --tone-info-fg: #0b4f9c;     --tone-info-bg: #e0eefd;
  --tone-success-fg: #14622f;  --tone-success-bg: #dff3e5;
  --tone-warn-fg: #7a4a00;     --tone-warn-bg: #fdf0d3;
  --tone-danger-fg: #a01f2d;   --tone-danger-bg: #fbe3e5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12151b;
    --surface: #1a1f28;
    --surface-2: #232a35;
    --text: #e8ebf0;
    --text-muted: #a3acba;
    --border: #343c4a;
    --accent: #6ea8ff;
    --accent-contrast: #0b1220;
    --accent-soft: #1d2d4a;
    --focus: #8fbbff;
    --tour-bg: #faf4c0; --tour-btn: #cefbc9; --tour-fg: #1b1f27; /* 자동 학습 설명창: 라이트·다크 같은 색 */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);

    --tone-neutral-fg: #c3cad6;  --tone-neutral-bg: #2a313d;
    --tone-info-fg: #9cc7ff;     --tone-info-bg: #17304f;
    --tone-success-fg: #8fdba7;  --tone-success-bg: #17361f;
    --tone-warn-fg: #f2c46d;     --tone-warn-bg: #3d2d0c;
    --tone-danger-fg: #ff9aa5;   --tone-danger-bg: #4a1a20;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12151b;
  --surface: #1a1f28;
  --surface-2: #232a35;
  --text: #e8ebf0;
  --text-muted: #a3acba;
  --border: #343c4a;
  --accent: #6ea8ff;
  --accent-contrast: #0b1220;
  --accent-soft: #1d2d4a;
  --focus: #8fbbff;
  --tour-bg: #faf4c0; --tour-btn: #cefbc9; --tour-fg: #1b1f27; /* 자동 학습 설명창: 라이트·다크 같은 색 */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);

  --tone-neutral-fg: #c3cad6;  --tone-neutral-bg: #2a313d;
  --tone-info-fg: #9cc7ff;     --tone-info-bg: #17304f;
  --tone-success-fg: #8fdba7;  --tone-success-bg: #17361f;
  --tone-warn-fg: #f2c46d;     --tone-warn-bg: #3d2d0c;
  --tone-danger-fg: #ff9aa5;   --tone-danger-bg: #4a1a20;
}

/* 모드와 무관한 치수·글꼴 토큰 */
:root {
  --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-sm: 0.8125rem;
  --fs: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --radius: 8px;
  --touch: 44px;
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --tabbar-h: 56px;
}
