/* Layout for this app only. Colors, type and components come from ui-kit.css. */
/* Safari on iPhone zooms the page when a focused field's text is under 16px. */
@media (pointer: coarse) { .mos-input, .mos-select { font-size: 16px; } }

/* Hub Tray Ledger (DesignSystemAgent templates/hub-tray-ledger.html, Miguel's pick 2026-11-26).
   The template's inline styles are the o1-meta … o1-w* classes here: the CSP allows no inline style. */
.o1-main { min-height: 100dvh; display: flex; flex-direction: column; }
.o1-page { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.o1-main:has(.o1-upnext, .o1-sticky-bar) .o1-page { padding-bottom: 84px; }
.o1-page-narrow { max-width: 440px; }
.o1-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; padding-top: max(var(--space-2), env(safe-area-inset-top)); }
.brand-mark { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink-primary); }
.brand-orb { width: 26px; height: 26px; }
.brand-name { font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-heading); color: var(--ink-primary); }
.tap-btn { min-height: 44px; min-width: 44px; align-self: center; }
.back-link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; min-width: 44px; padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-2)); align-self: center; font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; color: var(--ink-secondary); text-decoration: none; border-radius: var(--radius-control); transition: color var(--duration-fast) var(--ease-standard); }
.back-link:hover { color: var(--ink-primary); text-decoration: underline; text-underline-offset: 3px; }
.back-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cta-btn { min-height: 48px; min-width: 44px; font-size: var(--text-base); font-weight: 600; align-self: stretch; }
.num-input { min-height: 44px; min-width: 0; font-size: 16px; font-variant-numeric: tabular-nums; text-align: center; padding: var(--space-2) var(--space-1); }
.num-input-left { text-align: left; padding-left: var(--space-3); }
.edit-link { min-height: 44px; min-width: 44px; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 500; }
.edit-link:hover { color: var(--ink-primary); }
.icon-well-amber { background-color: var(--accent-amber-soft); color: var(--accent-amber-ink); }
.tag-ico { gap: var(--space-1); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.o1-meta { font-size: var(--text-xs); }
.o1-target { color: var(--ink-secondary); }
.o1-meta-sans { font-size: var(--text-xs); }
.o1-small { font-size: var(--text-sm); }
.o1-strong { font-weight: 600; }
.o1-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.o1-tray-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.o1-tray-title > h2 { margin: 0; }
.o1-tray-flush { gap: 0; }
.o1-tile-head { padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: 1px solid var(--divider); }
.o1-tile-foot { padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.o1-sub { padding: 0 var(--space-2) var(--space-1); }
.o1-module-row { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--ink-primary); transition: background-color var(--motion-fast) var(--ease-standard); }
.o1-module-row:hover { background-color: var(--surface-subtle); }
.o1-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.o1-grow > h2, .o1-grow > h3 { margin: 0; }
.o1-routine-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.o1-ex-list { display: flex; flex-direction: column; }
.o1-ex-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.o1-ex-row:last-child { border-bottom: none; }
.o1-code { min-width: 34px; justify-content: center; flex-shrink: 0; }
.o1-day-row, .o1-resume-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.o1-day-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); flex-shrink: 0; }
.o1-session-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (min-width: 760px) {
  .o1-routine-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .o1-session-grid { grid-template-columns: minmax(0, 1.48fr) minmax(0, 0.92fr); }
}
/* One side missing (rest day, no other days, finished workout): one column. */
.o1-routine-grid > :only-child, .o1-session-grid > :only-child { grid-column: 1 / -1; }
.o1-timer-strip { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.o1-timer { font-family: var(--font-mono); font-size: 32px; font-weight: 600; line-height: 1.05; letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; color: var(--ink-primary); }
/* One exercise: a tray (a finished one) or a tray that folds to its header (no JS needed). */
.o1-ex { display: block; scroll-margin-top: var(--space-4); }
.o1-ex > * + * { margin-top: var(--tile-gap); }
.o1-ex h2 { margin: 0; }
.o1-fold > summary { list-style: none; cursor: pointer; min-height: 44px; border-radius: var(--radius-tile); transition: background-color var(--motion-fast) var(--ease-standard); }
.o1-fold > summary::-webkit-details-marker { display: none; }
.o1-fold > summary:hover { background-color: var(--surface-subtle); }
.o1-fold > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.o1-fold > summary > .o1-tray-title { flex: 1; }
/* The chevron is a mask, so it takes the ink token instead of a colour in the SVG. */
.o1-fold > summary::after { content: ""; width: 12px; height: 12px; flex-shrink: 0; background-color: var(--ink-muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.2 6.2L8 10l3.8-3.8'/%3E%3C/svg%3E") center / 12px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.2 6.2L8 10l3.8-3.8'/%3E%3C/svg%3E") center / 12px no-repeat; transition: transform var(--duration-base) var(--ease-standard); }
.o1-fold[open] > summary::after { transform: rotate(180deg); }
.o1-col-head { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.85fr) 68px; gap: 6px; padding: 0 var(--space-3); align-items: center; }
.o1-col-head-timed { grid-template-columns: 20px minmax(0, 1fr) 68px; }
.o1-col-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--tracking-mono-label); color: var(--ink-secondary); text-align: center; }
.o1-col-label-left { text-align: left; padding-left: var(--space-2); }
.o1-set-tile { padding: var(--space-2) var(--space-3); border: 1.5px solid transparent; display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.85fr) 68px; gap: 6px; align-items: center; scroll-margin-top: var(--space-4); scroll-margin-bottom: 120px; }
.o1-set-tile-timed { grid-template-columns: 20px minmax(0, 1fr) 68px; }
.o1-set-active { border-color: var(--accent-cobalt); }
.o1-set-saved { background-color: var(--surface-subtle); }
.o1-set-num { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--ink-muted); text-align: center; }
.o1-set-active .o1-set-num { color: var(--accent-cobalt-ink); }
.o1-set-tile .mos-input, .o1-edit-tile .mos-input { min-width: 0; background-color: var(--surface-subtle); border-color: transparent; }
.o1-set-tile .mos-input:focus, .o1-edit-tile .mos-input:focus { background-color: var(--surface-card); border-color: var(--accent-cobalt); }
.o1-set-tile .mos-input-error, .o1-set-tile .mos-input-error:focus, .o1-edit-tile .mos-input-error, .o1-edit-tile .mos-input-error:focus { background-color: var(--surface-card); border-color: var(--accent-magenta); }
.o1-set-saved .mos-input { background-color: var(--surface-card); color: var(--ink-secondary); }
.o1-set-btn { width: 58px; min-height: 44px; padding: 0 var(--space-2); align-self: center; }
.o1-set-tile .o1-set-btn { width: 68px; justify-self: end; }
.o1-saved-btn { background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); border-color: transparent; }
.o1-saved-btn:hover { border-color: var(--accent-cobalt); }
.o1-set-err { grid-column: 1 / -1; margin: 0; }
/* Saving & failed row states + Finish draining state (Round 1 pick: Split Dock Ledger). */
form[data-state="saving"].o1-set-tile { border-color: var(--accent-cobalt); background-color: var(--surface-card); }
form[data-state="saving"] [data-set-submit] { background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); border-color: transparent; }
form[data-state="failed"].o1-set-tile { border-color: var(--accent-magenta); background-color: var(--surface-card); }
form[data-state="failed"] .o1-set-num { color: var(--accent-magenta-ink); }
form[data-state="failed"] [data-set-submit] { background-color: var(--accent-magenta-soft); color: var(--accent-magenta-ink); border-color: transparent; font-weight: 600; }
#finish[data-state="saving"] button { background-color: var(--surface-subtle); border-color: var(--border-default); color: var(--ink-secondary); opacity: 1; }
#finish[data-state="saving"] button::before { content: ""; width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent-cobalt); border-radius: 50%; animation: mos-spin 0.7s linear infinite; }
/* Timed set row: single-line inline controls that fit 375px without wrapping. */
.o1-timed-main { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: nowrap; }
.o1-timed-main .mos-input { flex: 1 1 56px; min-width: 52px; padding: var(--space-2) var(--space-2); }
.o1-timer-btn { min-height: 44px; min-width: 54px; padding: 0 var(--space-2); flex-shrink: 0; }
.o1-timer-btn[aria-pressed="true"] { background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); border-color: transparent; }
.o1-timer-readout { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 6px; min-height: 32px; display: inline-flex; align-items: center; border-radius: var(--radius-chip); background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); flex-shrink: 0; white-space: nowrap; }
[data-timer-state="zero"] .o1-timer-readout { background-color: var(--accent-amber-soft); color: var(--accent-amber-ink); }
[data-timer-state="zero"].o1-set-tile { border-color: var(--accent-amber); }
[data-timer-state="running"].o1-set-tile { border-color: var(--accent-cobalt); }
/* A finished workout: the same tiles, read only; done sets white, skipped ones muted. */
.o1-read { font-family: var(--font-mono); font-size: var(--text-sm); font-variant-numeric: tabular-nums; text-align: center; color: var(--ink-primary); min-height: 32px; display: grid; place-items: center; }
.o1-set-skipped { background-color: var(--surface-subtle); }
.o1-set-skipped .o1-read { color: var(--ink-muted); }
.o1-read-left { justify-items: start; padding-left: var(--space-3); }
.o1-saved-mark { color: var(--accent-cobalt-ink); display: grid; }
.o1-done-pill { gap: var(--space-1); }
.o1-queue-row { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--ink-primary); transition: background-color var(--motion-fast) var(--ease-standard); }
.o1-queue-row:hover { background-color: var(--surface-subtle); }
/* Sticky bottom dock: Split Dock Ledger (Rest | Up next). */
.o1-upnext { position: sticky; bottom: 0; z-index: 20; margin-top: auto; padding: var(--space-2) var(--space-4); padding-bottom: max(var(--space-3), env(safe-area-inset-bottom)); background-color: var(--surface-canvas); border-top: 1px solid var(--divider); box-shadow: var(--shadow-shell); }
.o1-upnext-inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 48px; }
.o1-rest { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex-shrink: 0; }
.o1-rest:only-child { flex: 1; }
.o1-rest-clock { font-family: var(--font-mono); font-size: 20px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink-primary); }
.o1-rest[data-rest-state="down"] .o1-rest-clock { color: var(--accent-cobalt-ink); }
.o1-rest[data-rest-state="over"] .o1-rest-clock { color: var(--accent-amber-ink); }
.o1-rest-badge { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 2px var(--space-2); border-radius: var(--radius-pill); background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); white-space: nowrap; }
.o1-rest[data-rest-state="over"] .o1-rest-badge { background-color: var(--accent-amber-soft); color: var(--accent-amber-ink); }
.o1-rest[data-rest-state="up"] .o1-rest-badge { background-color: var(--surface-control); color: var(--ink-secondary); }
.o1-rest .o1-rest-over { display: none; }
.o1-rest[data-rest-state="over"] .o1-rest-len { display: none; }
.o1-rest[data-rest-state="over"] .o1-rest-over { display: inline; }
.o1-dock-sep { width: 1px; height: 28px; background-color: var(--divider); flex-shrink: 0; }
.o1-next { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex: 1; min-width: 0; }
.o1-next .mos-heading { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Routine edit screen (Round 2 pick: Balanced 4x2 Ledger). */
.o1-edit-tile { display: flex; flex-direction: column; gap: var(--space-3); border: 1.5px solid transparent; }
.o1-edit-tile.has-error { border-color: var(--accent-magenta); }
.o1-ex-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.o1-unit-tags { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.o1-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); align-items: end; }
.o1-grid-4 > .mos-error-text { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); line-height: var(--leading-snug); }
.o1-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.o1-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 2px; min-width: 0; }
.o1-field-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: var(--tracking-mono-label); color: var(--ink-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o1-min-note { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; flex-shrink: 0; }
.o1-sticky-bar { position: sticky; bottom: 0; z-index: 15; margin-top: auto; padding: var(--space-3) var(--space-4); padding-bottom: max(var(--space-3), env(safe-area-inset-bottom)); background-color: var(--surface-canvas); border-top: 1px solid var(--divider); }
.o1-sticky-inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.o1-sticky-inner .cta-btn { flex: 1; max-width: 280px; }
@media (max-width: 430px) {
  .o1-field-label { font-size: 10px; letter-spacing: 0.01em; }
}
.o1-dialog-panel { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-4); padding: var(--space-6); }
.o1-dialog-text { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.o1-dialog-text-tight { gap: var(--space-1); }
.o1-dialog-text > h1, .o1-dialog-text > p { margin: 0; }
.o1-dialog-actions { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.o1-tray-foot { height: var(--space-3); }
/* Progress width in steps of 5 %. */
.o1-w0 { width: 0%; }
.o1-w5 { width: 5%; }
.o1-w10 { width: 10%; }
.o1-w15 { width: 15%; }
.o1-w20 { width: 20%; }
.o1-w25 { width: 25%; }
.o1-w30 { width: 30%; }
.o1-w35 { width: 35%; }
.o1-w40 { width: 40%; }
.o1-w45 { width: 45%; }
.o1-w50 { width: 50%; }
.o1-w55 { width: 55%; }
.o1-w60 { width: 60%; }
.o1-w65 { width: 65%; }
.o1-w70 { width: 70%; }
.o1-w75 { width: 75%; }
.o1-w80 { width: 80%; }
.o1-w85 { width: 85%; }
.o1-w90 { width: 90%; }
.o1-w95 { width: 95%; }
.o1-w100 { width: 100%; }

/* Sign-in and invite pages: DesignSystemAgent system/components/sign-in-card.html. */
/* Two-layer auth shell: recessed cool-grey .mos-tray wrapping a borderless white .mos-tile */
.signin-shell {
  width: 100%;
  max-width: 400px;
  gap: 0;
}
.signin-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
}
.signin-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
/* Logo sits above the card, outside it, centered */
.signin-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding-block: var(--space-2) var(--space-3);
}
.signin-orb {
  width: 32px;
  height: 32px;
}
.signin-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  color: var(--ink-primary);
}
.signin-title {
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

/* Form layout & filled icon fields */
.signin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.signin-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-primary);
}
.signin-input-group {
  min-height: 48px;
  padding: 0 var(--space-1) 0 var(--space-3);
  background-color: var(--surface-tray);
  border: 1px solid transparent;
  border-radius: var(--radius-well);
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}
.signin-input-group:hover {
  background-color: var(--surface-control);
}
.signin-input-group:focus-within {
  background-color: var(--surface-card);
  border-color: var(--accent-cobalt);
  box-shadow: var(--focus-ring);
}
.signin-input-group.is-error {
  background-color: var(--surface-card);
  border-color: var(--accent-magenta);
}
.signin-input-group.is-error:focus-within {
  border-color: var(--accent-magenta);
  box-shadow: var(--focus-ring-magenta);
}
.signin-input-group .mos-input {
  min-height: 44px;
  padding: var(--space-2) 0;
  font-size: 16px;
  line-height: var(--leading-snug);
}
.signin-input-group .mos-input-addon {
  color: var(--ink-muted);
}
.signin-input-group:focus-within .mos-input-addon {
  color: var(--ink-secondary);
}
.signin-input-group.is-error .mos-input-addon {
  color: var(--accent-magenta);
}
.signin-eye {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background-color: transparent;
  color: var(--ink-muted);
}
.signin-eye:hover:not(:disabled) {
  background-color: var(--surface-control-hover);
  color: var(--ink-primary);
}
.signin-eye .signin-eye-hide {
  display: none;
}
.signin-eye[aria-pressed="true"] .signin-eye-show {
  display: none;
}
.signin-eye[aria-pressed="true"] .signin-eye-hide {
  display: block;
}

