/* Live Assistant app, components. Tokens (colours, fonts, radii) are in theme.css, breakpoints in layout.css. */

:root {
  /* Paper of the printed labels: always off-white, like the thermal roll. */
  --label-paper: #fbfaf6;
  --label-ink: #111111;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --tap: 48px;
  /* Type scale floor: nothing under 13 px; anything that carries a decision (tags, KPI labels, section labels) 14 px. */
  --text-min: 0.8125rem;
  --text-decision: 0.875rem;
  --topbar: 64px;
  --press: 90ms;
  --motion: 200ms;
}

::selection {
  background: var(--chalk);
  color: var(--on-chalk);
}

/* The reader's own text size (browser setting) is the base: sizes below in rem follow it. */
html {
  font-size: 100%;
  scrollbar-color: var(--line-strong) transparent;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  /* Familjen Grotesk has no italic: never let the browser slant it. */
  font-synthesis-style: none;
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* Numbers, prices, sizes and quantities: Familjen Grotesk's tabular figures (tnum), so columns line up. */
.num {
  font-family: var(--font-ui);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Times, codes and references: IBM Plex Mono. */
.mono,
.feed-time,
.check-card-time {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.mono {
  font-size: 0.95em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.error {
  color: var(--live-fg);
  font-weight: 600;
}

.spacer {
  flex: 1;
}

.title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.label-mono {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 60ch;
}

.icon {
  flex: none;
  display: block;
}

/* ---------- app shell ---------- */

#app {
  display: grid;
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  /* 100vh where dvh is unknown (older WebViews), the dynamic height elsewhere. */
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex: none;
}

/* The mark (icons.js brandMark, the L-mètre of favicon.svg). */
.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-tag {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-min);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-slot {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  flex: 1;
}

.topbar-slot:empty {
  display: none;
}

/* The screen's buttons keep their words: the store, the live's name and the stages give way. */
.topbar-slot > .btn {
  flex-shrink: 0;
}

/* But Mensagens' "Seguimento ›" may shorten (large text): the same stage pill sits fully named in the bar. */
.topbar-slot > .btn-next-stage {
  flex-shrink: 1;
  min-width: 0;
}

.btn-next-stage .btn-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lives home: its buttons take their room in the bar, the store's name shrinks. */
body[data-screen="lives"] .topbar-slot {
  min-width: auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-left: auto;
  flex: none;
}

.screen {
  overflow: auto;
  min-height: 0;
}

/* A field or button scrolled into view (focus, goToField) stops above the sticky foot of its scroller. */
:is(.screen, .fin, .modal, .settings-body, .msg-pane, .msg-list, .track-body) {
  scroll-padding-bottom: 104px;
}

body[data-screen="live"] .screen {
  overflow: hidden;
}

/* Information chip (not a control). */
.chip-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--s3);
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-live {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 32px;
  padding: 0 var(--s3);
  border-radius: 999px;
  background: var(--live-bg);
  color: var(--live-fg);
  font-family: var(--font-ui);
  font-size: var(--text-decision);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
}

/* The live's current viewers inside the on-air pill, after the clock (owner 24.10). */
.pill-viewers {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding-left: var(--s2);
  border-left: 1px solid currentColor;
}

.pill-viewers[hidden] {
  display: none;
}

.pill-live.is-ended {
  background: var(--chip);
  color: var(--muted);
}

.rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  animation: pulse 1.4s ease-in-out infinite;
}

.is-ended .rec-dot {
  animation: none;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.dot-ok {
  background: var(--ok);
}

.status-line,
.ok-line {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 600;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  text-decoration: none;
}

/* Hover only for a real pointer: on the tablet a tap would leave it stuck. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    background: var(--chip);
  }
}

.btn-primary,
.btn-ok {
  background: var(--chalk);
  border-color: var(--chalk);
  color: var(--on-chalk);
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled),
  .btn-ok:hover:not(:disabled) {
    background: var(--chalk);
    filter: brightness(0.92);
  }
}

.btn-danger {
  background: transparent;
  border-color: var(--live-line);
  color: var(--live-fg);
}

@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover:not(:disabled) {
    background: var(--live-bg);
  }
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) {
    background: var(--chip);
    color: var(--text);
  }
}

.btn-icon {
  padding: 0;
  width: var(--tap);
}

.btn-no {
  padding: 0;
  width: var(--tap);
  color: var(--live);
}

.btn-xl {
  min-height: 56px;
  padding: 0 var(--s5);
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0 var(--s3);
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn.is-on {
  background: var(--chip);
  color: var(--text);
  border-color: var(--line-strong);
}

/* Press feedback on every control, under 100 ms, without layout change (transform and opacity only). */
:where(button, a, .ticket) {
  transition:
    transform var(--press) ease-out,
    opacity var(--press) ease-out,
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

:where(button, a, .ticket):active:not(:disabled) {
  transform: scale(0.98);
  opacity: 0.85;
}

/* Visible focus on every control. */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* A heading or pane focused by the app (tabindex="-1", for screen readers) is not a control: no ring. */
[tabindex="-1"]:not(button, a, input, textarea, select):focus {
  outline: none;
}

/* ---------- shared blocks ---------- */

.page {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s5) var(--s6) var(--s6);
}

.page-wide {
  max-width: 1240px;
}

.page-narrow {
  max-width: 760px;
}

.page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  min-width: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-min);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex: none;
}

.badge-ok,
.tag {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.tag-live,
.tag-cancel {
  background: var(--live-bg);
  color: var(--live-fg);
}

.badge-warn,
.tag-warn,
.tag-modify {
  background: var(--warn-bg);
  color: var(--warn);
}

.tag-muted,
.tag-question,
.tag-noise,
.tag-other {
  background: var(--chip);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

.tag-sm {
  min-height: 22px;
  font-size: var(--text-decision);
  padding: 0 6px;
}

/* Status pill of the status cards: OK or À vérifier. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill.is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

/* Segmented control (speed, zoom, theme, language, threshold). */
.segmented {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--deep);
  flex: none;
  /* One line, never a clipped word: what does not fit scrolls sideways, the hidden side fades (scroll-fade.js). */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented[data-fade="end"] {
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}

.segmented[data-fade="start"] {
  mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
}

.segmented[data-fade="start end"] {
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

/* The ring inside the button: the control scrolls, so a ring outside it would be cut. */
.segmented button:focus-visible {
  outline-offset: -3px;
}

/* The voice offset's − 15 s + (Réglages › Durante o live): two 48 px buttons around the value. */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.stepper .btn-icon {
  min-width: 48px;
  min-height: 48px;
}

.stepper-value {
  min-width: 3.5em;
  text-align: center;
  font-weight: 600;
}

/* The board's mic: the article on the board came from the seller's voice (voice-link.js). */
.board-voice {
  display: inline-block;
  margin-right: 6px;
  color: var(--chalk);
  vertical-align: -2px;
  line-height: 0;
}

/* The followed live's voice in the top bar (POC): on, reconnecting or stopped. */
.voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.voice-chip.is-warn {
  color: var(--warn);
}

/* A feed tab's count, a badge after its name (one line: "Encomendas 26"); À vérifier's in the warning colour. */
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.75em;
  height: 1.6em;
  margin-left: 6px;
  padding: 0 0.45em;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--text);
  font-size: 0.85em;
  line-height: 1;
}

.segmented button.is-on .tab-count {
  background: var(--surface);
  color: var(--text);
}

.segmented button.has-checks .tab-count {
  background: var(--warn);
  color: var(--on-warn);
}

.segmented button {
  display: inline-flex;
  flex: none;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: 56px;
  padding: 0 var(--s4);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.segmented button.is-on {
  background: var(--chalk);
  color: var(--on-chalk);
}

/* Compact segmented controls (Lives language switch, message language): still 48 px tall targets. */
.segmented-compact button,
.segmented-lang button {
  min-width: var(--tap);
  padding: 0 var(--s3);
}

.segmented-compact {
  padding: 0 4px;
  align-items: center;
}

/* Size chips: outlined in the warning colour, solid when picked. */
.chip {
  display: inline-grid;
  place-items: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--s3);
  border-radius: var(--r-control);
  border: 1px solid var(--warn-line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

/* The chosen chip takes the plum accent, as every selection of the app (UX review 2026-10-23). */
.chip.is-on {
  border-color: var(--chalk);
  background: var(--chalk);
  color: var(--on-chalk);
}

/* Native date and time pickers: the accent colour, never the browser's blue. */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  accent-color: var(--chalk);
}

/* Size shown on an article (not a control). */
.size-tag {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
}

/* On/off switch (Réglages). The whole row is the 48 px target. */
.switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  flex: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: transform 150ms ease, background-color 150ms ease;
}

[aria-checked="true"] > .switch-track {
  border-color: var(--chalk);
  background: var(--chalk);
}

[aria-checked="true"] > .switch-track::after {
  transform: translateX(20px);
  background: var(--on-chalk);
}

/* Radio circle of the radio rows. */
.radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
  transition: border-width 150ms ease, border-color 150ms ease;
}

.is-selected .radio,
[aria-checked="true"] > .radio {
  border: 7px solid var(--chalk);
}

/* ---------- dialogs, menus, toasts (the only raised layers) ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--s4);
  background: var(--scrim);
  pointer-events: auto;
}

.modal {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  animation: rise var(--motion) ease-out;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--muted);
}

.modal-danger .modal-icon {
  background: var(--live-bg);
  color: var(--live-fg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-body {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s2);
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  animation: rise 150ms ease-out;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .menu-item:hover {
    background: var(--chip);
  }
}

.menu-anchor {
  position: relative;
  flex: none;
}

/* A menu in a footer opens above its button. */
.menu.menu-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.menu-item.is-danger {
  color: var(--live-fg);
}

