/* Life Companion demonstration: calm, legible, phone first.
   Palette and type taken as design input from the UX1 drafts. */
:root {
  --paper: #F4F5F2;
  --surface: #FFFFFF;
  --ink: #1B2421;
  --muted: #4A5753;
  --teal: #0B5E51;
  --teal-dark: #08463C;
  --line: #D9DED9;
  --band: #FFF4E0;
  --band-ink: #5C3300;
  --band-edge: #E8C48A;
  --red: #B42318;
  --focus: #0B5E51;
  --radius-control: 10px;
  --radius-panel: 4px;
  font-size: 112.5%; /* 18px */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Golos Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--teal-dark); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10;
}
.skip:focus { top: 0.5rem; }

.column { max-width: 38rem; margin: 0 auto; padding: 0 1rem; }

/* Masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner {
  max-width: 38rem; margin: 0 auto; padding: 0.75rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
}
.brand { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.masthead-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.9rem; }
form.inline { display: inline; margin: 0; }

/* The demonstration band: the one strong element, worn like a wristband. */
.band {
  background: var(--band);
  color: var(--band-ink);
  border-bottom: 2px solid var(--band-edge);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(232, 196, 138, 0.28) 14px 16px);
}
.band p { max-width: 38rem; margin: 0 auto; padding: 0.45rem 1rem; font-weight: 600; font-size: 0.95rem; }

main { padding-top: 1.5rem; padding-bottom: 2rem; }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.25rem 0 0.75rem; letter-spacing: -0.015em; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
p { margin: 0 0 0.9rem; }

.tagline, .muted, .help, .hint, .crumb { color: var(--muted); }
.tagline { margin-bottom: 0.25rem; }
.help { font-size: 0.9rem; margin: -0.25rem 0 0.25rem; }
.crumb { font-size: 0.9rem; margin-bottom: 0.25rem; }

/* Notices */
.notices {
  border-left: 4px solid var(--band-edge);
  background: var(--surface);
  padding: 0.75rem 1rem 0.5rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
}
.notices h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.notices ul { margin: 0; padding-left: 1.1rem; }
.notices li { margin-bottom: 0.4rem; font-size: 0.95rem; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0 1.25rem; }
label { font-weight: 600; }
input[type=email], input[type=text], select, textarea, input[type=file] {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #8E9A95; border-radius: var(--radius-control);
  padding: 0.65rem 0.75rem; width: 100%;
}
textarea { resize: vertical; min-height: 6rem; }
input[aria-invalid=true] { border-color: var(--red); }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--teal); color: #FFFFFF; border: 1px solid var(--teal);
  border-radius: var(--radius-control); padding: 0.7rem 1.1rem; min-height: 44px;
  align-self: flex-start;
}
button:hover { background: var(--teal-dark); }
button:disabled { opacity: 0.7; cursor: progress; }
button.secondary { background: var(--surface); color: var(--teal); }
button.secondary:hover { background: #E8EFEC; }
button.danger { background: var(--surface); color: var(--red); border-color: var(--red); }
button.danger:hover { background: #FBEAE8; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 0.35rem; }
.choice, .declaration { display: flex; gap: 0.6rem; align-items: flex-start; min-height: 44px; padding: 0.3rem 0; }
.choice input, .declaration input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; flex: none; accent-color: var(--teal); }
.declaration { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0.6rem 0.75rem; }
.own-records { margin-top: 2.5rem; }
button.quiet {
  background: none; border: 0; color: var(--teal); padding: 0.4rem 0.25rem; min-height: 44px;
  font-weight: 500; text-decoration: underline; text-underline-offset: 0.18em;
}
.masthead-tools a.quiet { display: inline-block; padding: 0.4rem 0.25rem; }

.problem { color: var(--red); font-weight: 600; }
.confirm { background: #E4F1EC; border-left: 4px solid var(--teal); padding: 0.6rem 0.9rem; }

/* Views: a segmented switch */
.views {
  display: flex; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--surface); overflow: hidden; margin: 0.5rem 0 0.5rem;
}
.views a {
  flex: 1; text-align: center; padding: 0.6rem 0.4rem; text-decoration: none; color: var(--ink);
  border-right: 1px solid var(--line); min-height: 44px;
}
.views a:last-child { border-right: 0; }
.views a[aria-current=page] { background: var(--teal); color: #FFFFFF; font-weight: 600; }

/* Paths: a divided list, not a grid of cards */
.divided { list-style: none; margin: 0.5rem 0 1.5rem; padding: 0; border-top: 1px solid var(--line); }
.divided li { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.row-link { font-weight: 600; display: inline-block; min-height: 28px; }
.paths .hint { display: block; font-size: 0.92rem; }

.pathnav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 1rem 0 0; font-size: 0.92rem; }
.pathnav a[aria-current=page] { color: var(--ink); font-weight: 600; text-decoration: none; }

/* Engine answer */
.reply {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel);
  padding: 1rem; margin: 1.25rem 0;
}
.block { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.block:first-of-type { border-top: 0; }
.block-title { font-weight: 600; margin-bottom: 0.25rem; }
.block-text { white-space: pre-line; margin: 0; }
.block[data-kind=reading] { border-left: 3px solid var(--teal); padding-left: 0.75rem; }

/* Reset sits apart, at the end */
.reset { margin-top: 3rem; padding-top: 1rem; border-top: 2px dashed var(--line); }

.footer { border-top: 1px solid var(--line); padding-top: 1rem; padding-bottom: 2rem; font-size: 0.9rem; color: var(--muted); }
.footer p { margin-bottom: 0.4rem; }

@media (min-width: 40rem) {
  h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .views a[aria-current=page] { outline: 2px solid CanvasText; }
}

/* the "about this answer" disclosure and the owner's spend page */
details.block > summary { cursor: pointer; font-weight: 600; min-height: 28px; }
details.block > summary.block-title { margin-bottom: 0; }
details.block[open] > summary { margin-bottom: 0.25rem; }
details.block .block-text { font-size: 0.92rem; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table.spend { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.spend th, table.spend td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
table.spend td { text-align: right; }
table.spend tfoot th, table.spend tfoot td { font-weight: 600; }

/* The grant path's two one-tap buttons. */
form.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 1rem; }
