/* House Book (Stuff's layout came from Storage Log; People's from Filofax). Built from the shared chassis (vendor/chassis: tokens.css, controls.css,
   components.css, loaded first). This file holds only the app's identity colour and the
   layout that is genuinely its own: the hero, the sticky zone chips, the zone headings,
   the quick-add row and the room the select-mode action bar needs. */

/* Burnt orange, Filofax's (Tom, 17 Nov 2026). Light: a step deeper than the icon's #c2521c, so it reads as
   text on the grey cards (4.8:1). Dark: a lifted tint with dark ink. Dark values in the same three places tokens.css uses. */
:root { --accent: #b34a18; --text-on-accent: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --accent: #ef7c3c; --text-on-accent: #0a0a0b; }
}
:root[data-theme='dark'] { --accent: #ef7c3c; --text-on-accent: #0a0a0b; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
/* Select mode: the shared .ui-actionbar floats above the tab bar, so make room for it. */
body.has-actionbar { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }

/* The top row with the ✨ AI button (vendor/ai-protocol's .au-btn), on every screen. */
.app-top {
  display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-2);
  max-width: 620px; margin: 0 auto;
  padding: calc(var(--sp-2) + env(safe-area-inset-top)) var(--sp-4) 0;
}
main {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  max-width: 620px;
  margin: 0 auto;
}
main > .ui-stack, main > .ui-page { gap: var(--sp-4); }

/* ---- Find: hero ---- */
.hero { text-align: center; padding: 9vh 0 var(--sp-6); }
.hero .logo { font-size: 4.2rem; line-height: 1; display: block; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 25%, transparent)); }
.hero h1 { font: 700 var(--text-2xl)/1.15 var(--font-display); letter-spacing: -.02em; margin: var(--sp-3) 0 0; color: var(--accent); }
main.searching .hero { padding: var(--sp-3) 0 var(--sp-4); }
main.searching .hero .logo { font-size: 2rem; filter: none; }
main.searching .hero h1 { font-size: var(--text-lg); margin-top: var(--sp-1); }
#results { margin-top: var(--sp-3); }

/* A search result: name, then where it is. */
.result.ui-stack { gap: var(--sp-1); }
.spaced { margin-top: var(--sp-3); }
.item-loc { color: var(--accent); font-weight: 600; font-size: var(--text-sm); }
.item-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; }
.ui-row .ui-chips, .ui-card .ui-chips { margin-top: var(--sp-1); }

/* ---- Storage: sticky zone chips and zone sections ---- */
.zone-bar {
  position: sticky; top: 0; z-index: 20;
  padding-block: var(--sp-2);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.zone-head {
  margin: var(--sp-6) 0 0; padding: 0 var(--sp-1) var(--sp-2);
  border-bottom: 1px solid var(--border-strong);
  scroll-margin-top: 62px;   /* clears the sticky chip bar */
}
.room-head { margin: var(--sp-4) var(--sp-1) var(--sp-2); }

/* ---- Spot page: the add-an-item row ---- */
.quick-add { display: flex; gap: var(--sp-2); align-items: center; }
.quick-add > .ui-input[type="text"], .quick-add > .clearx-wrap { flex: 1; }
.quick-add > .ui-input[type="number"] { width: 72px; flex: none; text-align: center; }

/* ---- Add: item + quantity side by side ---- */
.field-pair { display: grid; grid-template-columns: 1fr 92px; gap: var(--sp-3); }
.bulk-tools > .ui-btn { flex: 1; }


/* Settings › AI actions: each job's Free / Paid line (the same as Dad HQ's AI actions page). */
.sl-ai-cost { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); }
.sl-ai-cost small { font-size: var(--text-xs); color: var(--text-2); }

/* ---- Find: grouped results ---- */
#results > section { margin-bottom: var(--sp-4); }
.find-locked { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* ---- People (from Filofax): initials or a day over a month in a row's lead box, the profile head ---- */
.ini { font-size: var(--text-sm); font-weight: 700; color: var(--accent); }
.date { display: grid; justify-items: center; }
.date b { font-size: var(--text-md); line-height: 1; }
.date small { font-size: var(--text-xs); line-height: 1; text-transform: uppercase; color: var(--text-3); }
.person-head { display: flex; align-items: center; gap: var(--sp-4); }
.person-head > .main { flex: 1; min-width: 0; display: grid; gap: var(--sp-1); }
.avatar { inline-size: 64px; block-size: 64px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--accent); font-weight: 600; font-size: var(--text-xl); }
.kv .k { flex: none; inline-size: 112px; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
/* The edit form: two fields side by side; kids/pets/holidays rows; day + month + optional year */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.subrow { display: flex; gap: var(--sp-2); align-items: end; }
.subrow > .fields { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.subrow .ui-field { flex: 1 1 130px; }
.dmy { display: grid; grid-template-columns: minmax(0, 4.5em) minmax(0, 1fr) minmax(0, 6em); gap: var(--sp-2); }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* ---- House: a fact, and a code hidden until tapped ---- */
.fact.ui-stack { gap: var(--sp-2); }
.fact .ui-head { gap: var(--sp-2); justify-content: space-between; }
.fact-body { margin: 0; color: var(--text-2); }
.code-row { display: flex; align-items: center; gap: var(--sp-3); }
.code { font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--text-lg); letter-spacing: .08em; flex: 1; }

/* ---- The People lock ---- */
.lock-page { padding-top: 4vh; }
.lock-body { align-items: center; text-align: center; }
.lock-body .ui-field { inline-size: 100%; max-inline-size: 320px; text-align: start; }
