/* app.css: design tokens (light + dark) and shared pieces, each page's styles, and at the end the role layer that
   gives Anvil components (Button, Label, TextBox, notifications, dialogs, RepeatingPanel grids) the same look.
   Restyle the app by changing the tokens at the top (both the light and the dark blocks). */

/* core.css: design tokens + the shared components. Restyle an app mostly by changing the tokens below
   (colours, fonts, radius, shadow); fonts are loaded in web/head.html. Light and dark are both required. */
/* Brain Mechanic: an armchair in a psychologist's office. Oxblood leather, walnut, cream paper, brass, banker's-lamp green. */
:root {
  --c-bg: #f2eadc;          /* page: linen wallpaper */
  --c-surface: #fcf8f0;     /* cards: case-file paper */
  --c-surface-2: #ece2d1;   /* subtle fills, hovers */
  --c-ink: #2a1d17;         /* text: walnut */
  --c-muted: #6c5849;       /* secondary text */
  --c-faint: #a08d7e;       /* hints, placeholders */
  --c-line: #dfd1bc;        /* borders */
  --c-brand: #7d2c27;       /* oxblood leather */
  --c-brand-ink: #fcf3e4;   /* text on brand */
  --c-brand-soft: #f3ddd5;  /* brand tints */
  --c-accent: #a8792f;      /* brass */
  --c-accent-soft: #f3e6cb;
  --c-lamp: #2f5b48;        /* banker's lamp green */
  --c-lamp-soft: #dde9e1;
  --c-wood: #5a3a26;        /* walnut panels */
  --c-good: #2f6b4a; --c-good-soft: #dfeee3;
  --c-warn: #9a5a00; --c-warn-soft: #f8ebcf;
  --c-bad: #b3261e;  --c-bad-soft: #f8e1dd;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60, 35, 20, .06), 0 10px 26px rgba(60, 35, 20, .08);
  --shadow-lg: 0 20px 54px rgba(50, 28, 15, .2);
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --c-on-status: #fff;     /* text on good/bad/warn fills */
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --maxw: 1160px;
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #1a1310; --c-surface: #241a15; --c-surface-2: #2f231d; --c-ink: #f2e7d7; --c-muted: #bba793; --c-faint: #7f6d60;
    --c-line: #3b2c24; --c-brand: #e0857a; --c-brand-ink: #1d0f0c; --c-brand-soft: #3d211d; --c-accent: #d9ad5c; --c-accent-soft: #34291a;
    --c-lamp: #7cc4a1; --c-lamp-soft: #1b2c24; --c-wood: #c49a72;
    --c-good: #7cc9a0; --c-good-soft: #18291f; --c-warn: #f0b85a; --c-warn-soft: #2f2412; --c-bad: #ff8c80; --c-bad-soft: #351b18; --c-on-status: #1d0f0c;
    --shadow: 0 1px 0 rgba(255, 220, 180, .03); --shadow-lg: 0 20px 54px rgba(0, 0, 0, .55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #1a1310; --c-surface: #241a15; --c-surface-2: #2f231d; --c-ink: #f2e7d7; --c-muted: #bba793; --c-faint: #7f6d60;
  --c-line: #3b2c24; --c-brand: #e0857a; --c-brand-ink: #1d0f0c; --c-brand-soft: #3d211d; --c-accent: #d9ad5c; --c-accent-soft: #34291a;
  --c-lamp: #7cc4a1; --c-lamp-soft: #1b2c24; --c-wood: #c49a72;
  --c-good: #7cc9a0; --c-good-soft: #18291f; --c-warn: #f0b85a; --c-warn-soft: #2f2412; --c-bad: #ff8c80; --c-bad-soft: #351b18; --c-on-status: #1d0f0c;
  --shadow: 0 1px 0 rgba(255, 220, 180, .03); --shadow-lg: 0 20px 54px rgba(0, 0, 0, .55); color-scheme: dark;
}

/* Design kit: motion tokens, browser surfaces, wrapping, press feedback, reduced motion (APP_MAKER/design/kit.css). */
/* design-kit:start */
:root {
  /* easing: never ease-in on UI */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* entering, exiting, most UI */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* moving across the screen */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);   /* sheets, drawers */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);      /* one authored entrance */
  /* durations: UI stays under 300ms, exits faster than entrances */
  --dur-press: 140ms; --dur-fast: 180ms; --dur-base: 220ms; --dur-slow: 320ms; --dur-hero: 640ms;
  /* 4px spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --measure: 65ch;
}

/* browser surfaces: the parts nobody draws */
::selection { background: color-mix(in srgb, var(--c-brand) 26%, transparent); color: inherit; }
html {
  accent-color: var(--c-brand); caret-color: var(--c-brand);
  scrollbar-color: color-mix(in srgb, var(--c-ink) 26%, transparent) transparent;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { text-underline-offset: .2em; text-decoration-thickness: from-font; }
h1, h2, h3, h4, [role="heading"], .anvil-role-page-title { text-wrap: balance; }
p, li, dd, blockquote, figcaption { text-wrap: pretty; }
td, th, time, output, progress, .num, .tabular, [data-num] { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-brand) 60%, transparent); outline-offset: 2px; }

/* press feedback: pressable things answer the moment they're pressed */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press) {
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease, color var(--dur-fast) ease, opacity var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press):active:not(:disabled) { transform: scale(.97); }

/* entrances: content is visible by default; these only add the arrival */
@keyframes kit-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes kit-pop { from { opacity: 0; transform: scale(.96); } }
@keyframes kit-fade { from { opacity: 0; } }
.kit-in { animation: kit-in var(--dur-slow) var(--ease-out) both; }
.kit-stagger > * { animation: kit-in var(--dur-slow) var(--ease-out) both; }
.kit-stagger > :nth-child(2) { animation-delay: 40ms; } .kit-stagger > :nth-child(3) { animation-delay: 80ms; }
.kit-stagger > :nth-child(4) { animation-delay: 120ms; } .kit-stagger > :nth-child(5) { animation-delay: 160ms; }
.kit-stagger > :nth-child(n+6) { animation-delay: 200ms; }

/* reduced motion = fewer and gentler, not none: movement goes, short fades that confirm a state stay */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kit-in, .kit-stagger > * { animation-name: kit-fade; animation-delay: 0ms !important; }
  :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press):active:not(:disabled) { transform: none; }
}
/* design-kit:end */

/* The app owns the page (not Anvil's theme). */
html, body { background: var(--c-bg) !important; color: var(--c-ink); }
body { margin: 0; font: 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.ui-modal-open { overflow: hidden; }

.ui, .ui *, .ui *::before, .ui *::after { box-sizing: border-box; }
.ui { font: 16px/1.55 var(--font-body); color: var(--c-ink); }
.ui h1, .ui h2, .ui h3, .ui h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; font-weight: 700; color: var(--c-ink); }
.ui h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.ui h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
.ui h3 { font-size: 1.2rem; }
.ui h4 { font-size: 1rem; }
.ui p { margin: 0 0 .8em; }
.ui :is(p, ul, ol, blockquote, figure) + :is(h2, h3) { margin-top: 1.4em; }  /* more space above a heading than below it */
.ui a { color: var(--c-brand); text-underline-offset: 3px; }
.ui [hidden] { display: none !important; }
.ui img { max-width: 100%; }
.ui .muted { color: var(--c-muted); }
.ui .faint { color: var(--c-faint); }
.ui .small { font-size: .875rem; }
.ui-ic, .ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* layout */
.ui-wrap { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 72px; }
.ui-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.ui-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ui-row.end { justify-content: flex-end; }
.ui-row.between { justify-content: space-between; }
.ui-row.top { align-items: flex-start; }
.ui-spacer { flex: 1; }
.ui-stack > * + * { margin-top: 14px; }
.ui-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ui-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ui-page-head h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.ui-page-head p { margin: 6px 0 0; }

/* cards */
.ui-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.ui-card.flat { box-shadow: none; }
.ui-card.tight { padding: 14px 16px; }
.ui-card > :last-child { margin-bottom: 0; }

/* buttons */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { font: 600 .95rem/1.2 var(--font-body); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; min-height: 44px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; }  /* transitions + press scale: design kit */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):hover { border-color: var(--c-ink); }
:is(.ui-btn.primary, .anvil-role-btn.anvil-role-btn-primary > button, a.anvil-role-btn.anvil-role-btn-primary) { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-brand-ink); }
:is(.ui-btn.primary, .anvil-role-btn.anvil-role-btn-primary > button, a.anvil-role-btn.anvil-role-btn-primary):hover { opacity: .92; }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost) { background: transparent; border-color: transparent; color: var(--c-muted); }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost):hover { background: var(--c-surface-2); color: var(--c-ink); }
:is(.ui-btn.danger, .anvil-role-btn.anvil-role-btn-danger > button, a.anvil-role-btn.anvil-role-btn-danger) { color: var(--c-bad); }
:is(.ui-btn.danger, .anvil-role-btn.anvil-role-btn-danger > button, a.anvil-role-btn.anvil-role-btn-danger):hover { border-color: var(--c-bad); }
:is(.ui-btn.danger.solid, .anvil-role-btn.anvil-role-btn-danger.anvil-role-btn-solid > button, a.anvil-role-btn.anvil-role-btn-danger.anvil-role-btn-solid) { background: var(--c-bad); border-color: var(--c-bad); color: var(--c-on-status); }
:is(.ui-btn.sm, .anvil-role-btn.anvil-role-btn-sm > button, a.anvil-role-btn.anvil-role-btn-sm) { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
:is(.ui-btn.lg, .anvil-role-btn.anvil-role-btn-lg > button, a.anvil-role-btn.anvil-role-btn-lg) { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }
:is(.ui-btn.icon, .anvil-role-btn.anvil-role-btn-icon > button, a.anvil-role-btn.anvil-role-btn-icon) { width: 40px; min-height: 40px; padding: 0; }
:is(.ui-btn.block, .anvil-role-btn.anvil-role-btn-block > button, a.anvil-role-btn.anvil-role-btn-block) { width: 100%; }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):disabled { opacity: .5; cursor: not-allowed; transform: none; }
:is(.ui-btn.is-busy, .anvil-role-btn.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-is-busy) { position: relative; color: transparent !important; }
:is(.ui-btn.is-busy, .anvil-role-btn.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-is-busy)::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--c-muted) transparent var(--c-muted) transparent; animation: ui-spin .8s linear infinite; }
:is(.ui-btn.primary.is-busy, .anvil-role-btn.anvil-role-btn-primary.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-primary.anvil-role-btn-is-busy)::after { border-color: var(--c-brand-ink) transparent var(--c-brand-ink) transparent; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
.ui :focus-visible { outline: 3px solid color-mix(in srgb, var(--c-brand) 55%, transparent); outline-offset: 2px; }

/* forms */
.ui-field { display: block; }
.ui-field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.ui-field > span em { font-style: normal; font-weight: 400; color: var(--c-muted); }
.ui input[type=text], .ui input[type=email], .ui input[type=password], .ui input[type=search], .ui input[type=number], .ui input[type=url],
.ui input[type=tel], .ui input[type=date], .ui input[type=time], .ui input[type=datetime-local], .ui select, .ui textarea {
  font: inherit; font-size: 1rem; color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: 11px 13px; width: 100%; min-height: 46px; margin: 0; box-shadow: none; transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease; }
.ui textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
/* tick boxes and radios keep the focus ring above; typed-in fields swap it for the border + glow */
.ui input:not([type=checkbox]):not([type=radio]):focus, .ui select:focus, .ui textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.ui ::placeholder { color: var(--c-faint); }
.ui-hint { font-size: .85rem; color: var(--c-muted); margin: 6px 0 0; }
.ui-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.ui-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--c-brand); flex: none; }
.ui-error { background: var(--c-bad-soft); color: var(--c-bad); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.ui-note { background: var(--c-brand-soft); color: var(--c-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.ui-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ui-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ui-choice span { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; background: var(--c-surface); }
.ui-choice input:checked + span { border-color: var(--c-brand); background: var(--c-brand-soft); }
.ui-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--c-brand) 55%, transparent); }

/* small pieces */
.ui-badge { display: inline-flex; align-items: center; gap: 5px; font: 600 .75rem/1.3 var(--font-body); padding: 4px 10px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
.ui-badge.brand { background: var(--c-brand-soft); color: var(--c-brand); }
.ui-badge.good { background: var(--c-good-soft); color: var(--c-good); }
.ui-badge.warn { background: var(--c-warn-soft); color: var(--c-warn); }
.ui-badge.bad { background: var(--c-bad-soft); color: var(--c-bad); }
.ui-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--c-surface-2); border-radius: 999px; border: 1px solid var(--c-line); }
.ui-seg button { font: 500 .85rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.ui-seg button.on { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow); }
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.ui-tabs a, .ui-tabs button { font: 600 .92rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 12px 14px; border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; margin-bottom: -1px; }
.ui-tabs .on { color: var(--c-ink); border-bottom-color: var(--c-brand); }
.ui-tabs .count { font-size: .75rem; background: var(--c-surface-2); border-radius: 999px; padding: 2px 7px; }
.ui-empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--c-line); border-radius: var(--radius); color: var(--c-muted); }
.ui-empty :is(.ui-ic, .ic) { width: 34px; height: 34px; color: var(--c-faint); margin-bottom: 8px; }
.ui-empty :is(h2, h3) { color: var(--c-ink); font-size: 1.15rem; margin-top: 0; }
.ui-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--c-brand-soft); color: var(--c-brand); font: 700 .85rem/1 var(--font-body); }
.ui-list { display: grid; gap: 10px; }
.ui-item { display: flex; gap: 14px; align-items: flex-start; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 18px; }
.ui-item .grow { flex: 1; min-width: 0; }
.ui-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.ui-item p { margin: 0; overflow-wrap: anywhere; }
.ui-skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--c-surface-2), var(--c-surface), var(--c-surface-2)); background-size: 200% 100%;
  animation: ui-skel 1.4s linear infinite; min-height: 80px; }
