@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Pantheon design system. Semantic colors change; engineering figures keep their own materials. */
:root {
  --p-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --p-font-display: 'Space Grotesk', 'DM Sans', sans-serif;
  --p-bg: #f3f5f8; --p-surface: #ffffff; --p-surface-2: #eaf0f6;
  --p-text: #14253c; --p-muted: #607087; --p-subtle: #78879b;
  --p-border: #dce3ec; --p-line: #cbd5e2;
  --p-accent: #2459dd; --p-accent-soft: #e9efff; --p-action: #2859df; --p-on-action: #ffffff;
  --p-teal: #087e79; --p-teal-soft: #e0f3ef;
  --p-success: #087c53; --p-warning: #a65e08; --p-danger: #c33846;
  --p-canvas: #0c1b2d; --p-radius: 12px; --p-radius-lg: 20px;
  --p-shadow: 0 2px 7px rgb(21 39 63 / 4%), 0 12px 28px rgb(21 39 63 / 3%);
  --p-shadow-lg: 0 18px 60px rgb(15 33 58 / 16%);
  --p-header-height: 72px;
}
html.dark, html[data-theme='dark'] {
  --p-bg: #0b1422; --p-surface: #121f30; --p-surface-2: #19293e;
  --p-text: #e6edf6; --p-muted: #a0afc2; --p-subtle: #8a9bb2;
  --p-border: #2b3c52; --p-line: #384b65;
  --p-accent: #8cabff; --p-accent-soft: #203456; --p-action: #3561df;
  --p-teal: #65d7c4; --p-teal-soft: #123b3c;
  --p-success: #70dcb0; --p-warning: #f5bd69; --p-danger: #ff8f99;
  --p-shadow: 0 2px 8px rgb(0 0 0 / 10%), 0 12px 28px rgb(0 0 0 / 8%);
  --p-shadow-lg: 0 18px 60px rgb(0 0 0 / 40%);
}
/* Bridge existing tools to one palette without changing their data or layouts. */
html[data-page] {
  --bg: var(--p-bg); --surface: var(--p-surface); --surface-2: var(--p-surface-2); --panel: var(--p-surface);
  --text: var(--p-text); --ink: var(--p-text); --ink-soft: var(--p-muted); --fg: var(--p-text);
  --muted: var(--p-muted); --border: var(--p-border); --line: var(--p-line); --line-soft: var(--p-surface-2);
  --accent: var(--p-accent); --blue: var(--p-accent); --blue-dark: var(--p-accent);
  --accent-light: var(--p-accent-soft); --accent-soft: var(--p-accent-soft); --tab-active: var(--p-accent);
  --teal: var(--p-teal); --green: var(--p-success); --red: var(--p-danger);
  --danger: var(--p-danger); --ok: var(--p-success); --warn: var(--p-warning);
  --stale-warn: var(--p-warning); --stale-error: var(--p-danger);
  --shadow: var(--p-shadow); --shadow-lg: var(--p-shadow-lg); --radius: var(--p-radius);
}
html[data-page] *, html[data-page] *::before, html[data-page] *::after { box-sizing: border-box; }
html[data-page] body { font-family: var(--p-font-body); color: var(--p-text); background: var(--p-bg); -webkit-font-smoothing: antialiased; margin: 0; }
html[data-page] :is(h1,h2,h3,h4) { font-family: var(--p-font-display); letter-spacing: -.035em; }
html[data-page] :is(button,input,select,textarea) { font-family: var(--p-font-body); }
html[data-page] :is(input,textarea,select) { accent-color: var(--p-accent); }
html[data-page] :is(a,button,input,textarea,select,summary,[tabindex]):focus-visible { outline: 3px solid var(--p-accent); outline-offset: 3px; }
html[data-page] :is(input,textarea)::placeholder { color: var(--p-muted); opacity: 1; }
html[data-page] ::selection { background: var(--p-accent-soft); color: var(--p-text); }
html[data-page] :is(.btn.primary,.ingest-btn:not(.secondary)) { background: var(--p-action); border-color: var(--p-action); color: var(--p-on-action); }
html[data-page] :is(.btn,.tab-btn,.tab,.chip,.chip-toggle) { transition: background .16s ease, border-color .16s ease, color .16s ease; }
html[data-page] :is(.btn,.tab-btn,.tab) { font-weight: 550; }
html[data-page] :is(input,textarea,select) { border-color: var(--p-border); }
/* Native menus do not consistently inherit a select's custom foreground.
   Set both colors, including transparent selects in drawers and filter bars. */
