/* =====================================================================
   ADORABLE SCIENCE: app.css
   Cream graph paper, chunky ink outlines, sticker shadows and pastel lab colours (light), a midnight lab bench
   (dark). Fonts (anvil.yaml head_html): Fredoka (headings), Nunito (text), Space Mono (lab labels).
   1. tokens (light + dark)   2. design kit   3. base   4. shared pieces   5. pages   6. Anvil components (roles)
   Restyle by changing the tokens: both the light and the dark block. Every app class is prefixed .as-.
   Deliberate, part of the identity since the first version (design kit, APP_MAKER/design): the cream graph paper,
   the sticker shadows (neobrutalist), and emoji as the app's icons ("adorable meets science").
   design-ok: emoji-icon, cream-background
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --as-paper: #fff9f0;
  --as-grid: rgba(108, 79, 216, .07);
  --as-card: #ffffff;
  --as-ink: #2b2a4c;          /* text */
  --as-ink-soft: #4d4b70;
  --as-muted: #67658a;        /* 4.5:1+ on card and paper (was #7d7b98, 4.1:1) */
  --as-line: #2b2a4c;         /* the chunky outlines */
  --as-shadow: #2b2a4c;       /* sticker shadows */
  --as-hair: #e9e2f5;
  --as-on-ink: #ffffff;       /* text on an ink fill */
  --as-accent: #6c4fd8;       /* accent text: links, numbers, "Science" */

  --as-mint: #c4f3e5;   --as-mint-mid: #8fe3cb;  --as-mint-deep: #11785f;
  --as-lav: #e6dbff;    --as-lav-deep: #6c4fd8;
  --as-peach: #ffdccf;  --as-peach-deep: #c4472a;
  --as-butter: #fff1b8; --as-butter-deep: #b07f00;
  --as-sky: #d6ecff;    --as-sky-deep: #2a6fbd;
  --as-pink: #ffd6e8;   --as-pink-deep: #c0306f;

  --as-pop: 4px 4px 0 var(--as-shadow);
  --as-pop-sm: 2px 2px 0 var(--as-shadow);
  --as-pop-lg: 7px 7px 0 var(--as-shadow);
  --as-r: 22px;
  --as-head: "Fredoka", "Baloo 2", "Nunito", system-ui, sans-serif;
  --as-text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --as-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* the template's names, for the shared role layer and the design kit */
  --c-bg: var(--as-paper); --c-surface: var(--as-card); --c-surface-2: var(--as-paper); --c-ink: var(--as-ink);
  --c-muted: var(--as-muted); --c-faint: var(--as-muted); --c-line: var(--as-line); --c-brand: var(--as-lav-deep);
  --c-brand-ink: #ffffff; --c-brand-soft: var(--as-lav); --c-good: var(--as-mint-deep); --c-bad: var(--as-peach-deep);
  --c-on-status: #ffffff; --radius: var(--as-r); --radius-sm: 14px; --shadow: var(--as-pop-sm); --shadow-lg: var(--as-pop-lg);
  --font-body: var(--as-text); --font-display: var(--as-head);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --as-paper: #17162a; --as-grid: rgba(184, 166, 255, .06); --as-card: #232140; --as-ink: #f3f0ff; --as-ink-soft: #d6d1f0;
    --as-muted: #b3aed3; --as-line: #a8a1dc; --as-shadow: #08070f; --as-hair: #3b3860; --as-on-ink: #17162a; --as-accent: #b9a8ff;
    --as-mint: #1d4a40; --as-mint-mid: #2e6b5c; --as-lav: #362d66; --as-peach: #5b3326; --as-butter: #4d4120; --as-sky: #20405e; --as-pink: #5c2946;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --as-paper: #17162a; --as-grid: rgba(184, 166, 255, .06); --as-card: #232140; --as-ink: #f3f0ff; --as-ink-soft: #d6d1f0;
  --as-muted: #b3aed3; --as-line: #a8a1dc; --as-shadow: #08070f; --as-hair: #3b3860; --as-on-ink: #17162a; --as-accent: #b9a8ff;
  --as-mint: #1d4a40; --as-mint-mid: #2e6b5c; --as-lav: #362d66; --as-peach: #5b3326; --as-butter: #4d4120; --as-sky: #20405e; --as-pink: #5c2946;
  color-scheme: dark;
}

/* tones: a pastel + its deep partner */
.tone-sky    { --t-bg: var(--as-sky);    --t-deep: var(--as-sky-deep); }
.tone-mint   { --t-bg: var(--as-mint);   --t-deep: var(--as-mint-deep); }
.tone-peach  { --t-bg: var(--as-peach);  --t-deep: var(--as-peach-deep); }
.tone-lav    { --t-bg: var(--as-lav);    --t-deep: var(--as-lav-deep); }
.tone-butter { --t-bg: var(--as-butter); --t-deep: var(--as-butter-deep); }
.tone-pink   { --t-bg: var(--as-pink);   --t-deep: var(--as-pink-deep); }

/* ---------- 2. design kit: motion tokens, browser surfaces, wrapping, press feedback, reduced motion ---------- */
/* 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 */

