/* The desktop workspace (panels.js; UI_RULES.md rule 18): three columns from 1280 px (form | results | map), every
   panel folding to a thin labelled rail, Expand map folding them all. Desktop only: a phone shows one view at a time. */
:root{--pn-rail:44px;--pn-form-w:340px;--pn-results-w:clamp(360px,24vw,440px)}
@media(min-width:1600px){:root{--pn-form-w:360px}}

/* ---- the fold button in each panel's header, and the rail a folded panel leaves ---- */
.pn-fold{display:inline-grid;place-items:center;flex:none;width:28px;height:28px;margin-left:6px;padding:0;border:1px solid var(--line-dark,#cdd2c8);border-radius:7px;background:var(--surface,#fff);color:var(--muted,#737b75);cursor:pointer}
.pn-fold:hover{color:var(--ink,#222924);border-color:var(--ink,#222924)}
.pn-fold:focus-visible,.pn-rail:focus-visible{outline:2px solid var(--accent,#3156d7);outline-offset:2px}
.pn-fold svg,.pn-rail svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pn-fold[hidden],.pn-rail[hidden]{display:none!important}
.pn-has-fold{display:flex;align-items:center}
.panel-heading.pn-has-fold>:first-child{flex:1;min-width:0}
.pn-rail{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%;height:100%;min-height:0;margin:0;padding:12px 0;border:0;background:var(--surface,#fff);color:var(--ink,#222924);font:600 12.5px/1 var(--sans,system-ui);letter-spacing:.02em;cursor:pointer}
.pn-rail:hover{background:var(--accent-soft,#edf1ff);color:var(--accent,#3156d7)}
.pn-rail-label{writing-mode:vertical-rl;transform:rotate(180deg)}
.pn-rail-h{flex-direction:row;justify-content:flex-start;height:var(--pn-rail);padding:0 14px}
.pn-rail-h .pn-rail-label{writing-mode:horizontal-tb;transform:none}
/* a folded panel shows its rail and nothing else (its scroll position and its contents kept) */
[data-pn-collapsed]>:not(.pn-rail){display:none!important}
[data-pn-collapsed]{padding:0!important;overflow:hidden!important;display:flex!important;flex-direction:column}
@media(max-width:620px){.pn-fold,.pn-rail{display:none!important}}

/* ---- the console: form | results | map (with the code view under the map), or form | map below 1280 ---- */
html[data-pn=console] .results-column{display:flex;flex-direction:column;min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden;background:#fff;border-right:1px solid var(--line,#e3e6df)}
html[data-pn=console] .results-column[hidden]{display:none}
html[data-pn=console] .results-column>.results-panel{margin:0!important;border:0!important;flex:1 0 auto;min-height:0;max-height:none!important;background:transparent}
@media(min-width:621px){
  html[data-pn=console][data-pn-three] .console-layout{grid-template-columns:var(--pn-form) var(--pn-results) minmax(520px,1fr)!important}
  html[data-pn=console][data-pn-collapsed-form]:not([data-pn-three]) .console-layout{grid-template-columns:var(--pn-rail) minmax(0,1fr)!important}
  html[data-pn] .console-layout,html[data-pn] main{--pn-form:var(--pn-user-form,var(--pn-form-w));--pn-results:var(--pn-user-results,var(--pn-results-w))}   /* (--pn-user-form / --pn-user-results: the dragged widths, panel-resize.js) */
  html[data-pn-collapsed-form] .console-layout,html[data-pn-collapsed-form] main{--pn-form:var(--pn-rail)}
  html[data-pn-collapsed-results] .console-layout,html[data-pn-collapsed-results] main{--pn-results:var(--pn-rail)}
  html[data-pn=console] .console-layout>.request-panel[data-pn-collapsed]{border-right:1px solid var(--line,#e3e6df)}
  /* the code view folded: its rail under the map, the map taking the height */
  html[data-pn-collapsed-code] .console-layout .workspace{grid-template-rows:46px minmax(0,1fr) var(--pn-rail)!important}
  html[data-pn-collapsed-code] .console-layout .inspector{height:var(--pn-rail)!important;border-top:1px solid var(--line,#e3e6df)}
  /* Expand map: the workspace is the map (every panel on its rail, the endpoint bar too) */
  html[data-pn=console][data-map-expanded] .console-layout .workspace{grid-template-rows:0 minmax(0,1fr) var(--pn-rail)!important}
  html[data-pn=console][data-map-expanded] .console-layout .workspace-toolbar{overflow:hidden;border:0}
}

/* ---- the tool pages with a form, cards and one map (Sun and shade, Map matching): controls | cards | map ---- */
@media(min-width:1280px){
  html[data-pn=tool][data-pn-three] main.tool-page{display:grid!important;grid-template-columns:var(--pn-form) minmax(0,1fr)!important;max-width:none!important;margin:0!important;padding:0!important;gap:0!important;height:calc(100svh - var(--pn-top,64px));min-height:560px;align-items:stretch}
  html[data-pn=tool][data-pn-three] main.tool-page>.tool-controls{position:static!important;top:auto;max-height:none!important;height:auto;min-height:0;overflow-y:auto;padding:20px 20px 0!important;border-right:1px solid var(--line,#e3e6df);background:#fcfcf9}
  html[data-pn=tool][data-pn-three] .tool-results[data-pn-split]{display:grid!important;grid-template-columns:var(--pn-results) minmax(480px,1fr);grid-template-rows:minmax(0,1fr);gap:0!important;min-height:0;height:100%}
  html[data-pn=tool][data-pn-three] .tool-results[data-pn-split]>.pn-cards{grid-column:1;grid-row:1;display:grid;gap:14px;align-content:start;min-width:0;min-height:0;overflow-y:auto;padding:16px;border-right:1px solid var(--line,#e3e6df);background:#fff}
  html[data-pn=tool][data-pn-three] .tool-results[data-pn-split]>.tool-map{grid-column:2;grid-row:1;height:100%!important;min-height:0;border:0!important;border-radius:0!important}
  html[data-pn=tool][data-pn-three] .tool-results[data-pn-split]>:not(.pn-cards):not(.tool-map){grid-column:1}
  html[data-pn=tool][data-map-expanded] .tool-results[data-pn-split]>.tool-map{position:static!important}
}

/* ---- Route planning: stops | itinerary | map ---- */
@media(min-width:1280px){
  html[data-pn=opt][data-pn-three] .opt-page{grid-template-columns:var(--pn-form) minmax(0,1fr)!important}
  html[data-pn=opt][data-pn-three] .opt-work{grid-template-columns:var(--pn-results) minmax(480px,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important}
  html[data-pn=opt][data-pn-three] .opt-work>.opt-results{grid-column:1;grid-row:1/-1;border-top:0;border-right:1px solid var(--line,#e3e6df)}
  html[data-pn=opt][data-pn-three] .opt-work>:not(.opt-results){grid-column:2}
}
@media(min-width:621px){html[data-pn=opt] .opt-page{--pn-form:var(--pn-form-w)}html[data-pn=opt][data-pn-collapsed-form] .opt-page{--pn-form:var(--pn-rail);grid-template-columns:var(--pn-rail) minmax(0,1fr)!important}}

/* Expand map in the pages with panels: the panels' rails, not the fallback's fixed frame (ui-frame.css) */
html[data-pn][data-map-expanded] [data-uf-expanded-frame]{position:relative!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;z-index:auto!important}
html[data-pn=console][data-map-expanded] [data-uf-expanded-frame]{height:100%!important}
html[data-pn][data-map-expanded] body{overflow:auto}
@media(max-width:1279px){html[data-pn=tool][data-map-expanded] [data-uf-expanded-frame]{position:fixed!important;top:var(--uf-expand-top,0px)!important;left:0!important;right:0!important;bottom:0!important;z-index:1300!important}html[data-pn=tool][data-map-expanded] body{overflow:hidden}}
/* phones: a tool page's map is full-bleed like the console's (no frame), so its control column has the same margins */
@media(max-width:620px){.tool-results>.tool-map,.tool-page .tool-map:not(.small){border:0!important;border-radius:0!important}}
/* three columns: a tool page's dock at the foot of its form column, as in the console (sticky, the form scrolling above it) */
@media(min-width:1280px){
  html[data-pn=tool][data-pn-three] main.tool-page>.tool-controls{display:flex!important;flex-direction:column;gap:2px}
  html[data-pn=tool][data-pn-three] main.tool-page>.tool-controls>*{flex:none}
  html[data-pn=tool][data-pn-three] main.tool-page>.tool-controls>.uf-dock{margin-top:auto;position:sticky;bottom:0;margin-left:-20px;margin-right:-20px;padding-left:20px;padding-right:20px;border-radius:0}
  html[data-pn=opt][data-pn-three] .opt-results>.opt-tabs{display:flex;align-items:center;min-width:0;gap:6px}
  html[data-pn=opt][data-pn-three] .opt-results>.opt-tabs{padding:0 10px 0 14px;gap:10px}
  html[data-pn=opt][data-pn-three] .opt-results .opt-tablist{gap:12px}
  html[data-pn=opt] main{--pn-results-w:clamp(410px,29vw,470px)}
  html[data-pn=opt][data-pn-three] .opt-results{grid-template-rows:auto minmax(0,1fr)!important}
}

/* ==== dark theme: generated by apps/dev-console/dark-theme.mjs from the rules above: do not edit by hand ==== */
:root[data-theme="dark"]{color-scheme:dark}
:root[data-theme="dark"] .pn-fold{border:1px solid var(--line-dark,#474944);background:var(--surface,#1a1a1a);color:var(--muted,#939593)}
:root[data-theme="dark"] .pn-fold:hover{color:var(--ink,#dcdedd)}
:root[data-theme="dark"] .pn-rail{background:var(--surface,#1a1a1a);color:var(--ink,#dcdedd)}
:root[data-theme="dark"] .pn-rail:hover{background:var(--accent-soft,#202123);color:var(--accent,#6983dc)}
html[data-theme="dark"][data-pn=console] .results-column{background:#1a1a1a;border-right:1px solid var(--line,#333432)}
@media(min-width:621px){html[data-theme="dark"][data-pn=console] .console-layout>.request-panel[data-pn-collapsed]{border-right:1px solid var(--line,#333432)}}
@media(min-width:621px){html[data-theme="dark"][data-pn-collapsed-code] .console-layout .inspector{border-top:1px solid var(--line,#333432)}}
@media(min-width:1280px){html[data-theme="dark"][data-pn=tool][data-pn-three] main.tool-page>.tool-controls{border-right:1px solid var(--line,#333432);background:#1f1f1c}}
@media(min-width:1280px){html[data-theme="dark"][data-pn=tool][data-pn-three] .tool-results[data-pn-split]>.pn-cards{border-right:1px solid var(--line,#333432);background:#1a1a1a}}
@media(min-width:1280px){html[data-theme="dark"][data-pn=opt][data-pn-three] .opt-work>.opt-results{border-right:1px solid var(--line,#333432)}}
/* ==== end of the generated dark theme ==== */
