/* astra-crm.css (Claude, 9 Nov 2026): Astra's round 2 design system on the CRM's own screens.
   Ben: "Do not strip out, simplify, or refactor any layout density, CSS classes, or motion effects introduced by Astra"
   and "Any new components you write must strictly inherit these exact spacing, font, and color tokens".
   astra-tokens.css and astra-journey.css load unchanged just before this file. This file does two things only:
   1. lays the CRM's screens out the way Astra's demo lays out the same screens, using Astra's own values
      (20 px page gutters, 16 px gaps and card padding, 8 px cards, 6 px controls, 42 px control height, 26 px page titles,
      the 280 px | map | panel map columns, the stage bar of outlined numbered buttons, the strategy panel);
   2. undoes an Astra element rule where it would break a CRM control (marked FIX), e.g. radio buttons stretched to
      full width or inline labels forced onto their own line.
   Asset paths stay as Astra gave them; the Harvest Compute mark keeps no white box (Ben, 9 Nov). */

body{line-height:1.5}

/* ---------- header: Astra's header row, then the navigation as outlined buttons with an icon for what each one opens (astralayout.js) */
#top{padding:12px 20px;gap:14px;border-bottom:1px solid var(--line2);background:var(--panel)}
#top h1{font-size:19px;font-weight:600;gap:14px}
#top h1 span{color:var(--fg)}
#top .hc-mark{height:48px}
#tabs{order:20;flex:1 0 100%;gap:8px;padding:12px 0 0;border-top:1px solid var(--line2)}
#tabs button{border:1px solid var(--line);background:var(--panel);color:var(--fg);border-radius:6px;padding:8px 11px;min-height:42px;display:inline-flex;align-items:center}
#tabs button.on{background:var(--chip);border-color:var(--accent);font-weight:400;color:var(--fg);box-shadow:none}
#tabs button.on::after,#tabs button::after{display:none}
#lookup{flex:1 1 280px}
#who{font-size:13px}
#pl-scope{padding:10px 20px}
.hc-ic{width:16px;height:16px;vertical-align:middle;margin-right:6px;stroke:currentColor;fill:none;stroke-width:1.6;flex:0 0 auto}

/* FIX: Astra's element rules, where they would break a CRM control */
input[type=radio]{width:auto;min-height:0;margin:0 6px 0 0;vertical-align:middle}
input[type=checkbox]{flex:0 0 auto}
input[type=range],input[type=color]{min-height:0}
label.chk,.layers label,.lyr label,#maptools label:has(>input[type=checkbox]),#maptools label:has(>input[type=radio]),.sk label:has(>input[type=checkbox]),.np-row label:has(>input[type=checkbox]){display:inline-flex;align-items:center;margin:4px 12px 4px 0}
svg button,#map button{min-height:0}
#mapctl button{min-width:44px;min-height:44px}
.pl-grp button,.wf button,#stratbar button,#mapfoot button,.np-more button,#np-flow button{min-height:42px}
/* the sketch editor's tool buttons stay compact (Ben, 10 Nov 2026: "the sketch editor buttons need to be smaller"), so the
   drawing gets the room; still 44 px on a touch screen */
.sk button{min-height:30px;padding:4px 9px;font-size:13px;line-height:1.3}
.sk .pal button{font-size:12px;padding:3px 8px}
@media (pointer:coarse){.sk button{min-height:44px}}
#m-close,#np-back{min-height:42px}

