/* rail.js (with organize.js): the chats sidebar — rows on the sidebar
 * ground, each with one status (chatstatus.js), the work links, groups and
 * folders, the row menu, the agent chooser that reuses it, and the phone
 * drawer. Contrast is fill tone only: hover is a light ink fill, the open
 * chat a white (dark: lifted) plate; no borders, pills or bars. Nothing idle
 * moves: only a Working row's ring turns. */

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-3);
  padding: var(--sv-space-3);
  border-right: var(--sv-hairline-w) solid var(--sv-hairline);
  background: var(--ws-sidebar);
  min-height: 0;
  --rail-hover: color-mix(in srgb, var(--sv-ink) 5%, var(--ws-sidebar));
  --rail-selected: var(--sv-surface);
}
:root.theme-dark .rail { --rail-selected: color-mix(in srgb, var(--sv-ink) 11%, var(--ws-sidebar)); }
.rail-head { padding: var(--sv-space-2) var(--sv-space-2) 0; }
.new-chat { width: 100%; }
.chats { position: relative; flex: 1; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; align-content: start; min-width: 0; }
.chats button {
  display: flex;
  align-items: center;
  gap: var(--sv-space-2);
  width: 100%;
  min-height: 32px;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--sv-radius);
  padding: 0 var(--sv-space-2) 0 var(--sv-space-3);
  color: var(--sv-ink-secondary);
  font-weight: 400;
  transition: background var(--sv-dur-instant) var(--sv-ease-out), color var(--sv-dur-instant) var(--sv-ease-out);
}
.chats button:hover { background: var(--rail-hover); color: var(--sv-ink); }
.chats button[aria-current="true"], .chats button[aria-current="true"]:hover { background: var(--rail-selected); color: var(--sv-ink); }
.chats .c-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chats .c-when { color: var(--sv-ink-tertiary); font-size: var(--ui-meta); font-variant-numeric: tabular-nums; }
/* A chat's last message under its title (rail.js previewLine): Share's row's line (home.css .c-body/.c-preview), one line. */
.chats .c-mark + .c-body { padding-block: var(--sv-space-1); }
.chats .c-body .c-preview { font-weight: 400; }
.chats .c-preview-by { color: var(--sv-ink-secondary); }
.chats .c-preview.c-reason { color: var(--sv-ink-secondary); }

/* One status per row (chatstatus.js): a mark in a slot at the left (empty
 * when the row has none, so every title lines up), a word at the right of
 * the title line. A row without one recedes: secondary ink, regular weight,
 * its age. Working is quiet ink with a turning ring and its clock; Needs you
 * the attention colour; Failed the danger colour and its reason; Done a
 * green check and a bold title until the chat is opened. */
