/* MiMrail: house style of bexhillwest.co.uk (WordPress "Extendable" theme) */
:root{
  --background:#ffffff;--foreground:#0B0620;--primary:#381d92;--secondary:#1C0A63;--tertiary:#F2F2FA;
  --muted:#5d5873;--faint:#8a85a3;--line:#e2e0ee;--line-strong:#cfcbe3;
  --primary-dim:rgba(56,29,146,.08);--primary-soft:rgba(56,29,146,.16);
  --glory-red:#B22234;--dim:#5d5873;   /* kept for warnings carried over from TrackIT! USA */
  --eu-gold:#E0A800;                    /* the EU flag's gold, darkened to read on white: the "!" of TrackIT! */
  --green:#1d7a4c;--amber:#a15c00;--red:#b42318;
  --radius:12px;--radius-sm:8px;--pill:32px;
  --shadow:0 6px 24px rgba(11,6,32,.08);
  /* drawing */
  --paper:#fbfbfe;--rail:#a9a6b8;--rail-edge:#3d3852;--tie:#ece2d2;--tie-edge:#b79b77;--headblock:#dfccae;
  --gauge:#381d92;--centre:#8a85a3;--keypt:#381d92;--board:#f6f1e7;--board-edge:#b9a27c;--room-floor:#fbfbfd;--room-wall:#8d8a99;--room-wall-edge:#4b4859;--room-glass:#dbeaf7;--room-fixture:#e7e4ee;
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:Inter,sans-serif;background:var(--background);color:var(--foreground);overflow:hidden;height:100vh;font-size:15px;-webkit-font-smoothing:antialiased}
.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 24px;height:64px;background:var(--background);border-bottom:1px solid var(--line);position:relative;z-index:100}
.header-brand{display:flex;align-items:baseline;gap:12px;min-width:0;flex:0 0 auto}
.header-brand h1,.header-brand .flag{flex:0 0 auto}
.header-brand h1{font-size:26px;font-weight:700;letter-spacing:-.02em;color:var(--foreground);white-space:nowrap}
.header-brand h1 span{color:var(--primary)}
.header-brand h1 .home-link{color:inherit;text-decoration:none}
.header-brand h1 .bang{color:var(--eu-gold)}
.header-brand .flag{font-size:12px;font-weight:600;color:var(--primary);background:var(--tertiary);padding:3px 10px;border-radius:var(--pill);align-self:center}
.header-brand .tagline{font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-actions{display:flex;align-items:center;gap:10px}
.site-link{font-size:14px;color:var(--foreground);text-decoration:none;padding:6px 4px;white-space:nowrap}
.site-link:hover{color:var(--primary);text-decoration:underline;text-underline-offset:3px}
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 18px;border:1px solid var(--line-strong);border-radius:var(--pill);background:var(--background);color:var(--foreground);font-family:Inter,sans-serif;font-size:14px;font-weight:500;cursor:pointer;transition:.15s;white-space:nowrap}
.btn:hover{border-color:var(--primary);color:var(--primary)}
.btn:active{transform:scale(.97)}
.btn-accent{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-accent:hover{background:var(--secondary);border-color:var(--secondary);color:#fff}
.btn-icon{width:36px;height:36px;padding:0;justify-content:center;font-size:16px}
.app-layout{display:flex;height:calc(100vh - 64px)}
.sidebar{width:340px;min-width:340px;background:var(--background);border-right:1px solid var(--line);overflow:hidden auto}
.sidebar::-webkit-scrollbar{width:6px}.sidebar::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:4px}
.panel{border-bottom:1px solid var(--line)}
.panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;cursor:pointer;background:var(--tertiary);transition:background .15s}
.panel-header:hover{background:#ebebf7}
.panel-header h3{font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--foreground)}
.panel-header .right{display:flex;align-items:center;gap:8px}
.step-badge{background:var(--background);color:var(--primary);font-size:12px;font-weight:600;padding:2px 10px;border-radius:var(--pill);border:1px solid var(--primary-soft)}
.step-badge.done{color:var(--green);border-color:rgba(29,122,76,.25)}
.step-badge.blue{color:var(--primary)}
.step-badge.rule{color:var(--red);border-color:rgba(180,35,24,.25)}
.panel-chevron{color:var(--muted);transition:transform .2s;font-size:13px}
.panel.collapsed .panel-body{display:none}
/* a folded panel says in one line what it holds */
.panel-sum{flex:1;min-width:0;margin:0 10px;font-size:13px;font-weight:400;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.panel:not(.collapsed) .panel-sum{display:none}
.panel.collapsed .panel-header.has-sum .step-badge{display:none}
/* the Layout panel: its tools, then four tabs (kept in view), then folding sections */
.ly-tabs{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;gap:4px;background:var(--background);padding:8px 0;margin:8px 0 2px;border-bottom:1px solid var(--line)}
.ly-tabs button{flex:1 1 auto;border:0;background:var(--tertiary);color:var(--muted);font:500 12.5px Inter,sans-serif;padding:6px 6px;border-radius:var(--pill);cursor:pointer;white-space:nowrap}
.ly-tabs button:hover{color:var(--foreground)}
.ly-tabs button.on{background:var(--primary);color:#fff}
.ly-tab-n{display:none;margin-left:5px;min-width:16px;padding:0 5px;border-radius:8px;background:var(--red);color:#fff;font-size:11px;font-weight:600;line-height:16px}
.ly-tab-n.on{display:inline-block}
.ly-sec-head{display:flex;align-items:baseline;gap:6px;cursor:pointer;user-select:none}
.ly-sec-head:hover .ly-sec-title{color:var(--primary)}
.ly-sec-chev{display:inline-block;width:10px;font-size:11px;color:var(--muted);transition:transform .15s}
.ly-sec.folded .ly-sec-chev{transform:rotate(-90deg)}
.ly-sec-sum{flex:1;min-width:0;font-size:13px;font-weight:400;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ly-sec:not(.folded) .ly-sec-sum{display:none}
.ly-sec.folded .ly-sec-body{display:none}
#lyList{max-height:340px;overflow:auto}
.panel.collapsed .panel-chevron{transform:rotate(-90deg)}
.panel-body{padding:16px 20px 20px}
.form-row{display:flex;gap:10px;align-items:flex-end;margin-bottom:12px}
.form-group{display:flex;flex-direction:column;gap:5px;flex:1 1 0}
.form-group label{font-size:13px;font-weight:500;color:var(--muted)}
.form-group input,.form-group select{padding:8px 12px;background:var(--background);border:1px solid var(--line-strong);border-radius:var(--radius-sm);color:var(--foreground);font-family:Inter,sans-serif;font-size:14px;font-variant-numeric:tabular-nums;outline:none;transition:border-color .15s;width:100%}
.form-group input:focus,.form-group select:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-dim)}
.form-group select{cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23381d92'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:30px}
.seg{display:flex;background:var(--tertiary);border-radius:var(--pill);padding:3px;gap:2px}
/* (in the side panel, a choice that does not fit its width wraps onto a second line: 18 px corners are a pill on one
   line and a rounded box on two) */
.sidebar .seg{flex-wrap:wrap;border-radius:18px}
.seg button{flex:1;border:0;background:transparent;color:var(--muted);font-family:Inter,sans-serif;font-size:13px;font-weight:500;padding:6px 10px;border-radius:var(--pill);cursor:pointer;white-space:nowrap}
.seg button:hover{color:var(--foreground)}
.seg button.on{background:var(--primary);color:#fff}
/* the Draw tool's kind the T key gives next: a small T on it */
.seg button.t-next::after{content:'T';display:inline-block;margin-left:5px;padding:0 4px;border:1px solid currentColor;border-radius:4px;font-size:10px;line-height:14px;font-weight:600;vertical-align:1px}
.seg button:disabled{opacity:.4;cursor:not-allowed}
.info-text{font-size:13px;color:var(--muted);line-height:1.55;margin-bottom:10px}
.info-text b{color:var(--foreground);font-weight:600}
.info-text.highlight{color:var(--foreground);background:var(--tertiary);padding:10px 12px;border-radius:var(--radius-sm);border-left:3px solid var(--primary)}
.overlay-controls{display:flex;flex-direction:column;gap:6px}
.overlay-toggle{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius-sm)}
.overlay-toggle span{font-size:14px;color:var(--foreground)}
.toggle-switch{position:relative;width:38px;height:22px;cursor:pointer}
.toggle-switch input{display:none}
.toggle-track{position:absolute;inset:0;background:var(--line-strong);border-radius:var(--pill);transition:.2s}
.toggle-switch input:checked+.toggle-track{background:var(--primary)}
.toggle-track::after{content:"";position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;top:3px;left:3px;transition:transform .2s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.toggle-switch input:checked+.toggle-track::after{transform:translateX(16px)}
.dim-list{display:flex;flex-direction:column}
.dim-item{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px;font-variant-numeric:tabular-nums}
.dim-item .k{color:var(--muted);font-size:13.5px}
.dim-item .val{color:var(--foreground);font-weight:500;text-align:right}
.dim-item .src{font-size:10.5px;letter-spacing:.3px;padding:1px 7px;border-radius:var(--pill);margin-left:8px;font-weight:600;vertical-align:1px}
.src.area{background:rgba(29,122,76,.10);color:var(--green)}
.src.calc{background:var(--primary-dim);color:var(--primary)}
.src.derived{background:rgba(161,92,0,.10);color:var(--amber)}
.src.rule{background:rgba(180,35,24,.08);color:var(--red)}
.src.assumed{background:rgba(93,88,115,.12);color:var(--muted)}
.btn-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.btn-row .btn{flex:1 1 auto;justify-content:center;padding:7px 10px}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.active{background:var(--primary-dim);border-color:var(--primary);color:var(--primary)}
.btn-sm{padding:4px 10px;font-size:12px}
.clash-row{flex-wrap:wrap}
.clash-row .btn-sm{margin-top:6px}
.form-group .btn{justify-content:center;width:100%}
.ly-row{cursor:pointer;padding-left:6px;padding-right:6px;border-radius:6px}
.ly-row:hover{background:var(--tertiary)}
.dim-item.sel{background:var(--primary-dim)}
.sub{font-size:14px;font-weight:600;color:var(--foreground);letter-spacing:-.01em;margin:18px 0 4px}
.sub:first-child{margin-top:0}
.canvas-area{flex:1 1 0;position:relative;overflow:hidden;background-color:var(--paper);background-image:linear-gradient(rgba(56,29,146,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(56,29,146,.045) 1px,transparent 1px);background-size:24px 24px}
#view{position:absolute;inset:0;width:100%;height:100%;cursor:grab;user-select:none;-webkit-user-select:none;touch-action:none}
#view.panning{cursor:grabbing}
.toolbar-strip{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;padding:6px 8px;background:var(--background);border:1px solid var(--line);border-radius:var(--pill);box-shadow:var(--shadow);z-index:50}
.toolbar-strip .divider{width:1px;height:22px;background:var(--line);margin:0 4px}
.toolbar-strip .btn{border-color:transparent}
.toolbar-strip .btn:hover{background:var(--tertiary)}
.zoom-display{font-size:13px;color:var(--muted);padding:0 6px;min-width:76px;text-align:center;font-variant-numeric:tabular-nums}
.status-bar{position:absolute;top:16px;left:50%;transform:translateX(-50%);padding:8px 18px;background:var(--background);border:1px solid var(--line);border-radius:var(--pill);box-shadow:var(--shadow);font-size:14px;color:var(--muted);z-index:50;white-space:nowrap;max-width:calc(100% - 32px);overflow:hidden;text-overflow:ellipsis}
.status-bar b{color:var(--foreground);font-weight:600}
.legend{position:absolute;top:16px;right:16px;padding:10px 14px;background:var(--background);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);font-size:13px;color:var(--muted);display:flex;flex-direction:column;gap:5px;z-index:40}
.legend i{display:inline-block;width:18px;height:5px;border-radius:2px;margin-right:8px;vertical-align:middle}
.hover-tip{position:absolute;pointer-events:none;padding:4px 10px;background:var(--foreground);border-radius:var(--pill);font-size:12.5px;color:#fff;z-index:60;display:none}
svg text{font-family:Inter,sans-serif;font-weight:600}
.modal-overlay{position:fixed;inset:0;background:rgba(11,6,32,.45);backdrop-filter:blur(3px);z-index:200;display:flex;align-items:center;justify-content:center;padding:24px}
.modal-overlay.hidden{display:none}
.modal{background:var(--background);border-radius:16px;box-shadow:0 20px 60px rgba(11,6,32,.25);width:min(920px,100%);max-height:100%;overflow:auto;display:grid;grid-template-columns:300px 1fr}
.modal-side{padding:24px;border-right:1px solid var(--line)}
.modal-main{padding:24px;display:flex;flex-direction:column;gap:12px;min-width:0}
.modal h2{font-size:22px;font-weight:600;letter-spacing:-.02em;margin-bottom:4px}
.modal .lede{font-size:13.5px;color:var(--muted);margin-bottom:16px;line-height:1.5}
.tile-map{width:100%;height:300px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-sm)}
.print-summary{display:flex;gap:18px;flex-wrap:wrap;font-size:14px;color:var(--muted)}
.print-summary b{color:var(--foreground);font-size:20px;font-weight:600;letter-spacing:-.02em;display:block}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:auto;padding-top:8px}
.modal-sub{font-size:15px;font-weight:600;letter-spacing:-.01em;margin:14px 0 8px}
.coupon-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:2px 0 14px}
.coupon-row .info-text{margin:0;font-size:12.5px}
.check-row{display:flex;align-items:center;gap:8px;font-size:14px;margin:4px 0 10px;cursor:pointer}
.check-row input{accent-color:var(--primary);width:16px;height:16px}
/* grades: each road with levels, its levels and the grades between */
.lv-road{font-size:13px;margin:10px 0 2px}
.lv-road .lv-len{color:var(--muted);font-size:12px}
.lv-row.sel{background:rgba(56,29,146,.08)}
details.lv-inherit{margin-top:10px;font-size:13px}
details.lv-inherit summary{cursor:pointer;color:var(--muted)}
.ls-preview{height:300px;overflow:auto;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff}
.ls-preview svg{display:block;height:100%}
.lv-road .btn-sm{margin-left:6px}
.dim-item.lv-vc{padding-left:18px;color:#5d5873;font-size:12.5px}
.dim-item.lv-grade{padding-left:18px;color:#8a4b08;font-size:12.5px}
/* the parts list: the dialog's preview and the printed pages */
.parts-preview{max-height:340px;overflow:auto;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;padding:4px 10px}
table.parts{width:100%;border-collapse:collapse;font-size:12.5px;color:#0B0620}
table.parts th{text-align:left;font-weight:600;padding:10px 6px 4px;border-bottom:1.5px solid #381d92;color:#381d92;font-size:13px}
table.parts td{padding:4px 6px;border-bottom:1px solid #e4e1ee;vertical-align:top}
table.parts td.q{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600;width:1%}
table.parts td.n{color:#5d5873}
.print-flow{padding:0;font-family:Inter,sans-serif}
.print-flow h1{font-size:18px;margin:0 0 2px;color:#0B0620}
.print-flow .sub{font-size:11px;color:#5d5873;margin:0 0 8px}
#printContainer{display:none}
@media print{
  html,body{height:auto;overflow:visible;background:#fff}
  body>*:not(#printContainer){display:none !important}
  #printContainer{display:block}
  .print-page{position:relative;overflow:hidden;break-after:page;page-break-after:always;background:#fff}
  .print-page:last-child{break-after:auto;page-break-after:auto}
  .print-page svg{position:absolute;display:block}
  table.parts tr{break-inside:avoid}
}
@media (max-width:1100px){.legend{display:none}}
@media (max-width:1700px){.header-brand .tagline{display:none}}
@media (max-width:1000px){.header{padding:0 14px}}
/* the header holds the brand, the country chip, four tabs and the tools: the tool labels go first */
@media (max-width:1560px){.header-actions .btn .lbl{display:none}}
@media (max-width:1200px){.site-link{display:none}}
@media (max-width:900px){.sidebar{width:290px;min-width:290px}.site-link{display:none}}

/* 3D view */
.modal.view3d{display:flex;flex-direction:column;width:min(1400px,100%);height:min(900px,100%);grid-template-columns:none;overflow:hidden}
.v3-bar{display:flex;align-items:center;gap:14px;padding:10px 16px;border-bottom:1px solid var(--border,#e4e2ec)}
.v3-note{flex:1;color:#5d5873;font-size:13px}
.v3-opt{display:flex;align-items:center;gap:5px;font-size:13px;color:#3d3854;white-space:nowrap;cursor:pointer}
.v3-progress{height:4px;background:var(--tertiary,#f2f2fa)}
.v3-progress>div{height:100%;width:0;background:var(--primary);transition:width .15s}
.v3-canvas{flex:1;min-height:300px;position:relative}
.v3-canvas canvas{display:block;width:100%;height:100%}

/* model rail */
#rfBox input.estimated{font-style:italic;color:#8a6a00}
.rf-save{display:flex;gap:6px;align-items:stretch}.rf-save input{flex:1 1 auto;min-width:0;width:auto}.rf-save .btn{flex:0 0 auto;width:auto}

/* map credit on the plan */
.map-credit{position:absolute;left:50%;transform:translateX(-50%);bottom:2px;max-width:calc(100% - 20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;line-height:1.3;color:#3b3650;background:rgba(255,255,255,.8);padding:2px 6px;border-radius:4px;pointer-events:none}
.map-credit:empty{display:none}

/* the selected piece's controls, in a window over the plan */
.sel-win{position:fixed;z-index:60;width:340px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:flex;flex-direction:column;background:var(--background);border:1px solid var(--line-strong);border-radius:var(--radius);box-shadow:0 10px 32px rgba(11,6,32,.18)}
.sel-win[hidden]{display:none}
.sel-win-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px 6px 14px;background:var(--tertiary);border-bottom:1px solid var(--line);border-radius:var(--radius) var(--radius) 0 0;cursor:move;user-select:none;touch-action:none}
.sel-win-title{font-size:13px;font-weight:600;color:var(--foreground);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sel-win-btns{display:flex;gap:4px;flex:0 0 auto}
.sel-win-btn{width:28px;height:28px;border:1px solid var(--line-strong);border-radius:50%;background:var(--background);color:var(--primary);font-size:15px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}
.sel-win-btn:hover{background:var(--primary);color:#fff}
.sel-win-body{padding:10px 14px 12px;overflow:auto}
.sel-win-body .btn-row{flex-wrap:wrap}
.btn.btn-sm{padding:3px 10px;font-size:12px;margin-top:4px}

/* the top of the plan: the layout's file and Undo / Redo, then the status line */
.canvas-top{position:absolute;top:12px;left:12px;right:12px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;z-index:50;pointer-events:none}
.canvas-top>*{pointer-events:auto}
/* the floating boxes over the plan let clicks through to it, except on their buttons: a click on the readout, the
   legend or between the zoom buttons is a click on the track under it */
.canvas-top .status-bar,.legend,.toolbar-strip,.zoom-display{pointer-events:none}
.toolbar-strip button{pointer-events:auto}
.canvas-top .status-bar{position:static;transform:none;flex:0 1 auto;min-width:0;max-width:100%}
.file-strip{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:4px 6px 4px 14px;background:var(--background);border:1px solid var(--line);border-radius:var(--pill);box-shadow:var(--shadow);margin-right:auto}
/* the file's state: saved (quiet), saving, or wanting something done (a click does it) */
.fs-status{font-weight:500;color:var(--muted)}
.fs-status[data-state="saving"]{color:var(--muted);font-style:italic}
.fs-status[data-state="none"],.fs-status[data-state="reconnect"],.fs-status[data-state="open"]{color:var(--primary);background:var(--tertiary)}
.fs-status[data-state="error"]{color:var(--red);background:var(--tertiary)}
.modal.recover{grid-template-columns:300px 1fr}
.recover-row{align-items:center;gap:10px}
.file-name{font-size:13px;font-weight:600;color:var(--foreground);max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:6px}
.fs-btn{border:0;background:transparent;color:var(--primary);font-family:Inter,sans-serif;font-size:13px;font-weight:500;padding:6px 10px;border-radius:var(--pill);cursor:pointer;white-space:nowrap}
.fs-btn:hover:not(:disabled){background:var(--tertiary)}
.fs-btn:disabled{color:var(--faint);cursor:default}
.fs-sep{width:1px;height:20px;background:var(--line);margin:0 4px}

/* Sanborn maps in the Map panel */
.sb-row{display:flex;align-items:center;gap:6px;margin:4px 0}
.sb-row .sb-name{flex:1 1 auto;min-width:0;padding:5px 8px;font-size:13px}
.sb-row .btn-sm{margin-top:0}

/* drawing track */
/* a tool out: a crosshair (the plan's #view would otherwise keep its grab hand); picking points for the underlay: a
   crosshair over everything on the plan, its pieces' and handles' own pointers too */
#view.drawing{cursor:crosshair}
#view.picking,#view.picking *{cursor:crosshair !important}
.draw-kind{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.draw-kind .seg{flex:0 1 auto;min-width:0}.draw-kind select{padding:4px 8px;font-size:13px}

/* the tool that is out, said on the plan; a note under it */
.mode-banner{display:flex;align-items:center;gap:10px;padding:5px 6px 5px 14px;background:var(--primary);color:#fff;border-radius:var(--pill);box-shadow:var(--shadow);font-size:13.5px;max-width:100%}
.canvas-top .mode-banner{pointer-events:none}
.mode-banner .mode-name{font-weight:700;white-space:nowrap}
.mode-banner .mode-hint{opacity:.85;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.mode-banner .fs-btn{pointer-events:auto;background:#fff;color:var(--primary);border-radius:var(--pill);padding:3px 12px;font-weight:600}
.plan-note{flex-basis:100%;text-align:center;font-size:13.5px;font-weight:600;color:var(--foreground)}
.canvas-top .plan-note{pointer-events:none}
.plan-note span,.plan-note{text-shadow:0 0 3px #fff,0 0 3px #fff}
.plan-note.bad{color:var(--red)}

/* ── country chip and picker (js/country.js) ── */
.country-chip{font:inherit;font-size:13px;font-weight:600;color:var(--primary);background:var(--background);border:1px solid var(--primary-soft);padding:3px 12px;border-radius:var(--pill);cursor:pointer;align-self:center;flex:0 0 auto;white-space:nowrap}
.country-chip:hover{border-color:var(--primary)}
.cp-overlay{position:fixed;inset:0;z-index:1000;background:rgba(11,6,32,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.cp-card{background:var(--background);border-radius:16px;box-shadow:0 20px 60px rgba(11,6,32,.3);width:min(860px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:24px 24px 16px;display:flex;flex-direction:column;gap:12px}
.cp-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.cp-head h2{font-size:22px;font-weight:700;letter-spacing:-.02em;color:var(--foreground)}
.cp-head p{font-size:14px;color:var(--muted);margin-top:4px}
.cp-close{flex:0 0 auto}
.cp-card>*{flex-shrink:0}
.cp-tabs{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.cp-tab{font:600 13px Inter,system-ui,sans-serif;padding:6px 14px;border-radius:var(--pill);border:1px solid var(--line-strong);background:var(--background);color:var(--secondary);cursor:pointer}
.cp-tab.on{background:var(--primary);border-color:var(--primary);color:#fff}
.cp-world{margin-left:auto;font-size:13px;font-weight:600;color:var(--primary);text-decoration:none}
.cp-world:hover{text-decoration:underline}
.cp-msg{font-size:14px;color:var(--secondary);min-height:20px}
.cp-msg .cp-pick{margin:6px 6px 0 0}
.cp-buttons{display:flex;gap:10px;flex-wrap:wrap}
.cp-btn{display:inline-flex;flex-direction:column;align-items:flex-start;height:auto;padding:8px 16px;border-radius:12px;line-height:1.25}
.cp-btn[aria-disabled="true"]{opacity:.6}
.cp-btn-sub{font-size:11.5px;font-weight:500;opacity:.8}
.cp-credit{font-size:11px;color:var(--muted);text-align:right}
@media (max-width:600px){.cp-card{padding:16px}.cp-head h2{font-size:18px}.cp-l{font-size:22px}.cp-l-live{font-size:26px}}

/* ── the shared workspace: the frame (step 1) ─────────────────────────────────────────────────────────────────
   a slim top bar (the file strip joins it in step 7, when the mode bar goes and makes room); the tool rail's slot on the left (step 2); the side panel on the right;
   a status bar at the foot */
.header{height:auto;min-height:52px;padding:6px 14px;gap:8px 12px;flex-wrap:wrap;justify-content:flex-start}
.header-actions{margin-left:auto}
/* (the page a column: the top bar as tall as it wraps to, the plan and panel the rest, the status bar at the foot) */
body{display:flex;flex-direction:column}
.header-brand h1{font-size:21px}

.header .btn{padding:6px 14px;font-size:13px}
.header .seg button{font-size:13px}
.app-layout{height:auto;flex:1 1 0;min-height:0}
.status-foot{flex:0 0 auto}
.sidebar{border-right:0;border-left:1px solid var(--line)}
.tool-rail{width:52px;flex:0 0 52px;border-right:1px solid var(--line);background:var(--background);display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 0}
.tool-rail[hidden]{display:none}
.status-foot{height:28px;display:flex;align-items:center;padding:0 14px;border-top:1px solid var(--line);background:var(--background);overflow:hidden}
.status-foot .status-bar{position:static;transform:none;padding:0;border:0;box-shadow:none;background:transparent;font-size:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:1600px){.header-actions .btn .lbl{display:none}.site-link{display:none}}

/* ── the shared workspace: the tool rail (step 2) ─────────────────────────────────────────────────────────────── */
.rail-btn{width:40px;height:40px;flex:0 0 auto;border:0;border-radius:10px;background:transparent;color:var(--foreground);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}
.rail-btn:hover:not(:disabled){background:var(--tertiary);color:var(--primary)}
.rail-btn.on{background:var(--primary);color:#fff}
.rail-btn:disabled{opacity:.3;cursor:default}
.rail-btn:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.rail-sep{width:28px;height:1px;flex:0 0 auto;background:var(--line);margin:4px 0}
.rail-gap{flex:1 1 auto}
.tool-rail{overflow:hidden auto;scrollbar-width:none}
.tool-rail::-webkit-scrollbar{display:none}
@media (max-height:820px){.tool-rail{gap:1px;padding:6px 0}.rail-btn{width:36px;height:34px}.rail-sep{margin:2px 0}}
.rail-dup{display:none !important}

/* ── the shared workspace: the right-hand panel, docked (step 3) ─────────────────────────────────────────────── */
.insp-out{display:none !important}
.insp-group{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);padding:14px 2px 4px}
.insp-focus{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 4px;padding:6px 6px 6px 12px;border-radius:var(--radius-sm);background:var(--primary-dim)}
.insp-focus-name{font-size:13px;font-weight:600;color:var(--primary)}
.ly-sec-about{margin-left:6px;width:22px;height:22px;flex:0 0 auto;border:1px solid var(--line);border-radius:50%;background:var(--background);color:var(--muted);font-size:12px;line-height:1;cursor:pointer}
.ly-sec-about:hover,.ly-sec.show-about .ly-sec-about{border-color:var(--primary);color:var(--primary)}
.ly-sec:not(.show-about) .info-text.about{display:none}
.sidebar.ly-narrow>[data-panel]:not(#lyPanel){display:none}

/* ── the shared workspace: the floating inspector and the folding side panel (step 4) ────────────────────────── */
.insp-focus-btns{display:flex;gap:2px;flex:0 0 auto}
/* (the fold button in the Layout panel's heading) */
.ly-side-fold{margin-right:4px;border:0;background:transparent;color:var(--muted);font-size:15px;width:28px;height:28px;border-radius:8px;cursor:pointer}
.ly-side-fold:hover{background:var(--tertiary);color:var(--primary)}
.side-strip{display:none}
.sidebar.side-folded{width:48px;min-width:48px;overflow:hidden}
.sidebar.side-folded>:not(#sideStrip){display:none !important}
.sidebar.side-folded>#sideStrip{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 0}
.side-strip .rail-btn{position:relative}
.side-strip-n{position:absolute;top:2px;right:0;min-width:14px;padding:0 4px;border-radius:10px;background:var(--red);color:#fff;font:700 9px/14px Inter,sans-serif}
.side-strip-n:empty{display:none}
.sel-win.sel-win-secs .ly-sec-head{pointer-events:auto}

/* ── the shared workspace: the status bar (step 5) ──────────────────────────────────────────────────────────────── */
.status-foot{gap:16px}
.status-foot .status-bar{flex:0 1 auto;min-width:0}
.sf-gap{flex:1 1 auto}
.sf-item{flex:0 0 auto;font-size:12px;color:var(--muted);white-space:nowrap}
.sf-btn{border:0;background:transparent;padding:2px 8px;border-radius:var(--pill);font-family:Inter,sans-serif;font-weight:600;color:var(--green);cursor:pointer}
.sf-btn.bad{color:var(--red)}
.sf-btn:hover{background:var(--tertiary)}
.sf-cursor{min-width:150px;text-align:right;font-variant-numeric:tabular-nums}
@media (max-width:900px){.sf-cursor,#sfFile{display:none !important}}

/* ── the shared workspace: a piece's detail (step 6) ─────────────────────────────────────────────────────────── */
.detail-bar{display:flex;align-items:center;gap:10px;max-width:100%;min-width:0;box-sizing:border-box;padding:5px 6px 5px 16px;background:var(--background);border:1px solid var(--primary-soft);border-radius:var(--pill);box-shadow:var(--shadow);font-size:13px;pointer-events:auto}
.detail-name{font-weight:600;color:var(--primary);white-space:nowrap}
.detail-hint{flex:1 1 auto;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.detail-bar .fs-btn{flex:0 0 auto}
.detail-bar .fs-btn{background:var(--primary);color:#fff;font-weight:600}
.detail-bar .fs-btn:hover{background:var(--secondary)}

/* ── the shared workspace: no mode bar (step 7) ───────────────────────────────────────────────────────────────── */
.header .file-strip{box-shadow:none;margin-right:auto;padding:2px 4px 2px 10px;flex-wrap:wrap;flex:0 1 auto;min-width:0}
.header .file-strip .file-name{font-size:13px}
.fs-new{position:relative;display:inline-flex}
.fs-more{padding:6px 6px;margin-left:-4px}
.fs-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:300;min-width:250px;padding:6px;background:var(--background);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow);display:flex;flex-direction:column}
.fs-menu[hidden]{display:none}
.fs-menu button{border:0;background:transparent;text-align:left;padding:8px 10px;border-radius:6px;font:500 13px Inter,sans-serif;color:var(--foreground);cursor:pointer}
.fs-menu button:hover,.fs-menu button:focus-visible{background:var(--tertiary);color:var(--primary)}
.fs-menu-sep{font-size:11px;color:var(--faint);padding:8px 10px 2px;border-top:1px solid var(--line);margin-top:4px}
.settings-lit{animation:settingsLit 1.6s ease-out}
@keyframes settingsLit{0%,30%{box-shadow:0 0 0 3px var(--primary)}100%{box-shadow:0 0 0 3px transparent}}

/* an option or control not offered in the chosen railway's area (applyRegion, js/app-state.js) */
.region-off { display: none !important; }