/* ---------- 3. base ---------- */
/* the lab's graph paper (the app's identity; a faint grid, not a gradient) design-ok: grid-background, ai-color-palette */
html, body {
  background-color: var(--as-paper) !important;
  background-image:
    linear-gradient(var(--as-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--as-grid) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
}
body { margin: 0; color: var(--as-ink); font-family: var(--as-text); }
[hidden] { display: none !important; }

.as-app { font: 16px/1.55 var(--as-text); color: var(--as-ink); }
.as-app *, .as-app *::before, .as-app *::after { box-sizing: border-box; }
.as-shell { min-height: 100vh; display: flex; flex-direction: column; }
:where(.as-app) :is(h1, h2, h3, h4) { font-family: var(--as-head); font-weight: 600; color: var(--as-ink); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.005em; }
:where(.as-app) p { margin: 0 0 .8em; }
:where(.as-app) a { color: inherit; }
:where(.as-app) a:hover, :where(.as-app) a:focus { color: inherit; }
:where(.as-app) label { font-weight: inherit; margin: 0; max-width: none; display: block; }
:where(.as-app) button { font: inherit; }
:where(.as-app) code { font-family: var(--as-mono); font-size: .86em; background: var(--as-lav); color: var(--as-ink); padding: 1px 6px; border-radius: 6px; }
.as-app :focus-visible { outline: 3px solid var(--as-accent); outline-offset: 2px; }
.as-app :is(p, ul, ol, blockquote, figure) + :is(h2, h3) { margin-top: 1.4em; }  /* more space above a heading than below it */

.as-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--as-ink); color: var(--as-on-ink) !important; padding: 10px 16px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.as-skip:focus { top: 12px; }
.as-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 20px 80px; outline: none; }
.as-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-tight { gap: 6px; }
.as-center { justify-content: center; }
.as-end { justify-content: flex-end; }
.as-muted { color: var(--as-muted); }
.as-small { font-size: .875rem; }
.as-break { overflow-wrap: anywhere; }
.as-linkish { color: var(--as-accent) !important; font-weight: 700; text-decoration: none; }
.as-linkish:hover { text-decoration: underline; }
.as-linkbtn { background: none; border: 0; padding: 2px 0; color: var(--as-accent) !important; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.as-section { font-size: 1.6rem !important; margin: 40px 0 14px !important; display: flex; align-items: center; gap: 10px; }
.as-section i { font: 700 .8rem var(--as-mono); background: var(--as-ink); color: var(--as-on-ink); border-radius: 99px; padding: 2px 9px; font-style: normal; }

/* ---------- 4. shared pieces ---------- */
/* mascot: Bea the Beaker (fixed colours: a light sticker on either theme) */
.as-mascot-box { display: block; line-height: 0; }
.as-mascot { display: block; overflow: visible; }
.as-bub { fill: #fff; stroke: #2b2a4c; stroke-width: 3; animation: as-bubble 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.as-bub2 { animation-delay: .9s; }
.as-bub3 { animation-delay: 1.7s; }
.as-eyes { animation: as-blink 5s infinite; transform-box: fill-box; transform-origin: center; }
.as-brand-mark { width: 44px; height: 52px; flex: none; }
.as-mascot-sm { width: 76px; height: 88px; margin: -6px auto 6px; }
.as-mascot-md { width: 118px; height: 138px; margin: 0 auto 8px; }
.as-mascot-hero { width: 220px; height: 256px; margin: 0 auto; animation: as-float 5s ease-in-out infinite; }
@keyframes as-bubble { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-7px); opacity: .7; } }
@keyframes as-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes as-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes as-wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* header */
.as-header { background: var(--as-card); border-bottom: 3px solid var(--as-line); position: relative; z-index: 5; }
.as-topbar { max-width: 1180px; margin: 0 auto; padding: 12px 20px 6px; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.as-brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; min-width: 0; color: var(--as-ink) !important; }
@media (hover: hover) and (pointer: fine) { .as-brand:hover .as-brand-mark { animation: as-wobble .8s ease-in-out 2; } }
.as-brand-text { display: flex; flex-direction: column; min-width: 0; }
.as-brand-name { font: 600 1.65rem/1 var(--as-head); letter-spacing: -.01em; }
.as-brand-name b { font-weight: 600; color: var(--as-accent); margin-left: 3px; }
.as-brand-tag { font-size: .8rem; color: var(--as-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-user { display: flex; align-items: center; gap: 8px; flex: none; }
.as-me { display: flex; align-items: center; gap: 8px; text-decoration: none !important; font-weight: 800; padding: 4px 12px 4px 4px; border-radius: 99px; border: 2px solid transparent; min-height: 44px; }
.as-me:hover { border-color: var(--as-line); background: var(--as-butter); }
.as-nav { position: relative; max-width: 1180px; margin: 0 auto; padding: 4px 20px 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.as-nav::-webkit-scrollbar { display: none; }
.as-tab { flex: none; text-decoration: none !important; font-weight: 800; font-size: .93rem; padding: 9px 14px; border-radius: 99px; border: 2px solid transparent; color: var(--as-ink-soft) !important; display: inline-flex; align-items: center; gap: 6px; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.as-tab:hover { background: var(--as-lav); color: var(--as-ink) !important; }
.as-tab-on, .as-tab-on:hover { background: var(--as-ink); color: var(--as-on-ink) !important; border-color: var(--as-ink); }
.as-badge { background: var(--as-peach-deep); color: #fff; font: 700 .75rem/1 var(--as-mono); border-radius: 99px; padding: 3px 7px; border: 2px solid var(--as-card); }

/* buttons: plain links (a.as-btn) and Anvil Buttons (roles btn, btn-primary ... on the wrapper) look the same */
:is(.as-btn, .anvil-role-btn > button) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 800 .95rem/1.2 var(--as-text); padding: 11px 20px; min-height: 44px; border-radius: 99px; border: 2.5px solid var(--as-line); background: var(--as-card); color: var(--as-ink) !important; text-decoration: none !important; cursor: pointer; box-shadow: var(--as-pop-sm); white-space: nowrap; margin: 0;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease; }
@media (hover: hover) and (pointer: fine) {
  :is(.as-btn, .anvil-role-btn > button):hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--as-shadow); }  /* design-ok: hard-offset-shadow (sticker look) */
}
:is(.as-btn, .anvil-role-btn > button):active:not(:disabled) { transform: translate(2px, 2px) scale(.98); box-shadow: 0 0 0 var(--as-shadow); }
:is(.as-btn, .anvil-role-btn > button):disabled { opacity: .55; cursor: progress; transform: none; }
:is(.as-btn-primary, .anvil-role-btn-primary > button) { background: var(--as-lav-deep); color: #fff !important; }
:is(.as-btn-good, .anvil-role-btn-good > button) { background: var(--as-mint-deep); color: #fff !important; }
:is(.as-btn-danger, .anvil-role-btn-danger > button) { background: var(--as-peach-deep); color: #fff !important; }
:is(.as-btn-soft, .anvil-role-btn-soft > button) { background: var(--as-butter); }
:is(.as-btn-ghost, .anvil-role-btn-ghost > button) { background: transparent; border-color: transparent; box-shadow: none; }
:is(.as-btn-ghost, .anvil-role-btn-ghost > button):hover { background: var(--as-lav); border-color: var(--as-line); box-shadow: var(--as-pop-sm); }
:is(.as-btn-sm, .anvil-role-btn-sm > button) { padding: 7px 14px; min-height: 36px; font-size: .875rem; border-width: 2px; }
:is(.as-btn-block, .anvil-role-btn-block > button) { display: flex; width: 100%; }
:is(.as-btn-dashed, .anvil-role-btn-dashed > button) { width: 100%; border-style: dashed; box-shadow: none; background: color-mix(in srgb, var(--as-card) 60%, transparent); margin-top: 6px; }
.anvil-role-btn { display: inline-block; }
.anvil-role-btn-block, .anvil-role-btn-dashed { display: block; width: 100%; }
.anvil-role-iconbtn > button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--as-line); background: var(--as-card); cursor: pointer; font-weight: 800; color: var(--as-ink); margin: 0; padding: 0; }
.anvil-role-iconbtn > button:hover { background: var(--as-peach); }

/* chips, badges, pills */
.as-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: .8rem; padding: 3px 11px; min-height: 26px; border-radius: 99px; background: var(--t-bg, var(--as-lav)); border: 2px solid var(--as-line); color: var(--as-ink) !important; text-decoration: none !important; white-space: nowrap; position: relative; z-index: 2; }
a.as-chip[href]:hover { background: var(--as-card); }
.as-evidence { display: inline-flex; gap: 4px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--as-card); border: 2px dashed var(--as-ink-soft); }
.as-specimen { font: 700 .75rem/1 var(--as-mono); letter-spacing: .06em; color: var(--as-ink-soft); background: color-mix(in srgb, var(--as-card) 80%, transparent); border: 1.5px solid var(--as-ink-soft); padding: 4px 7px; border-radius: 6px; }
.as-srcbadge { display: inline-flex; align-items: center; gap: 3px; font-size: .8rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--as-sky); color: var(--as-ink); white-space: nowrap; border: 0; }
.as-srcbadge-gold { background: var(--as-butter); box-shadow: inset 0 0 0 2px var(--as-butter-deep); }
.as-srcbadge-none { background: var(--as-peach); }
.as-srcbadge-btn { cursor: pointer; font-family: var(--as-text); min-height: 28px; }
.as-srcbadge-btn:hover { box-shadow: var(--as-pop-sm); }
.as-pill-soft { font: 700 .75rem var(--as-mono); letter-spacing: .04em; background: var(--as-butter); border: 2px solid var(--as-line); border-radius: 99px; padding: 3px 9px; vertical-align: middle; }
.as-status { display: inline-flex; gap: 5px; align-items: center; font-weight: 800; font-size: .8rem; padding: 4px 11px; border-radius: 99px; border: 2px solid var(--as-line); white-space: nowrap; }
.as-status-draft { background: var(--as-butter); }
.as-status-pending { background: var(--as-sky); }
.as-status-rejected { background: var(--as-peach); }
.as-status-published { background: var(--as-mint); }

