/* 하늘 배경 위에 반투명 카드를 얹는 아이폰 날씨 앱 스타일. 배경이 늘 색이 있으므로 글자는 흰색 고정. */
:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --glass: rgba(255, 255, 255, 0.13);
  --glass-line: rgba(255, 255, 255, 0.16);
  --up: #ffb37a;
  --down: #9fcbff;
  --sky-top: #14204a;
  --sky-bottom: #2d4a8a;
}
body[data-sky="day"]    { --sky-top: #2f74d0; --sky-bottom: #7fb6ec; }
body[data-sky="night"]  { --sky-top: #0d1636; --sky-bottom: #263f7e; }
body[data-sky="cloudy"] { --sky-top: #4b5a6e; --sky-bottom: #8796a8; }
body[data-sky="rain"]   { --sky-top: #263241; --sky-bottom: #4f6175; }
body[data-sky="snow"]   { --sky-top: #6c7f98; --sky-bottom: #b4c3d4; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--sky-top); }
body {
  background: var(--sky-top);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; }

.sky {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  transition: background 0.6s;
}
.stars {
  position: absolute; inset: 0; opacity: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 82% 28%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 6%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 74% 42%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 45%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 35%, #fff 50%, transparent 51%);
  transition: opacity 0.6s;
}
body[data-sky="night"] .stars { opacity: 0.8; }

.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 20px);
  display: flex; flex-direction: column; gap: 12px;
}

.top { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.place-wrap { display: flex; flex-direction: column; gap: 6px; }
.place {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 4px 0; cursor: pointer;
  font-size: 17px; font-weight: 600; text-align: left;
}
.place svg { opacity: 0.8; }
.gps-ico { margin-right: 4px; vertical-align: -1px; }
.dots { display: flex; gap: 6px; min-height: 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.dots span.on { background: #fff; }
.dots span.gps { border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; display: grid; place-items: center; cursor: pointer;
}
.busy .icon-btn svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 메인 문장 ── */
.hero { text-align: center; padding: 18px 8px 22px; }
.headline {
  font-size: clamp(32px, 9.5vw, 40px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.sub { margin-top: 8px; font-size: 17px; font-weight: 500; }
.detail { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.hilo { margin-top: 6px; font-size: 15px; font-weight: 500; }
.hilo .up, .hilo .down, .hilo .same { font-size: 13px; }

.up { color: var(--up); }
.down { color: var(--down); }
.same { color: var(--muted); }

/* ── 반투명 카드 ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.card-title { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 6px; }
.stat { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-icon { height: 36px; display: grid; place-items: center; }
.stat-value { font-size: 16px; font-weight: 600; }
.stat-name { font-size: 12px; color: var(--muted); }
.dust-1 .stat-icon { color: #7ee0a1; }
.dust-2 .stat-icon { color: #9fd8ff; }
.dust-3 .stat-icon { color: #ffc56b; }
.dust-4 .stat-icon { color: #ff7d7d; }

/* ── 시간별 ── */
.hourly { padding: 12px 0 10px; }
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0 12px 6px; padding: 3px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.seg button {
  border: 0; background: transparent; padding: 6px 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg button.on { background: rgba(255, 255, 255, 0.24); color: var(--text); }

.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hrow { display: flex; padding-right: 8px; }
.side {
  flex: 0 0 44px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  font-size: 11px; color: var(--muted); line-height: 1.2;
}
.side-diff { height: 30px; display: flex; align-items: center; text-align: center; }
.side-pop { height: 22px; display: flex; align-items: center; font-size: 14px; }
.cols { position: relative; display: flex; }
.line {
  position: absolute; left: 0; top: 74px; /* day+time+wx 높이 */
  color: rgba(255, 255, 255, 0.75); pointer-events: none;
}
.col { flex: 0 0 64px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.day { height: 16px; font-size: 11px; color: var(--muted); }
.time { height: 20px; font-size: 13px; font-weight: 500; }
.col.now .time { font-weight: 700; }
.wx { height: 38px; font-size: 24px; display: grid; place-items: center; }
.plot { position: relative; height: 74px; width: 100%; }
.val { position: absolute; left: 0; right: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.diff { height: 30px; display: flex; align-items: center; font-size: 14px; font-weight: 600; }
.pop { height: 22px; font-size: 12px; color: var(--muted); display: flex; align-items: center; }

/* ── 옷차림 ── */
.outfit { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.outfit-icon { font-size: 30px; }
.outfit-title { font-size: 16px; font-weight: 600; }
.tags { margin-top: 4px; font-size: 14px; color: var(--down); }

.yesterday { padding: 14px 16px; font-size: 15px; }

.foot { font-size: 11px; color: var(--muted); line-height: 1.6; text-align: center; padding-top: 4px; }

/* ── 지역 시트 ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0, 0, 0, 0); transition: background 0.2s;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop[hidden] { display: none; }
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.45); }
.sheet {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: #1c2440; color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px);
  transform: translateY(100%); transition: transform 0.2s ease-out;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h2 { font-size: 20px; font-weight: 700; }
.text-btn { border: 0; background: transparent; font-size: 16px; font-weight: 600; color: var(--down); cursor: pointer; padding: 6px; }
.search {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.1); color: var(--text);
  font: inherit; font-size: 16px; /* 16px 미만이면 아이폰이 확대해 버린다 */
  outline: none;
}
.search::placeholder { color: var(--muted); }
.list { list-style: none; margin-top: 6px; }
.row { display: flex; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.row.muted { padding: 12px 4px; color: var(--muted); font-size: 14px; }
.row-main {
  flex: 1; display: flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 13px 4px; font-size: 16px; text-align: left; cursor: pointer;
}
.row-main span:first-of-type { flex: 1; }
.row.on .row-main { font-weight: 700; }
.check, .plus { color: var(--down); font-weight: 700; }
.row-del { border: 0; background: transparent; color: #ff8f8f; font-size: 14px; padding: 10px 6px; cursor: pointer; }
.gps-btn {
  margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px; cursor: pointer;
  background: rgba(159, 203, 255, 0.16); color: var(--down); font-size: 16px; font-weight: 600;
}
.list-title { margin-top: 20px; font-size: 13px; color: var(--muted); }
.sheet-hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
