/* Product shell: the frame around the work, page scaffolding, the overview, sign-in and loading.
   A sidebar on the left (navy in light, black in dark) with a lime edge on the active section, one
   top bar with search and the account, and a slide-over menu plus tab bar on small screens. */

.skip-link {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: #030126;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  height: 100svh;
  overflow: hidden;
  background: var(--canvas);
  transition: grid-template-columns var(--base) var(--ease-out);
}
.shell.collapsed {
  grid-template-columns: var(--rail-collapsed) minmax(0, 1fr);
}

/* ── Rail ──────────────────────────────────────────────────────────────── */
.rail {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--frame);
  color: var(--frame-ink);
  border-right: 1px solid var(--frame-line);
}
.rail :focus-visible {
  outline-color: var(--lime);
}
.rail-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  height: var(--topbar);
  padding: 0 18px;
  border-bottom: 1px solid var(--frame-line);
  box-shadow: inset 0 3px 0 var(--lime);
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border-radius: var(--radius-sm);
  color: #ffffff;
  text-decoration: none;
}
.rail-logo {
  display: block;
  flex: none;
  width: 64px;
  height: 22px;
  transition:
    width var(--base) var(--ease-out),
    height var(--base) var(--ease-out);
}
.rail-product {
  padding-left: 12px;
  border-left: 1px solid var(--frame-line);
  color: var(--frame-ink);
  font: 600 15px/1 var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rail-close {
  display: none;
  margin-left: auto;
}
.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 10px 10px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--frame-line) transparent;
}
.nav-section {
  display: grid;
  gap: 2px;
}
/* Group labels tell the daily work from the records and the setup. */
.nav-heading {
  display: block;
  margin: 16px 10px 6px;
  color: var(--frame-label);
  font: 600 11.5px/1 var(--font-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-section:first-child .nav-heading {
  margin-top: 6px;
}
.nav [data-view] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--frame-ink);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  transition:
    color var(--fast) var(--ease-out),
    background-color var(--fast) var(--ease-out);
}
.nav [data-view] svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  transition: transform var(--fast) var(--ease-out);
}
.nav [data-view]:hover {
  background: var(--frame-raised);
  color: #ffffff;
}
.nav [data-view]:active svg {
  transform: scale(0.9);
}
.nav [data-view].active {
  background: var(--frame-raised);
  color: #ffffff;
}
.nav [data-view].active svg {
  color: var(--lime);
  opacity: 1;
}
/* A 3px lime edge rather than a filled pill: the signal, not a fill. */
.nav [data-view].active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -10px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
  transform: translateY(-50%);
}
.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-count {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: #ff8a96;
  color: #000000;
  font: 700 11.5px/20px var(--font-body);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-count:empty {
  display: none;
}
/* Collapsed: icons only. Labels are hidden, not removed, so the reading order is the same. */
.collapsed .rail-head {
  justify-content: center;
  padding: 0;
}
.collapsed .rail-product,
.collapsed .nav-label,
.collapsed .nav-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.collapsed .rail-logo {
  width: 40px;
  height: 14px;
}
.collapsed .nav {
  align-items: center;
  gap: 4px;
  padding: 12px 0;
}
.collapsed .nav-section {
  justify-items: center;
  gap: 4px;
}
.collapsed .nav-section + .nav-section {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--frame-line);
}
.collapsed .nav [data-view] {
  justify-content: center;
  width: 44px;
  height: 42px;
  padding: 0;
}
.collapsed .nav [data-view].active::before {
  left: -12px;
}
.collapsed .nav-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
}
.rail-tip {
  position: fixed;
  z-index: 75;
  padding: 6px 10px;
  border: 1px solid var(--toast-line);
  border-radius: var(--radius-sm);
  background: var(--toast-bg);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  animation: fade-in var(--fast) var(--ease-out);
}
.rail-scrim {
  display: none;
}