html[data-page] :is(option,optgroup) { color: var(--p-text); background-color: var(--p-surface); }
html[data-page='ops'] :is(input:not([type='checkbox']):not([type='radio']):not([type='range']),textarea,select) { color: var(--p-text); background-color: var(--p-surface); }

/* Shared navigation is namespaced so embedded tools keep their own controls. */
.no-header, .no-header * { box-sizing: border-box; }
html[data-page] .no-header, .no-header {
  position: relative; z-index: 45; flex: 0 0 auto; min-height: 72px;
  display: flex; align-items: center; gap: 24px; padding: 12px 28px;
  background: var(--p-surface); color: var(--p-text); border-bottom: 1px solid var(--p-border);
  font-family: var(--p-font-body); line-height: 1.3;
}
.no-header a { text-decoration: none; }
.no-header .p-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--p-text); }
.no-header .p-brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #102840; }
.no-header .p-brand-mark img { display: block; width: 25px; height: 25px; }
.no-header .p-brand-wordmark { font: 600 20px/1.1 var(--p-font-display); letter-spacing: -.055em; }
.no-header .p-brand-wordmark > span { display: block; font: 450 12px/1.7 var(--p-font-body); letter-spacing: .025em; color: var(--p-muted); }
.no-header .p-nav { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.no-header .p-nav::-webkit-scrollbar { display: none; }
.no-header .p-nav a { font: 550 14px/1.3 var(--p-font-body); color: var(--p-muted); white-space: nowrap; border-radius: 7px; padding: 12px 12px; }
.no-header .p-nav a:hover { background: var(--p-surface-2); color: var(--p-text); }
.no-header .p-nav a[aria-current='page'] { background: var(--p-accent-soft); color: var(--p-accent); }
.no-header .p-header-actions { display: flex; align-items: center; gap: 15px; margin-left: auto; flex: 0 0 auto; }
.no-header .p-header-spacer { flex: 1; }
.no-header .p-theme-control { display: flex; align-items: center; gap: 3px; padding: 0 8px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 8px; color: var(--p-muted); height: 36px; }
.no-header .p-theme-control svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.no-header .p-theme-control select { appearance: auto; width: auto; max-width: 86px; min-width: 0; min-height: 32px; height: 32px; padding: 0 1px 0 5px; margin: 0; font: 500 14px/1.2 var(--p-font-body); border: 0; border-radius: 4px; background: transparent; color: var(--p-text); cursor: pointer; }
.no-header .p-theme-control option { color: var(--p-text); background: var(--p-surface); }
.no-header .p-account { display: flex; align-items: center; gap: 12px; }
.no-header .p-user { display: block; max-width: 150px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--p-muted); }
.no-header .p-user[hidden] { display: none; }
.no-header .p-signout { color: var(--p-muted); font: 500 14px/1.2 var(--p-font-body); white-space: nowrap; }
.no-header .p-signout:hover { color: var(--p-accent); }
.p-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.p-skip { position: fixed; top: -80px; left: 16px; z-index: 2000; padding: 12px 18px; border-radius: 8px; background: var(--p-action); color: white; font: 500 14px var(--p-font-body); text-decoration: none; }
.p-skip:focus { top: 12px; }