/* avatars */
.as-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--as-butter); border: 2px solid var(--as-line); line-height: 1; }
.as-avatar-sm { width: 32px; height: 32px; font-size: 18px; }
.as-avatar-md { width: 42px; height: 42px; font-size: 23px; }
.as-avatar-lg { width: 56px; height: 56px; font-size: 30px; border-width: 2.5px; }
.as-avatar-xl { width: 86px; height: 86px; font-size: 48px; border-width: 3px; }
.as-avatar-xxl { width: 132px; height: 132px; font-size: 76px; border-width: 3px; }

/* bylines, stretched links */
.as-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.as-meta { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.as-byline { display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important; position: relative; z-index: 2; font-size: .9rem; min-width: 0; min-height: 32px; }
.as-byline > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.as-byline b { font-weight: 800; }
.as-byline[href]:hover b { text-decoration: underline; text-decoration-color: var(--as-peach-deep); text-underline-offset: 3px; }

/* empty states */
.as-empty { text-align: center; padding: 46px 20px; background: color-mix(in srgb, var(--as-card) 70%, transparent); border: 3px dashed var(--as-ink-soft); border-radius: 28px; margin: 10px 0; }
.as-empty .as-empty-title { font-size: 1.5rem; margin-top: 0; }
.as-empty p { color: var(--as-ink-soft); max-width: 460px; margin: 0 auto 18px; }

/* page heads, crumbs, banners */
.as-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 24px; }
.as-pagehead h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 0; }
.as-sub { color: var(--as-ink-soft); margin: 6px 0 0 !important; max-width: 640px; }
.as-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 16px; }
.as-crumbs > a:not(.as-btn) { font-weight: 800; text-decoration: none; color: var(--as-accent) !important; padding: 6px 0; }
.as-crumbs > a:not(.as-btn):hover { text-decoration: underline; }
.as-banner { display: flex; gap: 12px; align-items: center; padding: 13px 18px; border-radius: 16px; border: 2.5px solid var(--as-line); margin: 0 0 16px; font-size: .97rem; }
.as-banner-draft { background: var(--as-butter); }
.as-banner-pending { background: var(--as-sky); }
.as-banner-rejected { background: var(--as-peach); }
.as-banner-published { background: var(--as-mint); }
.as-reviewnote { background: var(--as-butter); border: 2px dashed var(--as-butter-deep); border-radius: 14px; padding: 11px 16px; margin: 0 0 16px; font-size: .95rem; white-space: pre-wrap; }

/* panels and forms */
.as-panel { background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: var(--as-r); padding: 18px; box-shadow: var(--as-pop); }
.as-panel-title { font-size: 1.12rem !important; margin: 0 0 12px !important; display: flex; justify-content: space-between; gap: 8px; }
.as-field { display: block; margin: 0 0 16px; }
.as-field-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: .9rem; margin-bottom: 6px; color: var(--as-ink); }
.as-field-label i { font: 400 .75rem var(--as-mono); color: var(--as-muted); font-style: normal; }
:where(.as-app) :is(input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], textarea, select) {
  width: 100%; font: 600 1rem/1.5 var(--as-text); color: var(--as-ink); background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 14px; padding: 11px 14px; margin: 0; box-shadow: none; height: auto; min-height: 46px;
  transition: box-shadow var(--dur-fast) ease, border-color var(--dur-fast) ease; }
:where(.as-app) select { cursor: pointer; }
.as-app input::placeholder, .as-app textarea::placeholder { color: var(--as-muted); font-weight: 500; opacity: 1; }
.as-app input:not([type=checkbox]):not([type=radio]):focus, .as-app textarea:focus, .as-app select:focus { outline: none; border-color: var(--as-accent); box-shadow: 0 0 0 4px var(--as-lav); }
:where(.as-app) textarea { resize: vertical; }
.as-form-narrow { max-width: 620px; }

