/* Shared frame for the playable field menus and city overview. */
#direction-panel:has(.direction-hero),#city-panel:has(.city-overview) {
  padding:0;width:clamp(365px,31vw,460px);max-width:calc(100vw - 2 * var(--edge));
  background:linear-gradient(125deg,#203440,#142432 68%,#13212c);
  border:1px solid #a18b64;border-radius:5px;scrollbar-width:thin
}
#direction-panel .direction-hero {
  min-height:clamp(160px,21vh,220px);padding:15px 20px 19px;border:0;
  background:linear-gradient(0deg,#1b2e3b 0%,#172937c4 22%,transparent 78%),
    linear-gradient(105deg,#102332c9,transparent 78%),var(--scene) center 46%/cover
}
#direction-panel .direction-hero.minor-hero {min-height:116px;gap:6px}
#direction-panel .direction-identity h2 {color:var(--gold);font-size:16px}
.hero-objective .goal-label,.field-body h4 {color:var(--gold);font:600 14px/1.3 var(--sans);margin:0}
#direction-panel .hero-objective h3 {font:400 clamp(32px,2.7vw,42px)/1.04 var(--serif);color:#fff6e5;margin:4px 0 0;letter-spacing:-.02em}
.field-body {padding:11px 20px 14px}
.field-body h3,.city-overview h3 {font:400 23px/1.15 var(--serif);margin:0;color:var(--ivory)}
.victory-measures {padding-bottom:12px}.victory-measures h4{margin-bottom:8px}
.target-row,.order-measure {display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.target-row {padding:5px 0;font-size:15px}.target-row strong,.order-measure b{font-variant-numeric:tabular-nums;white-space:nowrap}
.local-progress{margin-top:8px}
.field-body progress {display:block;width:100%;height:6px;appearance:none;border:0;border-radius:6px;background:#0a1923;overflow:hidden;accent-color:var(--brass);margin:5px 0}
.field-body progress::-webkit-progress-bar {background:#0a1923}.field-body progress::-webkit-progress-value{background:linear-gradient(90deg,#9f8055,#ebca8d);border-radius:6px}
.field-body progress::-moz-progress-bar{background:#d9b97e;border-radius:6px}
.next-move {padding-top:13px;border-top:1px solid #97825d55}
button.move-choice {width:100%;min-height:70px;display:flex;align-items:center;justify-content:flex-start;gap:11px;margin:4px 0 7px;padding:2px 0;border:0;background:none;text-align:left}
button.move-choice>.painted-icon,.kiln-heading .painted-icon {width:63px;height:63px;border-radius:3px;flex:none}
.move-choice>span{flex:1}.move-choice strong,.kiln-heading b{display:block;font:400 24px/1.1 var(--serif);color:var(--ivory)}
.move-choice small,.unit-face small,.unit-route small,.kiln-heading small{display:block;color:var(--muted);font-size:14px;margin-top:4px}
.order-measure {font-size:13px;color:var(--muted)}.order-measure b{color:var(--ivory)}
.field-tools {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));position:sticky;bottom:0;z-index:1;background:#132534;border-top:1px solid #88785b;padding:4px 5px}
.field-tools button {display:grid;justify-items:center;align-content:center;gap:2px;min-height:50px;padding:3px;border:0;background:transparent;color:#ead2a4;font-size:13px}
.field-tools button[aria-expanded=true]{background:#30424d;color:#fff0cf}.field-tools .glyph{width:22px;height:22px}
.field-totals>div {display:grid;grid-template-columns:33px minmax(0,1fr) auto;align-items:center;gap:9px;min-height:35px;font-size:15px}
.field-totals b{font:600 18px var(--sans);font-variant-numeric:tabular-nums}
.field-totals .painted-icon,.field-totals .glyph{width:30px;height:30px;color:var(--gold)}
.epoch-stats,.stats-supply {margin:14px 0}.epoch-columns {display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:9px;margin:12px 0 0}
.epoch-columns>div{display:grid;justify-items:center;gap:4px}.epoch-columns b,.epoch-columns small{font-size:12px;color:var(--muted)}
.epoch-columns i{width:80%;height:45px;display:flex;align-items:flex-end;border-bottom:1px solid #b89c71;background:linear-gradient(0deg,#8196a11c,transparent)}
.epoch-columns em{width:100%;background:linear-gradient(#e1c28b,#977745);border-radius:2px 2px 0 0}
.stats-supply h3{margin-bottom:7px}.field-body .field-notes{padding:0;border:none}.field-body .field-notes summary{padding:8px 0;background:none}
.stat-milestone{display:grid;grid-template-columns:25px 1fr auto;align-items:center;gap:8px;width:100%;padding:7px 0;border:0;text-align:left;background:none}
.stat-milestone .glyph{width:22px;height:22px}.stat-milestone small{color:var(--muted);font-size:12px}
.unit-filters{display:flex;gap:8px;margin:0 0 12px}.unit-filters label,.kiln-source{display:grid;gap:3px;min-width:0;color:var(--muted);font-size:13px}
.unit-filters label{flex:1}.unit-filters select,.kiln-source select{width:100%;min-width:0;height:38px;background:#112332;border:1px solid #6f7771;font-size:14px}
.unit-face{display:flex;align-items:center;gap:13px}.unit-portrait{display:inline-block;flex:none;background:url('assets/interface/unit-early-settlements.webp') no-repeat;background-size:300% 200%;border-radius:4px}
.unit-face>.unit-portrait,.unit-face>.glyph{width:104px;height:104px}.unit-face>.glyph{box-sizing:border-box;padding:20px;color:var(--gold);background:#132331}
.unit-portrait.state-unit{background-image:url('assets/interface/unit-early-states.webp')}
.unit-face h3{font-size:29px;margin-top:4px}.unit-profile p{color:#e2e7e6;font-size:15px;margin:11px 0}
.unit-facility,.unit-research,.issue-cost{display:flex;flex-wrap:wrap;align-items:center;gap:7px;font-size:14px;margin:5px 0}
.unit-facility>.glyph,.issue-cost>.glyph{width:22px;height:22px;color:var(--gold)}.unit-research{color:var(--muted)}
button.unit-study{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;min-height:36px;background:#1d3342;border-color:#625d50;color:var(--gold)}
.issue-cost>span{display:inline-flex;align-items:center;gap:3px}.issue-cost .painted-icon{width:28px;height:28px}
.unit-route{border-top:1px solid #8a795b55;margin-top:12px;padding-top:6px}
.refit{display:flex;align-items:center;gap:9px;text-align:left;width:100%;padding:6px 0;background:transparent;border:0}
.refit>.glyph:first-child,.refit>.unit-portrait{width:38px;height:38px;color:var(--brass)}.refit small{font-size:12px}.refit b{font:500 17px var(--serif)}
.refit>span{flex:1}.refit>.glyph:last-child,.move-choice>.glyph:last-child{width:17px;color:var(--brass)}
.unit-trail{display:flex;align-items:stretch;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#9d885e #10212d;margin:4px 0 14px;padding:3px 0 6px}
.trail-stop{flex:none;width:102px;position:relative}.trail-arrow{position:absolute;top:22px;left:-24px;width:48px;height:1px;background:#897d65;pointer-events:none}
.trail-arrow::after{content:"";width:5px;height:5px;position:absolute;right:0;top:-2px;border:solid #b79f72;border-width:1px 1px 0 0;transform:rotate(45deg)}
.unit-node{width:100%;min-height:79px;display:flex;flex-direction:column;align-items:center;gap:5px;border:0;background:none;padding:0 4px;color:#c1cbd1;font-size:12px;line-height:1.15;text-wrap:balance;white-space:normal}
.unit-node[aria-pressed=true]{color:var(--gold)}.unit-medal{display:grid;place-items:center;position:relative;width:44px;height:44px;background:#101f2c;border:1px solid #657278;border-radius:50%}
.unit-node[aria-pressed=true] .unit-medal{border:2px solid var(--gold)}
.unit-medal>.glyph{width:25px;height:25px}.unit-medal>.unit-portrait{width:100%;height:100%;border-radius:50%}
.unit-lock{position:absolute;bottom:-2px;right:-3px;width:16px;height:16px;border-radius:50%;background:#101d27;border:1px solid #87908f;display:grid;place-items:center}.unit-lock .glyph{width:10px;height:10px}
.city-overview{padding:7px 19px 15px}.city-overview .city-section {padding:8px 0;border:0}.city-overview .census{margin:0;display:flex;gap:8px;align-items:center}
.city-overview .census .painted-icon{width:35px;height:35px}.city-overview .census strong{font:400 31px var(--serif)}
.city-overview .census-bar{height:5px;margin:7px 0}.city-overview .city-inventory{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px 7px}
.city-overview .city-inventory>div{grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;gap:0 5px;border:0;padding:0}
.city-overview .city-inventory .painted-icon,.city-overview .city-inventory .glyph{width:32px;height:32px;grid-row:1/3}
.city-overview .city-inventory strong{grid-column:2;grid-row:1;font-size:17px}.city-overview .city-inventory span{grid-column:2;grid-row:2}
.food-ledger{font-size:13px;color:var(--muted);margin:9px 0 3px}.food-ledger b,.kiln-delivery b{color:#c4dbb9}.food-ledger b{margin-right:8px}
.city-kiln{border-top:1px solid #97825d55;padding-top:8px}.kiln-heading,.kiln-heading>button{display:flex;align-items:center;gap:9px}
.kiln-heading>button{flex:1;border:0;background:none;text-align:left;padding:0}.crew-step{display:flex;gap:2px}.crew-step button{height:40px;min-width:38px;font-size:20px;color:var(--gold)}
.kiln-source{display:flex;align-items:center;gap:8px;margin:5px 0}.kiln-source select{flex:1}
.kiln-recipe{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.kiln-recipe .recipe-item{display:flex;align-items:center;gap:3px;font-size:13px}
.kiln-recipe .painted-icon{width:32px;height:32px}.kiln-recipe>.glyph{width:15px}.kiln-delivery{display:flex;align-items:center;gap:5px;margin-top:2px;color:var(--muted);font-size:14px}.kiln-delivery span{flex:1}
.all-sites{width:100%;display:flex;align-items:center;gap:8px;min-height:40px;margin-top:12px;color:var(--gold)}.all-sites>.glyph:last-child{margin-left:auto}
@media(max-width:760px),(max-height:680px){#direction-panel .direction-hero{min-height:133px;gap:9px}#direction-panel .direction-hero.minor-hero{min-height:95px}.field-body{padding:9px 15px 12px}.field-tools button{min-height:45px}}
@media(max-width:760px){#direction-panel:has(.direction-hero),#city-panel:has(.city-overview){width:min(420px,calc(100% - 2 * var(--edge)))}.hero-objective .goal-label{font-size:13px}.unit-face>.unit-portrait,.unit-face>.glyph{width:84px;height:84px}}

.victory-measures table{width:100%;border-collapse:collapse;text-align:right;font-variant-numeric:tabular-nums}
.victory-measures th:first-child{text-align:left}
.victory-measures thead th{padding:0 0 6px;color:var(--gold);font-size:13px;font-weight:600}
.victory-measures tbody th{font-weight:500;text-wrap:balance}
.victory-measures td{padding:4px 0 4px 12px;white-space:nowrap}
.victory-measures td:last-child{color:var(--gold)}
.victory-measures .either-route td{padding:0;text-align:left;font:italic 14px var(--serif);color:var(--gold)}
.victory-measures td[colspan]{padding-left:0}
.victory-meter{position:relative;margin:1px 0 5px}
.victory-meter progress{display:block;width:100%;height:6px;border-radius:3px;background:#0a1923;margin:0}
.victory-meter i{position:absolute;top:-3px;bottom:-3px;left:clamp(1px,var(--target),calc(100% - 1px));width:2px;background:#f4dfb5;transform:translateX(-50%)}
.milestone-meter{margin:4px 4px 6px 0}
.milestone-meter progress{height:2px;background:#68747b}
.milestone-meter i{width:8px;height:8px;top:-3px;bottom:auto;background:#192c3c;border:1.5px solid var(--gold);transform:translateX(-50%) rotate(45deg)}
.milestone-meter.achieved i{background:var(--gold)}
#direction-panel .direction-hero:has(.s-C) .hero-objective h3{max-inline-size:12ch}
.victory-measures>small,.empty-record{color:var(--muted);font-size:13px}

#field-window{--window-gap:12px;z-index:10;inset:calc(var(--bar) + 12px) var(--edge) auto;width:auto;
  max-height:calc(100dvh - var(--bar) - 26px);padding:0;background:#152735;border-color:#a18b64;isolation:isolate}
#field-window[data-window=statistics]{max-width:740px;margin-left:auto}
.field-window-head{position:sticky;top:0;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 20px;background:linear-gradient(100deg,#243a4b,#172835);border-bottom:1px solid #53606a}
.field-window-head>div>span{display:flex;align-items:center;gap:5px;color:var(--gold);font-size:13px}
.field-window-head .seal{width:28px;height:28px}
.field-window-head .close-panel{position:static;flex:none}
.field-window-body{padding:16px 20px}
.workspace-bar{position:sticky;top:0;z-index:7;display:flex;align-items:center;gap:6px;min-width:0;padding:5px 9px;background:#192e3d;border-bottom:1px solid #69716b}
.workspace-tabs{display:flex;align-self:stretch;align-items:stretch;gap:3px;min-width:0;flex:1}
.workspace-tabs button,.workspace-bar>.window-size,.workspace-bar>.close-panel{position:static;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:5px 10px;background:transparent;color:var(--muted);border:0;border-radius:3px}
.workspace-tabs button[aria-selected=true]{color:var(--gold);background:#29404d;box-shadow:inset 0 -2px var(--brass)}
.workspace-tabs .glyph,.window-size .glyph{width:20px;height:20px}
.workspace-bar>.window-size,.workspace-bar>.close-panel{flex:none;width:42px;color:var(--ivory)}
#field-window .window-field{display:flex;align-items:center;gap:6px;margin:0 0 12px;color:var(--gold);font:600 16px var(--sans)}
.window-field .seal{width:30px;height:30px}
#knowledge-atlas{grid-template-rows:auto auto minmax(0,1fr) auto}
#knowledge-atlas .knowledge-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
#knowledge-atlas .knowledge-heading .atlas-tools{display:flex;gap:6px}
body.maximized-workspace :is(#field-window,#knowledge-atlas){inset:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);width:auto;height:auto;max-height:none;max-width:none;border-radius:0;margin:0;z-index:12}
body.maximized-workspace #field-window[data-window=statistics]{max-width:none}
@media(min-width:1000px){
  .maximized-workspace .field-statistics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 40px;max-width:1440px;margin:0 auto}
  .maximized-workspace .field-statistics .field-figures{grid-column:1/-1}
  .maximized-workspace .field-statistics section:last-child{grid-column:1/-1}
}
@media(max-width:550px){
  .workspace-bar{gap:1px;padding:3px}.workspace-tabs{gap:0}
  .workspace-tabs button{flex:1;flex-direction:column;gap:2px;padding:3px 2px;font-size:12px;line-height:1.08}
  .workspace-bar>.window-size,.workspace-bar>.close-panel{width:36px;min-height:44px;padding:4px}
  #knowledge-atlas .knowledge-heading .screen-back{max-width:100%;border:0}
  #knowledge-atlas .knowledge-heading .stage-jump select{max-width:13ch}
}
.field-statistics section,.required-by{margin-top:19px}
.field-statistics h3,.required-by h4{font:500 21px/1.2 var(--serif);margin:0 0 8px}
.field-figures,.window-stores{display:flex;flex-wrap:wrap;gap:12px 18px}
.field-figures>div,.window-stores>div{display:grid;align-items:center;grid-template-columns:auto auto;column-gap:7px}
.field-figures>div{flex:1}
.field-figures>div>:first-child,.window-stores>div>:first-child{grid-row:span 2;width:44px;height:44px}
.field-figures span,.window-stores span,.food-allocation span,.recruit-site small{color:var(--muted);font-size:13px}
.field-figures strong,.food-allocation strong{font:400 26px var(--serif)}.window-stores span{text-transform:capitalize}
.food-allocation{display:flex;align-items:center;gap:10px}.food-allocation>.painted-icon{width:48px;height:48px}
.food-allocation strong,.food-allocation span{display:block}.allocation-split{flex:1;margin-left:7px}
.allocation-bar,.allocation-split>div:last-child{display:flex;align-items:center;justify-content:space-between;gap:5px}
.allocation-bar{height:8px;gap:2px;margin:6px 0;overflow:hidden;border-radius:4px}
.allocation-bar i{height:100%;background:#c3a16f}.allocation-bar i:last-child{background:#81b5b4;flex:1}.allocation-bar i.shortfall{background:#c38775}
.allocation-split b{font-size:14px}
.record-link{display:flex;align-items:center;gap:9px;width:100%;min-height:47px;text-align:left;background:transparent;border:0;padding:4px 0}
.record-link>:first-child{width:40px;height:40px;color:var(--gold);flex:none}.record-link>span{flex:1}.record-link>.glyph:last-child{width:17px;color:var(--gold)}
.unit-filters{max-width:660px}.model-legend{display:flex;gap:18px;flex-wrap:wrap;color:var(--muted);font-size:13px}
.model-legend span::before{content:'';display:inline-block;width:25px;border-top:2px dashed #94c8d4;margin:0 5px 3px 0}
.model-legend span:last-child::before{border-top:2px solid #dfbb7a}
.unit-trail{display:block;margin:8px 0 15px;padding:0 0 6px}
.model-chart{position:relative;isolation:isolate;display:grid;grid-auto-flow:column;grid-auto-columns:282px;width:max-content}
.model-stage{grid-row:span 5;display:grid;grid-template-rows:subgrid;align-items:center;justify-items:center;row-gap:20px;
  padding:0 13px 12px;background:var(--tint);border-inline-end:1px solid #8094a144}
.model-stage h3{align-self:stretch;width:calc(100% + 26px);padding:7px;text-align:center;font-size:18px;background:var(--cap);color:var(--accent)}
.model-priors,.model-gates{width:100%;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:5px}
.model-gates>small,.recruit-site small{color:var(--muted)}
.unit-knowledge,.model-stage .unit-node{position:relative;z-index:1;display:flex;align-items:center;gap:6px;
  min-height:44px;border:1px solid #687476;border-radius:5px;background:#1b2c39;color:#d0d8da;text-align:left}
.unit-knowledge{max-width:100%;padding:4px 7px;font:600 15px/1.12 var(--sans)}
.unit-knowledge.prior{max-width:49%;padding:3px;gap:3px;font-size:12px}
.unit-knowledge .painted-icon{width:39px;height:39px;flex:none}.unit-knowledge.prior .painted-icon{width:25px;height:25px}
.unit-knowledge small{display:block;margin-bottom:2px;color:#bbcad2;font:500 11px var(--sans)}
.unit-knowledge.known{border-color:#ae9f7b;color:var(--ivory)}.unit-knowledge:not(.known) .painted-icon{filter:saturate(.65)}
.model-stage .unit-node{flex-direction:row;justify-content:flex-start;width:85%;padding:6px;background:#162936}
.model-stage .unit-node b{font:400 19px/1.08 var(--serif)}.model-stage .unit-node[aria-pressed=true]{outline:2px solid var(--gold);background:#2b3b42}
.model-stage .unit-node{display:grid;justify-content:stretch;width:92%;background:#172936;padding:3px 3px 8px;text-align:center;overflow:hidden}
.model-stage .unit-node[aria-pressed=true]{background:#172936}
.model-art{display:block;height:clamp(104px,15vh,166px);width:auto;aspect-ratio:1;margin:auto;max-width:100%;background-repeat:no-repeat;background-size:300% 100%;background-position:calc(var(--view) * 50%) center}
.model-lock{display:inline-flex;vertical-align:middle;margin-left:5px}.model-lock .glyph{width:14px;height:14px}
.model-post{align-self:start;width:100%;padding-bottom:2px}
.model-details{margin-top:7px;font:14px/1.32 var(--sans);text-align:left}
.model-details .model-angles{display:flex;border-bottom:1px solid #b899693f;justify-content:center}
.model-angles button{flex:1;background:none;border:0;border-radius:0;color:var(--muted);font-size:12px;min-height:36px}
.model-angles button[aria-pressed=true]{color:var(--gold);box-shadow:inset 0 -2px var(--gold)}
.model-details p{margin:6px 0}
.model-sheet-link{display:inline-flex;align-items:center;gap:3px;color:var(--gold);min-height:32px}
.model-sheet-link .glyph{width:14px;height:14px}
.model-stage .unit-medal{width:58px;height:58px;flex:none}.model-stage .unit-medal>.glyph{width:35px;height:35px}
.recruit-site{text-align:center;font-weight:600}.recruit-site small{display:block;font-weight:400}
.model-edges{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.model-edges path{fill:none;stroke:currentColor;stroke-width:2}
.model-edges .need{color:#94c8d4}.model-edges>path.need{stroke-dasharray:4 3}.model-edges .refit{color:#dfbb7a}
.unit-profile .unit-face p{margin:5px 0}.unit-profile .unit-face>:first-child{width:74px;height:74px;flex:none}
@media(min-width:1101px){
  .with-side-window{--window-right:calc(var(--edge) + clamp(365px,31vw,460px) + 12px)}
  .with-side-window #field-window,.with-side-window #knowledge-atlas{right:var(--window-right)}
  .with-side-window #knowledge-atlas{left:var(--edge);top:calc(var(--bar) + 12px);bottom:12px}
  .with-side-window .atlas-workspace{grid-template-columns:minmax(0,1fr) clamp(280px,21vw,358px)}
  .with-side-window .knowledge-heading{padding:8px;gap:7px;flex-wrap:wrap}
  .with-side-window .knowledge-heading .screen-back{max-width:21%}
}
@media(max-width:1100px){
  #field-window{inset:6px 6px auto;max-height:calc(100dvh - 12px)}
}
@media(max-width:600px){
  .field-window-head,.field-window-body{padding:10px 12px}
  .field-figures{gap:6px}.field-figures>div{display:flex;flex-direction:column;align-items:flex-start}
  .field-figures>div>:first-child{width:35px;height:35px}.field-figures span{font-size:12px}
  .model-chart{grid-auto-columns:248px}.food-allocation>.painted-icon{width:34px;height:34px}
}
