/*
 * The Dashboard view, redesigned 2026-10-24 on the owner's instruction after
 * testing the two-column page ("overcrowded and hard to read … every section in
 * the vertical column … room to breathe"; DECISIONS §15): ONE centred column,
 * `--db-column` (920px) wide inside the frame's gutters, every section the full
 * width of that column, stacked in the §9 order — the title row, the full-bleed
 * navy band (the key figure with its reference, then the five supporting figures
 * as one row that becomes a list on the phone), Live now, Needs attention,
 * Practice minutes, Sessions, Students, and the three reading modules (Topic
 * coverage, Guardrails, Plan usage) on a full-bleed cream field at the end.
 * 88px between sections (56 on the phone), 64px table rows, nothing under 13px.
 *
 * Depends on the `.an-*` title-row and shared parts in css/students.css (which
 * loads first); the two-column `.an-body` frame is not used here. Token-only;
 * the parts are the kit's. Painted by js/dashboard-view.js. The phone is the
 * `[data-layout='mobile']` block at the end.
 */

.db-page {
  --db-column: 920px;
  --db-gutter: var(--layout-gutter);
  --db-gap: 88px;

  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.db-page[hidden] {
  display: none;
}

/* everything but the two full-bleed fields sits in the centred column */
.db-colw {
  width: min(calc(100% - 2 * var(--db-gutter)), var(--db-column));
  margin-inline: auto;
}

.db-body {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* the one attention square per screen: orange with a navy inset edge */
.db-mark rect {
  fill: var(--color-attention);
  stroke: var(--color-ink);
}

/* -- title row: title + calibration line; the controls on the line below with
      New session at their right; "On this page" under them ------------------------- */
.db-title {
  gap: 16px 24px;
  padding: 32px 0 12px;
  background: var(--color-ground);
}

.db-title .an-title__left {
  gap: 8px;
  flex-basis: 100%;
}

.db-title .an-title__cal {
  font: var(--text-body);
}

.db-title .an-title__filters {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.db-title .an-title__actions {
  order: 2;
  margin-left: auto;
}

.db-title .db-jump {
  order: 3;
  flex-basis: 100%;
}

.db-jump {
  display: block;
  padding-top: 14px;
  border-top: var(--rule-hair);
}

.db-jump__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  font: var(--text-body-sm);
  color: var(--color-ink-3);
}

.db-jump__row .tt-link--action {
  font-weight: 500;
}

/* the phone's plan line (credits left); desktop reads it under Plan usage */
.db-title__plan {
  display: none;
}

.an-notices.db-colw {
  padding: 8px 0 0;
}

/* -- the navy band: full bleed, the column inside ----------------------------------- */
.db-band-host {
  width: 100%;
}

.db-band {
  display: block;
  width: 100%;
  padding: 44px 0 40px;
  background: var(--color-field-navy);
}

.db-band__inner {
  display: flex;
  flex-direction: column;
}

/* the key figure with its reference beside it: one statement, not two columns */
.db-band__lead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.db-band__key {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 14px;
  min-width: 0;
  max-width: 560px;
}

.db-band__lead > .tt-reference {
  flex: none;
  width: 320px;
  padding-top: 28px;
}

.db-band__link {
  text-decoration: none;
  color: inherit;
}

.db-band__link:hover .tt-figure__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.db-band .tt-figure__label {
  font: var(--text-body);
  font-weight: 600;
}

.db-band .tt-figure__delta {
  font: var(--text-body);
}

.db-band__lead-off {
  gap: 10px;
}

.db-band__statement {
  margin: 0;
  max-width: 560px;
  font: var(--text-title-md);
  letter-spacing: var(--tracking-title-md);
  color: var(--color-ink);
}

.db-band__gloss {
  margin: 0;
  max-width: 560px;
  font: var(--text-body);
  color: var(--color-ink-2);
}

.db-band .tt-reference__label,
.db-band .tt-reference__axis {
  font: var(--text-body-sm);
}

.db-reference__bar--pending {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-edge);
}

.db-reference__dim-line--short {
  border-right: 0;
}

.db-reference__dim-line--short + .tt-reference__dim-label {
  font: var(--text-label);
  color: var(--color-ink);
  padding-left: 6px;
  white-space: nowrap;
}

/* the five supporting figures: one row of five on the band, the rows of each
   cell aligned across the row (subgrid), a rule between cells; the phone turns
   it into a list of rows */
.db-band__figures {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto;
  margin-top: 36px;
  padding-top: 28px;
  border-top: var(--rule-on-navy);
}

.db-band__figures--line {
  display: flex;
}

/* no speaking time to lead with: the figures open the band */
.db-band__figures--first {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.db-fig {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 6px;
  padding: 0 20px;
  border-left: var(--rule-on-navy);
  color: inherit;
  text-decoration: none;
}

.db-fig:first-child {
  padding-left: 0;
  border-left: 0;
}

.db-fig:last-child {
  padding-right: 0;
}

.db-fig__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font: var(--text-body);
  font-weight: 600;
  color: var(--color-ink);
}

.db-fig:hover .db-fig__label > span:first-child {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.db-fig__arrow {
  display: inline-flex;
  flex: none;
  color: var(--color-ink-3);
}

.db-fig .tt-figure__value {
  font: var(--text-figure-lg);
  letter-spacing: var(--tracking-figure-lg);
  padding-top: 2px;
}

.db-fig .tt-figure__delta {
  font: var(--text-body-sm);
}

.db-fig__note {
  font: var(--text-body-sm);
  letter-spacing: 0;
  color: var(--color-ink-3);
}

/* the empty organisation: the statement, then "No sessions yet" under it */
.db-band--empty .db-band__gloss {
  font: var(--text-body);
}

.db-band__empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: var(--rule-on-navy);
}

.db-band__empty-title {
  margin: 0;
  font: var(--text-title-md);
  letter-spacing: var(--tracking-title-md);
  color: var(--color-ink);
}

.db-band__empty-text {
  margin: 0;
  font: var(--text-body);
  color: var(--color-ink-2);
}

.db-band__empty-actions {
  display: flex;
  padding: 4px 0 8px;
}

/* -- sections: a strong rule, the title, one line saying what it shows, 24px, the content */
.db-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: var(--db-gap);
}