/* ── Top bar ───────────────────────────────────────────────────────────── */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.topbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: var(--topbar);
  padding: 0 var(--gutter) 0 calc(var(--gutter) - 8px);
  border-bottom: 1px solid var(--rule);
  background: var(--canvas);
}
.topbar-burger,
.topbar-brand {
  display: none;
}
.topbar-spacer {
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topsearch {
  justify-content: flex-start;
  gap: 10px;
  width: min(380px, 40vw);
  min-height: 38px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 400;
}
.topsearch:hover:not(:disabled) {
  border-color: var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
}
.topsearch svg {
  width: 16px;
  height: 16px;
}
.topsearch span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The live connection, always visible: a desk that stopped updating must never look quiet. */
.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-right: 6px;
  padding: 0 11px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.conn .dot {
  width: 7px;
  height: 7px;
  background: var(--ink-4);
}
.conn.ok .dot {
  background: var(--success);
}
.conn.offline {
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
  background: var(--warning-bg);
  color: var(--warning-ink);
}
.conn.offline .dot {
  color: var(--warning);
  background: var(--warning);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
#notify-button {
  position: relative;
}
#notify-button.alerts-enabled {
  color: var(--ink);
}
.alert-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--canvas);
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #ffffff;
  font: 700 10px/13px var(--font-body);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .alert-count {
  color: #000000;
}
.account-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.account-trigger:hover:not(:disabled),
.account-trigger[aria-expanded="true"] {
  border: 0;
  background: var(--fill);
}
.account-trigger .avatar {
  width: 32px;
  height: 32px;
}

/* ── Content ───────────────────────────────────────────────────────────── */
#content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
  scrollbar-gutter: stable;
}
/* A new section eases in; live refreshes of the one on screen never replay it. */
#content.entering > .page,
#content.entering > .inbox {
  animation: page-in 0.36s var(--ease-out) both;
}
/* Reloading the section on screen keeps it in place, a little faded, once the wait is noticeable. */
#content.reloading > * {
  opacity: 0.6;
  transition: opacity var(--base) var(--ease-out) 0.12s;
}
.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 32px) var(--gutter) 56px;
}
.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}
.page-heading-copy {
  min-width: 0;
  max-width: 860px;
}
.page-heading .page-eyebrow {
  display: flex;
  margin-bottom: 10px;
}
.eyebrow-mark {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--frame) 18%, transparent);
}
.page-heading h1 {
  margin: 0;
  font: 700 clamp(28px, 2.6vw, 36px) / 1 var(--font-label);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.page-heading p {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.5;
  text-wrap: pretty;
}
.page-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.overview-date {
  display: grid;
  gap: 5px;
  text-align: right;
}
.overview-date span {
  color: var(--ink-3);
  font: 600 12px/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.overview-date strong {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}
/* Shaped like the page it stands in for, so nothing jumps when the data lands. */
.page-skeleton .skeleton {
  margin-bottom: 0;
}
.page-skeleton .sk-eyebrow {
  width: 120px;
  height: 12px;
  margin-bottom: 14px;
}
.page-skeleton .sk-title {
  width: min(420px, 70%);
  height: 34px;
  margin-bottom: 12px;
}
.page-skeleton .sk-lead {
  width: min(560px, 85%);
  height: 14px;
  margin-bottom: 28px;
}
.page-skeleton .sk-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.page-skeleton .sk-tile {
  height: 96px;
  border-radius: var(--radius-lg);
}
.page-skeleton .sk-block {
  height: 280px;
  border-radius: var(--radius-lg);
}

/* ── Route progress ────────────────────────────────────────────────────── */
/* A lime hairline across the top while a section loads; anything quicker than a blink never shows it. */
.route-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 450;
  height: 2px;
  pointer-events: none;
}
.route-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 2px 2px 0;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime-glow);
  opacity: 0;
}
.route-progress.running span {
  width: 86%;
  opacity: 1;
  transition:
    width 9s cubic-bezier(0.08, 0.75, 0.2, 1),
    opacity 0.15s var(--ease-out);
}
.route-progress.done span {
  width: 100%;
  opacity: 0;
  transition:
    width 0.22s var(--ease-out),
    opacity 0.3s var(--ease-out) 0.2s;
}

