/* css/school-rail.css — the School rail (WP-D). Desktop right rail, phone bottom sheet.
   Tokens only: every colour comes from the site's custom properties, so all four palettes and
   light/dark work. School colours arrive as an inline `--sc-c` and are darkened in light theme.
   Stage styles live in css/school.css (WP-B). Phone breakpoint: max-width 600px (same as the stage).

   Contract with the stage:
     .sc-fs gets  --sc-rail-w  (px, desktop rail width, 0px on phone)
                  --sc-rail-h  (px, visible sheet height on phone, 0px on desktop)
     The rail sits below the chrome:  top: var(--sc-chrome-h, 56px)                                  */

.sc-rail {
  --sc-r: 10px;
  --sc-adapt: 100%;
  position: absolute; top: var(--sc-chrome-h, 56px); right: 0; bottom: 0;
  width: min(360px, 42vw); z-index: 30;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  border-left: 1px solid var(--border);
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: 14px; line-height: 1.4;
  box-sizing: border-box;
}
:root[data-theme="light"] .sc-rail { --sc-adapt: 72%; }
.sc-rail *, .sc-rail *::before, .sc-rail *::after { box-sizing: border-box; }
.sc-rail :where(button) { font: inherit; color: inherit; }
.sc-rail ul, .sc-rail ol { list-style: none; margin: 0; padding: 0; }
.sc-rail [hidden] { display: none !important; }
.sc-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* focus ring */
.sc-rail :is(button, input, a, [tabindex]):focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ── sheet grabber (phone only) ───────────────────────────────────────────── */
.sc-sheet-grab { display: none; }

/* ── head ──────────────────────────────────────────────────────────────────── */
.sc-rail-head { flex: 0 0 auto; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.sc-head-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-head-kicker { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-code, 'Space Mono', monospace); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--warm); }
.sc-head-title { font-family: var(--font-display, 'DM Serif Display', serif); font-size: 1.18rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sc-head-sub { font-size: .78rem; color: var(--text2); }

/* ── body / foot ──────────────────────────────────────────────────────────── */
.sc-rail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 16px 28px; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.sc-rail-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--bg2); min-height: 48px; }

.sc-lead { margin: 0 0 14px; font-size: .95rem; color: var(--text2); }
.sc-note { margin: 8px 0 0; font-size: .78rem; color: var(--text3); }
.sc-note--ok { color: var(--green); margin: 0 0 8px; }
.sc-hint { font-size: .72rem; color: var(--text3); margin-left: 8px; }

.sc-sec { margin: 0 0 18px; }
.sc-sec-h { margin: 0 0 8px; font-family: var(--font-code, 'Space Mono', monospace); font-size: .64rem; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--text3); }
.sc-sec-sub { letter-spacing: .04em; text-transform: none; margin-left: 6px; color: var(--text3); opacity: .8; }
.sc-sec-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--text2); }
.sc-sec-toggle:hover { color: var(--text); }
.sc-count { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--surface2, var(--surface)); border: 1px solid var(--border); font-size: .62rem; color: var(--text2); letter-spacing: 0; }
.sc-chev { display: inline-flex; color: var(--text3); transition: transform .18s var(--ease-spring); }
.sc-chev.is-open { transform: rotate(90deg); }

.sc-list { display: flex; flex-direction: column; gap: 6px; }

