/* 퇴직금 계산기 — 2026 기준 (퇴직금 · 실업급여 · 주휴수당) */
:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #7b879c;
  --line: #e3e8f1;
  --brand: #1d4ed8;
  --brand-2: #3b82f6;
  --up: #0e9f6e;
  --down: #dc2626;
  --navy-1: #0b1220;
  --navy-2: #182642;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 280px;
  background: radial-gradient(120% 90% at 50% -20%, #dbe6ff 0%, rgba(238, 241, 247, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px calc(26px + env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

/* ── 상단 ───────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 2px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.28);
}

.brand-name {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.basis-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
  background: #e6edff;
  border: 1px solid #cfdcff;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.intro {
  padding: 2px 4px 6px;
}

.intro h1 {
  margin: 0 0 3px;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.6px;
  font-weight: 800;
}

.intro h1 em {
  font-style: normal;
  color: var(--brand);
}

.intro p {
  margin: 0;
  font-size: 12.8px;
  color: var(--ink-2);
  letter-spacing: -0.2px;
}

/* ── 탭 ─────────────────────────────── */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  margin-bottom: 9px;
  background: #e6ebf5;
  border: 1px solid #dde4f0;
  border-radius: 14px;
}

.tab {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink-2);
  padding: 8px 4px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tab.on {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.tab:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
}