/* Workspace home. */
html[data-page='home'] body { min-height: 100vh; }
.p-home { max-width: 1360px; margin: 0 auto; padding: 52px 40px 38px; }
.p-home-intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.p-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--p-muted); font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.p-eyebrow-dot { display: inline-block; width: 6px; height: 6px; background: var(--p-teal); border-radius: 50%; }
.p-home h1 { margin: 12px 0 0; font-size: clamp(32px,4vw,52px); line-height: 1.12; font-weight: 500; letter-spacing: -.055em; }
.p-home-intro > p { margin: 0 0 3px; max-width: 280px; font-size: 16px; line-height: 1.75; color: var(--p-muted); }
.p-feature { display: grid; grid-template-columns: .85fr 1.15fr; min-height: 360px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius-lg); overflow: hidden; box-shadow: var(--p-shadow); }
.p-feature-copy { padding: 34px 38px; display: flex; align-items: flex-start; flex-direction: column; justify-content: center; }
.p-feature .p-eyebrow { color: var(--p-teal); font-size: 12px; }
.p-feature h2 { margin: 18px 0 12px; font-size: clamp(29px,3vw,39px); font-weight: 500; line-height: 1.1; }
.p-feature-copy > p { margin: 0; max-width: 320px; font-size: 16px; line-height: 1.8; color: var(--p-muted); }
.p-primary-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; text-decoration: none; background: var(--p-action); color: white; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 550; transition: filter .16s ease; }
.p-primary-link:hover { filter: brightness(1.12); }
.p-feature .p-primary-link { margin-top: 24px; }
.p-feature-topics { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; color: var(--p-muted); font-size: 12px; }
.p-feature-topics span + span::before { content: '/'; margin-right: 12px; color: var(--p-line); }
.p-feature-visual { display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 340px; background: var(--p-canvas); overflow: hidden; color: #e5edf9; }
.p-feature-visual::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgb(137 171 211 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(137 171 211 / 5%) 1px, transparent 1px); background-size: 30px 30px; pointer-events: none; }
.p-diagram-label { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #9caec4; letter-spacing: .1em; }
.p-diagram-label span:first-child { color: #73d5c6; }
.p-feature-visual svg { position: relative; width: 100%; height: auto; max-height: 290px; display: block; }
.p-diagram-caption { position: absolute; left: 28px; right: 28px; bottom: 22px; display: flex; justify-content: space-between; gap: 12px; color: #aabacf; font-size: 12px; }
.p-connection-flow { stroke-dasharray: 4 7; animation: p-flow 2.2s linear infinite; }
@keyframes p-flow { to { stroke-dashoffset: -22; } }
.p-home-section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 40px 0 18px; }
.p-home-section-title h2 { font-size: 18px; font-weight: 500; margin: 0; }
.p-home-section-title p { margin: 0; font-size: 12px; color: var(--p-muted); }
.p-tool-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 18px; }
.p-tool-card { grid-column: span 2; border: 1px solid var(--p-border); border-radius: var(--p-radius); background: var(--p-surface); overflow: hidden; text-decoration: none; color: var(--p-text); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.p-tool-card:nth-child(n+4) { grid-column: span 3; }
.p-tool-card:hover { transform: translateY(-3px); border-color: var(--p-line); box-shadow: var(--p-shadow); }
.p-tool-image { height: 168px; padding: 14px 14px 0; background: var(--p-surface-2); overflow: hidden; border-bottom: 1px solid var(--p-border); }
.p-tool-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 6px 6px 0 0; display: block; }
.p-tool-image.p-model-image { padding: 0; background: #f5f6f8; }
.p-tool-image.p-model-image img { border-radius: 0; object-fit: cover; object-position: center; }
.p-tool-content { padding: 20px 22px 22px; }
.p-tool-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--p-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .11em; }
.p-tool-meta .p-open-arrow { font-size: 18px; color: var(--p-muted); line-height: 1; }
.p-tool-card h3 { margin: 0 0 8px; font-weight: 500; font-size: 21px; }
.p-tool-card p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--p-muted); }
.p-tool-card.p-compact { display: flex; align-items: stretch; }
.p-tool-card.p-compact .p-tool-image { flex: 0 0 37%; height: auto; min-height: 164px; padding: 0; border-bottom: 0; border-right: 1px solid var(--p-border); }
.p-tool-card.p-compact .p-tool-image img { height: 100%; border-radius: 0; object-position: center; }
.p-tool-card.p-compact .p-tool-content { flex: 1; min-width: 0; }
.p-home-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 26px; margin-top: 32px; border-top: 1px solid var(--p-border); color: var(--p-muted); font-size: 12px; }
.p-home-footer a { color: inherit; text-decoration: none; }
.p-home-footer a:hover { color: var(--p-accent); }

