/* 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). */

/* Sakura Pop tokens (light + dark) */
:root {
  --c-bg: #fff5f8;          /* page */
  --c-surface: #ffffff;     /* cards, menus, inputs */
  --c-surface-2: #ffe9f1;   /* subtle fills, hovers */
  --c-ink: #2a2238;         /* text */
  --c-muted: #6c5f7e;       /* secondary text */
  --c-faint: #76678a;       /* hints, placeholders (4.5:1 on every surface: WCAG AA) */
  --c-line: #f2d6e2;        /* borders */
  --c-brand: #ff4f8b;       /* sakura pink: primary fills, focus */
  --c-brand-ink: #2a2238;   /* text on brand (ink on pink, sticker style) */
  --c-brand-soft: #ffe1ec;  /* brand tints */
  --c-brand-text: #cc1f63;  /* pink that reads as text */
  --c-accent: #3cc6c0;      /* mint */
  --c-accent-soft: #dcf6f4;
  --c-sun: #ffd24a;         /* petal centres, stars */
  --c-outline: #2a2238;     /* sticker outlines */
  --c-tint: #f6cadb;        /* card sticker shadow */
  --c-good: #12855a; --c-good-soft: #dff5ea;
  --c-warn: #9a5a00; --c-warn-soft: #fff0d2;
  --c-bad: #d0294a;  --c-bad-soft: #ffe3e8;
  --radius: 22px; --radius-sm: 14px;
  --shadow: 0 4px 0 var(--c-tint);
  --shadow-lg: 0 6px 0 var(--c-outline), 0 22px 50px rgba(42, 34, 56, .18);
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --maxw: 1160px;
  --header-h: 66px;
  --c-on-status: #fff;     /* text on good/bad/warn fills */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #1a1424; --c-surface: #251d33; --c-surface-2: #30263f; --c-ink: #f7eef8; --c-muted: #bcaccb; --c-faint: #a594b8;
    --c-line: #3b2f50; --c-brand: #ff6fa3; --c-brand-ink: #1a1424; --c-brand-soft: #41213a; --c-brand-text: #ff8db7;
    --c-accent: #4fd8d1; --c-accent-soft: #163a3c; --c-sun: #ffd86a; --c-outline: #0c0812; --c-tint: #120d1a;
    --c-good: #5fd9a0; --c-good-soft: #133126; --c-warn: #f4bb55; --c-warn-soft: #33260f; --c-bad: #ff8399; --c-bad-soft: #3c1823;
    --shadow: 0 4px 0 var(--c-tint); --shadow-lg: 0 6px 0 #0c0812, 0 22px 50px rgba(0, 0, 0, .55); --c-on-status: #1a1424; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #1a1424; --c-surface: #251d33; --c-surface-2: #30263f; --c-ink: #f7eef8; --c-muted: #bcaccb; --c-faint: #a594b8;
  --c-line: #3b2f50; --c-brand: #ff6fa3; --c-brand-ink: #1a1424; --c-brand-soft: #41213a; --c-brand-text: #ff8db7;
  --c-accent: #4fd8d1; --c-accent-soft: #163a3c; --c-sun: #ffd86a; --c-outline: #0c0812; --c-tint: #120d1a;
  --c-good: #5fd9a0; --c-good-soft: #133126; --c-warn: #f4bb55; --c-warn-soft: #33260f; --c-bad: #ff8399; --c-bad-soft: #3c1823;
  --shadow: 0 4px 0 var(--c-tint); --shadow-lg: 0 6px 0 #0c0812, 0 22px 50px rgba(0, 0, 0, .55); --c-on-status: #1a1424; 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; }
}