/* Field rules, field errors & banners */
.signin-rule {
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--ink-muted);
}
.signin-field-msg {
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}
.signin-banner {
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-radius: var(--radius-well);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
}
.signin-banner-icon {
  flex-shrink: 0;
}
.signin-submit {
  min-height: 46px;
  margin-top: var(--space-1);
  font-size: var(--text-base);
  font-weight: 600;
}

/* Expired invite body */
.signin-status-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}
.signin-status-well {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-tile);
}
.signin-status-copy {
  margin: 0;
  max-width: 280px;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink-secondary);
  text-wrap: balance;
}

/* Empty grey band under the white card (Miguel: keep the band, no text) */
.signin-footer {
  height: var(--space-5);
}

/* Page wrapper for standalone auth pages: card centered both ways on phone and desktop */
.signin-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 400px);
  justify-content: center;
  align-content: center;
  row-gap: var(--space-2);
  padding: var(--space-4);
}

@media (max-width: 480px) {
  .signin-panel {
    padding: var(--space-5);
    gap: var(--space-4);
  }
  .signin-form {
    gap: var(--space-3);
  }
}
/* No JS: the eye stays hidden and the field a password field (/static/signin.js shows it). */
.signin-eye[hidden] { display: none; }

/* Submissions (Option 07: Editorial Document + Sidebar).
   Classes prefixed sub- to stay out of o1- (Training) and mos- (ui-kit). */