.menu-item:disabled {
  opacity: 0.5;
  cursor: default;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s2);
  max-width: min(560px, 100%);
  min-height: var(--tap);
  padding: 4px 4px 4px var(--s4);
  border-radius: var(--r-control);
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
  line-height: 1.3;
  box-shadow: var(--shadow-raised);
  animation: rise var(--motion) ease-out;
  /* Only its close button takes a tap: a control under the text stays usable. */
  pointer-events: none;
}

/* Up to two lines, never one cut line. */
.toast-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.toast-close {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.toast-close:focus-visible {
  outline-color: currentColor;
  outline-offset: -4px;
}

.toast-ok {
  background: var(--chalk);
  color: var(--on-chalk);
}

.toast-warn {
  background: var(--warn);
  color: var(--on-warn);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- 1. connexion (proposal A: one 560 px column) ---------- */

.connexion {
  display: flex;
  justify-content: center;
  padding: 48px var(--s4) var(--s6);
}

.connexion-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(560px, 100%);
}

.connexion-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connexion .title,
.avant .title {
  font-size: 30px;
}

.connexion .lead {
  font-size: 1rem;
}

.connexion-col .hint {
  margin-top: -10px;
}

.btn-big {
  min-height: 64px;
  padding: 0 30px;
  border-radius: var(--r-card);
  font-size: 19px;
}

/* Account row: who is connected, "Changer" to log out of the simulation. */
.account-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.account-icon {
  color: var(--muted);
}

.account-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.form-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
}

.radio-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

.live-list {
  max-height: 300px;
  overflow: auto;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.radio-row:first-child {
  border-top: 0;
}

@media (hover: hover) and (pointer: fine) {
  .radio-row:hover {
    background: var(--rail);
  }
}

.radio-row-grow {
  flex: 1;
  min-width: 0;
}

.radio-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-row-name {
  font-weight: 700;
}

.radio-row-sub {
  font-size: 0.875rem;
  color: var(--muted);
}

.radio-row-side {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.radio-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.error-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ---------- 2. avant le live (proposal A: three tiles, big Démarrer) ---------- */

.avant {
  padding-top: 44px;
  gap: 28px;
}

.avant-live-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  min-width: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.status-tile {
  gap: 14px;
  padding: 22px;
}

.status-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.status-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
}

.status-big {
  font-weight: 700;
}

.status-action {
  margin-top: auto;
  align-self: flex-start;
}

/* The printer tile's second button (Outra impressora under Etiqueta de teste) sits right under the first. */
.printer-tile .status-action:not([hidden]) ~ .status-action {
  margin-top: 0;
}

/* The live's currency (raccord R7), in the Page tile. */
.currency-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: auto;
}

/* Microphone level: thin chalk bars, the quiet ones dim. */
.meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 34px;
}

.meter-bar {
  width: 6px;
  height: 18%;
  border-radius: 2px;
  background: var(--line-strong);
  transition: height 90ms linear;
}

.meter-bar.is-on {
  background: var(--chalk);
  height: 55%;
}

.meter-bar.is-on:nth-child(2n) {
  height: 85%;
}

.meter-bar.is-on:nth-child(3n) {
  height: 70%;
}

.meter-bar.is-on:nth-child(5n) {
  height: 100%;
}

.avant-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: var(--s3);
  text-align: center;
}

.btn-start {
  min-height: 76px;
  width: min(420px, 100%);
  border-radius: var(--r-card);
  font-size: 22px;
  gap: var(--s3);
}

/* ---------- 3. live ---------- */

/* Top bar controls (rendered by the live screen into the slot). */
.topbar-source {
  max-width: 240px;
}

.btn-feed {
  flex: none;
}

.auto-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s4);
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
}

.auto-chip.is-on {
  border-color: var(--chalk);
  background: var(--chalk);
  color: var(--on-chalk);
}

.btn-finish {
  flex: none;
}