.db-section:empty {
  display: none;
}

.db-page .tt-section-head {
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-top: 16px;
}

.db-page .tt-section-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.db-page .tt-section-head__meta {
  margin-top: 6px;
  max-width: 72ch;
  font: var(--text-body);
}

.db-page .tt-section-head__tools {
  flex: none;
  flex-wrap: wrap;
  padding-top: 4px;
}

.db-page .tt-section-head__tools .tt-seg {
  align-self: center;
}

/* prose inside a section: a reading measure, never under 13px */
.db-page .an-module__lede {
  max-width: 72ch;
  font: var(--text-body);
}

.db-page .an-module__note,
.db-page .an-absent,
.db-page .an-loading,
.db-page .an-empty-hint {
  max-width: 80ch;
  font: var(--text-body-sm);
  letter-spacing: 0;
}

.db-page .tt-empty--inline {
  min-height: 44px;
}

/* an empty line with an explanation stacks: the line, then the explanation under it */
.db-section .tt-empty--inline:has(.an-empty-hint) {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.db-section .tt-empty--inline .an-empty-hint {
  max-width: 72ch;
}

.db-page .tt-kicker__meta {
  font: var(--text-body-sm);
}

/* -- Live now: one white card per session at the column's width, or one navy line ----
   Ruled like the tables around it; a deep-teal bar along the top of a live card is the
   only "live" colour, with the pip beside its title. A paused card is the one-line
   version with no bar. Ordinary tokens, so dark mode follows. */
.db-live {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-live .db-live__card {
  background: var(--color-ground);
  border: var(--rule-hair);
}

.db-live .db-live__card--live {
  border-top: 3px solid var(--color-live-text);
}

.db-live .tt-live__session .tt-live__name .an-ico {
  color: var(--color-live-text);
}

.db-live .tt-live__meta,
.db-live .tt-live__online-t {
  color: var(--color-ink-2);
}

/* the kit's 12px labels read at 13px on this page (the owner's floor) */
.db-page .tt-code-block__label,
.db-page .tt-reference__dim-label {
  font: var(--text-ui-sm);
  letter-spacing: 0;
}

.db-page .tt-code-inline--sm {
  font: var(--text-ui-sm);
  letter-spacing: 0.08em;
}

.db-page .tt-online,
.db-page .tt-field__label {
  font: var(--text-ui-sm);
  letter-spacing: 0;
}

.db-page .tt-chart__label--note,
.db-page .tt-chart__note b,
.db-step__n {
  font: 600 13px/16px var(--font-serif);
}

.db-live .tt-live__session {
  gap: 16px;
  padding: 24px 24px 22px;
}

.db-live .tt-live__name {
  font: var(--text-title-sm);
  letter-spacing: var(--tracking-title-sm);
}

.db-live .tt-live__meta {
  font: var(--text-body);
}

.db-live .tt-live__online-t {
  font: var(--text-body-sm);
}

/* the code, its copy buttons and the run controls on one line; it wraps when narrow */
.db-live .tt-live__code-row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}

.tt-live__online {
  flex: none;
  white-space: nowrap;
}

.db-live__run {
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.db-live .tt-live__paused {
  padding: 18px 24px;
}

.db-live .tt-live__paused .tt-live__name {
  font: var(--text-button);
}

.db-live .tt-live__paused .tt-live__meta {
  font: var(--text-body-sm);
  letter-spacing: 0;
  color: var(--color-ink-3);
}

.db-live-empty {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 24px;
}

.db-live-empty .tt-empty__text,
.db-live-empty .an-empty-hint {
  font: var(--text-body);
}

/* phone: Open session alone on its row, then Pause and End session side by side */
.db-live__open-row {
  width: 100%;
}

.db-live__open-row .tt-btn {
  width: 100%;
}

.db-live__pair {
  width: 100%;
}

.db-live__pair .tt-btn {
  flex: 1;
  min-width: 0;
}

/* -- Needs attention: the items stacked, each ruled, one sentence + one line + its verb */
.db-attention__list {
  display: flex;
  flex-direction: column;
}

.db-attention__item {
  gap: 10px;
  padding: 22px 0 24px;
  border-left: 0;
  border-bottom: var(--rule-hair);
}

.db-attention__item:first-child {
  padding-top: 4px;
}

.db-attention__item .tt-attention__head {
  font: var(--text-body-sm);
  font-weight: 600;
  letter-spacing: 0;
}

.db-attention__item .tt-attention__note {
  max-width: 80ch;
  font: var(--text-body);
}

.db-attention__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 4px;
}

.db-also {
  display: flex;
  flex-direction: column;
}

.db-also__head {
  padding: 2px 0 6px;
  font: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-ink-2);
}