.o1-page-wide { max-width: 1120px; }

/* List page */
.sub-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sub-filter .mos-seg-item { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.sub-filter-search { flex: 1; min-width: 200px; min-height: 44px; }
@media (max-width: 640px) { .sub-filter-search { flex-basis: 100%; } }
.sub-empty-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sub-empty-text { margin: 0; }
.sub-group { display: flex; flex-direction: column; }
.sub-group-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-strong); }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--divider); text-decoration: none; color: var(--ink-primary); transition: background-color var(--motion-fast) var(--ease-standard); }
.sub-row:last-child { border-bottom: none; }
.sub-row:hover { background-color: var(--surface-subtle); }
.sub-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sub-row-right { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.sub-row-arrow { color: var(--ink-subtle); }
/* All-records compact rows */
.sub-all-row { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2); border-bottom: 1px solid var(--divider); text-decoration: none; color: var(--ink-primary); transition: background-color var(--motion-fast) var(--ease-standard); min-width: 0; }
.sub-all-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-all-row:last-child { border-bottom: none; }
.sub-all-row:hover { background-color: var(--surface-subtle); }
@media (max-width: 600px) {
  .sub-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) 0; }
  .sub-row-right { width: 100%; justify-content: space-between; }
}

/* Detail: editorial document + sidebar grid */
.sub-doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; gap: var(--space-6) var(--space-8); align-items: start; width: 100%; min-width: 0; }
.sub-doc-hero { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-6); border-bottom: 1px solid var(--divider); min-width: 0; }
.sub-doc-body { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.sub-doc-sidebar { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 64px; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
@media (max-width: 900px) {
  .sub-doc-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: var(--space-5); }
  .sub-doc-hero, .sub-doc-sidebar, .sub-doc-body { grid-column: 1; grid-row: auto; min-width: 0; }
  .sub-doc-sidebar { position: static; }
  .sub-doc-hero { padding-bottom: 0; border-bottom: none; }
}
.sub-kicker-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sub-title { margin: 0; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-display); line-height: var(--leading-tight); color: var(--ink-primary); overflow-wrap: anywhere; }
.sub-hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sub-hero-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-control); background-color: var(--surface-subtle); color: var(--ink-primary); font-size: var(--text-sm); font-weight: 500; text-decoration: none; transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard); }
.sub-hero-link:hover { background-color: var(--surface-control); color: var(--ink-primary); }
.sub-hero-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sub-hero-link svg { color: var(--ink-muted); flex-shrink: 0; }
.sub-lead-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.sub-lead { margin: 0; font-size: var(--text-md); line-height: var(--leading-relaxed); color: var(--ink-secondary); max-width: 64ch; }
@media (max-width: 640px) { .sub-lead-row { flex-direction: column; gap: var(--space-2); } }

