/* Family Portal: a calm, neutral app look. Tokens first, then layout, then components. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #eaecf0;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-text: #ffffff;
  --accent-soft: #eef2ff;
  --accent-ink: #1e3a8a;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn-ink: #93370d;
  --warn-soft: #fffaeb;
  --amber: #f59e0b;
  --rain: #2563eb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111b;
    --surface: #131a26;
    --surface-2: #1a2231;
    --surface-3: #222c3d;
    --text: #eef1f6;
    --text-2: #cdd4e0;
    --muted: #98a2b3;
    --border: #252f40;
    --border-strong: #334055;
    --accent: #7aa2ff;
    --accent-hover: #9bb8ff;
    --accent-text: #0b1220;
    --accent-soft: #1b2744;
    --accent-ink: #c7d7ff;
    --danger: #f97066;
    --danger-soft: #2a1515;
    --ok: #47cd89;
    --ok-soft: #10261b;
    --warn-ink: #fec84b;
    --warn-soft: #2a2110;
    --amber: #fbbf24;
    --rain: #7aa2ff;
    --shadow-sm: none;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 0.95rem; }
p { margin: 0.5rem 0; }
.boot { text-align: center; color: var(--muted); padding: 4rem 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { flex: none; vertical-align: middle; }
.grow { flex: 1 1 auto; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 10;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.1rem 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 0.6rem 1.1rem; color: var(--text); font-weight: 650; font-size: 1rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-group { margin-top: 0.4rem; }
.nav-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.75rem 0.65rem 0.35rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.65rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 0.9rem;
}
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item .icon { color: var(--muted); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item[aria-current="page"] .icon { color: var(--accent); }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.me-card { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); color: var(--text); }
.me-card:hover { background: var(--surface-2); text-decoration: none; }
.me-card .who { min-width: 0; line-height: 1.25; }
.me-card .name { font-weight: 600; font-size: 0.88rem; }
.me-card .role { font-size: 0.75rem; color: var(--muted); }

.topbar { display: none; }
.tabbar { display: none; }
main { margin-left: var(--sidebar); padding: 2rem 2.5rem 4rem; max-width: calc(1180px + var(--sidebar)); }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 10; align-items: center; justify-content: space-between;
    padding: 0.6rem 16px; padding-top: max(0.6rem, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; }
  .me-link { display: flex; border-radius: 50%; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.3rem 0;
    color: var(--muted); font-size: 0.68rem; font-weight: 500; border-radius: var(--radius-sm);
  }
  .tab:hover { text-decoration: none; }
  .tab[aria-current="page"] { color: var(--accent); }
  main { margin-left: 0; padding: 1.25rem 16px 6.5rem; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 0.3rem 0 0; font-size: 0.92rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 200px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.15rem 1.25rem; }
.card > h2 { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.card > h2 .icon { color: var(--muted); }
.card-title { display: inline-flex; align-items: center; gap: 0.5rem; }
.card-link { display: inline-flex; align-items: center; gap: 0.15rem; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.card-link:hover { color: var(--accent); text-decoration: none; }
.grid { display: grid; gap: 1rem; }
.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-grid .wide { grid-column: 1 / -1; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1000px) { .home-grid, .cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- forms ---------- */
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); min-height: 40px; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-2); margin-bottom: 0.3rem; }
.field { margin-bottom: 0.9rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; font-size: 0.9rem; color: var(--text); margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem; min-height: 38px; cursor: pointer; font-weight: 600; font-size: 0.875rem; box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
a.btn { color: var(--text-2); }
a.btn.primary { color: var(--accent-text); }
.link-btn {
  background: none; border: 0; padding: 0.2rem 0; min-height: 28px; cursor: pointer; color: var(--accent);
  font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem;
}
.link-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.error { color: var(--danger); font-size: 0.85rem; margin: 0.5rem 0 0; }

/* Segmented control (was "chips") */
.chips { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--text-2);
  padding: 0.32rem 0.75rem; cursor: pointer; font-weight: 500; font-size: 0.82rem; min-height: 32px;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; letter-spacing: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 500; line-height: 1.4;
  padding: 0.08rem 0.5rem; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
  border: 1px solid var(--border);
}
.tag .icon { width: 12px; height: 12px; }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge { font-size: 0.7rem; font-weight: 600; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 0.45rem; line-height: 1.5; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); padding: 2rem; }
.login .logo { width: 48px; height: 48px; border-radius: 12px; display: block; margin: 0 0 1.25rem; }
.login h1 { margin-bottom: 0.3rem; }
.login p.lead { color: var(--muted); margin: 0 0 1.5rem; }
.login .btn { width: 100%; min-height: 42px; }

