:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #6b7a90;
  --line: #e3e8ef;
  --orange: #f97316;
  --orange-2: #fb923c;
  --orange-deep: #c2410c;
  --blue: #3b82f6;
  --navy: #0f172a;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

.phone { max-width: 430px; margin: 0 auto; min-height: 100dvh; background: var(--surface); box-shadow: 0 0 60px rgba(15, 23, 42, .10); position: relative; }
@media (min-width: 520px) { .phone { margin: 18px auto 40px; min-height: calc(100dvh - 58px); border-radius: 26px; overflow: hidden; } }

.app { min-height: inherit; display: flex; flex-direction: column; }

/* ───────── 상단바 ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(227, 232, 239, .7);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #f97316, #ea580c 60%, #9a3412); box-shadow: 0 4px 10px rgba(234, 88, 12, .28); }
.brand-name { font-weight: 800; letter-spacing: -.3px; font-size: 16px; }
.brand-ver { font-size: 10px; font-weight: 700; letter-spacing: .4px; color: var(--orange-deep); background: #fff1e6; border-radius: 6px; padding: 2px 5px; }
.icon-btn { border: 0; background: transparent; color: var(--ink-2); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn:active { background: var(--surface-2); }

/* ───────── 뷰 ───────── */
main { flex: 1; }
.view { display: none; padding: 12px 14px calc(96px + var(--safe-b)); }
.view.is-active { display: block; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 2px 12px; }
.view-title { margin: 0; font-size: 22px; letter-spacing: -.5px; font-weight: 800; }
.view-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.head-badge { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; background: #fff1e6; color: var(--orange-deep); font-weight: 800; display: grid; place-items: center; font-size: 15px; }

/* ───────── 검색 ───────── */
.search-zone { position: relative; z-index: 20; margin-bottom: 10px; }
.search-row { display: flex; gap: 8px; min-width: 0; }
.now-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 13px;
  padding: 0 12px; height: 44px; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.now-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px #ffedd5; }
.now-btn.is-loading .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.search { flex: 1; min-width: 0; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; height: 44px; padding: 0 6px 0 12px; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.search:focus-within { border-color: #fdba74; box-shadow: 0 0 0 3px #ffedd5; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; min-width: 0; }
.search input::placeholder { color: #9aa7b8; }
.search button { border: 0; background: var(--surface-2); color: var(--ink-2); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.recent-chips { margin-top: 9px; min-height: 0; }
.recent-chips:empty { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip .x { color: #a8b3c2; font-size: 12px; margin-left: 1px; }
.chip:active { background: var(--surface-2); }
.chip.toggle[aria-pressed="true"] { background: #fff1e6; border-color: #fdba74; color: var(--orange-deep); }
.suggest {
  position: absolute; left: 0; right: 0; top: 50px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15,23,42,.16); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 13px; border-bottom: 1px solid #f1f4f8; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:active { background: #f8fafc; }
.suggest-item .s-ico { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.suggest-item .s-main { flex: 1; min-width: 0; }
.suggest-item .s-name { display: block; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .s-sub { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .s-tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }

/* ───────── 카드 공통 ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: 14px; letter-spacing: -.2px; font-weight: 800; }
.muted { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.muted-text { color: var(--muted); }
.tiny-note { color: var(--muted); font-size: 11px; line-height: 1.45; }

/* ───────── 메인 빛 카드 (Vibe 배경) ───────── */
.place-card {
  border: 0; color: #fff; padding: 16px 16px 14px; overflow: hidden;
  background: linear-gradient(150deg, var(--vibe-1, #0f172a) 0%, var(--vibe-2, #1e293b) 55%, var(--vibe-3, #334155) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
  position: relative;
  transition: background .6s ease;
}
.place-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, rgba(255,255,255,.16), transparent 60%);
}
.place-card[data-vibe="night"] { --vibe-1:#070d18; --vibe-2:#111c2f; --vibe-3:#1e2b42; }
.place-card[data-vibe="dawn"]  { --vibe-1:#081426; --vibe-2:#123055; --vibe-3:#2a4d7a; }
.place-card[data-vibe="morning"] { --vibe-1:#2a1206; --vibe-2:#7c2d12; --vibe-3:#c2410c; }
.place-card[data-vibe="day"] { --vibe-1:#0a2233; --vibe-2:#0f3d52; --vibe-3:#15657f; }
.place-card[data-vibe="evening"] { --vibe-1:#2b0f06; --vibe-2:#8a2c0b; --vibe-3:#d4550f; }
.place-card[data-vibe="dusk"] { --vibe-1:#081426; --vibe-2:#173a63; --vibe-3:#3b5f8a; }
.place-card[data-vibe="otherday"] { --vibe-1:#101a2b; --vibe-2:#1f2d45; --vibe-3:#34455f; }

.place-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.place-kicker { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.62); letter-spacing: .1px; }
.place-name { margin: 1px 0 0; font-size: 25px; line-height: 1.2; letter-spacing: -.8px; font-weight: 800; }
.place-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.ghost-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 10px; padding: 7px 10px; font-size: 12px; font-weight: 700;
}
.place-card .ghost-btn { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.1); color: #fff; backdrop-filter: blur(4px); padding: 6px 9px; font-size: 11.5px; }
.place-card .ghost-btn[aria-pressed="true"] { background: rgba(255,255,255,.9); color: var(--navy); }
.ghost-btn.danger { color: var(--bad); border-color: #fecaca; }

.date-nav { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; position: relative; z-index: 1; }
.date-nav > button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff; font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.date-label { display: flex; align-items: center; gap: 7px; margin: 0 2px; }
.date-label span { font-size: 13px; font-weight: 700; }
.date-label em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #ffd7b8; background: rgba(255,255,255,.12); padding: 2px 6px; border-radius: 6px; }
.date-nav .today-btn { width: auto; padding: 0 9px; font-size: 11px; margin-left: auto; border-style: dashed; }

.solar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; z-index: 1; margin-top: 8px; }
.solar-item { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; }
.solar-item .k { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.62); display: flex; align-items: center; gap: 5px; }
.solar-item .k i { width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; }
.solar-item.blue .k i { background: #60a5fa; }
.solar-item.set .k i { background: #fb923c; }
.solar-item .v { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14.5px; letter-spacing: -.2px; margin-top: 1px; }
.solar-item .v small { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.5); margin-left: 5px; white-space: nowrap; }
.solar-item.is-now { background: rgba(251, 146, 60, .18); border-color: rgba(253, 186, 116, .55); box-shadow: 0 0 0 1px rgba(251,146,60,.15) inset; }
.phase-line { margin-top: 10px; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: #ffe4cc; position: relative; z-index: 1; }
.phase-line .pip { width: 7px; height: 7px; border-radius: 50%; background: #fb923c; box-shadow: 0 0 0 3px rgba(251,146,60,.22); }
.phase-line.dim { color: rgba(255,255,255,.55); font-weight: 600; }
.phase-line.dim .pip { background: rgba(255,255,255,.35); box-shadow: none; }

/* 태양 궤적 SVG */
.sunarc { position: relative; z-index: 1; margin: 10px -2px 0; }
.sunarc svg { display: block; width: 100%; height: auto; overflow: visible; }
.sunarc .arc-base { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 10; stroke-linecap: round; }
.sunarc .arc-seg { fill: none; stroke-width: 10; stroke-linecap: butt; }
.sunarc .arc-dash { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 1; stroke-dasharray: 2 4; }
.sunarc .arc-label { fill: rgba(255,255,255,.55); font-size: 9.5px; font-weight: 600; }
.sunarc .sun-dot { filter: drop-shadow(0 0 6px rgba(251, 191, 36, .8)); }
.sunarc .sun-dot circle { fill: #fde68a; }
.sunarc .sun-ring { fill: none; stroke: rgba(253, 230, 138, .5); stroke-width: 2; }
.sunarc .horizon-label { fill: rgba(255,255,255,.72); font-size: 9.5px; font-weight: 700; }

/* ───────── 나침반 패널 ───────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.panel-head strong { font-size: 13.5px; }
.panel-head span { font-size: 11.5px; color: var(--muted); }
#compassSvg { display: block; width: 100%; height: auto; max-height: 260px; margin: 2px auto 0; }
.compass-legend { display: flex; justify-content: center; gap: 14px; font-size: 11.5px; color: var(--ink-2); flex-wrap: wrap; }
.compass-legend span { display: inline-flex; align-items: center; gap: 5px; }
.compass-legend b { font-variant-numeric: tabular-nums; }
.lg { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg.sunrise { background: #fb923c; }
.lg.sunset { background: #ef4444; }
.lg.sun { background: #fbbf24; }
.map-links { display: flex; gap: 6px; margin-top: 10px; }
.map-links a { flex: 1; text-align: center; font-size: 11.5px; font-weight: 700; padding: 7px 0; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); }

/* ───────── 일출·일몰 시간대 카드 ───────── */
.window-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f4f8; }
.window-row:last-child { border-bottom: 0; padding-bottom: 0; }
.window-row .w-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #fff7ed; color: var(--orange-deep); font-size: 13px; flex: 0 0 auto; }
.window-row.night .w-ico { background: #eef4ff; color: #1d4ed8; }
.window-row .w-main { flex: 1; min-width: 0; }
.window-row .w-title { font-size: 12.5px; font-weight: 700; }
.window-row .w-sub { font-size: 11px; color: var(--muted); }
.window-row .w-val { text-align: right; font-variant-numeric: tabular-nums; max-width: 92px; }
.window-row .w-val .badge-txt { font-size: 10.5px; font-weight: 800; line-height: 1.3; display: block; }
.window-row .w-val b { font-size: 14px; }
.window-row .w-val small { display: block; font-size: 10.5px; color: var(--muted); }
.skeleton-line { height: 54px; border-radius: 10px; background: linear-gradient(90deg, #f1f4f8 25%, #e8edf4 37%, #f1f4f8 63%); background-size: 400% 100%; animation: sk 1.4s infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ───────── 7일 예보 ───────── */
.week-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; }
.week-strip::-webkit-scrollbar { display: none; }
.week-loading { color: var(--muted); font-size: 12px; padding: 18px 0; width: 100%; text-align: center; }
.day-card {
  flex: 0 0 82px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 13px; padding: 8px 6px 7px; text-align: center;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
.day-card.is-today { border-color: #fdba74; background: linear-gradient(180deg, #fff8f1, #fff); }
.day-card .d-name { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.day-card .d-date { font-size: 9.5px; color: var(--muted); }
.day-card .d-ico { font-size: 20px; line-height: 1.3; margin: 3px 0 1px; }
.day-card .d-cloud { font-size: 11px; font-weight: 700; }
.day-card .d-rain { font-size: 10px; color: #2563eb; font-weight: 600; }
.day-card .d-pm { font-size: 9.5px; font-weight: 700; margin-top: 2px; }
.day-card .d-sunset { font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 3px; }
.day-card .d-badge { font-size: 9px; font-weight: 800; border-radius: 5px; padding: 2px 4px; margin-top: 4px; display: inline-block; }
.d-badge.good { background: #fff1e6; color: var(--orange-deep); }
.d-badge.night { background: #eef2ff; color: #3730a3; }
.pm-good { color: var(--good); } .pm-mid { color: #0f766e; } .pm-warn { color: var(--warn); } .pm-bad { color: var(--bad); }
.weather-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.weather-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 11px; padding: 10px; font-size: 12px; color: #9a3412; }
.weather-error button { border: 1px solid #fdba74; background: #fff; color: #9a3412; font-weight: 700; border-radius: 8px; padding: 5px 9px; font-size: 11.5px; }

/* ───────── 스팟 ───────── */
.section-head { display: block; margin: 18px 2px 9px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.section-head .muted { display: block; margin-top: 2px; }
.spot-list { display: flex; flex-direction: column; gap: 8px; }
.spot-card {
  display: flex; gap: 11px; align-items: stretch; text-align: left; width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.spot-card:active { background: #fbfcfe; }
.spot-thumb { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 10px; background: var(--surface-2); object-fit: cover; }
.spot-thumb.ph { display: grid; place-items: center; color: #cbd5e1; font-size: 20px; }
.spot-main { flex: 1; min-width: 0; }
.spot-name-row { display: flex; align-items: center; gap: 6px; }
.spot-name { font-size: 14px; font-weight: 800; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-dist { font-size: 11px; color: var(--orange-deep); font-weight: 700; flex: 0 0 auto; }
.spot-meta { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-reason { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.tag { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #fff1e6; color: var(--orange-deep); }
.tag.t-night { background: #eef2ff; color: #3730a3; }
.tag.t-sunrise { background: #fff7e6; color: #b45309; }
.tag.t-silhouette { background: #f4f1ff; color: #5b21b6; }
.tag.t-season { background: #ecfdf5; color: #047857; }
.tag.t-fee { background: #eef6ff; color: #1d4ed8; }
.tag.t-unknown { background: #f1f5f9; color: #64748b; }
.spot-empty { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 18px 14px; text-align: center; color: var(--muted); font-size: 12px; background: #fbfcfe; }
.spot-empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.district-chips { margin-top: 10px; }
.notice-line { font-size: 11.5px; color: var(--muted); margin: -2px 2px 8px; }

/* ───────── 공모전 ───────── */
.contest-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.segment { flex: 1; display: flex; background: #f1f4f8; border-radius: 11px; padding: 3px; }
.segment button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 7px 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.segment button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
#contestSort { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 8px 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.filter-chips { align-items: center; margin-bottom: 10px; }
.contest-list { display: flex; flex-direction: column; gap: 9px; }
.contest-card { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 12px 12px 10px; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.contest-card.is-fav { border-color: #fdba74; box-shadow: 0 6px 18px rgba(249,115,22,.10); }
.contest-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.dday { font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 2px 7px; background: #fff1e6; color: var(--orange-deep); }
.dday.soon { background: #fee2e2; color: #b91c1c; }
.dday.today { background: #dc2626; color: #fff; }
.dday.closed { background: #f1f5f9; color: #64748b; }
.fav-btn { margin-left: auto; border: 0; background: transparent; font-size: 18px; line-height: 1; color: #cbd5e1; padding: 2px 0 2px 8px; }
.fav-btn.on { color: #f59e0b; }
.contest-title { margin: 0 0 3px; font-size: 14.5px; font-weight: 800; letter-spacing: -.3px; line-height: 1.35; }
.contest-host { font-size: 11.5px; color: var(--muted); }
.contest-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.contest-info .tag-row { margin-top: 0; }
.link-btn { border: 0; background: transparent; color: var(--orange-deep); font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.closed-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; background: #fbfcfe; }
.closed-box summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.closed-box summary::-webkit-details-marker { display: none; }
.closed-box summary b { font-size: 11px; color: var(--muted); font-weight: 700; }
.source-line { font-size: 10.5px; color: var(--muted); margin: 14px 2px 0; line-height: 1.5; }
.contest-empty { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 12.5px; border: 1px dashed #dbe2ea; border-radius: 14px; }

/* ───────── 메모 ───────── */
.primary-btn { border: 0; background: linear-gradient(140deg, #f97316, #ea580c); color: #fff; font-weight: 800; font-size: 13px; border-radius: 11px; padding: 9px 13px; box-shadow: 0 6px 14px rgba(234,88,12,.24); }
.primary-btn:active { transform: translateY(1px); }
.memo-tools { margin-bottom: 10px; }
.memo-tools input[type="search"] { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 12px; outline: 0; font-size: 13px; }
.memo-tools input[type="search"]:focus { border-color: #fdba74; box-shadow: 0 0 0 3px #ffedd5; }
.memo-tools .chips { margin-top: 8px; }
.memo-list { display: flex; flex-direction: column; gap: 8px; }
.memo-card { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.03); text-align: left; width: 100%; }
.memo-card .m-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.m-badge { font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: #eef2ff; color: #3730a3; }
.m-badge.spot { background: #fff1e6; color: var(--orange-deep); }
.m-badge.composition { background: #ecfeff; color: #0e7490; }
.m-badge.contest { background: #f4f1ff; color: #5b21b6; }
.m-status { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.m-date { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.m-title { font-size: 14px; font-weight: 800; letter-spacing: -.2px; }
.m-body { font-size: 12px; color: var(--ink-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.m-contest { font-size: 11px; color: #5b21b6; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-foot { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 16px; }
.memo-empty { text-align: center; padding: 34px 14px; color: var(--muted); font-size: 12.5px; border: 1px dashed #dbe2ea; border-radius: 14px; }
.memo-empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* ───────── 탭바 ───────── */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 40;
  width: 100%; max-width: 430px; display: flex;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(7px + var(--safe-b));
}
.tab { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #97a4b5; font-size: 10.5px; font-weight: 700; padding: 5px 0 3px; border-radius: 10px; }
.tab .tab-ico { font-size: 17px; line-height: 1.2; }
.tab.is-active { color: var(--orange-deep); }
.tab.is-active .tab-ico { transform: translateY(-1px); }

/* ───────── 모달 ───────── */
.sheet { border: 0; padding: 0; background: transparent; width: 100%; max-width: 430px; margin: auto auto 0; }
.sheet::backdrop { background: rgba(8, 15, 30, .45); backdrop-filter: blur(2px); }
.sheet-inner { background: #fff; border-radius: 20px 20px 0 0; max-height: 88dvh; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(8,15,30,.24); }
@media (min-width: 520px) { .sheet { margin: auto; } .sheet-inner { border-radius: 20px; max-height: 82dvh; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.sheet-body { padding: 14px 16px; overflow-y: auto; }
.sheet-foot { padding: 10px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.sheet-foot .ghost-btn { margin-right: auto; }
.set-block { margin-bottom: 18px; }
.set-block h3 { margin: 0 0 7px; font-size: 12px; letter-spacing: .2px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.source-list { list-style: none; margin: 0 0 8px; padding: 0; }
.source-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid #f1f4f8; }
.source-list li:last-child { border-bottom: 0; }
.source-list b { font-size: 12.5px; }
.source-list span { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.info-grid { display: grid; grid-template-columns: 64px 1fr; gap: 6px 8px; margin: 0; font-size: 12px; }
.info-grid dt { color: var(--muted); font-weight: 600; }
.info-grid dd { margin: 0; font-weight: 600; }
.set-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; background: #fbfcfe; font-size: 13px; outline: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #fdba74; background: #fff; box-shadow: 0 0 0 3px #ffedd5; }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

/* ───────── 토스트 ───────── */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translate(-50%, 14px);
  background: #0f172a; color: #fff; font-size: 12px; font-weight: 600; padding: 9px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .22s ease; z-index: 90; max-width: 82vw; text-align: center;
  box-shadow: 0 10px 24px rgba(8,15,30,.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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