/* "Strykningar och reserver på V64" – control room. Palette: charcoal black, dark blue-grey, mint for active,
   amber for control in progress, coral for struck, light cyan for reserve, white primary text. */
.re {
  --re-black: #0f1216; --re-slate: #1b2430; --re-slate-2: #263241; --re-slate-3: #34435a; --re-line: #3b4a60;
  --re-mint: #5eead4; --re-mint-ink: #0b3d36; --re-amber: #fbbf24; --re-amber-ink: #4a2e00; --re-coral: #fb7185; --re-coral-ink: #5a0f1f;
  --re-cyan: #a5f3fc; --re-cyan-ink: #0e4f5c; --re-white: #f8fafc; --re-grey: #aab6c6; --re-pale: #e8edf3;
  background: var(--re-black);
  color: var(--re-white);
}
.re h1, .re h2, .re h3, .re h4 { color: var(--re-white); letter-spacing: -.01em; }
.re a { color: var(--re-cyan); }
.re .muted { color: var(--re-grey); }
.re .tabular, .re-chip, .re-time-h, .re-price strong, .re-screen-leg, .re-row-leg, .re-legbtn { font-variant-numeric: tabular-nums; }

/* Hero */
.re-hero { background: linear-gradient(180deg, var(--re-slate) 0, var(--re-black) 100%); padding-block: 8px 30px; }
.re-hero .breadcrumbs, .re-hero .breadcrumbs a { color: rgba(255, 255, 255, .85); }
.re-hero .breadcrumbs li + li::before { color: rgba(255, 255, 255, .4); }
.re-hero h1 { font-size: clamp(30px, 4.4vw, 56px); margin: 12px 0 6px; }
.re-tagline { font-size: clamp(16px, 1.6vw, 21px); color: var(--re-mint); font-weight: 600; margin: 0 0 18px; max-width: 60ch; }
.re-panel { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.re-screen { display: grid; gap: 6px; padding: 14px 12px 12px; border-radius: 10px; background: var(--re-slate-2); border: 2px solid var(--re-line); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .35); min-width: 0; }
.re-screen-leg { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--re-grey); }
.re-screen-msg { font-size: clamp(15px, 1.4vw, 19px); font-weight: 800; }
.re-screen.is-alert { border-color: var(--re-coral); background: #2a1a22; }
.re-fiction { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--re-slate-2); color: var(--re-grey); border: 1px dashed var(--re-line); margin: 0 0 8px; }
.re-fiction-light { margin-top: 10px; }

/* Status chips: symbol + text */
.re-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .02em; background: var(--re-slate-3); color: var(--re-white); white-space: nowrap; }
.re-status svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.re-status-klar { background: var(--re-pale); color: var(--re-slate); }
.re-status-klar svg { fill: currentColor; stroke: none; }
.re-status-struken { background: var(--re-coral); color: var(--re-coral-ink); }
.re-status-kontroll { background: var(--re-amber); color: var(--re-amber-ink); }
.re-status-aktiv { background: var(--re-mint); color: var(--re-mint-ink); }
.re-status-rattad { background: var(--re-white); color: var(--re-slate); }
.re-legend { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.re-legend li { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--re-slate-2); }