/* ── generic row (schools, buildings, floors, branches, roles) ────────────── */
.sc-row {
  --cc: color-mix(in srgb, var(--sc-c, var(--warm)) var(--sc-adapt), #14100c);
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--sc-r);
  text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s var(--ease-spring);
}
.sc-row:hover { border-color: var(--border2); background: var(--surface2, var(--surface)); }
.sc-row:active { transform: scale(.992); }
.sc-row.is-current { border-color: var(--teal); }
.sc-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sc-row-title { font-weight: 600; font-size: .9rem; color: var(--text); overflow-wrap: anywhere; }
.sc-row-sub { font-size: .74rem; color: var(--text2); }
.sc-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--cc, color-mix(in srgb, var(--sc-c, var(--warm)) var(--sc-adapt), #14100c)); }
.sc-bar { flex: 0 0 auto; width: 44px; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--sc-c, var(--warm)) var(--sc-adapt), #14100c); }
.sc-row .sc-chev { margin-left: auto; }

.sc-mix { flex: 0 0 auto; display: inline-flex; gap: 3px; align-items: center; }
.sc-mix i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc-c, var(--warm)); opacity: var(--o, .2); }
:root[data-theme="light"] .sc-mix i { background: color-mix(in srgb, var(--sc-c, var(--warm)) 72%, #14100c); }
.sc-row .sc-mix { --sc-c: var(--text2); }
.sc-mixline { display: flex; align-items: center; margin: 6px 0 12px; }

/* ── school / building card ───────────────────────────────────────────────── */
.sc-crumb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 4px; margin: -4px 0 6px -4px; background: none; border: 0; border-radius: 8px; cursor: pointer; font-size: .8rem; color: var(--text2); }
.sc-crumb-btn:hover { color: var(--text); background: var(--surface); }
.sc-school { margin-bottom: 18px; }
.sc-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-family: var(--font-display, 'DM Serif Display', serif); font-weight: 400; font-size: 1.35rem; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
.sc-stats { margin: 0 0 8px; font-size: .78rem; color: var(--text2); }
.sc-blurb { margin: 0 0 14px; font-size: .9rem; color: var(--text); }

/* ── buttons, pills, chips ────────────────────────────────────────────────── */
.sc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--border2); border-radius: var(--sc-r); background: transparent; color: var(--text); font-weight: 600; font-size: .88rem; cursor: pointer; transition: transform .15s var(--ease-spring), border-color .15s, background .15s; }
.sc-btn:hover { border-color: var(--text3); background: var(--surface); }
.sc-btn:active { transform: translateY(1px); }
.sc-btn[disabled] { opacity: .45; cursor: not-allowed; }
.sc-btn--primary { background: var(--warm); border-color: transparent; color: var(--bg); }
.sc-btn--primary:hover { background: var(--warm); border-color: transparent; filter: brightness(1.06); transform: translateY(-1px); }
.sc-btn--block { width: 100%; }
.sc-btn-sub { font-weight: 400; font-size: .76rem; opacity: .75; }

.sc-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--border2); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .8rem; cursor: pointer; }
.sc-pill:hover { border-color: var(--text3); }
.sc-pill--sm { min-height: 28px; padding: 0 10px; font-size: .74rem; }

.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.sc-chip { min-height: 32px; padding: 0 13px; border: 1px solid var(--border2); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .8rem; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, transform .15s var(--ease-spring); }
.sc-chip:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--surface)); }
.sc-chip:active { transform: scale(.97); }
.sc-chip--warn { border-color: color-mix(in srgb, var(--yellow, var(--warm)) 60%, var(--border2)); }
.sc-chip--warn b { margin-left: 4px; color: var(--yellow, var(--warm)); }
.sc-check { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; margin: 2px 0 6px; font-size: .76rem; color: var(--text2); cursor: pointer; }
.sc-check input { width: 16px; height: 16px; accent-color: var(--teal); margin: 0; }

.sc-link { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
.sc-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text3); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.sc-iconbtn:hover { color: var(--text); background: var(--surface2, var(--surface)); border-color: var(--border); }
.sc-iconbtn--danger:hover { color: var(--red); }
.sc-iconbtn[disabled] { opacity: .3; cursor: not-allowed; pointer-events: none; }
.sc-iconbtn--ghost { flex: 0 0 auto; }

