/* 해루질 — 밤에 보는 앱이므로 다크 기본. 라이트 모드도 지원한다. */

:root {
  --bg: #0a1220;
  --bg-2: #101c30;
  --surface: #142339;
  --surface-2: #1b2e49;
  --line: #24395a;
  --text: #e8f0fb;
  --muted: #8ba3c4;
  --dim: #5f7799;

  --sea: #2f9fd8;
  --sea-deep: #14618f;
  --gold: #f5b942;
  --good: #35c98a;
  --warn: #f08a3c;
  --bad: #e2544e;

  --r: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.38);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #f2f6fb; --bg-2: #e8eff8; --surface: #ffffff; --surface-2: #f0f5fb;
  --line: #d5e0ed; --text: #12233a; --muted: #55708f; --dim: #7c93ad;
  --shadow: 0 6px 20px rgba(20,45,80,.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -180px, var(--bg-2), var(--bg)) fixed;
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 72px; }

/* ------------------------------------------------------------- 헤더 */

header.top {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 16px;
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--sea); }
header.top .grow { flex: 1; }

select, button, input {
  font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px;
}
select { max-width: 46vw; }
button { cursor: pointer; }
button:hover { background: var(--surface-2); }
.icon-btn { padding: 8px 10px; line-height: 1; }

/* --------------------------------------------------------- 히어로 카드 */

.hero {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--sea), var(--gold));
}
.hero-top { display: flex; align-items: center; gap: 18px; }

.gauge { position: relative; width: 108px; height: 108px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge .num {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge .num b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1; }
.gauge .num small { font-size: 11px; color: var(--muted); }

.hero h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.03em; line-height: 1.32; }
.stars { font-size: 17px; letter-spacing: 3px; color: var(--gold); }
.stars .off { color: var(--line); }
.hero .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  font-size: 12px; padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.chip b { color: var(--text); font-weight: 700; }

/* ------------------------------------------------------- 3시각 스트립 */