.chats .c-mark { flex: none; align-self: flex-start; display: grid; place-items: center; width: 14px; height: 14px; margin-top: calc(var(--sv-space-1) + 3px); color: var(--sv-ink-tertiary); }
.chats .c-mark .icon { width: 14px; height: 14px; }
.chats .c-mark.working::before { content: ""; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--sv-ink) 22%, transparent); border-top-color: var(--sv-ink); animation: rail-turn 0.9s linear infinite; }
.chats .c-mark.needs::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sv-attention); }
.chats .c-mark.failed { color: var(--sv-danger); }
.chats .c-row:not([data-status]) .c-mark.failed { opacity: 0.6; }
.chats .c-mark.done { color: var(--ws-working-ink); }
.chats .c-mark.done .icon { stroke-width: 2.5; }
@keyframes rail-turn { to { transform: rotate(1turn); } }
.chats .c-status { flex: none; font-size: var(--ui-meta); font-weight: 500; font-variant-numeric: tabular-nums; }
.chats .c-status.working { color: var(--sv-ink-secondary); font-weight: 400; }
.chats .c-status.needs { color: var(--sv-attention); }
.chats .c-status.failed { color: var(--sv-danger); }
.chats .c-status.done { color: var(--ws-working-ink); }
.chats .c-row[data-status] > .c-open { color: var(--sv-ink); }
@media (min-width: 761px) {
  .chats .c-row:is([data-status="needs"], [data-status="failed"]) .c-label, .chats .c-row:not([data-status]) > .c-open[aria-current="true"] .c-label { font-weight: 500; }
  .chats .c-row[data-status="done"] .c-label { font-weight: 600; }
}
@media (max-width: 760px), (pointer: coarse) and (max-width: 960px) and (max-height: 500px) {
  /* phone.css sets titles at 600: Done stands one step above it. */
  .chats .c-row[data-status="done"] .c-label { font-weight: 700; }
  /* The drawer is narrow and its titles large: the word leads the second line, the title keeps the first. */
  .chats .c-row[data-status] .c-body { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sv-space-2); align-items: baseline; }
  .chats .c-row[data-status] .c-line { display: contents; }
  .chats .c-row[data-status] .c-label { grid-column: 1 / -1; }
  .chats .c-row[data-status] .c-status { grid-row: 2; grid-column: 1; }
  .chats .c-row[data-status] .c-preview { grid-row: 2; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .chats .c-mark.working::before { animation: none; border-color: var(--sv-ink-secondary); border-right-color: transparent; }
}
/* Share's chats under its row (railshare.js) keep a dot: the same ring while one works, nothing that breathes. */
.chats .c-dot { display: none; flex: none; width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; }
.chats .c-dot.running { display: block; border: 1.5px solid color-mix(in srgb, var(--sv-ink) 18%, transparent); border-top-color: var(--sv-ink-secondary); animation: rail-turn 0.9s linear infinite; }
.chats .c-dot.failed { display: block; background: var(--sv-danger); }
@media (prefers-reduced-motion: reduce) { .chats .c-dot.running { animation: none; } }
/* railswipe.js: on a touch screen a row swipes left over an Archive plate (ink fill, no edge). */
@media (hover: none) and (pointer: coarse) {
  .chats .c-row[data-name]:not(.c-home) { touch-action: pan-y; }
  .chats .c-row.swiping { clip-path: inset(0 round var(--sv-radius)); } /* not overflow: hidden, which lets the grid row shrink to nothing */
  .chats .c-row.swiping::before { content: "Archive"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: var(--sv-space-5); background: var(--sv-ink); color: var(--sv-surface); font-weight: 500; }
  .chats .c-row.swiping > * { position: relative; border-radius: 0; background-color: var(--ws-sidebar); }
  .chats .c-row.swiping > [aria-current="true"] { background-color: var(--rail-selected); }
}
/* railmotion.js: a row that left fades where it was. */
.chats .c-ghost { position: absolute; pointer-events: none; margin: 0; }
/* Search, Recents, Mentions, Artifacts: one group, rows 1px apart like .chats */
.rail-nav { display: grid; gap: 1px; }
.rail-work {
  display: flex;
  align-items: center;
  gap: var(--sv-space-2);
  width: 100%;
  min-height: 32px;
  background: none;
  border: 0;
  border-radius: var(--sv-radius);
  padding: 0 var(--sv-space-3);
  text-align: left;
  color: var(--sv-ink-secondary);
  font-weight: 400;
}
.rail-work:hover { background: var(--rail-hover); color: var(--sv-ink); }
.rail-work[aria-current="true"] { background: var(--rail-selected); color: var(--sv-ink); font-weight: 500; }
.rail-work span { color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
/* Mentions' unread count (mentions.js) */
.rail-work .rail-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--sv-accent);
  color: var(--sv-on-accent);
  font-size: var(--ui-meta);
  font-weight: 500;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rail-work .rail-count[hidden] { display: none; }
/* A destination this person hid from their sidebar (railnav.js, railedit.js) */
.rail-work[data-rail-off] { display: none; }
.rail-foot { position: relative; border-top: var(--sv-hairline-w) solid var(--sv-hairline); padding-top: var(--sv-space-2); }
.rail-search-wrap { position: relative; display: block; }
.rail-search-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--sv-ink-tertiary); pointer-events: none; }
.rail-search-wrap .rail-search { width: 100%; padding-left: 32px; }
.rail-search {
  min-height: 32px;
  padding: 0 var(--sv-space-3);
  border-color: transparent;
  background: var(--sv-surface);
  font-size: var(--ui-text);
}
.rail-search::placeholder { color: var(--sv-ink-tertiary); }

@media (max-width: 760px), (pointer: coarse) and (max-width: 960px) and (max-height: 500px) {
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(85%, 20rem);
    z-index: var(--sv-z-nav);
    transform: translateX(-100%);
    transition: transform var(--sv-dur-base) var(--sv-ease-out);
    box-shadow: 0 8px 32px rgb(0 0 0 / 0.18);
  }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.32), 0 8px 32px rgb(0 0 0 / 0.18); }
}

/* search: quiet until hovered or focused (v1 sidebar-search) */
.rail-search {
  width: 100%;
  min-height: 32px;
  padding: 0 var(--sv-space-3);
  background: none;
  border: 0;
  border-radius: var(--sv-radius);
  color: var(--sv-ink);
  font-size: var(--ui-text);
}
.rail-search::placeholder { color: var(--sv-ink-secondary); }
.rail-search:hover { background: var(--ws-hover); }
.rail-search:focus { background: var(--sv-surface-raised); }