/* ---------------------------------------------------------------- Sakura Pop: sticker components */
.ui h1, .ui h2, .ui h3, .ui h4 { font-weight: 800; letter-spacing: -.01em; }
.ui a { color: var(--c-brand-text); }
.ui-card { border: 2px solid var(--c-line); }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { border: 2.5px solid var(--c-outline); box-shadow: 0 3px 0 var(--c-outline); font-weight: 800; font-family: var(--font-body); }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):hover { border-color: var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); }
@media (hover: hover) and (pointer: fine) { :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):hover { transform: translateY(-1px); } }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-outline); }
: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-outline); 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: 1; filter: saturate(1.15) brightness(1.03); }
:is(.ui-btn.mint, .anvil-role-btn.anvil-role-btn-mint > button, a.anvil-role-btn.anvil-role-btn-mint) { background: var(--c-accent); color: #10302f; }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost) { border-color: transparent; box-shadow: none; }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost):hover { transform: none; box-shadow: none; }
: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) { color: #fff; }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):disabled, :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):disabled:hover { transform: none; box-shadow: 0 3px 0 var(--c-outline); }
:is(.ui-btn.sm, .anvil-role-btn.anvil-role-btn-sm > button, a.anvil-role-btn.anvil-role-btn-sm) { box-shadow: 0 2px 0 var(--c-outline); border-width: 2px; }
.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 select, .ui textarea { border-width: 2px; }
.ui-badge { font-weight: 800; }
.ui-badge.brand { color: var(--c-brand-text); }
.ui-badge.mint { background: var(--c-accent-soft); color: #127a75; }
html.ui-dark .ui-badge.mint { color: var(--c-accent); }
.ui-tabs .on { border-bottom-color: var(--c-brand); border-bottom-width: 3px; }
.ui-avatar { background: var(--c-brand-soft); color: var(--c-brand-text); font-weight: 800; }
.ui-avatar-btn { border: 2.5px solid var(--c-outline); box-shadow: 0 2px 0 var(--c-outline); font-weight: 800; }
.ui-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.ui-brand span b { color: var(--c-brand-text); font-weight: 800; }
.ui-nav a { font-weight: 800; }
.ui-nav a.on { background: var(--c-brand-soft); color: var(--c-brand-text); }
.ui-header { border-bottom: 2px solid var(--c-line); }
.ui-menu { border: 2.5px solid var(--c-outline); }
.ui-modal { border: 2.5px solid var(--c-outline); }
.ui-toast { border: 2px solid var(--c-outline); font-weight: 700; }
.ui-empty { border: 2.5px dashed var(--c-line); background: color-mix(in srgb, var(--c-surface) 60%, transparent); }
.ui-stat b { color: var(--c-ink); }
.ui-tabbar a.on { color: var(--c-brand-text); }
.ui-check input { accent-color: var(--c-brand); }
.ui-seg button.on { box-shadow: 0 2px 0 var(--c-tint); font-weight: 800; }
::selection { background: var(--c-brand-soft); }
@media (max-width: 720px) { .ui-header-right .ui-btn.hide-s { display: none; } }


/* ===== engines: nv-tools.js (covers, picker), nv-editor.js (editor, playtest, publish, export) ===== */
.nv-cover { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(160deg, #ffb3cc, #ff4f8b);
  border: 2.5px solid var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); }
.nv-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-cover .nv-cover-t { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 10px; color: #fff; font: 800 1.05rem/1.1 var(--font-display);
  background: linear-gradient(180deg, transparent, rgba(26, 20, 36, .85)); text-shadow: 0 2px 0 rgba(26, 20, 36, .6); }
.nv-cover .nv-cover-badge { position: absolute; top: 8px; left: 8px; }
.nv-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--c-surface-2) repeating-conic-gradient(var(--c-line) 0 25%, transparent 0 50%) 0 0 / 16px 16px; display: block; }
.nv-thumb.contain { object-fit: contain; }
.nv-kind { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k, var(--c-faint)); flex: none; }
.k-true { --k: #f5b81c; } .k-good { --k: #ff4f8b; } .k-neutral { --k: #3cc6c0; } .k-bad { --k: #8b7d9c; } .k-secret { --k: #8a6cff; }
.nv-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 4px 2px; }
.nv-pick-grid button { border: 2px solid var(--c-line); background: var(--c-surface); border-radius: 14px; padding: 6px; cursor: pointer; text-align: left; font: 600 .78rem/1.25 var(--font-body); color: var(--c-ink); display: grid; gap: 4px; }
.nv-pick-grid button:hover, .nv-pick-grid button.on { border-color: var(--c-brand); background: var(--c-brand-soft); }
.nv-pick-grid button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-drop { border: 2.5px dashed var(--c-line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--c-muted); background: var(--c-surface); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); display: block; }
.nv-drop:hover, .nv-drop.over { border-color: var(--c-brand); background: var(--c-brand-soft); }
.nv-drop .ui-ic { width: 30px; height: 30px; color: var(--c-brand-text); }
.nv-drop input { display: none; }
.pt { position: fixed; inset: 0; z-index: 950; background: #120d1a; display: grid; grid-template-rows: auto 1fr; color: #fff; }
.pt-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.pt-top h3 { margin: 0; font: 800 1.1rem/1.2 var(--font-display); color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-top .ui-btn { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.pt-body { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.pt-host { min-height: 0; padding: 12px; }
.pt-side { border-left: 1px solid rgba(255,255,255,.12); overflow: auto; padding: 14px; font-size: .9rem; display: grid; align-content: start; gap: 14px; background: #1a1424; }
.pt-side h4 { margin: 0 0 6px; color: #fff; font: 800 .8rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.pt-vars { display: grid; gap: 6px; }
.pt-vars label { display: grid; grid-template-columns: 1fr 96px; gap: 8px; align-items: center; }
.pt-vars code { color: #8fe3df; overflow-wrap: anywhere; }
.pt-vars input { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; width: 100%; }
.pt-side select { font: inherit; width: 100%; padding: 7px; border-radius: 8px; background: #2a2238; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.pt-now { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.07); }
.pt-now b { color: #ff8db7; }
@media (max-width: 860px) { .pt-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .pt-side { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); max-height: 34vh; } }
.ed-lint { display: grid; gap: 8px; max-height: 56vh; overflow: auto; }
.ed-lint button { display: flex; gap: 10px; align-items: flex-start; text-align: left; font: 600 .92rem/1.35 var(--font-body); color: var(--c-ink); background: var(--c-surface); border: 2px solid var(--c-line); border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.ed-lint button:hover { border-color: var(--c-brand); }
.ed-lint .lv { flex: none; margin-top: 2px; }
.ed-lint small { display: block; color: var(--c-muted); font-weight: 700; }
.ed-pv { position: relative; border-radius: 16px; overflow: hidden; }
.ed-pv .nvp { pointer-events: none; }
.ex-opt { display: grid; gap: 10px; }
.ex-guide details { border: 2px solid var(--c-line); border-radius: 14px; padding: 4px 14px; margin-top: 8px; background: var(--c-surface); }
.ex-guide summary { cursor: pointer; font-weight: 800; padding: 10px 0; }
.ex-guide ol, .ex-guide ul { margin: 0 0 12px; padding-left: 20px; color: var(--c-muted); }
.ex-guide li { margin-bottom: 4px; }
.ex-progress { height: 10px; border-radius: 99px; background: var(--c-surface-2); overflow: hidden; border: 2px solid var(--c-outline); }
.ex-progress i { display: block; height: 100%; width: 0; background: var(--c-brand); transition: width var(--dur-base) var(--ease-out); }
.share-box { display: flex; gap: 8px; align-items: center; }
.share-box input { flex: 1; min-width: 0; }
.page-edit .ui-footer { display: none; }
.page-edit .ui-main { min-height: calc(100vh - var(--header-h)); }
.ed { max-width: 1440px; margin: 0 auto; padding: 14px 20px 40px; }
.ed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ed-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.ed-name { font: 800 1.45rem/1.2 var(--font-display) !important; border: 2px solid transparent !important; background: transparent !important; padding: 4px 8px !important; min-height: 0 !important; border-radius: 12px !important; min-width: 0; flex: 1; }
.ed-name:hover, .ed-name:focus { border-color: var(--c-line) !important; background: var(--c-surface) !important; }
.ed-save { font-size: .82rem; font-weight: 700; color: var(--c-muted); white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.ed-save.bad { color: var(--c-bad); }
.ed-save.ok .ui-ic { color: var(--c-good); width: 15px; height: 15px; }
.ed-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-acts .ui-btn { min-height: 40px; padding: 8px 14px; }
.ed-acts .count { background: var(--c-bad); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; }
.ed-acts .count.warn { background: var(--c-warn); }
.ed-tabs { margin-bottom: 16px; }
/* map */
.mp { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.mp-canvas { position: relative; height: min(72vh, 760px); border-radius: var(--radius); border: 2.5px solid var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); overflow: hidden;
  background: var(--c-surface) radial-gradient(circle, var(--c-line) 1.3px, transparent 1.6px) 0 0 / 22px 22px; }
.mp-canvas > svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.mp-canvas > svg.panning { cursor: grabbing; }
.mp-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.mp-tools .ui-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; background: var(--c-surface); }
.mp-tools .ui-btn.primary { background: var(--c-brand); }
.mp-legend { position: absolute; bottom: 10px; left: 12px; display: flex; gap: 12px; font-size: .75rem; font-weight: 700; color: var(--c-muted); background: color-mix(in srgb, var(--c-surface) 88%, transparent); padding: 5px 10px; border-radius: 99px; }
.mp-legend i { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid var(--c-ink); vertical-align: middle; margin-right: 5px; }
.mp-legend i.n { border-top-style: dashed; } .mp-legend i.j { border-top: 2.5px dotted var(--c-brand-text); }
.mp-n { cursor: pointer; }
.mp-n rect.box { fill: var(--c-surface); stroke: var(--c-outline); stroke-width: 2.5; }
.mp-n rect.sh { fill: var(--c-outline); }
.mp-n.sel rect.box { fill: var(--c-brand-soft); stroke: var(--c-brand-text); stroke-width: 3.5; }
.mp-n.end rect.box { fill: color-mix(in srgb, var(--k) 26%, var(--c-surface)); }
.mp-n text { font-family: var(--font-body); fill: var(--c-ink); }
.mp-n .t { font-weight: 800; font-size: 15px; }
.mp-n .s { font-size: 12px; fill: var(--c-muted); font-weight: 700; }
.mp-n .badge rect { fill: var(--c-accent); stroke: var(--c-outline); stroke-width: 2; }
/* design-ok: tiny-text (the START badge on the story map: SVG text in a fixed-size badge, an 11px label) */
.mp-n .badge text { font-size: 11px; font-weight: 800; fill: #10302f; letter-spacing: .06em; }
.mp-n .warn { fill: var(--c-bad); stroke: var(--c-surface); stroke-width: 2; }
.mp-e path { fill: none; stroke: var(--c-ink); stroke-width: 2.4; opacity: .7; }
.mp-e.next path { stroke-dasharray: 7 6; }
.mp-e.jump path { stroke: var(--c-brand-text); stroke-dasharray: 2 5; stroke-linecap: round; stroke-width: 3; }
.mp-e.cond path { opacity: .45; }
.mp-e.game path { stroke: var(--c-accent); stroke-width: 3; opacity: .9; stroke-dasharray: 10 4 2 4; }
.mp-legend i.g { border-top: 3px dashed var(--c-accent); }
.gcol { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; font-weight: 800; color: var(--c-muted); }
.gcol input[type=color] { width: 38px; height: 32px; padding: 1px; border-radius: 9px; border: 2px solid var(--c-outline); background: var(--c-surface); cursor: pointer; }
.gpal { display: inline-flex; border: 2px solid var(--c-outline); border-radius: 99px; overflow: hidden; padding: 0; cursor: pointer; background: none; }
.gpal i { width: 13px; height: 24px; display: block; }
.st-game .st-row > span.small { flex: none; min-width: 90px; }
.snds { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.snd { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 12px 14px; }
.snd .ui-btn.icon { width: 46px; min-height: 46px; grid-row: span 2; }
.snd input, .snd select { min-height: 34px !important; padding: 4px 8px !important; font-size: .85rem !important; }
.snd .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .82rem; color: var(--c-muted); }
.builtin { display: flex; flex-wrap: wrap; gap: 8px; }
.builtin .ui-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.mp-e rect { fill: var(--c-surface); stroke: var(--c-line); stroke-width: 1.5; }
.mp-e text { font: 700 11.5px var(--font-body); fill: var(--c-muted); }
.mp-side { display: grid; align-content: start; gap: 14px; }
.mp-side .ui-card { padding: 18px; }
.mp-side h3 { margin-bottom: 4px; overflow-wrap: anywhere; }
.mp-links { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.mp-links li { display: flex; gap: 8px; align-items: baseline; }
.mp-links a { font-weight: 800; cursor: pointer; }
.mp-btns { display: grid; gap: 8px; margin-top: 14px; }
.mp-btns .ui-btn { justify-content: flex-start; }
.mp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mp-stats b { display: block; font: 800 1.4rem/1.1 var(--font-display); }
.mp-stats span { font-size: .78rem; color: var(--c-muted); font-weight: 700; }
/* write */
.wr { display: grid; grid-template-columns: 240px minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.wr-list { position: sticky; top: calc(var(--header-h) + 12px); display: grid; gap: 8px; max-height: calc(100vh - var(--header-h) - 30px); overflow: auto; padding: 2px 2px 8px; }
.wr-scene { display: flex; gap: 8px; align-items: center; text-align: left; width: 100%; padding: 9px 11px; border-radius: 14px; border: 2px solid var(--c-line); background: var(--c-surface);
  font: 700 .9rem/1.25 var(--font-body); color: var(--c-ink); cursor: pointer; }
.wr-scene:hover { border-color: var(--c-brand); }
.wr-scene.on { border-color: var(--c-outline); background: var(--c-brand-soft); box-shadow: 0 3px 0 var(--c-outline); }
.wr-scene span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-scene .flag { font-size: .75rem; font-weight: 800; padding: 2px 6px; border-radius: 99px; background: var(--c-accent); color: #10302f; }
.wr-mobile { display: none; }
.wr-prev { position: sticky; top: calc(var(--header-h) + 12px); display: grid; gap: 10px; }
.wr-prev .ed-pv { border: 2.5px solid var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); background: #1a1424; }
.sc-head { display: grid; gap: 10px; margin-bottom: 14px; }
.sc-name { font: 800 1.5rem/1.2 var(--font-display) !important; }
.sc-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sc-chips select { width: auto !important; min-height: 38px !important; padding: 6px 10px !important; font-weight: 700; }
.sc-chips .ui-btn { min-height: 38px; padding: 6px 12px; font-size: .86rem; }
.sc-sec { margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sc-sec h3 { margin: 0; }
.sc-steps { display: grid; gap: 8px; }
.st { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px; border-radius: 16px; background: var(--c-surface); border: 2px solid var(--c-line); }
.st.sel { border-color: var(--c-brand); box-shadow: 0 3px 0 var(--c-tint); }
.st-k { display: flex; gap: 6px; align-items: center; font: 800 .74rem/1.15 var(--font-body); color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; }
.st-k .ui-ic { width: 16px; height: 16px; color: var(--c-brand-text); }
.st-say .st-k .ui-ic { color: var(--c-ink); }
.st-b { display: grid; gap: 8px; min-width: 0; }
.st-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-row > select, .st-row > input { width: auto !important; flex: 1 1 130px; min-height: 40px !important; padding: 7px 10px !important; }
.st-row > input.num { flex: 0 0 90px; }
.st textarea { min-height: 64px !important; font-size: 1rem; }
.st-m { display: flex; flex-direction: row; gap: 0; opacity: .45; transition: opacity .15s; }
.st:hover .st-m, .st:focus-within .st-m, .st.sel .st-m { opacity: 1; }
html.touch .st-m { opacity: 1; }
.st-m button { width: 28px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--c-faint); cursor: pointer; display: grid; place-items: center; }
.st-m button:hover { background: var(--c-surface-2); color: var(--c-ink); }
.st-m .ui-ic { width: 16px; height: 16px; }
.st-if { display: flex; gap: 8px; align-items: center; white-space: nowrap; font-size: .85rem; font-weight: 800; color: var(--c-warn); }
.st-if input { min-height: 34px !important; padding: 5px 10px !important; font-family: ui-monospace, Consolas, monospace !important; font-size: .88rem !important; }
.st-note textarea { background: var(--c-warn-soft) !important; }
.cond-bad { border-color: var(--c-bad) !important; }
.cond-msg { font-size: .8rem; color: var(--c-bad); font-weight: 700; }
.pic-field { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 14px; border: 2px solid var(--c-line); background: var(--c-surface); cursor: pointer; font: 700 .9rem/1.2 var(--font-body); color: var(--c-ink); max-width: 100%; }
.pic-field:hover { border-color: var(--c-brand); }
.pic-field img, .pic-field .ph { width: 54px; height: 40px; object-fit: cover; border-radius: 9px; background: var(--c-surface-2); flex: none; }
.pic-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sc-add .ui-btn { min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.sc-add select { width: auto !important; min-height: 38px !important; padding: 6px 10px !important; font-weight: 700; }
.cho { padding: 12px; border-radius: 16px; background: var(--c-surface); border: 2px solid var(--c-line); display: grid; gap: 8px; }
.cho-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cho-n { width: 28px; height: 28px; border-radius: 50%; background: var(--c-brand); color: var(--c-brand-ink); display: grid; place-items: center; font-weight: 800; border: 2px solid var(--c-outline); }
.cho-to { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 800; font-size: .88rem; color: var(--c-muted); }
.cho-to select { width: auto !important; flex: 1 1 200px; min-height: 40px !important; padding: 6px 10px !important; }
.cho details summary { cursor: pointer; font-weight: 800; font-size: .85rem; color: var(--c-brand-text); padding: 2px 0; }
.cho-more { display: grid; gap: 10px; padding: 10px 0 2px; }
.cho-more label.ui-field > span { font-size: .82rem; }
.eff { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.eff select, .eff input { width: auto !important; min-height: 36px !important; padding: 5px 8px !important; flex: 1 1 90px; }
.sc-tail { display: grid; gap: 12px; margin-top: 14px; }
.sc-tail .ui-card { padding: 14px 16px; display: grid; gap: 8px; }
.sc-tail select, .sc-tail input { min-height: 40px !important; padding: 6px 10px !important; }
.sc-ending { background: color-mix(in srgb, var(--k) 14%, var(--c-surface)); border: 2.5px solid var(--c-outline); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; box-shadow: 0 4px 0 var(--c-outline); }
/* cast, pictures, variables */
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.cast-head { display: flex; gap: 10px; align-items: center; }
.cast-head input[type=color] { width: 44px; height: 44px; padding: 2px; border-radius: 12px; border: 2px solid var(--c-outline); background: var(--c-surface); cursor: pointer; flex: none; }
.cast-head input[type=text] { font-weight: 800; font-size: 1.1rem; }
.poses { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.pose { display: grid; gap: 4px; position: relative; }
.pose button.pv { padding: 0; border: 2px solid var(--c-line); border-radius: 12px; background: var(--c-surface-2); cursor: pointer; overflow: hidden; }
.pose button.pv:hover { border-color: var(--c-brand); }
.pose input { min-height: 32px !important; padding: 4px 8px !important; font-size: .82rem !important; }
.pose .x { position: absolute; top: 4px; right: 4px; width: 26px !important; min-height: 26px !important; background: var(--c-surface) !important; box-shadow: none; border-width: 2px; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pic { display: grid; gap: 6px; padding: 10px; }
.pic input, .pic select { min-height: 34px !important; padding: 4px 8px !important; font-size: .85rem !important; }
.plan-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; }
.meter { height: 10px; border-radius: 99px; background: var(--c-surface-2); overflow: hidden; width: 160px; border: 2px solid var(--c-outline); }
.meter i { display: block; height: 100%; background: var(--c-accent); }
.vars { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.vars th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); padding: 0 8px; }
.vars td { background: var(--c-surface); padding: 8px; border-top: 2px solid var(--c-line); border-bottom: 2px solid var(--c-line); vertical-align: middle; }
/* design-ok: side-tab (the outline of a table row drawn as a card on phones) */
.vars td:first-child { border-left: 2px solid var(--c-line); border-radius: 14px 0 0 14px; }
/* design-ok: side-tab */
.vars td:last-child { border-right: 2px solid var(--c-line); border-radius: 0 14px 14px 0; }
.vars input, .vars select { min-height: 38px !important; padding: 5px 9px !important; }
.vars select[data-vartype] { min-width: 120px; }
.vars code { font-family: ui-monospace, Consolas, monospace; }
.cheat { font-size: .9rem; }
.cheat code { overflow-wrap: anywhere; background: var(--c-surface-2); padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; }
.cheat li { margin-bottom: 6px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.vars-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.tb-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tb-opts label { cursor: pointer; }
.tb-opts input { position: absolute; opacity: 0; }
.tb-opts span { display: grid; gap: 6px; justify-items: center; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--c-line); font-weight: 800; font-size: .8rem; }
.tb-opts input:checked + span { border-color: var(--c-outline); background: var(--c-brand-soft); box-shadow: 0 3px 0 var(--c-outline); }
.tb-opts i { width: 100%; height: 26px; border-radius: 8px; display: block; }
.tb-sakura i { background: #fff; border: 3px solid #2a2238; } .tb-midnight i { background: #12143a; border: 1px solid #8fe3df; }
.tb-paper i { background: #fbf3e3; border: 2px solid #3b2a1e; border-radius: 3px !important; box-shadow: 3px 3px 0 #3b2a1e; } .tb-pixel i { background: #1c1630; border: 3px solid #f4f1ff; border-radius: 0 !important; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--c-outline); cursor: pointer; }
.swatches input[type=color] { width: 40px; height: 34px; padding: 1px; border-radius: 10px; border: 2px solid var(--c-outline); }
.or-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.or-opts i { display: inline-block; flex: none; border: 2.5px solid currentColor; border-radius: 5px; }
.danger-zone { border-color: var(--c-bad) !important; }
@media (max-width: 1240px) { .wr { grid-template-columns: 220px minmax(0, 1fr); } .wr-prev { display: none; } }
@media (max-width: 900px) {
  .ed { padding: 10px 12px 90px; }
  .mp { grid-template-columns: 1fr; }
  .mp-canvas { height: 58vh; }
  .wr { grid-template-columns: 1fr; }
  .wr-list { display: none; }
  .wr-mobile { display: flex; gap: 8px; margin-bottom: 12px; }
  .wr-mobile select { flex: 1; }
  .st { grid-template-columns: 1fr; gap: 6px; }
  .st-k { padding-top: 0; }
  .st-m { flex-direction: row; justify-content: flex-end; order: -1; position: absolute; right: 8px; top: 6px; }
  .st { position: relative; }
  .set-grid, .vars-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-acts .lbl { display: none; }
  .tb-opts { grid-template-columns: repeat(2, 1fr); }
  .vars thead { display: none; }
  .vars tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--c-surface); border: 2px solid var(--c-line); border-radius: 14px; padding: 8px; margin-bottom: 8px; }
  .vars td { border: 0 !important; padding: 0; background: none; border-radius: 0 !important; }
  .vars td.note { grid-column: 1 / -1; }
}

/* ===== landing ===== */
.page-landing .ui-main { overflow-x: clip; }
/* "The object itself" hero: the hero IS a visual novel scene. The sakura park fills the width, Mira stands in it, the pitch is
   her dialogue box, and the two buttons are the story's choices. Petals drift; the story map peeks in the corner. */
.lp-hero { position: relative; min-height: 640px; display: flex; align-items: flex-end; padding: 40px 0 34px; overflow: hidden; background: #1a1424; border-bottom: 3px solid var(--c-outline); }
.lp-hero > .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
html.ui-dark .lp-hero > .bg { filter: brightness(.62) saturate(.9); }
.lp-hero > .sp { position: absolute; right: 9%; bottom: 0; height: 94%; animation: lp-bob 4s ease-in-out infinite; }
@keyframes lp-bob { 50% { transform: translateY(-6px); } }
.lp-petal { position: absolute; z-index: 1; width: 18px; height: 12px; border-radius: 70% 0; background: #ffb3cc; opacity: .85; animation: lp-drift 9s linear infinite; pointer-events: none; }
@keyframes lp-drift { from { transform: translate(0, -40px) rotate(0); } to { transform: translate(-160px, 760px) rotate(600deg); } }
.lp-hero .ui-wrap { position: relative; z-index: 2; width: 100%; padding-top: 0; padding-bottom: 0; }
.lp-vnbox { position: relative; max-width: 760px; background: #fff; color: #2a2238; border: 3px solid #2a2238; border-radius: 24px; padding: 30px 30px 22px; box-shadow: 0 6px 0 #2a2238, 0 30px 60px rgba(42, 34, 56, .3); }
html.ui-dark .lp-vnbox { background: #241c31; color: #f4eefb; border-color: #0e0a14; box-shadow: 0 6px 0 #0e0a14, 0 30px 60px rgba(0, 0, 0, .4); }
.lp-vnbox .who { position: absolute; top: -18px; left: 22px; background: #ff4f8b; color: #2a2238; border: 3px solid #2a2238; border-radius: 99px; padding: 4px 16px; font: 800 .95rem/1.2 var(--font-body); }
.lp-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.04; margin: 6px 0 12px; color: inherit; }
.lp-hero h1 em { font-style: normal; color: var(--c-brand-text); position: relative; white-space: nowrap; }
html.ui-dark .lp-hero h1 em { color: #ff8fb3; }
.lp-hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .22em; background: var(--c-accent); opacity: .45; border-radius: 99px; z-index: -1; }
.lp-lead { font-size: 1.04rem; opacity: .8; max-width: 38em; margin-bottom: 18px; }
.lp-lead::after { content: "▼"; display: inline-block; margin-left: 8px; font-size: .7rem; color: #ff4f8b; animation: lp-next 1s ease-in-out infinite; }
@keyframes lp-next { 50% { transform: translateY(3px); } }
.lp-cta { display: grid; gap: 10px; max-width: 460px; }
.lp-cta .ui-btn { justify-content: flex-start; gap: 10px; }
.lp-cta .ui-btn .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #ff4f8b; color: #2a2238; border: 2px solid #2a2238; display: grid; place-items: center; font: 800 .75rem/1 var(--font-body); }
.lp-proof { margin-top: 16px; display: flex; gap: 16px; flex-wrap: wrap; opacity: .8; font-size: .88rem; font-weight: 700; }
.lp-proof span { display: inline-flex; gap: 6px; align-items: center; }
.lp-proof .ui-ic { color: var(--c-good); }
.lp-map { position: absolute; z-index: 2; right: 3%; top: 26px; width: 220px; background: var(--c-surface); border: 2.5px solid var(--c-outline); border-radius: 22px; box-shadow: 0 6px 0 var(--c-outline); padding: 12px; transform: rotate(3deg); }
.lp-map svg { width: 100%; height: auto; display: block; }
.lp-map .t { font: 800 .74rem var(--font-body); color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px 4px; }
.lp-section { padding: 52px 0; }
.lp-section .ui-wrap { padding-top: 0; padding-bottom: 0; }
.lp-head { text-align: center; max-width: 660px; margin: 0 auto 32px; }
.lp-head p { color: var(--c-muted); font-size: 1.08rem; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.lp-step { position: relative; padding-top: 62px; }
.lp-step::before { counter-increment: s; content: counter(s); position: absolute; top: 18px; left: 22px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c-brand); color: var(--c-brand-ink); font: 800 1rem/1 var(--font-display); border: 2.5px solid var(--c-outline); }
.lp-feature .ui-ic { width: 28px; height: 28px; color: var(--c-brand-text); margin-bottom: 10px; }
.lp-feature:nth-child(3n+2) .ui-ic { color: var(--c-accent); }
.lp-feats { grid-template-columns: repeat(3, 1fr); }
.lp-feature h3 { margin-bottom: 6px; }
.lp-feature p { color: var(--c-muted); margin: 0; }
.lp-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lp-faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.lp-faq details { background: var(--c-surface); border: 2px solid var(--c-line); border-radius: var(--radius); padding: 4px 20px; }
.lp-faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--c-brand-text); font-size: 1.3rem; line-height: 1; }
.lp-faq details[open] summary::after { content: "–"; }
.lp-faq details p { color: var(--c-muted); margin: 0 0 16px; }
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lp-two .ui-card { padding: 28px; }
.lp-two ul { padding-left: 0; list-style: none; display: grid; gap: 8px; margin: 12px 0 18px; }
.lp-two li { display: flex; gap: 8px; } .lp-two li .ui-ic { color: var(--c-good); margin-top: 3px; }
.lp-band { background: var(--c-ink); color: var(--c-bg); border-radius: calc(var(--radius) + 8px); padding: 44px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 2.5px solid var(--c-outline); box-shadow: 0 6px 0 var(--c-brand); }
.lp-band h2 { color: var(--c-bg); margin: 0 0 6px; }
.lp-band p { margin: 0; opacity: .8; }
@media (max-width: 900px) {
  .lp-hero { padding-top: 30px; }
  .lp-hero { min-height: 0; display: block; padding: 300px 0 24px; }
  .lp-hero > .bg { height: 380px; }
  .lp-hero > .sp { height: 330px; bottom: auto; top: 40px; right: 4%; }
  .lp-map { display: none; }
  .lp-vnbox { padding: 26px 18px 18px; }
  .lp-cta { max-width: none; }
  .lp-steps, .lp-two, .lp-feats { grid-template-columns: 1fr; }
  .lp-shelf { grid-template-columns: repeat(2, 1fr); }
  .lp-band { padding: 30px 22px; }
  .lp-section { padding: 38px 0; }
}
@media (prefers-reduced-motion: reduce) { .lp-petal, .lp-hero > .sp, .lp-lead::after { animation: none; } }
/* 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); }
.ytf .ytf-cover:focus-visible .ytf-play { transform: translate(-50%, -50%) scale(1.08); }
@media (hover: hover) and (pointer: fine) { .ytf .ytf-cover:hover .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; } }

/* ===== discover ===== */
.dc-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.dc-head h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.dc-search { display: flex; gap: 8px; flex: 1; max-width: 460px; min-width: 240px; }
.dc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 14px; scrollbar-width: none; }
.dc-chips button { flex: none; font: 800 .88rem/1 var(--font-body); padding: 9px 14px; border-radius: 99px; border: 2px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); cursor: pointer; }
.dc-chips button.on { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }
.dc-chips button small { opacity: .6; margin-left: 4px; }
.dc-feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-bottom: 30px; }
.dc-f { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px; text-decoration: none; color: inherit !important; background: linear-gradient(135deg, var(--c-brand-soft), var(--c-surface)); border-color: var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .dc-f:hover { transform: translateY(-3px); } }
.dc-f h3 { margin: 4px 0 6px; font-size: 1.25rem; }
.dc-f p { margin: 0; font-size: .92rem; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px 16px; }
.dc-card { text-decoration: none; color: inherit !important; display: grid; gap: 8px; align-content: start; }
.dc-card .nv-cover { transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .dc-card:hover .nv-cover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 7px 0 var(--c-outline); } }
.dc-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.2; }
.dc-by { font-size: .85rem; color: var(--c-muted); font-weight: 700; }
.dc-nums { display: flex; gap: 10px; font-size: .78rem; color: var(--c-muted); font-weight: 800; flex-wrap: wrap; }
.dc-nums span { display: inline-flex; gap: 3px; align-items: center; }
.dc-nums .ui-ic { width: 14px; height: 14px; }
.dc-sort { width: auto !important; }
.dc-cta { margin-top: 34px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 720px) { .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dc-f { grid-template-columns: 92px 1fr; } .dc-feat { grid-template-columns: 1fr; } }

/* ===== studio ===== */
.sd-hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; margin-bottom: 22px; }
.sd-hero h1 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.sd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.sd-stats .ui-card { padding: 14px 16px; }
.sd-stats b { display: block; font: 800 1.7rem/1.1 var(--font-display); }
.sd-stats span { font-size: .85rem; color: var(--c-muted); font-weight: 700; }
.sd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.sd-card { display: grid; grid-template-rows: auto 1fr; gap: 0; padding: 0; overflow: hidden; }
.sd-card .nv-cover { border: 0; box-shadow: none; border-radius: 0; aspect-ratio: 3 / 2; border-bottom: 2px solid var(--c-line); }
.sd-body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; }
.sd-body h3 { margin: 0; font-size: 1.15rem; }
.sd-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.sd-nums { font-size: .82rem; color: var(--c-muted); font-weight: 700; }
.sd-acts { display: flex; gap: 6px; flex-wrap: nowrap; margin-top: 4px; align-items: center; }
.sd-acts .ui-btn.icon { width: 34px; min-height: 34px; flex: none; }
.sd-acts .ui-btn.icon:first-of-type { margin-left: auto; }
.sd-acts .ui-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.sd-plan { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 28px; background: var(--c-accent-soft); border-color: var(--c-outline); box-shadow: 0 4px 0 var(--c-outline); }
.sd-plan p { margin: 4px 0 0; }
.sd-new { display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; border: 2.5px dashed var(--c-line); border-radius: var(--radius); min-height: 280px; cursor: pointer; background: transparent; color: var(--c-muted); font: 800 1rem var(--font-body); }
.sd-new:hover { border-color: var(--c-brand); color: var(--c-brand-text); background: var(--c-brand-soft); }
.sd-new .ui-ic { width: 40px; height: 40px; }
.tpl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl label { cursor: pointer; }
.tpl input { position: absolute; opacity: 0; }
.tpl span { display: grid; gap: 4px; padding: 14px; border: 2px solid var(--c-line); border-radius: 16px; height: 100%; }
.tpl b { font-size: 1rem; } .tpl small { color: var(--c-muted); }
.tpl input:checked + span { border-color: var(--c-outline); background: var(--c-brand-soft); box-shadow: 0 3px 0 var(--c-outline); }
.tpl input:focus-visible + span { outline: 3px solid var(--c-brand); }
@media (max-width: 720px) { .sd-stats { grid-template-columns: 1fr 1fr; } .sd-hero { grid-template-columns: 1fr; } .tpl { grid-template-columns: 1fr; } }

/* ===== play ===== */
.pl { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.pl-stage { height: min(calc(100vh - var(--header-h) - 40px), 880px); min-height: 420px; border-radius: 18px; }
.pl-stage.landscape { height: auto; aspect-ratio: 3 / 2; min-height: 0; max-height: calc(100vh - var(--header-h) - 40px); }
.pl-info { display: grid; gap: 14px; }
.pl-info h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 6px 0 4px; }
.pl-by { font-weight: 800; color: var(--c-muted); }
.pl-by small { display: block; font-weight: 600; }
.pl-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-liked { background: var(--c-brand) !important; }
.pl-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.pl-nums b { display: block; font: 800 1.3rem/1.1 var(--font-display); }
.pl-nums span { font-size: .78rem; color: var(--c-muted); font-weight: 700; }
.pl-ends { display: grid; gap: 8px; }
.pl-end { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: .9rem; font-weight: 700; }
.pl-bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--c-surface-2); overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: var(--k, var(--c-brand)); }
.pl-draft { background: var(--c-warn-soft); color: var(--c-warn); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.pl-more { margin-top: 30px; }
@media (max-width: 1000px) {
  .pl { grid-template-columns: minmax(0, 1fr); }
  .pl-stage { height: auto; aspect-ratio: 2 / 3; max-height: calc(100vh - var(--header-h) - 20px); min-height: 0; margin: 0 auto; width: 100%; max-width: calc((100vh - var(--header-h) - 20px) * 0.6667); }
  .pl-stage.landscape { aspect-ratio: 3 / 2; max-width: none; }
}
@media (max-width: 720px) { .page-play .ui-wrap { padding-left: 10px; padding-right: 10px; padding-top: 12px; } }

/* ===== pro ===== */
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; margin-top: 24px; }
.pr-card { display: grid; gap: 12px; align-content: start; padding: 26px; }
.pr-card.pro { background: linear-gradient(160deg, var(--c-brand-soft), var(--c-surface) 60%); border: 2.5px solid var(--c-outline); box-shadow: 0 6px 0 var(--c-outline); }
.pr-card h2 { margin: 0; }
.pr-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pr-card li { display: flex; gap: 10px; align-items: flex-start; }
.pr-card li .ui-ic { color: var(--c-good); margin-top: 3px; }
.pr-card .big { font: 800 2.2rem/1 var(--font-display); }
.pr-hero { text-align: center; max-width: 680px; margin: 0 auto; }
.pr-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
@media (max-width: 760px) { .pr-grid { grid-template-columns: 1fr; } }

/* ===== guide ===== */
.gd { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.gd-toc { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 4px; }
.gd-toc a { font-weight: 800; font-size: .92rem; text-decoration: none; color: var(--c-muted) !important; padding: 7px 12px; border-radius: 12px; }
.gd-toc a:hover { background: var(--c-surface-2); color: var(--c-ink) !important; }
.gd section { margin-bottom: 34px; scroll-margin-top: calc(var(--header-h) + 12px); }
.gd section > h2 { display: flex; gap: 10px; align-items: center; }
.gd section > h2 .ui-ic { width: 26px; height: 26px; color: var(--c-brand-text); }
.gd code { overflow-wrap: anywhere; background: var(--c-surface-2); padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.gd table { width: 100%; border-collapse: collapse; background: var(--c-surface); border-radius: 16px; overflow: hidden; border: 2px solid var(--c-line); font-size: .93rem; }
.gd th, .gd td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.gd th { background: var(--c-surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.gd .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gd .cards .ui-card h3 { display: flex; gap: 8px; align-items: center; font-size: 1.05rem; }
.gd .tw { overflow-x: auto; }
@media (max-width: 860px) { .gd { grid-template-columns: minmax(0, 1fr); } .gd-toc { position: static; display: flex; flex-wrap: wrap; } }

/* ===== 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; } }

/* ===== 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; }
}


/* =====================================================================================================
   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; }


/* ===== ImgNovella as native Forms: RepeatingPanel grids, Label roles, components ===== */
.anvil-label > .anvil-label-text { font: inherit; color: inherit; }
.ui .anvil-label { margin: 0; }
.anvil-component-icon:empty { display: none; }
.anvil-role-badge.anvil-role-badge-mint { background: var(--c-accent-soft); color: #127a75; }
html.ui-dark .anvil-role-badge.anvil-role-badge-mint { color: var(--c-accent); }
.anvil-role-badge.anvil-role-badge-brand { color: var(--c-brand-text); }
.anvil-role-badge { font-weight: 800; }

/* covers (Components/Cover draws NVT.coverHtml) */
.nv-cover-box { display: block; }
/* the player (Components/Player) fills the stage box; the editor (Components/Screen) fills the page */
.pl-stage > *, .pl-stage .nv-player-host, .pl-stage .nv-player { width: 100%; height: 100%; display: block; }
.nv-screen-host { display: block; }

/* landing */
.anvil-role-lp-shelf > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lp-more { text-align: center; margin-top: 20px; }
.ui h2.lp-two-h { margin-top: 10px; }
.ytf-link svg { vertical-align: -2px; margin-right: 6px; }
@media (max-width: 900px) { .anvil-role-lp-shelf > div { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* novel cards (Items/NovelCard, Items/FeaturedCard) */
.anvil-role-dc-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px 16px; }
.anvil-role-dc-feat > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-bottom: 30px; }
.dc-card-box, .dc-f-box { height: 100%; }
.dc-f { height: 100%; }
.anvil-role-dc-title { font: 800 1.05rem/1.2 var(--font-display); color: var(--c-ink); }
.anvil-role-dc-by { font-size: .85rem; color: var(--c-muted); font-weight: 700; }
.anvil-role-dc-f-title { font: 800 1.25rem/1.15 var(--font-display); color: var(--c-ink); margin: 6px 0 6px; }
.anvil-role-dc-f-blurb { font-size: .92rem; line-height: 1.5; color: var(--c-muted); display: -webkit-box !important; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-height: 4.5em; }
.dc-f-nums { margin-top: 10px; }
@media (max-width: 720px) {
  .anvil-role-dc-grid > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anvil-role-dc-feat > div { grid-template-columns: 1fr; }
}

/* discover */
.dc-lead { margin: 6px 0 0; }
.dc-search .anvil-role-btn { flex: none; }
.dc-search > :first-child, .dc-search input { flex: 1; min-width: 0; }
.anvil-role-dc-chips { position: relative; }
.anvil-role-dc-chips > div { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 14px; scrollbar-width: none; position: relative; }
.dc-chip-box { flex: none; }
.anvil-role-dc-chip > button { font: 800 .88rem/1 var(--font-body); padding: 10px 14px; min-height: 40px; border-radius: 99px; border: 2px solid var(--c-line); background: var(--c-surface);
  color: var(--c-ink); cursor: pointer; margin: 0; box-shadow: none; white-space: nowrap; }
.anvil-role-dc-chip.anvil-role-on > button { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }
.ui h2.dc-h2 { margin: 6px 0 14px; display: flex; gap: 8px; align-items: baseline; }
.dc-list-head { margin-bottom: 14px; }
.dc-list-head h2.dc-h2 { margin: 0; }
.anvil-role-dc-total { color: var(--c-muted); font-size: 1rem; font-family: var(--font-body); }
.anvil-role-dc-sort select { width: auto; }
.dc-cta h3 { margin: 0; }
.dc-cta p { margin: 4px 0 0; }

/* studio (Items/StudioCard) */
.sd-card-box { height: 100%; }
.sd-card { height: 100%; }
.anvil-role-sd-lead { color: var(--c-muted); margin: 6px 0 0; }
.anvil-role-sd-num { font: 800 1.7rem/1.1 var(--font-display); color: var(--c-ink); }
.anvil-role-sd-title { font: 800 1.15rem/1.2 var(--font-display); color: var(--c-ink); }
.anvil-role-sd-nums { font-size: .82rem; color: var(--c-muted); font-weight: 700; }
.anvil-role-sd-count { font-size: .875rem; font-weight: 600; }
.sd-acts .anvil-role-btn-icon:first-of-type { margin-left: auto; }
.sd-acts > :nth-child(3) { margin-left: auto; }
.sd-acts .anvil-role-btn-icon > button { width: 36px; min-height: 36px; }
.sd-acts .ui-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.sd-plan h3 { margin: 0; }
.sd-plan .anvil-role-fine-print { margin: 4px 0 0; }

/* new novel dialog: radio choices as cards */
.tpl .anvil-role-tpl-opt { display: block; }
.tpl .anvil-role-tpl-opt label { display: flex; gap: 10px; align-items: center; padding: 14px; border: 2px solid var(--c-line); border-radius: 16px; height: 100%; cursor: pointer;
  font-weight: 800; margin: 0; }
.tpl .anvil-role-tpl-opt label:has(input:checked) { border-color: var(--c-outline); background: var(--c-brand-soft); box-shadow: 0 3px 0 var(--c-outline); }
.tpl .anvil-role-tpl-opt input { margin: 0; accent-color: var(--c-brand); width: 18px; height: 18px; flex: none; }
.nv-dialog .ui-hint { margin-top: 8px; }

/* play */
.pl-wrap { max-width: 1320px; }
.anvil-role-pl-title { font: 800 clamp(1.6rem, 3vw, 2.1rem)/1.12 var(--font-display); color: var(--c-ink); margin: 6px 0 4px; }
.anvil-role-pl-bio { display: block; font-weight: 600; }
.anvil-role-pl-blurb { margin: 0; }
.anvil-role-pl-tags > div { display: flex; gap: 6px; flex-wrap: wrap; }
.anvil-role-pl-num { font: 800 1.3rem/1.1 var(--font-display); color: var(--c-ink); }
.anvil-role-pl-found { display: inline; color: var(--c-muted); font-size: .95rem; font-family: var(--font-body); }
.pl-ends h3 { margin: 0; }
.anvil-role-pl-ends-list > div { display: grid; gap: 8px; }
.anvil-role-pl-liked > button { background: var(--c-brand); }
.pl-tip { margin: 0; }
.pl-nums .anvil-label, .sd-stats .anvil-label { text-align: inherit !important; }
.pl-more .anvil-role-sec-title { margin-bottom: 14px; }

/* pro */
.pr-self { justify-self: start; }
.pr-hero p.muted { font-size: 1.1rem; }

/* admin additions */
.ad-users-head, .ad-user-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 90px 80px 70px 80px 80px; }
.anvil-role-ad-list > div { display: grid; gap: 10px; }
.ad-novel-cover { width: 56px; flex: none; }
.ad-novel-acts { margin-top: 8px; }
.ad-report-story { margin: 0 0 8px; }
.anvil-role-ad-msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.ad-filter { gap: 10px; }
@media (max-width: 720px) {
  .ad-user-row { grid-template-columns: 1fr 1fr; }
  .anvil-role-ad-joined { display: none; }
}

/* the editor's own dialogs and toasts (nv-kit.js) sit above Anvil's page */
.ui-modal-wrap { z-index: 1050; }