/* Knowledge workspace. Preserve category colors and all figure backgrounds. */
html[data-page='notes'] { --header-h: 56px; --sidebar-w: 280px; }
html[data-page='notes'] body { height: 100dvh; }
html[data-page='notes'] body > header { padding: 0 22px; gap: 14px; }
html[data-page='notes'] header .title { font-family: var(--p-font-display); font-size: 16px; font-weight: 500; }
html[data-page='notes'] .tabs { border: 1px solid var(--p-border); border-radius: 12px; }
html[data-page='notes'] .tab-btn { min-height: 32px; }
html[data-page='notes'] .sidebar-search { padding: 14px 14px 12px; gap: 8px; }
html[data-page='notes'] .sidebar-search input[type='search'] { min-height: 38px; border-radius: 8px; }
html[data-page='notes'] .facet-panel { padding: 12px 16px; }
html[data-page='notes'] .overview-hero h1 { font-size: 32px; font-weight: 500; line-height: 1.2; }
html[data-page='notes'] .overview-hero p { font-size: 14px; }
html[data-page='notes'] .cat-card { padding: 20px; border-radius: var(--p-radius); box-shadow: var(--p-shadow); }
html[data-page='notes'] .cat-card-title { font-family: var(--p-font-display); font-size: 16px; font-weight: 500; }
html[data-page='notes'] .cat-card-desc { line-height: 1.75; }
html[data-page='notes'] .cat-tag { background: var(--p-surface-2); border-color: transparent; border-radius: 4px; }
html[data-page='notes'] .stat-chip { border-radius: 7px; background: var(--p-surface); }
html[data-page='notes'] .md-content h1 { font-size: 32px; font-weight: 500; }
html[data-page='notes'] .md-content :is(h2,h3) { letter-spacing: -.025em; }
html[data-page='notes'] .md-content :is(p,li) { line-height: 1.8; }
html[data-page='notes'].dark .graph-node text { fill: var(--p-muted); }
html[data-page='notes'].dark .graph-settings select { background: var(--p-surface-2); border-color: var(--p-border); }
html[data-page='notes'].dark .asst-body code { background: var(--p-surface-2); color: var(--p-text); }
html[data-page='notes'].dark .asst-body pre { background: var(--p-bg); border-color: var(--p-border); }
html[data-page='notes'] ::-webkit-scrollbar-thumb { background: var(--p-line); }

/* Model shell keeps original CAD and renders intact. */
html[data-page='models'] .bar { min-height: 64px; padding: 12px 24px; gap: 12px; background: var(--p-surface); border-color: var(--p-border); }
html[data-page='models'] .bar h1 { font-family: var(--p-font-display); font-size: 18px; font-weight: 500; color: var(--p-text); margin-right: 16px; }
html[data-page='models'] .bar .pick { color: var(--p-muted); font-size: 14px; }
html[data-page='models'] .btn { color: var(--p-text); background: var(--p-surface); border-color: var(--p-border); }
html[data-page='models'] .btn:hover { background: var(--p-surface-2); }
html[data-page='models'] .btn[aria-pressed='true'] { color: var(--p-accent); background: var(--p-accent-soft); border-color: var(--p-accent); }
html[data-page='models'] #controls { padding: 16px 24px; gap: 12px 24px; background: var(--p-surface); border-color: var(--p-border); }
html[data-page='models'] .field label { color: var(--p-muted); font-size: 12px; letter-spacing: .1em; }
html[data-page='models'] select { background: var(--p-bg); color: var(--p-text); font-size: 14px; border-color: var(--p-border); }
html[data-page='models'] #open { color: var(--p-accent); font-size: 14px; }
html[data-page='models'] .cap { color: var(--p-muted); font-size: 12px; }
html[data-page='models'] .cap b { color: var(--p-text); }
html[data-page='models'] #stage { background: var(--p-bg); }
html[data-page='models'] #stage .imgwrap { background: var(--p-bg); padding: 24px; }
html[data-page='models'] #stage img { border-radius: 12px; }

/* Operations retains functional colors for priority, category and live status. */
html[data-page='ops'] .topbar { padding: 14px 24px; gap: 12px 18px; }
html[data-page='ops'] .topbar h1 { font-size: 20px; font-weight: 500; }
html[data-page='ops'] .tabs { gap: 3px; }
html[data-page='ops'] .tabs a { font-size: 14px; min-height: 36px; }
html[data-page='ops'] .filters { padding: 12px 24px; }
html[data-page='ops'] main { padding: 22px 24px 80px; }
html[data-page='ops'] .col { background: var(--p-surface-2); border-color: var(--p-border); }
html[data-page='ops'] .col-head { padding: 15px 14px 12px; font-size: 13px; }
html[data-page='ops'] .col-note { padding-right: 14px; padding-left: 14px; }
html[data-page='ops'] .card { padding: 14px 12px 12px 14px; box-shadow: var(--p-shadow); }
html[data-page='ops'] .card .title { font-weight: 550; line-height: 1.5; }
html[data-page='ops'] .card .meta { font-size: 12px; gap: 8px; }
html[data-page='ops'] .chip { font-size: 14px; border-radius: 7px; }
html[data-page='ops'] .drawer .dbody { padding: 20px 22px 60px; }
html[data-page='ops'] .table-wrap { border-radius: var(--p-radius); }

