/* ============================================================
   투두메이트 디자인 토큰 — 색·크기·곡률의 유일한 정의 위치

   다른 CSS 는 여기 값을 var() 로만 쓴다. 예전에는 style → experience → atelier
   → daybook 가 같은 변수를 네 번 덮어써서, 어느 값이 실제로 이기는지 파일을 다
   열어 봐야 알 수 있었다. 이 파일의 값은 그 최종 결과를 그대로 옮긴 것이다.

   색은 팔레트(무료 6 + 프리미엄 6) × 밝기(2) 표로만 바뀐다. theme.js 가 <html> 에 data-palette,
   data-theme 을 붙인다. JS 가 돌기 전 첫 페인트는 data-* 가 없으므로
   포레스트를 기본값으로 두고, 시스템이 다크면 포레스트 다크를 쓴다.
   ============================================================ */

/* ── 스케일 (테마와 무관) ───────────────────────────────────
   글자 크기는 6단계뿐이다. 9·10·11px 글자가 폰에서 읽히지 않아 가장 작은 단계를 12px 로 잡았다.
   한 화면에 크기가 늘어날수록 위계가 흐려지므로, 새 크기가 필요해 보이면 먼저 이 중에서 고른다.
   굵기는 2단계: 번들 폰트(Pretendard 서브셋)가 400·700 파일만 있어서
   500~650 을 적어도 실제로는 400 이나 700 으로 그려진다. 적힌 값과 보이는 값을 맞춘 것이다. */
:root{
  --fs-xs:12px;   /* 배지·요일·보조 메타 */
  --fs-sm:13px;   /* 보조 글, 버튼 라벨 */
  --fs-md:15px;   /* 본문·목록 제목 */
  --fs-lg:17px;   /* 섹션 제목 */
  --fs-xl:20px;   /* 시트 제목 */
  --fs-2xl:24px;  /* 화면 제목 (달력 월, 할 일 탭 제목) */
  --fw-regular:400;
  --fw-bold:700;
  /* 곡률: 작은 장식(xs) · 칩·버튼(sm) · 카드·입력(md) · 시트·큰 패널(lg) · 알약(pill) */
  --r-xs:4px;
  --r-sm:8px;
  --r-md:12px;
  --r-lg:16px;
  --r-pill:999px;
  --base:200ms;
  --ease:cubic-bezier(0.2, 0, 0.1, 1);
  --fast:120ms;
  --check-hold:320ms; /* 완료 체크를 보여 주고 목록에서 빼기까지. checkHold.js CHECK_HOLD_MS 와 같아야 한다 */
  --s1:4px;
  --s2:8px;
  --s3:12px;
  --s4:16px;
  --s5:20px;
  --s6:24px;
  --s8:32px;
  --s10:40px;
  --safe-b:env(safe-area-inset-bottom, 0px);
}

/* ── 색: 포레스트 라이트 = 기본값 ──────────────────────────────
   카드가 바탕 위에 떠 보이는지는 --bg 와 --surface 의 명도 차가 정한다.
   완료 카드(--surface-2)는 진행 중 카드(--surface)보다 도드라지면 안 된다. */
