/* Home Manager — '밤 액자' 테마 (2026-10-20 시안 ③ 확정)
   짙은 잉크 바탕 · 호박색 포인트 · 그림자 없이 1px 선으로 칸 구분.
   벽 아이패드에서 늘 같은 모습이도록 다크 단일 테마로 고정한다. */
:root {
  --bg: #10141c;
  --card: #181e29;
  --ink: #e8e4da;
  --muted: #8e96a6;
  --line: #262e3c;
  --accent: #f0b65a;
  --accent-ink: #1a1408;
  --chip: #1f2735;
  --banner-ink: #f0d9a8;
  --warn: #f0b65a;   --warn-bg: #3a2f1c;
  --danger: #ff8f7d; --danger-bg: #3d1f1d;
  --ok: #8fd3b0;     --ok-bg: #1b3328;
  --focus: #7fa7e0;
  /* 가족 사람별 색 (시안 확정값) */
  --dad-bg: #22344d;  --dad-fg: #a9c4ec;  --dad-dot: #7fa7e0;
  --mom-bg: #3a2f1c;  --mom-fg: #f0d9a8;  --mom-dot: #f0b65a;
  --kid-bg: #33263d;  --kid-fg: #dcb8ea;  --kid-dot: #c79ad8;
  --fam-bg: #1b3328;  --fam-fg: #8fd3b0;  --fam-dot: #8fd3b0;

  --f-body: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --f-num: "Orbit", "IBM Plex Sans KR", -apple-system, sans-serif;
  --r: 12px; --r-sm: 8px; --r-xs: 4px;
  --tabbar-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display 를 준 요소도 hidden 이면 확실히 숨긴다 (야간 액자 등) */
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body);
  font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.splash { display: grid; place-items: center; height: 100dvh; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

/* ── 앱 틀 ─────────────────────────────────────────────── */
#app {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding-block: 14px 10px; }
.brand { background: none; border: 0; padding: 0; font-weight: 600; font-size: 1.15rem; letter-spacing: .02em; color: var(--ink); }
.today { color: var(--muted); font-size: .88rem; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); align-self: center; }
.live-dot.is-on { background: var(--ok); }
.clock { margin-left: auto; font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: 1.5rem; color: var(--banner-ink); line-height: 1; }
.view { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom, 0px)); }

/* 개인 모드 하단 탭 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tab { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; height: var(--tabbar-h);
  text-decoration: none; color: var(--muted); font-size: .72rem; }
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--accent); }
.tab-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-size: .66rem; font-weight: 600; display: grid; place-items: center; }

/* 벽걸이 모드: 한 화면에 다 들어가게, 칸 안에서만 스크롤 */
body.is-wall #app { height: 100dvh; min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
body.is-wall .topbar { padding-block: 16px 12px; }
body.is-wall .brand { font-size: 1.3rem; }
body.is-wall .today { font-size: 1rem; }
body.is-wall .clock { font-size: 2.6rem; }
body.is-wall .view { min-height: 0; padding-bottom: 16px; }
body.is-wall .dash-main { flex: 1; min-height: 0; }
body.is-wall .dash-main > * { min-height: 0; }

/* ── 공통 부품 ─────────────────────────────────────────── */
.page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.25rem; font-weight: 600; text-wrap: balance; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .82rem; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--chip); color: var(--ink); font-weight: 500; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--accent); font-size: .84rem; margin-left: auto; text-decoration: none; }

.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--muted); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }

.dday { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex: none; }
.dday.over { background: var(--danger-bg); color: var(--danger); }
.dday.soon { background: var(--warn-bg); color: var(--warn); }
.dday.ok { background: var(--ok-bg); color: var(--ok); }
.dday.later, .dday.none { background: var(--chip); color: var(--muted); }

.banner { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--chip); color: var(--banner-ink); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.banner b { font-weight: 600; }
.banner .go { margin-left: auto; color: var(--accent); font-size: .82rem; white-space: nowrap; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: .02em; }
.sub { color: var(--muted); font-size: .78rem; }
.panel-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.empty { color: var(--muted); font-size: .88rem; padding: 18px 4px; text-align: center; display: grid; gap: 10px; justify-items: center; }