/* Local CAD view controls share appearance without changing model materials. */
html[data-page='cad'] #hud { background: var(--p-surface); color: var(--p-text); border-color: var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); font: 14px/1.6 var(--p-font-body); max-width: min(380px, calc(100vw - 28px)); }
html[data-page='cad'] #hud :is(b,label), html[data-page='cad'] #phase { color: var(--p-text); }
html[data-page='cad'] #hud :is(.dim,.note) { color: var(--p-muted); }
html[data-page='cad'] #hud hr { border-top-color: var(--p-border); }
html[data-page='cad'] #hud :is(button,select) { font: 14px var(--p-font-body); background: var(--p-surface-2); color: var(--p-text); border: 1px solid var(--p-border); border-radius: 6px; }
html[data-page='cad'] #hud button:hover { background: var(--p-accent-soft); }
html[data-page='cad'] #hud :is(button.on,#play) { background: var(--p-action); color: var(--p-on-action); border-color: var(--p-action); }
html[data-page='cad'] #hud input[type='range'] { accent-color: var(--p-accent); }
html[data-page='cad'] #hud .tabs { flex-wrap: wrap; }

/* Sign-in shares the same identity and appearance, with its auth flow untouched. */
html[data-page='login'] body { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 100dvh; }
.p-login-main { flex: 1; display: grid; place-items: center; padding: 48px 24px 80px; background-image: radial-gradient(var(--p-border) .8px, transparent .8px); background-size: 22px 22px; }
html[data-page='login'] .login-card { background: var(--p-surface); padding: 40px; border: 1px solid var(--p-border); border-radius: var(--p-radius-lg); box-shadow: var(--p-shadow-lg); max-width: 410px; gap: 24px; }
html[data-page='login'] .login-card .logo { width: 48px; height: 48px; padding: 12px; background: #102840; border-radius: 13px; }
html[data-page='login'] .heading { color: var(--p-text); font: 500 28px/1.2 var(--p-font-display); letter-spacing: -.045em; }
html[data-page='login'] .subtext { color: var(--p-muted); line-height: 1.7; margin-top: -12px; }
html[data-page='login'] .btn-google { background: var(--p-surface); color: var(--p-text); border-color: var(--p-line); padding: 14px 20px; font-size: 14px; border-radius: 8px; }
html[data-page='login'] .btn-google:hover { background: var(--p-surface-2); }
html[data-page='login'] .error { background: var(--p-surface-2); border-color: var(--p-danger); color: var(--p-danger); }
.p-login-note { margin: 0; color: var(--p-muted); text-align: center; font-size: 12px; line-height: 1.7; }

@media (max-width: 1180px) {
  html[data-page] .no-header, .no-header { gap: 20px; padding-right: 22px; padding-left: 22px; }
  .no-header .p-user { display: none; }
  .no-header .p-nav a { padding-left: 12px; padding-right: 12px; }
  .p-home { padding: 36px 28px; }
  .p-feature-copy { padding: 30px; }
  .p-tool-card.p-compact .p-tool-image { flex-basis: 31%; }
}
@media (max-width: 900px) {
  html[data-page] .no-header, .no-header { flex-wrap: wrap; gap: 12px; padding: 12px 20px 8px; min-height: 104px; }
  .no-header .p-nav { order: 3; flex-basis: 100%; gap: 3px; }
  .no-header .p-nav a { padding: 12px 12px; }
  html[data-page='login'] .no-header { min-height: 72px; padding-bottom: 12px; }
  .p-home-intro > p { max-width: 240px; }
  .p-feature { grid-template-columns: 1fr 1fr; }
  .p-feature-copy { padding: 28px; }
  .p-feature-topics { gap: 8px; font-size: 12px; }
  .p-feature-topics span + span::before { margin-right: 8px; }
  .p-tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .p-tool-card, .p-tool-card:nth-child(n+4) { grid-column: auto; }
  .p-tool-card:last-child { grid-column: 1 / -1; }
  .p-tool-card.p-compact { display: block; }
  .p-tool-card.p-compact .p-tool-image { height: 168px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--p-border); }
  .p-tool-card.p-compact:last-child { display: flex; }
  .p-tool-card.p-compact:last-child .p-tool-image { height: auto; flex-basis: 40%; border-bottom: 0; border-right: 1px solid var(--p-border); }
}
@media (max-width: 768px) {
  html[data-page='notes'] body > header { padding: 0 12px; gap: 8px; }
  html[data-page='notes'] .sidebar { top: calc(var(--p-header-height) + var(--header-h)); height: calc(100dvh - var(--p-header-height) - var(--header-h)); }
  html[data-page='notes'] #sidebar-backdrop { top: calc(var(--p-header-height) + var(--header-h)); }
  html[data-page='notes'] .overview-hero h1 { font-size: 27px; }
  html[data-page='notes'] .md-content h1 { font-size: 27px; }
}
@media (max-width: 600px) {
  html[data-page] .no-header, .no-header { padding-right: 16px; padding-left: 16px; }
  .no-header .p-brand-wordmark { font-size: 19px; }
  .no-header .p-header-actions { gap: 12px; }
  .no-header .p-signout { font-size: 14px; }
  .no-header .p-theme-control { padding: 0 6px; }
  .no-header .p-theme-control svg { display: none; }
  .no-header .p-nav a { font-size: 14px; padding: 12px 12px; }
  .p-home { padding: 28px 16px; }
  .p-home-intro { display: block; margin-bottom: 24px; }
  .p-home-intro > p { max-width: 100%; margin-top: 18px; font-size: 16px; }
  .p-home h1 { font-size: 37px; }
  .p-feature { grid-template-columns: minmax(0,1fr); }
  .p-feature-copy { padding: 28px; }
  .p-feature h2 { font-size: 34px; }
  .p-feature-visual { min-height: 305px; }
  .p-feature-visual svg { max-height: 255px; }
  .p-home-section-title { margin-top: 30px; }
  .p-home-section-title p { display: none; }
  .p-tool-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .p-tool-card:last-child { grid-column: auto; }
  .p-tool-card.p-compact:last-child { display: block; }
  .p-tool-card.p-compact:last-child .p-tool-image { height: 168px; border-right: 0; border-bottom: 1px solid var(--p-border); }
  .p-tool-image { height: 180px; }
  .p-home-footer { font-size: 12px; line-height: 1.7; }
  html[data-page='ops'] :is(.topbar,.filters) { padding: 12px 16px; }
  html[data-page='ops'] main { padding: 16px 16px 80px; }
  html[data-page='models'] :is(.bar,#controls) { padding-right: 16px; padding-left: 16px; }
  html[data-page='models'] #stage .imgwrap { padding: 12px; }
  html[data-page='models'] .bar .btn { font-size: 14px; padding: 0 12px; }
  html[data-page='login'] .login-card { padding: 32px 26px; }
}
/* Keep workspace covers in the established 16:9 format. */
.p-tool-card:not(.p-compact) .p-tool-image { aspect-ratio: 16 / 9; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .p-connection-flow { animation: none; }
  .p-tool-card, .p-primary-link, html[data-page] :is(.btn,.tab-btn,.tab,.chip,.chip-toggle) { transition: none; }
  .p-tool-card:hover { transform: none; }
}
@media print {
  html[data-page] .no-header, .no-header, .p-skip { display: none; }
}

/* Compact workspace shell. Appearance belongs to the account menu. */
html[data-page] .no-header,.no-header{min-height:60px;padding:0 24px;gap:32px;flex-wrap:nowrap;box-shadow:none;align-items:center}
.no-header .p-brand-mark{width:30px;height:30px;border-radius:8px}.no-header .p-brand-mark img{width:23px;height:23px}
.no-header .p-brand-wordmark{font-size:19px;letter-spacing:-.04em}.no-header .p-brand{gap:10px}
.no-header .p-nav{align-self:stretch;gap:24px;overflow:visible}.no-header .p-nav a{display:flex;align-items:center;padding:0 2px;border-radius:0;border-bottom:2px solid transparent;font-size:14px;font-weight:500}
.no-header .p-nav a[aria-current='page']{background:transparent;border-bottom-color:var(--p-accent);color:var(--p-text)}.no-header .p-nav a:hover{background:transparent;color:var(--p-text)}
.no-header .p-header-actions{gap:10px;margin-left:auto}.no-header .p-account{position:relative;display:block}
.no-header .p-account-button,.no-header .p-nav-toggle{display:flex;align-items:center;justify-content:center;gap:8px;min-height:36px;min-width:36px;padding:4px 7px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--p-text);font:500 14px var(--p-font-body);cursor:pointer}
.no-header .p-account-button:hover,.no-header .p-account-button[aria-expanded='true'],.no-header .p-nav-toggle:hover{background:var(--p-surface-2)}
.no-header .p-account-button>svg{width:14px;height:14px}.no-header svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.no-header .p-avatar{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--p-surface-2);color:var(--p-muted);font-size:12px;font-weight:650}
.no-header .p-account-panel{position:absolute;z-index:100;top:calc(100% + 10px);right:0;width:252px;padding:16px;background:var(--p-surface);color:var(--p-text);border:1px solid var(--p-border);border-radius:10px;box-shadow:var(--p-shadow-lg)}
.no-header .p-account-panel[hidden]{display:none}.p-appearance{padding:0;margin:0;border:0}.p-appearance legend{margin-bottom:12px;font-size:13px;font-weight:600}
.p-theme-options{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.p-theme-options label{position:relative;cursor:pointer}.p-theme-options input{position:absolute;opacity:0;width:1px;height:1px}
.p-theme-options label>span{display:flex;align-items:center;flex-direction:column;gap:6px;padding:10px 4px;font-size:12px;border:1px solid var(--p-border);border-radius:6px;color:var(--p-muted)}
.p-theme-options input:checked+span{color:var(--p-accent);background:var(--p-accent-soft);border-color:var(--p-accent)}.p-theme-options input:focus-visible+span{outline:2px solid var(--p-accent);outline-offset:2px}
.no-header .p-account-link{display:block;margin-top:14px;padding-top:12px;border-top:1px solid var(--p-border);font-size:13px;color:var(--p-muted)}.no-header .p-account-link:hover{color:var(--p-text)}
.no-header .p-nav-toggle{display:none}
.p-workspace{max-width:1136px;margin:0 auto;padding:44px 32px 64px}.p-workspace h1{font-size:26px;font-weight:500;margin:0 0 28px}
.p-project{display:grid;grid-template-columns:1fr 1.35fr;color:var(--p-text);text-decoration:none;border:1px solid var(--p-border);border-radius:12px;overflow:hidden;background:var(--p-surface);min-height:288px;transition:border-color .15s}
.p-project:hover{border-color:var(--p-accent)}.p-project+.p-project{margin-top:14px}.p-project-copy{padding:32px;display:flex;align-items:start;flex-direction:column}.p-project .p-eyebrow{font-size:11px;letter-spacing:.1em;color:var(--p-muted);font-weight:500}.p-project h2{font-size:38px;font-weight:500;margin:14px 0 6px;line-height:1.1}.p-project p{font-size:15px;color:var(--p-muted);margin:0 0 20px}.p-project-team{display:flex;gap:18px;font-size:13px;color:var(--p-muted)}.p-project-open{display:flex;align-items:center;gap:30px;margin-top:auto;padding-top:24px;font-size:14px;color:var(--p-accent);font-weight:550}.p-project-image{overflow:hidden;position:relative;min-height:240px}.p-project-image img{position:absolute;width:100%;height:100%;object-fit:cover}
.p-tools-title{font-size:16px;font-weight:500;margin:36px 0 14px}.p-workspace-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.p-workspace-tools>a{position:relative;overflow:hidden;padding:0;background:var(--p-surface);border:1px solid var(--p-border);border-radius:10px;color:var(--p-text);text-decoration:none}.p-workspace-tools>a:hover{border-color:var(--p-line);background:var(--p-surface-2)}.p-tool-picture{aspect-ratio:16/10;overflow:hidden;background:var(--p-surface-2);border-bottom:1px solid var(--p-border)}.p-tool-picture img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}.p-teacher-picture img{object-fit:contain;padding:10px}.p-tool-copy{padding:19px 19px 22px}.p-workspace-tools h3{font-size:16px;margin:0 0 8px;font-weight:550}.p-workspace-tools p{font-size:13px;line-height:1.6;margin:0;color:var(--p-muted)}
@media(max-width:760px){
 html[data-page] .no-header,.no-header{min-height:54px;padding:0 14px;gap:12px;flex-wrap:nowrap}
 .no-header .p-brand-wordmark{font-size:18px}.no-header .p-header-actions{gap:3px}.no-header .p-nav-toggle{display:flex}.no-header .p-account-button{gap:6px}.no-header .p-avatar{display:none}
 .no-header .p-nav{display:none;position:absolute;top:100%;left:0;right:0;align-self:auto;padding:8px 14px 14px;background:var(--p-surface);border-bottom:1px solid var(--p-border);box-shadow:var(--p-shadow);gap:4px}
 .no-header.p-nav-open .p-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.no-header .p-nav a{padding:12px;border:0;border-radius:6px}.no-header .p-nav a[aria-current='page']{background:var(--p-accent-soft);color:var(--p-accent)}
 .p-workspace{padding:24px 16px 40px}.p-workspace h1{font-size:22px;margin-bottom:18px}.p-project{grid-template-columns:1fr;min-height:0}.p-project-copy{padding:24px}.p-project h2{font-size:32px}.p-project-image{min-height:170px;grid-row:1}.p-project-open{padding-top:20px}.p-project p{margin-bottom:16px}.p-workspace-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.p-workspace-tools>a{padding:0}.p-tool-copy{padding:15px 13px 18px}.p-tools-title{margin-top:28px}
}
/* Drawings get their own readable canvas, not a wall of reduced full sheets. */
.p-diagrams{max-width:1440px;margin:auto;gap:20px}.p-diagrams .dcard>h3{display:flex;justify-content:space-between;align-items:center;gap:14px;font-size:16px;padding:14px 18px;font-weight:500}.p-diagrams .dcard>h3>a{font-size:13px;margin-left:auto;font-weight:400}.p-diagrams .dcard iframe{height:min(68vh,680px);min-height:390px}.p-drawing-tools{display:flex;align-items:center;gap:5px;margin-left:auto}.p-drawing-tools .btn{font-size:13px!important;min-height:30px;padding:2px 9px!important}.p-drawing-viewport{overflow:auto;max-height:75vh;background:var(--p-surface);overscroll-behavior:contain}.p-drawing-viewport img{display:block;width:100%;height:auto}.p-source-sketch>summary{padding:16px 18px;cursor:pointer;font-size:14px;color:var(--p-muted)}.p-source-sketch img{width:100%;height:auto}
@media(max-width:680px){.p-diagrams .dcard>h3{padding:12px;font-size:14px;align-items:flex-start;flex-wrap:wrap}.p-diagrams .dcard iframe{height:64vh;min-height:380px}.p-drawing-tools{gap:4px}.p-drawing-viewport img{min-width:760px}.p-drawing-viewport{max-height:60vh}}
.p-drawing-notes{padding:16px 20px;border-top:1px solid var(--p-border);font-size:14px;line-height:1.6;color:var(--p-muted);display:grid;gap:10px}.p-drawing-notes p{margin:0!important;font-size:14px!important}.p-drawing-viewport img{min-width:960px}.p-drawing .p-drawing-viewport{background:#f8fafc}.p-drawing:nth-of-type(4) .p-drawing-viewport img{min-width:760px}@media(max-width:680px){.p-drawing-notes{padding:14px}.p-drawing-tools .btn{min-height:36px}.p-drawing-viewport img{min-width:1100px}.p-drawing:nth-of-type(4) .p-drawing-viewport img{min-width:900px}}
/* Between the phone menu and a wide window the nav row scrolls inside itself instead of widening the page. */
@media(min-width:761px) and (max-width:1180px){.no-header .p-nav{gap:18px;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.no-header .p-nav a{flex:none}}
/* Divider between the projects (OASIS-00, OASIS-01) and the tools. On the phone menu it becomes a full-width rule. */
.no-header .p-nav-sep{display:flex;align-items:center;flex:none;color:var(--p-line);font:400 18px/1 var(--p-font-body);user-select:none}
@media(max-width:760px){.no-header .p-nav-sep{grid-column:1/-1;height:1px;margin:4px 0;overflow:hidden;color:transparent;background:var(--p-border)}}