/* the citation meter */
.as-meter-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.as-meter-face { font-size: 38px; line-height: 1; animation: as-float 4s ease-in-out infinite; }
.as-meter-label { font: 600 1.15rem var(--as-head); }
.as-meter-count { font: 400 .8rem var(--as-mono); color: var(--as-muted); }
.as-meter-track { position: relative; height: 18px; background: var(--as-paper); border: 2.5px solid var(--as-line); border-radius: 99px; overflow: hidden; }
.as-meter-fill { height: 100%; background-color: var(--t-deep); border-radius: 99px; }
.as-meter-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--as-ink) 20%, transparent); }
.as-meter-tip { font-size: .875rem; color: var(--as-ink-soft); margin: 10px 0 0 !important; }

/* emoji pickers (cover critters, lab critters) */
.as-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.as-covers-lg { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.as-pick { display: contents; }
.as-cover { aspect-ratio: 1; font-size: 22px; background: var(--as-paper); border: 2px solid transparent; border-radius: 12px; cursor: pointer; padding: 0; min-width: 0; transition: transform var(--dur-press) var(--ease-out); }
.as-covers-lg .as-cover { font-size: 30px; }
@media (hover: hover) and (pointer: fine) { .as-cover:hover { transform: scale(1.12) rotate(-6deg); } }
.as-cover:active { transform: scale(.94); }
.as-cover-on { background: var(--as-butter); border-color: var(--as-line); box-shadow: var(--as-pop-sm); }

/* segmented toggles (Write / Preview, desk lists, appearance) */
.as-tabs2 { display: inline-flex; background: var(--as-card); border: 2px solid var(--as-line); border-radius: 99px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.as-tab2 { border: 0; background: transparent; border-radius: 99px; padding: 8px 14px; min-height: 36px; font-weight: 800; cursor: pointer; color: var(--as-ink-soft); font-size: .9rem; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.as-tab2:hover { color: var(--as-ink); background: var(--as-paper); }
:is(.as-tab2-on, .as-tab2.on), :is(.as-tab2-on, .as-tab2.on):hover { background: var(--as-ink); color: var(--as-on-ink); }
.as-tabs2-lg { margin: 0 0 20px; }
.as-tabs2-lg .as-tab2 { padding: 9px 18px; font-size: .97rem; }

/* ---------- 5. pages ---------- */
/* front page: hero */
.as-hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; align-items: center; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 30px; box-shadow: var(--as-pop-lg); padding: 38px 40px; margin: 8px 0 28px; position: relative; overflow: hidden; }
.as-hero::before { content: ""; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: var(--as-mint); opacity: .8; }
.as-hero::after { content: ""; position: absolute; left: 40%; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: var(--as-pink); opacity: .55; }
.as-hero-copy, .as-hero-art { position: relative; z-index: 1; }
.as-hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 14px; }
.as-squiggle { text-decoration: underline wavy var(--as-peach-deep); text-decoration-thickness: 3px; text-underline-offset: 8px; color: var(--as-accent); }
.as-hero p { font-size: 1.08rem; color: var(--as-ink-soft); max-width: 560px; margin-bottom: 20px; }
.as-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.as-hero-stats span { font-size: .9rem; background: var(--as-paper); border: 2px dashed var(--as-ink-soft); border-radius: 12px; padding: 6px 12px; }
.as-hero-stats b { font: 700 1.05rem var(--as-mono); color: var(--as-accent); }
.as-hero-bubble { background: var(--as-butter); border: 2.5px solid var(--as-line); border-radius: 18px; padding: 10px 14px; font-weight: 800; font-size: .9rem; box-shadow: var(--as-pop-sm); position: relative; margin-top: 10px; text-align: center; }
.as-hero-bubble::before { content: ""; position: absolute; top: -10px; left: 50%; width: 16px; height: 16px; background: var(--as-butter); border-left: 2.5px solid var(--as-line); border-top: 2.5px solid var(--as-line); transform: translateX(-50%) rotate(45deg); }

/* front page: filters & search */
.as-filters { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.as-filter { flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none !important; font-weight: 800; font-size: .9rem; padding: 8px 14px; min-height: 40px; border-radius: 99px; background: var(--as-card); border: 2.5px solid var(--as-line); color: var(--as-ink) !important; transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease; }
.as-filter i { font: 700 .75rem var(--as-mono); font-style: normal; background: var(--as-paper); border-radius: 99px; padding: 1px 7px; }
@media (hover: hover) and (pointer: fine) { .as-filter:hover { transform: translateY(-2px); background: var(--t-bg, var(--as-lav)); } }
.as-filter-on { background: var(--t-bg, var(--as-ink)); box-shadow: var(--as-pop-sm); }
.as-filter-on:not([class*="tone-"]) { color: var(--as-on-ink) !important; }
.as-filter-on:not([class*="tone-"]) i { color: var(--as-ink); }
.as-search { display: flex; align-items: center; gap: 10px; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 99px; padding: 5px 6px 5px 18px; margin: 8px 0 26px; max-width: 620px; }
.as-search > .anvil-text-box, .as-search > input { flex: 1; min-width: 0; }
.as-app .as-search input { border: 0 !important; outline: none; background: transparent; font: 600 1rem var(--as-text); padding: 8px 0; color: var(--as-ink); box-shadow: none !important; min-height: 40px; }
.as-search:focus-within { box-shadow: 0 0 0 4px var(--as-lav); }

/* front page: the lead story */
.as-lead { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 28px; box-shadow: var(--as-pop-lg); overflow: hidden; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .as-lead:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--as-shadow); } }  /* design-ok: hard-offset-shadow */
.as-lead-art { background-color: var(--t-bg); background-image: radial-gradient(color-mix(in srgb, var(--as-ink) 13%, transparent) 2px, transparent 2.5px); background-size: 22px 22px; display: grid; place-items: center; min-height: 300px; position: relative; box-shadow: inset -3px 0 0 var(--as-line); }
.as-lead-cover { font-size: 120px; width: 210px; height: 210px; display: grid; place-items: center; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 50%; box-shadow: var(--as-pop); animation: as-float 6s ease-in-out infinite; }
.as-lead-flag { position: absolute; top: 18px; left: 18px; background: var(--as-butter); border: 2.5px solid var(--as-line); border-radius: 12px; padding: 5px 11px; font-weight: 800; font-size: .875rem; transform: rotate(-3deg); box-shadow: var(--as-pop-sm); }
.as-lead-body { padding: 32px 34px; display: flex; flex-direction: column; gap: 10px; }
.as-lead-body h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); margin: 6px 0 2px; }
.as-lead-body h2 a { text-decoration: none; }
.as-lead-dek { font-size: 1.1rem; color: var(--as-ink-soft); }
.as-lead-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 2px dashed var(--as-hair); }

