:root {
  --canvas: #F1EEE4; --surface: #FAF8F1; --tint: #D5E4DB; --track: #DDD9CB;
  --key: #DAE5D1; --key-alt: #E8DEC8; --selecting: #EDC565; --selected: #B9DAAE;
  --outline: #768675; --ink: #26342F; --ink-soft: #4C5D56; --chrome: #34463F; --accent: #48615A;
  --on-chrome: #F4F1E8; --warning: #D2694F;
  --radius: 18px; --shadow: 0 1px 2px rgba(38, 52, 47, .08), 0 8px 24px rgba(38, 52, 47, .08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--selecting); outline-offset: 3px; }
[hidden] { display: none !important; }

.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--chrome); color: var(--on-chrome); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; }
.brand em { font-style: normal; font-weight: 450; opacity: .8; }
.mark { width: 28px; height: 28px; }
.mark rect { fill: var(--on-chrome); } .mark ellipse { fill: var(--chrome); } .mark circle { fill: var(--on-chrome); }
.bar-actions { display: flex; gap: 8px; }
.bar .ghost { color: var(--on-chrome); border-color: rgba(244, 241, 232, .4); }

.primary { background: var(--chrome); color: var(--on-chrome); border: 0; border-radius: 999px; padding: 14px 28px; font-weight: 600; }
.primary:hover { background: var(--accent); }
.ghost { background: transparent; border: 1px solid var(--outline); border-radius: 999px; padding: 10px 18px; }
.ghost:hover { background: rgba(118, 134, 117, .12); }

