/* Deliberately small and hand-written. The audience studies on phones, on
   variable connections, so every byte here is a byte not spent on audio. */

:root {
  --ink: #14211e;
  --muted: #5d6b67;
  --line: #dfe5e3;
  --brand: #1f6f5c;
  --brand-dark: #175647;
  --ok: #1a7f4b;
  --bad: #a33224;
  --bg: #fff;
  --card: #f7f9f8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ecea; --muted: #9aa8a4; --line: #2b3733;
    --brand: #4fbf9f; --brand-dark: #3da88a;
    --ok: #58c98c; --bad: #e2887c;
    --bg: #121917; --card: #1a2321;
  }
}

* { box-sizing: border-box; }

/* The hidden attribute is how every view here is switched, and the browser
   implements it as display:none in the UA stylesheet, which ANY author
   display rule silently overrides. `nav { display: flex }` did exactly
   that: signing out set nav.hidden = true and the tabs stayed on screen
   next to the signed-out prompt. Author-level and !important so an element
   that opts into hiding is hidden regardless of what else styles it. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* Respects the notch on iOS in standalone mode. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

header, main, footer { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }
header { padding-top: 1.25rem; }

h1 {
  font-size: 1.35rem; margin: 0 0 .75rem;
  color: var(--brand); letter-spacing: -.01em;
}
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }

nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .5rem .75rem; font: inherit; color: var(--muted); cursor: pointer;
}
.tab[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.link { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }

main { padding-top: 1rem; padding-bottom: 2rem; min-height: 60vh; }

.lede { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* Google's sign-in button guidance: their mark, unaltered, on a neutral
   surface, with the wording intact. */
.gsi {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem; margin: 1rem 0;
  background: #fff; color: #1f1f1f;
  border: 1px solid #747775; border-radius: 4px;
  font: 500 14px/1 "Roboto", system-ui, sans-serif;
  text-decoration: none;
}
.gsi:hover { background: #f7f8f8; }

.modes { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.mode {
  flex: 1 1 auto; padding: .5rem .75rem; font: inherit; cursor: pointer;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; text-align: left;
}
.mode.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem; margin-bottom: 1rem;
}
audio { width: 100%; margin-bottom: .5rem; }
audio.spent { display: none; }

.item + .item { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.prompt { font-weight: 600; margin: .25rem 0 .75rem; }

.options { display: flex; flex-direction: column; gap: .5rem; }
.option {
  padding: .7rem .9rem; font: inherit; text-align: left; cursor: pointer;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  /* Comfortable tap target on a phone. */
  min-height: 2.75rem;
}
.option:hover:not(:disabled) { border-color: var(--brand); }
/* Full-width variant, for a standalone action rather than one answer among
   several. */
.option.wide { display: block; width: 100%; text-align: center; }
.option:disabled { opacity: .55; cursor: default; }

.answer { display: flex; gap: .5rem; flex-wrap: wrap; }
.answer input {
  flex: 1 1 12rem; padding: .7rem .8rem; font: inherit;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}

.primary {
  width: 100%; padding: .8rem 1rem; font: inherit; font-weight: 600;
  color: #fff; background: var(--brand);
  border: 0; border-radius: 8px; cursor: pointer; min-height: 2.75rem;
}
.primary:hover { background: var(--brand-dark); }

.ok { color: var(--ok); font-weight: 600; margin: .75rem 0 .25rem; }
.bad { color: var(--bad); font-weight: 600; margin: .75rem 0 .25rem; }
.transcript {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .75rem; margin: .5rem 0 0;
}

table { border-collapse: collapse; width: 100%; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.bar {
  display: inline-block; width: 5rem; height: .5rem; vertical-align: middle;
  background: var(--line); border-radius: 3px; overflow: hidden;
}
.fill { display: block; height: 100%; background: var(--brand); }

footer { padding-bottom: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
footer a { color: var(--muted); }

/* Destructive action. Deliberately not styled like .primary: deleting an
   account cannot be undone and we hold no e-mail to apologise to. */
.danger {
  width: 100%; padding: .8rem 1rem; font: inherit; font-weight: 600;
  color: #fff; background: var(--bad);
  border: 0; border-radius: 8px; cursor: pointer; min-height: 2.75rem;
}
.danger:disabled { opacity: .5; cursor: default; }

/* Legal pages: prose rather than app chrome. Same stylesheet so they cost
   no extra request, and so they cannot drift into looking like a different
   site. */
.doc h3 { font-size: 1rem; margin: 1.75rem 0 .4rem; }
.doc ul { padding-left: 1.1rem; }
/* The only <ol> on the site is the list of backup copies in the privacy
   policy. Without this it keeps the browser default of 40px INSIDE an
   already indented <ul>, which on a phone pushes the text a third of the
   way across the screen (independent review). */
.doc ol { padding-left: 1.1rem; }
.doc li { margin-bottom: .4rem; }
.doc code { font-size: .9em; background: var(--card); padding: .1rem .3rem; border-radius: 4px; }
.doc a, main a { color: var(--brand); }
a.plain { color: inherit; text-decoration: none; }
