/* LineScout Redesign R1 preview — slim header, compact safety banner, map search bar.
   Styling only + new search/banner elements. Every existing control keeps its id and handler. */
body.r1-shell .r1-ico{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;display:block}

/* ---------- 1. Slim header ---------- */
body.r1-shell header.topbar{min-height:calc(56px + var(--top-safe));padding-top:calc(6px + var(--top-safe));padding-bottom:6px;gap:8px;background:linear-gradient(#0f151d,#0b1016)}
body.r1-shell header.topbar .brand{gap:9px}
body.r1-shell header.topbar .header-logo{width:34px;height:34px;border-radius:9px}
body.r1-shell header.topbar h1{display:flex;flex-direction:column;line-height:1.1;font-size:17px;margin:0;min-width:0}
body.r1-shell header.topbar h1 .r1-name{font-weight:800;letter-spacing:.2px;white-space:nowrap}
body.r1-shell header.topbar h1 .r1-sub{font-size:11px;font-weight:600;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.r1-shell header.topbar h1 .preview-badge{font-size:8px;padding:1px 5px;margin-left:4px}
body.r1-shell header.topbar p.header-lede{display:none} /* text kept verbatim in the safety banner */
body.r1-shell header.topbar .net-bar{order:2;min-height:44px;padding:0 11px;font-size:11px;gap:6px}
body.r1-shell header.topbar #btn811{order:3;min-height:44px;padding:0 14px;border-radius:12px;font-size:16px;font-weight:800;box-shadow:0 2px 10px rgba(229,50,45,.45),0 0 0 1px #ff8a8a inset;white-space:nowrap}
body.r1-shell.glove-mode header.topbar #btn811{min-height:52px;font-size:17px}
body.r1-shell.glove-mode header.topbar .net-bar{min-height:52px}
@media (max-width:379px){
  body.r1-shell header.topbar{padding-left:calc(8px + var(--side-safe));padding-right:8px;gap:6px}
  body.r1-shell header.topbar .header-logo{width:30px;height:30px}
  body.r1-shell header.topbar .net-bar{padding:0 9px}
  body.r1-shell header.topbar #btn811{padding:0 11px;font-size:15px}
}

/* ---------- 2. Compact safety banner ---------- */
body.r1-shell .disclaimer.r1-safety{position:relative;z-index:2600;padding:0;font-size:13px;flex-shrink:0}
body.r1-shell .r1-safety-row{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:9px;width:100%;min-height:44px;padding:0 12px;padding-left:calc(12px + var(--side-safe));padding-right:calc(10px + env(safe-area-inset-right,0px));cursor:pointer;color:#ffd7b5;font-size:13px;line-height:1.2}
body.r1-shell .r1-safety-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
body.r1-shell .r1-warn-ico{width:18px;height:18px;color:#ffb070}
body.r1-shell .r1-safety-line{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.r1-shell .r1-safety-more{font-size:11px;font-weight:700;color:#ffb070;text-transform:uppercase;letter-spacing:.05em}
body.r1-shell .r1-chev{width:18px;height:18px;color:#ffb070;transition:transform .2s}
body.r1-shell .r1-safety.open .r1-chev{transform:rotate(180deg)}
body.r1-shell .r1-safety-body{position:absolute;left:0;right:0;top:100%;background:#2a170e;border-bottom:1px solid #5a2e1a;box-shadow:0 16px 32px rgba(0,0,0,.6);padding:4px 12px 14px;padding-left:calc(12px + var(--side-safe));padding-right:calc(12px + env(safe-area-inset-right,0px));max-height:min(70vh,560px);overflow:auto;-webkit-overflow-scrolling:touch;color:#ffd7b5}
body.r1-shell .r1-safety-body[hidden]{display:none}
body.r1-shell .r1-safety-text{margin:0 0 10px;font-size:13.5px;line-height:1.4}
body.r1-shell .r1-links{display:grid;grid-template-columns:1fr 1fr;gap:8px}
body.r1-shell .r1-link{min-height:48px;display:flex;align-items:center;justify-content:center;text-align:center;padding:6px 10px;border-radius:12px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.14);color:#fff;text-decoration:none;font-size:13px;font-weight:700;line-height:1.2}
body.r1-shell .r1-link-call{grid-column:1/-1;background:var(--danger);border-color:var(--danger);font-size:16px}
body.r1-shell .r1-safety-note{font-size:11.5px;color:#d9b79c;margin:10px 0 8px}
body.r1-shell .r1-collapse{width:100%}
body.night-mode.r1-shell .r1-safety-body{background:#22110a}

/* ---------- 3. Search bar on the map ---------- */
body.r1-shell .r1-search{position:absolute;top:8px;left:calc(8px + var(--side-safe));right:calc(8px + env(safe-area-inset-right,0px));z-index:1300;display:flex;gap:8px;margin:0}
body.r1-shell .r1-sbox{flex:1;min-width:0;height:48px;display:flex;align-items:center;gap:8px;padding:0 6px 0 13px;border-radius:15px;background:rgba(20,27,36,.95);border:1px solid #2f3b49;box-shadow:0 6px 20px rgba(0,0,0,.45);color:var(--muted)}
body.r1-shell .r1-sbox:focus-within{border-color:var(--accent)}
body.r1-shell #r1SearchBox{flex:1;min-width:0;height:44px;border:0;outline:0;background:transparent;color:var(--text);font-size:16px;padding:0;-webkit-appearance:none;appearance:none}
body.r1-shell #r1SearchBox::placeholder{color:#8794a5}
body.r1-shell #r1SearchBox::-webkit-search-cancel-button{display:none}
body.r1-shell .r1-clear{min-width:44px;min-height:44px;padding:0;border-radius:12px;background:transparent;color:var(--muted);font-size:22px;line-height:1}
body.r1-shell .r1-clear.hidden{display:none}
body.r1-shell .r1-filter{position:relative;width:48px;min-width:48px;height:48px;min-height:48px;padding:0;border-radius:15px;background:rgba(20,27,36,.95);border:1px solid #2f3b49;box-shadow:0 6px 20px rgba(0,0,0,.45);color:var(--text);display:grid;place-items:center}
body.r1-shell .r1-filter[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
body.r1-shell .r1-badge{position:absolute;top:5px;right:5px;min-width:17px;height:17px;border-radius:9px;background:var(--accent);color:#141008;font-size:10px;font-weight:800;display:grid;place-items:center;padding:0 4px}
body.r1-shell .r1-badge.zero{background:#475569;color:#e2e8f0}
body.r1-shell .r1-suggest{position:absolute;top:62px;left:calc(8px + var(--side-safe));right:calc(8px + env(safe-area-inset-right,0px));z-index:3650;background:#141b24;border:1px solid #2f3b49;border-radius:16px;box-shadow:0 14px 34px rgba(0,0,0,.6);padding:6px;max-height:calc(100% - 74px);overflow:auto;-webkit-overflow-scrolling:touch}
body.r1-shell .r1-suggest.hidden{display:none}
body.r1-shell .r1-sg-head{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:8px 10px 4px}
body.r1-shell .r1-sg{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:6px 10px;border-radius:12px;background:transparent;color:var(--text);text-align:left;font-size:15px;font-weight:600;line-height:1.2}
body.r1-shell .r1-sg:hover,body.r1-shell .r1-sg:focus-visible{background:rgba(255,255,255,.06)}
body.r1-shell .r1-sg small{display:block;font-size:12px;font-weight:500;color:var(--muted);margin-top:2px}
body.r1-shell .r1-sg .r1-sg-ic{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.07);display:grid;place-items:center;flex-shrink:0;color:var(--muted)}
body.r1-shell .r1-sg .r1-sg-ic .r1-ico{width:18px;height:18px}
body.r1-shell .r1-sg-hint{font-size:12px;color:var(--muted);padding:6px 10px 8px;line-height:1.35}

/* ---------- Make room for the search bar (positions only; nothing moved off the map) ---------- */
body.r1-shell .map-fabs{top:64px;gap:6px}
body.r1-shell .map-fabs button{min-height:46px;padding-top:8px;padding-bottom:8px}
body.r1-shell.glove-mode .map-fabs button{min-height:56px}
body.r1-shell .s5-legend{top:64px}
body.r1-shell .leaflet-top{margin-top:56px}
body.r1-shell .gps-bar{top:168px}
body.r1-shell.glove-mode .s5-legend{left:74px}
body.r1-shell.glove-mode .gps-bar{top:200px}
body.r1-shell #routeWarn{top:64px}
body.r1-shell .s2-search-panel{top:calc(118px + var(--top-safe))}

/* ---------- Station chips: one scrollable row, collapsible from the filter button ---------- */
body.r1-shell #stationChips{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:7px 8px;gap:7px;align-items:center}
body.r1-shell #stationChips::-webkit-scrollbar{display:none}
body.r1-shell #stationChips .layer-chip{flex-shrink:0;white-space:nowrap;min-height:44px}
body.r1-shell #stationChips .ql-label{flex-shrink:0}
body.r1-shell #stationChips.r1-collapsed{display:none}
body.r1-shell .leaflet-bottom{margin-bottom:90px}
body.r1-shell.r1-chips-hidden .leaflet-bottom{margin-bottom:30px}