.db-also__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: var(--rule-hair);
  font: var(--text-body);
  color: var(--color-ink-2);
}

.db-also__row b {
  font-weight: 600;
  color: var(--color-ink);
}

.db-attention__rule {
  margin: 0;
  max-width: 80ch;
  font: var(--text-body-sm);
  color: var(--color-ink-3);
}

.db-error {
  padding: 24px 0 48px;
}

.db-error-host[hidden] {
  display: none;
}

/* -- the chart: the column's width, every label at 13px, the caption as paragraphs */
.db-plot-host {
  width: 100%;
  min-width: 0;
}

.db-page .tt-chart {
  gap: 14px;
}

.db-page .tt-chart__legend {
  font: var(--text-body);
}

.db-page .tt-chart__label {
  font: var(--text-ui-sm);
  letter-spacing: 0;
}

.db-page .tt-chart__notes {
  gap: 6px;
  font: var(--text-body-sm);
  letter-spacing: 0;
}

.db-page .tt-chart__note {
  grid-template-columns: 20px 1fr;
}

.db-page .tt-chart__caption {
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  font: var(--text-body-sm);
  letter-spacing: 0;
}

.db-caption-aside {
  max-width: 80ch;
}

/* the table alternative: one table, every day a 44px row */
.db-ctab {
  display: flex;
  flex-direction: column;
}

.db-page .db-ctab .db-ctab__tr {
  grid-template-columns: minmax(200px, 1fr) 160px 160px 140px;
  min-height: 44px;
}

.db-ctab .tt-tr--th {
  min-height: 0;
}

/* -- tables: 64px rows, 13px headers, 14px cells, nothing truncated ------------------- */
.db-page .tt-tr {
  min-height: 64px;
}

.db-page .tt-tr--th {
  min-height: 0;
  padding-bottom: 10px;
}

.db-page .tt-th {
  padding: 0 8px;
  font: var(--text-ui-sm);
  letter-spacing: 0;
  white-space: normal;
}