/* ---------- weather ---------- */
.weather-now { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.weather-now .big { font-size: 2.4rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.forecast { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; text-align: center; }
.forecast .day { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.6rem 0.2rem; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.forecast .hi { font-weight: 600; }
.forecast .pop { font-size: 0.72rem; color: var(--rain); display: inline-flex; align-items: center; gap: 0.1rem; }
.wx-sun { color: var(--amber); }
.wx-rain, .wx-snow { color: var(--rain); }
.wx-cloud { color: var(--muted); }

/* ---------- lists ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; padding-top: 0.2rem; }
.list .body { flex: 1; min-width: 0; }
.list .title { font-weight: 500; overflow-wrap: anywhere; }
.list .meta, .meta { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; margin-top: 0.3rem; }
.empty { color: var(--muted); font-size: 0.88rem; padding: 0.4rem 0; margin: 0; }
.task-check { width: 18px; height: 18px; margin-top: 0.15rem; flex: none; accent-color: var(--accent); cursor: pointer; }
li.done .title { text-decoration: line-through; color: var(--muted); }
.actions { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.task-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.3rem; }
.list-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.list-icon.fav { color: var(--amber); }

.game { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: center; }
.league { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; padding: 0.18rem 0.35rem; border-radius: 5px; color: #fff; min-width: 38px; text-align: center; }
.live { color: var(--danger); font-weight: 600; }
.win { color: var(--ok); font-weight: 600; }
.section-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.9rem 0 0.4rem; }
.section-label:first-of-type { margin-top: 0.1rem; }

.col-head { display: flex; justify-content: space-between; align-items: baseline; }
.col-head .count { color: var(--muted); font-size: 0.8rem; }

.wish-link { font-size: 0.8rem; display: inline-flex; align-items: center; gap: 0.2rem; }
.claimed { color: var(--ok); font-weight: 600; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.25rem; }

/* ---------- dialog & toast ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  width: min(480px, calc(100% - 32px)); padding: 1.5rem; box-shadow: var(--shadow-md);
}
dialog::backdrop { background: rgba(16, 24, 40, 0.45); backdrop-filter: blur(2px); }
dialog h2 { margin-bottom: 1.1rem; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; align-items: center; }
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(16px);
  background: var(--text); color: var(--surface); padding: 0.65rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: 0.2s; max-width: calc(100% - 32px); z-index: 30; box-shadow: var(--shadow-md);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 900px) { #toast { bottom: 28px; left: calc(50% + var(--sidebar) / 2); } }

/* ---------- more page (phones) ---------- */
.more-list { padding: 0.35rem 0.5rem; }
.more-list a { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.5rem; color: var(--text); border-top: 1px solid var(--border); font-weight: 500; }
.more-list a:first-child { border-top: 0; }
.more-list a:hover { text-decoration: none; background: var(--surface-2); }
.more-list a .icon:first-child { color: var(--muted); }
.more-list a .icon:last-child { margin-left: auto; color: var(--muted); }

/* ---------- meals ---------- */
.week-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.day-card { padding: 0.9rem 1rem; }
.day-card > h2 { font-size: 0.88rem; margin-bottom: 0.4rem; }
.day-card.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.slot { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.4rem; align-items: baseline; padding: 0.4rem 0; border-top: 1px solid var(--border); }
.slot-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.slot-body { display: flex; justify-content: space-between; gap: 0.4rem; align-items: baseline; min-width: 0; }
.slot > .link-btn { justify-self: start; color: var(--muted); font-weight: 500; }
.slot > .link-btn:hover { color: var(--accent); }
.meal-name { font-weight: 500; text-align: left; color: var(--text); font-size: 0.88rem; overflow-wrap: anywhere; }
button.meal-name:hover { color: var(--accent); }
.slot-dinner .meal-name { font-weight: 600; }
.clickable { cursor: pointer; }
.clickable:hover .title { color: var(--accent); }
.wide-dialog { width: min(640px, calc(100% - 32px)); }
.small-head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.1rem 0 0.4rem; font-weight: 600; }
.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin: 0.2rem 0; }
.steps { white-space: pre-wrap; margin: 0; }
.ideas { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 55%); }
.note { background: var(--surface-2); padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem; display: flex; gap: 0.5rem; align-items: flex-start; }
.progress { height: 3px; border-radius: 3px; margin-top: 0.9rem; background: var(--surface-3); overflow: hidden; position: relative; }
.progress::after { content: ""; position: absolute; inset: 0; width: 35%; background: var(--accent); border-radius: 3px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .progress::after { animation: none; width: 100%; opacity: 0.4; } }

/* ---------- groceries & deals ---------- */
.aisle-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; }
.deal-img { width: 52px; height: 52px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--border); flex: none; }
.deal-card > h2 { align-items: flex-start; }
.store-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 1rem; margin-bottom: 0.5rem; }