@keyframes ui-skel { to { background-position: -200% 0; } }
.ui-stat { display: block; }
.ui-stat b { display: block; font: 800 2rem/1.1 var(--font-display); }
.ui-stat span { color: var(--c-muted); font-size: .9rem; }

/* header */
.ui-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--c-bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--c-line); }
.ui-header-in { max-width: var(--maxw); margin: 0 auto; height: var(--header-h); padding: 0 24px; display: flex; align-items: center; gap: 22px; }
.ui-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-ink) !important; font: 800 1.15rem/1 var(--font-display); letter-spacing: -.01em; }
.ui-brand img { width: 32px; height: 32px; border-radius: 9px; }
.ui-nav { display: flex; gap: 2px; }
.ui-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px; color: var(--c-muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
.ui-nav a:hover { color: var(--c-ink); background: var(--c-surface-2); }
.ui-nav a.on { color: var(--c-ink); background: var(--c-surface-2); }
.ui-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.ui-avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c-brand); color: var(--c-brand-ink); font: 700 .85rem/1 var(--font-body); }
.ui-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 280px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; transform-origin: top right; animation: ui-pop var(--dur-fast) var(--ease-out); }
.ui-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--c-line); margin-bottom: 6px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.ui-menu > a, .ui-menu > button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  font: 500 .95rem/1.2 var(--font-body); color: var(--c-ink); text-decoration: none; cursor: pointer; text-align: left; }
.ui-menu > a:hover, .ui-menu > button:hover { background: var(--c-surface-2); }
.ui-menu-block { padding: 8px 12px 10px; display: grid; gap: 8px; }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* main + footer */
.ui-shell { min-height: 100vh; display: flex; flex-direction: column; }
.ui-main { flex: 1; }
.ui-shell.no-chrome .ui-header, .ui-shell.no-chrome .ui-footer, .ui-shell.no-chrome .ui-tabbar { display: none; }
.ui-footer { border-top: 1px solid var(--c-line); background: var(--c-surface); }
.ui-footer-in { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 40px; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: start; }
.ui-footer-brand p { margin: 8px 0 0; }
.ui-footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: flex-end; }
.ui-footer-links a, .ui-footer-links button { font: 500 .92rem/1.4 var(--font-body); color: var(--c-muted); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: none; }  /* 24px+ touch height */
.ui-footer-links a:hover, .ui-footer-links button:hover { color: var(--c-ink); }
.ui-footer-legal { grid-column: 1 / -1; margin: 0; }

/* phone tab bar (shown on small screens when signed in) */
.ui-tabbar { display: none; }
.ui-tabbar:empty { display: none !important; }

/* toasts + modals */
.ui-toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.ui-toast { display: flex; gap: 10px; align-items: center; background: var(--c-ink); color: var(--c-bg); padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-lg);
  font-weight: 500; animation: ui-pop var(--dur-base) var(--ease-out); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.ui-toast.error { background: var(--c-bad); color: var(--c-on-status); }
.ui-toast.ok { background: var(--c-good); color: var(--c-on-status); }
.ui-toast.out { opacity: 0; transform: translateY(8px); }
.ui-modal-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(10, 12, 20, .5); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: ui-fade var(--dur-fast) ease; }
.ui-modal { position: relative; width: min(100%, 520px); background: var(--c-surface); border-radius: calc(var(--radius) + 4px); padding: 28px; box-shadow: var(--shadow-lg); animation: kit-pop var(--dur-base) var(--ease-out); outline: none; }
.ui-modal.wide { width: min(100%, 760px); }
.ui-modal h2 { padding-right: 40px; }
.ui-modal-x { position: absolute; top: 14px; right: 14px; }
@keyframes ui-fade { from { opacity: 0; } }

@media (max-width: 720px) {
  .ui-wrap { padding: 22px 16px 56px; }
  .ui-header-in { padding: 0 16px; gap: 12px; }
  .ui-nav { display: none; }
  .ui-brand span { font-size: 1.05rem; }
  .ui-header-right :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { padding: 9px 13px; min-height: 40px; font-size: .9rem; }
  .ui-shell.signed-in .ui-tabbar { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; background: var(--c-surface); border-top: 1px solid var(--c-line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .ui-tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--c-muted); text-decoration: none; font: 600 .75rem/1 var(--font-body); }
  .ui-tabbar a :is(.ui-ic, .ic) { width: 22px; height: 22px; }
  .ui-tabbar a.on { color: var(--c-brand); }
  .ui-shell.signed-in:has(.ui-tabbar:not(:empty)) .ui-footer { padding-bottom: 72px; }
  .ui-footer-in { grid-template-columns: 1fr; }
  .ui-footer-links { justify-content: flex-start; }
  .ui-grid.two { grid-template-columns: 1fr; }
  .ui-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 6px); width: auto; }
  .ui-modal { padding: 24px 18px; }
}
@media (max-width: 380px) {
  .ui-header-right :is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost) { display: none; }
}
@media (prefers-reduced-motion: reduce) {  /* drop movement, keep the fades (design/README.md 6) */
  .ui-menu, .ui-toast, .ui-modal { animation-name: kit-fade; }
  .ui-toast.out { transform: none; }
  .ui-skel { animation: none; }
}


/* ===== auth ===== */
.au-wrap { min-height: calc(100vh - var(--header-h) - 160px); display: grid; place-items: center; padding: 40px 16px 64px; }
.au-card { width: min(100%, 440px); padding: 30px; }
.au-card h1 { font-size: 1.8rem; margin-bottom: 4px; }
.au-card .ui-seg { width: 100%; margin: 18px 0 20px; }
.au-card .ui-seg button { flex: 1; padding: 10px; }
.au-pw { position: relative; }
.au-pw input { padding-right: 70px; }
.au-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: .9rem; flex-wrap: wrap; }
.au-links a { cursor: pointer; }
.au-card .lk-consent, .au-card [class*="consent"] { font-size: .9rem; }
.au-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--c-muted); font-size: .85rem; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.au-google svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 480px) { .au-card { padding: 24px 18px; } }

/* ===== home ===== */
.hm-add { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 10px; align-items: start; margin-bottom: 22px; }
.hm-add textarea { min-height: 46px; height: 46px; }
@media (max-width: 720px) { .hm-add { grid-template-columns: 1fr; } .hm-add textarea { height: 90px; } }

/* ===== profile ===== */
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pf-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.pf-head .ui-avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.pf-head h1 { margin: 0; font-size: 1.8rem; }
.pf-links { display: grid; gap: 4px; }
.pf-links button, .pf-links a { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  font: 500 .97rem/1.2 var(--font-body); color: var(--c-ink); cursor: pointer; text-decoration: none; text-align: left; width: 100%; }
.pf-links button:hover, .pf-links a:hover { background: var(--c-surface-2); }
@media (max-width: 720px) { .pf-grid { grid-template-columns: 1fr; } }

/* ===== admin ===== */
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.ad-fb { display: grid; gap: 10px; }
.ad-fb .ui-item { display: block; }
.ad-fb .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--c-muted); margin-bottom: 8px; }
.ad-fb .msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.ad-fb .ctx { font-size: .8rem; color: var(--c-faint); overflow-wrap: anywhere; margin-bottom: 10px; }
.ad-fb textarea { min-height: 60px; font-size: .92rem; }
.ad-users { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ad-users th, .ad-users td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.ad-users th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.ad-users td.email { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .ad-users thead { display: none; }
  .ad-users tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
  .ad-users td { border: 0; padding: 0; }
  .ad-users td.joined { display: none; }
}


/* =====================================================================================================
   Brain Mechanic: the office (shared pieces from the old _bm layer, then each page)
   ===================================================================================================== */
/* ---------------------------------------------------------------- the office */
body { background-color: var(--c-bg) !important;
  background-image: repeating-linear-gradient(90deg, transparent 0 46px, color-mix(in srgb, var(--c-accent) 7%, transparent) 46px 48px, transparent 48px 96px) !important; }
.ui h1, .ui h2, .ui h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; font-variation-settings: "opsz" 72; }
.ui h4 { font-family: var(--font-body); font-weight: 700; }
.ui .mono { font-family: var(--font-mono); }
.ui a { color: var(--c-brand); }
.ui-card { border-radius: var(--radius); }

/* leather buttons with brass stitching */
:is(.ui-btn.primary, .anvil-role-btn-primary > button) { background: linear-gradient(180deg, color-mix(in srgb, var(--c-brand) 88%, #fff) 0%, var(--c-brand) 60%, color-mix(in srgb, var(--c-brand) 85%, #000) 100%);
  border-color: color-mix(in srgb, var(--c-brand) 80%, #000); position: relative; box-shadow: 0 2px 0 color-mix(in srgb, var(--c-brand) 60%, #000), 0 6px 16px color-mix(in srgb, var(--c-brand) 25%, transparent); }
:is(.ui-btn.primary, .anvil-role-btn-primary > button)::after { content: ""; position: absolute; inset: 4px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--c-accent) 70%, transparent); pointer-events: none; }
.ui-btn.primary.is-busy::after { inset: auto; border: 2px solid; border-color: var(--c-brand-ink) transparent var(--c-brand-ink) transparent; border-radius: 50%; }
:is(.ui-btn.brass, .anvil-role-btn-brass > button) { background: var(--c-accent-soft); border-color: color-mix(in srgb, var(--c-accent) 45%, transparent); color: var(--c-ink); }
:is(.ui-btn.brass, .anvil-role-btn-brass > button):hover { border-color: var(--c-accent); }

/* header: the blur lives on ::before, so the phone menu isn't trapped inside it */
.ui-header { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; }
.ui-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--c-bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px); border-bottom: 1px solid var(--c-line); }
.ui-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; }
.ui-brand img { border-radius: 9px; }
.ui-brand b { color: var(--c-brand); font-weight: 700; }
.ui-nav a.on { color: var(--c-brand); background: var(--c-brand-soft); }
.ui-avatar-btn { background: var(--c-brand); }
.ui-tabbar a.more { background: none; border: 0; cursor: pointer; }

/* the disclaimer plaque under the header, on every page */
.bm-plaque { border-top: 1px solid var(--c-line); background: linear-gradient(180deg, var(--c-accent-soft), color-mix(in srgb, var(--c-accent-soft) 70%, var(--c-bg))); }
.bm-plaque-in { max-width: var(--maxw); margin: 0 auto; padding: 5px 24px; display: flex; align-items: center; gap: 12px; font-size: .84rem; color: var(--c-muted); }
.bm-plaque-in b { color: var(--c-ink); font-weight: 600; }
.bm-plaque-in .sp { flex: 1; }
.bm-brake { font: 700 .8rem/1 var(--font-body); color: #fff; background: var(--c-bad); border: 0; border-radius: 999px; padding: 6px 12px 6px 8px;
  display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-bad) 20%, transparent); }
.bm-brake .ic { width: 16px; height: 16px; }
.bm-brake:hover { filter: brightness(1.08); }
.bm-plaque .short { display: none; }
@media (max-width: 720px) {
  .bm-plaque-in { padding: 5px 16px; }
  .bm-plaque .long { display: none; }
  .bm-plaque .short { display: inline; }
}

/* the phone "More" sheet + guest tab bar (the manual is public) */
@media (max-width: 720px) {
  .ui-shell .ui-tabbar { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; background: var(--c-surface); border-top: 1px solid var(--c-line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .ui-shell:has(.ui-tabbar:not(:empty)) .ui-footer { padding-bottom: 72px; }
  .ui-tabbar a.on { color: var(--c-brand); }
}
.bm-sheet { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 70; background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; animation: ui-pop var(--dur-fast) var(--ease-out) ease-out; max-height: 70vh; overflow-y: auto; }
.bm-sheet a, .bm-sheet button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 0; background: none;
  font: 500 1rem/1.2 var(--font-body); color: var(--c-ink) !important; text-decoration: none; cursor: pointer; text-align: left; }
.bm-sheet a:hover, .bm-sheet button:hover { background: var(--c-surface-2); }
.bm-sheet .ui-seg { margin: 6px 14px 10px; }
@media (max-width: 1060px) and (min-width: 721px) { .ui-nav a span { display: none; } .ui-nav a { padding: 9px 11px; } }

/* footer */
.ui-footer { background: var(--c-surface); border-top: 3px double var(--c-line); }
.bm-fine { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--c-muted); max-width: 70em; }