:root{
  --accent:#285e4c;
  --accent-hover:#194b3a;
  --accent-weak:#e9f0e8;
  --on-accent:#fff;
  --bg:#f4f5f1;
  --surface:#fff;
  --surface-2:#f1f3ed;
  --surface-3:#e8ece5;
  --line:#e6ebe5;
  --line-strong:#cbd7ce;
  --text:#1d2c29;
  --text-2:#56665e;
  /* 3단계 글자는 12px 로 많이 쓰여 연한 카드(--surface-2) 위에서도 4.5:1 을 넘겨야 한다. 4.17 이었다(2026-10-30 대비 검사). */
  --text-3:#606f66;
  /* 달력 요일 글자: 일요일·토요일. 12px 굵은 날짜가 연한 달력 바탕(--accent-weak) 위에 놓여 3.6:1 이었다 — 색상은 두고 명도만 낮췄다. */
  --sun:#9c574d;
  --sat:#506c8f;
  --danger:#ad5040;
  --danger-weak:#f9ede8;
  --lime:#d8edb1;
  --ok:#2f6b50;
  --ok-weak:#e9f2e9;
  --shared:#3c6b51;
  --shared-weak:#edf3e9;
  --warn:#8a5a00;
  --warn-weak:#fff2d8;
  --cal-me:#416895;
  --cal-me-bg:#eaf1fa;
  --cal-partner:#a16a4c;
  --cal-partner-bg:#f8ede4;
  --cal-private:#7b62a0;
  --cal-private-bg:#f0ebf7;
  --cal-together:#2a6b53;
  --cal-together-bg:#e5f1e9;
  --cat-0:#737c8a;
  --cat-1:#d9552f;
  --cat-2:#17924f;
  --cat-3:#2f6bf0;
  --cat-4:#8b46d6;
  --cat-5:#c07a12;
  --cat-6:#d63a7c;
  --cat-7:#0f8e9e;
  --cat-green:#4b805b;
  --cat-orange:#ad7945;
  --cat-purple:#6978a6;
  --hero:#214b3d;
  --hero-muted:#c2d7ca;
  --hero-progress:#d8edb1;
  --hero-text:#f5f7ee;
  --hero-track:#527163;
  --daybook-shadow:0 3px 14px #18332905;
  --shadow-1:0 1px 2px rgba(16, 22, 38, 0.05);
  --shadow-2:0 16px 56px #1a392510;
  --shadow-up:0 -1px 0 var(--line), 0 -8px 24px rgba(16, 22, 38, 0.06);
  --shadow-sheet:0 -4px 16px #1833290f;
}

/* 라벤더 */
:root[data-palette=lavender]{
  --accent:#6958a6;
  --accent-hover:#51408f;
  --accent-weak:#f0edf7;
  --bg:#f5f4f8;
  --surface-2:#f3f1f8;
  --line-strong:#d4cce0;
  --text:#302b3f;
  --text-2:#61596d;
  --text-3:#73697f;
  --hero:#493d68;
  --hero-muted:#d7cce7;
  --hero-progress:#ddd0f1;
  --hero-track:#77668f;
}

/* 클레이 */
:root[data-palette=clay]{
  --accent:#99583f;
  --accent-hover:#814831;
  --accent-weak:#f8ede5;
  --bg:#f8f4ef;
  --surface-2:#f5eee8;
  --line-strong:#decec0;
  --text:#352d27;
  --text-2:#6a5b52;
  --text-3:#7a685c;
  --hero:#704733;
  --hero-muted:#e6d2c0;
  --hero-progress:#f0d7ae;
  --hero-track:#99705b;
}

/* 오션 */
:root[data-palette=ocean]{
  --accent:#285e86;
  --accent-hover:#19496e;
  --accent-weak:#e7eff7;
  --bg:#f2f6f9;
  --surface-2:#edf3f8;
  --surface-3:#e1eaf2;
  --line:#dde6ed;
  --line-strong:#b5c8d6;
  --text:#20303e;
  --text-2:#516575;
  --text-3:#5a6d7d;
  --hero:#254d6b;
  --hero-muted:#c6dbe9;
  --hero-progress:#c4e3f4;
  --hero-track:#557991;
}

/* 로즈 */
:root[data-palette=rose]{
  --accent:#914e69;
  --accent-hover:#783951;
  --accent-weak:#f7eaf0;
  --bg:#faf4f6;
  --surface-2:#f8eef2;
  --surface-3:#efe1e7;
  --line:#ecdee5;
  --line-strong:#d5bac7;
  --text:#38262f;
  --text-2:#725865;
  --text-3:#816574;
  --hero:#713e52;
  --hero-muted:#efd0dc;
  --hero-progress:#f1cadb;
  --hero-track:#9c6a7e;
}

