/* Readable everywhere (loaded last): no text below a comfortable size, and the small capital labels in one style:
   bold mono capitals, 12px on computers and 13px on phones. Found by an audit of every screen at phone width. */

/* ---------- small capital labels ---------- */
.ls-k, .ra-t, .kpi .l, .nb-voice, .pill, .sl-state, .nb-sel small, .space-lvl .sl-state, .lb em, .block-node small, .bubble .who, .story-line .who, .vs-k, .adm-kpi .l, .h4-k {
  font-size: 12px !important; font-weight: 600 !important; letter-spacing: .08em !important;
}

/* ---------- small body text: at least 14px ---------- */
.nb-chip, .ra-tabs button, .nb-vt button, .bsum-actions button, .ls-opt small, .nb-grp-h span, .nb-lib-meta span, .nb-lib-meta, .ls-dir span, .ls-sl output,
.sl-time, .space-continue small, .space-link small, .nb-foot, .nb-who, .nb-day-n, .nb-note, .nb-ex, .nb-tr, .ra-list li, .ra-trend, .teach-ra-list .small,
.cm-b-can, .cm-camp-t span, .v2-camp-t span, .muted.small, .faint.small, .small.muted, .small.faint {
  font-size: 14px !important;
}
.nb3 .nb-k, .nb-k { font-size: 12px !important; }
.kpi .v small, .adm-kpi .v small { font-size: 12.5px !important; }
.nb-wks span { font-size: var(--fs-xs) !important; }

@media (max-width: 640px) {
  .ls-k, .ra-t, .kpi .l, .nb-voice, .pill, .sl-state, .nb-sel small, .space-lvl .sl-state, .lb em, .block-node small, .bubble .who, .story-line .who, .vs-k, .adm-kpi .l, .h4-k {
    font-size: 13px !important;
  }
  small, .small { font-size: 14px; }
  .nb-chip, .ra-tabs button, .nb-vt button, .bsum-actions button, .ls-opt small, .nb-grp-h span, .nb-lib-meta span, .nb-lib-meta, .ls-dir span, .ls-sl output,
  .sl-time, .space-continue small, .space-link small, .nb-foot, .nb-who, .nb-day-n, .nb-note, .nb-ex, .nb-tr, .ra-list li, .ra-trend, .cm-b-can, .cm-camp-t span {
    font-size: 14.5px !important;
  }
  .nb-chip, .ra-tabs button, .nb-vt button { padding-top: 7px; padding-bottom: 7px; }
  .nb-wks span { font-size: var(--fs-xs) !important; }
}

/* ---------- second audit: inside the Block, the notebook overview and Ember ---------- */
.feedback .k, .hint, .standee .nm, .basics-tbl th, .nb-k { font-size: 12px !important; font-weight: 600 !important; letter-spacing: .07em !important; }
.scene-controls .counter, .mcq .key, .beat span, .camp-node small, .space-today small, .nb-ov summary span, .btn .mono.faint { font-size: 13.5px !important; }
.bubble .l1b, .ex-card > .faint, .card > .faint { font-size: 14px !important; }
.ring b { font-size: 15px !important; }
@media (max-width: 640px) {
  .feedback .k, .hint, .standee .nm, .basics-tbl th, .nb-k, .nb3 .nb-k { font-size: 13px !important; }
  .scene-controls .counter, .mcq .key, .beat span, .camp-node small, .space-today small, .nb-ov summary span, .btn .mono.faint, .bubble .l1b, .ex-card > .faint, .card > .faint { font-size: 14.5px !important; }
}

/* Notebook overview: the summary line wraps instead of being cut; bars never grow out of the chart. */
.nb-ov summary { flex-wrap: wrap; row-gap: 2px; }
.nb-ov summary span { flex-basis: 100%; }
.nb-bars { overflow: hidden; }
.nb-bar { max-height: 100%; }
/* Notebook tabs: four tabs as a tidy 2 × 2 grid on phones */
@media (max-width: 640px) {
  .nb3-tabs { grid-template-columns: repeat(2, 1fr); border-radius: 22px; gap: 2px; }
  .nb3-tabs a { font-size: 15px; font-weight: 600; padding: 11px 6px; }
}
.nb3-tabs { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .nb3-tabs { grid-template-columns: repeat(2, 1fr); } }

