/* Tenant dashboard prototype (task 0015). Tokens only: every color comes
   from packages/ui/src/theme/tokens.css or the tenant theme. Soft tints are
   mixed from the tokens, as in the checklist. */

:root {
  --ok-soft: color-mix(in srgb, var(--ok) 14%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 14%, var(--surface));
  --bad-soft: color-mix(in srgb, var(--bad) 8%, var(--surface));
  --bad-line: color-mix(in srgb, var(--bad) 45%, var(--line));
  --warn-line: color-mix(in srgb, var(--warn) 45%, var(--line));
  --rail: 216px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  transition: background-color 350ms ease, color 350ms ease;
}
h1, h2, p, ol, ul, figure { margin: 0; }
p { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.sprite { position: absolute; }
.skip {
  position: absolute; z-index: 30; left: var(--s3); top: var(--s3); transform: translateY(-200%);
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s4);
  background: var(--surface); color: var(--text); border: 1px solid var(--text-2); border-radius: var(--radius-sm);
}
.skip:focus { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 16px; height: 16px; }

/* ── Prototype bar (review chrome, not product) ─────────────────── */
.pb {
  border-bottom: 1px dashed var(--muted);
  background: var(--surface-2);
  padding: 0 var(--gutter);
  font-family: system-ui, sans-serif;
  font-size: 13px;
}
/* Collapsed by default: one line, so the demo opens on the product. */
.pb__sum {
  display: flex; align-items: center; gap: var(--s3); min-height: var(--tap);
  cursor: pointer; list-style: none; color: var(--text-2);
}
.pb__sum::-webkit-details-marker { display: none; }
.pb__tag {
  padding: 2px var(--s2); border: 1px dashed var(--muted); border-radius: var(--radius-sm);
  color: var(--text); font-size: 12px; letter-spacing: 0.04em;
}
.pb__now { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb__cta { display: inline-flex; align-items: center; gap: var(--s1); color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px; white-space: nowrap; }
.pb__sum:hover .pb__cta { text-decoration-color: var(--text); }
.pb__chev { transition: transform 150ms ease; }
.pb__box[open] .pb__chev { transform: rotate(180deg); }
.pb__title { color: var(--text-2); margin: var(--s1) 0 var(--s2); }
.pb__fields { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding-bottom: var(--s3); }
.pb__field { display: grid; gap: 2px; color: var(--muted); }
.pb__field select {
  min-height: var(--tap); padding: 0 var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text);
}

/* ── Header ──────────────────────────────────────────────────────── */
.topbar { background: var(--header); color: var(--on-header); }
.topbar__in {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 64px; padding: var(--s2) var(--gutter);
}
.brand { position: relative; min-width: 0; }
.brand__btn, .brand__static {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--tap); padding: 0 var(--s2) 0 0;
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--on-header);
}
.brand__static { cursor: default; }
.brand__name { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid currentColor; font-family: var(--font-display); font-size: 15px; line-height: 1;
}
.logo--sm { width: 24px; height: 24px; font-size: 13px; }
/* Bloom's mark is tall (41:89): 28 px high fills the header slot. */
.logo-mark { flex: none; height: 28px; width: calc(28px * 41 / 89); fill: currentColor; }
.logo-mark--sm { height: 22px; width: calc(22px * 41 / 89); margin: 0 6px; }
.topbar__tools { display: flex; align-items: center; gap: var(--s2); }
.icon-btn, .user__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-width: var(--tap); min-height: var(--tap); padding: 0 var(--s2);
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--on-header);
  transition: border-color 150ms ease;
}
.icon-btn:hover, .user__btn:hover, .brand__btn:hover { border-color: color-mix(in srgb, var(--on-header) 30%, transparent); }
.brand__btn { border: 1px solid transparent; padding-left: var(--s2); margin-left: calc(var(--s2) * -1); }
.user { position: relative; }
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: color-mix(in srgb, var(--on-header) 14%, var(--header)); font-size: 13px; letter-spacing: 0.04em;
}
.user__text { display: grid; text-align: left; line-height: 1.2; }
.user__name { font-size: 14px; }
.user__role { font-size: 12px; color: color-mix(in srgb, var(--on-header) 78%, var(--header)); }

.menu {
  position: absolute; z-index: 10; top: calc(100% + 6px); min-width: 240px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--header) 70%, transparent);
  padding: var(--s2);
}
.menu--tenant { left: 0; }
.menu--user { right: 0; }
.menu__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: var(--s2) var(--s2) var(--s1); }
.menu__item {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  min-height: var(--tap); padding: 0 var(--s2);
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; text-align: left; text-decoration: none;
}
.menu__item:hover { background: var(--surface-2); }
.menu__item[aria-current="true"] { background: var(--surface-2); }
.menu__label { flex: 1; }
.menu__tick { color: var(--ok); }
.search {
  display: flex; align-items: center; gap: var(--s2); margin: var(--s1) 0 var(--s2);
  padding: 0 var(--s3); min-height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); min-height: 42px; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--text-2); }