/* article cards (RepeatingPanel role "cards": the grid goes on its items container) */
.anvil-role-cards > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.anvil-role-cards-3 > div { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.anvil-role-cards-writers > div { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.as-card { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: var(--as-r); box-shadow: var(--as-pop); overflow: hidden; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .as-card:hover { transform: translate(-2px, -3px) rotate(-.4deg); box-shadow: 6px 7px 0 var(--as-shadow); }  /* design-ok: hard-offset-shadow */
  .as-card:hover .as-card-cover { transform: translateY(22px) rotate(-8deg) scale(1.05); }
}
.as-card-band { background-color: var(--t-bg); background-image: radial-gradient(color-mix(in srgb, var(--as-ink) 12%, transparent) 1.6px, transparent 2px); background-size: 16px 16px; height: 96px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 14px 10px; border-bottom: 2.5px solid var(--as-line); }
.as-card-cover { font-size: 40px; width: 72px; height: 72px; display: grid; place-items: center; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 50%; transform: translateY(26px); box-shadow: var(--as-pop-sm); transition: transform var(--dur-base) var(--ease-out); }
.as-card-body { padding: 34px 18px 12px; flex: 1; }
.as-card-title { font-size: 1.28rem !important; margin: 10px 0 6px !important; }
.as-card-title a { text-decoration: none; }
.as-card-dek { color: var(--as-ink-soft); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.as-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 12px; border-top: 2px dashed var(--as-hair); }

/* reading an article */
.as-article { max-width: 780px; margin: 0 auto; }
.as-article-head { background-color: var(--t-bg); background-image: radial-gradient(color-mix(in srgb, var(--as-ink) 10%, transparent) 2px, transparent 2.5px); background-size: 22px 22px; border: 3px solid var(--as-line); border-radius: 30px; box-shadow: var(--as-pop-lg); padding: 30px 32px 24px; margin-bottom: 30px; position: relative; }
.as-article-cover { float: right; font-size: 64px; width: 108px; height: 108px; display: grid; place-items: center; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 50%; box-shadow: var(--as-pop); margin: -6px 0 10px 16px; animation: as-float 6s ease-in-out infinite; }
.as-article-title { font-size: clamp(2rem, 4.6vw, 3rem) !important; margin: 14px 0 10px !important; }
.as-article-dek { font-size: 1.2rem; color: var(--as-ink-soft); font-weight: 600; }
.as-article-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; clear: both; padding-top: 14px; margin-top: 8px; border-top: 2px dashed color-mix(in srgb, var(--as-ink) 25%, transparent); }

.as-prose { font-size: 1.12rem; line-height: 1.78; color: var(--as-ink); }
.as-prose > * { margin: 0 0 1.05em; }
.as-prose h3 { font-size: 1.6rem; margin: 1.5em 0 .5em; }
.as-prose h4 { font-size: 1.25rem; margin: 1.3em 0 .4em; }
.as-prose a { color: var(--as-accent) !important; text-decoration: underline; text-decoration-color: var(--as-peach-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
.as-prose ul, .as-prose ol { padding-left: 1.4em; }
.as-prose li { margin: .3em 0; }
.as-prose ul li::marker { content: "✦  "; color: var(--as-accent); }
.as-prose blockquote { margin-left: 0; border: 2.5px solid var(--as-line); background: var(--as-lav); border-radius: 18px; padding: 14px 20px; font-style: italic; font-size: 1.05em; }
.as-prose hr { border: 0; height: 18px; background: radial-gradient(circle, var(--as-ink-soft) 2.5px, transparent 3px) center / 26px 18px repeat-x; width: 120px; margin: 2em auto; opacity: .5; }
.as-prose strong { font-weight: 800; }
.as-labnote { display: block; background: var(--as-mint); border: 2.5px solid var(--as-line); border-radius: 18px; padding: 14px 18px; box-shadow: var(--as-pop-sm); font-size: 1rem; }
.as-labnote-tag { display: block; font: 700 .8rem var(--as-mono); letter-spacing: .04em; color: var(--as-ink); margin-bottom: 4px; }
.as-cite { line-height: 0; }
.as-cite a { font: 700 .75rem/1 var(--as-mono); text-decoration: none !important; color: var(--as-ink) !important; background: var(--as-butter); border: 1.5px solid var(--as-line); border-radius: 6px; padding: 2px 5px; margin-left: 1px; }
.as-cite a:hover { background: var(--as-lav-deep); color: #fff !important; }
.as-cite-missing { font: 700 .75rem/1 var(--as-mono); background: var(--as-peach); border: 1.5px dashed var(--as-peach-deep); border-radius: 6px; padding: 2px 5px; }

.as-refs { background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: var(--as-r); padding: 22px 24px; margin: 34px 0 24px; box-shadow: var(--as-pop); scroll-margin-top: 20px; }
.as-refs .as-refs-title { font-size: 1.35rem; margin: 0; }
.as-refs-list { margin: 14px 0 0; display: grid; gap: 12px; }
.as-ref { display: flex; gap: 12px; align-items: flex-start; }
.as-ref a { font-weight: 800; color: var(--as-ink) !important; text-decoration: underline; text-decoration-color: var(--as-lav-deep); text-underline-offset: 3px; word-break: break-word; }
.as-ref-n { flex: none; font: 700 .875rem/1 var(--as-mono); width: 30px; height: 30px; display: grid; place-items: center; background: var(--as-butter); border: 2px solid var(--as-line); border-radius: 9px; }
.as-ref-meta { font-size: .875rem; color: var(--as-muted); margin-top: 2px; }
.as-refs-none { background: var(--as-peach); }
.as-refs-none p { margin: 10px 0 0; }

.as-boopbox { display: flex; align-items: center; gap: 18px; margin: 10px 0 26px; padding: 18px 22px; background: var(--as-pink); border: 2.5px solid var(--as-line); border-radius: var(--as-r); }
.as-boopbox p { margin: 0; font-weight: 700; }
.as-boop { flex: none; display: inline-flex; align-items: center; gap: 10px; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 99px; padding: 10px 20px 10px 12px; cursor: pointer; font-weight: 800; color: var(--as-ink); box-shadow: var(--as-pop); transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-base) ease; }
@media (hover: hover) and (pointer: fine) { .as-boop:hover { transform: translate(-1px, -1px) rotate(-2deg); } }
.as-boop:active { transform: scale(.96); }
.as-boop-paw { font-size: 28px; line-height: 1; }
.as-boop b { font: 700 1.15rem var(--as-mono); }
.as-boop-on { background: var(--as-pink-deep); color: #fff; }
.as-boop-pop .as-boop-paw { animation: as-pop .5s var(--ease-out); }
@keyframes as-pop { 0% { transform: scale(1); } 40% { transform: scale(1.6) rotate(-15deg); } 100% { transform: scale(1); } }

.as-authorbox { display: flex; gap: 16px; align-items: center; text-decoration: none !important; padding: 18px 22px; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: var(--as-r); box-shadow: var(--as-pop); transition: transform var(--dur-fast) var(--ease-out); margin-bottom: 20px; }
@media (hover: hover) and (pointer: fine) { .as-authorbox:hover { transform: translate(-2px, -2px); } }
.as-authorbox p { margin: 2px 0 4px; color: var(--as-ink-soft); }
.as-authorbox-name { font-size: .95rem; color: var(--as-ink-soft); }
.as-authorbox-name b { font: 600 1.25rem var(--as-head); color: var(--as-ink); }
.as-notebook { background: color-mix(in srgb, var(--as-card) 80%, transparent); border: 2.5px dashed var(--as-ink-soft); border-radius: var(--as-r); padding: 18px 22px; margin: 20px 0; }
.as-notebook .as-notebook-title { font-size: 1.2rem; margin: 0; }
.as-log-list { display: grid; gap: 10px; }
.as-log blockquote { margin: 6px 0 0; padding: 8px 12px; background: var(--as-butter); border-radius: 10px; font-size: .95rem; white-space: pre-wrap; }

/* writing desk */
.as-editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.as-editor-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.as-panel-actions { display: grid; gap: 10px; }
.as-panel-actions p { margin: 0; text-align: center; }
.as-app .anvil-role-as-input-title, .as-app .anvil-role-as-input-title input { font: 600 1.55rem/1.25 var(--as-head); }
.as-app input.anvil-role-as-input-title { padding: 14px 16px; }
.as-bodybar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--as-lav); border: 2.5px solid var(--as-line); border-bottom: 0; border-radius: 16px 16px 0 0; padding: 8px; }
.as-fmts { display: flex; gap: 4px; flex-wrap: wrap; transition: opacity var(--dur-base) ease; }
.as-fmt { width: 38px; height: 36px; border: 2px solid var(--as-line); background: var(--as-card); border-radius: 10px; cursor: pointer; font-weight: 800; color: var(--as-ink); }
.as-fmt:hover { background: var(--as-butter); }
.as-dim { opacity: .35; pointer-events: none; }
.as-app textarea.anvil-role-as-body { min-height: 400px; font: 500 1.06rem/1.75 var(--as-text); border-radius: 0 0 16px 16px; }
.as-preview { min-height: 400px; background: var(--as-card); border: 2.5px dashed var(--as-line); border-radius: 0 0 16px 16px; padding: 18px 22px; }
.as-help { font-size: .875rem; color: var(--as-ink-soft); margin-top: 8px; line-height: 2; }
.as-help summary { cursor: pointer; font-weight: 800; color: var(--as-accent); }
.as-sources { margin-top: 28px; background: var(--as-sky); background-image: radial-gradient(color-mix(in srgb, var(--as-ink) 8%, transparent) 1.5px, transparent 2px); background-size: 18px 18px; border: 3px solid var(--as-line); border-radius: 26px; padding: 22px; box-shadow: var(--as-pop); scroll-margin-top: 20px; }
.as-sources-head h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-sources-head p { color: var(--as-ink-soft); font-size: .96rem; max-width: 680px; }
.as-src { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.as-src-n { font: 700 1rem/1 var(--as-mono); width: 36px; height: 36px; display: grid; place-items: center; background: var(--as-butter); border: 2px solid var(--as-line); border-radius: 10px; margin-top: 4px; }
.as-src-fields { display: grid; gap: 8px; min-width: 0; }
.as-src-row2 { display: grid; grid-template-columns: 1.3fr 1fr 170px; gap: 8px; }
.as-app .as-src :is(input, select) { font-size: .93rem; padding: 8px 11px; border-width: 2px; border-radius: 11px; min-height: 42px; }
.as-src-tools { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.as-guide summary { list-style: none; cursor: pointer; }
.as-guide summary::-webkit-details-marker { display: none; }
.as-guide ul { margin: 0; padding-left: 18px; font-size: .9rem; display: grid; gap: 6px; }

/* my lab */
.as-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.as-tile { border: 2.5px solid var(--as-line); border-radius: 20px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; box-shadow: var(--as-pop-sm); }
.as-tile > span { font-size: 30px; grid-row: span 2; }
.as-tile > b { font: 700 1.6rem/1 var(--as-mono); }
.as-tile > small { font-weight: 800; font-size: .8rem; }
.as-labrow { display: flex; gap: 16px; align-items: center; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--as-pop-sm); }
.as-labrow-cover { font-size: 30px; width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: var(--as-paper); border: 2px solid var(--as-line); border-radius: 50%; }
.as-labrow-main { flex: 1; min-width: 0; }
.as-labrow-main h3 { font-size: 1.15rem; margin: 6px 0 2px; overflow-wrap: anywhere; }
.as-labrow-main h3 a { text-decoration: none; }
.as-labrow-main h3 a[href]:hover { text-decoration: underline; }
.as-labrow-main .as-reviewnote { margin: 10px 0 0; }
.as-labrow-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.as-labgroup > p { margin-top: -6px; }

/* writers */
.as-wcard { position: relative; text-align: center; height: 100%; background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 26px; padding: 24px 18px 18px; box-shadow: var(--as-pop); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); display: flex; flex-direction: column; align-items: center; }
@media (hover: hover) and (pointer: fine) { .as-wcard:hover { transform: translate(-2px, -3px) rotate(.4deg); box-shadow: 6px 7px 0 var(--as-shadow); } }  /* design-ok: hard-offset-shadow */
.as-wcard .as-wcard-name { font-size: 1.3rem; margin: 12px 0 2px; }
.as-wcard-name a { text-decoration: none; }
.as-wcard-dish, .as-profile-dish { padding: 10px; border-radius: 50%; background: var(--as-mint); box-shadow: inset 0 0 0 8px var(--as-card), inset 0 0 0 11px var(--as-mint-mid); border: 2.5px solid var(--as-line); }
.as-wcard-spec { color: var(--as-accent); font-weight: 800; font-size: .9rem; }
.as-wcard-bio { color: var(--as-ink-soft); font-size: .9rem; margin: 8px 0 0 !important; }
.as-wcard-stats { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 14px 0 10px; }
.as-wcard-stats span { font-size: .8rem; background: var(--as-paper); border-radius: 10px; padding: 4px 8px; }
.as-wcard-stats b { font-family: var(--as-mono); }
.as-wcard-latest { margin-top: auto; padding-top: 10px; font-size: .875rem; color: var(--as-muted); border-top: 2px dashed var(--as-hair); width: 100%; }
.as-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.as-badges-sm { justify-content: center; margin-top: 0; }
.as-badge2 { display: inline-flex; gap: 5px; align-items: center; font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: var(--as-butter); border: 2px solid var(--as-line); cursor: help; }
.as-badges-sm .as-badge2 b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.as-profile { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; background: var(--as-card); border: 3px solid var(--as-line); border-radius: 30px; box-shadow: var(--as-pop-lg); padding: 30px 34px; }
.as-profile h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 10px 0 4px; overflow-wrap: anywhere; }
.as-profile-dish { padding: 14px; }
.as-profile-spec { font-weight: 800; color: var(--as-accent); margin-bottom: 10px; }
.as-profile-bio { font-size: 1.05rem; color: var(--as-ink-soft); max-width: 620px; white-space: pre-wrap; }
.as-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 6px; }
.as-stat { background: var(--as-card); border: 2.5px solid var(--as-line); border-radius: 18px; padding: 14px; text-align: center; box-shadow: var(--as-pop-sm); }
.as-stat b { display: block; font: 700 1.7rem/1.1 var(--as-mono); color: var(--as-accent); }
.as-stat span { font-size: .875rem; font-weight: 800; }