/* ── Overview tiles ("shelf labels") ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-tile {
  display: grid;
  align-content: start;
  justify-content: stretch;
  justify-items: stretch;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
button.stat-tile:hover:not(:disabled) {
  border-color: var(--rule-strong);
  background: var(--surface);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-label {
  color: var(--ink-3);
  font: 600 12.5px/1 var(--font-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.stat-icon {
  display: flex;
  color: var(--ink-4);
}
.stat-icon svg {
  width: 16px;
  height: 16px;
}
.stat-value {
  color: var(--ink);
  font: 700 38px/0.9 var(--font-label);
  font-variant-numeric: tabular-nums;
}
.stat-of {
  margin-left: 2px;
  color: var(--ink-3);
  font: 600 20px/1 var(--font-label);
}
.stat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stat-detail {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.stat-detail.warn {
  color: var(--warning-ink);
}
.stat-bottom svg {
  width: 15px;
  height: 15px;
  color: var(--ink-4);
  transition:
    transform var(--fast) var(--ease-out),
    color var(--fast) var(--ease-out);
}
button.stat-tile:hover .stat-bottom svg {
  color: var(--ink);
  transform: translateX(3px);
}
.stat-tile.tone-amber .stat-value,
.stat-tile.tone-amber .stat-icon {
  color: var(--warning-ink);
}
.stat-tile.tone-red .stat-value,
.stat-tile.tone-red .stat-icon {
  color: var(--danger);
}
.stat-tile.tone-green .stat-value,
.stat-tile.tone-green .stat-icon {
  color: var(--success);
}
.stat-tile.static {
  cursor: default;
}

/* ── Overview panels ───────────────────────────────────────────────────── */
.home-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}
.home-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.home-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
.home-panel-head h2 {
  margin: 0;
  font: 700 18px/1.1 var(--font-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-panel-kicker {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
}
.home-panel-head button {
  flex: none;
}
.home-list {
  display: grid;
}
.home-row {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
}
.home-row:last-child {
  border-bottom: 0;
}
.home-row:hover:not(:disabled) {
  border-color: var(--rule);
  background: var(--hover);
}
.home-row-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--fill);
  color: var(--ink-2);
  font: 700 11.5px/1 var(--font-body);
  letter-spacing: 0.02em;
}
.home-row-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.home-row-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-row-sub {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-row-side {
  display: grid;
  flex: none;
  justify-items: end;
  gap: 4px;
}
.home-row-time {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.home-row-arrow {
  display: flex;
  color: var(--ink-4);
  transition:
    transform var(--fast) var(--ease-out),
    color var(--fast) var(--ease-out);
}
.home-row:hover .home-row-arrow {
  color: var(--ink);
  transform: translateX(3px);
}
.home-row-arrow svg {
  width: 15px;
  height: 15px;
}
.home-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 220px;
  padding: 28px 24px;
  text-align: center;
}
.home-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--success-bg);
  color: var(--success);
}
.home-empty p {
  max-width: 300px;
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ── Loading cover ─────────────────────────────────────────────────────── */
.boot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  min-height: 100svh;
  background: var(--frame);
  color: var(--frame-ink);
}
.boot img {
  display: block;
  width: 118px;
  height: 40px;
}
.boot p {
  margin: 0;
  color: var(--frame-ink);
  font-size: 14px;
}
/* Suppy's loader: a barcode with a lime scan line sweeping it. */
.scan {
  position: relative;
  display: flex;
  gap: 3px;
  width: 188px;
  height: 46px;
}
.scan i {
  flex: 1 1 0;
  background: #ffffff;
  opacity: 0.92;
}
.scan i:nth-child(4n + 1) {
  flex-grow: 3;
}
.scan i:nth-child(5n + 3) {
  flex-grow: 4;
}
.scan i:nth-child(7n + 2) {
  flex-grow: 2;
}
.scan::after {
  content: "";
  position: absolute;
  top: 0;
  right: -10px;
  left: -10px;
  height: 2px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 14px 2px rgba(201, 255, 61, 0.75);
  animation: scan 1.3s ease-in-out infinite alternate;
}