.live {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

/* Board: the announced article in board numerals, its price, sizes and how long ago it was announced. */
.board {
  display: flex;
  align-items: center;
  min-height: 112px;
  padding: 0 var(--s5);
  border-bottom: 1px solid var(--line);
  background: var(--deep);
  min-width: 0;
  overflow: hidden;
}

/* The announced article (aria-live) beside the "Este live" button, which only short screens show. */
.board-live {
  flex: 1 1 auto;
  min-width: 0;
}

.btn-summary,
.btn-summary-close {
  display: none;
}

.live-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.live-side-head h2 {
  margin: 0;
}

.board-in {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  min-width: 0;
}

/* The one authored moment: a new article wipes in from the left (reduced motion turns it off, see the end). */
.board-in.is-wiping {
  animation: board-wipe 220ms ease-out;
}

@keyframes board-wipe {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.board-no {
  font-family: var(--font-num);
  font-size: 86px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  flex: none;
}

.board-art {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}

.board-desc {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  /* The whole name on up to three lines (UX review 2026-10-23), never one cut line. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* The latest validated orders of the article on the board (side panel and desktop column only). */
.board-orders {
  display: grid;
  gap: var(--s2);
  width: 100%;
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.board-orders[hidden] {
  display: none;
}

.board-orders ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Her name takes what is left and ends with "…"; the size never shrinks. */
.board-orders li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s2);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.board-orders li > .num {
  white-space: nowrap;
}

.board-order-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-price {
  font-family: var(--font-num);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex: none;
}

.board-price small {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
}

.board-sizes {
  display: flex;
  gap: var(--s2);
  flex: none;
}

.board-sizes .size-tag {
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  border-color: var(--line-strong);
  border-radius: var(--r-control);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.board-since {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.dur {
  display: block;
  width: 220px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.dur i {
  display: block;
  height: 100%;
  background: var(--chalk);
  transition: width 500ms linear;
}

.board-wait {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--muted);
}

/* Body: the rail (the live's articles, then the feed) and the card stack. */
.live-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.live.feed-open .live-body {
  grid-template-columns: 272px minmax(0, 1fr);
}

.rail {
  display: none;
  flex-direction: column;
  gap: var(--s3);
  min-height: 0;
  padding: var(--s4);
  border-right: 1px solid var(--line);
  background: var(--rail);
}

.feed-open .rail {
  display: flex;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -12px -12px -8px 0;
}

.rail-articles {
  flex: 0 1 auto;
  max-height: 45%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.art-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
}

.art-tile {
  display: grid;
  gap: 2px;
  padding: var(--s2) 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  min-width: 0;
}

.art-tile.is-active {
  border-color: var(--chalk);
  box-shadow: inset 0 0 0 1px var(--chalk);
}

.art-tile-no {
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

/* Number and order count on one row, the description below (it shrinks, the count always shows). */
.art-tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1);
}

.art-tile-count {
  font-size: var(--text-min);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.art-tile-desc {
  min-width: 0;
  font-size: var(--text-min);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-grid-empty {
  grid-column: 1 / -1;
}

.rail-feed-title {
  margin-top: 6px;
}

.feed-list {
  list-style: none;
  margin: 0 -4px;
  padding: 0 4px var(--s2);
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  overscroll-behavior: contain;
}

.feed-item {
  display: grid;
  gap: 2px;
  font-size: 0.875rem;
  line-height: 1.35;
}

.feed-item .tag {
  justify-self: start;
  margin-top: 2px;
}

.feed-who {
  display: flex;
  gap: var(--s2);
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
}

.feed-who strong {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-text {
  color: var(--text);
  overflow-wrap: anywhere;
}

.feed-speech .feed-who {
  font-size: var(--text-min);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  justify-content: flex-start;
}

.feed-speech .feed-text {
  color: var(--muted);
}

.stack {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* Auto mode: a teal edge over the top of the stack (absolute: nothing moves). */
.stack.is-auto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--chalk);
  z-index: 2;
}

.cards {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3) var(--s4) var(--s5);
  overscroll-behavior: contain;
}

.cards-empty {
  margin: auto;
  max-width: 36ch;
  text-align: center;
  color: var(--muted);
}

.new-pill {
  position: absolute;
  left: 50%;
  bottom: var(--s3);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  min-height: var(--tap);
  padding: 0 var(--s4);
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow-raised);
  cursor: pointer;
}

/* The pill is centred with a translate: keep it while pressed. */
.new-pill:active {
  transform: translateX(-50%) scale(0.98);
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px var(--s4);
  min-height: 80px;
  padding: 14px var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  flex: none;
}

.card-question {
  background: var(--rail);
  min-height: 64px;
}

/* The newest card: a 2 px chalk inset ring (device setting "highlight"), no coloured stripe. */
.card.is-newest {
  box-shadow: inset 0 0 0 2px var(--chalk);
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.card-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Line 2: article, size, price, then the source comment; one line, the description and comment shrink first. */
.card-line {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  min-width: 0;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1.3;
}

.card-line > * {
  flex: none;
}

.card-no {
  font-weight: 600;
}

.card-line > .card-desc {
  flex: 0 1 auto;
  min-width: 2ch;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.card-size {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.card-size.is-missing {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}

.card-price {
  font-weight: 600;
}

.card-line > .card-quote {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: var(--s2);
  font-size: 0.875rem;
  color: var(--muted);
}

.card-quote > * + * {
  margin-left: var(--s2);
}

.card-line-quiet > .card-quote {
  margin-left: 0;
  font-size: 0.95rem;
}

/* A customer's comment, quoted the UI language's way (comment.quote). Familjen has no italic: muted colour instead. */
.quote-text {
  color: var(--muted);
  font-weight: 400;
}

.card-for {
  font-size: 0.875rem;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--muted);
  font-weight: 600;
}

/* At least 24 px between Refuser and Imprimer: a hurried tap never lands on the other one. */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s5);
}

.card-actions .btn {
  min-height: 52px;
}

.card-actions .btn-no {
  width: 52px;
}

.card-actions .btn-ok {
  min-width: 148px;
  font-size: 16px;
}

/* A card decided from here (printed, refused, seen, ignored) stays in place a moment: same height as the
   buttons, so nothing moves. */
.card-done {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 52px;
  padding: 0 var(--s2);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.card-done.is-off {
  color: var(--muted);
}

.card.is-decided {
  background: var(--rail);
}

.card.is-decided .card-name,
.card.is-decided .card-line {
  color: var(--muted);
}

/* A card to check: a dashed outline and the "?" reason badge (never a coloured stripe, never a percentage). */
.card.is-low {
  border-style: dashed;
  border-color: var(--warn-line);
}

.tag-check {
  background: var(--warn-bg);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}

.size-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  padding: 6px var(--s3);
  border-radius: var(--r-control);
  background: var(--warn-bg);
}

/* A printed card held in place keeps its size row's height, without showing it. */
.size-picker.is-held {
  visibility: hidden;
}

.size-picker-label {
  font-weight: 600;
  color: var(--warn);
  margin-right: var(--s1);
}

/* Footer: counters, printer tray, undo. */
.live-foot {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 72px;
  padding: var(--s1) var(--s5);
  border-top: 1px solid var(--line);
  background: var(--deep);
  min-width: 0;
}

.kpis {
  display: flex;
  gap: 36px;
  flex: none;
}

.kpi {
  display: flex;
  flex-direction: column;
  min-width: 56px;
}

.kpi-value {
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
}

.kpi-label {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-decision);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.kpi.is-warn .kpi-value {
  color: var(--warn);
}

.tray-zone {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.tray {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  width: 100%;
  justify-content: flex-end;
}

.tray-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  flex: none;
}

.tray-label .num {
  font-size: var(--text-decision);
  font-weight: 600;
}

.tray-empty {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A label the printer did not acknowledge, in the live's tray: its reason in the warning colour. */
.tray-failure {
  color: var(--warn);
  font-weight: 600;
  min-width: 0;
}

.tray-strip {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  min-width: 0;
  padding: 4px 2px;
  scrollbar-width: none;
}

/* The oldest labels fade out at the right edge instead of being cut. */
.tray-strip.is-overflowing {
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}

/* A printed label: paper colours in both themes, like the thermal roll. */
.ticket {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: var(--tap);
  min-width: 112px;
  max-width: 156px;
  padding: 4px 10px;
  border: 0;
  border-radius: 4px;
  background: var(--ticket);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: var(--ticket-ink);
  text-align: left;
  cursor: pointer;
  flex: none;
}

.ticket-name {
  font-family: "Archivo", var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: var(--text-min);
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-line {
  font-family: "Archivo", var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: var(--text-min);
  color: var(--ticket-muted);
}

/* An undone label: struck through, in the ticket's own muted ink (never opacity: it stays readable). */
.ticket.is-cancelled {
  color: var(--ticket-muted);
  text-decoration: line-through;
  box-shadow: inset 0 0 0 1px var(--ticket-muted);
}

.ticket.is-printing {
  animation: print-out 250ms ease-out;
}

@keyframes print-out {
  from {
    transform: translateY(-40%);
    opacity: 0;
  }
}

.btn-undo {
  flex: none;
}

/* Over the printer tray, below the cards. Never takes a tap. */
.toast-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.toast-slot:empty {
  display: none;
}

/* ---------- 4. etiquette (proposal C: print tray) ---------- */

.etiquette {
  display: grid;
  /* The label keeps at least 12rem on a short screen (a phone held sideways): the screen scrolls instead. */
  grid-template-rows: 120px auto minmax(12rem, 1fr) 88px;
  grid-template-areas: "band" "notice" "stage" "bar";
  height: 100%;
}

.etiquette > .label-band {
  grid-area: band;
}

.etiquette > .print-notice,
.etiquette > .etiquette-notices {
  grid-area: notice;
}

/* A label the printer did not acknowledge (printer.js failure): the notice's look, its Retry at the end. */
.print-failure {
  align-items: center;
  flex-wrap: wrap;
}

.print-failure-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.etiquette > .label-stage {
  grid-area: stage;
}

.etiquette > .label-bar {
  grid-area: bar;
}

/* Devices without Web Bluetooth (iPad, iPhone): the label screen says they do not print. */
.print-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: var(--s3) var(--s4) 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-small);
  background: var(--warn-bg);
  color: var(--text);
}

.print-notice .icon {
  margin-top: 2px;
  color: var(--warn);
}

/* Band of every label of the live, newest first. */
.label-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--deep);
  min-width: 0;
}

.label-band > .btn {
  flex: none;
}

/* The tickets scroll sideways beside Voltar, which stays in place. */
.label-tickets {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}

.btn-back {
  min-height: var(--tap);
  padding: 0 var(--s3) 0 var(--s2);
}

.ticket.ticket-lg {
  position: relative;
  min-width: 132px;
  max-width: 200px;
  min-height: 56px;
  padding: 10px 14px;
}

.ticket-lg .ticket-name {
  font-size: var(--text-decision);
}

.ticket-lg .ticket-line {
  font-size: var(--text-min);
}

/* Selected label: a chalk ring around the paper (the focus outline stays free for the keyboard). */
.ticket.is-selected {
  box-shadow:
    0 0 0 3px var(--deep),
    0 0 0 6px var(--chalk);
}

.ticket-badge {
  position: absolute;
  top: -9px;
  right: -6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-family: var(--font-ui);
  font-size: var(--text-min);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Neutral work surface with a faint dot grid: the label is the only white object on it. */
.label-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  /* The canvas is sized on this box (cq units): the whole label fits, whatever the room. */
  container-type: size;
  padding: var(--s5);
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.5px);
  background-size: 16px 16px;
  overflow: hidden;
}

.label-canvas {
  display: block;
  width: min(800px, 100cqw, 100cqh * 400 / 240);
  height: auto;
  aspect-ratio: 400 / 240;
  object-fit: contain;
  background: var(--label-paper);
  border-radius: 4px;
  box-shadow: var(--shadow-raised);
  image-rendering: pixelated;
}

.label-stage.is-cancelled .label-canvas {
  opacity: 0.45;
}

.label-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 32px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}

.label-bar > .muted {
  white-space: nowrap;
}

/* ---------- 5. fin du live (proposal A + customer sheet) ---------- */

body[data-screen="fin-live"] .screen {
  overflow: hidden;
}

.topbar-live-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.fin {
  display: grid;
  grid-template-rows: 120px minmax(12rem, 1fr) minmax(88px, auto);
  height: 100%;
}

.fin-band {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 32px;
  background: var(--deep);
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
}

.fin-kpi {
  display: grid;
  min-width: 0;
}

/* "À valider : N · CHF X" while order proposals still wait for a Yes. */
.fin-kpi.is-warn .fin-kpi-value,
.fin-kpi.is-warn .fin-kpi-label {
  color: var(--warn);
}

/* Réglages → Aide: the 6-digit support code, read aloud on the phone. */
.support-code {
  font-size: 22px;
  letter-spacing: 0.08em;
}

.fin-kpi-value {
  font: 600 40px/1.05 var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.fin-kpi-label {
  font-size: var(--text-decision);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fin-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
}

.fin-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

.fin-checks {
  border-right: 1px solid var(--line);
}

.fin-sheet {
  background: var(--rail);
}

.fin-col-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 32px;
}

.fin-col-head .label-mono {
  flex: 1;
}

/* "Clientes / Fil do live" (spec 2026-10-22), and the feed's tabs in the column. */
.fin-col-head:has(.fin-view) {
  flex-wrap: wrap;
}
.fin-view {
  flex: none;
}
.fin-feed .feed-tabs {
  margin: 0;
}

.label-mono.is-warn {
  color: var(--warn);
}

/* "6 encomendas · 5 perguntas · 2 duplicados" under "13 pontos a verificar" (UX review E3). */
.fin-breakdown {
  margin: calc(-1 * var(--s2)) 0 0;
  font-size: var(--text-min);
}