/* Listening bar: Continue, Start again and Stop fit on a phone (wrapping onto two rows when needed) */
.tts-bar { max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
@media (max-width: 480px) {
  .tts-bar { left: 12px; right: 12px; transform: none; max-width: none; border-radius: 22px; padding: 8px 10px; gap: 8px; }
  .tts-bar .tts-k { flex-basis: 100%; text-align: center; }
  .tts-bar .btn { padding: 8px 11px; }
}

/* Explanations: a small flag switches between the learner's language and the original English */
.xpl-flag { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: -3px 0 0 4px; padding: 4px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; line-height: 0; }
.xpl-flag img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.xpl-flag:hover, .xpl-flag:focus-visible { background: var(--line, rgba(0, 0, 0, .06)); }
.xpl-wait .xpl-t { opacity: .55; transition: opacity .2s; }
@media (max-width: 640px) { .xpl-flag img { width: 22px; height: 15px; } }

/* Questions and answers up to B1: English first, a smaller and lighter translation underneath */
.gl-tr { display: block; margin-top: 4px; font: 400 15px/1.35 var(--sans, Inter, system-ui, sans-serif); letter-spacing: 0; color: var(--text-3, #756E63); }
.prompt-big .gl-tr, .gap-sentence .gl-tr { font-size: 16px; margin-top: 6px; }
.mcq button .gl-tr { font-size: 14px; margin-top: 2px; }
.mcq button:has(.gl) { display: flex; align-items: baseline; gap: 12px; }
.mcq button .gl { display: block; flex: 1; min-width: 0; }
.mcq button:has(.gl) .key { flex: none; }

/* Extra, if you want more: optional practice cards after a Block */
.xtra { margin-top: 16px; }
.xtra-h { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.xtra-h .muted { margin: 2px 0 0; }
.xtra-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.xtra-list li { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.xtra-t { display: grid; gap: 2px; min-width: 0; }
.xtra-t > span { font: 400 1.05rem/1.35 var(--serif); }
.xtra-t small { font-size: 14px; color: var(--text-2, #5E5950); }
.xtra-ok { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ok); white-space: nowrap; }
.xtra-ok svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .xtra-list li { grid-template-columns: auto 1fr; }
  .xtra-list li > .nb-k { grid-column: 1 / -1; justify-self: start; }
  .xtra-list li > .btn, .xtra-list li > .xtra-ok { grid-column: 1 / -1; justify-self: start; }
}

/* Waking up: shown only when the server is slow to answer at start */
.waking { text-align: center; padding: 18vh 16px 0; }
.waking h2 { margin: 18px 0 8px; }
.waking-dot { width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--accent); animation: waking 1.4s ease-in-out infinite; }
@keyframes waking { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.25); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .waking-dot { animation: none; } }

/* Basics: listen and listen slowly next to each date, time or price */
.date-ls { display: inline-flex; gap: 4px; margin-left: 10px; vertical-align: middle; }
.date-ls .btn { min-height: 36px; padding: 6px 9px; }

/* Story: line by line (one line at a time, translation under it) or the whole scene */
.lbl-mode { display: inline-flex; gap: 2px; padding: 3px; margin: 14px 0 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-elev); }
.lbl-mode button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font: 600 15px/1.2 var(--sans); color: var(--text-2, #5E5950); cursor: pointer; }
.lbl-mode button.on { background: var(--text); color: var(--bg); }
.lbl-next-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 6px; }
.scene-controls.lbl-on #play, .scene-controls.lbl-on #slow { display: none; }
.story-line.lbl-hidden { display: none; }

/* Tutors: what to improve */
.imp-days { gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.imp-sec { margin-top: 16px; }
.imp-sec h3 { margin: 0 0 12px; }
.imp-tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.imp-tbl th { text-align: left; font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.imp-tbl td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.imp-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.imp-list li { display: grid; gap: 2px; }
.imp-words { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.imp-log-f textarea { width: 100%; margin-bottom: 8px; }
.imp-log-f .row { gap: 8px; flex-wrap: wrap; }
.imp-log { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.imp-log p { margin: 2px 0 0; }
@media (max-width: 640px) { .imp-tbl { font-size: 14px; } .imp-tbl th:nth-child(2), .imp-tbl td:nth-child(2) { display: none; } }
.finish-note { margin: 10px 0 0; color: var(--text-2, #5E5950); }

/* Your Blocks: go back into any part of a Block */
.yb-list { display: grid; gap: 16px; }
.yb-card { display: grid; gap: 12px; }
.yb-head h3 { margin: 8px 0 2px; }
.yb-head h3 a { color: inherit; text-decoration: none; }
.yb-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.yb-part { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font: 600 15px/1.2 var(--sans); color: var(--text); text-decoration: none; background: var(--bg-elev); }
.yb-part:hover, .yb-part:focus-visible { border-color: var(--accent); }
.yb-foot { gap: 8px; flex-wrap: wrap; }
.yb-more { margin-top: var(--sp-5); text-align: center; }
.read-optional { margin: 0 0 12px; color: var(--text-2, #5E5950); }
.read-optional .pill { margin-right: 6px; }

/* Ember: practise a Block, the notebook, or just chat */
.em-pick { display: grid; gap: 8px; }
.em-k { margin: 4px 0 0; font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.em-chips { gap: 8px; flex-wrap: wrap; }
.em-lost { white-space: nowrap; }
@media (max-width: 640px) { .em-k { font-size: 13px; } }

/* Ember: archive of conversations, saving a conversation to the notebook */
.em-archive { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.em-arch { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; color: var(--text); font: inherit; }
.em-arch:hover, .em-arch:focus-visible { border-color: var(--accent); }
.em-arch .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.em-phr { display: grid; gap: 8px; margin: 6px 0 10px; }
.em-phr label, .em-sum { display: flex; gap: 8px; align-items: flex-start; }
.em-old { max-height: 50vh; overflow: auto; }
.em-memlist { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.em-memlist li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }

/* Today: phrase of the week and a little British life */
.st-extra { display: grid; gap: var(--sp-3); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-k { display: block; font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.st-pw { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.st-pw .st-k { grid-column: 1 / -1; }
.st-pw b { font: 400 1.1rem/1.35 var(--serif); }
.st-pw small { grid-column: 2; color: var(--text-2, #5E5950); font-size: 14px; }
.st-tip { font-size: 15px; color: var(--text-2, #5E5950); }
@media (max-width: 640px) { .st-k { font-size: 13px; } }

/* First-time hints: one small bubble per feature */
.hint-bubble { position: fixed; z-index: 400; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--text); color: var(--bg); font: 500 15px/1.4 var(--sans); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45); animation: hint-in .25s ease; }
.hint-bubble::before { content: ''; position: absolute; top: -6px; left: var(--arrow, 50%); width: 12px; height: 12px; background: var(--text); transform: translateX(-50%) rotate(45deg); }
.hint-bubble button { border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: .8; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hint-bubble { animation: none; } }

/* What you can do now: can-do ticks for completed Blocks */
.space-cando ul { list-style: none; padding: 0; margin: 8px 0 8px; display: grid; gap: 8px; }
.space-cando li { display: flex; gap: 8px; align-items: flex-start; }
.space-cando li svg { flex: none; width: 18px; height: 18px; color: var(--green, #2f9e6b); margin-top: 2px; }

/* Camp postcard */
.pc-btn { margin-left: auto; }
.postcard { display: grid; grid-template-columns: 1fr 1.3fr; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #ddd); background: var(--surface, #fff); }
.pc-front { background: var(--pc); color: #fff; padding: 22px 18px; position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; }
.pc-front h2 { margin: 0; color: #fff; font-size: 1.5rem; line-height: 1.15; }
.pc-hi { margin: 0 0 4px; font-style: italic; opacity: .9; }
.pc-stamp { position: absolute; top: 12px; right: 12px; border: 2px dashed rgba(255,255,255,.8); border-radius: 6px; padding: 4px 8px; font-size: .78rem; font-weight: 700; transform: rotate(4deg); }
.pc-back { padding: 18px; }
.pc-back ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.pc-back li { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; }
.pc-back li svg { flex: none; width: 16px; height: 16px; color: var(--pc); margin-top: 3px; }
.pc-sign { font-family: Georgia, serif; font-style: italic; margin: 12px 0 2px; }
@media (max-width: 560px) { .postcard { grid-template-columns: 1fr; } .pc-front { min-height: 120px; } }

/* Tutors: needs you, student card */
.tn-needs { margin: 8px 0 28px; }
.tn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.tn-head .teach-h { margin-bottom: 8px; }
.tn-group { margin: 16px 0 8px; font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tn-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.tn-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 16px; }
.tn-row + .tn-row { border-top: 1px solid var(--line); }
.tn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: start; margin-top: 8px; }
.tn-list .k-reading .tn-dot, .tn-list .k-snapshotNew .tn-dot, .tn-list .k-weekly .tn-dot { background: var(--ok); }
.tn-list .k-quiet .tn-dot { background: var(--text-3); }
.tn-main { min-width: 0; }
.tn-line { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.tn-who { color: var(--text); }
.tn-what { color: var(--text-2); }
.tn-text { color: var(--text-2); font-size: 14.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-wait { margin-top: 2px; }
.tn-act { white-space: nowrap; }
.tn-calm { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tn-calm b { color: var(--ok); font-weight: 600; }
.tn-more { margin: 8px 2px 0; }
.tn-all { margin-top: 8px; }
@media (max-width: 560px) {
  .tn-row { grid-template-columns: 10px minmax(0, 1fr); }
  .tn-act { grid-column: 2; justify-self: start; margin-top: 8px; }
  .tn-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

.sc-box { margin: 0 0 24px; }
.sc-card { display: grid; gap: 20px; }
.sc-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.sc-title { font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.sc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.sc-fact { min-width: 0; }
.sc-fact dt { font-size: 13px; color: var(--text-3); margin-bottom: 2px; }
.sc-fact dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.sc-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sc-col { min-width: 0; }
.sc-h { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.sc-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.sc-list li { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.sc-fixes s { color: var(--text-3); }
.sc-n { font-size: 13px; color: var(--accent); font-weight: 600; }
.sc-sum { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-k { font: 600 12px/1.3 var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-right: 6px; }
.sc-col p.small { margin: 4px 0; }
.sc-private { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; color: var(--text-2); }
.sc-private svg { width: 16px; height: 16px; flex: none; }
.sc-focus { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); }
.sc-focus p { margin: 4px 0 0; color: var(--text); }
.sc-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-acts [aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.sc-form { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sc-form .field { margin-bottom: 8px; }
.sc-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 12px; }
.sc-form-slot:empty { display: none; }
@media (max-width: 860px) {
  .sc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-cols { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 420px) { .sc-2 { grid-template-columns: 1fr; } }