/* ── route mode ───────────────────────────────────────────────────────────── */
.sc-route-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sc-crumb { font-size: .74rem; color: var(--text3); text-align: right; overflow-wrap: anywhere; }
.sc-route-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 2px 0 4px; }
.sc-kindc--journey { color: var(--purple) !important; }
.sc-kindc--trunk, .sc-kindc--role { color: var(--warm); }
.sc-kindc--selection { color: var(--teal) !important; }
.sc-kindc--proposal { color: var(--yellow, var(--warm)) !important; }
.sc-kindc--branch { color: var(--blue) !important; }
:root[data-theme="light"] .sc-kindc--selection { color: color-mix(in srgb, var(--teal) 70%, #14100c) !important; }
.sc-kind { padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; font-family: var(--font-code, 'Space Mono', monospace); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
.sc-kind--journey { color: var(--purple); }
.sc-kind--trunk, .sc-kind--role { color: var(--warm); }
.sc-kind--proposal { color: var(--yellow, var(--warm)); border-style: dashed; }
.sc-kind--branch { color: var(--blue); }
:root[data-theme="light"] .sc-kind--trunk, :root[data-theme="light"] .sc-kind--role { color: color-mix(in srgb, var(--warm) 70%, #14100c); }
.sc-title-btn { display: block; max-width: 100%; padding: 0; background: none; border: 0; text-align: left; cursor: text; }
.sc-title-btn .sc-head-title { border-bottom: 1px dashed transparent; }
.sc-title-btn:hover .sc-head-title { border-bottom-color: var(--text3); }
.sc-input { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--border2); border-radius: 8px; background: var(--bg2); color: var(--text); font: inherit; font-size: .9rem; }
input.sc-input::-webkit-search-cancel-button { display: none; }
.sc-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); }
.sc-title-input { width: 100%; font-family: var(--font-display, 'DM Serif Display', serif); font-size: 1.1rem; }

.sc-proposal { margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--yellow, var(--warm)) 70%, var(--border2)); border-radius: var(--sc-r); background: color-mix(in srgb, var(--yellow, var(--warm)) 8%, transparent); }
.sc-proposal p { margin: 0 0 8px; font-size: .8rem; color: var(--text2); }
.sc-proposal-acts { display: flex; gap: 8px; }

.sc-prefix { margin: 8px 0 4px; padding: 8px 10px; border: 1px dashed var(--border2); border-radius: var(--sc-r); }
.sc-prefix-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--text2); flex-wrap: wrap; }
.sc-prefix-h b { color: var(--text); font-weight: 600; }
.sc-prefix-acts { display: inline-flex; align-items: center; gap: 10px; }
.sc-prefix-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.sc-prefix-list li { display: flex; align-items: flex-start; gap: 8px; font-size: .78rem; color: var(--text2); padding-left: 4px; }
.sc-prefix-t { overflow-wrap: anywhere; }

