/* One page frame for every route. Header, menus, banners and content share one inner box
   (--frame wide, --gutter padded), so their edges line up by construction. Loaded last. */

/* Paint the whole document canvas, including long pages and staff routes. */
html{background:linear-gradient(color-mix(in srgb,var(--surface-1) 91%,transparent),color-mix(in srgb,var(--surface-1) 96%,transparent)),url('/assets/event-hub/stone-iron-material.webp') center top / 960px 540px repeat var(--ground);color-scheme:dark;scrollbar-color:var(--line-strong) var(--ground)}
body,body.ember-slice{background:transparent;color:var(--ink);font-family:var(--font-ui)}
body:has(.staff-workspace:not([hidden])){background-color:transparent}
body.syndicate-arrival-background::before{display:none}

/* Connection states and notices share the frame's spacing scale. */
.notice{padding:var(--space-4) var(--space-5)}
/* Keep the list flush; only connection content needs its own inset. */
.events-index>.event-catalog:not(.event-access)>:is(h3,h3+p){margin-inline:var(--space-6)}
.events-index>.event-catalog:not(.event-access)>h3:first-child{margin-top:var(--space-5)}
.events-index>.event-catalog:not(.event-access)>h3+p+:is(a,button){margin:0 var(--space-6) var(--space-5)}
.events-index>.event-access{padding:var(--space-5) var(--space-6)}
.events-index>.event-access>h3:first-child{margin-top:0}
.events-index>.event-access>p.hint{padding:0}
@media(max-width:650px){
 .events-index>.event-catalog:not(.event-access)>:is(h3,h3+p),.events-index>.event-catalog:not(.event-access)>h3+p+:is(a,button){margin-inline:20px}
 .events-index>.event-access{padding-inline:20px}
}
::selection{background:var(--action);color:var(--action-ink)}
:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
a{color:var(--accent);text-underline-offset:3px}

/* Full-width bars whose content sits in the frame: padding grows with the window instead of a boxed inset. */
body>header,body>#shared-navigation,body>#staff-navigation{
 box-sizing:border-box;width:100%;max-width:none;margin:0;
 padding-inline:max(var(--gutter),calc((100% - var(--frame))/2 + var(--gutter)));
 border:0;border-radius:0;box-shadow:none}
body>header{background:var(--surface-1);border-bottom:1px solid var(--line);min-height:72px}
body>#shared-navigation{background:var(--ground);border-bottom:1px solid var(--line)}
body>#staff-navigation{background:var(--surface-1);border-bottom:1px solid var(--line)}
body>#shared-navigation a,body>#staff-navigation a{color:var(--ink-muted)}
body>#shared-navigation a[aria-current=page],body>#staff-navigation a[aria-current=page]{color:var(--ink);border-bottom-color:var(--accent)}
.brand-wordmark{font-family:var(--font-title);letter-spacing:.09em;color:var(--ink)}

/* Content uses the same box. */
body>main{box-sizing:border-box;width:100%;max-width:var(--frame);margin-inline:auto;padding-inline:var(--gutter)}
body>footer{max-width:var(--frame);padding-inline:var(--gutter)}

/* Buttons: one primary metal, one quiet outline. */
button.primary,.primary:is(a,button),a.shared-link.primary{background:var(--action);color:var(--action-ink);border-color:var(--action)}
button.primary:hover,a.shared-link.primary:hover{background:var(--action-hover);border-color:var(--action-hover)}

/* Tables read as data: tabular numbers everywhere. */
table,td,th,.num{font-variant-numeric:tabular-nums}

/* Scene headers show the whole painting (height set with the scene-banner rule in shared-shell.css);
   keep the emblem carved into each scene in view. */
:is(.home-page-heading,.events-muster-heading,.character-chamber) .scene-motion{object-position:62% 35%}

/* Every stat label carries its stat icon, so a row of numbers reads at a glance. */
.stat-grid .stat-cell>small{display:inline-flex;align-items:center;gap:6px}
.stat-grid .personal-stat-icon{width:20px;height:20px;flex:0 0 auto;color:var(--accent)}
.stat-grid .neutral-stat-icon svg{width:20px;height:20px}
/* Staff and task pages open with a compact title, not a scene banner: the work starts above the fold.
   Scene banners stay on member pages (Home, Events, My Character, Clan). The Gatherer keeps its own
   heading during the officer pilot. */
body :is(.people-root>.shared-heading,.native-task-heading,.ember-planning-heading,.staff-stat-intro:has(>h1),.external-heading:has(>h1),
 .insights-page-heading){
 position:relative;box-sizing:border-box;min-height:96px;display:flex;flex-direction:column;justify-content:center;gap:0;
 margin:0 0 var(--space-5);padding:var(--space-4) 0;background:none;border:0;border-bottom:1px solid var(--line);border-radius:0;overflow:visible}
body :is(.people-root>.shared-heading,.native-task-heading,.ember-planning-heading,.staff-stat-intro:has(>h1),.external-heading:has(>h1),
 .insights-page-heading)::before,
body :is(.people-root>.shared-heading,.native-task-heading,.ember-planning-heading,.staff-stat-intro:has(>h1),.external-heading:has(>h1),
 .insights-page-heading)::after{content:none;display:none}
body :is(.people-root>.shared-heading,.native-task-heading,.ember-planning-heading,.staff-stat-intro:has(>h1),.external-heading:has(>h1),
 .insights-page-heading) h1{font:600 var(--text-headline)/1.2 var(--font-title);margin:0;max-width:none;text-shadow:none}