/* 그라파이트 */
:root[data-palette=graphite]{
  --accent:#454d57;
  --accent-hover:#303740;
  --accent-weak:#e9ecf0;
  --bg:#f4f5f6;
  --surface-2:#eef0f3;
  --surface-3:#e2e5e9;
  --line:#e0e4e9;
  --line-strong:#bac3ce;
  --text:#252b33;
  --text-2:#59626e;
  --text-3:#626b77;
  --hero:#353e48;
  --hero-muted:#d1d7de;
  --hero-progress:#dce2e8;
  --hero-track:#65707d;
}

/* ── 다크 ────────────────────────────────────────────────────
   어두운 바탕에서는 같은 색이 탁해 보여 명도를 올려 다시 잡는다.
   아래 두 블록은 같은 값이다: JS 전 첫 페인트(시스템 다크)와 설정의 '어둡게'.
   light-dark() 는 구형 WebView 에서 글자가 사라지는 하드 페일이라 쓰지 않는다. */
@media (prefers-color-scheme: dark){
:root:not([data-theme]){
  --accent:#b7d8bd;
  --accent-hover:#cee8d2;
  --accent-weak:#2b4034;
  --on-accent:#1a2c22;
  --bg:#141d1a;
  --surface:#1e2925;
  --surface-2:#27332c;
  --surface-3:#354039;
  --line:#34413a;
  --line-strong:#506255;
  --text:#edf3ed;
  --text-2:#bdcac1;
  --text-3:#a9b8ae;
  --sun:#efa99b;
  --sat:#a9c9f1;
  --danger:#efab95;
  --danger-weak:#423229;
  --lime:#65724e;
  --ok:#b0d2b4;
  --ok-weak:#2a3e2d;
  --shared:#8cc7ba;
  --shared-weak:#2b3b2c;
  --warn:#f0b661;
  --warn-weak:#2e2412;
  --cal-me:#a6c8f0;
  --cal-me-bg:#25364b;
  --cal-partner:#f0c3a6;
  --cal-partner-bg:#473a30;
  --cal-private:#d4b9f4;
  --cal-private-bg:#393046;
  --cal-together:#acdec4;
  --cal-together-bg:#253e32;
  --cat-0:#a4acb9;
  --cat-1:#ff8f6b;
  --cat-2:#4fc98a;
  --cat-3:#ee9278;
  --cat-4:#c197f5;
  --cat-5:#f0b661;
  --cat-6:#f58bb7;
  --cat-7:#4fc9d9;
  --hero:#254d3b;
  --hero-muted:#c3d7c5;
  --hero-progress:#d2e6aa;
  --hero-text:#f1f5e9;
  --hero-track:#557564;
  --daybook-shadow:none;
  --shadow-1:0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2:0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-up:0 -1px 0 var(--line), 0 -8px 24px rgba(0, 0, 0, 0.45);
  --shadow-sheet:none;
}
}
:root[data-theme=dark]{
  --accent:#b7d8bd;
  --accent-hover:#cee8d2;
  --accent-weak:#2b4034;
  --on-accent:#1a2c22;
  --bg:#141d1a;
  --surface:#1e2925;
  --surface-2:#27332c;
  --surface-3:#354039;
  --line:#34413a;
  --line-strong:#506255;
  --text:#edf3ed;
  --text-2:#bdcac1;
  --text-3:#a9b8ae;
  --sun:#efa99b;
  --sat:#a9c9f1;
  --danger:#efab95;
  --danger-weak:#423229;
  --lime:#65724e;
  --ok:#b0d2b4;
  --ok-weak:#2a3e2d;
  --shared:#8cc7ba;
  --shared-weak:#2b3b2c;
  --warn:#f0b661;
  --warn-weak:#2e2412;
  --cal-me:#a6c8f0;
  --cal-me-bg:#25364b;
  --cal-partner:#f0c3a6;
  --cal-partner-bg:#473a30;
  --cal-private:#d4b9f4;
  --cal-private-bg:#393046;
  --cal-together:#acdec4;
  --cal-together-bg:#253e32;
  --cat-0:#a4acb9;
  --cat-1:#ff8f6b;
  --cat-2:#4fc98a;
  --cat-3:#ee9278;
  --cat-4:#c197f5;
  --cat-5:#f0b661;
  --cat-6:#f58bb7;
  --cat-7:#4fc9d9;
  --hero:#254d3b;
  --hero-muted:#c3d7c5;
  --hero-progress:#d2e6aa;
  --hero-text:#f1f5e9;
  --hero-track:#557564;
  --daybook-shadow:none;
  --shadow-1:0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2:0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-up:0 -1px 0 var(--line), 0 -8px 24px rgba(0, 0, 0, 0.45);
  --shadow-sheet:none;
}