/* ── 카드 ───────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}

.pair .field + .field { margin-top: 0; }

.field + .field { margin-top: 10px; }

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.8px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  padding: 0 2px;
  letter-spacing: -0.2px;
}

.field-label .hint {
  font-weight: 600;
  color: var(--ink-3);
  font-size: 11.5px;
}

.field-label .hint.warn { color: #c2410c; font-weight: 700; }

.unit-inline {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: -0.1px;
}

.money-field,
.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f9fd;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.money-field.small { padding: 9px 11px; }

.money-field:focus-within,
.date-field:focus-within {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.money-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0;
  outline: none;
}

.money-field.small input { font-size: 17px; letter-spacing: -0.3px; }

.money-field input::placeholder {
  color: #b8c2d4;
  font-weight: 700;
  opacity: 1;
}

.money-field .unit {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
}

.date-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  padding: 0;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.unit-hint {
  margin: 5px 2px 0;
  font-size: 11.8px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}

.unit-hint.is-placeholder {
  font-weight: 600;
  color: #96a2b8;
}

/* 칩 */
.chips {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  overflow-x: auto;
  padding: 1px 1px 2px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chips.tight { margin-top: 0; }

.chip {
  flex: none;
  border: 1.5px solid #d9e2f2;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 12.2px;
  font-weight: 800;
  letter-spacing: -0.3px;
  padding: 6px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:active { transform: scale(0.96); background: #eef3ff; }

.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 한 줄 세부 입력 */
.row.slim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f4f9;
}

.row.slim .row-label {
  font-size: 12.6px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: -0.2px;
  min-width: 0;
}

.row.slim .row-hint {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1.35;
}

.mini-input {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f4f7fc;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 6px 10px;
  flex: none;
}

.mini-input input {
  width: 66px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  text-align: right;
  color: var(--ink);
  outline: none;
  font-variant-numeric: tabular-nums;
  padding: 0;
}

.mini-input input::placeholder { color: #b8c2d4; }
.mini-input .unit { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }

/* ── 결과(다크) ─────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 13px 15px 12px;
  margin-bottom: 10px;
  background: linear-gradient(160deg, var(--navy-1) 0%, var(--navy-2) 62%, #1f3358 100%);
  color: #fff;
  box-shadow: 0 16px 34px rgba(11, 18, 32, 0.26);
}

.hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45) 0%, rgba(59, 130, 246, 0) 70%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 12.8px;
  font-weight: 700;
  color: #9fb0cc;
  letter-spacing: -0.2px;
  flex: 1 1 auto;
  min-width: 0;
}

.pill {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(16, 185, 129, 0.16);
  color: #5eead4;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pill.flat {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.32);
}

.hero-num {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.hero-num strong {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -1.4px;
}

.hero-num strong.long { font-size: 26px; letter-spacing: -1px; }

.hero.is-empty .hero-num strong {
  font-size: 22px;
  color: #8fa2bf;
  letter-spacing: -0.3px;
  line-height: 1.35;
}

.hero-unit {
  font-size: 18px;
  font-weight: 800;
  color: #c7d3e8;
  letter-spacing: -0.4px;
}

.hero-sub {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 12.6px;
  line-height: 1.45;
  color: #9fb0cc;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

/* ── 계산 내역 표 ────────────────────── */
.table-card { padding: 7px 14px 5px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table td {
  font-size: 13px;
  padding: 6.5px 0;
  text-align: right;
  color: var(--ink-2);
  border-top: 1px solid #f1f4f9;
  letter-spacing: -0.2px;
}

.table tr:first-child td { border-top: 0; }

.table td:first-child {
  text-align: left;
  color: var(--ink);
  font-weight: 600;
  padding-right: 10px;
}

.table td:last-child { white-space: nowrap; font-weight: 700; color: var(--ink); }

.table tr.net td {
  border-top: 1.5px solid var(--line);
  color: var(--brand);
  font-weight: 800;
  font-size: 14px;
  padding-top: 10px;
}

.table .sub {
  display: block;
  font-size: 10.8px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 1px;
  letter-spacing: -0.1px;
}

.basis-line {
  margin: 0 0 6px;
  padding: 0 4px;
  font-size: 11.4px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-3);
  letter-spacing: -0.2px;
  text-align: center;
}

/* ── 복사 ───────────────────────────── */
.copy {
  width: 100%;
  border: 1.5px solid #cdd9f0;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  border-radius: 15px;
  padding: 11px;
  cursor: pointer;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, transform 0.08s;
}

.copy:active { transform: scale(0.99); background: #f2f6ff; }
.copy.done { color: var(--up); border-color: #b7e6d4; background: #f0fdf8; }

/* ── 광고 ───────────────────────────── */
.adbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.6);
}

.ad-label {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  letter-spacing: -0.2px;
}

.ad-label strong { color: var(--ink-2); font-weight: 800; }

.nudge {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #dde5f2;
  border-radius: 11px;
  background: #fff;
  text-decoration: none;
  font-size: 12.6px;
  line-height: 1.35;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nudge:hover,
.nudge:focus-visible {
  color: var(--ink-2);
  border-color: #b9cdf0;
  background: #f7faff;
}

.nk-line {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nudge em { font-style: normal; }
.nk-dot { margin: 0 5px; opacity: 0.55; }
.nudge b { font-weight: 700; color: var(--ink-2); }
.nudge:hover b { color: var(--ink); }
.nk-go { flex: 0 0 auto; font-weight: 700; opacity: 0.7; }

.ad-note {
  margin: 0;
  font-size: 10.8px;
  line-height: 1.5;
  color: #96a2b8;
  letter-spacing: -0.2px;
}

/* ── 접히는 안내 ─────────────────────── */
.basis,
.applike { padding: 0; overflow: hidden; }

.basis > summary,
.applike > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.basis > summary::-webkit-details-marker,
.applike > summary::-webkit-details-marker { display: none; }

.sum-right { display: flex; align-items: center; gap: 8px; flex: none; }

.basis .chev,
.applike .chev {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2fa;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  transition: transform 0.2s;
  flex: none;
}

.basis[open] .chev,
.applike[open] .chev { transform: rotate(180deg); }

.basis-body,
.applike-body {
  padding: 2px 16px 16px;
  border-top: 1px solid #f1f4f9;
}

.basis-date {
  margin: 12px 0 0;
  font-size: 11.8px;
  color: var(--ink-3);
  letter-spacing: -0.2px;
}

.basis-date strong { color: var(--ink-2); }

.basis-body h3 {
  margin: 16px 0 6px;
  font-size: 12.6px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.basis-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.basis li {
  position: relative;
  padding-left: 13px;
  font-size: 12.2px;
  line-height: 1.62;
  color: var(--ink-2);
  letter-spacing: -0.2px;
}

.basis li + li { margin-top: 5px; }

.basis li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b9c5da;
}

.basis a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid #c9d8fb;
  font-weight: 600;
}

.basis .sources li { font-size: 11.8px; line-height: 1.55; }
.basis .sources li + li { margin-top: 4px; }

.basis .note {
  margin: 13px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  letter-spacing: -0.2px;
}

.os { margin-top: 12px; }

.os h3 {
  margin: 0 0 5px;
  font-size: 12.4px;
  font-weight: 800;
  color: var(--ink);
}

.os ol {
  margin: 0;
  padding-left: 17px;
  font-size: 12.4px;
  line-height: 1.65;
  color: var(--ink-2);
}

footer {
  padding: 8px 4px 0;
  font-size: 11.6px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.2px;
}

footer nav { display: flex; gap: 12px; }
footer a { color: var(--ink-2); text-decoration: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  background: #0f172a;
  color: #fff;
  font-size: 12.8px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  box-shadow: 0 12px 24px rgba(11, 18, 32, 0.3);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 문서 페이지 */
.doc { padding-top: 8px; }
.doc .card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.6px; }
.doc .card h2 { font-size: 15px; margin: 20px 0 8px; letter-spacing: -0.3px; }
.doc .card p,
.doc .card li { font-size: 13.4px; line-height: 1.75; color: var(--ink-2); letter-spacing: -0.2px; }
.doc .card ul { padding-left: 18px; margin: 0; }
.doc .card p { margin: 0 0 10px; }
.doc .updated { font-size: 12px; color: var(--ink-3); }
.doc .back {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  font-size: 13.5px;
}

@media (max-width: 360px) {
  .hero-num strong { font-size: 30px; }
  .hero.is-empty .hero-num strong { font-size: 19px; }
  .table td { font-size: 12.4px; }
  .money-field input { font-size: 18px; }
  .tab { font-size: 12.6px; }
  .pair { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 브랜드 아이콘 (인라인 SVG) */
.brand-mark svg { display: block; }

/* 1일 소정근로 select */
.money-field select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  padding: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  text-align: right;
}

/* 입력 줄 사이 간격 · select 표시 */
.field + .pair { margin-top: 10px; }
.chips.wrap + .pair { margin-top: 10px; }
.money-field .caret {
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
  margin-left: -4px;
}