body :is(.people-root>.shared-heading,.native-task-heading,.ember-planning-heading,.staff-stat-intro:has(>h1),.external-heading:has(>h1),
 .insights-page-heading)>p{margin:var(--space-1) 0 0;max-width:var(--measure-read);color:var(--ink-muted);text-shadow:none}

/* Owner Tools: a capture desk. One summary line, one card per waiting match with a single
   gold action, quiet text controls for everything optional, and the file fallback folded away. */
.owner-tools{display:grid;gap:var(--space-5)}
.owner-tools-summary{margin:0;font-size:var(--text-body);color:var(--ink)}
.owner-tools-section{display:grid;gap:var(--space-3);padding:var(--space-4) var(--space-5);background:var(--surface-1);border:1px solid var(--line);border-radius:var(--radius-surface);scroll-margin-top:var(--space-6)}
.owner-tools-section h2{margin:0;font:600 var(--text-title)/1.25 var(--font-title)}
.owner-tools-section>p{margin:0;max-width:var(--measure-read);color:var(--ink-muted)}
.owner-tools-section label{display:grid;gap:var(--space-1);max-width:28rem}
.owner-tools-section button.primary,.weekly-intake-plain>button{justify-self:start}
.weekly-intake-plain{display:grid;gap:var(--space-3)}
.weekly-intake-plain [data-weekly-status]:empty{display:none}
.owner-tools-matches{display:grid;gap:var(--space-3)}
.owner-tools-match{display:grid;gap:var(--space-2);padding:var(--space-4);background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius-control)}
.owner-tools-match-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--space-1) var(--space-4)}
.owner-tools-match h3{margin:0;font:600 var(--text-title)/1.25 var(--font-title)}
.owner-tools-meta{margin:0;color:var(--ink-muted);font-size:var(--text-small)}
.owner-tools-meta:empty{display:none}
.owner-tools-state{display:flex;flex-wrap:wrap;gap:var(--space-2);margin:0;padding:0;list-style:none}
.owner-tools-state li{padding:var(--space-1) var(--space-2);border-radius:var(--radius-control);font-size:var(--text-label);background:var(--good-wash);color:var(--good)}
.owner-tools-state li[data-tone=warn]{background:var(--warn-wash);color:var(--warn)}
.owner-tools-state li[data-tone=bad]{background:var(--bad-wash);color:var(--bad)}
.owner-tools-names{margin:0;color:var(--ink)}
.owner-tools-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2) var(--space-5);margin-top:var(--space-1)}
.owner-tools-more{position:relative}
.owner-tools-menu{display:grid;gap:var(--space-1);padding:var(--space-3);margin-top:var(--space-1);border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface-2);max-width:100%}
.owner-tools-menu[hidden]{display:none}
.owner-tools-menu a{white-space:normal;overflow-wrap:anywhere}
.owner-tools-go{font-weight:600}
.owner-tools-reveal,.owner-tools-link{min-height:44px;padding:0;background:none;border:0;color:var(--ink-muted);font:inherit;cursor:pointer;text-align:left}
.owner-tools-reveal::after{content:"";display:inline-block;width:6px;height:6px;margin-left:var(--space-2);border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-3px) rotate(45deg);transition:transform 140ms ease-out}
.owner-tools-reveal[aria-expanded=true]::after{transform:translateY(0) rotate(-135deg)}
.owner-tools-reveal:hover,.owner-tools-link:hover,.owner-tools-reveal[aria-expanded=true]{color:var(--ink);background:none}
.owner-tools-link{color:var(--accent)}
.owner-tools-panel{display:grid;gap:var(--space-2);padding-top:var(--space-2);border-top:1px solid var(--line)}
.owner-tools-panel p{margin:0}
.owner-tools-label{color:var(--ink-muted);font-size:var(--text-small);letter-spacing:.06em;text-transform:uppercase}
.owner-tools-downloads{display:flex;flex-wrap:wrap;gap:0 var(--space-5)}
.owner-tools-fallback{background:none;border-style:dashed;gap:var(--space-1)}
@media(max-width:650px){.owner-tools-section{padding:var(--space-4)}.owner-tools-actions>.primary{flex:1 1 100%;text-align:center}}
@media(prefers-reduced-motion:reduce){.owner-tools-reveal::after{transition:none}}

/* Desktop application of the shared sizing scale. Only a visible Strategy
   stage opts out: its retained DOM must not affect later Gatherer navigation. */
@media(min-width:1024px){
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)),body.ember-slice:not(:has(:where(#shared-stage:not([hidden])) .war-council)){
  font-size:var(--text-body);
 }
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) :is(button,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.shared-link,.action-link){
  font-size:var(--text-label);
 }
 /* Writing fields keep their component's minimum; this floor is for single-line controls. */
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) :is(button,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,.shared-link,.action-link){
  min-height:var(--target-min);
 }
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) :is(#shared-navigation,#navigation,#staff-navigation,#staff-task-navigation,#context-navigation)>a{
  font-size:var(--text-label);min-height:var(--target-min);
 }
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) main h1{font-size:var(--text-display)}
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) main h2{font-size:var(--text-headline)}
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) main h3{font-size:var(--text-title)}
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) main :is(.hint,.small,small){font-size:var(--text-small)}
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) :is(table th,table td){font-size:var(--text-label)}
 /* Data workspaces use the shared frame; prose retains its existing ch measure. */
 body:not(:has(:where(#shared-stage:not([hidden])) .war-council)) :is(.shared-stage,.matching-workspace,.match-history,.member-record,.event-prep,.event-results,.roster-plan,.data-extract){max-width:100%}
}