/* Top Gallery Slider (horizontal scroll-snap, unboxed on canvas) */
.sub-slider { gap: var(--space-3); min-width: 0; max-width: 100%; }
.sub-slider-stage { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; background-color: var(--surface-subtle); outline: 1px solid var(--border-subtle); outline-offset: -1px; border-radius: var(--radius-tile); }
.sub-slider-track { display: flex; width: 100%; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sub-slider-track::-webkit-scrollbar { display: none; }
.sub-slider-track:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sub-slider-slide { flex: 0 0 100%; width: 100%; min-width: 0; aspect-ratio: 1440 / 900; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.sub-slider-slide a { display: block; width: 100%; height: 100%; }
.sub-slider-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sub-slider-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); min-width: 0; max-width: 100%; }
.sub-slider-thumbs { display: flex; align-items: center; gap: var(--space-2); overflow-x: auto; min-width: 0; max-width: 100%; scrollbar-width: none; }
.sub-slider-thumbs::-webkit-scrollbar { display: none; }
.sub-slider-thumb { width: 64px; height: 44px; padding: 2px; border: 1.5px solid transparent; background-color: var(--surface-subtle); border-radius: var(--radius-control); flex-shrink: 0; overflow: hidden; transition: border-color var(--motion-fast) var(--ease-standard), opacity var(--motion-fast) var(--ease-standard); opacity: 0.72; }
.sub-slider-thumb:hover { opacity: 1; background-color: var(--surface-subtle); }
.sub-slider-thumb.is-active { border-color: var(--accent-cobalt); opacity: 1; }
.sub-slider-thumb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sub-slider-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-chip); }
.sub-slider-nav { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.sub-icon-btn { width: 44px; height: 44px; background: transparent; color: var(--ink-muted); border-radius: var(--radius-control); }
.sub-icon-btn:hover { background-color: var(--surface-subtle); color: var(--ink-primary); }

/* Editorial sections — separated by hairlines */
.sub-section { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.sub-section + .sub-section { padding-top: var(--space-6); border-top: 1px solid var(--divider); }
.sub-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sub-copy-icon { width: auto; min-width: 44px; min-height: 44px; padding: 0 var(--space-2); background: transparent; color: var(--ink-muted); border-radius: var(--radius-control); gap: 6px; flex-shrink: 0; font-size: var(--text-xs); font-weight: 500; }
.sub-copy-icon:hover { background-color: var(--surface-subtle); color: var(--ink-primary); }
.sub-copy-icon .sub-ic-check { display: none; line-height: 0; }
.sub-copy-icon.is-copied { color: var(--accent-cobalt-ink); background-color: var(--accent-cobalt-soft); }
.sub-copy-icon.is-copied .sub-ic-copy { display: none; }
.sub-copy-icon.is-copied .sub-ic-check { display: inline-flex; }
.sub-copy-icon.is-failed { color: var(--accent-magenta-ink); background-color: var(--accent-magenta-soft); }
.sub-copy-status:empty { display: none; }
.sub-copy-html { min-width: 104px; padding: 0 var(--space-3); }
.sub-copy-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.sub-copy-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; }
.sub-ruled-block { flex-direction: column; align-items: stretch; gap: var(--space-3); }
.sub-hash-line { margin: 0; overflow-wrap: anywhere; }
.sub-unchanged { margin: 0; font-size: var(--text-sm); }
.sub-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--accent-cobalt-ink); text-decoration: none; }
.sub-link:hover { text-decoration: underline; }
.sub-folds { gap: 0; }
.sub-fold-inline { width: 100%; }