/* ---------- map page: strategy panel on top, then filters | map | parcel panel (Astra's .layout 280px | 1fr | panel) */
#v-map{padding:20px 20px 0;gap:0;background:var(--bg)}
#v-map>.strategy-panel{flex:0 0 auto}
#v-map .strategy-panel h2{font-size:18px;margin:0 0 6px}
#v-map .strategy-card input{float:right;margin:0}
#v-map .strategy-card .strategy-n{margin-top:6px;font-variant-numeric:tabular-nums}
#v-map .strategy-tools{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:12px}
#v-map .strategy-tools:empty{display:none}
#v-map .strategy-panel #stratbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:0;border:0;background:none;margin-top:10px}
#v-map .strategy-panel #stratbar .sb-l,#v-map .strategy-panel #stratbar .sbtn,#v-map .strategy-panel #stratbar .sb-sum{display:none}
#v-map>#mapwrap{background:transparent;overflow:visible;padding-left:296px}
#v-map>#mapwrap>#mapmove{left:296px;border:1px solid var(--line2);border-radius:8px;overflow:hidden;background:var(--mapbg)}
#v-map>#mapwrap>#maptools{left:0;top:0;bottom:0;max-height:none;width:280px;max-width:280px;background:var(--panel);border:1px solid var(--line2);border-radius:8px;padding:16px;overflow:auto}
#v-map>#mapwrap>#maptools>.box{border:0;box-shadow:none;background:none;padding:0}
#v-map>#mapwrap #mapctl{right:10px;top:10px}
#v-map>#mapfoot{margin:16px 0 0;border:1px solid var(--line2);border-radius:8px;background:var(--panel);padding:10px 16px 10px calc(var(--fb-dock-w,0px) + 20px)}
/* no fixed width: the record panel widens when "All details" opens (a fixed width here hid that bar off screen) */
#side:not(.closed){margin:20px 20px 20px 0;border:1px solid var(--line2);border-radius:8px}
@media (max-width:1100px){#v-map>#mapwrap{padding-left:0}#v-map>#mapwrap>#mapmove{left:0}#v-map>#mapwrap>#maptools{left:10px;top:10px;bottom:auto;max-height:calc(100% - 20px);width:auto;max-width:min(300px,calc(100% - 70px))}}
@media (max-width:860px){#side:not(.closed){margin:0;border-radius:0;width:100%}}
@media (max-width:650px){#v-map{padding:10px 10px 0}}

/* ---------- concept design and sketch: a full page under the header, like Astra's journey pages, not a box over the map */
#modal.on.pl-cp{inset:var(--hc-top,0px) 0 0 0;background:var(--bg);padding:0;align-items:stretch;justify-content:stretch;z-index:19}
#modal.on.pl-cp .dlg{width:100%;max-width:none;height:100%;max-height:100%;border-radius:0;box-shadow:none;background:var(--bg)}
#modal.on.pl-cp #wf-dlg{order:-1;padding:12px 20px 0}
#modal.on.pl-cp .dhead{padding:12px 20px;border-bottom:0;gap:12px;align-items:center;flex-wrap:wrap}
#modal.on.pl-cp .dhead h2{font-size:26px;font-weight:500;margin:8px auto 8px 0;flex:1 0 100%}
#modal.on.pl-cp #m-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0;flex:1 1 0;min-width:0}
#modal.on.pl-cp .dbody{padding:4px 20px 90px}
#m-body.wf-on-design{display:grid;grid-template-columns:minmax(300px,1fr) 300px;gap:16px;align-content:start}
#m-body.wf-on-design>style{display:none}
#m-body.wf-on-design>#cp-plan{grid-column:1;background:var(--panel);border:1px solid var(--line2);border-radius:8px;padding:16px}
/* the drawing keeps its full height in the one-column layout: the page scrolls inside a box of fixed height, and without this
   a narrow window squeezed the drawing's grid row (overflow:hidden lets a row shrink below its content) down to its padding */
#m-body.wf-on-design>#cp-plan{display:block}
@media (max-width:1100px){#m-body.wf-on-design{grid-auto-rows:max-content}}
#m-body.wf-on-design>#cp-3d{grid-column:1}
#m-body.wf-on-design>.cp-cards{grid-column:2;grid-row:1/span 3;display:flex;flex-direction:column;gap:16px;margin:0}
#m-body.wf-on-design>.cp-cards>.cp-card{height:auto;max-height:none;padding:16px;border:1px solid var(--line2);border-radius:8px;font-size:13px}
#m-body.wf-on-sketch>#cp-sketch .sk{margin-top:0;border-top:0;padding-top:0}
@media (max-width:1100px){#m-body.wf-on-design{grid-template-columns:1fr}#m-body.wf-on-design>.cp-cards{grid-column:1;grid-row:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}}
@media (max-width:650px){#modal.on.pl-cp .dhead,#modal.on.pl-cp .dbody,#modal.on.pl-cp #wf-dlg{padding-left:10px;padding-right:10px}}
/* Ben, 10 Nov 2026: "I can't scroll down to the map. It's really annoying." The whole page scrolls (the stage bar, the title
   and its buttons too), not only the part under them, so on Sketch the drawing gets the window's height under the sketch's
   own pinned toolbars (campussketch.js 1.3 sizes it) instead of what was left under about 250 px of fixed rows */
#modal.on.pl-cp .dlg{overflow:auto}
#modal.on.pl-cp .dlg>*{flex-shrink:0}
#modal.on.pl-cp .dbody{flex:0 0 auto;overflow:visible;min-height:auto}
/* the sketch's versions bar and shape palette pin to the top of the page as it scrolls (their -12 px allowed for a padding
   the scrolling box no longer has, and cut the top of the versions bar off) */
#modal.on.pl-cp .sk .skhead{top:0}
#modal.on.pl-cp .sk .pal{top:var(--skh,0px)}
/* on a phone the two pinned toolbars wrap to about half the screen and the drawing slid under them: there they scroll
   away with the page, so the drawing can be seen whole */
@media (max-width:650px){#modal.on.pl-cp .sk .skhead,#modal.on.pl-cp .sk .pal{position:static}}
/* FIX: Astra's journey page gives every .side a 75vh scroll box of its own; on Sketch that made the side panel (areas,
   version name, readout) a box the mouse wheel scrolled instead of the page. It grows with its content again, as before */
.sk .side{max-height:none;overflow:visible}

/* ---------- the stage bar: Astra's row of outlined, numbered buttons ("1. Discover", ...) */
.wf{gap:8px;font:14px/1.5 var(--font)}
.wf .wf-steps{gap:8px}
.wf .wf-sep{display:none}
.wf .wf-st{border:1px solid var(--line);background:var(--panel);border-radius:6px;padding:8px 11px;min-height:42px;gap:6px}
.wf .wf-st .n{width:auto;height:auto;border:0;background:none;border-radius:0;font-size:14px;font-weight:400;color:inherit}
.wf .wf-st .n::after{content:"."}
.wf .wf-st[data-s=done] .n{background:none;color:var(--accent)}
.wf .wf-st[data-s=done] .n::after{content:""}
.wf .wf-st[data-s=warn] .n{color:#7a5a00;font-weight:600}
.wf .wf-st[data-s=warn] .n::after{content:""}
.wf .wf-st[aria-current=step]{background:var(--chip);border-color:var(--accent);font-weight:400}
.wf .wf-st[aria-current=step] .n{box-shadow:none}
.wf .wf-nav{min-height:42px;border-radius:6px}

/* ---------- site plan and presentations: Astra's page title, stage bar and cards */
#np-root .np-top{padding:12px 20px;gap:12px;background:var(--bg);border-bottom:0}
#np-root #np-title{font-size:26px;font-weight:500}
#np-root .np-flow{padding:0 20px 12px;background:var(--bg);border-bottom:1px solid var(--line2)}
#np-root .np-body{padding:16px 20px 90px;background:var(--bg)}
#np-root .np-card{background:var(--panel);border:1px solid var(--line2);border-radius:8px;padding:16px}
#np-root .np-grid{gap:16px}
/* the presentation cards keep the CRM's sideways strip and its arrows (1.1): five cards side by side squeezed the
   Headline, Date and logo fields until their text was cut off, and the page still says "Scroll sideways for more" */
#np-root .np-strip{gap:16px}

/* ---------- home: Astra's "working day" tiles */
#pl-home .plh-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}
#pl-home .plh-tile{background:var(--panel);border:1px solid var(--line2);border-radius:8px;padding:16px;box-shadow:none;min-height:0}
#pl-home .plh-more{gap:8px}
#pl-home .plh-more button{min-height:42px}

/* the site plan and presentations pages also sit under the header, like Astra's journey pages */
#np-root{top:var(--hc-top,0px)}
/* on a phone the header wraps to several rows, so these pages take the whole screen (as the dialogs did) */
@media (max-width:650px){#modal.on.pl-cp{inset:0}#np-root{top:0}}

/* Ben, 9 Nov 2026: "some of the buttons were a little close together on Astra's": 10 px between buttons in every row
   of buttons (Astra used 6 px, the CRM's own rows 4 to 6 px), and no tap target under 44 px on a touch screen */
.actions,.toolbar,#m-actions,#modal .pl-grp,#modal .pl-row,#modal .pl-stack,.strategy-tools,#v-map .strategy-panel #stratbar,#mapfoot,#multi,.np-bar,.np-more,.wf,.wf .wf-steps,#tabs,#pl-home .plh-more,#mapctl,.sk .bar,.sk .tabs,.sk .pal,#top{gap:10px}
.sk #sk-tools{row-gap:8px}
@media (pointer:coarse){button,select,input:not([type=checkbox]):not([type=radio]),summary,.wf .wf-st{min-height:48px}}

/* Ben: "ensure that maximum space is left for the map": the map fills the whole visible page below the header once the
   page is scrolled down to it (mapscroll.js sizes it), and a click on the map scrolls it fully into view */
#v-map .strategy-panel{padding:16px 20px;margin-bottom:16px}
#v-map .strategy-cards{margin:12px 0}
#v-map .strategy-card small:not(.strategy-n){display:block}

/* Ben: "ensure that maximum space is left for the map" (1.2, 10 Nov 2026). On a laptop the map must show at least as
   much as before Astra's layout: the strategy panel starts folded away ("Strategy cards" at the top of the Find parcels
   column opens it, astralayout.js), and on a wide mouse screen the page buttons share the first row with the logo (as
   before Astra's layout; they keep Astra's outlined style and icons), with 34 px controls, a 34 px logo and 8 px row
   padding (WCAG 2.5.8 asks 24 px). Touch screens and phones keep Astra's rows, 42 px and the 48 px rule. */
#hc-strat-tgw{margin:0 0 14px}
#hc-strat-tg{display:flex;align-items:center;justify-content:center;width:100%;white-space:nowrap}
@media (max-width:1100px){#hc-strat-tgw{margin-bottom:10px}}
#hc-strat-tg.on{background:var(--chip);border-color:var(--accent)}
#hc-strat[hidden]{display:none}
.hc-strat-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:start}
@media (pointer:fine) and (min-width:701px){
 #top{padding:8px 20px;gap:8px}
 #top .hc-mark{height:34px}
 #top input,#top select,#top button{min-height:34px}
 #tabs{padding-top:8px;gap:6px}
 #tabs button{min-height:34px;padding:4px 8px}
 #tabs .hc-ic{margin-right:5px}
 #ux-bar2 #stratbar button{min-height:30px}
 #pl-scope{padding:6px 20px}
 #v-map{padding-top:12px}
 #v-map .strategy-panel{margin-bottom:12px}
 #v-map>#mapfoot{margin-top:8px;padding-top:6px;padding-bottom:6px}
 #v-map>#mapfoot button{min-height:30px}
}
/* with Requests, History, Team, Settings and the colours in the More menu (Ben, 19 Nov 2026) the page buttons fit
   beside the logo on a laptop, so the header is one row from 1280 px; narrower, they keep Astra's own row under the
   logo and the lookup */
@media (pointer:fine) and (min-width:1280px){
 #tabs{order:0;flex:0 1 auto;padding-top:0;border-top:0}
 #top h1{margin:0}
 #top #lookup input{padding-top:5px;padding-bottom:5px}
 #top #lookup{flex:1 1 180px}
}
