:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --line: #e3e7e2;
  --text: #1c2320;
  --muted: #5d6762;
  --pine: #1f6b4f;
  --pine-deep: #0f3b2c;
  --pine-ink: #ffffff;
  --pine-soft: #e2efe7;
  --buoy: #ff6a13;
  --buoy-ink: #b84300;
  --on-buoy: #241000;
  --star: #f2a900;
  --bell-bg: #fff3c4;
  --bell-ink: #9a6a00;
  --sun: #d2402c;
  --sat: #2a63c4;
  --warn-bg: #fff1df;
  --warn-ink: #8a4b00;
  --scrim: rgb(10 20 15 / .5);
  color-scheme: light;
}
/* 어둡게: 설정에서 고르거나 '기기 설정 따라'일 때 (index.html 머리 스크립트가 data-theme 을 단다) */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1311;
    --surface: #171e1a;
    --line: #27302b;
    --text: #e7ece9;
    --muted: #9ba59f;
    --pine: #4fb487;
    --pine-ink: #06170f;
    --pine-soft: #1c2c24;
    --buoy-ink: #ff8f4d;
    --sun: #ff7a66;
    --sat: #7da7ff;
    --bell-bg: #3a3114;
    --bell-ink: #ffcf4d;
    --warn-bg: #3a2914;
    --warn-ink: #ffc98a;
}

/* touch-action: 두 번 톡 확대(화면 밀림)만 막고 핀치 확대는 둔다. 안쪽 스크롤 칸마다 따로 계산돼서 * 에 건다 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 "Pretendard Variable", Pretendard, system-ui, sans-serif;
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p { margin: 0; }
b { font-weight: 650; }
small { font-size: .8125rem; font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--buoy-ink); font-size: .9375rem; min-height: 1.4em; }
.vacant { color: var(--buoy-ink); font-weight: 700; white-space: nowrap; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- 휴대폰 틀 ---------- */
/* --top: 화면 위 여백. 휴대폰은 상태 표시줄, PC 의 휴대폰 틀은 둥근 모서리만큼 */
.phone { --top: env(safe-area-inset-top, 0px); overflow: clip; background: var(--bg); }
/* 휴대폰: 100dvh 는 아이폰 홈 화면 앱에서 가끔 짧게 잡혀 아래가 빈다 → 화면 네 변에 붙인다 */
@media (max-width: 759.98px) { .phone { position: fixed; inset: 0; } }
.desk-note { display: none; }