/* Images: 8 fixed unboxed, unclipped slots (2 cols at 390px, 4 cols at >=760px) */
.sub-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (min-width: 760px) {
  .sub-image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sub-shot { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.sub-shot-frame { width: 100%; background-color: var(--surface-subtle); outline: 1px solid var(--border-subtle); outline-offset: -1px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sub-shot-frame a { display: block; width: 100%; height: 100%; }
.sub-shot-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sub-ar-portrait { aspect-ratio: 750 / 995; }
.sub-ar-gallery { aspect-ratio: 1440 / 900; }
.sub-ar-benefits { aspect-ratio: 1524 / 1064; }
.sub-shot-missing { color: var(--ink-muted); font-size: var(--text-sm); text-align: center; padding: var(--space-3); }
.sub-shot-blocked { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-muted); overflow-wrap: anywhere; padding: var(--space-3); width: 100%; }
.sub-shot-url { overflow-wrap: anywhere; }
.sub-shot-cap { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-xs); color: var(--ink-muted); }
.sub-shot-name { font-weight: 600; color: var(--ink-primary); }

/* Diff image pairs and tag rows */
.sub-diff-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sub-tag-removed { text-decoration: line-through; color: var(--ink-muted); }
.sub-tag-added { background-color: var(--accent-cobalt-soft); color: var(--accent-cobalt-ink); }
.sub-diff-images { display: flex; flex-direction: column; gap: var(--space-4); }
.sub-diff-img-row { display: flex; flex-direction: column; gap: var(--space-2); }
.sub-diff-img-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.sub-diff-img-side { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }

/* Ruled rows (keywords, copy fields) */
.sub-ruled { display: flex; flex-direction: column; }
.sub-ruled-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); }
.sub-ruled-row:last-child { border-bottom: none; }
.sub-ruled-key { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-mono-label); color: var(--ink-muted); min-width: 112px; flex-shrink: 0; }
.sub-ruled-val { flex: 1; min-width: 0; font-size: var(--text-base); color: var(--ink-primary); overflow-wrap: anywhere; }
@media (max-width: 560px) { .sub-ruled-row { flex-direction: column; gap: 4px; } }