/* group headers: small muted labels; Archived folds */
.chats .rail-group-head {
  display: flex;
  align-items: center;
  gap: var(--sv-space-1);
  min-height: 28px;
  margin-top: var(--sv-space-3);
  padding: 0 var(--sv-space-3);
  color: var(--sv-ink-tertiary);
  font-size: var(--ui-meta);
  font-weight: 500;
}
.chats > .rail-group-head:first-child { margin-top: 0; }
.chats button.rail-group-head:hover { color: var(--sv-ink); }
.chats .rail-caret { display: inline-flex; width: 0.75em; transition: transform var(--sv-dur-fast) var(--sv-ease-out); }
.chats .rail-caret .icon { width: 12px; height: 12px; }
.chats .rail-group-head[aria-expanded="true"] .rail-caret { transform: rotate(90deg); }
/* Projects / People sections, folder labels, and the eye that hides a group for this person */
.chats .rail-section { margin-top: var(--sv-space-4); padding: 0 var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); font-weight: 500; }
.chats .rail-group-count { margin-left: auto; padding-left: var(--sv-space-2); color: var(--sv-ink-tertiary); font-weight: 400; font-variant-numeric: tabular-nums; }
.chats .rail-folder { margin-top: var(--sv-space-2); padding: 0 var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.chats .rail-section + .rail-group > .rail-group-head, .chats .rail-folder + .rail-group > .rail-group-head { margin-top: var(--sv-space-1); }
.chats .rail-group { display: flex; align-items: center; min-width: 0; }
.chats .rail-group > .rail-group-head { flex: 1; min-width: 0; }
.chats .rail-group > .rail-group-head > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chats .rail-group + .rail-group > .rail-group-head { margin-top: 0; }
.chats .rail-sub-head { margin-top: 0; padding-left: calc(var(--sv-space-3) + var(--sv-space-4)); }
.chats .rail-eye { flex: none; align-self: flex-end; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: var(--sv-space-1); padding: 0; border: 0; background: none; color: var(--sv-ink-tertiary); opacity: 0; cursor: pointer; }
.chats .rail-eye:hover { color: var(--sv-ink); background: var(--ws-hover); }
.chats .rail-group:is(:hover, :focus-within) .rail-eye, .chats .rail-eye:focus-visible { opacity: 1; }
@media (hover: none) { .chats .rail-eye { opacity: 1; width: 44px; height: 44px; } }
.chats .rail-empty { margin: 0; padding: var(--sv-space-2) var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-text); }
/* A folded group that holds the open chat says so (rail.js holds-current). */
.chats .rail-group-head.holds-current { color: var(--sv-ink); font-weight: 600; }
.chats .rail-group-head.holds-current::after { content: ""; flex: none; width: 6px; height: 6px; margin-left: var(--sv-space-1); border-radius: 50%; background: var(--sv-ink); }

/* organize.js: the ⋯ on project and folder heads, the + by Projects, selected
 * rows, drop targets while dragging, and the selection bar. */