.db-page .tt-th__unit {
  font: var(--text-body-sm);
  letter-spacing: 0;
}

.db-page .tt-td {
  padding: 6px 8px;
  font: var(--text-body);
}

.db-page .tt-td--stack {
  gap: 2px;
}

.db-page .tt-td__name,
.db-page .tt-td__secondary {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.db-page .tt-td__secondary {
  font: var(--text-body-sm);
  letter-spacing: 0;
}

.db-page .an-numstack .tt-td__primary {
  font: var(--text-body);
}

.db-page .tt-td--now.an-numstack .tt-td__primary {
  font-weight: 600;
}

.db-page .an-dim-stack .tt-td__primary {
  font: var(--text-body);
}

.db-page .tt-table__foot {
  padding-top: 14px;
  font: var(--text-body-sm);
}

.db-page .tt-microbar__value {
  font: var(--text-body);
}

/* a third, quiet line under a session's title: turns, required topics, blocked */
.db-td-facts {
  font: var(--text-body-sm);
  color: var(--color-ink-3);
}

.db-cols-sessions {
  grid-template-columns: minmax(280px, 1fr) 92px 104px 190px 124px 120px;
}

.db-cols-students {
  grid-template-columns: minmax(206px, 1fr) 172px 118px 176px 116px 126px;
}

.db-td-note {
  font: var(--text-body-sm);
}

/* definitions under a table, one per line */
.db-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: var(--rule-hair);
  font: var(--text-body-sm);
  color: var(--color-ink-3);
}

.db-notes b {
  font-weight: 600;
  color: var(--color-ink-2);
}

/* the Students table's tools and tabs */
.db-students__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.db-tabstrip .tt-tabs {
  height: 40px;
}

.db-tabstrip .tt-tab {
  height: 40px;
  font: var(--text-ui);
}

/* -- the reading field at the end: Topic coverage, Guardrails, Plan usage ------------- */
.db-reading {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: var(--db-gap);
  padding-bottom: 96px;
}

.db-reading > .db-section:first-child {
  margin-top: 64px;
}

.db-module__figure {
  gap: 6px;
}

.db-module__figure .tt-figure__unit {
  margin-left: 8px;
  font: var(--text-ui);
  color: var(--color-ink-2);
}

.db-module__figure .tt-figure__delta {
  font: var(--text-body);
}

/* the session select: a real <select> inside the kit's select frame */
.db-page .tt-field {
  gap: 6px;
  max-width: 440px;
}

.db-select {
  position: relative;
}

.db-topic-select {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font: var(--text-ui);
  color: var(--color-ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.db-topic-select:focus-visible {
  outline: none;
  box-shadow: none;
}

.db-select:focus-within {
  border-color: var(--color-edge-strong);
  box-shadow: 0 0 0 2px var(--color-ground), 0 0 0 4px var(--color-focus);
}

.db-select .tt-select__caret {
  pointer-events: none;
}

.db-mix {
  display: flex;
  border-top: var(--rule-hair);
  border-bottom: var(--rule-hair);
}

.db-mix__cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
  min-height: 52px;
  padding: 8px 20px;
  border-left: var(--rule-hair);
  font: var(--text-body);
  color: var(--color-ink);
}

.db-mix__cell:first-child {
  border-left: 0;
  padding-left: 0;
}

.db-mix__n {
  font: var(--text-figure-md);
  letter-spacing: var(--tracking-figure-md);
  font-variant-numeric: tabular-nums;
}

.db-topics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-topic {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-topic__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font: var(--text-body);
  color: var(--color-ink);
}

.db-topic__name {
  flex: 1;
  min-width: 0;
}

.db-topic__req {
  font: var(--text-body-sm);
  color: var(--color-ink-3);
  white-space: nowrap;
}

.db-topic__flag {
  font: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-warning);
  white-space: nowrap;
}

.db-topic__val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.db-topic__val b {
  font-weight: 600;
}

.db-topic__val span {
  color: var(--color-ink-3);
}

.db-topic__track {
  position: relative;
  display: flex;
  height: 8px;
  background: var(--color-meter-track);
}

.db-topic__fill {
  height: 8px;
  background: var(--color-chart-1);
}

.db-topic.is-short .db-topic__fill {
  background: var(--color-warning);
}