.readonly { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.readonly__in {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s2) var(--gutter); font-size: 14px; color: var(--text-2);
}
.readonly__in p { flex: 1 1 260px; }
.readonly strong { color: var(--text); font-weight: 400; }

/* ── Shell ───────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: calc(100vh - 64px); }
.rail { border-right: 1px solid var(--line); padding: var(--s5) var(--s3); background: var(--bg); }
.rail__list { display: grid; gap: var(--s1); }
.rail__item {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--tap); padding: 0 var(--s3);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text-2);
  transition: background-color 150ms ease;
}
.rail__sep { height: 1px; margin: var(--s3) var(--s3); background: var(--line); }
.rail__item:hover { background: var(--surface); color: var(--text); }
.rail__item[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.rail__soon { margin: var(--s5) var(--s3) 0; padding-top: var(--s4); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.rail__soon-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s2); }
.rail__soon li { line-height: 1.8; }

.main { padding: var(--s6) var(--s6) var(--s7); max-width: calc(var(--max) + 2 * var(--s6)); width: 100%; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
h1 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: 0.01em; }
.pagehead__meta { margin-top: var(--s1); color: var(--muted); font-size: 14px; }
.pagehead__glance { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); color: var(--text-2); font-size: 14px; }
.pagehead__glance .ic { color: var(--green); }
/* Wide screens show Hoy in the first viewport, so the line would repeat it. */
@media (min-width: 1100px) { .pagehead__glance { display: none; } }
.scope { display: inline-flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 14px; }
.scope strong { color: var(--text); font-weight: 400; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg__opt {
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--s4);
  background: none; border: 1px solid transparent; border-radius: 9px; cursor: pointer; color: var(--text-2);
  transition: background-color 150ms ease;
}
.seg__opt:hover { color: var(--text); }
.seg__opt[aria-checked="true"] { background: var(--surface-2); border-color: var(--text-2); color: var(--text); }

/* ── Grid of sections ───────────────────────────────────────────── */
.grid {
  display: grid; gap: var(--s4);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas: "atencion atencion" "hoy ochenta" "reporte reporte";
  align-items: start;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); min-width: 0; }
.card--atencion { grid-area: atencion; }
.card--hoy { grid-area: hoy; }
.card--ochenta { grid-area: ochenta; }
.card--reporte { grid-area: reporte; }
h2 { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.25; margin-bottom: var(--s4); }
.count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-family: var(--font-body); font-size: 13px;
}

/* ── Tags (state needs icon and word) ───────────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.3; color: var(--text-2); }
.tag--ok { color: var(--ok); }
.tag--warn { color: var(--warn); }
.tag--bad { color: var(--bad); }
.tag--live { color: var(--text); }
.tag--muted { color: var(--muted); }
.tag--inline { margin-left: var(--s2); font-size: 12px; }

/* ── Buttons and links ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--s4);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn:hover { border-color: var(--text-2); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); border-color: transparent; }
.btn--quiet { background: transparent; }
.link {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); min-width: var(--tap);
  color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px;
}
.link:hover { text-decoration-color: var(--text); }
.link--block { margin-top: var(--s2); }
.more { display: inline-flex; min-height: var(--tap); align-items: center; margin-top: var(--s2); text-underline-offset: 4px; }
button.more { padding: 0; background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--muted); }
.more--phone { display: none; }

/* ── Atención ───────────────────────────────────────────────────── */
.alerts { display: grid; gap: var(--s2); }
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3) var(--s4);
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
}
.alert--urgent { background: var(--bad-soft); border-color: var(--bad-line); }
.alert--review { background: var(--surface); }
.alert__icon { align-self: start; }
.alert--urgent .alert__icon, .alert--urgent .alert__level { color: var(--bad); }
.alert--review .alert__icon, .alert--review .alert__level { color: var(--warn); }
.alert__title { font-size: 16px; color: var(--text); }
.alert__meta { font-size: 13px; color: var(--text-2); }
.alert__who { font-size: 13px; color: var(--muted); }
.calm { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); }
.calm .ic { color: var(--ok); flex: none; }
.calm--closed { align-items: flex-start; }
.calm--closed .ic { color: var(--muted); }