.plan {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; margin-top: 14px;
}
.plan div { background: var(--surface); padding: 14px 8px; text-align: center; }
.plan .lab { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.plan .val { font-size: 26px; font-weight: 800; font-family: var(--mono); letter-spacing: -.04em; margin-top: 2px; }
.plan .hint { font-size: 10.5px; color: var(--dim); margin-top: 1px; }
.plan .go .val { color: var(--good); }
.plan .peak .val { color: var(--sea); }
.plan .out .val { color: var(--warn); }

/* --------------------------------------------------------------- 카드 */

section.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin-top: 14px;
}
section.card > h2 {
  font-size: 13px; margin: 0 0 12px; color: var(--muted);
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ------------------------------------------------------------- 그래프 */

.chart { width: 100%; height: 176px; display: block; }
.chart text { font-size: 10px; fill: var(--dim); font-family: var(--mono); }
.chart .axis { stroke: var(--line); stroke-width: 1; }

/* ------------------------------------------------------- 14일 스트립 */

.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.day {
  flex: none; width: 68px; text-align: center; padding: 10px 4px 9px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  cursor: pointer; transition: transform .1s, border-color .1s;
}
.day:hover { transform: translateY(-2px); }
.day.sel { border-color: var(--sea); box-shadow: 0 0 0 1px var(--sea) inset; }
.day .d { font-size: 11px; color: var(--muted); }
.day .dd { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.day .bar { height: 5px; border-radius: 3px; background: var(--line); margin: 7px 3px 6px; overflow: hidden; }
.day .bar i { display: block; height: 100%; border-radius: 3px; }
.day .t { font-size: 11.5px; font-family: var(--mono); color: var(--muted); }
.day .md { font-size: 10px; color: var(--dim); }
.day.sat .dd { color: #79b8ff; }
.day.sun .dd { color: #ff8f8a; }

/* --------------------------------------------------------- TOP 리스트 */

.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer;
}
.top-item:hover { border-color: var(--sea); }
.top-item .rank { font-size: 12px; color: var(--dim); width: 16px; font-family: var(--mono); }
.top-item .when { font-weight: 700; }
.top-item .grow { flex: 1; }
.top-item .tm { font-family: var(--mono); font-size: 15px; color: var(--sea); font-weight: 700; }

/* --------------------------------------------------------------- 달력 */

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .hd { text-align: center; font-size: 11px; color: var(--dim); padding-bottom: 2px; }
.cal .cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-content: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; color: #06121f;
}
.cal .cell.empty { background: none; cursor: default; }
.cal .cell.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.cal .cell small { display: block; font-size: 8.5px; font-weight: 500; opacity: .75; text-align: center; }

/* --------------------------------------------------------------- 목록 */

ul.reasons { margin: 0; padding-left: 18px; }
ul.reasons li { margin-bottom: 5px; font-size: 13.5px; }

.warns { display: flex; flex-direction: column; gap: 7px; }
.warn-item {
  display: flex; gap: 9px; font-size: 13px; padding: 9px 11px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  border-radius: 10px;
}
.danger {
  background: color-mix(in srgb, var(--bad) 13%, transparent);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

details { border-top: 1px solid var(--line); }
details:first-of-type { border-top: none; }
details > summary {
  cursor: pointer; padding: 11px 2px; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "＋"; color: var(--sea); font-size: 13px; }
details[open] > summary::before { content: "－"; }
details .body { padding: 0 2px 14px; font-size: 13.3px; color: var(--muted); }
details .body b { color: var(--text); }
details .body p { margin: 0 0 9px; }

.notice {
  font-size: 12.3px; padding: 11px 13px; border-radius: 12px;
  background: color-mix(in srgb, var(--sea) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--sea) 30%, transparent);
  color: var(--muted); margin-top: 14px;
}
.notice b { color: var(--text); }

footer { text-align: center; color: var(--dim); font-size: 11.5px; margin-top: 26px; line-height: 1.8; }

/* ------------------------------------------------------------ 다이얼로그 */

dialog {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 16px; padding: 20px; max-width: 420px; width: calc(100% - 32px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(4,10,20,.66); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 4px; font-size: 16px; }
dialog label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 5px; }
dialog input, dialog select { width: 100%; }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.primary { background: var(--sea); border-color: var(--sea); color: #04121d; font-weight: 700; }
.primary:hover { background: var(--sea-deep); color: #fff; }

@media (max-width: 420px) {
  .hero-top { gap: 13px; }
  .gauge { width: 88px; height: 88px; }
  .gauge .num b { font-size: 25px; }
  .hero h1 { font-size: 18px; }
  .plan .val { font-size: 22px; }
}

/* ------------------------------------------------------------ 준비물 */

.disclosure {
  font-size: 11.8px; line-height: 1.5; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 11px; margin: 0 0 12px;
}

.gear-list { display: flex; flex-direction: column; gap: 8px; }

.gear-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .12s, transform .12s;
}
.gear-item:hover { border-color: var(--sea); transform: translateY(-1px); }
.gear-item:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.gear-item img {
  width: 56px; height: 56px; flex: none; border-radius: 8px;
  object-fit: cover; background: var(--line);
}

.gi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gi-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.gi-tag {
  font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 34%, transparent);
}
.gi-why { font-size: 12.3px; color: var(--muted); line-height: 1.45; }
.gi-prod {
  font-size: 11px; color: var(--dim); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.gi-price {
  flex: none; text-align: right; font-family: var(--mono);
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.gi-price small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 1px; }
.gi-price em {
  display: block; font-style: normal; font-size: 10px; font-weight: 600;
  color: var(--sea); font-family: inherit; margin-top: 1px;
}

.gear-foot { font-size: 11px; color: var(--dim); margin: 11px 0 0; }

@media (max-width: 420px) {
  .gear-item img { width: 46px; height: 46px; }
  .gi-why { font-size: 11.8px; }
  .gi-price { font-size: 13.5px; }
}

/* ------------------------------------------ 정적 콘텐츠 (검색 노출용) */

.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;
}

a.brand { text-decoration: none; color: inherit; }

article.seo {
  margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line);
  max-width: 40rem;
}
article.seo h1 { font-size: clamp(24px, 5vw, 31px); line-height: 1.28; letter-spacing: -.03em; margin: 0 0 14px; }
article.seo h2 { font-size: 19px; margin: 38px 0 12px; letter-spacing: -.02em; }
article.seo h3 { font-size: 15.5px; margin: 24px 0 8px; color: var(--muted); font-weight: 700; }
article.seo p  { margin: 0 0 14px; font-size: 14.6px; line-height: 1.78; }
article.seo .lede { font-size: 16px; color: var(--text); }
article.seo ul { padding-left: 19px; margin: 0 0 14px; }
article.seo li { margin-bottom: 7px; font-size: 14.3px; }
article.seo a { color: var(--sea); }
ul.safety li { color: var(--muted); }

/* 30일 물때표 */
.tablewrap { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table.forecast { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 460px; background: var(--surface); }
table.forecast th, table.forecast td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.forecast thead th {
  background: var(--surface-2); color: var(--muted); font-weight: 600;
  font-size: 11.5px; letter-spacing: .04em; position: sticky; top: 0;
}
table.forecast tbody tr:last-child td { border-bottom: none; }
table.forecast tr.hi { background: color-mix(in srgb, var(--good) 9%, transparent); }
table.forecast td.t { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.forecast td.sat { color: #79b8ff; }
table.forecast td.sun { color: #ff8f8a; }
table.forecast a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
table.forecast a:hover { color: var(--sea); border-color: var(--sea); }

/* 사실 목록 */
dl.facts { margin: 0 0 18px; display: flex; flex-direction: column; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
dl.facts > div { background: var(--surface); display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 11px 14px; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; font-size: 14px; }

nav.spotlinks { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
nav.spotlinks a {
  font-size: 12.8px; padding: 5px 11px; border-radius: 999px; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
nav.spotlinks a:hover { border-color: var(--sea); color: var(--text); }

nav.site-nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 40px; font-size: 13px; }
nav.site-nav a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
nav.site-nav a:hover { color: var(--sea); border-color: var(--sea); }

.hero-h { font-size: 21px; margin: 0 0 6px; letter-spacing: -.03em; line-height: 1.32;
  font-family: inherit; font-weight: 700; }