.db-topic__half {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 14px;
  background: var(--color-ink);
}

.db-topic__axis {
  display: flex;
  justify-content: space-between;
  padding-top: 4px;
  font: var(--text-body-sm);
  color: var(--color-ink-3);
}

.db-bars {
  display: flex;
  flex-direction: column;
}

.db-bar {
  display: grid;
  grid-template-columns: 280px 1fr 40px;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  font: var(--text-body);
  color: var(--color-ink);
  text-decoration: none;
}

.db-bar__name {
  font: var(--text-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-link);
}

.db-bar:hover .db-bar__name {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

.db-bar__track {
  display: flex;
  height: 8px;
  background: var(--color-meter-track);
}

.db-bar__fill {
  height: 8px;
  background: var(--color-chart-1);
}

.db-bar__n {
  text-align: right;
  font: var(--text-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.db-hist {
  display: flex;
  flex-direction: column;
  border-top: var(--rule-hair);
}

.db-hist__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  min-height: 48px;
  align-items: center;
  padding: 8px 0;
  border-bottom: var(--rule-hair);
  font: var(--text-body);
  color: var(--color-ink-2);
  font-variant-numeric: tabular-nums;
}

.db-hist__row span:first-child {
  font: var(--text-body);
  font-weight: 600;
  color: var(--color-ink);
}

.db-hist__row b {
  font-weight: 600;
  color: var(--color-ink);
}

.db-page .tt-meter__row {
  font: var(--text-body);
}

.db-page .tt-meter__note {
  font: var(--text-body-sm);
  letter-spacing: 0;
}

/* -- the empty dashboard's steps and previews ---------------------------------------- */
.db-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 72ch;
}

.db-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
}

.db-step__n {
  display: block;
  padding-top: 3px;
  color: var(--color-ink);
  text-align: right;
}

.db-step div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: var(--text-body);
  color: var(--color-ink-2);
}

.db-step b {
  font: var(--text-button);
  color: var(--color-ink);
}

.db-empty-figs {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.db-empty-fig {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  border-top: var(--rule-hair);
  font: var(--text-body);
  color: var(--color-ink-2);
}

/* -- the 390 frame ------------------------------------------------------------------ */
[data-layout='mobile'] .db-page {
  --db-gutter: 16px;
  --db-gap: 56px;
}

[data-layout='mobile'] .db-title {
  padding: 20px 0 8px;
}

[data-layout='mobile'] .db-title .an-title__left {
  flex-basis: auto;
}

[data-layout='mobile'] .db-title .db-jump {
  order: 1;
}

[data-layout='mobile'] .db-title .an-title__filters {
  order: 2;
}

[data-layout='mobile'] .db-title .an-title__actions {
  order: 3;
  margin-left: 0;
}

[data-layout='mobile'] .db-jump__row .tt-link--action {
  min-height: var(--size-control-phone);
}

[data-layout='mobile'] .db-title__plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: var(--text-body);
  color: var(--color-ink-2);
  font-variant-numeric: tabular-nums;
}

/* Live now comes before the band: the room the instructor is running first */
[data-layout='mobile'] .db-live-host {
  order: -1;
  margin-top: 24px;
}

[data-layout='mobile'] .db-band {
  padding: 28px 0 24px;
}

[data-layout='mobile'] .db-band__lead {
  flex-direction: column;
  gap: 24px;
}

[data-layout='mobile'] .db-band__lead > .tt-reference {
  width: 100%;
  padding-top: 0;
}

[data-layout='mobile'] .db-band .tt-figure--xl .tt-figure__value {
  font: var(--text-figure-xl);
  letter-spacing: var(--tracking-figure-xl);
}

/* the five figures as rows: label and note at the left, the value and its change at the right */
[data-layout='mobile'] .db-band__figures {
  display: flex;
  flex-direction: column;
  margin-top: 28px;
  padding-top: 8px;
}

[data-layout='mobile'] .db-band__figures--first {
  margin-top: 0;
  padding-top: 0;
}

[data-layout='mobile'] .db-fig {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'label value'
    'note delta';
  column-gap: 16px;
  row-gap: 4px;
  padding: 14px 0;
  border-left: 0;
  border-bottom: var(--rule-on-navy);
}

[data-layout='mobile'] .db-fig:last-child {
  border-bottom: 0;
}