/* Diff block */
.sub-diff { display: flex; flex-direction: column; gap: var(--space-3); padding-left: var(--space-4); border-left: 2px solid var(--accent-cobalt); }
.sub-diff-item { display: flex; flex-direction: column; gap: 4px; }
.sub-diff-old { font-size: var(--text-sm); color: var(--ink-muted); text-decoration: line-through; }
.sub-diff-new { font-size: var(--text-sm); color: var(--ink-primary); font-weight: 500; }

/* Inline SVG fold sections (zero data: URI — CSP blocks it on submissions) */
details.sub-fold { border-top: 1px solid var(--divider); }
details.sub-fold:last-of-type { border-bottom: 1px solid var(--divider); }
details.sub-fold > summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--ink-primary); }
details.sub-fold > summary::-webkit-details-marker { display: none; }
details.sub-fold > summary:hover { background-color: var(--surface-subtle); }
details.sub-fold > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
details.sub-fold .sub-fold-chev { width: 16px; height: 16px; color: var(--ink-muted); transition: transform var(--motion-base) var(--ease-standard); flex-shrink: 0; }
details.sub-fold[open] .sub-fold-chev { transform: rotate(180deg); }
.sub-fold-body { padding-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink-secondary); }

/* Sidebar inspector (the ONE tray surface) */
.sub-side-section { display: flex; flex-direction: column; gap: var(--space-3); }
.sub-side-meta { display: flex; flex-direction: column; margin: 0; }
.sub-side-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--divider); font-size: var(--text-sm); }
.sub-side-row:first-child { padding-top: 0; }
.sub-side-row:last-child { border-bottom: none; padding-bottom: 0; }
.sub-side-row dt { color: var(--ink-muted); font-size: var(--text-xs); flex-shrink: 0; }
.sub-side-row dd { margin: 0; color: var(--ink-primary); font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* Blocker list */
.sub-blocker-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-1); }
.sub-blocker-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--accent-magenta-ink); }
.sub-blocker-item a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: var(--space-2) 0; color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.sub-blocker-dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background-color: var(--accent-magenta); flex-shrink: 0; }

