/* 공통 톤 "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; }
[hidden] { display: none !important; }

/* ── 머리: 앱 아이콘 + 이름, 언어 전환 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; }
.top h1 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.2px; } /* 404 페이지 */
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--strong); font-size: 18px; font-weight: 700; letter-spacing: -0.2px; text-decoration: none; }
.app-icon { display: block; flex: none; width: 44px; height: 44px; border-radius: 11px; }
/* 라이트·다크 모두 같은 알약 (칩 색은 라이트에서 바탕과 같아서 안 보여요 → 카드색). 눌리는 높이 44px. */
.lang {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; padding: 0 18px; border-radius: 22px;
  background: var(--card); color: var(--button); font-size: 14px; font-weight: 500; text-decoration: none;
}

/* ── 첫 줄: 한 줄 소개 + 앱 받기 */
.hero { padding: 20px 4px 28px; }
.hero h1 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -0.5px; text-wrap: balance; }
.hero .sub { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--soft); text-wrap: balance; }
.hero .btn, .hero .soon { margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  height: 48px; padding: 0 24px; border-radius: 16px; background: var(--seed); color: var(--on-seed);
  font-size: 16px; font-weight: 600; text-decoration: none;
}
/* 아직 앱이 없을 때: 눌러지지 않는 글자만 (버튼·알약 모양 없이) */
.soon { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

/* ── 입력 카드 */
.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;
}
/* 날짜 칸. iOS·iPadOS 는 어느 브라우저(크롬 포함)든 WebKit 이라서, 기본 모양을 걷어 내고 높이·세로 가운데·왼쪽 정렬을 직접 정해요.
   (안 그러면 값이 칸 위쪽에 가운데로 붙고, 값이 비면 칸이 납작하게 줄어요.) */
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; height: 52px; min-height: 52px; margin: 0; padding: 0 16px; border: 0; border-radius: 14px;
  background: var(--chip); color: var(--strong); font: inherit; font-size: 17px; line-height: 52px; text-align: left; font-variant-numeric: tabular-nums;
}
input[type="date"]::-webkit-date-and-time-value { min-height: 52px; margin: 0; padding: 0; text-align: left; line-height: 52px; }
input[type="date"]::-webkit-datetime-edit { display: inline-flex; align-items: center; min-height: 52px; padding: 0; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
/* 빈 칸(.is-empty, app.js 가 붙임): 날짜처럼 보이는 글자를 숨겨요. 눌러서 고르는 중(:focus)에는 보여요. 자리는 그대로라 칸이 납작해지지 않아요. */
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit,
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit-fields-wrapper,
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit-text,
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit-month-field,
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit-day-field,
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit-year-field,
input[type="date"].is-empty:not(:focus)::-webkit-date-and-time-value { color: transparent; -webkit-text-fill-color: transparent; }
input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0 0 0 8px; }

.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 {
  display: flex; flex-direction: column; justify-content: center; min-height: 160px;
  margin-top: 12px; padding: 28px 24px 24px; border-radius: 24px; background: var(--card);
}
.prompt { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 600; color: var(--soft); }
.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;
}
.r-unit { font-size: 22px; font-weight: 600; color: var(--strong); }
.note { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); white-space: pre-line; }

/* ── 앱 기능 4가지: 카드 하나, 줄마다 제목 + 한 줄 */
.features { list-style: none; margin: 12px 0 0; padding: 8px 24px; border-radius: 24px; background: var(--card); }
.features li { padding: 16px 0; }
.features li + li { border-top: 1px solid var(--track); }
.features b { display: block; font-size: 16px; font-weight: 600; color: var(--strong); }
.features span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--soft); text-wrap: pretty; }

/* ── 바닥: 개인정보처리방침 · 문의 · ⓒ */
.foot { padding: 24px 4px 0; }
.links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; }
.links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--soft); font-size: 14px; }
.copy { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

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

@media (min-width: 600px) {
  .top { padding-top: 32px; }
  .hero { padding-top: 32px; }
}
@media (max-width: 380px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .top { gap: 8px; }
  .brand { gap: 10px; font-size: 16px; }
  .app-icon { width: 40px; height: 40px; border-radius: 10px; }
  .lang { padding: 0 14px; }
  .card { padding: 20px; }
  .result { padding: 24px 20px 20px; }
  .features { padding: 4px 20px; }
  .hero h1 { font-size: 24px; }
  .r-value { font-size: 64px; }
}