/* 라벤더 다크 */
:root[data-theme=dark][data-palette=lavender]{
  --accent:#d3c0f0;
  --accent-hover:#e4d4fa;
  --accent-weak:#3b334d;
  --on-accent:#282035;
  --bg:#1b1823;
  --surface:#272231;
  --surface-2:#302a3c;
  --surface-3:#3b3349;
  --line:#41384f;
  --line-strong:#675974;
  --text:#f0ebf7;
  --text-2:#cbc0d9;
  --text-3:#b5a8c6;
  --hero:#45345a;
  --hero-muted:#d9cce4;
  --hero-progress:#decbf1;
  --hero-track:#715b88;
}

/* 클레이 다크 */
:root[data-theme=dark][data-palette=clay]{
  --accent:#ebc1a8;
  --accent-hover:#f5d3bc;
  --accent-weak:#49382d;
  --on-accent:#342317;
  --bg:#211b17;
  --surface:#2e251f;
  --surface-2:#382c24;
  --surface-3:#44362c;
  --line:#4b3c31;
  --line-strong:#73604f;
  --text:#f7eee6;
  --text-2:#d9c7b8;
  --text-3:#c3ad9a;
  --hero:#644733;
  --hero-muted:#e1d4bc;
  --hero-progress:#ead4ab;
  --hero-track:#917052;
}

/* 오션 다크 */
:root[data-theme=dark][data-palette=ocean]{
  --accent:#abd4f2;
  --accent-hover:#d0e9fc;
  --accent-weak:#2b4256;
  --on-accent:#182d3f;
  --bg:#151d25;
  --surface:#202c37;
  --surface-2:#293847;
  --surface-3:#344658;
  --line:#394b5b;
  --line-strong:#597185;
  --text:#edf4fa;
  --text-2:#bfcede;
  --text-3:#a6bdd0;
  --hero:#24415a;
  --hero-muted:#c4dbea;
  --hero-progress:#b8dff5;
  --hero-track:#526f87;
}

/* 로즈 다크 */
:root[data-theme=dark][data-palette=rose]{
  --accent:#f0b7ce;
  --accent-hover:#ffd5e5;
  --accent-weak:#4c3040;
  --on-accent:#3b2030;
  --bg:#23191e;
  --surface:#31242b;
  --surface-2:#3e2c35;
  --surface-3:#4b3541;
  --line:#513b47;
  --line-strong:#795c6b;
  --text:#fbecf3;
  --text-2:#dfc3d0;
  --text-3:#c8a8b8;
  --hero:#593346;
  --hero-muted:#e7c7d5;
  --hero-progress:#f2c5d8;
  --hero-track:#87566d;
}

/* 그라파이트 다크 */
:root[data-theme=dark][data-palette=graphite]{
  --accent:#ccd7e3;
  --accent-hover:#e5edf6;
  --accent-weak:#384553;
  --on-accent:#25323f;
  --bg:#191c20;
  --surface:#24292f;
  --surface-2:#30363e;
  --surface-3:#3d454f;
  --line:#414b57;
  --line-strong:#647180;
  --text:#f1f3f6;
  --text-2:#c9d0d9;
  --text-3:#afb9c7;
  --hero:#384450;
  --hero-muted:#d2dce6;
  --hero-progress:#dce5ee;
  --hero-track:#687889;
}

/* 민트 (프리미엄) */
:root[data-palette=mint]{
  --accent:#3a6c66;
  --accent-hover:#26554e;
  --accent-weak:#e1f2f0;
  --bg:#f0f5f5;
  --surface-2:#eaf5f3;
  --line-strong:#bad5d1;
  --text:#21302e;
  --text-2:#4e605e;
  --text-3:#5d716e;
  --hero:#2b4945;
  --hero-muted:#aed9d3;
  --hero-progress:#9fe2da;
  --hero-track:#52736f;
}