/* sign in */
.as-auth { display: grid; grid-template-columns: 1fr minmax(0, 460px) 1fr; align-items: center; gap: 20px; padding: 20px 0; }
.as-auth-art { justify-self: end; }
.as-auth-art .as-mascot { animation: as-float 5s ease-in-out infinite; }
.as-auth-card { grid-column: 2; padding: 30px; }
.as-auth-card h1 { font-size: 2rem; margin: 0; }
.as-auth-card .as-sub { margin-bottom: 18px !important; }
.as-auth-card .anvil-role-msg-error, .as-auth-card .anvil-role-msg-note { margin-bottom: 14px; }
.as-auth-switch { text-align: center; margin-top: 16px; font-size: .92rem; }
.as-auth-switch p { margin: 0; }
.as-auth-switch .as-linkbtn { padding: 4px 0; }
.as-perks { list-style: none; padding: 12px 14px; margin: 0 0 16px; background: var(--as-mint); border-radius: 14px; display: grid; gap: 4px; font-size: .92rem; font-weight: 700; }
.as-or { text-align: center; margin: 12px 0; color: var(--as-ink-soft); }
.as-auth-card .lk-consent, .as-auth-card [class*="consent"] { font-size: .9rem; margin-bottom: 14px; }
.anvil-role-au-google img, .anvil-role-au-google .anvil-component-icon { width: 18px; height: 18px; flex: none; }

