/* 잇다 테마 토큰 — 라이트(낮 노선도) / 다크(밤 노선도)
   html[data-theme="light"|"dark"]가 없으면 시스템 설정을 따른다.
   역할 이름으로만 쓴다. 화면 파일에 색 값을 직접 쓰지 않는다(근거 노선 잉크·카카오 노랑 제외). */

:root {
  color-scheme: light;
  accent-color: var(--focus); /* 기본 체크박스·라디오 */
  /* 셸: 레일·마스트헤드·첫 화면·강조 섹션 */
  --shell: #FFFFFF;
  --shell-2: #F4F6FB;
  --shell-3: #E9EDF6;
  --shell-fg: #0B1230;
  --shell-fg-2: #47517A;
  --shell-rule: #D9DFEC;
  /* 읽기 판 */
  --ground: #EEF1F8;
  --surface: #FFFFFF;
  --surface-2: #F6F8FC;
  --rule: #D9DFEC;
  --rule-strong: #8A93B5;   /* 입력칸 테두리, 3:1 이상 */
  --ink: #0B1230;
  --ink-2: #47517A;
  --ink-3: #5B658C;
  /* 주 버튼(판 위·셸 위 공통) */
  --btn: #0B1230;
  --btn-fg: #F6F7FB;
  --btn-hover: #1B2858;
  /* 근거 노선 잉크(선): 두 모드 같음 */
  --l-inflow: #E3264F;
  --l-beacon: #3D72FF;
  --l-member: #22A85A;
  --l-code: #9B6CFF;
  --l-npay: #F5C518;
  --l-none: #7A84A9;        /* 라이트: 흰 판 위 3:1 이상(그래픽) */
  --line-casing: rgba(11, 18, 48, .55); /* 흰 바탕에서 노란 선 외곽선(선 폭 + 3px) */
  /* 근거 노선 글자색(라벨): 바탕 대비 4.5:1 이상 */
  --lt-inflow: #C8143E;
  --lt-beacon: #2456D6;
  --lt-member: #12763D;
  --lt-code: #7A45E0;
  --lt-npay: #7C5E00;
  --lt-none: #5B658C;
  /* 역·환승역·종착 판 */
  --stn-fill: #FFFFFF;
  --stn-stroke: #0B1230;
  --hub-fill: #FFFFFF;
  --hub-stroke: #0B1230;
  --plate: #FFFFFF;
  --plate-fg: #0B1230;
  --plate-stroke: #0B1230;
  --grid-line: rgba(11, 18, 48, .05);
  /* 상태(색 + 모양 + 글자) */
  --ok: #0F6E3C;     --ok-bg: #DFF2E7;
  --hold: #6E4B00;   --hold-bg: #FFEFBF;
  --none: #47517A;   --none-bg: #E6E9F2;
  --deduct: #B0123B; --deduct-bg: #FCE4EA;
  --focus: #3D72FF;
  --scrim: rgba(11, 18, 48, .45);
  --shadow: 0 10px 28px -14px rgba(11, 18, 48, .35);
  --kakao: #FEE500;
  --radius: 8px;
}

/* 다크(밤 노선도): 명시 선택 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --shell: #0B1230;
  --shell-2: #121C44;
  --shell-3: #1B2858;
  --shell-fg: #F6F7FB;
  --shell-fg-2: #AEB7DA;
  --shell-rule: rgba(214, 222, 255, .16);
  --ground: #0F1736;
  --surface: #151F48;
  --surface-2: #1C2856;
  --rule: #26335F;
  --rule-strong: #6A79AA;
  --ink: #F2F4FA;
  --ink-2: #B4BCDD;
  --ink-3: #8F99BF;
  --btn: #F6F7FB;
  --btn-fg: #0B1230;
  --btn-hover: #FFFFFF;
  --line-casing: transparent;
  --l-none: #8C95B8;
  --lt-inflow: #FF7A93;
  --lt-beacon: #8DACFF;
  --lt-member: #5CCB8A;
  --lt-code: #B99BFF;
  --lt-npay: #F5C518;
  --lt-none: #AEB7DA;
  --stn-fill: #F6F7FB;
  --stn-stroke: #0B1230;
  --hub-fill: #0B1230;
  --hub-stroke: #F6F7FB;
  --plate: #F6F7FB;
  --plate-fg: #0B1230;
  --plate-stroke: #0B1230;
  --grid-line: rgba(214, 222, 255, .05);
  --ok: #7EDDA5;     --ok-bg: #12352A;
  --hold: #F7D26A;   --hold-bg: #3A3110;
  --none: #C3CADF;   --none-bg: #232E58;
  --deduct: #FF8FA6; --deduct-bg: #3D1530;
  --focus: #9DB8FF;
  --scrim: rgba(3, 6, 18, .7);
  --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7);
}

/* 다크: 시스템 설정(명시 선택이 없을 때) — 위 블록과 값이 같아야 한다 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --shell: #0B1230;
    --shell-2: #121C44;
    --shell-3: #1B2858;
    --shell-fg: #F6F7FB;
    --shell-fg-2: #AEB7DA;
    --shell-rule: rgba(214, 222, 255, .16);
    --ground: #0F1736;
    --surface: #151F48;
    --surface-2: #1C2856;
    --rule: #26335F;
    --rule-strong: #6A79AA;
    --ink: #F2F4FA;
    --ink-2: #B4BCDD;
    --ink-3: #8F99BF;
    --btn: #F6F7FB;
    --btn-fg: #0B1230;
    --btn-hover: #FFFFFF;
    --line-casing: transparent;
  --l-none: #8C95B8;
    --lt-inflow: #FF7A93;
    --lt-beacon: #8DACFF;
    --lt-member: #5CCB8A;
    --lt-code: #B99BFF;
    --lt-npay: #F5C518;
    --lt-none: #AEB7DA;
    --stn-fill: #F6F7FB;
    --stn-stroke: #0B1230;
    --hub-fill: #0B1230;
    --hub-stroke: #F6F7FB;
    --plate: #F6F7FB;
    --plate-fg: #0B1230;
    --plate-stroke: #0B1230;
    --grid-line: rgba(214, 222, 255, .05);
    --ok: #7EDDA5;     --ok-bg: #12352A;
    --hold: #F7D26A;   --hold-bg: #3A3110;
    --none: #C3CADF;   --none-bg: #232E58;
    --deduct: #FF8FA6; --deduct-bg: #3D1530;
    --focus: #9DB8FF;
    --scrim: rgba(3, 6, 18, .7);
    --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7);
  }
}

/* 테마 전환 버튼(시스템·라이트·다크) — 셸 위에 놓는다 */
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--shell-2); border: 1px solid var(--shell-rule); }
.theme-switch button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--shell-fg-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.theme-switch button:hover { color: var(--shell-fg); }
.theme-switch button[aria-pressed="true"] { background: var(--shell); color: var(--shell-fg); box-shadow: 0 0 0 1px var(--shell-rule); }
.theme-switch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
