/* mimo — brand palette: primary #FF2D4D, secondary #FF6B8A, accent #FFB3BE, background #FFE9EC,
   surface #FFF7F8, text #2A0F1F. Rules from research/2026-10-17-ux-design.md:
   - #FF2D4D only for fills and bold labels >= 17px; small red text uses #C8102E (5.9:1 on white).
   - Reading happens on white; pink frames it. Body text follows the iPhone text size (Dynamic Type).
   - One prominent button per screen; every tap target >= 44px. */
:root {
  --primary: #FF2D4D; --secondary: #FF6B8A; --accent: #FFB3BE; --blush: #FFE9EC;
  --page: #FFF7F8; --paper: #FFFFFF; --sunken: #FFF1F3;
  --fg: #2A0F1F; --muted: #6E3A4E; --line: #F1D6DC;
  --red-text: #C8102E; --btn: #E0183A; --btn-fg: #FFFFFF; --warn: #8A4B00;
  --shadow: 0 1px 2px rgba(42, 15, 31, .05), 0 10px 30px rgba(42, 15, 31, .07);
  --rounded: ui-rounded, "Nunito", "SF Pro Rounded", system-ui, sans-serif;
  --measure: 36em;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #1A0A12; --paper: #2A1420; --sunken: #22101A; --blush: #2A0F1F;
          --fg: #FFF1F3; --muted: #E7AFBD; --line: #43202F;
          --red-text: #FF8BA3; --btn: #FF6B8A; --btn-fg: #2A0F1F; --warn: #FFCF73;
          --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .3); }
}
* { box-sizing: border-box; }
html { font: -apple-system-body; }            /* follows the iPhone's text-size setting */
body { margin: 0; background: var(--page); color: var(--fg); -webkit-font-smoothing: antialiased;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: max(17px, 1rem); line-height: 1.5; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px max(28px, env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  max-width: 640px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 12px 8px 16px;
  background: color-mix(in srgb, var(--page) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--rounded); font-weight: 800;
  font-size: 1.3rem; color: var(--primary); letter-spacing: -.01em; }
.brand img { display: block; height: 30px; width: auto; }
.icon-btn { width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-btn svg { width: 100%; height: 100%; fill: currentColor; }

/* buttons */
button { font: inherit; font-size: 1rem; font-weight: 600; min-height: 44px; border-radius: 12px; padding: 10px 18px;
  cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--fg); }
button.primary { background: var(--btn); color: var(--btn-fg); border-color: transparent; }
button.quiet { background: transparent; border-color: transparent; color: var(--red-text); }
button.small { min-height: 36px; padding: 4px 8px; font-size: .9rem; }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* 1. record view: the button is the screen */
.record-view { min-height: calc(100svh - 80px); display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 24px 0 48px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 10px; margin-bottom: 32px; }
.login p { margin: 0; color: var(--muted); }
#record { width: 200px; height: 176px; min-height: 0; padding: 0; border: 0; background: transparent; border-radius: 28px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#record:active { transform: none; }
#record svg { width: 100%; height: 100%; overflow: visible; }
#record .donut { transition: transform .15s; transform-origin: 60px 80px; }
#record:active .donut { transform: scale(.95); }
#record .hole { fill: var(--page); transition: r .2s; }
#record .stopmark { fill: var(--primary); opacity: 0; transition: opacity .2s; }
#record .arc { transform-origin: 60px 80px; transition: opacity .3s; }
#record.recording .hole { r: 24px; }
#record.recording .stopmark { opacity: 1; }
#record.recording .arc1 { animation: wave 1.4s ease-in-out infinite; }
#record.recording .arc2 { animation: wave 1.4s ease-in-out .25s infinite; }
#record.sending .arc1 { animation: fade 1.2s ease-in-out infinite; }
#record.sending .arc2 { animation: fade 1.2s ease-in-out .4s infinite; }
#record.sending .donut { opacity: .85; }
@keyframes wave { 0%, 100% { opacity: 1; transform: translateX(0); } 50% { opacity: .55; transform: translateX(6px); } }
@keyframes fade { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { #record .arc { animation: none !important; } }
#timer { margin: 18px 0 0; font-family: var(--rounded); font-size: 34px; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
#timer.muted { color: var(--muted); font-size: 22px; }
#recordLabel { margin: 6px 0 0; font-weight: 600; }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
#cancel { margin-top: 10px; }
#status { min-height: 1.5em; margin: 14px 0 0; max-width: 30em; color: var(--muted); font-size: .95rem; }
#status.error { color: var(--red-text); }
.progress { width: min(280px, 80%); margin: 18px 0 0; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .5s linear; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; font-size: .9rem; color: var(--muted); }
.steps li { padding: 2px 0 2px 22px; position: relative; }
.steps li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.now { color: var(--fg); font-weight: 600; }
.steps li.now::before { border-color: var(--primary); background: var(--primary); }
.steps li.done::before { border-color: var(--primary); }

/* 2. result: segmented control, white paper for reading */
.result { padding: 8px 0 0; }
.tabs { display: flex; gap: 2px; padding: 3px; margin: 4px auto 16px; max-width: 320px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); }
.tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 6px 10px; }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--fg); box-shadow: 0 1px 3px rgba(42, 15, 31, .14); }