.slot-empty { border-style: dashed; background: transparent; align-items: center; justify-content: center; min-height: 140px; }
.slot-empty span { color: var(--line); font-size: .82rem; letter-spacing: .08em; filter: brightness(1.6); }

/* ── 대시보드 (E-1) ────────────────────────────────────── */
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ov-card { text-decoration: none; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.metric { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--chip); }
.metric b { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: 1.6rem; line-height: 1.1; font-weight: 400; }
.metric span { font-size: .74rem; color: var(--muted); }
.metric.warn b { color: var(--warn); }
.metric.danger b { color: var(--danger); }

.dash-main { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1.2fr; gap: 12px; align-items: stretch; }
.split { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-width: 0; }
/* 대시보드 안 재고 칸은 버튼을 조금 줄여 이름이 덜 접히게 */
.dash-main .stepper button { width: 34px; height: 34px; }
.dash-main .qty { min-width: 40px; font-size: 1.05rem; }
.dash-main .inv-row { gap: 8px; }

/* ── 목록 행 ───────────────────────────────────────────── */
.rows { display: grid; }
.rows > * + * { border-top: 1px solid var(--line); }
.group-title { font-size: .76rem; color: var(--muted); letter-spacing: .06em; margin: 14px 0 4px; }
.group-title:first-child { margin-top: 0; }

.inv-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.inv-main { display: grid; min-width: 0; flex: 1; text-align: left; background: none; border: 0; padding: 0; }
.inv-name { font-weight: 500; overflow-wrap: anywhere; }
.inv-meta { color: var(--muted); font-size: .76rem; }
.inv-row.is-low .inv-name { color: var(--warn); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--chip); font-size: 1.2rem; line-height: 1; }
.stepper button:active { background: var(--line); }
.qty { min-width: 52px; text-align: center; font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.qty small { font-family: var(--f-body); font-size: .7rem; color: var(--muted); margin-left: 2px; }

.shop-row { display: flex; align-items: center; gap: 6px; }
.shop-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 0; background: none; border: 0; text-align: left; }
.box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.shop-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shop-meta { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.shop-row.is-done .shop-name { color: var(--muted); text-decoration: line-through; }
.shop-row.is-done .box { background: var(--accent); border-color: var(--accent); }
.shop-row.is-done .box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); }
.x-btn { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: var(--r-xs); font-size: 1.1rem; flex: none; }

.row-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.row-chips:empty { display: none; }
.actions-inline { margin-left: auto; display: flex; gap: 6px; }
.m-row { display: flex; align-items: center; gap: 10px; }
.m-row.is-off .m-name { color: var(--muted); }
.m-main { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 9px 0; }
.m-name { font-weight: 500; overflow-wrap: anywhere; }
.m-sub { color: var(--muted); font-size: .76rem; }

/* 재고 필터 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 12px; font-size: .82rem; }
.cat-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.search { flex: 1 1 180px; min-width: 0; }

/* 장보기 빠른 추가 */
.quick-add { display: flex; gap: 8px; }
.quick-add input[type="text"] { flex: 1; min-width: 0; }
.quick-add input[type="number"] { width: 70px; }

/* ── v0.3 가족 공용 ───────────────────────────────────── */
.banners { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }

.who { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; flex: none;
  background: var(--chip); color: var(--muted); }
.who[data-who="아빠"] { background: var(--dad-bg); color: var(--dad-fg); }
.who[data-who="엄마"] { background: var(--mom-bg); color: var(--mom-fg); }
.who[data-who="딸"]   { background: var(--kid-bg); color: var(--kid-fg); }
.who[data-who="가족"] { background: var(--fam-bg); color: var(--fam-fg); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot[data-who="아빠"] { background: var(--dad-dot); }
.dot[data-who="엄마"] { background: var(--mom-dot); }
.dot[data-who="딸"]   { background: var(--kid-dot); }
.dot[data-who="가족"] { background: var(--fam-dot); }
.dot[data-who="기념일"] { background: var(--danger); }
.dot[data-who="납부"] { background: var(--muted); }

.duty-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.duty { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--chip); color: var(--ink); font-size: .84rem; }
.duty-kind { color: var(--muted); font-size: .76rem; }
.duty-ov { font-size: .66rem; color: var(--accent); }