/* steps */
.sc-steps { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 14px; position: relative; }
.sc-step {
  --cc: color-mix(in srgb, var(--sc-c, var(--teal)) var(--sc-adapt), #14100c);
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--sc-r);
  transition: border-color .15s, box-shadow .2s, background .15s;
}
.sc-step:hover { border-color: var(--border2); }
.sc-step.has-issue { border-color: color-mix(in srgb, var(--yellow, var(--warm)) 55%, var(--border)); }
.sc-step-row {
  display: grid; grid-template-columns: 28px 24px minmax(0, 1fr) auto; column-gap: 6px; align-items: center;
  grid-template-areas: "grip num main act" "grip num one one";
  padding: 4px 6px 4px 2px; min-height: 44px;
}
.sc-grip { grid-area: grip; align-self: stretch; display: flex; align-items: center; justify-content: center; width: 28px; min-height: 44px; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--text3); cursor: grab; touch-action: none; }
.sc-grip:hover { color: var(--text); background: var(--surface2, var(--surface)); }
.sc-num { grid-area: num; align-self: start; margin-top: 11px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cc); font-family: var(--font-code, 'Space Mono', monospace); font-size: .64rem; font-weight: 700; color: var(--text); line-height: 1; }
.sc-num.is-done { background: var(--cc); color: #0b0d14; }
.sc-step-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 3px; width: 100%; min-height: 44px; justify-content: center; padding: 6px 4px 6px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.sc-step-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; font-size: .88rem; line-height: 1.25; color: var(--text); overflow-wrap: anywhere; }
.sc-step.is-open .sc-step-title { -webkit-line-clamp: unset; display: block; }
.sc-step-meta { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; font-family: var(--font-code, 'Space Mono', monospace); font-size: .64rem; color: var(--text2); }
.sc-step-actions { grid-area: act; display: inline-flex; align-items: center; gap: 0; justify-self: end; }
.sc-rone { grid-area: one; margin: 0 4px 8px 0; font-size: .76rem; line-height: 1.35; color: var(--text2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sc-step.is-open .sc-rone { -webkit-line-clamp: 4; }
.sc-step.is-done .sc-step-title { color: var(--text2); }
.sc-tier { display: inline-flex; color: var(--cc, var(--text2)); }
.sc-glyph { display: block; }
.sc-dots { display: inline-flex; gap: 2px; align-items: center; }
.sc-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--border2); }
.sc-dots i.on { background: var(--text2); }
.sc-meta-t { color: var(--text3); }
.sc-badge { padding: 0 6px; border-radius: 4px; border: 1px solid var(--border2); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); }
.sc-badge--done { color: var(--green); border-color: color-mix(in srgb, var(--green) 50%, var(--border)); }
.sc-badge--gap { color: var(--yellow, var(--warm)); border-style: dashed; border-color: color-mix(in srgb, var(--yellow, var(--warm)) 60%, var(--border)); }
.sc-warn { color: var(--yellow, var(--warm)); font-family: var(--font-body, 'Outfit', sans-serif); font-size: .7rem; }
:root[data-theme="light"] .sc-warn, :root[data-theme="light"] .sc-badge--gap, :root[data-theme="light"] .sc-chip--warn b { color: color-mix(in srgb, var(--yellow, var(--warm)) 55%, #14100c); }
.sc-step.is-gap { border-style: dashed; }
.sc-step-more { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 10px 10px 36px; }
.sc-step-actions .sc-add { opacity: .75; }

/* drag */
.sc-step.sc-dragging { z-index: 6; transition: none; cursor: grabbing; border-color: var(--teal); background: var(--bg2); box-shadow: 0 10px 28px rgba(0, 0, 0, .38); }
:root[data-theme="light"] .sc-step.sc-dragging { box-shadow: 0 10px 24px rgba(40, 30, 20, .22); }
.sc-steps.sc-sorting .sc-step:not(.sc-dragging) { transition: transform .16s var(--ease-spring); }
.sc-rail.is-dragging, .sc-rail.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* insert-after search */
.sc-ins { padding: 8px 10px 10px; border-top: 1px dashed var(--border2); }
.sc-ins-label { display: block; margin: 0 0 6px; font-family: var(--font-code, 'Space Mono', monospace); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); }
.sc-ins-field { display: flex; align-items: center; gap: 6px; }
.sc-ins-results { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.sc-hit { display: flex; align-items: flex-start; gap: 8px; width: 100%; min-height: 40px; padding: 8px 8px; background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.sc-hit:hover, .sc-hit:focus-visible { background: var(--surface2, var(--surface)); }
.sc-hit.is-in { opacity: .5; cursor: default; }
.sc-hit-title { flex: 1 1 auto; min-width: 0; font-size: .84rem; color: var(--text); overflow-wrap: anywhere; }
.sc-hit-note { font-size: .68rem; color: var(--text3); }
.sc-hit--gap { border: 1px dashed var(--border2); margin-top: 4px; }
.sc-hit .sc-tier { margin-top: 3px; }

/* save */
.sc-save { margin: 10px 0 4px; }
.sc-save--form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border2); border-radius: var(--sc-r); background: var(--surface); }
.sc-save-actions { display: flex; gap: 8px; }
.sc-save--done { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--purple) 45%, var(--border)); border-radius: var(--sc-r); background: color-mix(in srgb, var(--purple) 8%, transparent); }
.sc-save-state { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; }
.sc-save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.sc-save-note { font-size: .76rem; color: var(--text2); }

/* journeys */
.sc-jr { display: flex; align-items: stretch; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--sc-r); }
.sc-jr.is-current { border-color: var(--purple); }
.sc-jr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; min-height: 44px; padding: 8px 4px 8px 12px; background: none; border: 0; text-align: left; cursor: pointer; }
.sc-jr-title { font-weight: 600; font-size: .86rem; overflow-wrap: anywhere; }
.sc-jr-sub { font-size: .72rem; color: var(--text2); }
.sc-jr .sc-iconbtn { align-self: center; margin-right: 4px; }