.report, .transcript { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 20px 18px; max-width: var(--measure); margin: 0 auto; }
.r-head { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.r-meta { margin: 0; font-size: 13px; letter-spacing: .02em; color: var(--muted); }
.r-title { margin: 6px 0 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.r-lead { margin: 12px 0 0; font-size: 1.05rem; line-height: 1.55; }
.r-section { margin-top: 22px; }
.r-section h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; font-weight: 600; }
.r-section p { margin: 0; line-height: 1.55; }
.r-points { margin: 0; padding-left: 1.1em; }
.r-points li { margin: 6px 0; line-height: 1.5; }
.r-points li::marker { color: var(--primary); }
.r-actions { list-style: none; margin: 0; padding: 0; }
.r-actions li { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.r-actions li:first-child { border-top: 0; padding-top: 2px; }
.r-check { grid-row: span 2; width: 18px; height: 18px; margin-top: 3px; border: 2px solid var(--primary); border-radius: 5px; }
.r-what { font-weight: 600; line-height: 1.4; }
.r-who { grid-column: 2; font-size: .9rem; color: var(--muted); }
.r-topic + .r-topic { margin-top: 14px; }
.r-topic h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.r-foot { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.r-empty { margin: 0; color: var(--muted); }

.transcript .hint { margin: 0 0 14px; }
.turn { margin: 0 0 16px; }
.turn:last-child { margin-bottom: 0; }
.turn .who { display: inline-flex; align-items: baseline; gap: 8px; min-height: 32px; padding: 2px 10px; border-radius: 999px;
  border: 0; font-size: .85rem; font-weight: 700; background: var(--blush); color: var(--red-text); }
.turn .who small { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.turn.s2 .who { background: #EDE7FF; color: #4B2BB3; }
.turn.s3 .who { background: #E3F4EC; color: #1C6B45; }
.turn.s4 .who { background: #FFF1D6; color: #7A4B00; }
@media (prefers-color-scheme: dark) {
  .turn.s2 .who { background: #2D2350; color: #CBBDFF; } .turn.s3 .who { background: #173828; color: #A9E5C6; }
  .turn.s4 .who { background: #3A2A0E; color: #FFD796; }
}
.turn p { margin: 6px 0 0; line-height: 1.55; }
.t-plain { margin: 0; white-space: pre-wrap; line-height: 1.55; }

.warnings { max-width: var(--measure); margin: 10px auto 0; padding-left: 18px; color: var(--warn); font-size: .85rem; }
.warnings:empty { display: none; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: var(--measure); margin: 18px auto 0; }

/* settings sheet */
dialog { width: min(560px, 100%); max-height: 88svh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0;
  background: var(--paper); color: var(--fg); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
dialog::backdrop { background: rgba(42, 15, 31, .35); }
.sheet { padding: 8px 18px max(20px, env(safe-area-inset-bottom)); }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 8px 0;
  background: var(--paper); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
.sheet h3 { margin: 0; font-size: 1rem; }
.sheet-sub { display: flex; align-items: center; justify-content: space-between; }
.field { margin: 16px 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.help { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
select, textarea, input[type=password] { width: 100%; font: inherit; font-size: 1rem; color: var(--fg); background: var(--sunken);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.check input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--muted); font-size: .85rem; }
#history { list-style: none; padding: 0; margin: 6px 0 0; }
#history li { border-top: 1px solid var(--line); }
#history li:first-child { border-top: 0; }
.h-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-radius: 0; padding: 10px 0;
  background: transparent; text-align: left; }
.h-title { font-weight: 600; }
.h-item small { color: var(--muted); font-weight: 400; }

/* Markdown report (Laurens's prompt) */
.r-sub { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.r-h3 { margin: 24px 0 8px; font-size: 20px; line-height: 1.3; font-weight: 600; }
.r-h4 { margin: 16px 0 4px; font-size: 1rem; font-weight: 600; }
.r-p { margin: 0 0 10px; line-height: 1.55; }
.r-points ul { margin: 4px 0 2px; padding-left: 1.1em; }
.r-points li strong { font-weight: 600; }
.r-unsure { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: .78rem; font-weight: 600;
  background: #FFF1D6; color: #7A4B00; vertical-align: 1px; }
.r-photo { color: var(--muted); font-style: italic; }

/* top bar actions and the conversations list */
.top-actions { display: flex; align-items: center; gap: 2px; }
.text-btn { min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--red-text); font-weight: 600; }
.history-view { padding: 8px 0 24px; max-width: var(--measure); margin: 0 auto; }
.hv-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.hv-head h2 { margin: 0; font-size: 22px; }
.hv-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.hv-list li + li { border-top: 1px solid var(--line); }
.hv-list .hint { padding: 16px; margin: 0; }
.hv-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 14px 16px;
  border: 0; border-radius: 0; background: transparent; text-align: left; }
.hv-item:active { background: var(--sunken); transform: none; }
.hv-item small { color: var(--muted); font-weight: 400; }
.hv-head button { white-space: nowrap; flex: none; }
.hv-head h2 { flex: 1; }

/* several conversations in one recording */
.parts { max-width: var(--measure); margin: 0 auto 12px; }
.parts-label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 6px; text-align: center; }
.parts-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; justify-content: center; flex-wrap: wrap; }
.part-chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 10px;
  border-radius: 12px; font-weight: 700; }
.part-chip small { font-weight: 500; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.part-chip[aria-current="true"] { background: var(--btn); color: var(--btn-fg); border-color: transparent; }
.part-chip[aria-current="true"] small { color: var(--btn-fg); opacity: .85; }

/* login and invitation */
.auth-view { min-height: calc(100svh - 80px); display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 380px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px 22px; text-align: center; }
.auth-card img { border-radius: 14px; }
.auth-card h2 { margin: 12px 0 4px; font-size: 24px; }
.auth-card form { display: grid; gap: 6px; text-align: left; margin-top: 18px; }
.auth-card label { font-weight: 600; font-size: .9rem; margin-top: 8px; }
.auth-card input { width: 100%; font: inherit; font-size: 1rem; color: var(--fg); background: var(--sunken);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
button.wide { width: 100%; margin-top: 14px; }
.auth-status { min-height: 1.4em; margin: 12px 0 0; color: var(--red-text); font-size: .9rem; }
.hint.small { font-size: .78rem; margin-top: 16px; }

/* brand kit (Downloads/mimo-huisstijl → brand/): the logo on the login card, the bubble background behind it */
.auth-view { background: url("/static/brand/hero.svg") center bottom / cover no-repeat; margin: 0 -16px; padding: 24px 16px; }
@media (prefers-color-scheme: dark) { .auth-view { background: none; } }
.auth-card { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: color-mix(in srgb, var(--paper) 92%, transparent); }
.auth-logo { width: 200px; height: auto; display: block; margin: 0 auto 6px; }
.auth-card h2 { font-size: 20px; margin-top: 6px; }