.chats .rail-folder, .chats .rail-section { display: flex; align-items: center; min-height: 28px; }
.chats .rail-more-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; min-height: 28px; height: 28px; margin-left: auto; padding: 0; color: var(--sv-ink-tertiary); opacity: 0; cursor: pointer; }
.chats .rail-more-btn:hover, .chats .rail-more-btn[aria-expanded="true"] { color: var(--sv-ink); background: var(--ws-hover); opacity: 1; }
.chats :is(.rail-group, .rail-folder, .rail-section):is(:hover, :focus-within, .menu-open) .rail-more-btn, .chats .rail-more-btn:focus-visible { opacity: 1; }
.chats .rail-section .rail-more-btn { opacity: 1; }
@media (hover: none) { .chats .rail-more-btn { opacity: 1; width: 44px; height: 44px; } }
.chats .c-row[draggable="true"] > .c-open, .chats [data-project][draggable="true"] { cursor: grab; }
.chats .c-row.selected > .c-open { background: color-mix(in srgb, var(--sv-accent) 16%, var(--ws-sidebar)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sv-accent) 45%, transparent); color: var(--sv-ink); }
.chats .drop-ok { background: color-mix(in srgb, var(--sv-accent) 18%, var(--ws-sidebar)); outline: 2px solid var(--sv-accent); outline-offset: -2px; border-radius: var(--sv-radius); color: var(--sv-ink); }
/* A project or folder dropped above or below a head takes that place: a line shows where. */
.chats [data-drop="before"] { border-radius: 0; box-shadow: inset 0 2px 0 var(--sv-accent); }
.chats [data-drop="after"] { border-radius: 0; box-shadow: inset 0 -2px 0 var(--sv-accent); }
.chats .rail-folder[draggable="true"], .chats button.rail-group-head[draggable="true"] { cursor: grab; }
.chats .rail-drop-none { margin: 0 0 var(--sv-space-2); padding: var(--sv-space-2) var(--sv-space-3); border: var(--sv-hairline-w) dashed var(--sv-hairline-strong); border-radius: var(--sv-radius); color: var(--sv-ink-secondary); font-size: var(--ui-meta); text-align: center; }
.rail-select { display: flex; align-items: center; gap: var(--sv-space-1); margin: var(--sv-space-1) var(--sv-space-2) 0; padding: var(--sv-space-1) var(--sv-space-1) var(--sv-space-1) var(--sv-space-2); border-radius: var(--sv-radius); background: color-mix(in srgb, var(--sv-accent) 14%, var(--ws-sidebar)); color: var(--sv-ink); font-size: var(--ui-text); }
.rail-select[hidden] { display: none; }
.rail-select-count { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.rail-select-move { flex: none; min-height: 28px; padding: 0 var(--sv-space-2); border: 0; border-radius: var(--sv-radius); background: var(--sv-ink); color: var(--ws-sidebar); font-weight: 500; }
/* Asking "Delete N?": the question takes the bar's room. */
.rail-select:has(.armed) :is(.rail-select-move, .rail-select-archive) { display: none; }
.rail-select-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--sv-space-1); min-width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--sv-radius); background: none; color: var(--sv-ink-secondary); white-space: nowrap; }
.rail-select-icon:hover { background: var(--ws-hover); color: var(--sv-ink); }
.rail-select-icon.danger:hover, .rail-select-icon.armed { color: var(--sv-danger); }
.rail-select-icon.armed { padding: 0 var(--sv-space-2); font-weight: 500; }

/* row: the open button plus a ⋯ that overlays the age on hover/focus */
.chats .c-row { position: relative; min-width: 0; }
.chats .c-more {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 28px;
  min-height: 0;
  padding: 0 var(--sv-space-2);
  background: var(--rail-hover);
  color: var(--sv-ink-secondary);
  font-size: 1rem;
  line-height: 1;
}
.chats .c-row:has(> [aria-current="true"]) .c-more { background: var(--rail-selected); }
.chats .c-row .c-more:hover, .chats .c-more[aria-expanded="true"] { background: var(--ws-selected); color: var(--sv-ink); }
.chats .c-row:is(:hover, :focus-within, .menu-open) .c-more { display: inline-flex; }
.chats .c-row:is(:hover, :focus-within, .menu-open) :is(.c-when, .c-status) { visibility: hidden; }
/* rail.js: a chat that looks done and old (archiveHint) offers Archive beside its ⋯ (still: idle rows never move) */
.chats .c-archive {
  position: absolute;
  top: 2px;
  right: 34px;
  bottom: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 28px;
  min-height: 0;
  padding: 0 var(--sv-space-2);
  background: var(--rail-hover);
  color: var(--sv-ink-secondary);
}
.chats .c-archive:hover { background: var(--ws-selected); color: var(--sv-ink); }
.chats .c-stale:is(:hover, :focus-within) .c-archive { display: inline-flex; }
@media (hover: none) {
  .chats .c-row { display: flex; align-items: stretch; }
  .chats .c-row > .c-open { flex: 1; min-width: 0; }
  .chats .c-more { position: static; display: inline-flex; min-width: 44px; background: none; }
  .chats .c-archive { position: static; display: inline-flex; min-width: 44px; background: none; }
  .chats .c-row:has(> [aria-current="true"]) .c-more { background: none; }
  .chats .c-row:is(:hover, :focus-within, .menu-open) :is(.c-when, .c-status) { visibility: visible; }
}

/* inline rename */
.chats .rail-input {
  width: 100%;
  min-height: 32px;
  padding: 0 var(--sv-space-3);
  background: var(--sv-surface-raised);
  border: var(--sv-hairline-w) solid var(--sv-hairline-strong);
  color: var(--sv-ink);
  font-size: var(--ui-text);
}