/* Cards of the "À vérifier" list: compact order cards. */
.check-cards,
.cust-list,
.sheet-orders,
.sheet-comments,
.sheet-history,
.addr-cards,
.merge-list,
.modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.check-card-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Her name keeps at least 9rem: the tag goes under it rather than squeezing it to nothing. */
.check-card-name > span:first-child {
  flex: 0 1 auto;
  min-width: min(100%, 9rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-card-acts {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* One line where it fits; a long hint goes under the comment rather than out of the card. */
.check-card-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  color: var(--muted);
}

.check-no {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.check-card .quote-text,
.check-card-line > .muted {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Size picker band of a card without size. */
.pick-size {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 12px;
  border-radius: var(--r-control);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 15px;
  font-weight: 600;
}

.pick-size > span {
  margin-right: auto;
}

/* Orders per customer: rows are buttons laid out as a table. */
.cust-head,
.cust-row {
  display: grid;
  /* rem: the articles column grows with the text size ("Artigos" in large text). */
  grid-template-columns: minmax(0, 1fr) 4.5rem 120px 150px;
  align-items: center;
  gap: var(--s3);
  padding: 0 14px;
}

.cust-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-min);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cust-row {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .cust-row:hover {
    background: var(--card);
  }
}

.cust-row.is-current {
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--chalk);
}

.cust-name {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  min-width: 0;
}

.cust-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cust-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cust-total {
  font-weight: 700;
}

.cust-status,
.cust-head > :last-child {
  display: flex;
  justify-content: flex-end;
}

.fin-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) 14px;
  padding: var(--s2) 32px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

/* The buttons keep their words; the points-left tag gives way first (its text wraps), then the row wraps. */
.fin-foot > .btn {
  flex-shrink: 0;
}

/* On a second line, "Tudo certo" stays on the right. */
.fin-foot > .btn-all-good {
  margin-left: auto;
}

.fin-foot > .tag {
  /* Takes the free room before the spacer does, up to its own width. */
  flex: 1000 1 0;
  max-width: max-content;
  min-width: min(11rem, 100%);
  padding-block: 4px;
  border-radius: var(--r-control);
  white-space: normal;
}

.tag-lg {
  min-height: 30px;
  padding: 0 12px;
  font-size: 15px;
}

.btn-all-good {
  min-height: 64px;
  padding: 0 30px;
  font-size: 19px;
  border-radius: var(--r-card);
}

/* Customer sheet (in place of the table). */
.sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}

.sheet-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sheet-who > .muted {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
  font-size: 14px;
}

.sheet-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.sheet-name:focus {
  outline: none;
}

.sheet-orders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.sheet-order.is-cancelled .sheet-order-name,
.sheet-order.is-cancelled .sheet-order-line > :not(.tag) {
  color: var(--text-dim);
  text-decoration: line-through;
}

.sheet-order-name {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Size, quantity, price and tags; a late order's source tag goes to the next line when the row is full. */
.sheet-order-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

.sheet-price {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sheet-order-acts {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  gap: var(--s2);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-actions .btn {
  justify-content: flex-start;
}

/* Right to erasure: apart at the end of the sheet, never next to the everyday corrections. */
.sheet-erase {
  display: grid;
  gap: var(--s2);
  justify-items: start;
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.sheet h3 {
  margin-top: 4px;
}

.sheet-comments,
.sheet-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
}

.sheet-comments li,
.sheet-history li {
  display: flex;
  gap: var(--s3);
  min-width: 0;
}

.sheet-history li {
  justify-content: space-between;
}

.sheet-time {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Dialogs of the corrections. */
.modal-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-control);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 0.95rem;
}

.modal-wide {
  width: min(560px, 100%);
}

.merge-list {
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.merge-pick {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 56px;
  padding: 0 var(--s4);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.merge-list li:last-child .merge-pick {
  border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .merge-pick:hover {
    background: var(--chip);
  }
}

.merge-name {
  flex: 1;
  font-weight: 700;
}

/* Line editor ("Modifier une ligne"). */
.modal.editor {
  width: min(860px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  gap: 18px;
  padding: 26px 28px;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.editor-title {
  flex: 1;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.editor-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px 20px;
}

.editor-label {
  align-self: center;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
}

.editor-row,
.editor-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

/* Payment date: the day and the time side by side, the example under them. */
.paid-when .paid-date {
  flex: 1 1 9rem;
  max-width: 12rem;
  min-width: 0;
}

.paid-when .paid-time {
  flex: 0 1 6rem;
  min-width: 0;
}

.paid-when > .small {
  flex-basis: 100%;
}

.input {
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--surface);
  font-size: 1.05rem;
}

.editor-search {
  width: 100%;
}

.editor-other {
  width: 150px;
}

.editor-price {
  width: 140px;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.editor-unit {
  font-weight: 700;
}

/* Choices of the editor: outlined, chalk fill when picked. */
.pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  min-width: 56px;
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .pick:hover {
    background: var(--chip);
  }
}

.pick.is-on {
  background: var(--chalk);
  border-color: var(--chalk);
  color: var(--on-chalk);
}

.pick-no {
  min-width: 72px;
  font: 600 24px var(--font-num);
  font-variant-numeric: tabular-nums;
}

.editor-qty {
  min-width: 40px;
  text-align: center;
  font: 600 32px var(--font-num);
  font-variant-numeric: tabular-nums;
}

.editor-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.editor-error {
  color: var(--live-fg);
  font-weight: 600;
}

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

.btn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
}

/* What a primary still needs, beside it (UX review E3): "Falta: tamanho, cliente". */
.editor-missing {
  flex: 1 1 160px;
  margin: 0;
  color: var(--warn);
  font-weight: 600;
}

.editor-missing[hidden] {
  display: none;
}

.editor-note {
  flex: 1 1 140px;
  text-align: right;
}

.editor-head .modal-title {
  flex: 1;
}

.editor-confirm {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  flex: 1 1 360px;
}

.editor-confirm .modal-icon {
  flex: none;
  background: var(--live-bg);
  color: var(--live-fg);
}

.editor-confirm p {
  color: var(--muted);
}

.editor-confirm strong {
  color: var(--text);
}

.ok-line {
  color: var(--ok-fg);
}

.panel-head .panel-title {
  margin-right: auto;
}

/* ---------- 6. messages (proposal A: list + draft) ---------- */

body[data-screen="messages"] .screen,
body[data-screen="reglages"] .screen {
  overflow: hidden;
}

.msgs {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.msg-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--rail);
  overflow-y: auto;
}

/* "Mensagens" as the list's title on a phone only (layout.css); beside the pane it is for screen readers. */
.msg-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.msg-list-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  padding: var(--s3) 18px;
  border-bottom: 1px solid var(--line);
}

.msg-list-head .label-mono {
  flex: 1;
}

.msg-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.msg-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 68px;
  padding: var(--s3) 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .msg-row:hover {
    background: var(--surface);
  }
}

/* The selected customer: card fill and a 3 px chalk inset on the left edge (no coloured border). */
.msg-row.is-selected {
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--chalk);
}

.msg-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.msg-row-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row-sub {
  color: var(--muted);
  font-size: var(--text-min);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-pane {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: 28px 32px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.msg-pane-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
}

.msg-pane-head .title {
  margin-right: auto;
}

/* "Enviar N mensagens…" at the foot of the list: a phone only (layout.css). */
.msg-list-foot {
  display: none;
}

/* Back to the list: a phone shows the list or one customer (layout.css). */
.msg-back {
  display: none;
}

/* A send waiting for its answer. */
.spinner {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.msg-note .spinner {
  width: 18px;
  height: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2400ms;
  }
}

.msg-pane-head .title:focus {
  outline: none;
}

.msg-context {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-size: 0.9rem;
}

.message-text {
  width: 100%;
  min-height: 280px;
  flex: 1 1 280px;
  padding: 18px 20px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
}

.message-text:focus-visible {
  border-color: var(--chalk);
  outline: none;
}

.message-text[readonly] {
  background: var(--rail);
  color: var(--muted);
}

.msg-pane-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  min-height: var(--tap);
}

.msg-note {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
}

/* ---------- 7. réglages (proposal B: categories left) ---------- */

.reglages {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: var(--rail);
  overflow-y: auto;
}

.settings-nav-title {
  padding: var(--s2) 14px var(--s3);
}

.settings-cat {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .settings-cat:hover:not(.is-current) {
    background: var(--chip);
    color: var(--text);
  }
}

.settings-cat.is-current {
  background: var(--chalk);
  color: var(--on-chalk);
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: 32px 40px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.settings-group {
  display: flex;
  flex-direction: column;
  max-width: 820px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  min-height: 72px;
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
}

.settings-group > .setting-row:first-child {
  border-top: 0;
}

.setting-block {
  flex-direction: column;
  align-items: stretch;
}

.setting-block > .setting-text {
  flex: none;
}

.setting-switch {
  width: 100%;
  flex-wrap: nowrap;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.setting-switch:disabled {
  cursor: not-allowed;
}

.setting-switch:disabled .switch-track {
  opacity: 0.45;
}

.setting-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 240px;
}

.setting-label {
  font-weight: 600;
}

/* "MB WAY  Por defeito": the tag apart from the name. */
.setting-label > .tag {
  margin-left: var(--s2);
  vertical-align: 1px;
}

.setting-hint {
  font-size: 0.875rem;
  color: var(--muted);
}

.setting-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.signature-text {
  width: 100%;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.signature-text:focus-visible {
  border-color: var(--chalk);
  outline: none;
}

/* Réglages › Mensagens: the store's message template, its tags and the preview (screens/messages-editor.js). */
.messages-editor {
  gap: var(--s3);
}

.messages-editor > .segmented {
  align-self: flex-start;
}

.tpl-unknown:empty {
  display: none;
}

.tpl-title {
  font-size: 1.15rem;
}

.tpl-subtitle {
  margin-top: var(--s3);
}

.tpl-text {
  min-height: 14rem;
}

.tpl-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.tpl-chips > .setting-hint {
  flex-basis: 100%;
}

.tpl-chip {
  border-color: var(--line-2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
}

.tpl-preview {
  margin: 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--deep);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tpl-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tpl-table th {
  padding: var(--s2) var(--s3) var(--s2) 0;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.tpl-table th:first-child {
  width: 34%;
}

.tpl-table td {
  padding: var(--s3) var(--s3) var(--s3) 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.tpl-table td > .btn {
  margin-top: var(--s1);
}

.tpl-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.tpl-example {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.tpl-name-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tpl-name-field > .input,
.tpl-value > .input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  color: var(--text);
}

.tpl-value {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.tpl-foot {
  margin-top: var(--s3);
}

/* Réglages › Loja: the store's logo, name and address (screens/identity-editor.js, mockup 01); Guardar stays at the bottom. */
.identity-editor {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  max-width: 640px;
}

.identity-lead {
  margin: 0;
}

.identity-logo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

/* Réglages › Loja: the address label as it prints (label.js canvas at 1:1, scaled down). */
.identity-preview {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.identity-preview-canvas {
  display: block;
  width: min(100%, 400px);
  height: auto;
  background: var(--label-paper);
  border-radius: 4px;
  box-shadow: var(--shadow-raised);
  image-rendering: pixelated;
}

.identity-logo-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  padding: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-control);
  color: var(--muted);
}

.identity-logo-box > img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.identity-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 100px;
  min-width: 0;
}

.identity-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.identity-logo > .editor-error {
  flex-basis: 100%;
  margin: 0;
}

.identity-field {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
}

.identity-field > .editor-error {
  margin: 0;
}

.identity-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.identity-field > .input {
  width: 100%;
  min-width: 0;
  color: var(--text);
}

.identity-field > .input[aria-invalid="true"] {
  border-color: var(--live-fg);
}

.identity-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--s3);
}

.identity-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s2);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
  /* Covers the scroll area's bottom padding under it, so no field shows through below Guardar. */
  box-shadow: 0 48px 0 var(--bg);
}