/* ---------- health ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; min-width: 0; }
.stat-label { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
@media (max-width: 480px) { .stat-value { font-size: 1.05rem; } .stat { padding: 0.55rem; } }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 12px; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-goal { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.c-end, .c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.c-cross { stroke: var(--muted); stroke-width: 1; }
.c-tip { position: absolute; transform: translate(-50%, -100%); pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); padding: 0.35rem 0.55rem; font-size: 0.8rem; display: flex; flex-direction: column; white-space: nowrap; }
.c-tip[hidden] { display: none; }
.history { margin-top: 0.5rem; }
.history summary { cursor: pointer; font-weight: 500; font-size: 0.88rem; padding: 0.4rem 0; }
.food-notes { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.7rem; }

/* ---------- TV channels & devices ---------- */
.url-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; flex-wrap: wrap; }
.url-row .small { width: 6.5rem; }
.url-row code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.3rem 0.5rem; border-radius: 6px; overflow-wrap: anywhere; flex: 1 1 200px; }
.steps-list { margin: 0; padding-left: 1.3rem; }
.steps-list li { margin: 0.45rem 0; }
.tv-grid { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 1000px) { .tv-grid { grid-template-columns: 1fr; } }
.fav-list .chno { width: 1.8rem; text-align: right; color: var(--muted); font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.ch-logo { width: 36px; height: 36px; object-fit: contain; flex: none; }
.group-list { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.25rem 0.7rem; }
.group-item { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.group-item:last-child { border-bottom: 0; }
.group-item .grow { flex: 1; }
.kv { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 0.5rem; align-items: baseline; padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.kv:first-of-type { border-top: 0; }
.today { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 0.7rem; margin-top: 0.2rem; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; margin-top: 0.9rem; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-width: 0; }
.wb-val { font-size: 0.65rem; color: var(--muted); height: 1em; white-space: nowrap; }
.wb-track { width: 100%; max-width: 26px; height: 64px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.wb-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.wb-day { font-size: 0.72rem; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.75rem; }
.photo { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(16,24,40,.6); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
pre.code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.8rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.85rem; }
.pc-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pc-clock { font-size: 3rem; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- calendar ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.month-head { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-align: left; padding: 0.5rem 0.55rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.05em; }
.day { min-height: 108px; background: var(--surface); padding: 0.35rem 0.4rem; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.day:hover { background: var(--surface-2); }
.day.other { background: var(--surface-2); }
.day.other .day-num { color: var(--muted); opacity: 0.7; }
.day-num { font-size: 0.78rem; font-weight: 600; width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; border-radius: 999px; }
.day.today .day-num { background: var(--accent); color: var(--accent-text); }
.ev { display: flex; gap: 0.4rem; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; cursor: pointer; min-height: 40px; font-size: 0.88rem; }
.ev:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ev-compact { padding: 0.1rem 0.3rem; min-height: 0; font-size: 0.72rem; border: 0; border-radius: 4px; background: transparent; }
.ev-compact:hover { background: var(--surface-3); }
.ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev-time { color: var(--muted); white-space: nowrap; font-size: 0.85em; font-variant-numeric: tabular-nums; }
.more { background: none; border: 0; color: var(--muted); font-size: 0.72rem; text-align: left; cursor: pointer; padding: 0 0.3rem; font-weight: 500; }
.more:hover { color: var(--accent); }
.ev-list { display: flex; flex-direction: column; gap: 0.35rem; }
.agenda { display: flex; flex-direction: column; gap: 0.9rem; }
.agenda-day { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; align-items: start; }
.agenda-date { font-weight: 600; font-size: 0.82rem; padding-top: 0.6rem; color: var(--muted); }
.agenda-date.is-today { color: var(--accent); }
@media (max-width: 720px) {
  .day { min-height: 60px; }
  .ev-compact .ev-title, .ev-compact .ev-time { display: none; }
  .ev-compact { width: auto; padding: 0.15rem; }
  .agenda-day { grid-template-columns: 1fr; gap: 0.3rem; }
  .agenda-date { padding-top: 0; }
}
.day-boxes { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; }
.compact-tasks .task-actions { display: none; }
.compact-tasks .list > li { padding: 0.55rem 0; }

/* ---------- pantry ---------- */
.scan-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 460px; overflow: auto; }
.scan-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 9rem 3.5rem; gap: 0.5rem; align-items: center; }
.scan-row input[type="text"] { min-height: 34px; padding: 0.3rem 0.55rem; }
@media (max-width: 600px) { .scan-row { grid-template-columns: auto minmax(0, 1fr) 6rem; } .scan-row > :last-child { display: none; } }
.xc-login .url-row .small { width: 5.5rem; }

/* TV home screen picture: a small preview of how the TV shows it. */
.backdrop-preview { position: relative; aspect-ratio: 16 / 9; max-width: 32rem; border-radius: 12px; overflow: hidden; background: #0f141c; }
.backdrop-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.backdrop-shade { position: absolute; inset: 0; background: linear-gradient(rgba(15, 20, 28, .85), rgba(15, 20, 28, .6) 40%, rgba(15, 20, 28, .9)); }
.backdrop-label { position: absolute; top: 9%; left: 0; right: 0; text-align: center; color: #e8edf4; font-weight: 700; letter-spacing: .12em; font-size: clamp(.7rem, 2.4vw, 1rem); }