/* Chips */
.re-chip { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 15px; background: var(--re-slate-3); color: var(--re-white); border: 2px solid transparent; }
.re-chip.is-ord { background: var(--re-white); color: var(--re-slate); }
.re-chip.is-res { background: transparent; color: var(--re-cyan); border-color: var(--re-cyan); }
.re-chip.is-active { background: var(--re-mint); color: var(--re-mint-ink); }
.re-chip.is-struck { background: #3a2028; color: var(--re-coral); border-color: var(--re-coral); grid-auto-flow: column; gap: 6px; }
.re-chip.is-struck s { text-decoration-thickness: 2px; }
.re-struck-lbl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.re-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Paper */
.re-layout { padding-block: 24px 48px; }
.re-paper { background: var(--re-slate); border-radius: var(--radius); padding: clamp(20px, 3vw, 40px); max-width: none; border: 1px solid var(--re-line); }
.re-paper h2 { margin-top: 44px; }
.re-paper p, .re-paper li { max-width: 72ch; }
.re-paper ul + p, .re-paper ol + p, .re-paper .table-scroll + p, .re-paper .re-fig + p { margin-top: 12px; }
.re-paper .re-rows > li, .re-paper .re-legend > li, .re-paper .re-minis > li, .re-paper .re-panel > li, .re-paper .re-channels > li { max-width: none; }
.re-paper .data-table th { background: var(--re-slate-3); color: var(--re-white); }
.re-paper .data-table td { border-color: var(--re-line); color: var(--re-white); }
.re-paper .data-table { background: var(--re-slate-2); }
.re-paper code.gv-row { background: var(--re-slate-3); color: var(--re-white); }
.re-ingress { font-size: clamp(17px, 1.5vw, 20px); font-weight: 600; }
.re-k { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--re-grey); margin: 0 0 6px; }
.re-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.re-two > * { min-width: 0; }
.re-card { padding: 14px 16px; border-radius: 8px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-card h2, .re-card h3 { margin-top: 0; }
.re-check-after { border-top: 4px solid var(--re-mint); }
.re-check { border-top: 4px solid var(--re-cyan); }
.re-btn { min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 2px solid var(--re-line); background: var(--re-slate-2); color: var(--re-white); font: 700 14px/1.2 var(--font); cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.re-btn:hover { border-color: var(--re-cyan); }
.re-btn[aria-pressed="true"] { background: var(--re-white); border-color: var(--re-white); color: var(--re-slate); }
.re-case, .re-phase { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* Receipt */
.re-receipt { margin: 14px 0; padding: 16px; border-radius: 12px; background: var(--re-black); border: 2px solid var(--re-line); }
.re-receipt-head { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.re-modes { display: inline-flex; gap: 6px; padding: 4px; border-radius: 10px; background: var(--re-slate-2); }
.re-mode { display: grid; padding: 8px 12px; border-radius: 8px; font-weight: 800; color: var(--re-grey); }
.re-mode small { font-weight: 600; font-size: 11px; }
.re-mode.is-on { background: var(--re-white); color: var(--re-slate); }
.re-modes-solo { margin: 12px 0; }
.re-price { display: grid; grid-template-columns: auto auto; gap: 4px 18px; padding: 10px 14px; border-radius: 10px; background: var(--re-slate-2); border: 2px solid var(--re-mint); align-items: baseline; }
.re-price span { font-weight: 700; white-space: nowrap; }
.re-price strong { font-size: 26px; color: var(--re-mint); margin-right: 4px; }
.re-price small { grid-column: 1 / -1; color: var(--re-grey); font-size: 12px; max-width: 32ch; }
.re-price-solo { margin: 12px 0; width: max-content; max-width: 100%; }
.re-legnav { display: none; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.re-legbtn { min-height: 44px; min-width: 44px; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--re-line); background: var(--re-slate-2); color: var(--re-white); font: 800 13px/1 var(--font); cursor: pointer; }
.re-legbtn[aria-pressed="true"] { background: var(--re-cyan); border-color: var(--re-cyan); color: var(--re-cyan-ink); }
.re-rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.re-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 100px 100px minmax(120px, auto); gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--re-slate-2); }
.re-row-leg { font-weight: 800; color: var(--re-grey); }
.re-row-ord .re-k, .re-row-res .re-k { margin-bottom: 4px; }
.re-row-status { justify-self: end; }
.re-row-ord small.tabular { display: inline-block; margin: 0 4px; color: var(--re-grey); font-weight: 700; }
.re-receipt[data-phase="after"] .re-row[data-leg="3"] { outline: 2px solid var(--re-mint); outline-offset: 2px; }
.re-system { margin: 12px 0 0; color: var(--re-grey); }
.re-incident { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: #1f1a24; border: 2px solid var(--re-coral); }
.re-incident dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.re-incident dt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--re-grey); }
.re-incident dd { margin: 4px 0 0; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Standby */
.re-standby { margin: 14px 0; padding: 16px; border-radius: 12px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-standby-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-top: 8px; align-items: stretch; }
.re-slot { display: grid; gap: 6px; padding: 14px; border-radius: 10px; background: var(--re-slate); border: 2px solid var(--re-line); transition: opacity .25s, transform .25s, border-color .25s; }
.re-slot-active { border-color: var(--re-mint); }
.re-slot-r1, .re-slot-r2 { border-style: dashed; }
.re-slot-r2 { transform: translateX(10px) scale(.96); opacity: .8; }
.re-slot-chip { min-height: 36px; display: flex; align-items: center; }
.re-slot-lbl { font-weight: 700; font-size: 14px; }
.re-standby[data-case="one"] .re-slot-r1 { border-style: solid; border-color: var(--re-mint); }
.re-standby[data-case="two"] .re-slot-r1 { opacity: .35; border-color: var(--re-coral); }
.re-standby[data-case="two"] .re-slot-r2 { transform: none; opacity: 1; border-style: solid; border-color: var(--re-mint); }
.re-standby .small { margin: 10px 0 0; color: var(--re-grey); }

/* Before/after, times */
.re-before-after { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 14px 0; padding: 16px; border-radius: 12px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-ba { padding: 12px 14px; border-radius: 10px; background: var(--re-slate); }
.re-ba p { margin: 4px 0; }
.re-ba-arrow { font-size: 28px; color: var(--re-grey); }
.re-ba-note { grid-column: 1 / -1; margin: 0; font-weight: 800; font-size: 17px; color: var(--re-mint); }
.re-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.re-time { padding: 14px 16px; border-radius: 10px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-time-h { display: block; font-size: 30px; font-weight: 800; color: var(--re-cyan); line-height: 1; margin-bottom: 4px; }
.re-time p { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.re-times .re-ba-note, .re-times .small { grid-column: 1 / -1; }
.re-times .small { margin: 0; }

/* Channels */
.re-channels { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.re-ch { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 190px; padding: 10px; border-radius: 10px; background: var(--re-slate-2); border: 1px solid var(--re-line); text-align: center; min-width: 0; }
.re-ch-head { font-weight: 800; color: var(--re-grey); font-variant-numeric: tabular-nums; }
.re-ch-line { display: block; width: 4px; margin: 0 auto; border-radius: 2px; background: var(--re-line); }
.re-ch.has-inc .re-ch-line { background: var(--re-coral); }
.re-ch-inc { display: grid; gap: 6px; justify-items: center; font-size: 12px; font-weight: 700; color: var(--re-mint); }
.re-ch-ok { font-size: 12px; color: var(--re-grey); font-weight: 600; }

/* Modes */
.re-modes2 { margin: 14px 0; padding: 14px 16px; border-radius: 10px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-mode-body p { margin: 8px 0; }
.re-endpoint { padding: 10px 12px; border-radius: 8px; background: var(--re-black); border-left: 4px solid var(--re-mint); }
.re-endpoint .re-k { display: inline; margin-right: 6px; }

/* Track figures */
.re-tracks figure { margin: 0; }
.re-fig { width: 100%; height: auto; display: block; border-radius: 10px; }
.re-asphalt { fill: var(--re-slate-2); }
.re-startline { stroke: var(--re-white); stroke-width: 3; stroke-dasharray: 8 6; }
.re-tl { fill: var(--re-grey); font: 700 12px/1 var(--font); }
.re-path { fill: none; stroke-width: 4; stroke-linecap: round; }
.re-path-lead { stroke: var(--re-cyan); }
.re-path-new { stroke: var(--re-mint); stroke-dasharray: 10 8; }
.re-path-rygg { stroke: var(--re-grey); stroke-dasharray: 3 6; }
.re-path-rygg.is-changed { stroke: var(--re-amber); }
.re-tp circle { fill: var(--re-white); }
.re-tp text { fill: var(--re-slate); font: 800 14px/1 var(--font); font-variant-numeric: tabular-nums; }
.re-tp-back circle { fill: var(--re-pale); }
.re-tp.is-gone circle { fill: none; stroke: var(--re-coral); stroke-width: 2; stroke-dasharray: 4 3; }
.re-tp.is-gone text { fill: var(--re-coral); text-decoration: line-through; }

/* Reduced */
.re-reduced { margin: 14px 0; padding: 14px 16px; border-radius: 10px; background: var(--re-slate-2); border: 1px solid var(--re-line); }
.re-reduced .small { margin: 4px 0 8px; }
.re-red-panel p { margin: 8px 0; }
.re-minis { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.re-mini { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--re-black); border: 1px solid var(--re-line); }
.re-mini-res { font-weight: 700; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Result station */
.re-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.re-result { padding: 14px 16px; border-radius: 10px; background: var(--re-slate-2); border: 2px solid var(--re-line); }
.re-result.is-ok { border-color: var(--re-mint); }
.re-result.is-fail { border-color: var(--re-coral); border-style: dashed; }
.re-result dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.re-result dt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--re-grey); }
.re-result dd { margin: 4px 0 0; font-weight: 800; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.re-results .small { grid-column: 1 / -1; margin: 0; }

/* Mistakes reuse */
.re-mistakes > div { background: var(--re-slate-2); border-left-color: var(--re-amber); color: var(--re-white); }

@media (prefers-reduced-motion: reduce) {
  .re-btn, .re-slot, .re-legbtn { transition: none; }
  .re-slot-r2 { transform: none; }
}
@media (max-width: 1000px) {
  .re-row { grid-template-columns: 56px minmax(0, 1fr) 90px 90px; }
  .re-row-status { grid-column: 2 / -1; justify-self: start; }
  .re-incident dl, .re-result dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .re-hero h1 { font-size: clamp(26px, 8vw, 36px); }
  .re-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .re-legend li { grid-template-columns: 1fr; gap: 4px; }
  .re-two, .re-standby-grid, .re-times, .re-results, .re-minis, .re-receipt-head { grid-template-columns: 1fr; }
  .re-before-after { grid-template-columns: 1fr; }
  .re-ba-arrow { transform: rotate(90deg); justify-self: center; }
  .re-legnav { display: flex; }
  .re-receipt[data-leg] .re-row { display: none; }
  .re-receipt[data-leg="1"] .re-row[data-leg="1"], .re-receipt[data-leg="2"] .re-row[data-leg="2"], .re-receipt[data-leg="3"] .re-row[data-leg="3"],
  .re-receipt[data-leg="4"] .re-row[data-leg="4"], .re-receipt[data-leg="5"] .re-row[data-leg="5"], .re-receipt[data-leg="6"] .re-row[data-leg="6"] { display: grid; grid-template-columns: 1fr 1fr; }
  .re-row-leg, .re-row-ord, .re-row-status { grid-column: 1 / -1; }
  .re-slot-r2 { transform: none; opacity: 1; }
  .re-channels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .re-ch { min-height: 150px; }
  .re-price { width: 100%; }
  .sp-mistakes.re-mistakes { grid-template-columns: 1fr; }
}