/* ---------------------------------------------------------------- shared pieces */
:is(.bm-code, .anvil-role-bm-code) { font: 700 .72rem/1 var(--font-mono); letter-spacing: .04em; color: var(--c-accent); background: var(--c-accent-soft); border: 1px solid color-mix(in srgb, var(--c-accent) 30%, transparent);
  padding: 4px 7px; border-radius: 6px; white-space: nowrap; }
:is(.bm-st, .anvil-role-bm-st) { font: 600 .72rem/1.2 var(--font-body); padding: 3px 9px; border-radius: 999px; background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
:is(.bm-st.dx, .anvil-role-bm-st.anvil-role-dx), :is(.bm-st.dsm, .anvil-role-bm-st.anvil-role-dsm), :is(.bm-st.icd, .anvil-role-bm-st.anvil-role-icd) { background: var(--c-lamp-soft); color: var(--c-lamp); }
:is(.bm-st.urgent, .anvil-role-bm-st.anvil-role-urgent) { background: var(--c-bad-soft); color: var(--c-bad); }
:is(.bm-st.occ, .anvil-role-bm-st.anvil-role-occ), :is(.bm-st.spec, .anvil-role-bm-st.anvil-role-spec) { background: var(--c-accent-soft); color: var(--c-warn); }
.bm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 -2px; }
.bm-chip { font: 600 .86rem/1 var(--font-body); padding: 9px 13px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-muted);
  cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.bm-chip .ic { width: 16px; height: 16px; }
.bm-chip.on { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-brand-ink); }
.bm-chip:hover:not(.on) { border-color: var(--c-ink); color: var(--c-ink); }

/* case-file cards */
:is(.bm-cards, .anvil-role-bm-cards > div) { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bm-card { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 4px var(--radius) var(--radius) var(--radius);
  padding: 18px 18px 16px; text-decoration: none; color: inherit !important; box-shadow: var(--shadow); transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); min-width: 0; }
.bm-card::before { content: ""; position: absolute; left: -1px; top: -9px; width: 72px; height: 10px; background: var(--c-surface); border: 1px solid var(--c-line); border-bottom: 0; border-radius: 6px 10px 0 0; }
@media (hover: hover) and (pointer: fine) { .bm-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c-brand) 40%, var(--c-line)); } }
.bm-card h3 { margin: 0; font-size: 1.12rem; }
.bm-card p { margin: 0; color: var(--c-muted); font-size: .95rem; }
.bm-card .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bm-card .sysic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--c-brand-soft); color: var(--c-brand); flex: none; }
.bm-card .sysic .ic { width: 18px; height: 18px; }
.bm-card .foot { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--c-faint); }
.bm-card.pattern .sysic { background: var(--c-accent-soft); color: var(--c-accent); }
.bm-card.tool .sysic { background: var(--c-lamp-soft); color: var(--c-lamp); }
.bm-card.scan .sysic { background: var(--c-surface-2); color: var(--c-ink); }

/* article layout (manual entry, pattern, tool) */
.bm-art { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.bm-art-head { margin-bottom: 18px; }
.bm-art-head h1 { margin: 10px 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.bm-art-head .line { font: italic 500 1.2rem/1.45 var(--font-display); color: var(--c-muted); margin: 0; }
.bm-sec { margin: 0 0 22px; }
.bm-sec h2 { font-size: 1.25rem; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.bm-sec h2 .ic { color: var(--c-accent); width: 20px; height: 20px; }
.bm-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bm-list li { position: relative; padding-left: 26px; }
.bm-list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.bm-list.warn li::before { background: var(--c-warn); box-shadow: 0 0 0 3px var(--c-warn-soft); }
.bm-list.good li::before { background: var(--c-lamp); box-shadow: 0 0 0 3px var(--c-lamp-soft); }
.bm-list.bad li::before { background: var(--c-bad); box-shadow: 0 0 0 3px var(--c-bad-soft); }
ol.bm-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
ol.bm-steps li { counter-increment: st; position: relative; padding-left: 40px; min-height: 28px; }
ol.bm-steps li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--c-brand); color: var(--c-brand-ink);
  display: grid; place-items: center; font: 700 .85rem/1 var(--font-mono); }
.bm-myth { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.bm-myth > div { padding: 14px 16px; }
.bm-myth .m { background: var(--c-surface-2); }
.bm-myth .t { background: var(--c-surface); }
.bm-myth b { display: block; font: 700 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; color: var(--c-muted); }
.bm-myth .t b { color: var(--c-lamp); }
.bm-myth .m p { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c-bad) 60%, transparent); }
.bm-myth p { margin: 0; }
.bm-side { position: sticky; top: calc(var(--header-h) + 50px); display: grid; gap: 14px; }
.bm-stat { font-size: .92rem; }
.bm-stat b { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); display: block; margin-bottom: 6px; }
.bm-src { font-size: .82rem; color: var(--c-faint); }
.bm-see { background: var(--c-bad-soft); border: 1px solid color-mix(in srgb, var(--c-bad) 25%, transparent); border-radius: var(--radius); padding: 16px 18px; }
.bm-see h3 { color: var(--c-bad); font-size: 1.05rem; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bm-see ul { margin: 0; padding-left: 20px; }
.bm-back { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; color: var(--c-muted) !important; margin-bottom: 8px; }
.bm-back:hover { color: var(--c-ink) !important; }
:is(.bm-links, .anvil-role-bm-links > div) { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) { .bm-art { grid-template-columns: minmax(0, 1fr); } .bm-side { position: static; } }
@media (max-width: 560px) { .bm-myth { grid-template-columns: 1fr; } }

/* note card: "nobody here is a doctor" */
.bm-note { display: flex; gap: 12px; align-items: flex-start; background: var(--c-accent-soft); border: 1px dashed color-mix(in srgb, var(--c-accent) 55%, transparent); border-radius: var(--radius); padding: 13px 16px; font-size: .92rem; }
.bm-note .ic { color: var(--c-accent); flex: none; margin-top: 2px; }
.bm-note p { margin: 0; }

/* crisis panel */
.bm-crisis h2 { display: flex; gap: 10px; align-items: center; }
.bm-crisis h2 .ic { color: var(--c-bad); width: 26px; height: 26px; }
.bm-lines { display: grid; gap: 8px; margin: 14px 0; }
.bm-line { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--c-surface-2); font-size: .94rem; }
.bm-line b { font-size: .8rem; color: var(--c-muted); font-weight: 700; }
.bm-line a { font-weight: 700; }
.bm-urgent { background: var(--c-bad); color: #fff; border-radius: 12px; padding: 12px 14px; font-weight: 600; }

/* gauges */
.bm-gauge { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.bm-gauge svg { width: 100%; max-width: 170px; height: auto; overflow: visible; }
.bm-gauge .lbl { font: 700 .75rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.bm-gauge .val { font: 700 1.2rem/1 var(--font-mono); color: var(--c-ink); }

/* dashboard warning lamps */
.bm-lamp { display: flex; gap: 10px; align-items: center; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-surface);
  cursor: pointer; font: 500 .92rem/1.3 var(--font-body); color: var(--c-ink); width: 100%; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.bm-lamp i { flex: none; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--c-faint) 40%, var(--c-surface-2)); border: 2px solid var(--c-line); transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.bm-lamp:hover { border-color: color-mix(in srgb, var(--c-accent) 60%, var(--c-line)); }
.bm-lamp.on { background: var(--c-accent-soft); border-color: var(--c-accent); }
.bm-lamp.on i { background: radial-gradient(circle at 35% 35%, #ffe7a3, #f2a72e 55%, #c46f0a); border-color: #f2a72e; box-shadow: 0 0 10px 2px rgba(242, 167, 46, .6); }
.bm-lamp.crisis.on { background: var(--c-bad-soft); border-color: var(--c-bad); }
.bm-lamp.crisis.on i { background: radial-gradient(circle at 35% 35%, #ffc2b8, #e0473a 55%, #a01d12); border-color: #e0473a; box-shadow: 0 0 10px 2px rgba(224, 71, 58, .6); }

/* meter bar */
.bm-meter { height: 10px; border-radius: 99px; background: var(--c-surface-2); overflow: hidden; }
.bm-meter > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c-lamp), var(--c-accent) 60%, var(--c-bad)); background-size: 300px 100%; }
:is(.bm-level, .anvil-role-bm-level) { font: 700 .72rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
:is(.bm-level.l0, .anvil-role-bm-level.anvil-role-l0) { background: var(--c-lamp-soft); color: var(--c-lamp); }
:is(.bm-level.l1, .anvil-role-bm-level.anvil-role-l1) { background: var(--c-accent-soft); color: var(--c-warn); }
:is(.bm-level.l2, .anvil-role-bm-level.anvil-role-l2) { background: color-mix(in srgb, var(--c-bad-soft) 60%, var(--c-accent-soft)); color: var(--c-warn); }
:is(.bm-level.l3, .anvil-role-bm-level.anvil-role-l3) { background: var(--c-bad-soft); color: var(--c-bad); }

/* search */
.bm-search { position: relative; }
.bm-search input[type=search] { padding-left: 46px; min-height: 54px; font-size: 1.05rem; border-radius: 999px; box-shadow: var(--shadow); }
.bm-search > .ic { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--c-muted); pointer-events: none; }

/* ===== landing ===== */
.page-landing .ui-main { overflow-x: clip; }
.lp-hero { position: relative; padding: 46px 0 30px; }
.lp-hero .ui-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding-top: 0; padding-bottom: 0; }
.lp-hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.02; margin-bottom: 16px; }
.lp-hero h1 em { font-style: italic; color: var(--c-brand); }
.lp-lead { font-size: 1.18rem; color: var(--c-muted); max-width: 33em; margin-bottom: 22px; }
.lp-ask { margin-bottom: 14px; }
.lp-ask form { display: flex; gap: 8px; }
.lp-ask .bm-search { flex: 1; min-width: 0; }
.lp-try { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .88rem; color: var(--c-muted); margin-bottom: 22px; }
.lp-try button { font: 500 .86rem/1 var(--font-body); border: 1px dashed color-mix(in srgb, var(--c-accent) 60%, transparent); background: none; color: var(--c-ink); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lp-try button:hover { background: var(--c-accent-soft); }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-proof { margin-top: 18px; display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--c-muted); font-size: .9rem; }
.lp-proof span { display: inline-flex; gap: 6px; align-items: center; }
.lp-proof .ic { color: var(--c-lamp); }

/* the office */
.lp-office { --wall: #e9dcc4; --stripe: #e1d1b4; --panel: #6b4430; --panel-d: #573525; --rug: #8b3a31; --rug-b: #c9973f; --leather: #7d2c27; --leather-d: #5b1e1a;
  --leather-h: #a2463d; --brass: #c9973f; --glow: rgba(255, 214, 140, .55); --shade: #2f5b48; --paper: #fbf3e1; --ink: #3b2a1f; --dash: #241915;
  position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--c-line); aspect-ratio: 56 / 48; background: var(--wall); }
.ui-dark .lp-office { --wall: #2b201a; --stripe: #33261f; --panel: #3d281d; --panel-d: #2f1f17; --rug: #5a231e; --rug-b: #9c7230; --leather: #8a322b; --leather-d: #5e1f1a;
  --leather-h: #b0534a; --glow: rgba(255, 200, 110, .38); --paper: #efe2c6; }
.lp-office svg { display: block; width: 100%; height: 100%; }
.lp-office .lamp-l { animation: lp-flick 6s ease-in-out infinite; transform-origin: 50% 50%; }
.lp-office .hl { cursor: pointer; }
.lp-office .hl circle.on { animation: lp-blink 2.4s ease-in-out infinite; }
.lp-office .hl:nth-of-type(2) circle.on { animation-delay: .5s; } .lp-office .hl:nth-of-type(3) circle.on { animation-delay: 1.1s; }
.lp-office .hl:nth-of-type(4) circle.on { animation-delay: 1.6s; } .lp-office .hl:nth-of-type(5) circle.on { animation-delay: .8s; }
.lp-office .needle { transform-box: fill-box; transform-origin: 0% 50%; animation: lp-needle 5s ease-in-out infinite; }
@keyframes lp-blink { 0%, 100% { opacity: .35; } 45%, 60% { opacity: 1; } }
@keyframes lp-flick { 0%, 100% { opacity: 1; } 50% { opacity: .85; } }
@keyframes lp-needle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(14deg); } }
.lp-tag { position: absolute; left: 14px; bottom: 14px; background: color-mix(in srgb, var(--c-surface) 92%, transparent); border: 1px solid var(--c-line); border-radius: 12px;
  padding: 7px 11px; font-size: .78rem; color: var(--c-muted); max-width: 52%; box-shadow: var(--shadow); }
.lp-tag b { color: var(--c-ink); }

