/* 공통 톤 "A · 담백" (앱 packages/core 의 ToneColors 와 같은 값):
   회색 바탕 + 흰 카드, 테두리·그림자 없음, 대표색은 결과 숫자·주 버튼에만. 다크 모드도 같은 톤.
   색은 전부 이 토큰으로만 써요. 글자·바탕 쌍의 대비 4.5:1 은 test/contrast.test.js 가 검사해요
   (muted 는 page·card 위에서만, 칩·트랙 위 글자는 soft·button 을 써요). */
:root {
  --page: #f2f4f6;
  --card: #ffffff;
  --chip: #f2f4f6;
  --track: #e5e8eb;
  --strong: #191f28;
  --soft: #4e5968;
  --button: #333d4b;
  --muted: #66707d;
  --accent: #3d63dd;
  --seed: #3d63dd;
  --on-seed: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #101114;
    --card: #1c1e22;
    --chip: #2a2d33;
    --track: #2a2d33;
    --strong: #f2f4f6;
    --soft: #c9ced6;
    --button: #e5e8eb;
    --muted: #a3abb6;
    --accent: #8299ee;
    --seed: #3d63dd;
    --on-seed: #ffffff;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[lang=ko] { word-break: keep-all; overflow-wrap: break-word; }

body {
  margin: 0;
  background: var(--page);
  color: var(--strong);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px 40px; }

a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 머리 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 4px 20px; }
.top h1 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.2px; }
.lang {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--chip); color: var(--button); font-size: 14px; text-decoration: none;
}

/* ── 입력 카드 */
.card { background: var(--card); border-radius: 24px; padding: 24px; }
.field { margin: 0 0 20px; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin: 0 0 6px 2px; }
.lbl-row label { font-size: 14px; color: var(--muted); }
.today {
  height: 28px; padding: 0 12px; border: 0; border-radius: 14px;
  background: var(--chip); color: var(--button); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
input[type="date"] {
  display: block; width: 100%; min-width: 0; height: 52px; padding: 0 16px; border: 0; border-radius: 14px;
  background: var(--chip); color: var(--strong); font: inherit; font-size: 17px; font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
}

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; cursor: pointer; }
.switch input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0;
  border-radius: 15px; background: var(--track); cursor: pointer;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
}
.switch input:checked { background: var(--seed); }
.switch input:checked::after { left: 23px; }

/* ── 결과 */
.result { margin-top: 12px; padding: 28px 24px 24px; border-radius: 24px; background: var(--card); }
.r-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.r-value {
  font-size: 72px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; color: var(--accent);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.result.empty .r-value { color: var(--muted); }
.r-unit { font-size: 22px; font-weight: 600; color: var(--strong); }
.basis { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ── 앱 안내 한 줄 */
.app {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 24px; padding: 14px 14px 14px 20px; border-radius: 20px; background: var(--card);
}
.app p { margin: 0; line-height: 1.5; }
.app b { display: block; font-size: 15px; font-weight: 600; color: var(--strong); }
.app small { display: block; font-size: 13px; color: var(--soft); }
.btn, .soon {
  display: inline-flex; align-items: center; justify-content: center; flex: none; white-space: nowrap;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.btn { height: 36px; padding: 0 16px; border-radius: 14px; background: var(--seed); color: var(--on-seed); }
.soon { height: 28px; padding: 0 12px; border-radius: 14px; background: var(--chip); color: var(--button); }

.nojs { margin: 0 0 12px; padding: 16px; border-radius: 16px; background: var(--card); color: var(--soft); }

@media (min-width: 600px) {
  .top { padding-top: 56px; }
}
@media (max-width: 380px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .card { padding: 20px; }
  .result { padding: 24px 20px 20px; }
  .r-value { font-size: 64px; }
}