/* Copy field prose (long description on canvas: headings, lists, inline images) */
.sub-prose { display: flex; flex-direction: column; gap: var(--space-4); max-width: 72ch; color: var(--ink-primary); font-size: var(--text-base); line-height: var(--leading-relaxed); }
.sub-prose p { margin: 0; color: var(--ink-secondary); overflow-wrap: anywhere; }
.sub-prose-h2 { margin: var(--space-3) 0 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-heading); line-height: var(--leading-snug); color: var(--ink-primary); }
.sub-prose-h2:first-child { margin-top: 0; }
.sub-prose-h3 { margin: var(--space-2) 0 0; font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-heading); line-height: var(--leading-snug); color: var(--ink-primary); }
.sub-prose-list, .sub-prose-ol { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); color: var(--ink-secondary); }
.sub-prose-list li, .sub-prose-ol li { overflow-wrap: anywhere; }
.sub-prose-list strong { color: var(--ink-primary); font-weight: 600; }
.sub-prose-fig { margin: var(--space-2) 0; width: 100%; background-color: var(--surface-subtle); outline: 1px solid var(--border-subtle); outline-offset: -1px; border-radius: var(--radius-tile); overflow: hidden; }
.sub-prose-fig a { display: block; width: 100%; }
.sub-prose-fig img { display: block; width: 100%; height: auto; object-fit: contain; }

/* Copy pre blocks */
.sub-pre { margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); line-height: var(--leading-normal); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-primary); }

/* Chip wrap (generic keywords) */
.sub-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: var(--space-2); }

/* Set row state hooks (W5a): the script toggles data-state, never button text. */
[data-set-submit] [data-label="saving"],
[data-set-submit] [data-label="retry"] { display: none; }
form[data-state="saving"] [data-set-submit] [data-label="done"],
form[data-state="failed"] [data-set-submit] [data-label="done"] { display: none; }
form[data-state="saving"] [data-set-submit] [data-label="saving"] { display: inline-block; width: 14px; height: 14px; font-size: 0; line-height: 0; border: 2px solid var(--border-strong); border-top-color: var(--accent-cobalt); border-radius: 50%; animation: mos-spin 0.7s linear infinite; }
form[data-state="failed"] [data-set-submit] [data-label="retry"] { display: inline-flex; align-items: center; justify-content: center; }
/* Timed row hooks (W6): the script toggles aria-pressed and hidden, never button text. */
[data-timer-start][hidden],
[data-timer][hidden] { display: none; }
[data-timer-start] [data-timer-label="stop"] { display: none; }
[data-timer-start][aria-pressed="true"] [data-timer-label="start"] { display: none; }
[data-timer-start][aria-pressed="true"] [data-timer-label="stop"] { display: inline-flex; align-items: center; }