.ev-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; background: none; border: 0; text-align: left; color: var(--ink); }
.ev-time { flex: none; min-width: 44px; color: var(--muted); font-size: .78rem; }
.ev-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.memo-row { display: grid; gap: 2px; width: 100%; padding: 8px 0; background: none; border: 0; text-align: left; color: var(--ink); }
.memo-body { white-space: pre-line; overflow-wrap: anywhere; }
.memo-meta { color: var(--muted); font-size: .72rem; }
.meals-today { display: grid; gap: 4px; }
.meal-line { display: flex; gap: 10px; font-size: .9rem; }
.meal-slot { color: var(--muted); font-size: .76rem; min-width: 30px; padding-top: 2px; }

.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.more-link { text-decoration: none; gap: 4px; }
.more-link b { font-weight: 600; }

.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav b { font-size: 1.05rem; min-width: 110px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { text-align: center; font-size: .74rem; color: var(--muted); padding: 4px 0; }
.cal-wd.is-sun, .cal-cell.is-sun .cal-num { color: var(--danger); }
.cal-wd.is-sat, .cal-cell.is-sat .cal-num { color: var(--dad-dot); }
.cal-cell { min-height: 58px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 4px; border-radius: var(--r-xs);
  border: 1px solid transparent; background: var(--chip); color: var(--ink); text-align: left; min-width: 0; }
.cal-cell.is-out { opacity: .4; }
.cal-cell.is-today { border-color: var(--accent); }
.cal-cell.is-sel { background: var(--line); border-color: var(--banner-ink); }
.cal-num { font-family: var(--f-num); font-size: .82rem; }
.cal-peek { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

.duty-table { border-collapse: collapse; width: 100%; }
.duty-table th { font-size: .76rem; color: var(--muted); font-weight: 500; padding: 4px 2px; text-align: center; white-space: nowrap; }
.duty-table td { padding: 2px; }
.duty-table select { min-height: 36px; padding: 4px 2px; font-size: .82rem; text-align: center; text-align-last: center; -webkit-appearance: none; appearance: none; }

.meal-grid { display: grid; grid-template-columns: 72px repeat(3, minmax(0, 1fr)); gap: 4px; }
.meal-head { text-align: center; font-size: .76rem; color: var(--muted); padding: 4px 0; }
.meal-day { font-family: var(--f-num); font-size: .8rem; color: var(--muted); align-self: center; line-height: 1.25; }
.meal-day small { font-family: var(--f-body); font-size: .72rem; }
.meal-day.is-today { color: var(--accent); }
.meal-cell { min-height: 52px; padding: 6px 8px; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  text-align: left; font-size: .84rem; overflow-wrap: anywhere; }
.meal-cell.is-empty { color: var(--muted); text-align: center; border-style: dashed; background: transparent; }

.recycle-row { display: grid; gap: 8px; padding: 10px 0; }
.wd-toggles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 420px; }
.wd { min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); }
.wd.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ── v0.4 날씨 · 바코드 · 가전 · 야간 액자 ────────────── */
.weather-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--ink); }
.weather-chip:empty { display: none; }
.weather-chip .num { font-family: var(--f-num); font-size: 1rem; color: var(--banner-ink); }
body.is-wall .weather-chip { font-size: 1rem; }
body.is-wall .weather-chip .num { font-size: 1.25rem; }

.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg { min-height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 600; }
.seg.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scan-view { position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scan-log { display: grid; gap: 4px; min-height: 2.6em; font-size: .9rem; }
.scan-new { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--chip); }
.scan-new select { flex: 1; min-width: 0; }