/* review desk */
.as-checks { display: grid; gap: 8px; }
.as-check-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; }
.as-check-row > div { display: grid; }
.as-check-row small { color: var(--as-ink-soft); font-size: .8rem; }
.as-check-row.as-ok { background: var(--as-mint); }
.as-check-row.as-warn { background: var(--as-peach); }
.as-decide { display: grid; gap: 10px; background: var(--as-butter); }
.as-decide .as-field { margin: 0; }
.as-decide p { margin: 0; text-align: center; }
.as-article-review { max-width: none; }
.anvil-role-as-check label, .anvil-role-as-check .checkbox label { display: flex !important; gap: 10px; align-items: center; font-weight: 800; cursor: pointer; padding: 6px 0; margin: 0; }
.anvil-role-as-check input { width: 20px; height: 20px; accent-color: var(--as-lav-deep); margin: 0; position: static; }

/* footer */
.as-footer { border-top: 3px solid var(--as-line); background: var(--as-card); margin-top: 20px; }
.as-footer-in { max-width: 1180px; margin: 0 auto; padding: 18px 20px 26px; display: grid; gap: 10px; font-size: .9rem; color: var(--as-ink-soft); }
.as-footer-in p { margin: 0; }
.as-footer-in a:not(.as-linkbtn) { color: var(--as-accent); font-weight: 700; }
.as-fact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--as-mint); border: 2px solid var(--as-line); border-radius: 16px; padding: 9px 14px; color: var(--as-ink); font-weight: 700; }
.as-fact-tag { font: 700 .75rem var(--as-mono); letter-spacing: .04em; background: var(--as-card); border: 2px solid var(--as-line); border-radius: 99px; padding: 2px 9px; }
.as-footer-theme { gap: 10px; margin-top: 4px; }
.as-footer-theme .as-tab2 { padding: 6px 12px; min-height: 32px; font-size: .875rem; }

/* Watch section: the app's YouTube video. Click to play; nothing loads from YouTube before the click. */
.as-watch { margin: 48px 0 12px; }
.as-watch h2 { font-size: 1.6rem; }
.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(--as-muted); margin: 0 0 16px; }
.ytf .ytf-link { font-weight: 800; color: var(--as-accent); display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; }
.ytf .ytf-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--as-r); overflow: hidden; background: #000; border: 2.5px solid var(--as-line); box-shadow: var(--as-pop-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) ease; }
.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-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ytf .ytf-cover:hover img { transform: scale(1.02); filter: brightness(.92); }
  .ytf .ytf-cover:hover .ytf-play { transform: translate(-50%, -50%) scale(1.08); }
}
.ytf .ytf-cover:focus-visible { outline: 3px solid var(--as-accent); outline-offset: -3px; }
.ytf .ytf-len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .8rem; font-weight: 700; line-height: 1.3; padding: 3px 7px; border-radius: 5px; }
.ytf .ytf-note { font-size: .875rem; color: var(--as-muted); margin: 10px 2px 0; }

/* dialogs (Dialogs/*: alert(Form, role="app-dialog")) */
.as-dialog { text-align: left; }
.as-dialog .as-dialog-title { font-size: 1.55rem; text-align: center; margin: 0 0 12px; }
.as-modal-body { color: var(--as-ink-soft); margin-bottom: 18px; }
.as-modal-body ul { padding-left: 20px; }
.as-modal-body .as-field { margin-top: 10px; }