/* row menu: named actions, fixed and clamped to the viewport by script (v1 row-menu) */
.rail-menu {
  position: fixed;
  z-index: calc(var(--sv-z-overlay) + 1);
  display: grid;
  min-width: 13.5rem;
  max-width: min(20rem, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sv-space-1);
}
.rail-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 var(--sv-space-3);
  background: transparent;
  border: 0;
  border-radius: var(--sv-radius);
  color: var(--sv-ink);
  font-weight: 400;
  text-align: left;
}
.rail-menu-item:hover, .rail-menu-item:focus-visible { background: var(--sv-surface-sunken); }
.rail-menu-item.danger { color: var(--sv-danger); }
.rail-menu-item.armed { font-weight: 500; }
.rail-menu-sep { height: var(--sv-hairline-w); margin: var(--sv-space-1) 0; background: var(--sv-hairline); }

/* Move to project: the same menu, its items the projects (rail.js showMoves) */
.rail-menu-list { display: grid; }
.rail-menu-item .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-menu-item[aria-current="true"] { font-weight: 500; }
.rail-menu-filter {
  width: 100%;
  min-height: 32px;
  margin-bottom: var(--sv-space-1);
  padding: 0 var(--sv-space-3);
  background: var(--sv-surface-sunken);
  border: var(--sv-hairline-w) solid var(--sv-hairline);
  border-radius: var(--sv-radius);
  color: var(--sv-ink);
  font-size: var(--ui-text);
}
.rail-menu-empty { margin: 0; padding: var(--sv-space-2) var(--sv-space-3); color: var(--sv-ink-secondary); }

/* Agent chooser: only the results scroll; search and current/default stay put. */
.rail-menu.agent-menu { display: flex; flex-direction: column; width: min(26rem, calc(100vw - 16px)); min-width: 0; max-width: none; max-height: min(36rem, calc(100dvh - 16px)); overflow: hidden; padding: var(--sv-space-2); }
.agent-menu > :not(.agent-results) { flex: none; }
.agent-menu-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sv-space-2); padding-left: var(--sv-space-2); }
.agent-menu-head h3 { margin: 0; font-size: var(--ui-text); font-weight: 600; }
.agent-menu-head button { min-width: 36px; min-height: 36px; padding: 0; }
.agent-menu-note { margin: 0 var(--sv-space-2) var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.agent-menu .rail-menu-filter { flex: none; min-height: 40px; margin-bottom: var(--sv-space-2); }
.agent-pinned { padding-bottom: var(--sv-space-2); border-bottom: var(--sv-hairline-w) solid var(--sv-hairline); }
.agent-results-heading { display: flex; justify-content: space-between; padding: var(--sv-space-2); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.agent-results { display: block; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.agent-option { min-height: 52px; padding: var(--sv-space-2); }
.agent-option .label { flex: 1; white-space: normal; overflow-wrap: anywhere; }
.agent-name { display: block; font-weight: 500; }
.agent-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; color: var(--sv-ink-secondary); font-size: var(--ui-meta); line-height: 1.4; }
.agent-current { flex: none; margin-left: var(--sv-space-2); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.agent-option[aria-current="true"] { background: var(--sv-surface-sunken); }

/* Touch browsers zoom the page when a field under 16px takes focus. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .rail-search, .chats .rail-input { min-height: 44px; font-size: 16px; }
  .rail-menu-item { min-height: 44px; }
  .rail-menu-filter { min-height: 44px; font-size: 16px; }
}

/* railsearch.js: the search's modes, as Spotlight's (Chats ⌘1, Artifacts ⌘2).
 * Shown while the field has focus or a query. */
.rail-modes { display: flex; gap: 2px; padding: 2px; margin: 2px 0 var(--sv-space-1); border-radius: var(--sv-radius); background: var(--ws-hover); }
.rail-modes[hidden] { display: none; }
.rail-mode {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sv-space-1);
  min-height: 26px;
  padding: 0 var(--sv-space-2);
  background: none;
  border: 0;
  border-radius: calc(var(--sv-radius) - 2px);
  color: var(--sv-ink-secondary);
  font-size: var(--ui-meta);
  font-weight: 500;
}
.rail-mode:hover { color: var(--sv-ink); }
.rail-mode.on { background: var(--sv-surface-raised); color: var(--sv-ink); box-shadow: 0 0 0 var(--sv-hairline-w) var(--sv-hairline); }
.rail-mode-key { font: inherit; font-weight: 400; color: var(--sv-ink-tertiary); font-variant-numeric: tabular-nums; }
@media (hover: none) and (pointer: coarse) {
  .rail-mode { min-height: 36px; }
  .rail-mode-key { display: none; }
}
