/* ─── Rail map (/rails) ─────────────────────────────────────────────
   Full-screen map under the top bar with a left panel (desktop) or a bottom sheet (phones).
   Uses the site tokens from style.css. */

body:has(.rails-app) .site-footer { display: none; }
body:has(.rails-app) { overflow: hidden; }

.rails-app {
    --rails-panel-w: 372px;
    --rails-line: var(--border);
    position: fixed; left: 0; right: 0;
    top: var(--rails-top, var(--nav-h, 58px));
    bottom: var(--rails-bottom, 0px);
    display: flex; z-index: 5;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* ─── Panel ─── */
.rails-panel {
    width: var(--rails-panel-w); flex: none;
    display: flex; flex-direction: column; min-height: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--rails-line);
    position: relative; z-index: 2;
}
.rails-sheet-handle { display: none; }
.rails-tabs { display: flex; border-bottom: 1px solid var(--rails-line); flex: none; }
.rails-tab {
    flex: 1; background: none; border: 0; border-bottom: 2px solid transparent;
    color: var(--text-muted); font: 600 13px/1 inherit; font-family: inherit; padding: 13px 0 11px; cursor: pointer;
}
.rails-tab:hover { color: var(--text-secondary); }
.rails-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.rails-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rails-tab .rails-badge { margin-left: 4px; }