.screen { min-height: calc(100vh - 60px); }
.intro { max-width: 720px; margin: 0 auto; padding: 64px 24px 48px; }
.eyebrow { color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; }
h1 { font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 20px; }
.lede { font-size: 20px; color: var(--ink-soft); margin: 0 0 32px; }
.steps { padding-left: 1.2em; margin: 0 0 36px; display: grid; gap: 10px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.fine { font-size: 13px; color: var(--ink-soft); }
.error { color: var(--warning); font-weight: 600; }

/* Calibration */
.stage { position: relative; height: calc(100vh - 60px); overflow: hidden; }
.target { position: absolute; width: 120px; height: 120px; transform: translate(-50%, -50%); transition: left .5s ease, top .5s ease; }
.target[data-look="straight"], .target[data-look="closed"] { left: 50%; top: 50%; }
.target[data-look="left"] { left: 70px; top: 50%; }
.target[data-look="right"] { left: calc(100% - 70px); top: 50%; }
.target[data-look="up"] { left: 50%; top: 70px; }
.target[data-look="left-up"] { left: 70px; top: 70px; }
.target[data-look="right-up"] { left: calc(100% - 70px); top: 70px; }
.target svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--track); stroke-width: 8; }
.ring { fill: none; stroke: var(--chrome); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .12s linear; }
.dot { fill: var(--chrome); }
.target[data-look="closed"] .dot { fill: var(--outline); }
.target.captured .dot { fill: var(--selected); }
.calib-card { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px; text-align: center; }
.calib-card .step { margin: 0; color: var(--ink-soft); font-size: 14px; }
.calib-card .prompt { margin: 4px 0; font-size: 22px; font-weight: 650; }
.calib-card .status { margin: 0; color: var(--accent); }
.look-report { margin-top: 10px; text-align: left; }
.look-report .summary { font-weight: 650; margin: 0 0 8px; }
.look-report table { width: 100%; border-collapse: collapse; font-size: 14px; }
.look-report th, .look-report td { padding: 4px 6px; border-bottom: 1px solid var(--track); }
.look-report th { color: var(--ink-soft); font-weight: 600; }
.look-report td.bad { color: var(--warning); font-weight: 650; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
#calibrate.reporting .target { display: none; }
#calibrate.reporting .calib-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); }

/* Talk */
#talk { padding: 20px 24px 32px; }
.question { text-align: center; font-size: clamp(24px, 3.4vw, 36px); margin: 4px 0 18px; letter-spacing: -.01em; }
.grid { display: grid; grid-template-columns: 1fr minmax(260px, 1.15fr) 1fr; grid-template-rows: repeat(3, minmax(120px, 1fr));
  gap: 14px; max-width: 1180px; margin: 0 auto; height: min(68vh, 640px); }
.tile { --fill: 0; position: relative; overflow: hidden; border: 0; border-radius: var(--radius); background: var(--key); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; }
.tile::before { content: ""; position: absolute; inset: 0; background: var(--selecting); transform-origin: left; transform: scaleX(var(--fill)); }
.tile > * { position: relative; }
.tile .word { font-size: clamp(22px, 2.6vw, 34px); font-weight: 700; text-transform: capitalize; }
.tile .hint { font-size: 13px; color: var(--ink-soft); }
.tile.action { background: var(--chrome); color: var(--on-chrome); }
.tile.action .hint { color: var(--tint); }
.tile.action.soft { background: var(--track); color: var(--ink); }
.tile.action.soft .hint { color: var(--ink-soft); }
.tile.fired { animation: fired .45s ease; }
@keyframes fired { 0% { box-shadow: 0 0 0 0 var(--selected); } 100% { box-shadow: 0 0 0 18px rgba(185, 218, 174, 0); } }
.centre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.preview { position: relative; width: 100%; max-width: 280px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #1d2724; }
.preview video, .preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 34px; }
.chip { background: var(--surface); border: 1px solid var(--outline); border-radius: 999px; padding: 4px 12px; font-weight: 600; text-transform: capitalize; }
.chip.empty { font-weight: 400; color: var(--ink-soft); border-style: dashed; text-transform: none; }
.live-status { margin: 0; min-height: 22px; font-size: 14px; color: var(--ink-soft); text-align: center; }
.live-status[data-kind="warn"] { color: var(--warning); font-weight: 600; }
.talk-actions { display: flex; justify-content: center; margin-top: 16px; }

.hood { position: fixed; right: 16px; bottom: 16px; width: 300px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; font-size: 14px; }
.hood h3 { margin: 0 0 10px; font-size: 15px; }
.crops { display: flex; gap: 8px; margin-bottom: 10px; }
.crops img { width: 50%; image-rendering: pixelated; border-radius: 6px; background: var(--track); aspect-ratio: 52 / 22; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 10px; }
.stats dt { color: var(--ink-soft); } .stats dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.errors { display: grid; gap: 3px; }
.err { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.err .barwrap { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.err .bar-fill { height: 100%; background: var(--accent); }
.err.best .bar-fill { background: var(--selecting); }

.sentence { position: fixed; inset: 0; background: rgba(38, 52, 47, .55); display: grid; place-items: center; padding: 24px; }
.sentence-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); max-width: 760px; padding: 40px; text-align: center; }
.said { font-size: clamp(28px, 4vw, 46px); line-height: 1.15; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; }
.source { color: var(--ink-soft); margin: 0 0 24px; }

.small { padding: 6px 12px; font-size: 14px; }
.coach { position: fixed; left: 16px; bottom: 16px; top: 76px; width: 360px; overflow-y: auto; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; font-size: 14px; }
.coach-head { display: flex; align-items: center; justify-content: space-between; }
.coach-head h3 { margin: 0; font-size: 16px; }
.coach-sub { color: var(--ink-soft); margin: 6px 0 12px; }
.coach-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.coach-steps li { line-height: 1.35; }
.coach-steps .tool { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 600; }
.coach-steps .why { color: var(--ink-soft); display: block; }
.coach-steps .saw { color: var(--accent); display: block; font-variant-numeric: tabular-nums; }
.coach-steps .err { color: var(--warning); }
.coach-steps .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--outline); margin-left: 4px; }
.coach-steps li.running .saw::after { content: "…"; }
.coach-result { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--key); font-weight: 600; }
.coach-result.needs_help, .coach-result.incomplete { background: var(--key-alt); }
.coach-banner { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 5; background: var(--chrome);
  color: var(--on-chrome); border-radius: 999px; padding: 12px 24px; font-size: 20px; font-weight: 650; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); text-align: center; }
.tile.target { outline: 5px solid var(--selecting); outline-offset: -5px; }
.preview.target { outline: 5px solid var(--selecting); }
.ask { position: fixed; inset: 0; background: rgba(38, 52, 47, .55); display: grid; place-items: center; padding: 24px; z-index: 10; }
.ask-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); max-width: 560px; padding: 32px; }
.ask-card h3 { font-size: 24px; margin: 4px 0 8px; }
@media (min-width: 1101px) { body.coach-open #talk { padding-left: 392px; } }
@media (max-width: 1100px) { .coach { position: static; width: auto; margin: 16px 24px; } }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; height: auto; grid-template-rows: repeat(3, 110px); }
  .centre { grid-column: 2; }
  .hood { position: static; width: auto; margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .target, .ring { transition: none; }
  .tile.fired { animation: none; }
}

