/* Curiosity Coach. One column, phone first.
   The loud thing is the learner's own words, set in heavy condensed type. Everything else stays quiet.
   Colour means one thing only: the kind of a question (what, how, why, what if). */

@font-face {
  font-family: "Anek Latin";
  src: url("/fonts/anek-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --ink: #0B0E14;
  --muted: #474C55;
  --faint: #6B707A;
  --line: #DFE0DB;
  --panel: #F2F2EE;
  --what: #2B87D3;
  --how: #1F7A45;
  --why: #E4572E;
  --whatif: #E3A008;
  --danger: #B42318;
  --radius: 10px;
  --font: "Anek Latin", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17.5px; line-height: 1.5; font-weight: 420;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(48px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
.noscript { padding: 24px; }

/* ---- top bar and tabs ---- */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; font-stretch: 80%; font-size: 19px; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; stroke: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 720; text-decoration: none; background: none; cursor: pointer; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); margin: 0 -16px 22px; padding: 0 8px; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 2px 7px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 620; font-stretch: 84%; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a svg { width: 19px; height: 19px; flex: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- type ---- */
h1, h2, h3, p { margin: 0; }
.display { font-size: clamp(40px, 11.5vw, 58px); line-height: .95; font-weight: 780; font-stretch: 75%; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 34px; line-height: 1.02; font-weight: 770; font-stretch: 77%; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.15; font-weight: 740; font-stretch: 82%; }
h3 { font-size: 17.5px; font-weight: 700; }
.lede { color: var(--muted); margin-top: 8px; }
.small { font-size: 15px; color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: -6px 0 12px -5px; font-size: 15.5px; font-weight: 650; text-decoration: none; }
.back svg { width: 18px; height: 18px; }
.said { font-size: 26px; line-height: 1.08; font-weight: 760; font-stretch: 78%; text-wrap: balance; overflow-wrap: anywhere; }
.stack > * + * { margin-top: 14px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-size: 15px; font-weight: 650; }

/* ---- buttons and fields ---- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 10px 16px; border-radius: var(--radius); border: 2px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; font-stretch: 88%; font-size: 17.5px; cursor: pointer; text-decoration: none; text-align: center; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.outline { background: var(--bg); color: var(--ink); }
.btn.quiet { border-color: transparent; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; font-weight: 650; }
.btn.danger { background: var(--bg); color: var(--danger); border-color: var(--danger); }
.btn.inline { width: auto; min-height: 40px; font-size: 15.5px; padding: 6px 12px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-weight: 650; font-size: 15.5px; margin-bottom: 4px; }
.field { width: 100%; padding: 11px 12px; border: 1.5px solid var(--faint); border-radius: var(--radius); background: var(--bg); }
textarea.field { resize: none; min-height: 52px; overflow: hidden; line-height: 1.35; }
.field:focus { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.hint { font-size: 14.5px; color: var(--faint); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 13px; background: none; font-size: 15px; font-weight: 600; cursor: pointer; }

/* ---- lists ---- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows.section { margin-top: 30px; }
.rows li a, .rows li button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-decoration: none; cursor: pointer; }
.rows b { display: block; font-weight: 700; }
.rows span.sub { display: block; font-size: 15px; color: var(--faint); }
.rows svg { width: 18px; height: 18px; flex: none; color: var(--faint); }

/* ---- photos ---- */
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs.three { grid-template-columns: repeat(3, 1fr); }
.thumb { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--panel); border: 0; padding: 0; cursor: pointer; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.waiting img { opacity: .55; }
.badge { position: absolute; left: 5px; bottom: 5px; background: var(--bg); color: var(--ink); font-size: 12.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.photo-hero { width: 100%; max-height: 38vh; min-height: 120px; object-fit: cover; border-radius: var(--radius); background: var(--panel); }
.photo-hero.compact { max-height: 22vh; }
.dropzone { border: 1.5px dashed var(--faint); border-radius: var(--radius); padding: 12px; text-align: center; color: var(--muted); font-size: 15px; margin-top: 10px; }
.wide-only { display: none; }

/* ---- the question posts: one painted post per question, coloured by its kind ---- */
.ground { display: flex; align-items: flex-end; gap: 5px; min-height: 44px; padding: 0 2px; border-bottom: 2px dashed var(--faint); flex-wrap: wrap; }
.post { width: 9px; height: 34px; border-radius: 3px 3px 0 0; background: var(--faint); flex: none; }
.post.small { height: 22px; }
.ground.tall { min-height: 64px; margin-top: 12px; }
.ground.tall .post { height: 46px; width: 11px; }
.k-what { background: var(--what); } .k-how { background: var(--how); } .k-why { background: var(--why); } .k-whatif { background: var(--whatif); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 15px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 16px; border-radius: 2px 2px 0 0; display: inline-block; }
.legend b { font-variant-numeric: tabular-nums; }

.q { display: grid; grid-template-columns: 9px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
button.q { cursor: pointer; }
.q .post { height: auto; min-height: 44px; border-radius: 3px; }
.q.coach .post { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.75) 0 4px, transparent 4px 8px); }
.q-text { font-size: 21px; line-height: 1.12; font-weight: 740; font-stretch: 80%; overflow-wrap: anywhere; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.q-text, .q-note, .q .small { display: block; }
.q-note { margin-top: 4px; font-size: 15.5px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-block; }
.dots i.on { background: var(--ink); }

/* ---- exploration ---- */
.steps { display: flex; gap: 16px; font-size: 14.5px; color: var(--faint); font-weight: 650; margin: 14px 0 4px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps .now { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.questions { border-top: 1px solid var(--line); }
.place { scroll-margin-top: 8px; }
.report { margin-top: 10px; }
.clue { border-left: 4px solid var(--ink); padding: 2px 0 2px 14px; scroll-margin-top: 14px; }
.clue .asked { font-weight: 700; font-stretch: 85%; }
.clue .credit { color: var(--how); font-weight: 600; margin-top: 4px; }
.clue .layer { margin-top: 6px; }
.clue .open { margin-top: 8px; color: var(--muted); font-style: italic; }
.ai-note { font-size: 13.5px; color: var(--faint); margin-top: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ai-note button { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--faint); cursor: pointer; font-size: 13.5px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; }
.notice { border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 6px 0; }
.thinking i { width: 9px; height: 22px; border-radius: 2px 2px 0 0; background: var(--ink); animation: bob 1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; background: var(--why); } .thinking i:nth-child(3) { animation-delay: .3s; background: var(--what); }
@keyframes bob { 50% { transform: scaleY(.45); transform-origin: bottom; } }
@media (prefers-reduced-motion: reduce) { .thinking i { animation: none; } }

/* ---- gym ---- */
.versus { display: grid; gap: 14px; }
.answer { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.answer.better { border-color: var(--ink); border-width: 2px; }
.answer h3 { margin-bottom: 2px; font-size: 15px; color: var(--muted); }
.panel .said { margin-top: 2px; }
.panel .lesson { margin-top: 6px; }
details summary .sum-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details summary .sum-sub { display: block; font-size: 14.5px; font-weight: 500; color: var(--faint); }
details > summary { list-style-position: outside; margin-left: 18px; }
.answer .prompt { font-weight: 720; font-stretch: 82%; font-size: 19px; line-height: 1.15; margin-bottom: 8px; overflow-wrap: anywhere; }
.answer .text p + p, .answer .text ol, .answer .text ul { margin-top: 8px; }
.answer .text ol, .answer .text ul { padding-left: 22px; margin-bottom: 0; }
details summary { cursor: pointer; font-weight: 700; padding: 10px 0; }

/* ---- week and admin tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: right; font-size: 13.5px; color: var(--faint); font-weight: 650; padding: 6px 0 6px 12px; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 0; }
.table th.row-label { font-size: 16px; color: var(--ink); font-weight: 420; padding: 11px 0; border-top: 1px solid var(--line); }
.table td { padding: 11px 0 11px 12px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; vertical-align: top; }
.table td.strong { font-weight: 760; }
.table td.dim { color: var(--faint); }
.bars { display: grid; grid-template-columns: max-content 1fr 28px; gap: 10px 12px; align-items: center; margin-top: 12px; font-size: 15px; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.track { display: block; height: 10px; background: var(--panel); border-radius: 2px; overflow: hidden; }
.track .fill { display: block; height: 100%; background: var(--ink); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.person { padding: 14px 0; border-bottom: 1px solid var(--line); }
.person .who { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.person .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.secret { font-size: 22px; font-weight: 760; font-stretch: 85%; letter-spacing: .01em; overflow-wrap: anywhere; user-select: all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inset { margin-top: 14px; padding: 14px; background: var(--panel); border-radius: var(--radius); }
.safe-list { margin: 0; padding-left: 26px; display: grid; gap: 16px; }
.safe-list.section { margin-top: 22px; }
.radios { border: 0; margin: 0; padding: 0; min-width: 0; }
.radios legend { padding: 0; margin-bottom: 4px; font-size: 15.5px; font-weight: 650; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; margin: 0; font-size: 16.5px; font-weight: 420; }
.radio input { flex: none; width: 21px; height: 21px; margin: 2px 0 0; accent-color: var(--ink); }
.safe-list li::marker { font-weight: 740; }
.safe-list strong { display: block; font-size: 21px; line-height: 1.12; font-weight: 740; font-stretch: 80%; }
.safe-list span { display: block; color: var(--muted); margin-top: 2px; }
.agreement { margin-top: 12px; }
.agreement.notice .inset { background: var(--bg); }
.proof { display: block; width: 100%; max-height: 70vh; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.note-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; background: var(--panel); padding: 12px 14px; border-radius: var(--radius); max-height: 340px; overflow: auto; }
input[type="file"].field { padding: 10px; font-size: 15px; }
input[type="date"].field { min-height: 50px; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }

/* ---- camera ---- */
.camera { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; }
.camera video { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.camera .controls { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px calc(20px + env(safe-area-inset-bottom, 0px)); }
.camera .controls > * { flex: 1; }
.camera .controls a { color: #fff; font-weight: 700; font-size: 17px; padding: 10px 0; }
.camera .shutter { flex: none; width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); padding: 0; cursor: pointer; }
.camera .shutter:focus-visible { outline-color: #fff; }
.camera .shutter[disabled] { opacity: .5; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); max-width: calc(100vw - 32px); z-index: 30; font-size: 16px; }
.center { text-align: center; }
.idea { padding: 18px 0; border-bottom: 1px solid var(--line); }
.idea p { margin-top: 6px; }
.idea .src { font-size: 14.5px; color: var(--faint); }
.idea .in-app { font-size: 15px; font-weight: 650; }

@media (min-width: 620px) {
  .app { padding-top: 12px; }
  .versus { grid-template-columns: 1fr 1fr; }
  .wide-only { display: block; }
  .tabs a { flex-direction: row; gap: 7px; font-size: 15.5px; padding: 12px 2px 10px; }
}