@media (min-width: 760px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 64px;
    min-height: 100vh;
    background: #e6e1d6 radial-gradient(circle at 20% 15%, #f2efe8 0, transparent 55%);
  }
  .phone {
    --top: 26px;
    position: relative;
    width: 390px;
    height: min(844px, calc(100vh - 48px));
    border-radius: 52px;
    border: 11px solid #121614;
    box-shadow: 0 30px 60px -20px rgb(20 30 25 / .45), 0 0 0 1px #2a302d;
    flex: none;
  }
  .phone * { scrollbar-width: none; }
  .desk-note { display: grid; gap: .5rem; max-width: 220px; color: #2b332f; }
  .desk-note b { font-size: 2rem; font-weight: 800; color: var(--pine-deep); letter-spacing: -.02em; }
  .desk-note .muted { color: #5b625e; font-size: .9375rem; }
}
@media (min-width: 760px) {
  [data-theme="dark"] body { background: #0b0f0d; }
  [data-theme="dark"] .desk-note, [data-theme="dark"] .desk-note b { color: #cfd8d3; }
  [data-theme="dark"] .desk-note .muted { color: #8d9792; }
}

/* ---------- 공통 버튼 · 입력 ---------- */
.btn {
  min-height: 44px;
  padding: 0 1.125rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.btn.accent { background: var(--buoy); border-color: var(--buoy); color: var(--on-buoy); }
.btn.small { min-height: 40px; padding: 0 .875rem; font-size: .9375rem; border-radius: 10px; }
.btn.block { width: 100%; min-height: 52px; font-size: 1.0625rem; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg, .icon svg { width: 20px; height: 20px; }
.icon {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 12px; background: none; color: var(--muted);
  font: inherit; font-size: 1.5rem; cursor: pointer;
}
.icon:disabled { opacity: .3; }
.link { background: none; border: 0; padding: .25rem; min-height: 32px; color: var(--muted); font: inherit; font-size: .875rem; text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 .875rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { padding: .75rem .875rem; resize: vertical; line-height: 1.5; }
.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; min-width: 0; }

/* 밤 캠핑장 일러스트 (scripts/make_art.py). 아래 곡선은 페이지 바탕색으로 이어 준다 */
.scene { display: block; width: calc(100% + 48px); max-width: none; margin: 14px -24px 0; }
.merge { position: absolute; left: 0; bottom: -1px; width: 100%; height: 18px; fill: var(--bg); }
.empty-art { width: 168px; height: auto; margin-bottom: -4px; }

/* ---------- 첫 화면들 ---------- */
.screen { position: absolute; inset: 0; overflow-y: auto; }
.intro { display: flex; flex-direction: column; }
.intro-top {
  position: relative;
  padding: calc(48px + var(--top)) 24px 0;
  background: linear-gradient(180deg, var(--pine-deep), #1a5a42);
  color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .75rem;
}
.logo { font-size: 1.125rem; font-weight: 800; color: #bfe3cf; letter-spacing: .02em; }
.tagline { font-size: 1.875rem; line-height: 1.3; font-weight: 750; letter-spacing: -.02em; }
.intro-body { padding: 20px 24px calc(32px + env(safe-area-inset-bottom)); display: grid; gap: .75rem; align-content: start; }
.intro-body h1 { font-size: 1.375rem; font-weight: 750; }
.intro-body label { font-weight: 650; font-size: .9375rem; }
.hint { font-size: .875rem; color: var(--muted); background: var(--surface); padding: .75rem; border-radius: 12px; }
.who-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .625rem; }
.who {
  min-height: 72px; padding: .75rem;
  display: flex; align-items: center; gap: .75rem;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 650; font-size: 1.0625rem; cursor: pointer; text-align: left;
}
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pine-soft); color: var(--pine); font-weight: 800;
}

/* ---------- 앱 뼈대 ---------- */
#app { position: absolute; inset: 0; display: flex; flex-direction: column; }
#scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }

.tabs {
  flex: none;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  min-height: 60px;
  display: grid; justify-items: center; align-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabs button[aria-current] { color: var(--pine); }
.tabs button[aria-current] svg { fill: var(--pine-soft); }

.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--top)) 20px 12px;
  background: var(--bg);
}
.bar h1 { font-size: 1.625rem; font-weight: 800; letter-spacing: -.02em; }
.sec { font-size: 1.0625rem; font-weight: 750; margin: 28px 20px 10px; display: flex; align-items: baseline; gap: .5rem; }
.sec .more { margin-left: auto; text-decoration: none; color: var(--pine); font-weight: 650; }
.bar-sub { margin: 0 20px 12px; font-size: .875rem; color: var(--muted); word-break: keep-all; }

/* ---------- 오픈 일정 ---------- */
.op-day + .op-day { margin-top: 18px; }
.op-day h3 { margin: 0 20px 8px; font-size: .9375rem; font-weight: 600; color: var(--muted); }
.op-day h3 b { color: var(--text); font-weight: 750; margin-right: 2px; }
.op-day h3.sat b { color: var(--sat); }
.op-day h3.sun b { color: var(--sun); }
.row.op { align-items: flex-start; gap: 12px; }
.row.op + .row.op::before { left: 74px; }
.op-time { width: 48px; flex: none; padding-top: 1px; font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.op-time small { display: block; font-size: .6875rem; font-weight: 650; color: var(--muted); line-height: 1.3; }
.row.op .grow.tap { cursor: pointer; }
.row.op .grow > b { line-height: 1.35; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 3px; }
.pill { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--pine-soft); color: var(--pine); }
.pill.soft { background: var(--bg); color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.op-side { display: grid; justify-items: end; gap: 2px; margin: -8px -4px 0 0; }
.dday { font-size: .75rem; font-weight: 750; color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 8px; }
.dday.soon { color: var(--buoy-ink); }

/* 홈: 곧 열리는 예약 카드 (가로로 넘김) */
.op-cards { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scroll-padding-inline: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.op-cards::-webkit-scrollbar { display: none; }
.op-card {
  flex: none; width: 188px; padding: 12px 14px 16px; scroll-snap-align: start;
  background: var(--surface); border-radius: 20px; cursor: pointer;
  display: grid; align-content: start; gap: 2px;
}
.op-card-top { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 4px 0; }
.op-card .dday { padding: 3px 9px; border-radius: 999px; background: var(--bg); }
.op-card .dday.soon { background: var(--buoy); color: var(--on-buoy); }
.op-when { display: flex; align-items: baseline; gap: 6px; }
.op-when b { font-size: 1.625rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.op-when span { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.op-name { margin-top: 6px; font-size: .9375rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.op-sub { font-size: .8125rem; color: var(--muted); }
.op-card.lead { background: linear-gradient(160deg, var(--pine-deep), #1d5f46); color: #fff; }
.op-card.lead .op-when span, .op-card.lead .op-sub { color: #bfe3cf; }
.op-card.lead .dday { background: rgb(255 255 255 / .14); color: #fff; }
.op-card.lead .dday.soon { background: var(--buoy); color: var(--on-buoy); }
.op-card.lead .bell { color: #d6ece0; }
.op-card.lead .bell[aria-pressed="true"] { background: rgb(255 255 255 / .16); }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
/* 켠 종: 노란 동그라미 위 채운 노란 종 */
.bell { border-radius: 50%; transition: background-color .15s; }
.bell[aria-pressed="true"] { color: var(--bell-ink); background: var(--bell-bg); }
.bell[aria-pressed="true"] svg { fill: var(--star); stroke: var(--bell-ink); }
.op-unknown { margin: 22px 0 0; }
.op-unknown summary { margin: 0 20px 10px; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--muted); cursor: pointer; }
.op-unknown .grow p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 캠핑장 시트: 예약 시작 일정 — 가장 가까운 것 크게, 나머지는 조용한 목록 */
.sched-head { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.sched-head .sub { margin: 0; }
.sn { position: relative; margin-top: 8px; padding: 16px 18px; border-radius: 18px; background: var(--pine-soft); }
.sn-date { font-size: .875rem; font-weight: 650; color: var(--pine); }
.sn-time { margin: 2px 0 4px; font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.sn-time.unknown { font-size: 1.375rem; }
.sn-who { font-size: .9375rem; font-weight: 600; }
.sn-left { position: absolute; top: 14px; right: 14px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--pine); font-size: .8125rem; font-weight: 750; }
.sn-left.soon { background: var(--buoy); color: var(--on-buoy); }
.sched-more { list-style: none; margin: 4px 0 0; padding: 0; }
.sched-more li { display: flex; align-items: baseline; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.sched-more b { font-weight: 700; min-width: 52px; }
.sched-more .muted { flex: 1; min-width: 0; }
.sched-rule { margin: 10px 0 14px; font-size: .8125rem; color: var(--muted); line-height: 1.55; word-break: keep-all; }
.bell-label { display: inline-flex; align-items: center; font-size: .8125rem; font-weight: 650; color: var(--muted); margin-right: -10px; }
.next-opens { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 4px; }
.next-opens li { font-weight: 600; }
.next-opens .num { display: inline-block; min-width: 82px; }
.next-opens em { font-style: normal; font-size: .8125rem; color: var(--buoy-ink); margin-left: 4px; }
.pick-grid { margin-top: 12px; display: grid; gap: 16px; }

/* ---------- 홈 ---------- */
.hero {
  position: relative;
  padding: calc(28px + var(--top)) 24px 0;
  background: linear-gradient(170deg, var(--pine-deep) 0%, #17553f 60%, #1f6b4f 100%);
  color: #fff;
}
.hello { color: #bfe3cf; font-weight: 650; }
.hero h1 { font-size: 1.75rem; line-height: 1.3; font-weight: 800; letter-spacing: -.02em; margin-top: .25rem; max-width: 15em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 0; position: relative; z-index: 1; }
.stats div + div { border-left: 1px solid rgb(255 255 255 / .18); padding-left: 14px; }
.stats dt { font-size: .8125rem; color: #bfe3cf; }
.stats dd { margin: 2px 0 0; font-size: 1.5rem; font-weight: 800; }

.setup {
  margin: -8px 16px 0; position: relative; z-index: 1;
  display: flex; align-items: center; gap: .75rem;
  padding: 14px 14px 14px 16px;
  background: var(--surface); border-radius: 16px;
  border: 1px solid var(--line);
}
.setup > div { flex: 1; min-width: 0; }
.setup p { font-size: .875rem; color: var(--muted); }

.open-list { display: grid; gap: 10px; padding: 0 16px; }
.open-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 16px;
  background: var(--surface); border-radius: 18px;
}
.open-card .date {
  width: 52px; flex: none; padding-right: 14px;
  display: grid; justify-items: center; line-height: 1.15;
  border-right: 1px solid var(--line);
}
.open-card .date b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
.open-card .date span { font-size: .6875rem; font-weight: 600; color: var(--muted); }
.open-card .date.sat b { color: var(--sat); }
.open-card .date.sun b { color: var(--sun); }
.open-card .what { flex: 1; min-width: 0; }
.open-card .what p { font-size: .875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-box { margin: 0 16px; padding: 24px 16px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; border: 1.5px dashed var(--line); border-radius: 16px; }
.rows .empty-box { list-style: none; }

/* ---------- 목록 ---------- */
.rows { list-style: none; margin: 0 16px; padding: 0; background: var(--surface); border-radius: 18px; overflow: hidden; }
.rows:has(> .empty-box) { background: none; margin: 0; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 12px 14px 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 78px; right: 0; border-top: 1px solid var(--line); }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--pine-soft); }
.row.expired { opacity: .5; }
.grow { flex: 1; min-width: 0; }
.grow > b { display: block; font-size: 1rem; }
.grow p { font-size: .875rem; }
.chev { width: 10px; height: 10px; flex: none; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); margin-right: 8px; opacity: .6; }

.tile {
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff; font-size: .8125rem; font-weight: 750;
  background: #1f6b4f;
}
.tile.r-seoul { background: #8a542a; }
.tile.r-north { background: #1f6b4f; }
.tile.r-south { background: #2b6a88; }
.tile.r-incheon { background: #35558f; }
.tile.r-chung { background: #646422; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: .75rem; font-weight: 650; padding: 1px 7px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.tag.on { background: var(--pine-soft); color: var(--pine); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }

.star svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.star[aria-pressed="true"] { color: var(--star); }
.star[aria-pressed="true"] svg { fill: var(--star); }
.del svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; min-height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
}
.chips button svg { width: 16px; height: 16px; fill: var(--star); }
.chips button[aria-selected="true"] { background: var(--pine-deep); border-color: var(--pine-deep); color: #fff; }

/* ---------- 설정 ---------- */
.group { margin: 0 16px 12px; background: var(--surface); border-radius: 18px; overflow: hidden; }
.group-title { margin: 20px 28px 8px; font-size: .8125rem; font-weight: 650; color: var(--muted); }
.cell {
  width: 100%; min-height: 56px; padding: 10px 14px 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 0; background: none; color: var(--text); font: inherit; text-align: left;
}
.cell + .cell { border-top: 1px solid var(--line); }
.cell.danger { color: var(--sun); font-weight: 650; justify-content: center; cursor: pointer; }
.toggle {
  appearance: none; width: 52px; min-height: 32px; height: 32px; padding: 0; flex: none;
  border: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .18s;
}
.toggle:checked { background: var(--pine); }
.toggle:checked::after { transform: translateX(20px); }

/* ---------- 레이어 (시트 · 안내 · 사진) ---------- */
.layer { position: absolute; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: var(--scrim); }
#sheet .scrim { opacity: 0; transition: opacity .26s; }
#sheet.on .scrim { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 0 20px;
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
#sheet.on .sheet { transform: none; }
@media (prefers-reduced-motion: reduce) {
  #sheet .scrim, .sheet, .btn, .toggle::after, #toast { transition: none; }
}
.grab { position: sticky; top: 0; height: 22px; margin: 0 -20px; background: var(--surface); z-index: 1; cursor: pointer; }
.grab::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
.sheet-head { position: relative; padding: 6px 48px 14px 0; display: grid; gap: 2px; }
.sheet-head h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.sheet-head .star { position: absolute; right: -8px; top: 0; }
.sheet-head p.muted { font-size: .875rem; }
.sub { font-size: 1.0625rem; font-weight: 750; margin: 24px 0 10px; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.link-row { display: flex; gap: 8px; margin-top: 10px; }
.link-row .btn { flex: 1; }
.sheet-foot {
  position: sticky; bottom: 0; margin: 24px -20px 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--surface) 22%);
}
.field { display: grid; gap: 6px; font-size: .875rem; font-weight: 650; color: var(--muted); }

.notes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.notes li { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; }
.notes .meta { font-size: .8125rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.note-form { display: grid; gap: 8px; }
.thumb.add {
  display: grid; place-content: center; justify-items: center; gap: 2px;
  border: 1.5px dashed var(--line); background: var(--surface); color: var(--muted);
  font-size: .75rem; font-weight: 650;
}
.thumb.add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.thumb.add:focus-within { outline: 2px solid var(--pine); outline-offset: 2px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--line); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.taken {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 0 2px;
  background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff;
  font-size: .6875rem; font-style: normal; font-weight: 650;
}
.thumb span { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgb(0 0 0 / .6); color: #fff; font-size: .875rem; line-height: 20px; }

/* 펼치기 (즐겨찾는 자리) */
.fold { margin-top: 20px; border-block: 1px solid var(--line); }
.fold summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 56px; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary b { font-size: 1.0625rem; font-weight: 750; }
.fold summary::after { content: ""; margin: 0 6px 4px auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.fold[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.fold[open] { padding-bottom: 16px; }
.fold .pick-grid { margin-top: 10px; }

/* 달력 */
.fav-pick {
  flex: none; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.fav-pick { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }
.fav-pick svg { width: 14px; height: 14px; fill: var(--star); }
.cal { background: var(--bg); border-radius: 18px; padding: 8px 10px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 1.0625rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.wd { font-size: .75rem; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal .d {
  aspect-ratio: 1; min-height: 40px; width: 100%;
  border: 0; border-radius: 50%; background: none; color: var(--text);
  font: inherit; font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.cal .sun, .wd.sun { color: var(--sun); }
.cal .sat, .wd.sat { color: var(--sat); }
.cal .d.today { box-shadow: inset 0 0 0 1.5px var(--muted); }
.cal .d.sel { background: var(--pine); color: var(--pine-ink); }
.cal .d:disabled { opacity: .28; cursor: default; }
.picked-days { margin-top: 8px; font-size: .875rem; font-weight: 650; color: var(--pine); min-height: 1.4em; }

.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--bg); border-radius: 14px; gap: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.seg button:disabled { opacity: .4; }

#site-grid { margin-top: 12px; display: grid; gap: 16px; }
.zone-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: .9375rem; }
.site-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.site-chips button {
  position: relative; min-height: 44px; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  font: inherit; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.site-chips button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.site-chips .is-fav::after { content: "★"; position: absolute; top: -1px; right: 3px; font-size: .625rem; color: var(--star); }

/* 아이폰 안내 */
#ios-guide { display: flex; align-items: flex-end; padding: 16px 16px calc(56px + env(safe-area-inset-bottom)); }
.guide { position: relative; width: 100%; background: var(--surface); border-radius: 22px; padding: 20px; display: grid; gap: 10px; }
.guide ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 4px; }
.arrow { position: absolute; left: 50%; bottom: -40px; margin-left: -12px; color: #fff; font-size: 2rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .arrow { animation: nudge 1.2s ease-in-out infinite; }
  @keyframes nudge { 50% { transform: translateY(6px); } }
}

.viewer { background: #000; display: grid; place-items: center; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .cap { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 6px; color: #fff; font-weight: 600; }
.viewer .cap a { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgb(255 255 255 / .16); color: #fff; text-decoration: none; }
.viewer .cap svg, .place svg, .taken svg { fill: none; stroke: currentColor; stroke-width: 2; }
.viewer .cap svg { width: 16px; height: 16px; }
.place { display: inline-flex; align-items: center; gap: 3px; min-height: 32px; color: var(--pine); font-size: .875rem; font-weight: 650; text-decoration: none; }
.place svg { width: 15px; height: 15px; }
.taken svg { display: inline; width: 10px; height: 10px; margin-right: 1px; vertical-align: -1px; }
.viewer .cap:empty { display: none; }
.viewer .close { position: absolute; top: calc(12px + var(--top)); right: 12px; color: #fff; font-size: 2rem; }

#toast {
  position: absolute; left: 50%; bottom: 84px; z-index: 30;
  max-width: calc(100% - 40px); padding: 12px 18px;
  background: #1c2320; color: #fff; border-radius: 14px;
  font-size: .9375rem; font-weight: 600; text-align: center;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 관리자 ---------- */
.bar .back { min-height: 44px; padding: 0 4px; font-size: 1rem; text-decoration: none; color: var(--pine); font-weight: 650; }
.bar:has(.back) h1 { font-size: 1.125rem; }
.cell.tap { cursor: pointer; }
.cell.top { align-items: flex-start; }
.cell small { font-size: .8125rem; }
.ad-actions { display: flex; gap: 10px; margin-top: 2px; }
.danger-link { color: var(--sun); }
.rule-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rule-row input, .rule-row select { min-width: 0; min-height: 40px; padding: 0 8px; }
.rule-row [data-rule-del] { justify-self: end; }
.rule-row .mini { display: flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.rule-row .mini input { width: 18px; min-height: 18px; }
#ad-site .rule-row:last-of-type { border-bottom: 0; }
.ad-evs li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ad-evs li.off { opacity: .45; text-decoration: line-through; }
.ad-evs li.off .link { text-decoration: underline; }

.code-input { flex: 1; min-height: 44px; text-align: center; letter-spacing: .12em; font-variant-numeric: tabular-nums; }

.cell.stack { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
.cell.stack .seg { grid-template-columns: repeat(3, 1fr); }
.cell.stack .seg button { min-height: 40px; font-size: .9375rem; }

/* 로그인 · PIN 패드 */
.pick-title { font-weight: 700; font-size: 1.0625rem; }
.sheet-head.center { text-align: center; padding-right: 0; justify-items: center; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 8px 0 4px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.pin-dots i.on { background: var(--pine); border-color: var(--pine); }
.pin-msg { text-align: center; min-height: 1.4em; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 8px calc(20px + env(safe-area-inset-bottom)); }
.pad button { min-height: 60px; border: 0; border-radius: 16px; background: var(--bg); color: var(--text); font: inherit; font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.pad button:active { background: var(--pine-soft); }
@media (prefers-reduced-motion: no-preference) {
  .pin-dots.shake { animation: shake .35s; }
  @keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
}
.empty-box.done { border: 0; margin: 12px 0 24px; }

/* 관리자 · 가족 줄: 상태는 작은 표시, 할 일은 ⋯ 메뉴로 */
.user-row { align-items: center; }
.user-row .pills { margin-bottom: 0; }
.more svg { width: 22px; height: 22px; fill: currentColor; }
.group.menu { margin: 0 0 calc(16px + env(safe-area-inset-bottom)); background: var(--bg); }
.group.menu .cell { font-weight: 600; justify-content: flex-start; }