/* ---------- Type screen, as in the app ---------- */
#talk { padding: 18px 20px 24px; }
.type { display: grid; gap: 14px; max-width: 1400px; margin: 0 auto;
  grid-template-columns: 1fr 1.25fr 1fr; grid-template-rows: auto auto minmax(170px, auto);
  grid-template-areas: "tl top tr" "tl text tr" "bl mid br"; }
.tl { grid-area: tl; } .tr { grid-area: tr; } .bl { grid-area: bl; } .br { grid-area: br; }
.topbar { grid-area: top; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.textline { grid-area: text; background: var(--surface); border: 2px solid var(--outline); border-radius: 18px;
  padding: 14px 18px; font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; min-height: 58px; display: flex; align-items: center;
  overflow-wrap: anywhere; }
.middle { grid-area: mid; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.llm { background: var(--tint); border-radius: 18px; padding: 16px 18px; text-align: center; font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 600; min-height: 76px; display: flex; align-items: center; justify-content: center; }
.heard { display: flex; gap: 10px; align-items: center; }
.heard input { flex: 1; min-width: 0; font: inherit; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--outline);
  background: var(--surface); color: var(--ink); }
.mic { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--outline); background: var(--key-alt);
  display: grid; place-items: center; }
.mic svg { width: 26px; height: 26px; fill: var(--ink); }
.mic.listening { background: var(--selecting); }
.middle { justify-content: center; }
.camrow { display: flex; gap: 14px; align-items: center; justify-content: center; max-width: 1400px; margin: 14px auto 0; }
.camrow .preview { width: 160px; max-width: 160px; flex: none; border-radius: 12px; }
.camrow .live-status { text-align: left; margin: 4px 0 0; }
.seeing { min-width: 280px; }
.seeing p { margin: 0; }
.seeing-look { font-size: 18px; }
.seeing-look .label { color: var(--ink-soft); }
.seeing .ok { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.seeing .ok.yes { background: var(--selected); }
.seeing .ok.no { background: var(--track); color: var(--ink-soft); }
.holdbar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin: 6px 0; width: 260px; }
.holdbar span { display: block; height: 100%; width: 0; background: var(--selecting); transition: width .08s linear; }
.keys { font-size: 13px; color: var(--ink-soft); margin-top: 6px !important; }
kbd { font: 600 12px/1 var(--font); border: 1px solid var(--outline); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px;
  background: var(--surface); }

.tile.key, .tile.fn { position: relative; overflow: hidden; border: 2px solid var(--outline); border-radius: 22px; box-shadow: none;
  color: var(--ink); text-align: center; }
.tile.key { background: var(--key); display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; padding: 14px 22px; }
.tile.key .badge { position: absolute; top: 18px; left: 18px; width: 58px; }
.tile.key.tr .badge, .tile.key.br .badge { left: auto; right: 18px; }
.tile.key .main { font-size: clamp(26px, 3.2vw, 46px); font-weight: 700; letter-spacing: .04em; padding: 0 46px; text-transform: none; }
.tile.key .rule { height: 2px; background: rgba(118, 134, 117, .35); margin: 0 12px; }
.tile.key .sub { font-size: clamp(18px, 2vw, 28px); color: var(--ink-soft); }
.tile.fn { background: var(--key-alt); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; padding: 14px 18px;
  min-height: 82px; }