.identity-status {
  margin: 0;
}

.identity-status:empty {
  display: none;
}

/* ---------- responsive ---------- */

/* Desktop: the app is at most 1440 px wide, centred. */
/* ---------- 0. lives (home) ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lives {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100%;
}

.lives-main {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: 26px var(--s6) var(--s6);
  min-width: 0;
}

.lives-day {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* What the list is for, under a short history (instead of an empty page). */
.lives-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  max-width: 40rem;
  margin: 0;
}

.lives-hint > svg {
  flex: none;
  margin-top: 2px;
}

.live-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-row {
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: var(--s4) 18px;
}

.live-row.is-past {
  background: transparent;
  padding-block: 14px;
}

.live-row-time {
  min-width: 86px;
  flex: none;
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* "Início" above the start time (UX review E3). */
.live-row-time {
  display: grid;
  gap: var(--s1);
}

.live-row-time-label {
  font-family: var(--font-ui);
  font-size: var(--text-min);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-row.is-past .live-row-time {
  font-size: 30px;
  color: var(--muted);
}

.live-row-main {
  display: grid;
  gap: var(--s1);
  flex: 1;
  min-width: 0;
}

.live-row-name {
  font-size: 18px;
  font-weight: 700;
}

.live-row-sub {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.lives-empty {
  display: grid;
  justify-items: start;
  gap: var(--s4);
  padding: var(--s6) 0;
}

.lives-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
  background: var(--deep);
  border-left: 1px solid var(--line);
  min-width: 0;
}

.lives-aside > .btn {
  align-self: flex-start;
}

.day-kpi {
  display: grid;
}

.day-kpi-value {
  font-family: var(--font-num);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.day-kpi-label {
  font-size: 0.875rem;
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.search-input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--surface);
  font-size: 1.05rem;
}

.search-results,
.search-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hit {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.search-hit-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.search-hit-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px var(--s2);
  min-height: var(--tap);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .search-hit-live:hover {
    background: var(--chip);
  }
}

.search-hit-live .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
}

.search-hit-when {
  font-weight: 600;
}

/* Top bar inside a live: "‹ Lives", then Live / Contrôle / Messages. */
.btn-lives {
  flex: none;
  padding-left: var(--s2);
}

.stage-pills {
  display: flex;
  gap: var(--s1);
  flex: none;
}

.stage-pill {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .stage-pill:hover:not(:disabled):not(.is-current) {
    color: var(--text);
  }
}

.stage-pill.is-current {
  background: var(--chalk);
  color: var(--on-chalk);
}

/* A stage not open yet: its lock and its reason (title, visually hidden text), muted at 4.5:1, never faded. */
.stage-pill.is-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: not-allowed;
}

.stage-pill:not(.is-current):not(.is-locked) {
  color: var(--text);
}

/* App-level toast (save errors, a live already running), above everything, never takes a tap. */
/* Lost connection to the live: over every screen, under the top bar, until it comes back. */
.conn-banner {
  position: fixed;
  top: calc(var(--topbar) + var(--s2));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s5);
  border-radius: 999px;
  background: var(--live-bg);
  color: var(--live-fg);
  box-shadow: inset 0 0 0 1px var(--live-line), var(--shadow-raised);
  font-size: 17px;
  font-weight: 700;
}

.conn-banner[hidden] {
  display: none;
}

/* A new version of the app, waiting for the seller's go (never shown during a followed live: app.js offerUpdate). */
.update-banner {
  position: fixed;
  top: calc(var(--topbar) + var(--s2));
  right: var(--s4);
  left: var(--s4);
  z-index: 44;
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: max-content;
  max-width: calc(100% - 2 * var(--s4));
  margin-inline: auto;
  min-height: var(--tap);
  padding: var(--s1) var(--s1) var(--s1) var(--s4);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-raised);
  font-weight: 600;
}

.update-banner .btn {
  flex: none;
  white-space: nowrap;
}

.update-banner[hidden] {
  display: none;
}

/* A save that failed: stays in the top bar until a save works again. */
.chip-warn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--s3);
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px var(--warn-line);
  font-size: var(--text-decision);
  font-weight: 700;
  white-space: nowrap;
}

.app-toast {
  position: fixed;
  inset: auto var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)) var(--s4);
  justify-content: center;
  z-index: 40;
}

/* Under 1280 px the live feed is a drawer over the cards. */
@media (max-width: 1279.98px) {
  .live.feed-open .live-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-open .rail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 85vw);
    z-index: 15;
    box-shadow: var(--shadow-drawer);
    animation: drawer-in var(--motion) ease-out;
  }

  .brand-tag,
  .topbar-source {
    display: none;
  }
}

@keyframes drawer-in {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}