/* 민트 다크 (프리미엄) */
:root[data-theme=dark][data-palette=mint]{
  --accent:#66dbcb;
  --accent-hover:#71eede;
  --accent-weak:#273a38;
  --on-accent:#172724;
  --bg:#131b1a;
  --surface:#1b2725;
  --surface-2:#212f2e;
  --surface-3:#293a38;
  --line:#2d403d;
  --line-strong:#4c635f;
  --text:#ddf2ef;
  --text-2:#aacbc7;
  --text-3:#8eb5af;
  --hero:#25403d;
  --hero-muted:#b4d8d3;
  --hero-progress:#8fe1d6;
  --hero-track:#476a66;
}

/* 해바라기 (프리미엄) */
:root[data-palette=sunflower]{
  --accent:#71623a;
  --accent-hover:#594c26;
  --accent-weak:#f3eee2;
  --bg:#f6f5f0;
  --surface-2:#f5f2e9;
  --line-strong:#d7cfbb;
  --text:#322e21;
  --text-2:#615d4f;
  --text-3:#726c5d;
  --hero:#4c442b;
  --hero-muted:#dbd0b0;
  --hero-progress:#e6d5a4;
  --hero-track:#766c53;
}

/* 해바라기 다크 (프리미엄) */
:root[data-theme=dark][data-palette=sunflower]{
  --accent:#e2c677;
  --accent-hover:#f4d98c;
  --accent-weak:#3c3727;
  --on-accent:#282317;
  --bg:#1c1a13;
  --surface:#28241b;
  --surface-2:#312c21;
  --surface-3:#3b3729;
  --line:#413c2d;
  --line-strong:#655e4c;
  --text:#f2ecdd;
  --text-2:#cdc4ab;
  --text-3:#b7ad8f;
  --hero:#433b25;
  --hero-muted:#dad1b7;
  --hero-progress:#e6d198;
  --hero-track:#6e6448;
}

/* 미드나잇 (프리미엄) */
:root[data-palette=navy]{
  --accent:#4f619f;
  --accent-hover:#374a86;
  --accent-weak:#eceff7;
  --bg:#f3f4f8;
  --surface-2:#f0f1f8;
  --line-strong:#cacfe1;
  --text:#292d3e;
  --text-2:#575c6d;
  --text-3:#676c7f;
  --hero:#384265;
  --hero-muted:#c9d1e8;
  --hero-progress:#ccd4f2;
  --hero-track:#626d8e;
}

/* 미드나잇 다크 (프리미엄) */
:root[data-theme=dark][data-palette=navy]{
  --accent:#bbc8f2;
  --accent-hover:#d0dafc;
  --accent-weak:#30364c;
  --on-accent:#1e2435;
  --bg:#171a23;
  --surface:#202431;
  --surface-2:#282c3b;
  --surface-3:#313649;
  --line:#363b4e;
  --line-strong:#575e74;
  --text:#e9edf7;
  --text-2:#bec4da;
  --text-3:#a5acc6;
  --hero:#313a5a;
  --hero-muted:#cad0e5;
  --hero-progress:#c7d1f3;
  --hero-track:#586388;
}

/* 올리브 (프리미엄) */
:root[data-palette=olive]{
  --accent:#5f6939;
  --accent-hover:#485126;
  --accent-weak:#edf0e0;
  --bg:#f4f6f0;
  --surface-2:#f1f3e9;
  --line-strong:#cdd2b8;
  --text:#2d2f21;
  --text-2:#5b5f4e;
  --text-3:#6b6f5d;
  --hero:#41462b;
  --hero-muted:#ccd5aa;
  --hero-progress:#cedd94;
  --hero-track:#6a7152;
}