.tile.fn .badge { width: 50px; flex: none; }
.tile.fn .main { font-size: clamp(22px, 2.4vw, 34px); font-weight: 700; }
.tile.fn[data-look="closed"] .badge { background: var(--surface); border-radius: 50%; padding: 6px; width: 54px; }
.badge .lid { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.badge .pupil { fill: var(--ink); }
.badge .closed { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.tile.key::before, .tile.fn::before { opacity: .85; }
.tile.key.empty .sub { opacity: .7; }
.tile.key .main.long { font-size: clamp(20px, 2.3vw, 34px); letter-spacing: .01em; white-space: nowrap; }

.finish { width: min(920px, 100%); display: grid; gap: 14px; }
.finish .sentence-card { padding: 34px 40px; }
.finish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finish-actions .tile.fn.speak { background: var(--key); }

@media (max-width: 860px) {
  .type { grid-template-columns: 1fr 1fr; grid-template-rows: auto; min-height: 0;
    grid-template-areas: "top top" "text text" "tl tr" "bl br" "mid mid"; }
  .tile.key { min-height: 150px; }
}

/* ---------- app-style tab bar ---------- */
.bar { padding: 10px 20px; }
.brand { gap: 18px; }
.wordmark { font-size: 24px; font-weight: 700; letter-spacing: .01em; margin-right: 6px; }
.tabs { display: flex; align-items: center; gap: 4px; }
.tab { background: transparent; border: 0; color: var(--tab-idle, #C9D3CC); font-size: 17px; font-weight: 500; padding: 8px 16px;
  border-radius: 999px; }
.tab:hover { color: var(--on-chrome); }
.tab.active { background: var(--on-chrome); color: var(--ink); font-weight: 600; }
.tab-sep { width: 1px; height: 26px; background: rgba(244, 241, 232, .3); margin: 0 8px; }
.panel[hidden] { display: none !important; }

/* ---------- Quick chat ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, minmax(170px, 1fr)); gap: 16px;
  max-width: 1400px; margin: 0 auto; }
.tile.qc { position: relative; border: 2px solid var(--outline); border-radius: 22px; background: var(--key); box-shadow: none;
  display: flex; align-items: center; justify-content: center; padding: 58px 24px 24px; color: var(--ink); }
.tile.qc.alt { background: var(--key-alt); }
.tile.qc .badge { position: absolute; top: 18px; width: 58px; }
.tile.qc.pos-l .badge { left: 18px; }
.tile.qc.pos-r .badge { right: 18px; }
.tile.qc.pos-c .badge { left: 50%; transform: translateX(-50%); }
.tile.qc[data-look="closed"] .badge { background: var(--surface); border-radius: 50%; padding: 6px; width: 56px; }
.tile.qc .main { font-size: clamp(22px, 2.6vw, 38px); font-weight: 650; line-height: 1.2; }
.tile.qc .main.phrase { font-size: clamp(18px, 1.9vw, 28px); font-weight: 600; }
.tile.qc .main.note { font-size: 16px; font-weight: 400; color: var(--ink-soft); }

/* ---------- Spell ---------- */
.spell { max-width: 1400px; margin: 0 auto; display: grid; gap: 14px; }
.spell-text { background: var(--surface); border-radius: 22px; padding: 20px 28px 12px; display: grid;
  grid-template-columns: 1fr auto; align-items: center; gap: 4px 20px; box-shadow: var(--shadow); }
.spelled { margin: 0; font-size: clamp(30px, 3.6vw, 52px); font-weight: 700; min-height: 1.3em; overflow-wrap: anywhere; }
.spelled .placeholder { color: var(--ink-soft); font-weight: 600; }
.caret { display: inline-block; width: 10px; height: 1em; background: var(--accent); vertical-align: -0.12em; margin-left: 4px; }
.spell-hint { margin: 0; text-align: right; color: var(--ink-soft); font-size: 15px; }
.spell-hint strong { color: var(--ink); font-size: 18px; }
.spell-progress { grid-column: 1 / -1; height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.spell-progress span { display: block; height: 100%; width: 0; background: var(--selecting); }
.spell-keys { background: var(--tray, #DCD7C8); border-radius: 22px; padding: 14px; display: grid; gap: 10px; }
.krow { display: flex; justify-content: center; gap: 10px; padding: 6px; border-radius: 14px; border: 3px solid transparent; }
.krow.active { background: #E5D3A0; border-color: var(--ink); }
.k { min-width: 0; flex: 0 1 9%; padding: 14px 6px; border: 0; border-radius: 12px; background: var(--key-flat, #FBF9F3);
  font-size: clamp(20px, 2.4vw, 34px); font-weight: 600; color: var(--ink); box-shadow: 0 2px 0 rgba(48, 58, 53, .25); }
.k.word { flex: 1 1 40%; background: transparent; box-shadow: none; font-weight: 500; }
.k.action { flex: 1 1 18%; font-size: clamp(16px, 1.8vw, 26px); background: var(--key-function, #C9C3B1); }
.k.action[data-id="space"] { flex: 2 1 30%; background: var(--key-flat, #FBF9F3); }
.k.action[data-id="speak"] { background: var(--accent); color: var(--on-chrome); }
.k.active { outline: 4px solid var(--ink); outline-offset: 0; background: var(--selecting); color: var(--ink); }
.spell-state { margin: 0; text-align: center; color: var(--ink-soft); }

/* ---------- Settings ---------- */
.settings { max-width: 720px; margin: 0 auto; background: var(--surface); border-radius: 22px; padding: 28px 32px; box-shadow: var(--shadow);
  display: grid; gap: 22px; }
.settings h2 { margin: 0; }
.setting { display: grid; gap: 8px; }
.setting.row { display: flex; align-items: center; gap: 12px; }
.setting input[type="range"] { width: 100%; accent-color: var(--chrome); }
/* the header never forces sideways scrolling: tabs and actions wrap onto a second line when narrow */
.bar { flex-wrap: wrap; gap: 8px 16px; }
.brand { flex-wrap: wrap; min-width: 0; }
.tabs { flex-wrap: wrap; }
.tab, .bar .ghost { white-space: nowrap; }
.bar-actions { flex-wrap: wrap; }
@media (max-width: 900px) { .tab { font-size: 15px; padding: 6px 12px; } .wordmark { font-size: 21px; } }

/* ---------- Edge layout: each box sits where its calibration circle was ---------- */
#talk { padding: 0; }
.edges { display: grid; height: calc(100vh - 66px); padding: 14px 18px; gap: 14px;
  grid-template-columns: minmax(170px, 23vw) 1fr minmax(170px, 23vw);
  grid-template-rows: minmax(110px, 21vh) 1fr minmax(96px, 16vh);
  grid-template-areas: "tl up tr" "l centre r" ". cl ."; }
.a-tl { grid-area: tl; } .a-up { grid-area: up; } .a-tr { grid-area: tr; }
.a-l { grid-area: l; } .a-r { grid-area: r; } .a-cl { grid-area: cl; }
.a-up, .a-cl { justify-self: center; width: min(420px, 100%); }
.centre-area { grid-area: centre; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  width: min(680px, 100%); justify-self: center; min-height: 0; }
.centre-area .textline, .centre-area .llm { min-height: 58px; }
.rest-hint { margin: 0; text-align: center; color: var(--ink-soft); font-size: 17px; }
.cam-slot .camrow { margin: 4px 0 0; justify-content: center; }

.tile.edge.key { padding: 52px 14px 12px; }
.tile.edge.key .badge { top: 12px; left: 14px; width: 50px; }
.tile.edge.key.a-tr .badge, .tile.edge.key.a-r .badge { left: auto; right: 14px; }
.tile.edge.key .main { font-size: clamp(22px, 2.6vw, 40px); padding: 0 4px; }
.tile.edge.key .sub { font-size: clamp(16px, 1.6vw, 24px); }
.tile.edge.fn { min-height: 0; height: 100%; }
.tile.edge.qc { padding: 48px 18px 18px; }
.tile.edge.qc.a-tl .badge, .tile.edge.qc.a-l .badge { left: 16px; right: auto; transform: none; }
.tile.edge.qc.a-tr .badge, .tile.edge.qc.a-r .badge { right: 16px; left: auto; transform: none; }
.tile.edge.qc.a-up .badge, .tile.edge.qc.a-cl .badge { left: 50%; transform: translateX(-50%); }
.tile.edge.qc .badge { top: 12px; width: 50px; }
.tile.edge.qc[data-look="closed"] .badge { width: 50px; }

/* Finish: Speak at the left edge, Back in the top-right corner, the sentence in the middle */
.sentence { padding: 0; }
.finish { width: min(760px, calc(100% - 48vw)); }
.tile.fn.finish-btn { position: fixed; width: min(320px, 22vw); height: 120px; z-index: 11; }
.tile.fn.finish-btn.at-l { left: 18px; top: 50%; transform: translateY(-50%); background: var(--key); }
.tile.fn.finish-btn.at-tr { right: 18px; top: 80px; }
.coach-banner { top: auto; bottom: 18vh; }

@media (max-width: 860px) {
  .edges { height: auto; grid-template-columns: 1fr 1fr; grid-template-rows: auto;
    grid-template-areas: "up up" "tl tr" "l r" "centre centre" "cl cl"; }
  .tile.edge.key, .tile.edge.qc { min-height: 130px; }
  .finish { width: calc(100% - 32px); }
  .tile.fn.finish-btn { position: static; width: auto; transform: none; }
}
