:root {
  color-scheme: dark;
  --bg: #10211b;
  --bg-2: #173028;
  --ink: #f4f0e6;
  --muted: #c5d0c6;
  --line: #2d4a3d;
  --sun: #f0a202;
  --sun-2: #ffe08a;
  --soil: #1a1408;
  --warn: #e07a5f;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(240, 162, 2, 0.18), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}
header, main, footer { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 0 8px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark { width: 42px; height: 42px; color: var(--sun); }
.mark circle { fill: currentColor; }
.eyebrow, .prompt-label, .kicker {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--sun-2);
}
.wordmark { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
button, select, input {
  font: inherit;
  color: inherit;
}
button {
  background: var(--sun);
  color: var(--soil);
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}
button.secondary, button[data-ask] {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button:disabled { opacity: 0.55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 2px;
}
.ask { padding: 18px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button { text-align: left; }
.chips + .prompt-label { margin-top: 18px; }
.chips button.is-active {
  background: var(--sun);
  color: var(--soil);
  border-color: var(--sun);
}
.stage {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: start;
  padding: 10px 0 20px;
}
.answer h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.15;
  margin: 8px 0 12px;
}
.answer p { font-size: 1.05rem; line-height: 1.5; }
.roof {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.roof h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 12px; }
.day { margin-bottom: 16px; }
.day p { margin: 0 0 6px; color: var(--muted); }
.bars { height: 120px; display: flex; align-items: flex-end; gap: 3px; }
.bar {
  flex: 1;
  background: #6d5424;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}
.bar.in-window { background: linear-gradient(var(--sun-2), var(--sun)); }
.hours { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; }
.setup {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 8px;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--muted); }
input, select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.assumption, .muted { color: var(--muted); }
.trace { margin: 12px 0 28px; }
.trace ol { font-family: ui-monospace, monospace; font-size: 0.85rem; }
footer { padding-bottom: 32px; color: var(--muted); font-size: 0.9rem; }
footer a { color: var(--sun-2); }
.is-error { color: var(--warn); }
.consent { width: min(640px, calc(100% - 32px)); margin: 10vh auto; }
.consent h1 { font-family: var(--serif); font-weight: 500; font-size: 2.4rem; }
.consent form { display: flex; gap: 10px; }
@media (max-width: 800px) {
  .stage, .setup { grid-template-columns: 1fr; }
  header { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* v1.1: voice controls, household memory, MCP App card */
.voice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mic { font-weight: 600; }
.mic.is-listening { outline: 3px solid #f5a524; }
.speak { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.heard, .memory { font-size: 13px; opacity: .8; }
.app-frame { width: 100%; height: 300px; border: 0; background: transparent; }
.charts { width: 100%; }
.app-frame { display: block; min-width: 100%; }
.voice label.speak { flex-direction: row; font-size: 0.85rem; }