/* smaller screens */
@media (max-width: 960px) {
  .as-editor { grid-template-columns: 1fr; }
  .as-editor-side { position: static; }
  .as-lead { grid-template-columns: 1fr; }
  .as-lead-art { min-height: 220px; box-shadow: inset 0 -3px 0 var(--as-line); }
  .as-lead-cover { width: 160px; height: 160px; font-size: 90px; }
  .as-hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .as-hero-art { display: flex; align-items: center; gap: 14px; order: -1; }
  .as-hero-art .as-mascot-hero { width: 110px; height: 128px; margin: 0; }
  .as-hero-bubble { margin: 0; text-align: left; }
  .as-hero-bubble::before { top: 50%; left: -10px; transform: translateY(-50%) rotate(-45deg); }
  .as-auth { grid-template-columns: 1fr; }
  .as-auth-art { justify-self: center; }
  .as-auth-card { grid-column: 1; }
}
@media (max-width: 800px) { .ytf .ytf-in { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
@media (max-width: 640px) {
  .as-main { padding: 16px 16px 60px; }
  .as-topbar { padding: 10px 16px 4px; }
  .as-nav { padding: 4px 16px 10px; }
  .as-brand-tag, .as-me-name { display: none; }
  .as-brand-name { font-size: 1.35rem; }
  .as-hero, .as-profile, .as-article-head { border-radius: 24px; box-shadow: var(--as-pop); }
  .as-lead-body { padding: 22px; }
  .as-article-head { padding: 22px 20px 18px; }
  .as-article-cover { width: 76px; height: 76px; font-size: 44px; }
  .as-prose { font-size: 1.05rem; }
  .as-src { grid-template-columns: 1fr; }
  .as-src-n { margin: 0; }
  .as-src-row2 { grid-template-columns: 1fr; }
  .as-src-tools { flex-direction: row; justify-content: flex-end; }
  .as-tiles, .as-stats { grid-template-columns: repeat(2, 1fr); }
  .as-labrow { flex-wrap: wrap; }
  .as-labrow-actions { width: 100%; justify-content: flex-start; }
  .as-profile { grid-template-columns: 1fr; text-align: center; padding: 24px 20px; }
  .as-profile .as-row, .as-profile .as-badges { justify-content: center; }
  .as-profile-dish { justify-self: center; }
  .as-boopbox { flex-direction: column; text-align: center; }
  .as-refs { padding: 18px; }
  .anvil-role-cards > div, .anvil-role-cards-3 > div, .anvil-role-cards-writers > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .ytf .ytf-play svg { width: 56px; height: 40px; } }

/* reduced motion: Bea stops bobbing and the cards stop tilting; colour fades stay (design kit) */
@media (prefers-reduced-motion: reduce) {
  .as-bub, .as-eyes, .as-mascot-hero, .as-lead-cover, .as-article-cover, .as-meter-face, .as-auth-art .as-mascot, .as-boop-pop .as-boop-paw { animation: none; }
  .as-card:hover, .as-lead:hover, .as-wcard:hover, .as-authorbox:hover, .as-boop:hover, .as-cover:hover, .as-filter:hover,
  .as-card:hover .as-card-cover, :is(.as-btn, .anvil-role-btn > button):hover, :is(.as-btn, .anvil-role-btn > button):active { transform: none; }
}

/* ---------- 6. Anvil components: notifications, dialogs, labels (the role layer from template-forms) ---------- */
anvil-dropzone { display: contents; }   /* App Server 1.18 wraps named elements in these; hosted Anvil doesn't */
.anvil-role-contents, .anvil-role-contents > div { display: contents; }
.anvil-label { padding: 0; margin: 0; }
.anvil-role-msg-error { background: var(--as-peach); color: var(--as-ink); border: 2.5px solid var(--as-line); border-radius: 14px; padding: 10px 14px; font-size: .95rem; font-weight: 700; }
.anvil-role-msg-note { background: var(--as-sky); color: var(--as-ink); border: 2.5px solid var(--as-line); border-radius: 14px; padding: 10px 14px; font-size: .95rem; font-weight: 700; }
.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; }

/* notifications (state.toast) look like the old pill toasts design-ok: hard-offset-shadow */
.anvil-notification, [data-notify="container"].anvil-alert { background: var(--as-ink); color: var(--as-on-ink); border: 2.5px solid var(--as-line); border-radius: 18px;
  box-shadow: 3px 3px 0 var(--as-lav-deep); font: 800 1rem/1.4 var(--as-text); padding: 12px 40px 12px 18px; }
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-ok, .anvil-alert-success) { background: var(--as-mint-deep); color: #fff; box-shadow: var(--as-pop-sm); }
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-error, .anvil-alert-danger) { background: var(--as-peach-deep); color: #fff; box-shadow: var(--as-pop-sm); }
:is(.anvil-notification, [data-notify="container"]) :is(.anvil-close, [data-notify="dismiss"]) { color: inherit; opacity: .85; text-shadow: none; min-width: 24px; min-height: 24px; }
.anvil-notification, [data-notify="container"] { transition-property: opacity, transform !important; }   /* Anvil animates "all" */

/* dialogs (alert / confirm) look like the old sticker modals */
.anvil-modal-content { background: var(--as-card); color: var(--as-ink); border: 3px solid var(--as-line); border-radius: 28px; box-shadow: var(--as-pop-lg); font: 16px/1.55 var(--as-text); }
.anvil-modal-header { border-bottom: 0; padding: 22px 26px 0; }
.anvil-modal-title { font: 600 1.55rem/1.15 var(--as-head); color: var(--as-ink); }
.anvil-modal-body { padding: 18px 26px 24px; }
.anvil-modal-footer { border-top: 0; padding: 0 26px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.anvil-modal-footer .btn, .anvil-modal-footer button { font: 800 .95rem/1.2 var(--as-text); padding: 10px 18px; min-height: 44px; border-radius: 99px; border: 2.5px solid var(--as-line); background: var(--as-card); color: var(--as-ink); box-shadow: var(--as-pop-sm); margin: 0; }
.anvil-modal-footer .btn-primary, .anvil-modal-footer button:last-child { background: var(--as-lav-deep); color: #fff; }
.anvil-modal-header .anvil-close, .anvil-modal-header .close { color: var(--as-muted); opacity: 1; text-shadow: none; min-width: 24px; min-height: 24px; }
.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), 520px); max-width: none; }
@media (max-width: 720px) { .anvil-modal-body { padding: 16px 18px 20px; } .anvil-modal-header { padding: 18px 18px 0; } }