.rails-views { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.rails-view { display: flex; flex-direction: column; }
.rails-pad { padding: 14px; display: grid; gap: 10px; }
.rails-hint { margin: 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.rails-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rails-grow { flex: 1; }

.rails-status {
    flex: none; display: flex; align-items: center; gap: 10px; justify-content: space-between;
    padding: 9px 14px; border-top: 1px solid var(--rails-line);
    color: var(--text-muted); font-size: 12px;
}
.rails-review-link { color: var(--text-secondary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.rails-review-link b { background: var(--yellow); color: #111; border-radius: 9px; padding: 1px 6px; font-size: 11px; }
.rails-review-link:hover { color: var(--accent); }

/* Inputs */
.rails-searchbox {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-input); border: 1px solid var(--rails-line); border-radius: 10px; padding: 0 10px;
    color: var(--text-muted);
}
.rails-searchbox:focus-within { border-color: var(--accent); }
.rails-searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 10px 0; }
.rails-searchbox kbd { font: 11px var(--font-mono, ui-monospace, monospace); border: 1px solid var(--rails-line); border-radius: 4px; padding: 1px 5px; color: var(--text-muted); }
.rails-input, .rails-select, .rails-textarea {
    width: 100%; background: var(--bg-input); border: 1px solid var(--rails-line); border-radius: 8px;
    color: var(--text); font: inherit; padding: 8px 10px;
}
.rails-input:focus, .rails-select:focus, .rails-textarea:focus { outline: 0; border-color: var(--accent); }
.rails-textarea { min-height: 64px; resize: vertical; }
.rails-field { display: grid; gap: 4px; }
.rails-field > span { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.rails-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rails-check { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }

/* Buttons */
.rails-chip, .rails-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--bg-elevated); border: 1px solid var(--rails-line); color: var(--text-secondary);
    border-radius: 8px; padding: 6px 11px; font: 600 12.5px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none;
}
.rails-chip:hover, .rails-btn:hover { color: var(--text); border-color: var(--border-light); background: var(--bg-hover); }
.rails-btn-primary { background: var(--accent); border-color: var(--accent); color: #07140c; }
.rails-btn-primary:hover { background: var(--accent-hover); color: #07140c; border-color: var(--accent-hover); }
.rails-btn-danger { color: var(--red); }
.rails-btn:disabled { opacity: .5; cursor: default; }
.rails-btn-block { width: 100%; padding: 9px 12px; }
.rails-chip:focus-visible, .rails-btn:focus-visible, .rails-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rails-icon-btn {
    background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0;
}
.rails-icon-btn:hover { color: var(--text); background: var(--bg-hover); }

.rails-seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--rails-line); border-radius: 8px; padding: 2px; }
.rails-seg button { background: none; border: 0; color: var(--text-muted); font: 600 12px/1 inherit; font-family: inherit; padding: 6px 9px; border-radius: 6px; cursor: pointer; }
.rails-seg button[aria-checked="true"] { background: var(--accent-subtle); color: var(--accent); }

/* Lists */
.rails-list { display: flex; flex-direction: column; padding: 0 6px 10px; }
.rails-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
    background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; width: 100%;
}
.rails-item:hover, .rails-item.is-active { background: var(--bg-hover); }
.rails-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rails-item-main { flex: 1; min-width: 0; }
.rails-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rails-item-sub { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rails-item-chips { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.rails-group-label {
    font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); font-weight: 700;
    padding: 12px 10px 4px;
}
.rails-empty { color: var(--text-muted); padding: 18px 14px; font-size: 13px; line-height: 1.5; }

/* Line chips and swatches */
.rails-lchip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    border-radius: 5px; padding: 2px 7px; font-size: 11.5px; font-weight: 700; line-height: 1.35;
    color: #0b0d10; background: var(--c, #9aa3b2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border: 0; cursor: pointer; font-family: inherit;
}
.rails-lchip.is-network { background: transparent; color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.rails-lchip.is-direct { background: transparent; color: var(--text-secondary); box-shadow: inset 0 0 0 1.5px var(--border-light); }
.rails-lchip.is-planned { opacity: .6; }
.rails-ldot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.rails-sw { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.rails-sw-dash { background: repeating-linear-gradient(90deg, #9aa3b2 0 5px, transparent 5px 8px); }

/* Directions: stop inputs */
.rails-stops { display: grid; background: var(--bg-input); border: 1px solid var(--rails-line); border-radius: 10px; }
.rails-stop { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 10px; position: relative; }
.rails-stop + .rails-stop { border-top: 1px solid var(--rails-line); }
.rails-stop.drag-over { background: var(--accent-subtle); }
.rails-stop.dragging { opacity: .4; }
.rails-stop-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--text-muted); flex: none; background: var(--bg-input); }
.rails-stop:first-child .rails-stop-dot { border-color: var(--blue); background: var(--blue); }
.rails-stop:last-child .rails-stop-dot { border-color: var(--accent); background: var(--accent); }
.rails-stop:not(:last-child)::after {
    content: ""; position: absolute; left: 15px; top: calc(50% + 9px); height: calc(100% - 16px); border-left: 2px dotted var(--border-light); z-index: 1;
}
.rails-stop input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 10px 0; }
.rails-stop .rails-grip { cursor: grab; color: var(--text-muted); padding: 6px 4px; background: none; border: 0; line-height: 0; }
.rails-stop .rails-grip:active { cursor: grabbing; }
.rails-swap {
    position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--rails-line);
    color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.rails-swap:hover { color: var(--accent); }
.rails-stops-wrap { position: relative; margin-right: 10px; }
.rails-ac {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 2px;
    background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 8px;
    box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; padding: 4px;
}

/* Route result */
.rails-summary {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; background: var(--bg-elevated); border-top: 1px solid var(--rails-line); border-bottom: 1px solid var(--rails-line);
}
.rails-summary b { font-size: 20px; letter-spacing: -.01em; }
.rails-summary span { color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.rails-steps { padding: 8px 14px 16px; display: grid; }
.rails-step { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 6px 0; border-radius: 6px; }
.rails-step.is-ride { cursor: pointer; }
.rails-step.is-ride:hover { background: var(--bg-hover); }
.rails-step-mark { display: flex; justify-content: center; }
.rails-step-mark .rails-bar { width: 4px; border-radius: 2px; background: var(--c); }
.rails-step-mark .rails-bar.is-dashed { background: repeating-linear-gradient(180deg, var(--c) 0 5px, transparent 5px 9px); }
.rails-step-mark .rails-node { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--text-secondary); background: var(--bg-card); margin-top: 3px; }
.rails-step-mark .rails-node.is-start { border-color: var(--blue); background: var(--blue); }
.rails-step-mark .rails-node.is-end { border-color: var(--accent); background: var(--accent); }
.rails-step-mark .rails-node.is-change { border-color: var(--yellow); }
.rails-step-st { font-weight: 650; font-weight: 600; }
.rails-step-sub { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rails-step-change { color: var(--yellow); font-size: 12px; font-weight: 600; }
.rails-cmd {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; max-width: 100%;
    background: var(--bg-input); border: 1px solid var(--rails-line); border-radius: 6px; padding: 3px 4px 3px 8px;
    font: 12px var(--font-mono, ui-monospace, Consolas, monospace); color: var(--text);
}
.rails-cmd code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rails-cmd button { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; font: 600 11px inherit; font-family: inherit; }
.rails-cmd button:hover { color: var(--accent); background: var(--bg-hover); }
.rails-note { font-size: 12px; color: var(--text-muted); padding: 0 14px 14px; line-height: 1.5; }
.rails-warn { margin: 12px 14px; padding: 10px 12px; border-radius: 8px; background: rgba(224,177,58,.1); color: var(--yellow); font-size: 13px; line-height: 1.45; }
.rails-err { margin: 12px 14px; padding: 10px 12px; border-radius: 8px; background: rgba(240,96,92,.1); color: var(--red); font-size: 13px; line-height: 1.45; }
.rails-ok { margin: 12px 14px; padding: 10px 12px; border-radius: 8px; background: var(--accent-subtle); color: var(--accent); font-size: 13px; line-height: 1.45; }

/* Detail (station / line) */
.rails-detail-head { padding: 12px 14px 12px; border-bottom: 1px solid var(--rails-line); display: grid; gap: 6px; }
.rails-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--text-muted); font: 600 12px inherit; font-family: inherit; cursor: pointer; padding: 0; justify-self: start; }
.rails-back:hover { color: var(--text); }
.rails-detail-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.rails-detail-meta { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.rails-detail-meta .mono { font-family: var(--font-mono, ui-monospace, Consolas, monospace); }
.rails-pill { display: inline-block; border-radius: 5px; padding: 1px 6px; font-size: 11px; font-weight: 700; background: var(--bg-elevated); color: var(--text-secondary); }
.rails-pill.is-planned { background: rgba(74,144,217,.15); color: var(--blue); }
.rails-pill.is-disused { background: rgba(240,96,92,.12); color: var(--red); }
.rails-sec { padding: 12px 14px; border-bottom: 1px solid var(--rails-line); }
.rails-sec:last-child { border-bottom: 0; }
.rails-sec h3 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.rails-sec p { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.rails-chiprow { display: flex; gap: 5px; flex-wrap: wrap; }
.rails-btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.rails-btnrow .rails-btn { flex: 1; }
.rails-dep { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--rails-line) 60%, transparent); align-items: center; }
.rails-dep:last-child { border-bottom: 0; }
.rails-dep-name { font-weight: 600; background: none; border: 0; color: var(--text); padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.rails-dep-name:hover { color: var(--accent); }
.rails-dep-dist { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.rails-dep .rails-cmd { margin-top: 0; grid-column: 1 / -1; justify-self: start; }
.rails-more { background: none; border: 0; color: var(--accent); font: 600 12.5px inherit; font-family: inherit; cursor: pointer; padding: 6px 0 0; }

/* Strip map for a line */
.rails-strip { display: grid; }
.rails-strip-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; min-height: 32px; position: relative; }
.rails-strip-row::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 4px; background: var(--c); }
.rails-strip-row:first-child::before { top: 50%; }
.rails-strip-row:last-child::before { bottom: 50%; }
.rails-strip-row.is-gap::before { background: repeating-linear-gradient(180deg, var(--c) 0 4px, transparent 4px 8px); }
.rails-strip-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-card); border: 3px solid var(--c); justify-self: center; position: relative; z-index: 1; }
.rails-strip-dot.is-x { width: 14px; height: 14px; background: #fff; border-color: #0b0d10; box-shadow: 0 0 0 2px var(--c); }
.rails-strip-name { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.rails-strip-name button { background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; padding: 0; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rails-strip-name button:hover { color: var(--accent); }
.rails-strip-name .rails-chiprow { flex-wrap: nowrap; overflow: hidden; }
.rails-strip-name .rails-lchip { font-size: 10px; padding: 1px 5px; }
.rails-speedbar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 8px; }
.rails-speedbar span { height: 6px; border-radius: 3px; background: var(--bg-elevated); }
.rails-speedbar span.on { background: var(--accent); }

/* Suggest */
.rails-form { display: grid; gap: 10px; padding: 14px; }
.rails-form h3 { margin: 0; font-size: 14px; }
.rails-subtabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 14px 0; }
.rails-subtabs .rails-chip[aria-pressed="true"] { background: var(--accent-subtle); color: var(--accent); border-color: rgba(56,217,122,.35); }
.rails-draft { margin: 0 14px; border: 1px dashed var(--border-light); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.rails-draft h4 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.rails-draft ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.rails-draft li { padding-right: 24px; position: relative; }
.rails-draft li button { position: absolute; right: 0; top: -2px; }
.rails-picker { position: relative; }
.rails-mine { padding: 0 14px 16px; display: grid; gap: 6px; }
.rails-mine-item { font-size: 12.5px; color: var(--text-secondary); border-left: 3px solid var(--border-light); padding: 2px 0 2px 8px; }
.rails-mine-item.is-approved { border-color: var(--accent); }
.rails-mine-item.is-rejected { border-color: var(--red); }
.rails-mine-item.is-pending { border-color: var(--yellow); }
.rails-mine-item small { color: var(--text-muted); display: block; }

/* ─── Map ─── */
.rails-mapwrap { flex: 1; position: relative; min-width: 0; }
.rails-map { position: absolute; inset: 0; background: #12232d; }
.rails-map.leaflet-container { font-family: inherit; }
.rails-map.is-picking { cursor: crosshair; }
.rails-ctrls { position: absolute; right: 12px; top: 12px; z-index: 500; display: grid; gap: 6px; }
.rails-ctrls button {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
    background: rgba(18,21,26,.92); border: 1px solid var(--rails-line); color: var(--text); font: 600 17px/1 inherit; font-family: inherit;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.rails-ctrls button:hover, .rails-ctrls button[aria-expanded="true"] { color: var(--accent); }
.rails-ctrls button:focus-visible { outline: 2px solid var(--accent); }
.rails-layers {
    position: absolute; right: 54px; top: 12px; z-index: 500; width: 230px;
    background: rgba(18,21,26,.97); border: 1px solid var(--rails-line); border-radius: 12px; padding: 12px 14px;
    display: grid; gap: 7px; box-shadow: var(--shadow); font-size: 13px;
}
.rails-layers h4 { margin: 4px 0 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.rails-layers h4:first-child { margin-top: 0; }
.rails-layers label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); cursor: pointer; }
.rails-layers input { accent-color: var(--accent); margin: 0; }
.rails-key { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.rails-dot { width: 9px; height: 9px; border-radius: 50%; background: #dfe4ea; border: 2px solid #0b0d10; box-sizing: content-box; }
.rails-dot-x { width: 11px; height: 11px; background: #fff; border-width: 2.5px; }
.rails-dot-od { background: #dfe4ea; box-shadow: 0 0 0 2px #5b8def; }
.rails-credit { margin: 4px 0 0; color: var(--text-muted); font-size: 11.5px; line-height: 1.45; }
.rails-credit a { color: var(--text-secondary); }
.rails-coord {
    position: absolute; left: 12px; bottom: 12px; z-index: 500; pointer-events: none;
    background: rgba(18,21,26,.88); border: 1px solid var(--rails-line); border-radius: 6px; padding: 4px 8px;
    font: 11.5px var(--font-mono, ui-monospace, Consolas, monospace); color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.rails-menu {
    position: absolute; z-index: 700; min-width: 210px; padding: 4px;
    background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 10px; box-shadow: var(--shadow);
}
.rails-menu-head { padding: 6px 10px 4px; color: var(--text-muted); font-size: 11.5px; }
.rails-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.rails-menu button:hover { background: var(--bg-hover); }
.rails-toast {
    position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 800;
    background: var(--bg-elevated); border: 1px solid var(--border-light); color: var(--text); border-radius: 8px;
    padding: 8px 14px; font-size: 13px; box-shadow: var(--shadow);
}

/* Leaflet labels */
.rails-label.leaflet-tooltip {
    background: none; border: 0; box-shadow: none; padding: 0; margin-left: 8px;
    color: #eef1f5; font: 600 11.5px/1 Inter, system-ui, sans-serif; white-space: nowrap;
    text-shadow: 0 0 3px #0b0d10, 0 0 3px #0b0d10, 0 0 5px #0b0d10;
}
.rails-label.leaflet-tooltip::before { display: none; }
.rails-label.is-minor { font-weight: 500; color: #c9d0da; font-size: 11px; }
.rails-map.hide-minor .rails-label.is-minor, .rails-map.hide-labels .rails-label { display: none; }
.rails-map.dim-labels .rails-label:not(.is-hl) { opacity: .35; }
.rails-hover.leaflet-tooltip {
    background: var(--bg-elevated); border: 1px solid var(--border-light); color: var(--text); border-radius: 6px;
    font: 600 12px Inter, system-ui, sans-serif; box-shadow: var(--shadow); padding: 4px 8px;
}
.rails-hover.leaflet-tooltip::before { display: none; }

/* ─── Phones: the panel is a bottom sheet over the map ─── */
@media (max-width: 860px) {
    .rails-app { display: block; }
    .rails-mapwrap { position: absolute; inset: 0; }
    .rails-panel {
        position: absolute; left: 0; right: 0; bottom: 0; width: auto; z-index: 600;
        height: var(--sheet-h, 50%); border-right: 0; border-top: 1px solid var(--border-light);
        border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.4);
        transition: height .22s ease;
    }
    .rails-panel.is-dragging { transition: none; }
    .rails-panel[data-sheet="peek"] { --sheet-h: 142px; }
    .rails-panel[data-sheet="half"] { --sheet-h: 52%; }
    .rails-panel[data-sheet="full"] { --sheet-h: calc(100% - 52px); }
    .rails-sheet-handle {
        display: block; background: none; border: 0; padding: 8px 0 2px; cursor: grab; touch-action: none; flex: none;
    }
    .rails-sheet-handle span { display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--border-light); margin: 0 auto; }
    .rails-tab { padding: 10px 0 9px; }
    .rails-ctrls { top: 10px; right: 10px; }
    .rails-ctrls #railsZoomIn, .rails-ctrls #railsZoomOut { display: none; }
    .rails-layers { right: 52px; top: 10px; width: min(230px, calc(100vw - 72px)); }
    .rails-coord { display: none; }
    .rails-status { padding-bottom: max(9px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .rails-panel { transition: none; } }

/* Elements toggled with the hidden attribute must stay hidden even when a rule above sets display. */
.rails-app [hidden] { display: none !important; }
.rails-item-title, .rails-item-sub { display: block; }
