:root {
  --bg: #0E1116;
  --card: #171B22;
  --card-hi: #1D232C;
  --line: #262D38;
  --text: #F2F4F7;
  --muted: #8D96A5;
  --accent: #FFB020;
  --accent-ink: #1A1000;
  --radius: 18px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FFFBF3; --card: #FFFFFF; --card-hi: #FEF3E2; --line: #F0E0C8;
    --text: #201A0E; --muted: #6B5F4C; --accent: #B45309; --accent-ink: #FFFFFF;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FFFBF3; --card: #FFFFFF; --card-hi: #FEF3E2; --line: #F0E0C8;
  --text: #201A0E; --muted: #6B5F4C; --accent: #B45309; --accent-ink: #FFFFFF;
  color-scheme: light;
}
* { box-sizing: border-box; }
/* 라이트/다크 전환이 뚝 끊기지 않고 부드럽게 이어지도록. prefers-reduced-motion에서는 아래 미디어쿼리가 다시 꺼준다. */
*, *::before, *::after { transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top) max(20px, calc((100% - 480px) / 2)) env(safe-area-inset-bottom);
  background: var(--bg) radial-gradient(60% 260px at 50% -40px, rgba(198, 244, 50, .16), transparent 72%) no-repeat;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
a { color: var(--accent); }
h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: -.03em; }
h2 { margin: 28px 0 8px; font-size: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.crumb { margin: 14px 0 0; font-size: 13px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.lang-switch { position: relative; display: inline-block; margin: 8px 0 0; }
.lang-toggle {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--card); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lang-toggle:hover, .lang-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
.lang-menu[hidden] { display: none; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 15;
  margin: 0; padding: 6px; list-style: none; min-width: 120px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .5);
}
.lang-menu li + li { margin-top: 2px; }
.lang-menu a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 13px; text-decoration: none; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--card-hi); }
.lang-menu a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.theme-toggle {
  position: fixed; z-index: 20; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, calc((100% - 480px) / 2 + 14px));
  width: 38px; height: 38px; margin: 0; padding: 0; max-width: none; border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4);
}
.theme-toggle:hover { border-color: var(--accent); }

.hero { padding-top: 20px; padding-bottom: 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.accent { color: var(--accent); }
.lead { margin: 10px 0 0; color: var(--muted); text-wrap: balance; }

.input-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
.input-row label { font-size: 13px; font-weight: 700; color: var(--muted); }
.usage-input { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 56px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.usage-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.usage-input input:focus { outline: 0; }
.usage-input input::-webkit-outer-spin-button, .usage-input input::-webkit-inner-spin-button { margin: 0; }
#usage-unit { color: var(--muted); font-weight: 700; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.seg button { height: 40px; min-width: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.result { padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.result-total { margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
.result-total strong { font-size: 40px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.breakdown { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }


.foot { padding-block: 32px 40px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }
body > main:not(:has(.result)) { padding-block: 32px; }
body > main:not(:has(.result)) p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── 청년 혜택: 민트 강조 ── */
:root { --accent: #34D399; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --accent: #047857; } }
:root[data-theme="light"] { --accent: #047857; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note { color: var(--muted); font-size: 12px; margin: 10px 0 14px; line-height: 1.6; }
.note a { color: var(--muted); }
.search { display: block; width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.meta { margin: 12px 0 6px; color: var(--muted); font-size: 13px; }
.empty-msg { color: var(--muted); font-size: 14px; padding: 18px 0; text-align: center; }
.empty-msg[hidden] { display: none; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.item-btn { all: unset; box-sizing: border-box; display: grid; gap: 6px; width: 100%; padding: 14px 16px; cursor: pointer; }
.item-btn:hover, .item-btn[aria-expanded="true"] { color: var(--accent); }
.item-name { font-weight: 700; font-size: 15px; line-height: 1.4; }
.item-org { color: var(--muted); font-size: 12px; }
.item-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { padding: 2px 8px; border-radius: 999px; background: var(--card-hi); color: var(--muted); font-size: 11px; font-weight: 600; }
.item-detail { padding: 0 16px 16px; border-top: 1px solid var(--line); margin: 0 16px; padding-left: 0; padding-right: 0; padding-top: 12px; font-size: 14px; }
.item-detail[hidden] { display: none; }
.item-detail p { margin: 0 0 10px; }
.item-label { margin-bottom: 2px !important; color: var(--muted); font-size: 12px; font-weight: 700; }
.item-link { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; text-decoration: none; }
.more { display: block; width: 100%; height: 44px; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.more:disabled { opacity: .6; cursor: default; }
.more[hidden] { display: none; }
.next { margin-top: 24px; }
.pill-link { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.pill-link:hover { border-color: var(--accent); }

/* ── 내게 맞는 혜택: 입력 폼과 마감 배지 ── */
.profile { display: grid; gap: 10px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field span { color: var(--muted); font-size: 12px; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.field input, .field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-hi); color: var(--text); font: inherit; font-size: 15px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-hi); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle[aria-pressed="true"] { border-color: #F97066; background: #F97066; color: #FFFFFF; font-weight: 700; }
.profile .note { margin: 0; }
.badge { display: inline-block; justify-self: start; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-closing { background: #F97066; color: #FFFFFF; }
.badge-open { background: var(--card-hi); color: var(--muted); }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

/* ── 내 지역 청년센터 ── */
.centers { margin-top: 18px; }
.centers[hidden] { display: none; }
.section-title { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.center-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.center-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: grid; gap: 4px; }
.center-name { font-weight: 700; font-size: 15px; }
.center-addr { color: var(--muted); font-size: 13px; }
.center-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.center-links a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: 13px; text-decoration: none; }
.center-links a:hover { border-color: var(--accent); }