.lead { color: var(--text-2); max-width: 62ch; margin-bottom: var(--s4); }
.steps { display: grid; gap: var(--s4) var(--s5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { display: flex; gap: var(--s3); align-items: flex-start; }
.step .ic { color: var(--muted); margin-top: 1px; }
.step--done .ic { color: var(--ok); }
.step__title { color: var(--text); }
.step__who { font-size: 13px; color: var(--muted); }

/* ── Hoy por área ───────────────────────────────────────────────── */
.today { width: 100%; border-collapse: collapse; }
.today thead th { font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: left; padding: 0 var(--s3) var(--s2); }
.today thead th:first-child { padding-left: 0; }
.row > * { padding: var(--s4) var(--s3); border-top: 1px solid var(--line); vertical-align: top; text-align: left; }
.row > :first-child { padding-left: 0; }
.row > :last-child { padding-right: 0; }
.row__area { font-weight: 400; font-size: 16px; padding-top: calc(var(--s4) + 2px); white-space: nowrap; }
.row__hours { display: flex; align-items: center; gap: 6px; margin-top: var(--s1); font-size: 13px; color: var(--muted); }
.row__go { text-align: right; white-space: nowrap; }
.row__go .link { margin-top: -10px; }
.row__none { color: var(--muted); }
.row__hint { display: block; font-size: 13px; }

.today--single thead th:first-child, .today--single .row__area { display: none; }
.today--single thead th:nth-child(2), .today--single .row > :nth-child(2) { padding-left: 0; }
.shift {
  display: grid; gap: var(--s2); min-width: 150px; margin: calc(var(--s2) * -1); padding: var(--s2);
  border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; color: inherit;
  transition: border-color 150ms ease;
}
.shift:hover { border-color: var(--line); background: var(--surface-2); }
.strip { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
/* Pending segments mixed from --muted so they stay >= 3:1 on the surface. */
.seg-t { flex: 1 1 0; min-width: 3px; height: 12px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 72%, var(--surface)); }
.seg-t--d { background: var(--green); }
.seg-t--c { height: 22px; }
.strip--ended .seg-t--c:not(.seg-t--d) { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad); }
.shift__line { display: flex; justify-content: space-between; align-items: center; gap: var(--s1) var(--s3); flex-wrap: wrap; }
.shift__line .tag { white-space: nowrap; }
.shift__n { font-size: 13px; color: var(--muted); }

.legend { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); font-size: 13px; color: var(--muted); }
.legend__i { display: inline-flex; align-items: flex-end; gap: 6px; }
.legend .seg-t { display: inline-block; width: 8px; flex: none; }

/* ── 86 activo ──────────────────────────────────────────────────── */
.sold { display: grid; }
.sold__item { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.sold__item:first-child { border-top: 0; padding-top: 0; }
.sold__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.sold__name { font-size: 16px; }
.sold__kind { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sold__reason { color: var(--text-2); font-size: 14px; }
.sold__meta { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s1); font-size: 13px; color: var(--muted); }

/* ── Reporte semanal ────────────────────────────────────────────── */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.tab {
  min-height: var(--tap); padding: 0 var(--s4); margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-2);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }

.report { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--s6); }
.report__week { color: var(--muted); font-size: 14px; }
.report__kpi { margin: var(--s1) 0 var(--s3); color: var(--text-2); font-size: 14px; }
.report__kpi strong { display: block; font-weight: 400; font-family: var(--font-display); font-size: 22px; line-height: 1.25; color: var(--text); }
.report__text { color: var(--text-2); max-width: 62ch; }
.report__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); font-size: 13px; color: var(--muted); }
.report__foot .link { font-size: 15px; }

.trend figcaption, .omitted__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: var(--s3); }
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); align-items: end; }
.bar { display: grid; justify-items: center; gap: 6px; }
.bar__v { font-size: 13px; color: var(--text-2); }
.bar__track { position: relative; display: block; width: 100%; max-width: 36px; height: 120px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar__fill { position: absolute; inset: auto 0 0; background: var(--green); border-radius: 4px 4px 0 0; }
.bar--partial .bar__fill { background: transparent; box-shadow: inset 0 0 0 1.5px var(--green); }
/* Three label lines for every bar (range, month, "en curso"), so tracks share one baseline and a
   partial week never looks taller than a full one. */
.bar__w { display: grid; justify-items: center; align-content: start; min-height: calc(3 * 1.3em); font-size: 12px; color: var(--muted); line-height: 1.3; }
.bar__note { font-size: 12px; }

.omitted__list { display: grid; }
.omitted__list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.omitted__list li:first-child { border-top: 0; padding-top: 0; }
.omitted__name { color: var(--text); }
.omitted__n { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ── Empty, error, loading ──────────────────────────────────────── */
.empty { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-2); max-width: 62ch; }
.empty .ic { color: var(--muted); margin-top: 1px; }
/* A load failure is not an operational emergency: no tinted box. */
.error { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); }
.error > .ic { color: var(--warn); margin-top: 1px; }
.error .btn { grid-column: 2; justify-self: start; }
.error__title { color: var(--text); }
.error__body { font-size: 13px; color: var(--text-2); }
.skel-wrap { display: grid; gap: var(--s2); }
.skel { display: block; border-radius: var(--radius-sm); background: var(--surface-2); }
.skel--alert { height: 72px; }
.skel--row { height: 76px; }
.skel--line { height: 56px; }
.skel--report { height: 200px; }