.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.file-link { flex: 1; min-width: 0; color: var(--accent); overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.photo-cell { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: var(--r-xs); overflow: hidden; background: var(--chip); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell .x-btn { position: absolute; top: 2px; right: 2px; background: rgba(6, 8, 12, .7); color: var(--ink); width: 28px; height: 28px; }

/* 야간 액자: 화면 전체를 덮는 어두운 시계 + 흐린 가족사진 */
#night { position: fixed; inset: 0; z-index: 100; background: #05070b; display: grid; place-items: end start; cursor: pointer; }
#night .night-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: brightness(.55); }
#night .night-photo.is-on { opacity: 1; }
#night .night-info { position: relative; padding: 0 0 max(40px, env(safe-area-inset-bottom, 0px)) max(48px, env(safe-area-inset-left, 0px)); color: #c9b98f; text-shadow: 0 2px 16px rgba(0, 0, 0, .8); }
#night .night-clock { font-family: var(--f-num); font-size: clamp(4rem, 14vw, 9rem); line-height: 1; color: #d9c79b; }
#night .night-date { font-size: 1.3rem; margin-top: 8px; opacity: .85; }
#night .night-hint { font-size: .8rem; margin-top: 14px; opacity: .45; }
@media (prefers-reduced-motion: no-preference) { #night .night-photo { transition: opacity 1.6s ease; } }

/* ── 입력 ──────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input[type="date"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 70px; resize: vertical; }
label.field { display: grid; gap: 5px; font-size: .82rem; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form { display: grid; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.form-actions .left { margin-right: auto; }
.calc { font-size: .84rem; color: var(--banner-ink); background: var(--chip); border-radius: var(--r-sm); padding: 8px 11px; }

/* ── 대화상자 ──────────────────────────────────────────── */
dialog#sheet { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
dialog#sheet::backdrop { background: rgba(6, 8, 12, .7); }
.sheet-title { margin: 0 0 12px; font-size: 1.1rem; font-weight: 600; }
.preset-list { display: grid; gap: 2px; max-height: 50dvh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px; }
.preset-item { display: grid; grid-template-columns: auto 1fr 140px; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.preset-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.preset-item .p-sub { display: block; color: var(--muted); font-size: .74rem; }
.preset-item input[type="date"] { min-height: 36px; padding: 4px 8px; font-size: .82rem; }
.history { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }

/* ── 로그인·안내 화면 ─────────────────────────────────── */
.center-screen { flex: 1; display: grid; place-items: center; padding-block: 32px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; }
.login-card h1 { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: .02em; }
.login-card .clock-big { font-family: var(--f-num); font-size: 3rem; color: var(--banner-ink); line-height: 1; }
.err { color: var(--danger); font-size: .86rem; min-height: 1.2em; }
.mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-btn { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.mode-btn b { font-size: 1.05rem; }
.mode-btn span { color: var(--muted); font-size: .82rem; }
.mode-btn.is-on { border-color: var(--accent); }

.settings { display: grid; gap: 12px; max-width: 640px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ── 알림 토스트 ───────────────────────────────────────── */
#toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 500; }
#toast.is-err { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
body.is-wall #toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 1rem; }

/* ── 반응형 ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .overview, .dash-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.is-wall #app { height: auto; min-height: 100dvh; }
  body.is-wall .dash-main > * { min-height: 220px; }
  .panel-body { max-height: 420px; }
}
@media (max-width: 700px) {
  .overview, .dash-main, .mode-pick { grid-template-columns: 1fr; }
  .overview .panel { padding: 12px 14px; }
  .split { grid-template-rows: auto; }
  .panel-body { max-height: none; }
  .slot-empty { display: none; }  /* 폰에서는 빈 칸을 숨긴다 */
  .cal-cell { min-height: 46px; padding: 3px; }
  .cal-peek { display: none; }
  .meal-grid { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); }
  /* 폰 홈: 개요 카드는 2칸으로 작게, 일정 칸을 맨 위로 */
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .overview .panel { padding: 10px; gap: 6px; }
  .overview .panel-head .sub { display: none; }
  .overview .metrics { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 4px; }
  .overview .metric { padding: 5px 6px; }
  .overview .metric b { font-size: 1.2rem; }
  .overview .metric span { font-size: .64rem; }
  .dash-main > :last-child { order: -1; }
  .meal-cell { font-size: .78rem; padding: 5px; }
  .clock { font-size: 1.2rem; }
  .weather-chip .wx-more { display: none; }
  .preset-item { grid-template-columns: auto 1fr; }
  .preset-item input[type="date"] { grid-column: 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .stepper button, .cat-chip { transition: background-color .15s; }
}