[data-layout='mobile'] .db-fig__label {
  grid-area: label;
  align-self: end;
}

[data-layout='mobile'] .db-fig .tt-figure__value {
  grid-area: value;
  justify-self: end;
  padding-top: 0;
  font: var(--text-figure-md);
  letter-spacing: var(--tracking-figure-md);
}

[data-layout='mobile'] .db-fig .tt-figure__delta {
  grid-area: delta;
  justify-self: end;
}

[data-layout='mobile'] .db-fig__note {
  grid-area: note;
}

[data-layout='mobile'] .db-live .tt-live__session {
  padding: 20px 16px;
}

[data-layout='mobile'] .db-live .tt-live__paused {
  padding: 16px;
}

[data-layout='mobile'] .db-live .tt-live__code-row {
  flex-direction: column;
  align-items: stretch;
}

[data-layout='mobile'] .db-live__run {
  margin-left: 0;
}

[data-layout='mobile'] .tt-live__actions {
  flex-wrap: wrap;
}

[data-layout='mobile'] .db-live-empty {
  padding: 0 16px;
}

[data-layout='mobile'] .db-attention__item {
  padding: 18px 0 20px;
}

[data-layout='mobile'] .db-attention__actions .tt-btn {
  min-height: var(--size-control-phone);
}

[data-layout='mobile'] .db-also__row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 10px 0;
}

[data-layout='mobile'] .tt-chart__head {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

[data-layout='mobile'] .tt-chart__head .tt-seg {
  align-self: stretch;
  height: calc(var(--size-control-phone) + 2px);
}

[data-layout='mobile'] .tt-chart__head .tt-seg__item {
  flex: 1;
  justify-content: center;
}

[data-layout='mobile'] .db-page .db-ctab .db-ctab__tr {
  grid-template-columns: minmax(0, 1fr) 72px 72px 64px;
}

/* the filter tabs wrap on the phone (nothing scrolls sideways; every tab a 44px target) */
[data-layout='mobile'] .db-tabstrip .tt-tabs {
  flex-wrap: wrap;
  gap: 0 20px;
  height: auto;
}

[data-layout='mobile'] .db-tabstrip .tt-tab {
  height: var(--size-control-phone);
}

[data-layout='mobile'] .db-students__tools .tt-btn {
  min-height: var(--size-control-phone);
}

/* the phone lists (sessions, students): one block per row with the caret */
.db-plist {
  display: flex;
  flex-direction: column;
}

.db-prow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 76px;
  padding: 12px 0;
  border-bottom: var(--rule-hair);
  text-decoration: none;
  color: inherit;
}

.db-prow__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.db-prow__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font: var(--text-button);
  color: var(--color-ink);
}

.db-prow:hover .db-prow__name,
.db-prow:focus-visible .db-prow__name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.db-prow__meta {
  font: var(--text-body-sm);
  color: var(--color-ink-3);
  overflow-wrap: anywhere;
}

.db-prow__facts {
  font: var(--text-body-sm);
  color: var(--color-ink-2);
}

.db-prow__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  gap: 4px;
  font: var(--text-body-sm);
}

.db-prow__last {
  font: var(--text-body-sm);
  color: var(--color-ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.db-prow__side .tt-microbar__track {
  width: 44px;
}

.db-prow__side .tt-microbar__value {
  min-width: 52px;
  font: var(--text-body-sm);
}

.db-prow__caret {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -12px;
  color: var(--color-ink-2);
}

[data-layout='mobile'] .db-mix {
  flex-direction: column;
}

[data-layout='mobile'] .db-mix__cell {
  padding: 8px 0;
  border-left: 0;
  border-top: var(--rule-hair);
}

[data-layout='mobile'] .db-mix__cell:first-child {
  border-top: 0;
}

[data-layout='mobile'] .db-bar {
  grid-template-columns: minmax(0, 1fr) 40px;
  min-height: var(--size-control-phone);
}

[data-layout='mobile'] .db-bar__track {
  grid-column: 1 / 3;
}

[data-layout='mobile'] .db-reading {
  padding-bottom: 56px;
}

[data-layout='mobile'] .db-reading > .db-section:first-child {
  margin-top: 48px;
}

[data-layout='mobile'] .db-error {
  padding: 16px 0 32px;
}