/* Tablet portrait and small laptops (700–1279 px). */
@media (max-width: 1279.98px) {
  .lives {
    grid-template-columns: minmax(0, 1fr);
  }

  .lives-main {
    padding: var(--s5) var(--s4);
  }

  .lives-aside {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: var(--s5) var(--s4);
  }

  .page {
    padding: var(--s5) var(--s4) var(--s6);
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .fin {
    /* max-content: the band hides its overflow, and such an auto row would shrink on a short screen. */
    grid-template-rows: max-content minmax(12rem, 1fr) auto;
  }

  .fin-band {
    flex-wrap: wrap;
    gap: var(--s3) var(--s5);
    padding: var(--s3) var(--s4);
  }

  .fin-kpi-value {
    font-size: 30px;
  }

  .fin-cols {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow-y: auto;
  }

  /* Stacked columns grow with their content (min-height: 0 would let the rows shrink and overlap). */
  .fin-col {
    overflow: visible;
    min-height: auto;
  }

  .fin-checks {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fin-foot {
    flex-wrap: wrap;
    padding: var(--s3) var(--s4);
  }

  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .msgs {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .msg-pane {
    padding: var(--s5) var(--s4);
  }

  .reglages {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .settings-body {
    padding: var(--s5) var(--s4);
  }

  .etiquette {
    grid-template-rows: 120px auto minmax(12rem, 1fr) auto;
  }

  .label-band {
    padding: 0 var(--s4);
  }

  .label-bar {
    flex-wrap: wrap;
    padding: var(--s3) var(--s4);
  }

  /* Top bar of a live's screens: the stages and the screen's own controls come first. */
  body[data-screen="live"] .brand-name,
  body[data-screen="live"] .topbar-page,
  body[data-screen="fin-live"] .brand-name,
  body[data-screen="fin-live"] .topbar-page,
  body[data-screen="messages"] .brand-name,
  body[data-screen="messages"] .topbar-page,
  body[data-screen="etiquette"] .brand-name,
  body[data-screen="etiquette"] .topbar-page,
  body[data-screen="lives"] .brand-name {
    display: none;
  }

  .board {
    min-height: 96px;
    padding: 0 var(--s4);
  }

  .board-in {
    gap: var(--s4);
  }

  .board-no {
    font-size: 60px;
  }

  .board-desc {
    font-size: 19px;
  }

  .board-price {
    font-size: 40px;
  }

  .board-price small {
    font-size: 17px;
  }

  .board-sizes {
    gap: 6px;
  }

  .board-sizes .size-tag {
    min-width: 34px;
    min-height: 32px;
    padding: 0 6px;
  }

  .dur {
    width: 120px;
  }

  /* Footer on two rows: counters, then the printer tray and undo. */
  .live-foot {
    flex-wrap: wrap;
    gap: var(--s2) var(--s4);
    padding: var(--s2) var(--s4) var(--s3);
  }

  .kpis {
    flex: 1 0 100%;
    justify-content: space-between;
  }

  .tray {
    justify-content: flex-start;
  }
}

/* Phones (under 700 px); layout.css holds the phone layout. */
@media (max-width: 699.98px) {
  .topbar-page,
  .brand-name {
    display: none;
  }

  .cust-head,
  .cust-row {
    grid-template-columns: minmax(0, 1fr) auto 6rem;
  }

  .cust-head > :last-child {
    display: none;
  }

  /* Her status under her name (A verificar, Reimprimir, Silenciada); "Pronta" goes, the line says enough. */
  .cust-row {
    row-gap: 2px;
    padding-block: var(--s2);
  }

  .cust-status {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .cust-status:has(> .tag:not(.tag-warn, .tag-muted)) {
    display: none;
  }

  .check-card,
  .sheet-order {
    grid-template-columns: minmax(0, 1fr);
  }

  .check-card-acts,
  .sheet-order-acts {
    grid-row: auto;
    grid-column: auto;
    flex-wrap: wrap;
  }

  .sheet-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .msgs,
  .reglages {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .msg-list {
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .card {
    grid-template-columns: 1fr;
  }

  .card-actions .btn-ok {
    flex: 1;
    min-width: 0;
  }

  .board-sizes,
  .board-since {
    display: none;
  }

  .kpis {
    gap: var(--s3);
  }

  .kpi-value {
    font-size: 1.1rem;
  }
}

/* All motion off when the system asks for it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Simulated admin console (/admin, loopback only). */
body[data-screen="admin"] {
  background: var(--bg);
}

.admin {
  display: grid;
  gap: var(--s3);
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.admin-foot {
  display: flex;
  justify-content: flex-end;
}

/* Suivi: payment and delivery tracking of one live. */
.suivi {
  display: grid;
  /* One column the width of the screen: a long filter bar scrolls, it never widens the page. */
  grid-template-columns: minmax(0, 1fr);
  /* The filters scroll sideways: max-content keeps their row from shrinking on a short screen. */
  grid-template-rows: 120px auto max-content minmax(12rem, 1fr) minmax(88px, auto);
  height: 100%;
}

.suivi > .track-filters {
  justify-self: start;
  max-width: calc(100% - 64px);
  overflow-x: auto;
  scrollbar-width: none;
  margin: var(--s3) 32px 0;
}

/* Scope (Ce live · Aujourd'hui · 7 jours · Tout) and "Regrouper par", above the filters (spec §4 bis). */
.track-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: var(--s4) 32px 0;
}

.track-bar .segmented {
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.track-bar .label-mono + .segmented {
  margin-right: var(--s3);
}

/* The rows scroll here; one list (a live, or customers over lives) or one section per live. */
.track-body {
  min-height: 0;
  overflow: auto;
  padding-bottom: var(--s4);
}

.track-body .track-rows {
  overflow: visible;
}

.track-note {
  margin: var(--s3) 32px 0;
}

.track-live + .track-live {
  margin-top: var(--s4);
}

.track-live-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin: var(--s4) 32px 0;
  font-size: 1rem;
  font-weight: 600;
}

.track-expand {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-width: 0;
  min-height: 44px;
  margin: -10px 0 -10px -6px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.track-expand:hover {
  background: var(--card);
}

.track-expand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Her lives under her row, on the same columns. */
.track-sub,
.track-subrows {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-subrow {
  min-height: 52px;
  padding-left: 40px;
  background: var(--card);
}

.track-rows,
.track-empty {
  margin: var(--s3) 32px 0;
}

.track-rows {
  display: grid;
  /* The name, reference and tags keep their room (rem: they grow with the text); the actions wrap rather than squeeze them. */
  grid-template-columns: minmax(10rem, 1.3fr) 7rem minmax(min-content, 1.2fr) minmax(min-content, 1fr) auto;
  grid-auto-rows: max-content;
  column-gap: var(--s3);
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.track-rows.no-pay {
  grid-template-columns: minmax(9rem, 1.3fr) minmax(min-content, 1fr) auto;
}

.track-rows.no-delivery {
  grid-template-columns: minmax(9rem, 1.3fr) 7rem minmax(min-content, 1.2fr) auto;
}

/* Rows share the list's columns, so the actions of one row never shift the tags of another. */
.track-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  gap: var(--s3);
  min-height: 64px;
  padding: var(--s2) 14px;
  border-bottom: 1px solid var(--line);
}

/* A phone's compact row (layout.css): one status in place of the payment tag and the stepper; hidden elsewhere. */
.track-status,
.menu-anchor.is-phone-only,
.menu-item.is-phone-only {
  display: none;
}

.track-row.is-overdue {
  box-shadow: inset 3px 0 0 var(--live);
}

.track-who {
  display: grid;
  gap: 2px;
  min-width: 0;
}

/* Her name wraps rather than being cut (UX review 2026-10-23). */
.track-who strong {
  overflow-wrap: anywhere;
}

.track-ref,
.track-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.track-pay,
.track-delivery {
  display: grid;
  justify-items: start;
  gap: var(--s1);
}

.track-diff {
  margin: 0;
  color: var(--warn);
}

/* The parcel's stepper: three dots joined by a line, the current step named. */
.delivery {
  display: grid;
  justify-items: start;
  gap: 2px;
}

.delivery-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery-step {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.delivery-step + .delivery-step::before {
  content: "";
  width: 14px;
  height: 2px;
  margin: 0 4px;
  background: var(--line-strong);
}

.delivery-step.is-done + .delivery-step::before {
  background: var(--chalk);
}

.delivery-dot {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.delivery-step.is-done .delivery-dot {
  border-color: var(--chalk);
  background: var(--chalk);
  color: var(--on-chalk);
}

.delivery-step.is-current .delivery-dot {
  border-color: var(--chalk);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 6px var(--chalk);
}

/* Only the current step (or the last one, once reached) is named on screen; the others are read by screen readers. */
.delivery-step:not(.is-current):not(.is-done:last-child) .delivery-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.delivery-step.is-current .delivery-name,
.delivery-step.is-done:last-child .delivery-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.track-acts {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}

.track-methods {
  flex-wrap: wrap;
}

.track-reminder {
  min-height: 180px;
}

.suivi > .fin-foot {
  padding: 0 32px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1279.98px) {
  .track-rows,
  .track-rows.no-pay,
  .track-rows.no-delivery {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .track-acts {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Payment and delivery block of the customer sheet. */
.sheet-track {
  display: grid;
  gap: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.sheet-track-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

.sheet-payments {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-payments li {
  display: flex;
  gap: var(--s3);
  font-variant-numeric: tabular-nums;
}

/* Lives home "À encaisser" card and its list. */
.collect-card {
  display: grid;
  justify-items: start;
  gap: var(--s2);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.collect-card .small {
  margin: 0;
}

.collect-overdue {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  margin: 0;
  color: var(--live-fg);
}

.collect-list {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.collect-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.collect-when {
  font-weight: 600;
}

.live-row-next {
  color: var(--warn);
}

/* A dialog body in a <form> (Enter submits): no box of its own, the modal lays out its children as before. */
.dialog-form {
  display: contents;
}

.collect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ---- live: order feed (spec pilot §6) ---- */
.order-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.feed-row {
  display: grid;
  /* Time, customer, order and the button on the first line; the comment, then the state, below the name. The feed is
     the middle column from 1280 px (layout.css), so the one-line layout of fixed columns no longer fits anywhere. */
  /* The name keeps 6rem: a long order ("Nº 224 · S · para ma sœur") wraps instead of hiding it. */
  grid-template-columns: 3.5rem minmax(6rem, 1fr) minmax(0, auto) auto;
  grid-template-areas:
    "time who what action"
    ". comment comment action"
    ". status status action";
  row-gap: 4px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* Oui / Non (row-actions.js) or Reimprimir, in the row's last cell. */
.feed-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* .btn-no alone is an icon button (48 px); here it carries its word. */
.feed-actions .btn-no {
  width: auto;
  padding: 0 var(--s3);
}

/* A row to check whose size alone is unknown: the article's sizes, 48 px chips, a tap is Oui with that size. */
.feed-actions:has(> .feed-sizes) {
  flex-wrap: wrap;
  align-items: center;
}

.feed-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.feed-sizes .chip {
  min-width: 52px;
}

.feed-row.is-review,
.feed-row.is-cancel {
  border-color: var(--warn-line);
}
.feed-row.is-rejected,
.feed-row.is-cancelled,
.feed-row.is-seen,
.feed-row.is-cancelApplied {
  color: var(--text-dim);
}
.feed-row .feed-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* .feed-who is also the rail feed's header line (flex, muted): one block, in the text colour, here. The comment as
   written wraps: never cut (spec 2026-10-22). */
.feed-row .feed-who {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-row .feed-comment {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}
.feed-row .feed-who {
  color: var(--text);
  font-weight: 600;
}
.feed-status {
  display: grid;
  gap: 2px;
}
.feed-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}
.feed-state.tone-ok {
  color: var(--ok);
}
.feed-state.tone-wait,
.feed-state.tone-warn,
.feed-reason {
  color: var(--warn);
}
.feed-state.tone-muted {
  color: var(--muted);
}
.feed-reason {
  font-size: 0.8rem;
}
.feed-row .feed-time {
  grid-area: time;
}
.feed-row .feed-who {
  grid-area: who;
}
.feed-row .feed-what {
  grid-area: what;
  text-align: right;
}
.feed-row .feed-comment {
  grid-area: comment;
}
.feed-row .feed-status {
  grid-area: status;
}
.feed-row > .btn,
.feed-row > .feed-actions {
  grid-area: action;
}

/* ---- live: the comment feed (spec 2026-10-22): order cards stand out, questions and cancellations are medium cards
   with a badge, any other comment is one readable line ---- */
.feed-row.kind-order {
  padding: 14px 16px;
  border-width: 1.5px;
  border-color: var(--line-2);
  box-shadow: 0 1px 0 var(--line);
}
.feed-row.kind-order.is-review {
  border-color: var(--warn-line);
}
.feed-row.kind-order .feed-who {
  font-size: 1.05rem;
}
.feed-row.kind-order .feed-what {
  color: var(--chalk);
  font-size: 1.15rem;
  font-weight: 700;
}
.feed-row.kind-question,
.feed-row.kind-cancel {
  background: var(--surface);
}
.feed-badge {
  margin-right: 8px;
  vertical-align: 1px;
}
/* An order she wrote in several comments (spec 2026-10-23 §6.5): one conversation card on the shared row grid
   (time | name and her comments | order and action, UX review 2026-10-23): her comments stacked on a rail in the
   comment slot, oldest first, each with its time. The name wraps rather than hide "· 3 messages" behind an ellipsis. */
.feed-row.is-grouped .feed-who {
  white-space: normal;
  overflow-wrap: anywhere;
}
.feed-row > .feed-fragments,
.feed-row > .feed-fragments-wrap {
  grid-area: comment;
  min-width: 0;
}
.feed-fragments-wrap {
  display: grid;
  gap: var(--s2);
  justify-items: start;
}
.feed-fragments {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 2px 0 2px var(--s3);
  list-style: none;
  border-left: 3px solid var(--line-strong);
}
.feed-fragment {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.feed-fragment .feed-time {
  flex: none;
  color: var(--muted);
  font-size: max(var(--text-min), 0.85rem);
}
.feed-fragment-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.feed-row .feed-count {
  font-weight: 500;
}
/* A line set aside (rejected, cancelled, seen): every text in --text-dim (4.5:1, contrast.test.ts), never faded; a
   rejected or cancelled order struck through, its state said with an icon (screens/order-feed.js). */
:is(.is-rejected, .is-cancelled, .is-seen, .is-cancelApplied).feed-row :is(.feed-who, .feed-what, .feed-comment, .feed-time, .feed-fragment-text) {
  color: var(--text-dim);
}
:is(.is-rejected, .is-cancelled).feed-row .feed-what {
  text-decoration: line-through;
}
.feed-more {
  min-height: 48px;
}
/* A card that just received her latest comment is marked for a moment (off under reduced motion, rule above). */
.feed-row.is-grouped.is-fresh {
  animation: feed-fresh 200ms ease-out;
}
@keyframes feed-fresh {
  from {
    background: var(--chip);
  }
}
.feed-row.is-pointed {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.feed-line {
  border-bottom: 1px solid var(--line);
}
/* An ordinary comment: 16 px at least, the text colour, the whole text wrapping; a real button (48 px) opening the
   order sheet. */
.feed-plain {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.feed-plain:hover {
  background: var(--chip);
}
.feed-plain .feed-time {
  margin-right: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.feed-plain-who {
  margin-right: 8px;
  font-weight: 600;
}
.feed-hidden {
  margin: 0 0 6px;
  font-size: max(var(--text-min), 0.9rem);
}

/* The live's top bar at 800 px (portrait): the stages, the on-air clock, Terminar and the menu fit on one line; the
   stages scroll sideways rather than push the page wider with longer words. */
@media (max-width: 1279.98px) {
  .topbar {
    gap: var(--s2);
    padding: 0 var(--s3);
  }
  .stage-pill {
    padding: 0 8px;
  }
  /* The live's own controls need the room: the mark goes, as the name already did. */
  body[data-screen="live"] .brand {
    display: none;
  }
  .stage-pills {
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

/* ---- home: live on air offers, one row per Page on air (spec pilot §6) ---- */
.live-offers {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.live-offer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--live-bg);
  border: 1px solid var(--live-line);
  border-radius: 12px;
}
.live-offer-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.live-offer > .rec-dot {
  color: var(--live-fg);
}

/* ---- after the live: OK / Corriger / Supprimer (spec pilot §6) ---- */
/* Supprimer carries its word here, not only the cross of the live's cards. */
.check-card-acts .btn-no {
  width: auto;
  padding: 0 var(--s3);
}
.check-card-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* With its three actions, a proposal to check keeps the full width for the name and the comment: the actions go
   under them (after the size band), on the right. */
.check-card:has(> .check-card-acts > :nth-child(3)) > .check-card-name,
.check-card:has(> .check-card-acts > :nth-child(3)) > .check-card-line {
  grid-column: 1 / -1;
}
.check-card:has(> .check-card-acts > :nth-child(3)) > .check-card-acts {
  grid-row: 4;
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.check-card:has(> .check-card-acts > :nth-child(3)):not(:has(> .pick-size)) > .check-card-acts {
  grid-row: 3;
}

/* Store switcher (top bar, platform only, from two stores on). */
.store-switch {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  flex: 0 1 auto;
}

/* The store's name gives way to the screen's buttons (it ellipsizes); a full tap target. */
.store-switch-select {
  flex: 0 1 auto;
  min-width: 5rem;
  max-width: 14rem;
  min-height: var(--tap);
  padding: 0 var(--s2);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-overflow: ellipsis;
}

.store-switch-select:disabled {
  opacity: 0.6;
}

.store-switch-hint {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Réglages › Equipa e atividade */
.team-section + .team-section {
  margin-top: var(--s4);
}

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
}

.team-link {
  word-break: break-all;
}

.activity-row.is-refused .setting-label,
.team-alert .setting-label {
  color: var(--warn);
}

/* Late order sheet (screens/late-order.js, spec 2026-10-22 §3): the live's articles as a scrolling list of wide picks. */
.late-articles {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

/* The article picked: its price and sizes in the pick's ink, not the muted grey (unreadable on the accent). */
.pick-article.is-on .muted {
  color: var(--on-chalk);
}

.pick-article {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 10px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
}

.late-new {
  display: grid;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
}

.late-new[hidden] {
  display: none;
}

.late-order .input {
  width: 100%;
  min-width: 0;
}

.late-order .late-price {
  max-width: 10rem;
}

/* The comment an order comes from (spec 2026-10-22), as written, above the form. */
.late-comment {
  display: grid;
  gap: 4px;
  margin: 0 0 var(--s3);
  padding: var(--s3);
  border-radius: 10px;
  background: var(--deep);
}
.late-comment-text {
  font-size: max(16px, 1rem);
  overflow-wrap: anywhere;
}

.late-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s3);
}

/* "Adicionada: …" with its icon on the same line. */
.late-added {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  overflow-wrap: anywhere;
}

.late-added > .icon {
  flex: none;
}

.late-status:empty {
  display: none;
}

/* The sheet scrolls rather than squeezing its parts (a full-height sheet on a phone is a fixed-height flex column). */
.late-order > * {
  flex-shrink: 0;
}

/* The sheet scrolls; "Adicionar" stays in view at its foot, over the fields that scroll under it. */
.late-order .editor-foot {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-bottom: var(--s2);
  background: var(--surface);
  /* Sticky stops at the sheet's padding: the same surface below it hides what scrolls through that gap. */
  box-shadow: 0 40px 0 var(--surface);
}

/* Contrôle: "+ Commande tardive" and "Chercher les nouveaux commentaires" under "À vérifier". */
.fin-late {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* Lives home: the late order button of the most recent live. */
.live-row-late {
  justify-self: start;
}

/* Messages: what she was already sent, unchanged, folded. */
.msg-history summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  cursor: pointer;
}

.msg-history-text {
  margin: 0 0 var(--s3);
  color: var(--muted);
  white-space: pre-wrap;
}

/* Messages: "Pagamento" and "Entrega" beside their menus. */
.msg-method {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  max-width: 100%;
}

.msg-method select {
  max-width: 100%;
}

/* "Seguimento ›" after Messages: under 1280 px the stages (or the phone's bottom navigation) already offer it. */
@media (max-width: 1279.98px) {
  .btn-next-stage {
    display: none;
  }
}

/* Lives home under 1280 px: the search is its icon (named for screen readers), as on a phone. */
@media (max-width: 1279.98px) {
  .btn-search {
    padding: 0;
    width: var(--tap);
  }

  .btn-search .btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Legal pages (Ajuda, connexion footer): each link a full tap target. */
.legal-links { display: inline-flex; flex-wrap: wrap; column-gap: 1rem; }
.legal-links a { display: inline-flex; align-items: center; min-height: 48px; color: inherit; }
.connexion-legal { margin-top: 1.5rem; text-align: center; }

/* The customer sheet's shipping addresses (screens/address-editor.js, mockup 02): one card per address, the default
   first with its pill; the editor (mockup 03) reuses the identity fields with a paste box and its banner. */
.addr-block {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.addr-cards {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.addr-card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.addr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-width: 0;
}

.addr-card-label {
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.addr-pill {
  flex: none;
  background: var(--chip);
  color: var(--chalk);
  font-weight: 700;
}

.addr-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.addr-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s1);
}

.addr-acts .btn {
  max-width: 100%;
}

.addr-default {
  background: var(--chip);
  border-color: var(--chip);
}

.addr-add {
  justify-content: flex-start;
}

.addr-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
}

.addr-error > p {
  margin: 0;
}

.address-editor .addr-form {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.address-editor .identity-select {
  width: 100%;
  min-width: 0;
  color: var(--text);
}

.addr-paste {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: var(--s3);
  resize: vertical;
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.4;
}

.addr-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-card);
  font-weight: 600;
}

.addr-banner[hidden] {
  display: none;
}

.addr-banner > svg {
  flex: none;
  margin-top: 2px;
}

.addr-banner.is-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.addr-banner.is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.addr-foot {
  position: sticky;
  bottom: calc(-1 * var(--s4));
  flex-direction: column;
  align-items: stretch;
  background: var(--surface);
  /* Covers the dialog's bottom padding under it, so no field shows through below Guardar. */
  box-shadow: 0 32px 0 var(--surface);
}

.addr-foot-error {
  margin: 0;
}

/* ---------- parcels: Colis screen, Seguimento's side panel, scanner, a label's link signed out (spec 2026-10-24 §7) ---------- */

/* Seguimento: "Digitalizar etiquetas" above the scope (phone); in the top bar from 700 px (layout.css). */
.track-head {
  min-width: 0;
}

.track-scan {
  margin: var(--s4) 32px 0;
  width: calc(100% - 64px);
}

.topbar-scan {
  flex-shrink: 0;
  margin-left: auto;
}

.track-open {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: var(--tap);
  margin: -12px 0 -12px -6px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-small);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.track-open strong {
  overflow-wrap: anywhere;
}

.track-row.is-selected {
  background: var(--chip);
}

/* Rows on the left, her parcel on the right (layout.css sets the columns from 700 px). */
.track-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
}

.track-split-list {
  min-width: 0;
}

.colis-panel {
  min-width: 0;
  margin: var(--s4) var(--s4) 0 0;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

/* The Colis screen: the parcel scrolls, its actions stay at the bottom. */
.colis-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
}

.colis-scroll {
  min-height: 0;
  overflow: auto;
}

.colis {
  display: grid;
  gap: var(--s4);
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s5) var(--s4);
}

.colis.is-panel {
  padding: 0;
}

.colis-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
}

.colis-head-text {
  display: grid;
  gap: var(--s1);
  min-width: 0;
  flex: 1;
}

.colis-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.colis.is-panel .colis-name {
  font-size: 1.4rem;
}

.colis-meta {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.colis-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-card);
  font-weight: 700;
}

.colis-banner.is-warn {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}

.colis-banner.is-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.colis-banner > span:not(.tag) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.colis-lines {
  margin: 0;
  padding: 0 var(--s4);
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.colis.is-panel .colis-lines {
  padding: 0;
  border: 0;
}

.colis-line {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
}

.colis-line:first-child {
  border-top: 0;
}

.colis-line-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.colis-line-text strong {
  overflow-wrap: anywhere;
}

/* The line the scan just found, on the Colis screen. */
.colis-line.is-scanned {
  margin-inline: calc(-1 * var(--s3));
  padding-inline: var(--s3);
  border-radius: var(--r-small);
  background: var(--chip);
  box-shadow: inset 4px 0 0 var(--chalk);
}

.colis-line.is-scanned + .colis-line {
  border-top-color: transparent;
}

/* Its label number ("#12"), or 1/2 for twin rows without one. */
.colis-line-mark {
  flex: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* A shipment over several lives (spec 2026-10-24 §12): its lines under a header per live. */
.colis-sections {
  display: grid;
  gap: var(--s3);
}

.colis-section {
  display: grid;
  gap: var(--s2);
  min-width: 0;
}

.colis-live {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.colis-group {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: 0;
  overflow-wrap: anywhere;
}

.colis-group > .icon {
  flex: none;
  margin-top: 2px;
}

.colis-line.is-missing .colis-line-text strong {
  color: var(--warn);
}

.colis-line.is-cancelled .colis-line-text strong {
  color: var(--live-fg);
  text-decoration: line-through;
}

.colis-line.is-cancelled .colis-line-text span {
  color: var(--live-fg);
}

/* The article's box: 48 px, ticked green. */
.colis-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  border: 2px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
}

.colis-box.is-on {
  border-color: var(--ok);
  background: var(--ok);
}

.colis-box.is-cancelled {
  border-color: var(--live-line);
  background: var(--live-bg);
  color: var(--live-fg);
  cursor: default;
}

.colis-ship {
  display: grid;
  gap: var(--s2);
}

.colis-ship > .label-mono {
  margin: 0;
}

.colis-address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}

.colis-address > .icon {
  flex: none;
}

.colis-address-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
}

.colis-address > .btn {
  flex: none;
}

.colis-method {
  margin: 0;
  overflow-wrap: anywhere;
}

.colis-preview {
  display: grid;
  justify-items: center;
  gap: var(--s2);
}

.colis-preview > .label-mono {
  justify-self: start;
  margin: 0;
}

.colis-preview-canvas {
  width: min(100%, 400px);
  height: auto;
  border-radius: var(--r-small);
  background: var(--label-paper);
  box-shadow: var(--shadow-raised);
}

.colis-notice {
  margin: 0;
}

.colis-actions,
.colis-foot {
  display: grid;
  gap: var(--s2);
}

/* The actions stay at the width of the parcel above them (720 px), centred. */
.colis-foot {
  padding: var(--s3) max(var(--s4), calc((100% - 720px) / 2 + var(--s4)));
  border-top: 1px solid var(--line);
  background: var(--rail);
}

.colis-foot > .btn,
.colis-actions > .btn {
  white-space: normal;
}

.colis-addr-dialog .radio-list {
  margin-top: var(--s3);
}

/* The scanner: the camera on a dark ground whatever the theme (is-live), the page's own ground without it (the number
   field); the result card at the bottom. */
body[data-screen="scanner"] .topbar {
  display: none;
}

/* Without the top bar the screen takes its row (else it would fall into the bar's 56 px row). */
body[data-screen="scanner"] #app {
  grid-template-rows: minmax(0, 1fr) auto;
}

.scanner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-height: 100%;
  padding: calc(var(--s5) + env(safe-area-inset-top)) var(--s4) var(--s4);
  background: var(--bg);
  color: var(--text);
}

.scanner.is-live {
  background: var(--label-ink);
  color: var(--label-paper);
}

.scanner-title {
  margin: 0;
  padding: 0 calc(var(--tap) + var(--s3));
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.scanner-close {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  border-color: transparent;
}

.scanner.is-live .scanner-close {
  background: var(--label-ink);
  color: var(--label-paper);
}

.scanner-view {
  position: relative;
  flex: none;
  align-self: center;
  width: min(100%, 420px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-card);
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 12%;
  border: 4px solid var(--label-paper);
  border-radius: var(--r-card);
}

.scanner-note {
  margin: 0;
  text-align: center;
}

.scanner-idle {
  display: grid;
  justify-items: center;
  gap: var(--s3);
}

.scanner-manual {
  display: grid;
  gap: var(--s2);
  width: 100%;
  max-width: 420px;
  align-self: center;
}

.scanner.is-live .scanner-manual :is(.label-mono, .muted) {
  color: var(--label-paper);
}

.scanner-manual-row {
  display: flex;
  gap: var(--s2);
}

.scanner-manual-row > .input {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.scanner-manual-open {
  align-self: center;
}

.scanner.is-live .scanner-manual-open {
  color: var(--label-paper);
}

.scanner-result {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s3);
  width: 100%;
  max-width: 520px;
  align-self: center;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
}

.scanner-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-small);
  background: var(--ok);
  color: var(--surface);
}

.scanner-result.is-warn .scanner-result-icon {
  background: var(--warn);
  color: var(--on-warn);
}

.scanner-result.is-danger .scanner-result-icon {
  background: var(--live);
  color: var(--surface);
}

.scanner-result.is-danger .scanner-result-text strong {
  color: var(--live-fg);
}

.scanner-result-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.scanner-result-text span {
  color: var(--muted);
}

.scanner-open {
  grid-column: 1 / -1;
}

/* A label's link opened while nobody is signed in (mockup 08). */
.scan-signin {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  padding: var(--s6) 0;
  text-align: center;
}

.scan-signin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-card);
  background: var(--chip);
  color: var(--chalk);
}

.scan-signin-caption {
  margin: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.scan-signin-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
}

.scan-signin .muted {
  margin: 0;
}

.scan-signin .btn {
  white-space: normal;
}

/* ---- customer avatar (avatar.js, owner 24.10): a 32 px circle left of her name (40 px in her sheet), her photo over
   her initials on her tone; a photo that fails is removed and the initials show ---- */
.avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  /* In em of its own font size (13 px → 32 px): larger text grows the circle with its initials. */
  width: 2.4615em;
  height: 2.4615em;
  margin-right: 8px;
  border-radius: 50%;
  overflow: hidden;
  vertical-align: middle;
  color: var(--on-avatar);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.avatar-lg {
  width: 2.5em;
  height: 2.5em;
  font-size: 16px;
}
.avatar-tone-1 {
  background: var(--avatar-1);
}
.avatar-tone-2 {
  background: var(--avatar-2);
}
.avatar-tone-3 {
  background: var(--avatar-3);
}
.avatar-tone-4 {
  background: var(--avatar-4);
}
.avatar-tone-5 {
  background: var(--avatar-5);
}
.avatar-tone-6 {
  background: var(--avatar-6);
}
.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* In a flex line the gap spaces it; the name next to it keeps its ellipsis. */
:is(.feed-who, .cust-name, .sheet-who-row, .track-who, .search-hit-name, .pick, .colis-head) > .avatar {
  margin-right: 0;
}
/* A feed card's name line is a block (its ellipsis needs it): the avatar sits centred on the line, 8 px before the
   badge or the name. */
.feed-row .feed-who > .avatar {
  margin-right: 8px;
  vertical-align: middle;
}
.feed-row .feed-who {
  line-height: 32px;
}
.feed-row.is-grouped .feed-who {
  line-height: 1.35;
}
/* Small margins in a pick: the picks keep their 6 px gap. A smaller circle (28 px) keeps the 48 px pick height. */
.pick > .avatar {
  width: 2.3334em;
  height: 2.3334em;
  margin-left: -4px;
  font-size: 12px;
}
/* Seguimento: the avatar in its own column, her name and its lines beside it. */
.track-who.has-avatar {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--s2);
  align-items: start;
}
.track-who.has-avatar > .avatar {
  grid-row: 1 / span 3;
}
.track-who.has-avatar > :not(.avatar) {
  grid-column: 2;
}
.search-hit-name {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}
.cust-name {
  align-items: center;
}
.sheet-who-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}