/* ── Tablet ─────────────────────────────────────────────────────── */
@media (max-width: 1099px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "atencion" "hoy" "ochenta" "reporte"; }
  .report { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
  .report__summary { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: var(--s5) var(--s5) var(--s7); }
}
@media (max-width: 899px) {
  :root { --rail: 88px; }
  .rail { padding: var(--s4) var(--s2); }
  .rail__item { flex-direction: column; justify-content: center; gap: 2px; padding: var(--s2) 0; font-size: 12px; min-height: 56px; text-align: center; }
  /* README § 10.2: the roadmap stays visible, compact, on the icon rail. */
  .rail__soon { margin: var(--s4) 0 0; padding-top: var(--s3); font-size: 12px; text-align: center; }
  .rail__soon-title { font-size: 11px; letter-spacing: 0.04em; }
  .rail__soon li { line-height: 1.6; }
  .user__text { display: none; }
}

/* ── Phone ──────────────────────────────────────────────────────── */
@media (max-width: 719px) {
  .topbar__in { min-height: 56px; }
  .shell { display: block; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s2) var(--gutter); }
  .rail__list { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .rail__sep { display: none; }
  /* Phone: the roadmap is one muted line under the nav row. */
  .rail__soon { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 var(--s2); margin: var(--s1) 0 0; padding: var(--s1) 0 0; border-top: 0; }
  .rail__soon-title { margin: 0; }
  .rail__soon ul { display: flex; flex-wrap: wrap; }
  .rail__soon li + li::before { content: "·"; padding: 0 6px; }
  .rail__item { flex-direction: column; justify-content: center; min-height: 52px; padding: 0; font-size: 12px; gap: 0; }
  .row__hours { margin-top: 0; }
  .main { padding: var(--s5) var(--gutter) var(--s7); }
  h1 { font-size: 24px; }
  .pagehead { margin-bottom: var(--s4); }
  .seg { width: 100%; }
  .seg__opt { flex: 1; padding: 0 var(--s2); }
  .card { padding: var(--s4); }
  .grid { gap: var(--s3); }

  .alert { grid-template-columns: auto minmax(0, 1fr); }
  .alert .btn { grid-column: 2; justify-self: start; }
  /* Phone: two alerts, then "Ver las N alertas", so Hoy and its strips
     reach the first screens (README § 10.1 order kept). */
  .alerts:not(.alerts--open) .alert:nth-child(n+3) { display: none; }
  .more--phone:not([hidden]) { display: inline-flex; }
  .alerts:not(.alerts--open) ~ a.more { display: none; }
  /* Phone: only the first alert keeps a button; the rest act through a
     link, so the first screen is not a stack of boxes. */
  .alert { padding: var(--s3); gap: var(--s1) var(--s3); }
  .alert .btn--quiet {
    min-height: var(--tap); margin: calc(var(--s2) * -1) 0; padding: 0; border: 0; background: none;
    text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px;
  }

  .today thead { display: none; }
  .today, .today tbody, .row, .row > * { display: block; }
  .row { padding: var(--s4) 0; border-top: 1px solid var(--line); position: relative; }
  .row:first-child { border-top: 0; padding-top: 0; }
  .row > * { border-top: 0; padding: 0; }
  .row__area { padding: 0 0 var(--s3); font-size: 17px; }
  .row > td[data-label] { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); align-items: start; margin-bottom: var(--s3); }
  .row > td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); padding-top: 4px; }
  .row > td[data-label="Turno AM"]::before { content: "AM"; }
  .row > td[data-label="Turno PM"]::before { content: "PM"; }
  .row__go { position: absolute; top: var(--s4); right: 0; }
  .row:first-child .row__go { top: 0; }
  .today--single .row__go { position: static; text-align: left; }
  .today--single .row__go .link { margin-top: 0; }
  .row__go .link { margin-top: -12px; }
  .row--none .row__none { padding-bottom: var(--s1); }
  .shift { min-width: 0; }

  .report { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .pb__now { display: none; }
  .pb__cta { margin-left: auto; }
  .bar__track { height: 96px; }
  .topbar .brand__name { font-size: 18px; }
}

/* Prototype-only toast with the link target. */
.toast {
  position: fixed; z-index: 20; left: 50%; bottom: var(--s5); transform: translateX(-50%);
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  padding: var(--s3) var(--s4); border: 1px dashed var(--muted); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-family: system-ui, sans-serif; font-size: 13px;
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--header) 70%, transparent);
}
.toast strong { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