/* 올리브 다크 (프리미엄) */
:root[data-theme=dark][data-palette=olive]{
  --accent:#bbd358;
  --accent-hover:#cae757;
  --accent-weak:#353927;
  --on-accent:#222517;
  --bg:#191b13;
  --surface:#23251b;
  --surface-2:#2c2e21;
  --surface-3:#353928;
  --line:#3a3e2c;
  --line-strong:#5c604b;
  --text:#ebefda;
  --text-2:#c1c8a6;
  --text-3:#aab28b;
  --hero:#393e25;
  --hero-muted:#cdd5b1;
  --hero-progress:#c9db82;
  --hero-track:#616847;
}

/* 코랄 (프리미엄) */
:root[data-palette=coral]{
  --accent:#8e5549;
  --accent-hover:#763d32;
  --accent-weak:#f6eceb;
  --bg:#f7f4f3;
  --surface-2:#f7f0ef;
  --line-strong:#decbc8;
  --text:#3a2a27;
  --text-2:#695855;
  --text-3:#7b6965;
  --hero:#5d3b35;
  --hero-muted:#e5cbc6;
  --hero-progress:#f0cec7;
  --hero-track:#87655f;
}

/* 코랄 다크 (프리미엄) */
:root[data-theme=dark][data-palette=coral]{
  --accent:#efbcb2;
  --accent-hover:#fad2c9;
  --accent-weak:#47322e;
  --on-accent:#30201c;
  --bg:#201816;
  --surface:#2e211f;
  --surface-2:#382a27;
  --surface-3:#44332f;
  --line:#4a3734;
  --line-strong:#705955;
  --text:#f6ebe8;
  --text-2:#d7c0bb;
  --text-3:#c3a7a2;
  --hero:#52342e;
  --hero-muted:#e3ccc7;
  --hero-progress:#f0cac2;
  --hero-track:#805c54;
}

/* 플럼 (프리미엄) */
:root[data-palette=plum]{
  --accent:#8a4f8a;
  --accent-hover:#713771;
  --accent-weak:#f6ebf6;
  --bg:#f7f4f7;
  --surface-2:#f7eff7;
  --line-strong:#ddcadd;
  --text:#392939;
  --text-2:#685768;
  --text-3:#7a677a;
  --hero:#5a385a;
  --hero-muted:#e3c9e3;
  --hero-progress:#edcbed;
  --hero-track:#846284;
}

/* 플럼 다크 (프리미엄) */
:root[data-theme=dark][data-palette=plum]{
  --accent:#eab8ea;
  --accent-hover:#f7cdf7;
  --accent-weak:#453045;
  --on-accent:#301e30;
  --bg:#201620;
  --surface:#2d202d;
  --surface-2:#382838;
  --surface-3:#433043;
  --line:#493649;
  --line-strong:#6f576f;
  --text:#f5eaf5;
  --text-2:#d5bed5;
  --text-3:#c1a4c1;
  --hero:#503150;
  --hero-muted:#e1c9e1;
  --hero-progress:#edc7ed;
  --hero-track:#7e587e;
}

/* ── 화면 구조 치수 ──────────────────────────────────────────
   색과 달리 화면 폭·앱 모드(.pocket-app/.daybook-app)에 따라 바뀐다.
   --composer-h, --keyboard-inset 은 JS 가 실측값으로 덮어쓴다. */
:root{--composer-h:76px}
@media (max-width:1199px){:root{--sidebar-width:205px;--rail-width:260px}}
@media (max-width:767px){:root{--sidebar-width:0px;--nav-height:62px}}
:root{--sidebar-width:236px;--rail-width:290px}
@media (max-width:1199px) and (min-width:768px){:root{--sidebar-width:206px;--rail-width:0px}}
@media (max-width:767px){:root{--sidebar-width:0px;--nav-height:76px}}
:root.pocket-app{--phone-width:560px;--phone-nav-h:64px;--keyboard-inset:0px;--composer-h:88px}
:root{--ad-banner-h:50px;--ad-gap-top:6px;--ad-gap-bottom:8px}
.schedule-app{--phone-width:560px}
:root.daybook-app{--phone-width:560px;--phone-nav-h:58px}
:root.daybook-app{--daybook-header:48px}
@media (max-height:650px){:root.daybook-app{--daybook-header:44px;--phone-nav-h:48px}}