/* sections */
.lp-section { padding: 50px 0; }
.lp-section .ui-wrap { padding-top: 0; padding-bottom: 0; }
.lp-head { text-align: center; max-width: 660px; margin: 0 auto 30px; }
.lp-head p { color: var(--c-muted); font-size: 1.08rem; }
:is(.lp-steps, .anvil-role-lp-steps > div) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lp-step { position: relative; padding-top: 62px; }
.lp-step .n { position: absolute; top: 18px; left: 20px; font: 700 .78rem/1 var(--font-mono); color: var(--c-accent); letter-spacing: .1em; }
.lp-step .ic { position: absolute; top: 14px; right: 18px; width: 28px; height: 28px; color: var(--c-brand); }
.lp-step h3 { margin-bottom: 6px; }
.lp-step p { color: var(--c-muted); margin: 0; font-size: .95rem; }
:is(.lp-systems, .anvil-role-lp-systems > div) { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.lp-sys { display: grid; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-line); text-decoration: none; color: inherit !important; transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .lp-sys:hover { transform: translateY(-2px); border-color: var(--c-brand); } }
.lp-sys .ic { width: 26px; height: 26px; color: var(--c-brand); }
.lp-sys b { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.lp-sys span { font-size: .84rem; color: var(--c-muted); }
.lp-sys em { font: 700 .75rem/1 var(--font-mono); color: var(--c-accent); font-style: normal; }
.lp-factory { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 30px; align-items: center; background: var(--c-wood); color: #f6ead6; border-radius: 26px; padding: 38px; }
.ui-dark .lp-factory { background: #2a1c15; border: 1px solid var(--c-line); }
.lp-factory h2 { color: #f6ead6; }
.lp-factory p { color: #e4d3b8; }
.lp-factory .bm-card { color: var(--c-ink) !important; }
.lp-factory .bm-card p { color: var(--c-muted); }
.lp-factory :is(.bm-cards, .anvil-role-bm-cards > div) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-pit { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 30px; align-items: center; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 26px; padding: 44px 38px 38px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.lp-pit::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(90deg, var(--c-ink) 0 14px, var(--c-surface) 14px 28px); opacity: .8; }
.lp-pit :is(.bm-cards, .anvil-role-bm-cards > div) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
:is(.lp-fine, .anvil-role-lp-fine > div) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
:is(.lp-fine, .anvil-role-lp-fine > div) .ui-card h3 { display: flex; gap: 8px; align-items: center; }
:is(.lp-fine, .anvil-role-lp-fine > div) .ui-card h3 .ic { color: var(--c-accent); }
:is(.lp-faq, .anvil-role-lp-faq > div) { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
:is(.lp-faq, .anvil-role-lp-faq > div) details { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 4px 20px; }
:is(.lp-faq, .anvil-role-lp-faq > div) summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
:is(.lp-faq, .anvil-role-lp-faq > div) summary::-webkit-details-marker { display: none; }
:is(.lp-faq, .anvil-role-lp-faq > div) summary::after { content: "+"; color: var(--c-brand); font-size: 1.3rem; line-height: 1; }
:is(.lp-faq, .anvil-role-lp-faq > div) details[open] summary::after { content: "–"; }
:is(.lp-faq, .anvil-role-lp-faq > div) details p { color: var(--c-muted); margin: 0 0 16px; }
.lp-band { background: var(--c-brand); color: var(--c-brand-ink); border-radius: 26px; padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; }
.lp-band::after { content: ""; position: absolute; inset: 8px; border: 1.5px dashed color-mix(in srgb, var(--c-accent) 70%, transparent); border-radius: 20px; pointer-events: none; }
.lp-band h2 { color: var(--c-brand-ink); margin: 0 0 6px; }
.lp-band p { margin: 0; opacity: .85; }
.lp-band .ui-btn { position: relative; z-index: 1; }
@media (max-width: 980px) {
  .lp-hero .ui-wrap { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .lp-office { max-width: 620px; width: 100%; margin: 0 auto; }
  :is(.lp-steps, .anvil-role-lp-steps > div) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.lp-systems, .anvil-role-lp-systems > div) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-factory { grid-template-columns: minmax(0, 1fr); padding: 26px 20px; }
  .lp-pit { grid-template-columns: minmax(0, 1fr); padding: 36px 20px 24px; }
  :is(.lp-fine, .anvil-role-lp-fine > div) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .lp-hero { padding-top: 26px; }
  :is(.lp-steps, .anvil-role-lp-steps > div), .lp-factory :is(.bm-cards, .anvil-role-bm-cards > div) { grid-template-columns: minmax(0, 1fr); }
  .lp-band { padding: 28px 22px; }
  .lp-section { padding: 36px 0; }
  .lp-ask form { flex-direction: column; }
  .lp-tag { display: none; }
}
/* design-ok: reduced-motion-kill (decorative loops only) */
@media (prefers-reduced-motion: reduce) { .lp-office * { animation: none !important; } }
/* Watch section: the app's YouTube video. Click to play; nothing loads from YouTube before the click. */
.ytf .ytf-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: center; max-width: 1040px; margin: 0 auto; }
.ytf .ytf-copy h2 { margin: 6px 0 10px; }
.ytf .ytf-copy p { color: var(--c-muted); margin: 0 0 16px; }
.ytf .ytf-link { font-weight: 700; }
.ytf .ytf-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius, 16px); overflow: hidden; background: #000; border: 1px solid var(--c-line); box-shadow: var(--shadow-lg); }
.ytf .ytf-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytf .ytf-cover { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font: inherit; cursor: pointer; display: block; }
.ytf .ytf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow) var(--ease-out), filter var(--dur-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ytf .ytf-cover:hover img { transform: scale(1.02); filter: brightness(.92); } }
.ytf .ytf-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); line-height: 0; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ytf .ytf-cover:hover .ytf-play, .ytf .ytf-cover:focus-visible .ytf-play { transform: translate(-50%, -50%) scale(1.08); } }
.ytf .ytf-cover:focus-visible { outline: 3px solid var(--c-brand); outline-offset: -3px; }
.ytf .ytf-len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.3; padding: 3px 7px; border-radius: 5px; }
.ytf .ytf-note { font-size: .8rem; color: var(--c-muted); margin: 10px 2px 0; }
@media (max-width: 800px) { .ytf .ytf-in { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
@media (max-width: 480px) { .ytf .ytf-play svg { width: 56px; height: 40px; } }

/* ===== manual ===== */
.mn-top { display: grid; gap: 14px; margin-bottom: 22px; }
.mn-top h1 { margin: 0; }
.mn-results { display: grid; gap: 26px; }
.mn-group h2 { font-size: 1.15rem; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.mn-group h2 .count { font: 700 .72rem/1 var(--font-mono); color: var(--c-muted); background: var(--c-surface-2); padding: 4px 8px; border-radius: 6px; }
.mn-sys { margin-bottom: 34px; }
.mn-sys-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--c-line); }
.mn-sys-head .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--c-brand); color: var(--c-brand-ink); display: grid; place-items: center; flex: none; }
.mn-sys-head .ic .ic { width: 22px; height: 22px; }
.mn-sys-head h2 { margin: 0; font-size: 1.3rem; }
.mn-sys-head p { margin: 0; color: var(--c-muted); font-size: .92rem; }
.mn-sys-head :is(.bm-code, .anvil-role-bm-code) { margin-left: auto; }
.mn-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--c-muted); align-items: center; }
.mn-none { padding: 30px 20px; }
.mn-entry-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mn-where { font: 600 .84rem/1 var(--font-body); color: var(--c-muted); display: inline-flex; gap: 6px; align-items: center; }
.mn-where .ic { width: 16px; height: 16px; }
.mn-mix a { text-decoration: none; }
.mn-lights { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-lights span { display: inline-flex; gap: 7px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--c-surface-2); font-size: .86rem; }
.mn-bay { display: flex; gap: 14px; align-items: center; margin: -4px 0 22px; padding: 14px 18px; border-radius: var(--radius); background: var(--c-wood); color: #f6ead6 !important; text-decoration: none; }
.ui-dark .mn-bay { background: #2a1c15; border: 1px solid var(--c-line); }
.mn-bay > .ic { flex: none; width: 26px; height: 26px; color: #e7c27a; }
.mn-bay span { flex: 1; font-size: .92rem; color: #e4d3b8; }
.mn-bay b { display: block; font: 600 1.08rem/1.3 var(--font-display); color: #f6ead6; }
.mn-bay:hover { filter: brightness(1.08); }
.mn-lights span i { width: 9px; height: 9px; border-radius: 50%; background: #f2a72e; box-shadow: 0 0 6px rgba(242, 167, 46, .7); }

/* ===== diagnose ===== */
.dg-tabs { margin-bottom: 18px; }
.dg-board { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.dg-sys { margin-bottom: 18px; }
.dg-sys h3 { font-size: 1rem; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dg-sys h3 .ic { color: var(--c-brand); }
:is(.dg-lamps, .anvil-role-dg-lamps > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.dg-out { position: sticky; top: calc(var(--header-h) + 46px); display: grid; gap: 12px; max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; padding-bottom: 6px; }
.dg-panel { background: var(--dash, #241915); color: #f2e7d7; border-radius: 22px; padding: 18px; border: 2px solid var(--c-accent); }
.dg-panel h2 { color: #f2e7d7; font-size: 1.15rem; margin-bottom: 4px; }
.dg-panel p { color: #bba793; font-size: .9rem; margin: 0; }
.dg-panel :is(.cnt, .anvil-role-cnt) { font: 700 2.2rem/1 var(--font-mono); color: #f2a72e; }
.dg-match { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); text-decoration: none; color: inherit !important; }
.dg-match:hover { border-color: var(--c-brand); }
.dg-match .row { display: flex; gap: 8px; align-items: center; }
.dg-match b { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.dg-match .hits { font-size: .8rem; color: var(--c-muted); }
.dg-match .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dg-bar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 44; display: none; }
.dg-bar .ui-btn { width: 100%; box-shadow: var(--shadow-lg); }
.dg-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dg-groups h2 { font-size: 1.2rem; margin: 26px 0 6px; }
.dg-groups > p { color: var(--c-muted); margin: 0 0 14px; }
:is(.dg-recent, .anvil-role-dg-recent > div) { display: grid; gap: 8px; }
.dg-rec { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); flex-wrap: wrap; }
.dg-rec .grow { flex: 1; min-width: 160px; }
.dg-rec b { display: block; }
@media (max-width: 980px) {
  .dg-board { grid-template-columns: minmax(0, 1fr); }
  .dg-out { position: static; max-height: none; overflow: visible; }
  .dg-bar.show { display: block; }
}
@media (min-width: 721px) { .dg-bar { bottom: 16px; left: auto; right: 16px; width: 320px; } }

/* ===== scan ===== */
.sc-wrap { max-width: 820px; }
.sc-head h1 { margin: 8px 0 6px; }
.sc-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sc-fuel { position: sticky; top: calc(var(--header-h) + 38px); z-index: 5; background: color-mix(in srgb, var(--c-bg) 92%, transparent); padding: 10px 0; margin: 10px 0 6px; }
.sc-fuel .row { display: flex; justify-content: space-between; font: 700 .72rem/1 var(--font-mono); letter-spacing: .1em; color: var(--c-muted); margin-bottom: 6px; }
.sc-intro { font: italic 500 1.15rem/1.45 var(--font-display); margin: 6px 0 16px; }
.sc-q { border: 1px solid var(--c-line); background: var(--c-surface); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 10px; transition: border-color var(--dur-fast) var(--ease-out); }
.sc-q.done { border-color: color-mix(in srgb, var(--c-lamp) 40%, var(--c-line)); }
.sc-q.miss { border-color: var(--c-bad); }
.sc-q legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 1.02rem; }
.sc-q legend .n { font: 700 .75rem/1 var(--font-mono); color: var(--c-accent); margin-right: 8px; }
.sc-opts { clear: both; display: flex; flex-wrap: wrap; gap: 6px; }
.sc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sc-opt span { display: inline-block; padding: 9px 13px; border: 1px solid var(--c-line); border-radius: 999px; cursor: pointer; font-size: .92rem; background: var(--c-bg); }
.sc-opt input:checked + span { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-brand-ink); }
.sc-opt.shade span { background: color-mix(in srgb, var(--c-accent) 16%, var(--c-bg)); border-color: color-mix(in srgb, var(--c-accent) 40%, var(--c-line)); }
.sc-shade-note { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; }
.sc-swatch { flex: none; width: 22px; height: 14px; border-radius: 99px; background: color-mix(in srgb, var(--c-accent) 16%, var(--c-bg)); border: 1px solid color-mix(in srgb, var(--c-accent) 40%, var(--c-line)); }
.sc-bay { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 18px 20px; border-radius: var(--radius); background: var(--c-wood); color: #f6ead6; }
.ui-dark .sc-bay { background: #2a1c15; border: 1px solid var(--c-line); }
.sc-bay h3 { color: #f6ead6; margin: 0 0 4px; font-size: 1.15rem; }
.sc-bay p { margin: 0; color: #e4d3b8; font-size: .93rem; max-width: 36em; }
.sc-opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--c-brand) 50%, transparent); }
.sc-ack { margin: 16px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--c-accent-soft); }
.sc-src { font-size: .82rem; color: var(--c-faint); margin-top: 18px; }
/* result */
.sc-res { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; padding: 24px; border-radius: 24px; background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--shadow); }
.sc-res .bm-gauge svg { max-width: 220px; }
.sc-res h2 { margin: 8px 0 8px; font-size: clamp(1.5rem, 3vw, 2rem); }
.sc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sc-block { margin-top: 26px; }
.sc-block h2 { font-size: 1.2rem; margin-bottom: 12px; }
.sc-quad { position: relative; width: 100%; max-width: 360px; aspect-ratio: 1; border: 1px solid var(--c-line); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.sc-quad > div { display: flex; padding: 12px !important; font: 600 .82rem/1.2 var(--font-body); color: var(--c-muted); text-align: center; padding: 8px; }
.sc-quad > div:nth-child(1) { background: var(--c-accent-soft); align-items: flex-start; } .sc-quad > div:nth-child(2) { background: var(--c-bad-soft); align-items: flex-start; justify-content: flex-end; }
.sc-quad > div:nth-child(3) { background: var(--c-lamp-soft); align-items: flex-end; } .sc-quad > div:nth-child(4) { background: var(--c-surface-2); align-items: flex-end; justify-content: flex-end; }
.sc-quad .dot { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--c-brand); border: 3px solid var(--c-surface); box-shadow: 0 0 0 3px var(--c-brand); transform: translate(-50%, 50%); }
.sc-axis { font: 700 .75rem/1 var(--font-mono); color: var(--c-muted); letter-spacing: .08em; }
.sc-flag { margin-top: 18px; }
.sc-sub { display: grid; gap: 10px; max-width: 420px; }
.sc-sub .row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: .9rem; }
@media (max-width: 640px) { .sc-res { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } .sc-res .sc-acts { justify-content: center; } }

/* ===== factory ===== */
.fs-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; align-items: center; margin-bottom: 26px; }
.fs-hero .ui-card { background: var(--c-wood); color: #f6ead6; border: 0; }
.ui-dark .fs-hero .ui-card { background: #2a1c15; border: 1px solid var(--c-line); }
.fs-hero .ui-card h3 { color: #f6ead6; }
.fs-hero .ui-card p { color: #e4d3b8; }
.fs-grp { margin-bottom: 30px; }
.fs-grp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--c-line); }
.fs-grp-head h2 { margin: 0; font-size: 1.35rem; }
.fs-grp-head p { margin: 0; color: var(--c-muted); }
.fs-voice { font: italic 600 clamp(1.3rem, 3vw, 1.75rem)/1.35 var(--font-display); color: var(--c-brand); padding: 18px 22px; border: 1px solid color-mix(in srgb, var(--c-accent) 35%, var(--c-line)); background: color-mix(in srgb, var(--c-accent-soft) 45%, var(--c-surface)); border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 22px; }
.fs-voice small { display: block; font: 700 .75rem/1 var(--font-mono); letter-spacing: .12em; color: var(--c-muted); font-style: normal; margin-bottom: 8px; }
.fs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .fs-hero, .fs-two { grid-template-columns: minmax(0, 1fr); } }

/* ===== toolbox ===== */
:is(.tb-now, .anvil-role-tb-now > div) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
:is(.tb-now, .anvil-role-tb-now > div) a { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 14px; background: var(--c-bad-soft); border: 1px solid color-mix(in srgb, var(--c-bad) 25%, transparent);
  text-decoration: none; color: var(--c-ink) !important; font-weight: 600; }
:is(.tb-now, .anvil-role-tb-now > div) a .ic { color: var(--c-bad); flex: none; }
.tb-cat { margin-bottom: 28px; }
.tb-cat-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--c-line); }
.tb-cat-head h2 { margin: 0; font-size: 1.3rem; }
.tb-cat-head p { margin: 0; color: var(--c-muted); }
.tb-widget { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 22px; padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow); }
/* breathing */
.tb-breath { display: grid; justify-items: center; gap: 14px; padding: 10px 0; }
.tb-orb { width: 220px; height: 220px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.tb-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--c-accent) 60%, transparent); }
.tb-orb .ball { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--c-lamp) 50%, #fff), var(--c-lamp));
  box-shadow: 0 0 40px color-mix(in srgb, var(--c-lamp) 50%, transparent); transform: scale(1); transition-property: transform; transition-timing-function: ease-in-out; }
.tb-orb .txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 600 1.05rem/1.25 var(--font-display); color: var(--c-ink); padding: 40px; pointer-events: none; }
.tb-orb .txt b { display: block; font: 700 1.6rem/1 var(--font-mono); margin-top: 6px; }
.tb-breath-pick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
/* timer */
.tb-timer { display: grid; justify-items: center; gap: 14px; }
.tb-ring { width: 200px; height: 200px; }
.tb-ring text { font-family: var(--font-mono); }
/* grounding */
.tb-ground .step { display: none; }
.tb-ground .step.on { display: block; }
.tb-ground h3 { font-size: 1.5rem; }
.tb-ground .big { font: 700 3rem/1 var(--font-mono); color: var(--c-accent); }
.tb-ground .inputs { display: grid; gap: 8px; margin: 12px 0; }
/* worksheet */
.tb-sheet { display: grid; gap: 14px; }
.tb-sheet input[type=range] { width: 100%; accent-color: var(--c-brand); }
.tb-range { display: flex; gap: 12px; align-items: center; }
.tb-range output { font: 700 1rem/1 var(--font-mono); min-width: 3ch; text-align: right; }
@media (max-width: 760px) { :is(.tb-now, .anvil-role-tb-now > div) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== adhd ===== */
.pl-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 28px; align-items: center; background: var(--c-wood); color: #f6ead6; border-radius: 26px; padding: 34px; margin-bottom: 18px; position: relative; overflow: hidden; }
.ui-dark .pl-hero { background: #2a1c15; border: 1px solid var(--c-line); }
.pl-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(90deg, #f6ead6 0 14px, #2a1c15 14px 28px); opacity: .55; }
.pl-hero h1 { color: #f6ead6; margin: 8px 0 10px; font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.pl-hero p { color: #e4d3b8; margin: 0 0 8px; max-width: 38em; }
.pl-hero cite { display: block; font: italic 500 .92rem/1.4 var(--font-display); color: #d9c39d; margin-bottom: 16px; }
.pl-hero .ui-row { gap: 10px; }
.pl-board { background: #141110; border: 6px solid #3a2b22; border-radius: 14px; padding: 16px 18px; font: 700 1.3rem/1.5 var(--font-mono); color: #ffd36b; letter-spacing: .08em; box-shadow: inset 0 0 0 2px #000, 0 10px 30px rgba(0, 0, 0, .35); transform: rotate(-2deg); }
.pl-board div { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.pl-board .g { color: #7fe0a0; } .pl-board .w { color: #f6ead6; } .pl-board .r { color: #ff7b6b; }
.pl-jump { position: sticky; top: calc(var(--header-h) + 34px); z-index: 6; background: color-mix(in srgb, var(--c-bg) 92%, transparent); padding: 8px 0 2px; margin-bottom: 18px; }
.pl-sec { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 100px); }
.pl-sec > h2 { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pl-sec > h2 .ic { color: var(--c-accent); width: 24px; height: 24px; }
.pl-sec > p.lead { color: var(--c-muted); max-width: 46em; margin: 0 0 14px; }
:is(.pl-relief, .anvil-role-pl-relief > div) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
:is(.pl-relief, .anvil-role-pl-relief > div) a { display: flex; gap: 12px; align-items: center; padding: 15px 16px; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink) !important; font-weight: 600; box-shadow: var(--shadow); transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { :is(.pl-relief, .anvil-role-pl-relief > div) a:hover { transform: translateY(-2px); border-color: var(--c-brand); } }
:is(.pl-relief, .anvil-role-pl-relief > div) a .ic { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--c-brand-soft); color: var(--c-brand); }
:is(.pl-relief, .anvil-role-pl-relief > div) a small { display: block; font-weight: 400; color: var(--c-muted); font-size: .82rem; margin-top: 2px; }
.pl-parked { margin-top: 10px; }
:is(.pl-two, .anvil-role-pl-two > div) { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pl-crit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; margin-top: 14px; }
.pl-pres { display: grid; gap: 8px; }
.pl-pres div { padding: 12px 14px; border-radius: 12px; background: var(--c-surface-2); font-size: .93rem; }
.pl-pres b { display: block; margin-bottom: 2px; }
.pl-last { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--c-muted); }
:is(.pl-engine, .anvil-role-pl-engine > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
:is(.pl-engine, .anvil-role-pl-engine > div) .ui-card h3 { font-size: 1.08rem; margin: 8px 0 6px; }
:is(.pl-engine, .anvil-role-pl-engine > div) .ui-card p { margin: 0; color: var(--c-muted); font-size: .93rem; }
.pl-myths { display: grid; gap: 10px; }
.pl-ev { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.pl-ev th, .pl-ev td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.pl-ev th { font: 700 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); background: var(--c-surface-2); }
.pl-ev td:first-child { font-weight: 700; min-width: 150px; }
.pl-ev td:first-child small { display: block; font-weight: 400; color: var(--c-muted); margin-top: 4px; }
.pl-ev :is(.bm-st, .anvil-role-bm-st) { display: inline-block; }
:is(.pl-facts, .anvil-role-pl-facts > div) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
:is(.pl-sys, .anvil-role-pl-sys > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
:is(.pl-sys, .anvil-role-pl-sys > div) .ui-card { display: grid; gap: 10px; align-content: start; }
:is(.pl-sys, .anvil-role-pl-sys > div) h3 { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 1.12rem; }
:is(.pl-sys, .anvil-role-pl-sys > div) h3 .ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--c-lamp-soft); color: var(--c-lamp); flex: none; }
:is(.pl-sys, .anvil-role-pl-sys > div) .line { margin: 0; color: var(--c-muted); font-style: italic; }
:is(.pl-sys, .anvil-role-pl-sys > div) .bm-list { font-size: .93rem; }
:is(.pl-countries, .anvil-role-pl-countries > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 14px; }
:is(.pl-orgs, .anvil-role-pl-orgs > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink) !important; }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a:hover { border-color: var(--c-brand); }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a b { display: flex; gap: 6px; align-items: center; }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a b .ic { width: 14px; height: 14px; color: var(--c-muted); }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a em { font: 700 .75rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-accent); font-style: normal; }
:is(.pl-orgs, .anvil-role-pl-orgs > div) a span { font-size: .88rem; color: var(--c-muted); }
@media (max-width: 900px) {
  .pl-hero { grid-template-columns: minmax(0, 1fr); padding: 26px 20px 30px; }
  .pl-board { transform: none; font-size: 1.05rem; }
  :is(.pl-relief, .anvil-role-pl-relief > div) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.pl-two, .anvil-role-pl-two > div), .pl-crit, :is(.pl-facts, .anvil-role-pl-facts > div) { grid-template-columns: minmax(0, 1fr); }
  .pl-ev thead { display: none; }
  .pl-ev tr { display: grid; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
  .pl-ev td { border: 0; padding: 0; }
}
@media (max-width: 460px) { :is(.pl-relief, .anvil-role-pl-relief > div) { grid-template-columns: minmax(0, 1fr); } :is(.pl-relief, .anvil-role-pl-relief > div) a { padding: 12px 14px; } }

/* ===== help ===== */
.hp-crisis { background: var(--c-surface); border: 2px solid var(--c-bad); border-radius: 22px; padding: 22px; margin-bottom: 30px; }
.hp-sec { margin-bottom: 34px; }
.hp-sec > h2 { display: flex; gap: 10px; align-items: center; }
.hp-sec > h2 .ic { color: var(--c-accent); width: 24px; height: 24px; }
.hp-sec > p { color: var(--c-muted); max-width: 46em; }
:is(.hp-who, .anvil-role-hp-who > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
:is(.hp-who, .anvil-role-hp-who > div) .ui-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
:is(.hp-who, .anvil-role-hp-who > div) .ui-card .tag { font: 700 .75rem/1 var(--font-mono); letter-spacing: .08em; color: var(--c-accent); }
:is(.hp-who, .anvil-role-hp-who > div) .ui-card p { margin: 6px 0 0; font-size: .93rem; color: var(--c-muted); }
.hp-table { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.hp-table th, .hp-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.hp-table th { font: 700 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); background: var(--c-surface-2); }
.hp-table td:first-child { font-weight: 700; white-space: nowrap; }
:is(.hp-country, .anvil-role-hp-country > div) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.hp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) {
  .hp-two { grid-template-columns: minmax(0, 1fr); }
  .hp-table thead { display: none; }
  .hp-table tr { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
  .hp-table td { border: 0; padding: 0; white-space: normal !important; }
}

/* ===== workorder ===== */
.wo-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.wo-edit .ui-card { margin-bottom: 14px; }
.wo-edit h2 { font-size: 1.1rem; margin-bottom: 10px; }
:is(.wo-pick, .anvil-role-wo-pick > div) { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.wo-sheet { background: #fffdf7; color: #2a1d17; border-radius: 6px; padding: 30px 32px; box-shadow: var(--shadow-lg); border: 1px solid #e3d6c1; font-size: .95rem; position: sticky; top: calc(var(--header-h) + 46px); }
.wo-sheet h1 { color: #2a1d17; font-size: 1.6rem; margin: 0; }
.wo-sheet h3 { color: #7d2c27; font: 700 .74rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; margin: 18px 0 8px; border-bottom: 1px solid #e3d6c1; padding-bottom: 6px; }
.wo-sheet table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.wo-sheet td, .wo-sheet th { text-align: left; padding: 5px 4px; border-bottom: 1px dotted #e3d6c1; vertical-align: top; }
.wo-sheet th { font-weight: 600; color: #6c5849; font-size: .78rem; }
.wo-sheet .stamp { display: inline-block; border: 2px solid #b3261e; color: #b3261e; font: 700 .75rem/1 var(--font-mono); padding: 6px 8px; border-radius: 4px; transform: rotate(-3deg); letter-spacing: .08em; }
.wo-sheet .fine { font-size: .76rem; color: #6c5849; margin-top: 18px; }
.wo-sheet p { margin: 0 0 6px; white-space: pre-wrap; }
.wo-sheet .empty { color: #a08d7e; font-style: italic; }
@media (max-width: 900px) { .wo-grid { grid-template-columns: minmax(0, 1fr); } .wo-sheet { position: static; padding: 22px 18px; } }
@media print {
  .ui-header, .ui-footer, .ui-tabbar, .wo-edit, .wo-head, .bm-plaque, .ui-toasts { display: none !important; }
  body { background: #fff !important; }
  .wo-grid { display: block; }
  .wo-sheet { box-shadow: none; border: 0; position: static; padding: 0; }
  .ui-wrap { padding: 0 !important; max-width: none; }
}

/* ===== garage ===== */
.gr-cluster { background: #241915; border-radius: 28px; padding: 22px; border: 3px solid var(--c-accent); box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), var(--shadow-lg); color: #f2e7d7; margin-bottom: 22px; }
.gr-cluster { --c-surface-2: #120c0a; --c-line: #4a3427; --c-ink: #f2e7d7; --c-muted: #bba793; --c-wood: #6b4430; }
.gr-gauges { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.gr-lamps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid #4a3427; align-items: center; }
.gr-lamp { display: inline-flex; gap: 8px; align-items: center; font: 600 .78rem/1.2 var(--font-mono); padding: 7px 10px; border-radius: 999px; background: #120c0a; color: #f2e7d7 !important; text-decoration: none; border: 1px solid #4a3427; }
.gr-lamp i { width: 11px; height: 11px; border-radius: 50%; background: #3a2b22; }
.gr-lamp.l2 i { background: #f2a72e; box-shadow: 0 0 8px #f2a72e; }
.gr-lamp.l3 i { background: #e0473a; box-shadow: 0 0 8px #e0473a; }
.gr-lamp.ok i { background: #7cc4a1; box-shadow: 0 0 8px #7cc4a1; }
.gr-cluster .cap { font: 700 .72rem/1 var(--font-mono); letter-spacing: .12em; color: #bba793; }
.gr-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
.gr-card h2 { font-size: 1.2rem; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.gr-card h2 .ic { color: var(--c-accent); }
.gr-sliders { display: grid; gap: 12px; }
.gr-slider { display: grid; grid-template-columns: 76px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.gr-slider span { font: 700 .74rem/1 var(--font-mono); letter-spacing: .08em; color: var(--c-muted); text-transform: uppercase; }
.gr-slider input { width: 100%; accent-color: var(--c-brand); }
.gr-slider output { font: 700 .95rem/1 var(--font-mono); text-align: right; }
.gr-chart [data-chart] svg { width: 100%; height: auto; display: block; }
.gr-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--c-muted); margin-top: 6px; }
.gr-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
:is(.gr-list, .anvil-role-gr-list > div) { display: grid; gap: 8px; }
.gr-row { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-bg); flex-wrap: wrap; }
.gr-row .grow { flex: 1; min-width: 150px; }
.gr-row b { display: block; font-weight: 600; }
.gr-row a { text-decoration: none; }
.gr-row select { width: auto; min-height: 36px; padding: 6px 10px; font-size: .88rem; }
.gr-row textarea { min-height: 60px; font-size: .9rem; width: 100%; }
.gr-sample { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--c-accent-soft); border: 1px dashed var(--c-accent); margin-bottom: 16px; }
.gr-j details { border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-bg); padding: 4px 14px; }
.gr-j summary { cursor: pointer; padding: 10px 0; font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.gr-j dl { margin: 0 0 12px; display: grid; gap: 8px; }
.gr-j dt { font: 700 .72rem/1.2 var(--font-mono); letter-spacing: .06em; color: var(--c-muted); text-transform: uppercase; }
.gr-j dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .gr-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .gr-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gr-cluster { padding: 16px 12px; } }

/* ===== bmw_adhd ===== */
.aw { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.aw > *, .aw-step > * { min-width: 0; }
.aw h3 { margin: 0; font-size: 1.2rem; }
.aw .hint { margin: 0; color: var(--c-muted); font-size: .92rem; }
.aw-steps { display: flex; gap: 6px; }
.aw-steps i { flex: 1; height: 6px; border-radius: 99px; background: var(--c-surface-2); }
.aw-steps i.on { background: var(--c-accent); }
.aw-step { display: none; gap: 14px; }
.aw-step.on { display: grid; grid-template-columns: minmax(0, 1fr); }
.aw-ball-wrap { display: grid; place-items: center; height: 190px; }
.aw-ball { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--c-lamp) 45%, #fff), var(--c-lamp));
  box-shadow: 0 0 34px color-mix(in srgb, var(--c-lamp) 45%, transparent); transition-property: transform; transition-timing-function: ease-in-out; }
.aw-say { text-align: center; font: 600 1.05rem/1.3 var(--font-display); min-height: 1.4em; margin: 0; }
.aw textarea { min-height: 160px; }
.aw-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-pick button { white-space: normal; text-align: left; line-height: 1.3; }
.aw-big { padding: 16px 18px; border-radius: var(--radius); background: var(--c-accent-soft); border: 1px dashed color-mix(in srgb, var(--c-accent) 55%, transparent); }
.aw-big b { display: block; font: 700 .75rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); margin-bottom: 6px; }
.aw-big p { margin: 0; font: 600 1.15rem/1.35 var(--font-display); overflow-wrap: anywhere; }
.aw-parked { margin: 0; padding-left: 20px; color: var(--c-muted); font-size: .93rem; overflow-wrap: anywhere; }
/* the shrinking disc */
.aw-disc { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; }
.aw-disc > * { max-width: 100%; }
.aw-disc > svg { width: min(240px, 70vw); height: auto; }
.aw-disc text { font-family: var(--font-mono); }
.aw-mins { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.aw-sep { border: 0; border-top: 1px dashed var(--c-line); margin: 6px 0; }
.aw-train { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 8px; align-items: end; }
.aw-watch { font: 700 2rem/1 var(--font-mono); text-align: center; color: var(--c-ink); }
.aw-log { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.aw-log li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 9px 12px; border-radius: 10px; background: var(--c-surface-2); font-size: .9rem; min-width: 0; }
.aw-log li span { overflow-wrap: anywhere; min-width: 0; }
.aw-log li b { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; }
.aw-mult { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--c-lamp-soft); }
.aw-mult strong { font: 700 1.8rem/1 var(--font-mono); color: var(--c-lamp); }
.aw-mult p { margin: 0; font-size: .93rem; }
/* menu */
.aw-course { border: 1px solid var(--c-line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; background: var(--c-bg); }
.aw-course h4 { margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.aw-course h4 span { font: 400 .86rem/1.3 var(--font-body); color: var(--c-muted); }
.aw-mine { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.aw-mine .bm-chip { background: var(--c-lamp-soft); border-color: color-mix(in srgb, var(--c-lamp) 40%, transparent); color: var(--c-ink); }
.aw-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-ideas .bm-chip { font-size: .8rem; padding: 7px 10px; }
.aw-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.aw-order { text-align: center; padding: 16px; border-radius: var(--radius); background: var(--c-accent-soft); font: 600 1.2rem/1.3 var(--font-display); }
/* door card */
.aw-door { display: grid; gap: 8px; }
.aw-door label { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-surface); cursor: pointer; font-weight: 600; }
.aw-door label input { width: 22px; height: 22px; accent-color: var(--c-lamp); flex: none; }
.aw-door label.ticked { background: var(--c-lamp-soft); border-color: var(--c-lamp); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c-lamp) 60%, transparent); }
.aw-door label .x { margin-left: auto; }
.aw-ready { text-align: center; padding: 14px; border-radius: var(--radius); background: var(--c-lamp); color: #fff; font: 700 1.15rem/1.2 var(--font-display); }
@media (max-width: 560px) { .aw-train { grid-template-columns: minmax(0, 1fr) 90px; } .aw-train .ui-btn { grid-column: 1 / -1; } }

/* =====================================================================================================
   Brain Mechanic, Forms version: the same office look for Anvil components (Labels, item Forms, panels)
   ===================================================================================================== */
/* Labels: text inherits the look of the role around it; status pieces sit inline */
.anvil-label > .anvil-label-text { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.anvil-label > i:empty, .anvil-component-icon:empty { display: none; }
.ui .anvil-label { margin: 0; }
.anvil-label:is(.anvil-role-bm-code, .anvil-role-bm-st, .anvil-role-bm-level, .anvil-role-count, .anvil-role-cnt) { display: inline-block; }
.anvil-label.anvil-role-inline, .anvil-label.anvil-role-li-b, .anvil-label.anvil-role-li-t, .anvil-label.anvil-role-note-lead,
.anvil-label.anvil-role-note-body, .anvil-label.anvil-role-chip-text, .anvil-label.anvil-role-lamp-text { display: inline; }
.anvil-role-li-b, .anvil-role-note-lead { font-weight: 700; }
.anvil-role-strong { font-weight: 700; }
.anvil-role-lead-muted { color: var(--c-muted); margin: 6px 0 0; }
.anvil-role-sec-p { margin: 0 0 .8em; }
.anvil-role-count { font: 700 .72rem/1 var(--font-mono); color: var(--c-muted); background: var(--c-surface-2); padding: 4px 8px; border-radius: 6px; }
.ui-tabs .anvil-role-count { font: 600 .75rem/1 var(--font-body); border-radius: 999px; padding: 3px 7px; }
.anvil-role-empty-title { font: 600 1.15rem/1.2 var(--font-display); color: var(--c-ink); margin-bottom: 6px; }

/* page titles of the reading pages */
.anvil-role-art-title { font: 600 clamp(1.8rem, 4vw, 2.6rem)/1.12 var(--font-display); letter-spacing: -.01em; margin: 10px 0 8px; color: var(--c-ink); }
.anvil-role-art-line { font: italic 500 1.2rem/1.45 var(--font-display); color: var(--c-muted); margin: 0; }
.anvil-role-art-aka { margin-top: 8px; }
.anvil-role-page-title { font-weight: 600; font-variation-settings: "opsz" 72; }
.side-h { font-size: 1.05rem; margin: 0 0 8px; }
.side-cap { display: block; font: 700 .72rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); margin-bottom: 10px; }
.card-h2 { font-size: 1.15rem; }
.page-note { margin-top: 28px; }
.ui-wrap > .bm-note, .ui-wrap > anvil-dropzone > .bm-note { margin-top: 18px; }

/* buttons: the brass one, and chips made of Anvil Buttons */
:is(.ui-btn.brass, .anvil-role-btn-brass > button):disabled { opacity: .7; }
.anvil-role-bm-chip { display: inline-block; flex: none; }
.anvil-role-bm-chip > button { font: 600 .86rem/1 var(--font-body); padding: 9px 13px; margin: 0; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface);
  color: var(--c-muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; box-shadow: none; min-height: 36px;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.anvil-role-bm-chip > button::before { width: 16px; height: 16px; }
.anvil-role-bm-chip.anvil-role-on > button { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-brand-ink); }
@media (hover: hover) and (pointer: fine) { .anvil-role-bm-chip:not(.anvil-role-on) > button:hover { border-color: var(--c-ink); color: var(--c-ink); } }
.anvil-role-bm-chips .flow-panel-gutter, .anvil-role-bm-chips > div { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; }
.anvil-role-bm-chips .flow-panel-item { margin: 0 !important; flex: none; }
.anvil-role-bm-chips { overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; }
.lp-try .bm-chip { font: 500 .86rem/1 var(--font-body); border: 1px dashed color-mix(in srgb, var(--c-accent) 60%, transparent); background: none; color: var(--c-ink); padding: 8px 11px; }
@media (hover: hover) and (pointer: fine) { .lp-try .bm-chip:hover { background: var(--c-accent-soft); } }
.lp-ask-row { display: flex; gap: 8px; }
.lp-ask-row .bm-search { flex: 1; min-width: 0; }
.lp-ask-row .anvil-role-btn > button { min-height: 54px; }
@media (max-width: 560px) { .lp-ask-row { flex-direction: column; } }
.lp-p { color: #e4d3b8; margin-bottom: 14px; }

/* the search box: a TextBox inside the label */
.bm-search input { padding-left: 46px; min-height: 54px; font-size: 1.05rem; border-radius: 999px; box-shadow: var(--shadow); }
.bm-search > .ic { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--c-muted); pointer-events: none; z-index: 1; }
.bm-search { display: block; }

/* case-file cards (Items.Card): the card is the link */
.anvil-role-bm-cards > div > *, .anvil-role-bm-cards > div > * > .bm-card { height: 100%; }
.anvil-role-card-h { font: 600 1.12rem/1.2 var(--font-display); color: var(--c-ink); font-variation-settings: "opsz" 72; }
.anvil-role-card-line { color: var(--c-muted); font-size: .95rem; }
.bm-card .anvil-role-bm-level { align-self: flex-start; }
.bm-card .foot .anvil-label { font-size: .82rem; color: var(--c-faint); }

/* titled groups of cards (Items.Group): manual systems, patterns, drawers, search results */
.bm-group { margin-bottom: 34px; }
.bm-group-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px dashed var(--c-line); }
.bm-group-head .grow { flex: 1; min-width: 0; }
.bm-group-head .gh { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bm-group-head .gic { width: 42px; height: 42px; border-radius: 12px; background: var(--c-brand); color: var(--c-brand-ink); display: grid; place-items: center; flex: none; }
.bm-group-head .gic .ic { width: 22px; height: 22px; }
.anvil-role-group-title { font: 600 1.3rem/1.2 var(--font-display); color: var(--c-ink); font-variation-settings: "opsz" 72; }
.anvil-role-group-line { color: var(--c-muted); font-size: .92rem; }
.bm-group.mn-group .bm-group-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 12px; }
.bm-group.mn-group .anvil-role-group-title { font-size: 1.15rem; }
.bm-group.dg-group .anvil-role-group-title { font-size: 1.25rem; }
.bm-more { display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; font-weight: 600; }

/* plain lists (Items.Li in a panel with role bm-list / bm-steps) */
:is(.anvil-role-bm-list, .anvil-role-bm-steps, .anvil-role-wo-list, .anvil-role-gr-dl) > div { display: grid; gap: 8px; }
.anvil-role-bm-list .bm-li { position: relative; padding-left: 26px; }
.anvil-role-bm-list .bm-li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.anvil-role-bm-list.anvil-role-warn .bm-li::before { background: var(--c-warn); box-shadow: 0 0 0 3px var(--c-warn-soft); }
.anvil-role-bm-list.anvil-role-good .bm-li::before { background: var(--c-lamp); box-shadow: 0 0 0 3px var(--c-lamp-soft); }
.anvil-role-bm-list.anvil-role-bad .bm-li::before { background: var(--c-bad); box-shadow: 0 0 0 3px var(--c-bad-soft); }
.anvil-role-bm-steps > div { gap: 10px; counter-reset: st; }
.anvil-role-bm-steps .bm-li { counter-increment: st; position: relative; padding-left: 40px; min-height: 28px; }
.anvil-role-bm-steps .bm-li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--c-brand); color: var(--c-brand-ink);
  display: grid; place-items: center; font: 700 .85rem/1 var(--font-mono); }
.anvil-role-li-b { margin-right: .3em; }
.bm-see .anvil-role-bm-list { font-size: .95rem; }
.see-more { margin: 10px 0 0; }
.urgent-box { margin-bottom: 20px; }
.urgent-box p, .bm-see > p { margin: 0 0 10px; }
.anvil-role-mn-lights > div { display: flex; flex-wrap: wrap; gap: 6px; }
.anvil-role-mn-lights .bm-li { display: inline-flex; gap: 7px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--c-surface-2); font-size: .86rem; }
.anvil-role-mn-lights .bm-li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #f2a72e; box-shadow: 0 0 6px rgba(242, 167, 46, .7); }
.myth-text { text-decoration: line-through; }
.bm-myth .m .anvil-label { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c-bad) 60%, transparent); }
.anvil-role-pl-myths > div, .anvil-role-myth-list > div { display: grid; gap: 10px; }

/* small text cards (Items.Tile) */
.tile { display: grid; gap: 6px; align-content: start; height: 100%; }
.tile-h { display: flex; gap: 8px; align-items: center; }
.tile-h .ic { color: var(--c-accent); }
.anvil-role-tile-title { font: 600 1.08rem/1.25 var(--font-display); color: var(--c-ink); }
.anvil-role-tile-text { color: var(--c-muted); font-size: .95rem; }
.anvil-role-tile-tag { font: 700 .75rem/1 var(--font-mono); letter-spacing: .1em; color: var(--c-accent); }
.tile-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.tile.bm-stat .anvil-role-tile-title { font: 700 .75rem/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); }
.tile.bm-stat .anvil-role-tile-text { color: var(--c-ink); font-size: .92rem; }
.tile.lp-step { position: relative; padding-top: 62px; }
.tile.lp-step .anvil-role-tile-tag { position: absolute; top: 18px; left: 20px; letter-spacing: .1em; font-size: .78rem; }
.tile.lp-step .tile-h .ic { position: absolute; top: 14px; right: 18px; width: 28px; height: 28px; color: var(--c-brand); }
.tile.pl-pres-card { background: var(--c-surface-2); border: 0; box-shadow: none; padding: 12px 14px; }
.anvil-role-pl-pres > div { display: grid; gap: 8px; }
.tile.pl-country .anvil-role-tile-text, .tile.hp-country-card .anvil-role-tile-text { font-size: .875rem; }

/* three-column tables that fold on phones (Items.Row3) */
:is(.anvil-role-hp-table, .anvil-role-pl-ev) { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; font-size: .93rem; }
.row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.6fr); gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--c-line); margin-bottom: -1px; }
.anvil-role-pl-ev .row3 { grid-template-columns: minmax(0, 1.1fr) 150px minmax(0, 2fr); }
.row3.head { background: var(--c-surface-2); }
.row3.head .anvil-label { font: 700 .72rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.row3 .c1 { display: grid; gap: 4px; }
.row3 .c2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
@media (max-width: 760px) {
  .row3, .anvil-role-pl-ev .row3 { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .row3.head { display: none; }
}

/* big link tiles (Items.BigLink) */
.big-link { text-decoration: none; color: var(--c-ink) !important; min-width: 0; }
.big-link .bl-text { display: grid; gap: 3px; min-width: 0; }
.anvil-role-bl-title { font-weight: 700; }
.anvil-role-bl-sub { color: var(--c-muted); font-size: .86rem; }
.anvil-role-bl-tag { font: 700 .75rem/1 var(--font-mono); letter-spacing: .08em; color: var(--c-accent); }
.big-link.lp-sys { display: grid; gap: 6px; padding: 16px; height: 100%; border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.big-link.lp-sys > .ic { width: 26px; height: 26px; color: var(--c-brand); }
.big-link.lp-sys .anvil-role-bl-title { font: 600 1.02rem/1.25 var(--font-display); }
.big-link.pl-relief-link { display: flex; gap: 12px; align-items: center; padding: 15px 16px; height: 100%; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.big-link.pl-relief-link > .ic { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--c-brand-soft); color: var(--c-brand); background-clip: content-box; }
.big-link.pl-org { display: grid; gap: 4px; padding: 14px 16px; height: 100%; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); grid-template-columns: minmax(0, 1fr) auto; }
.big-link.pl-org > .ic { order: 2; width: 14px; height: 14px; color: var(--c-muted); }
.big-link.tb-now-link { display: flex; gap: 10px; align-items: center; padding: 14px; height: 100%; border-radius: 14px; background: var(--c-bad-soft); border: 1px solid color-mix(in srgb, var(--c-bad) 25%, transparent); font-weight: 600; }
.big-link.tb-now-link > .ic { color: var(--c-bad); flex: none; }
@media (hover: hover) and (pointer: fine) {
@media (hover: hover) and (pointer: fine) { .big-link:is(.lp-sys, .pl-relief-link):hover { transform: translateY(-2px); border-color: var(--c-brand); } }
  .big-link.pl-org:hover { border-color: var(--c-brand); }
}
.tb-now-h { font-size: 1.1rem; margin-bottom: 10px; }

/* the Diagnose board */
.dg-sys-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dg-sys-h .ic { color: var(--c-brand); }
.anvil-role-dg-sys-title { font: 600 1rem/1.2 var(--font-display); color: var(--c-ink); }
.anvil-role-dg-matches > div { display: grid; gap: 12px; }
.anvil-role-dg-sub { margin: 4px 0 0; color: var(--c-muted); font-size: .9rem; }
.dg-empty { padding: 28px 16px; }
.anvil-role-dg-hits { font-size: .85rem; color: var(--c-muted); }
.dg-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.anvil-role-dg-total { align-self: center; }
.dg-wo { margin-top: 10px; }
.anvil-role-dg-p { color: var(--c-muted); margin-bottom: 10px; }

/* a check (Items.Question: radio buttons as answer tiles) */
.anvil-role-sc-list > div { display: grid; gap: 0; }
.sc-q legend { display: flex; gap: 10px; align-items: baseline; }
.anvil-role-sc-n { font: 700 .75rem/1 var(--font-mono); color: var(--c-accent); }
.anvil-role-sc-qtext { font-weight: 600; }
.anvil-role-sc-opts .flow-panel-gutter, .sc-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.anvil-role-sc-opts .flow-panel-item { margin: 0 !important; }
.anvil-role-sc-opt { margin: 0; }
.anvil-role-sc-opt label { display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 10px 14px; min-height: 44px; border: 1px solid var(--c-line); border-radius: 999px;
  background: var(--c-surface); cursor: pointer; font-weight: 500; font-size: .93rem; }
.anvil-role-sc-opt input { accent-color: var(--c-brand); margin: 0; width: 16px; height: 16px; }
.anvil-role-sc-opt label:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); }
.anvil-role-sc-opt.anvil-role-shade label { background: color-mix(in srgb, var(--c-accent-soft) 70%, var(--c-surface)); border-style: dashed; }
.anvil-role-sc-opt.anvil-role-shade label:has(input:checked) { border-style: solid; border-color: var(--c-brand); background: var(--c-brand-soft); }
.sc-ack .checkbox label, .sc-ack label { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.anvil-role-sc-hint { color: var(--c-bad); }
.anvil-role-sc-intro { color: var(--c-muted); margin: 0 0 14px; }
.anvil-role-sc-src { font-size: .82rem; color: var(--c-muted); margin-top: 18px; }
.anvil-role-sc-r-title { font: 600 1.6rem/1.15 var(--font-display); color: var(--c-ink); margin: 10px 0 8px; }
.sc-dials { gap: 24px; }

/* gauges + chart components */
.gauge-box, .gauge-box > div { display: contents; }
.gr-plot svg { width: 100%; height: auto; display: block; }
.gr-legend .k-mood { background: var(--c-lamp); } .gr-legend .k-stress { background: var(--c-bad); } .gr-legend .k-sleep { background: var(--c-accent); }
.gr-caps { margin-bottom: 12px; }
.gr-col { display: grid; gap: 14px; align-content: start; }
.anvil-role-cap { font: 700 .72rem/1 var(--font-mono); letter-spacing: .12em; color: var(--c-muted); }
.gr-slider .anvil-role-out { font: 700 .9rem/1 var(--font-mono); min-width: 3.2em; text-align: right; }
.gr-slider input[type=range] { padding: 0; min-height: 0; border: 0; box-shadow: none; background: none; accent-color: var(--c-brand); }
.gr-save { margin-top: 14px; }
.gr-import { margin-bottom: 12px; }
.gr-empty { padding: 24px; }
.anvil-role-gr-list > div { display: grid; gap: 10px; }
.gr-row .grow { display: block; }
.gr-title { margin-left: 4px; }
.gr-ctl { gap: 4px; flex-wrap: nowrap; }
.gr-ctl select { min-height: 36px; padding: 6px 10px; font-size: .88rem; width: auto; }
.gr-jd { border: 1px solid var(--c-line); border-radius: 12px; padding: 4px 14px; background: var(--c-surface); }
.gr-jd summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; list-style: none; }
.gr-jd summary::-webkit-details-marker { display: none; }
.gr-jd summary > span { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.anvil-role-gr-dl { margin: 4px 0 12px; }
.anvil-role-gr-dl .anvil-role-li-b { display: block; font-size: .82rem; color: var(--c-muted); }
.anvil-role-gr-dl .anvil-role-li-t { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.gr-lamp .anvil-label { display: inline; }

/* recent results, picks, work order sheet */
.dg-rec .grow { display: grid; gap: 2px; }
.pick { display: grid; gap: 2px; padding: 4px 0; }
.pick .anvil-role-fine-print { padding-left: 28px; }
.anvil-role-wo-pick > div, .anvil-role-wo-wants > div { display: grid; gap: 6px; }
.wo-words { display: grid; gap: 14px; }
.wo-cap { font: 700 .75rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #a8792f; }
.wo-h1 { font-size: 1.5rem; margin: 6px 0; color: #2a1d17 !important; }
.anvil-role-wo-who { font-size: .875rem; color: #6c5849; }
.wo-sheet .anvil-role-wo-empty, .wo-empty-p { color: #a08d7e; font-style: italic; }
.anvil-role-wo-list .bm-li::before { content: "• "; }
.anvil-role-wo-table { margin: 6px 0 12px; font-size: .88rem; }
.wo-row { display: grid; grid-template-columns: minmax(0, 2fr) 70px minmax(0, 1.2fr) 90px; gap: 8px; padding: 6px 0; border-bottom: 1px solid #dfd1bc; margin-bottom: -1px; }
.wo-row.head .anvil-label { font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #6c5849; }
.anvil-role-wo-note { color: #a08d7e; font-size: .75rem; }
.wo-lights { margin: 0; }

/* the account dialog, crisis dialog, plan button */
.anvil-role-ask-why { margin-bottom: 4px; font-size: 1rem; }
.crisis-dlg .bm-crisis h2 { padding-right: 36px; }
.plan-btn { display: inline-block; }
.anvil-role-fs-q { margin: 8px 0 12px; }
.fs-voice .anvil-label { display: inline; }
.fs-check { display: grid; gap: 12px; }
.anvil-role-pl-line { color: var(--c-muted); font-style: italic; }
.pl-sys-card { display: grid; gap: 10px; align-content: start; height: 100%; }
.pl-sys-card .tile-h .ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--c-lamp-soft); color: var(--c-lamp); background-clip: content-box; }
.pl-sys-card .anvil-role-bm-list { font-size: .93rem; }
.pl-hero-acts { margin-top: 14px; }
.pl-wo { margin-top: 14px; }
.pl-online { margin: 12px 0 0; }
.pl-more { margin-bottom: 18px; }
.pl-last .anvil-label { display: inline-block; }
.hp-wo { margin-top: 12px; }
.mn-popular { margin-bottom: 22px; }
.mn-legend .badge-wrap { display: inline-flex; }

/* the More sheet button in the phone tab bar */
.ui-tabbar button.more { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--c-muted); font: 600 .75rem/1 var(--font-body); background: none; border: 0; cursor: pointer; }
.ui-tabbar button.more .ic { width: 22px; height: 22px; }
.ui-tabbar button.more.on { color: var(--c-brand); }
.ui-tabbar .bm-sheet .ui-seg button { flex: 1; }
@media (min-width: 721px) { .ui-tabbar { display: none !important; } }
:is(.anvil-role-bm-list, .anvil-role-bm-steps, .anvil-role-mn-lights, .anvil-role-wo-list) > div > * { margin: 0 !important; padding: 0; }

/* =====================================================================================================
   Anvil components: the same look through roles (prop:role='["btn", "btn-primary", "ic-wand"]').
   Button = .anvil-button wrapper > button; Link = a; TextBox = input; TextArea = textarea; DropDown = wrapper > select;
   RepeatingPanel = root > items container > item forms (grid rules go on "> div").
   ===================================================================================================== */

/* Anvil buttons: the wrapper is inline, the button inside resets Anvil's own padding and margins */
.anvil-role-btn { display: inline-block; }
.anvil-role-btn > button { margin: 0; }
.anvil-role-btn-block, .anvil-role-btn-block > button { display: flex; width: 100%; }
.anvil-role-btn-icon > button > span, .anvil-role-btn-icon > button .anvil-button-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* the round account button in the header */
.anvil-role-avatar > button { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c-brand);
  color: var(--c-brand-ink); font: 700 .85rem/1 var(--font-body); padding: 0; margin: 0; }

/* text from Label components */
.anvil-role-menu-name { font-weight: 800; }
.anvil-role-menu-email { color: var(--c-muted); font-size: .875rem; }
.anvil-role-fine-print { color: var(--c-muted); font-size: .875rem; }
.anvil-label { padding: 0; margin: 0; }

/* notifications (state.toast) look like the old toasts */
.anvil-notification { background: var(--c-ink); color: var(--c-bg); border: 0; border-radius: 14px; box-shadow: var(--shadow-lg);
  font: 600 1rem/1.4 var(--font-body); }
.anvil-notification.anvil-role-ok { background: var(--c-good); color: var(--c-on-status); }
.anvil-notification.anvil-role-error { background: var(--c-bad); color: var(--c-on-status); }
.anvil-notification .anvil-notification-title { font-weight: 800; }

/* dialogs (alert / confirm with a Form inside) look like the old modals */
.anvil-modal-content { background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg); font: 16px/1.55 var(--font-body); }
.anvil-modal-header { border-bottom: 0; padding: 22px 26px 0; }
.anvil-modal-title { font: 800 1.6rem/1.1 var(--font-display); color: var(--c-ink); }
.anvil-modal-body { padding: 18px 26px 24px; }
.anvil-modal-footer { border-top: 0; padding: 0 26px 22px; }
.anvil-modal-header .anvil-close { color: var(--c-muted); opacity: 1; text-shadow: none; }
@media (max-width: 720px) { .anvil-modal-body { padding: 16px 18px 20px; } .anvil-modal-header { padding: 18px 18px 0; } }

/* ---- shared helpers for the component version */
.anvil-role-contents, .anvil-role-contents > div { display: contents; }
.anvil-role-page-title { font: 800 clamp(1.7rem, 3.4vw, 2.3rem)/1.08 var(--font-display); color: var(--c-ink); margin: 0; letter-spacing: -.005em; }
.anvil-role-sec-title { font: 800 1.6rem/1.08 var(--font-display); color: var(--c-ink); margin: 0; }
.anvil-role-card-title { font: 800 1.3rem/1.08 var(--font-display); color: var(--c-ink); margin: 4px 0 0; }
.anvil-role-faint { color: var(--c-faint); }
.anvil-role-sh-stars { color: #f0a500; letter-spacing: 1px; font-size: .95rem; }
.anvil-role-sh-stars.anvil-role-faint { color: var(--c-faint); letter-spacing: 0; }
.lp-signup { margin: 14px 0 0; }
@media (max-width: 720px) { .anvil-role-sh-shelf > div { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }
.ui-empty > .ic { width: 34px; height: 34px; color: var(--c-faint); margin-bottom: 8px; }

/* ---- reading pages, dialogs, profile, admin (component version) */
.anvil-role-bk-title { font: 800 clamp(1.6rem, 3.6vw, 2.3rem)/1.08 var(--font-display); color: var(--c-ink); margin: 2px 0 6px; }
.anvil-role-bk-intro { color: var(--c-muted); margin: 0; }
.anvil-modal-content .ui h2.dlg-h, .anvil-role-dlg-title { font: 800 1.6rem/1.1 var(--font-display); color: var(--c-ink); margin: 0 0 .5em; padding-right: 36px; }
.anvil-modal-content .ui { font: 16px/1.55 var(--font-body); }
.anvil-role-seg > button { font: 800 .85rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 8px 13px; border-radius: 999px; cursor: pointer; margin: 0; box-shadow: none; }
.anvil-role-seg.anvil-role-on > button { background: var(--c-accent); color: #2b2350; }
.anvil-role-pf-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--c-brand-soft); color: var(--c-brand);
  font: 700 1.3rem/1 var(--font-body); }
.anvil-role-pf-title { font: 800 1.8rem/1.08 var(--font-display); color: var(--c-ink); }
.pf-pw { margin-top: 22px; }
.pf-more { margin-top: 16px; }
.anvil-role-strong { font-weight: 800; }
.anvil-role-stat-num { font: 800 2rem/1.1 var(--font-display); color: var(--c-ink); }
.ad-stat { text-decoration: none; color: inherit !important; }
.ad-stat span, .ad-stat .anvil-role-fine-print { color: var(--c-muted); font-size: .9rem; }
.anvil-role-ad-demo-line { margin-top: 18px; }
.ad-filter, .ad-search { margin-bottom: 16px; }
.ad-search .anvil-role-ad-search-box { max-width: 360px; }
.ad-table { display: grid; gap: 8px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--c-line); font-size: .93rem; }
.ad-users-head, .ad-user-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 90px 90px 90px; }
.ad-lib-head, .ad-lib-row { grid-template-columns: minmax(0, 3fr) 70px 70px 70px; }
.ad-users-head b, .ad-lib-head b { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.anvil-role-ad-email { overflow-wrap: anywhere; }
.ad-fb-actions { margin-top: 10px; }
@media (max-width: 720px) {
  .ad-users-head { display: none; }
  .ad-user-row { grid-template-columns: 1fr 1fr; }
  .ad-lib-head, .ad-lib-row { grid-template-columns: minmax(0, 1fr) 50px 50px 50px; }
}
.anvil-notification.alert-success, .anvil-notification.anvil-notification-success { background: var(--c-good); color: var(--c-on-status); }
.anvil-notification.alert-danger, .anvil-notification.anvil-notification-danger { background: var(--c-bad); color: var(--c-on-status); }

/* The open-source runtime (App Server 1.18) wraps named elements and components in <anvil-dropzone> tags; hosted Anvil
   has dropped them. Make them invisible to layout so child selectors and grids behave the same on both. */
anvil-dropzone { display: contents; }
/* Notifications on the open-source runtime (1.18): Bootstrap-style alerts. Same look as .anvil-notification above. */
[data-notify="container"].anvil-alert { background: var(--c-ink); color: var(--c-bg); border: 2.5px solid var(--c-line); border-radius: 14px;
  box-shadow: var(--shadow); font: 700 1rem/1.4 var(--font-body); padding: 12px 40px 12px 16px; }
[data-notify="container"].anvil-alert-success { background: var(--c-good); color: var(--c-on-status); }
[data-notify="container"].anvil-alert-danger { background: var(--c-bad); color: var(--c-on-status); }
[data-notify="container"].anvil-alert .anvil-close, [data-notify="container"].anvil-alert [data-notify="dismiss"] { color: inherit; opacity: .8; text-shadow: none; }
/* header: the guest buttons stay on one line, the logo never shrinks */
.ui-brand img { flex: none; }
.ui-header-right .ui-row { flex-wrap: nowrap; gap: 8px; }
@media (max-width: 480px) {
  .ui-brand span { font-size: .98rem; line-height: 1.05; }
  .ui-header-right .ui-btn { padding: 8px 11px; min-height: 38px; font-size: .86rem; }
}
.pf-pw { margin-top: 22px !important; }
/* Toast colours win over the plain rule above on both runtimes (hosted: anvil-role-ok/error; App Server 1.18: alert-success/danger). */
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-ok, .anvil-alert-success) { background: var(--c-good); color: var(--c-on-status); }
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-error, .anvil-alert-danger) { background: var(--c-bad); color: var(--c-on-status); }
/* Our dialogs: Anvil's normal alert is a 300 px "small" modal; give them the old modal's width. */

/* ---- template pages (component version) */
.lp-art-card { position: relative; display: grid; gap: 12px; padding: 22px; max-width: 460px; margin: 0 auto; }
.lp-art-bar { display: flex; gap: 6px; margin-bottom: 6px; }
.lp-art-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--c-line); display: block; }
.lp-art-row { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--c-surface-2); }
.lp-art-row b { display: block; } .lp-art-row small { color: var(--c-muted); }
.anvil-role-item-list > div { display: grid; gap: 10px; }
.item-title { gap: 8px; }
.anvil-role-item-body { overflow-wrap: anywhere; margin-top: 2px; }
.anvil-role-initials { font: 700 .85rem/1 var(--font-body); color: inherit; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; }
.ui-tabbar .nav-link { display: grid; }
.ui-nav .nav-link.on, .ui-tabbar a.on { }
.anvil-role-dlg-title, .anvil-modal-content .ui h2.dlg-h { font: 700 1.5rem/1.15 var(--font-display); color: var(--c-ink); margin: 0 0 .5em; padding-right: 36px; }

.anvil-modal-content .ui-row.end { margin-top: 18px; }
.anvil-modal-content textarea { width: 100%; }
/* Our dialogs: Anvil's normal alert is a 300 px "small" modal; give them a comfortable width. */
.anvil-modal-dialog.anvil-role-app-dialog.anvil-modal-sm, .anvil-modal-dialog.anvil-role-app-dialog:not(.anvil-modal-lg) { width: min(calc(100vw - 24px), 540px); max-width: none; }
.anvil-modal-dialog.anvil-role-app-dialog.anvil-modal-lg { width: min(calc(100vw - 24px), 780px); max-width: none; }/* badges from Label components: prop:role='["badge"]' (+ "badge-brand", "badge-good", "badge-warn", "badge-bad") */
.anvil-role-badge { display: inline-flex; align-items: center; gap: 5px; font: 600 .75rem/1.3 var(--font-body); padding: 4px 10px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
.anvil-role-badge.anvil-role-badge-brand { background: var(--c-brand-soft); color: var(--c-brand); }
.anvil-role-badge.anvil-role-badge-good { background: var(--c-good-soft); color: var(--c-good); }
.anvil-role-badge.anvil-role-badge-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.anvil-role-badge.anvil-role-badge-bad { background: var(--c-bad-soft); color: var(--c-bad); }
/* auth page parts made of components */
.anvil-role-au-title { font: 700 1.8rem/1.1 var(--font-display); margin-bottom: 4px; color: var(--c-ink); }
.anvil-role-au-sub { color: var(--c-muted); margin-bottom: 4px; }
.au-pw { position: relative; display: block; }
.au-pw input { padding-right: 70px; }
.anvil-role-au-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.anvil-role-au-show > button { border: 0; background: none; color: var(--c-muted); font: 600 .8rem/1 var(--font-body); padding: 8px; cursor: pointer; margin: 0; box-shadow: none; }
.anvil-role-au-google img, .anvil-role-au-google .anvil-component-icon { width: 18px; height: 18px; flex: none; }
.anvil-role-msg-error { background: var(--c-bad-soft); color: var(--c-bad); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.anvil-role-msg-note { background: var(--c-brand-soft); color: var(--c-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }

/* Screen-reader-only text (Label role "sr", or class ui-sr): read out, not shown */
.anvil-role-sr, .ui-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Anvil's own notifications animate everything (transition: all): only fade and move (design kit) */
.anvil-notification, [data-notify="container"] { transition-property: opacity, transform !important; }
.au-card a { display: inline-block; padding: 3px 0; }  /* 24px+ touch height */
.anvil-notification .anvil-close, [data-notify="dismiss"] { min-width: 24px; min-height: 24px; }