/* foot: message + undo */
.sc-msg { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; font-size: .78rem; line-height: 1.3; border: 1px solid var(--border); background: var(--surface); }
.sc-msg--ok { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }
.sc-msg--warn { border-color: color-mix(in srgb, var(--yellow, var(--warm)) 65%, var(--border)); background: color-mix(in srgb, var(--yellow, var(--warm)) 10%, var(--surface)); }
.sc-msg-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sc-msg-undo { flex: 0 0 auto; background: none; border: 0; padding: 4px 2px; color: var(--teal); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sc-undo { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; margin-left: auto; border: 1px solid var(--border2); border-radius: 999px; background: var(--surface); font-size: .78rem; cursor: pointer; }
.sc-undo:hover { border-color: var(--text3); }

/* ── phone: bottom sheet, three detents (peek 72 · half · full) ───────────── */
@media (max-width: 600px) {
  .sc-rail {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: var(--sc-detent-h, 72px); max-height: calc(100% - 56px);
    border-left: 0; border-top: 1px solid var(--border2); border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .38);
    transition: height .3s var(--ease-spring);
    z-index: 40;
  }
  :root[data-theme="light"] .sc-rail { box-shadow: 0 -8px 28px rgba(40, 30, 20, .2); }
  .sc-rail.is-dragging-sheet { transition: none; }
  .sc-sheet-grab { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 100%; height: 22px; padding: 0; background: var(--bg2); border: 0; border-radius: 18px 18px 0 0; cursor: grab; touch-action: none; }
  .sc-sheet-bar { width: 40px; height: 4px; border-radius: 4px; background: var(--border2); }
  .sc-sheet-grab:hover .sc-sheet-bar { background: var(--text3); }
  .sc-rail-head { padding: 2px 16px 10px; border-bottom: 0; touch-action: none; }
  .sc-rail[data-detent="peek"] .sc-head-kicker { display: none; }
  .sc-rail[data-detent="peek"] .sc-head-title { -webkit-line-clamp: 1; font-size: 1.02rem; }
  .sc-rail[data-detent="peek"][data-mode="campus"] .sc-head-title { -webkit-line-clamp: 2; font-size: .95rem; line-height: 1.22; font-family: var(--font-body, 'Outfit', sans-serif); }
  .sc-rail[data-detent="peek"] .sc-rail-foot, .sc-rail[data-detent="peek"] .sc-rail-body { display: none; }
  .sc-rail-body { padding: 8px 14px 28px; border-top: 1px solid var(--border); }

  /* 44 px targets */
  .sc-row, .sc-hit { min-height: 44px; }
  .sc-step-row { min-height: 52px; grid-template-columns: 34px 24px minmax(0, 1fr) auto; }
  .sc-grip { width: 34px; min-height: 52px; }
  .sc-iconbtn { width: 44px; height: 44px; }
  .sc-step-actions { margin: 0 -4px 0 0; }
  .sc-step-actions .sc-add { display: none; }  /* phone: Add after lives in the open row (44 px pill) */
  .sc-title-btn { padding: 12px 0; margin: -12px 0; }
  .sc-chip { min-height: 44px; padding: 0 15px; font-size: .84rem; }
  .sc-btn, .sc-pill { min-height: 44px; }
  .sc-pill--sm { min-height: 36px; }
  .sc-crumb-btn { min-height: 44px; }
  .sc-check { min-height: 44px; }
  .sc-sec-toggle { min-height: 44px; }
  .sc-input { min-height: 44px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  .sc-undo { min-height: 44px; }
  .sc-msg-undo { min-height: 44px; padding: 0 8px; }
  .sc-jr-main { min-height: 52px; }
  /* one-liners only when a row is open: keeps rows near 44 px */
  .sc-step:not(.is-open) .sc-rone { display: none; }
  .sc-step-more { padding-left: 42px; }
}

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

/* the map shows a building that is not on the working route (rail + sheet head say so) */
.sc-ctx { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 10px 9px 12px; border: 1px dashed var(--border2); border-radius: 10px; font-size: .8rem; line-height: 1.35; color: var(--text2); }
.sc-ctx b { color: var(--text); font-weight: 600; }
.sc-ctx span { flex: 1; min-width: 0; }
.sc-ctx .sc-chip { flex: none; }
.sc-head-ctx { color: var(--teal); }
