:root {
  --sheet: #ffffff; --fg: #15171a; --muted: #5f6670; --line: #e6e9ed; --chip: #f2f4f7;
  --rain: #1f6fd6; --rain-bg: #e6f0ff; --rain-line: #b9d3fb; --accent: #1f6fd6; --btn: #1f6fd6; --danger: #c93838;
  --sw-on: #34c759; --sw-off: #d3d6db;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sheet: #131417; --fg: #eef0f3; --muted: #a2a9b2; --line: #272a2f; --chip: #1e2024;
    --rain: #7fb2ff; --rain-bg: #17263d; --rain-line: #2a4a78; --accent: #7fb2ff; --danger: #ff8080; --sw-off: #3a3c42;
  }
}
:root[data-theme="dark"] {
  --sheet: #131417; --fg: #eef0f3; --muted: #a2a9b2; --line: #272a2f; --chip: #1e2024;
  --rain: #7fb2ff; --rain-bg: #17263d; --rain-line: #2a4a78; --accent: #7fb2ff; --danger: #ff8080; --sw-off: #3a3c42;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sheet); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased; word-break: keep-all; font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:active { transform: scale(0.97); }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--sheet); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 240ms cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ───────── 하늘(사진) ───────── */
.sky { position: relative; color: #fff; padding: calc(env(safe-area-inset-top) + 14px) 0 40px; overflow: hidden; background: #3a6fb5; text-shadow: 0 1px 14px rgba(0,0,0,.28); }
.sky .bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; opacity: 0; transition: opacity 400ms ease-out; }
.sky .bg.on { opacity: 1; }
.sky .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,var(--top, .30)) 0%, rgba(0,0,0,var(--mid, .12)) 45%, rgba(0,0,0,var(--bot, .38)) 100%); transition: background 400ms ease-out; }
.sky[data-sky="snow"], .sky[data-sky="fog"] { --top: .42; --mid: .30; --bot: .50; }
.sky[data-sky="cloudy"] { --top: .34; --mid: .20; --bot: .42; }
@media (prefers-reduced-motion: reduce) { .sky .bg { transition: none; } }
.sky > * { position: relative; }
.sky .bg, .sky .shade { position: absolute; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 20px; }
.place { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.upd { font-size: 14px; opacity: .9; margin-top: 3px; }
.glass { border: 0; background: rgba(255,255,255,.22); color: #fff; border-radius: 999px; height: 40px; padding: 0 14px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-shadow: none; }

.cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 22px; }
.cards::-webkit-scrollbar { display: none; }
.card { flex: 0 0 100%; scroll-snap-align: center; padding: 0 24px; }
.card .lab { font-size: 18px; font-weight: 600; opacity: .95; }
.card .t { display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; }
.card .t b { font-size: 108px; font-weight: 250; letter-spacing: -0.05em; line-height: .95; font-variant-numeric: tabular-nums; }
.card .t .side { padding-top: 12px; font-size: 18px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.card .t .side span { opacity: .85; font-size: 16px; }
.card .now { font-size: 15px; opacity: .9; margin-top: 2px; }
.skyline { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; background: rgba(0,0,0,.28); border-radius: 999px; padding: 9px 15px; font-size: 17px; font-weight: 600; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-shadow: none; }
.pill.wet { background: rgba(31,111,214,.85); }
.vs { font-size: 16px; opacity: .95; margin-top: 12px; }
.daytabs { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.daytabs button { border: 0; background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 16px; font-weight: 600; text-shadow: none; transition: background-color 150ms ease-out, color 150ms ease-out; }
.daytabs button[aria-current="true"] { background: #fff; color: #15171a; }

/* ───────── 아래 시트 ───────── */
.sheet { position: relative; margin-top: -24px; background: var(--sheet); border-radius: 24px 24px 0 0; padding: 24px 18px calc(env(safe-area-inset-bottom) + 40px); }
.sec + .sec { margin-top: 30px; }
.sec h2 { margin: 0 0 12px; font-size: 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec h2 small { font-size: 15px; font-weight: 400; color: var(--muted); }

/* 시간별: 큰 글씨 */
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 6px; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.hr { flex: none; width: 86px; scroll-snap-align: start; text-align: center; background: var(--chip); border-radius: 18px; padding: 12px 0 12px; border: 2px solid transparent; }
.hr .ap { font-size: 14px; color: var(--muted); line-height: 1.2; }
.hr .hh { font-size: 21px; font-weight: 700; line-height: 1.25; }
.hr .ic { margin: 8px 0 4px; display: flex; justify-content: center; color: var(--fg); }
.hr .tt { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hr .rr { margin-top: 4px; font-size: 16px; color: var(--muted); min-height: 21px; }
.hr.wet { background: var(--rain-bg); border-color: var(--rain-line); }
.hr.wet .rr { color: var(--rain); font-weight: 700; }
.hr.now { border-color: var(--fg); }
.hr.newday .ap { color: var(--accent); font-weight: 700; }
.hint { font-size: 15px; color: var(--muted); }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { background: var(--chip); border-radius: 16px; padding: 13px 14px; }
.chip .row1 { display: flex; justify-content: space-between; align-items: center; }
.chip b { font-size: 16px; }
.chip .org { font-size: 13px; color: var(--muted); margin-top: 1px; }
.chip .tt { margin-top: 8px; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip .rn { font-size: 15px; color: var(--muted); margin-top: 2px; }
.chip .rn.wet { color: var(--rain); font-weight: 700; }
.note { font-size: 14px; color: var(--muted); margin: 10px 2px 0; line-height: 1.5; }

.air { display: flex; align-items: center; gap: 16px; background: var(--chip); border-radius: 16px; padding: 16px; }
.air .big { font-size: 28px; font-weight: 800; flex: none; }
.air .sub { font-size: 15px; color: var(--muted); line-height: 1.55; }
.g1 { color: #2f7de1; } .g2 { color: #1f9a55; } .g3 { color: #e08a12; } .g4 { color: #e5484d; }

.list { background: var(--chip); border-radius: 16px; }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 17px; }
.list .row:last-child { border-bottom: 0; }
.list .ctl { display: flex; align-items: center; gap: 10px; }
.list input[type="time"] { border: 0; background: var(--sheet); color: var(--fg); border-radius: 9px; padding: 7px 9px; font-size: 17px; }
.btns { display: flex; gap: 8px; margin-top: 12px; }
.btn { flex: 1; border: 0; background: var(--btn); color: #fff; border-radius: 14px; padding: 15px 10px; font-size: 16px; font-weight: 700; }
.btn.ghost { background: var(--chip); color: var(--fg); }
.btn[disabled] { opacity: .55; }
.saved { font-size: 14px; font-weight: 400; color: var(--muted); opacity: 0; transition: opacity 150ms ease-out; }
.saved.on { opacity: 1; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--sheet); border-radius: 12px; padding: 12px 14px; font-size: 17px; }
.search button { border: 0; background: var(--chip); border-radius: 12px; padding: 0 16px; font-size: 16px; font-weight: 600; }
.results { margin-top: 8px; display: grid; gap: 6px; }
.results button { text-align: left; border: 0; background: var(--chip); border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.results button span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

.foot { margin-top: 36px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.foot a { color: inherit; }
.link { border: 0; background: none; padding: 0; color: var(--danger); font-size: 15px; text-decoration: underline; }
.msg { background: var(--chip); border-radius: 16px; padding: 16px; font-size: 16px; line-height: 1.55; }

/* ───────── 가입 화면 ───────── */
.join .sky { min-height: 46vh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 56px; }
.join h1 { margin: 0; padding: 0 24px; font-size: 38px; letter-spacing: -0.02em; }
.join .lead { padding: 0 24px; margin: 10px 0 0; font-size: 18px; line-height: 1.5; opacity: .95; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--line); background: var(--sheet); border-radius: 14px; padding: 15px 16px; font-size: 19px; }
.field input.code { letter-spacing: .25em; text-transform: uppercase; font-weight: 700; }
.steps { margin: 0; padding-left: 22px; line-height: 1.9; font-size: 17px; }
.bigcode { font-size: 30px; font-weight: 800; letter-spacing: .25em; margin-top: 6px; }
.err { color: var(--danger); font-size: 16px; margin-top: 10px; min-height: 22px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(20,20,22,.92); color: #fff; padding: 13px 18px; border-radius: 14px; font-size: 16px; max-width: calc(100% - 32px); text-align: center;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), opacity 180ms ease-out; z-index: 10; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* 스위치 */
.sw { position: relative; display: inline-block; width: 52px; height: 32px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--sw-off); transition: background-color 180ms ease-out; pointer-events: none; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.sw input:checked + span { background: var(--sw-on); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