/* ── Sign-in ───────────────────────────────────────────────────────────── */
.signin {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100svh;
  background: var(--canvas);
}
.signin-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  min-height: 100svh;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  background: var(--frame);
  color: #ffffff;
  box-shadow: inset 0 3px 0 var(--lime);
}
[data-theme="dark"] .signin-story {
  border-right: 1px solid var(--frame-line);
}
.signin-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.signin-brand img {
  display: block;
  width: 98px;
  height: auto;
}
.signin-brand span {
  padding-left: 18px;
  border-left: 1px solid var(--frame-line);
  color: var(--frame-ink);
  font: 600 16px/1.15 var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.signin-story .eyebrow {
  color: var(--frame-ink);
}
.signin-story h1 {
  max-width: 640px;
  margin: 20px 0 22px;
  color: #ffffff;
  font: 700 clamp(54px, 6.6vw, 100px) / 0.9 var(--font-label);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.signin-story h1 span {
  color: var(--lime);
}
.signin-story-copy p {
  max-width: 400px;
  margin: 0;
  color: var(--frame-ink);
  font-size: 15px;
  line-height: 1.6;
}
.signin-barcode {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 64px;
  color: var(--lime);
}
.signin-barcode rect {
  fill: currentColor;
  stroke: none;
}
.signin-captions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 600px;
  margin-top: 14px;
  color: var(--frame-ink);
  font: 600 12px/1 var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.signin-side {
  display: grid;
  place-items: center;
  padding: 40px 28px;
}
.signin-card {
  width: min(100%, 400px);
  animation: page-in 0.4s var(--ease-out) both;
}
.signin-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.signin-lock svg {
  width: 15px;
  height: 15px;
}
.signin-card h2 {
  margin: 18px 0 10px;
  font-size: clamp(40px, 4vw, 50px);
  line-height: 1;
}
.signin-card > p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}
.signin-card form {
  gap: 16px;
  margin-top: 28px;
}
.signin-card input {
  min-height: 48px;
  font-size: 15px;
}
.signin-card .primary {
  justify-content: space-between;
  min-height: 50px;
  margin-top: 6px;
  padding: 0 18px;
  font-size: 15px;
}
.signin-card .primary svg {
  color: var(--lime);
}
[data-theme="dark"] .signin-card .primary svg {
  color: inherit;
}
.signin-foot {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
}
.signin-foot svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

/* ── Tab bar (small screens) ───────────────────────────────────────────── */
.tabbar {
  display: none;
}

/* ── Responsive shell ──────────────────────────────────────────────────── */
@media (max-height: 820px) and (min-width: 961px) {
  .nav [data-view] {
    min-height: 34px;
  }
  .nav-heading {
    margin: 12px 10px 5px;
  }
}
@media (max-width: 1200px) {
  .home-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .shell,
  .shell.collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The rail becomes a slide-over that always shows its labels. */
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 300px);
    box-shadow: var(--shadow-lg);
    transform: translateX(-101%);
    visibility: hidden;
    transition:
      transform var(--base) var(--ease-out),
      visibility 0s linear var(--base);
  }
  .rail-open .rail {
    transform: none;
    visibility: visible;
    transition: transform var(--base) var(--ease-out);
  }
  .rail-close {
    display: inline-flex;
    color: var(--frame-ink);
  }
  .rail-close:hover:not(:disabled) {
    background: var(--frame-raised);
    color: #ffffff;
  }
  .rail-open .rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: var(--scrim);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: fade-in var(--fast) var(--ease-out) both;
  }
  .collapsed .rail-head {
    justify-content: flex-start;
    padding: 0 10px 0 18px;
  }
  .collapsed .rail-product,
  .collapsed .nav-label,
  .collapsed .nav-heading {
    position: static;
    width: auto;
    height: auto;
    overflow: hidden;
    clip: auto;
  }
  .collapsed .rail-logo {
    width: 64px;
    height: 22px;
  }
  .collapsed .nav {
    align-items: stretch;
    gap: 2px;
    padding: 10px 10px 18px;
  }
  .collapsed .nav-section {
    justify-items: stretch;
    gap: 2px;
  }
  .collapsed .nav-section + .nav-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .collapsed .nav [data-view] {
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 0 10px;
  }
  .collapsed .nav [data-view].active::before {
    left: -10px;
  }
  .collapsed .nav-count {
    position: static;
    min-width: 20px;
    height: 20px;
    font-size: 11.5px;
    line-height: 20px;
  }
  .nav [data-view] {
    min-height: 44px;
  }
  /* The top bar joins the frame: black or navy, with the lime hairline. */
  .topbar {
    gap: 6px;
    padding: 0 8px 0 6px;
    border-bottom-color: var(--frame-line);
    background: var(--frame);
    color: #ffffff;
    box-shadow: inset 0 3px 0 var(--lime);
  }
  .topbar :focus-visible {
    outline-color: var(--lime);
  }
  .topbar-burger {
    display: inline-flex;
  }
  .topbar-collapse {
    display: none;
  }
  .topbar button.quiet {
    color: var(--frame-ink);
  }
  .topbar button.quiet:hover:not(:disabled) {
    background: var(--frame-raised);
    color: #ffffff;
  }
  .topbar-brand {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
  }
  .topbar-brand img {
    display: block;
    width: 56px;
    height: 19px;
  }
  .topsearch {
    flex: 1;
    width: auto;
    min-width: 0;
    margin-left: 4px;
    border-color: var(--frame-line);
    background: var(--frame-raised);
    color: var(--frame-ink);
  }
  .topsearch:hover:not(:disabled) {
    border-color: var(--frame-line);
    background: var(--frame-hover);
    color: #ffffff;
  }
  .topsearch kbd,
  .topbar-spacer {
    display: none;
  }
  .conn {
    width: 34px;
    min-height: 34px;
    margin-right: 0;
    padding: 0;
    justify-content: center;
    border-color: var(--frame-line);
    background: var(--frame-raised);
  }
  .conn.offline {
    border-color: #ffc93d;
    background: #33290a;
  }
  .conn > span:not(.dot) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .alert-count {
    border-color: var(--frame);
  }
  .account-trigger:hover:not(:disabled),
  .account-trigger[aria-expanded="true"] {
    background: var(--frame-raised);
  }
  .account-trigger .avatar {
    background: var(--lime);
    color: #000000;
  }
  .tabbar {
    display: grid;
    flex: none;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    min-height: var(--tabbar);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule);
    background: var(--surface);
  }
  .tabbar a,
  .tabbar button {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    min-height: 48px;
    padding: 6px 4px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
  }
  .tabbar a:hover,
  .tabbar button:hover:not(:disabled) {
    background: transparent;
    color: var(--ink);
  }
  .tabbar .active,
  .tabbar a.active:hover {
    background: var(--fill);
    color: var(--ink);
  }
  .tabbar svg {
    width: 21px;
    height: 21px;
  }
  .tabbar .nav-count {
    position: absolute;
    top: 3px;
    left: calc(50% + 6px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 17px;
  }
  .page {
    padding-top: 18px;
    padding-bottom: 32px;
  }
  .page-heading {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions {
    width: 100%;
  }
  .overview-date {
    text-align: left;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-value {
    font-size: 32px;
  }
  .signin {
    grid-template-columns: minmax(0, 1fr);
  }
  .signin-story {
    min-height: auto;
    gap: 28px;
    padding: 28px 24px 30px;
  }
  .signin-story h1 {
    margin: 14px 0 0;
    font-size: clamp(44px, 12vw, 64px);
  }
  .signin-story-copy p,
  .signin-story-foot {
    display: none;
  }
  .signin-side {
    padding: 32px 22px 44px;
  }
}
@media (max-width: 760px) {
  .home-columns,
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-panel-head {
    padding: 12px 14px;
  }
  .home-row {
    padding: 10px 14px;
  }
  .home-row-arrow {
    display: none;
  }
  .home-row-side .badge {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stat-tile {
    padding: 12px 14px;
  }
}
@media (max-width: 600px) {
  /* On a phone the theme lives in the account menu, leaving room for search. */
  #theme-button {
    display: none;
  }
}
@media (max-width: 420px) {
  .page-heading h1 {
    font-size: 28px;
  }
  .topbar-brand img {
    width: 48px;
    height: 16px;
  }
}

/* Performance: reply coverage uses the same outcome colours as the daily chart. */
.perf-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.perf-panel-caption {
  color: var(--ink-3);
  font-size: 11px;
  text-align: right;
}
.perf-coverage {
  display: grid;
  gap: 20px;
  padding: 22px 20px;
}
.perf-coverage > p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.perf-coverage > svg {
  display: block;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: var(--radius-xs);
}
.perf-coverage rect {
  stroke: none;
}
.perf-coverage rect.on-time {
  fill: var(--success);
}
.perf-coverage rect.late {
  fill: var(--warning);
}
.perf-coverage rect.waiting {
  fill: color-mix(in srgb, var(--danger) 75%, transparent);
}
.perf-coverage-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.perf-coverage-values > div {
  display: grid;
  gap: 7px;
}
.perf-coverage-values strong {
  font: 700 32px/1 var(--font-label);
  font-variant-numeric: tabular-nums;
}
.perf-coverage-values small {
  margin-left: 3px;
  color: var(--ink-3);
  font: 500 12px var(--font-body);
}
.perf-coverage-values span {
  color: var(--ink-2);
  font-size: 12px;
}
.perf-follow-up {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.perf-follow-up + .perf-follow-up {
  border-top: 1px solid var(--rule);
}
.perf-follow-up > strong {
  min-width: 34px;
  font: 700 28px/1 var(--font-label);
  font-variant-numeric: tabular-nums;
}
.perf-follow-up.has-work > strong {
  color: var(--warning-ink);
}
.perf-follow-up > div {
  display: grid;
  flex: 1;
  gap: 4px;
}
.perf-follow-up span {
  font-size: 12.5px;
  font-weight: 600;
}
.perf-follow-up small {
  color: var(--ink-3);
  font-size: 11px;
}
.perf-comparison-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 14px;
}
.perf-comparison-head .section-head {
  margin: 0 0 7px;
}
.perf-comparison-head p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}
.perf-comparison-head label {
  display: grid;
  flex: none;
  gap: 6px;
  color: var(--ink-3);
  font-size: 12px;
}
.perf-comparison-head select {
  min-width: 180px;
}
.perf-unanswered {
  color: var(--danger-ink);
  font-weight: 700;
}
.perf-definitions {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.perf-definitions summary {
  width: fit-content;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.perf-definitions dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
  margin: 22px 0 0;
}
.perf-definitions dt {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}
.perf-definitions dd {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
}
@media (max-width: 1100px) {
  .perf-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .perf-comparison-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .perf-definitions dl {
    grid-template-columns: minmax(0, 1fr);
  }
  .perf-coverage-values strong {
    font-size: 27px;
  }
  .perf-coverage-values small {
    display: block;
    margin: 5px 0 0;
  }
}
