/* app.css: Reelstuber's tokens (light + dark), the design kit, the shared pieces, the Sticker Pop skin, each page's
   styles (engine screens keep their old class names) and at the end the role layer for Anvil components. */

/* core.css: design tokens + the shared components. Restyle an app mostly by changing the tokens below
   (colours, fonts, radius, shadow); fonts are loaded in web/head.html. Light and dark are both required. */
/* Reelstuber "Sticker Pop": cream paper, hot pink + lime stickers, chunky ink outlines, hard offset shadows. */
:root {
  --c-bg: #FFF7EC;          /* page (cream paper) */
  --c-surface: #ffffff;     /* cards, menus, inputs */
  --c-surface-2: #FFEEDB;   /* subtle fills, hovers */
  --c-ink: #1A1033;         /* text */
  --c-muted: #5E5277;       /* secondary text */
  --c-faint: #6B6086;       /* hints, placeholders */
  --c-line: #EADBC6;        /* soft dividers */
  --c-outline: #1A1033;     /* sticker outlines */
  --c-pop: #1A1033;         /* hard offset shadows */
  --c-brand: #FF3D8B;       /* hot pink: primary buttons, focus */
  --c-brand-ink: #1A1033;   /* text on pink */
  --c-brand-soft: #FFE0EE;  /* pink tints */
  --c-link: #D01F69;        /* pink that reads as text */
  --c-accent: #C6F432;      /* lime */
  --c-accent-ink: #1A1033;
  --c-accent-soft: #F1FDCB;
  --c-violet: #7B5CFF;
  --c-good: #12804F; --c-good-soft: #DDF7E9;
  --c-warn: #A35D00; --c-warn-soft: #FFF0D6;
  --c-bad: #D12A3A;  --c-bad-soft: #FFE3E5;
  --c-on-status: #fff;    /* text on good/bad/warn fills */
  --radius: 20px; --radius-sm: 12px;
  --shadow: 4px 4px 0 var(--c-pop);
  --shadow-lg: 8px 8px 0 var(--c-pop);
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --maxw: 1180px;
  --header-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #150D24; --c-surface: #21163A; --c-surface-2: #2C1F4A; --c-ink: #FFF4FA; --c-muted: #C6B9DD; --c-faint: #A193BD;
    --c-line: #3A2B5C; --c-outline: #06030C; --c-pop: #06030C; --c-brand: #FF5CA0; --c-brand-ink: #1A1033; --c-brand-soft: #3D1A3A;
    --c-link: #FF7DB3; --c-accent: #D4FF4A; --c-accent-ink: #1A1033; --c-accent-soft: #2B3315; --c-violet: #9C85FF;
    --c-good: #5FE0A0; --c-good-soft: #123224; --c-warn: #FFC15C; --c-warn-soft: #33250E; --c-bad: #FF8A93; --c-bad-soft: #3A1620; --c-on-status: #150D24;
    --shadow: 4px 4px 0 var(--c-pop); --shadow-lg: 8px 8px 0 var(--c-pop); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #150D24; --c-surface: #21163A; --c-surface-2: #2C1F4A; --c-ink: #FFF4FA; --c-muted: #C6B9DD; --c-faint: #A193BD;
  --c-line: #3A2B5C; --c-outline: #06030C; --c-pop: #06030C; --c-brand: #FF5CA0; --c-brand-ink: #1A1033; --c-brand-soft: #3D1A3A;
  --c-link: #FF7DB3; --c-accent: #D4FF4A; --c-accent-ink: #1A1033; --c-accent-soft: #2B3315; --c-violet: #9C85FF;
  --c-good: #5FE0A0; --c-good-soft: #123224; --c-warn: #FFC15C; --c-warn-soft: #33250E; --c-bad: #FF8A93; --c-bad-soft: #3A1620; --c-on-status: #150D24;
  --shadow: 4px 4px 0 var(--c-pop); --shadow-lg: 8px 8px 0 var(--c-pop); 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; }
}



/* ===================================================================== Sticker Pop (Reelstuber's look) */
.ui a { color: var(--c-link); }
.ui h1, .ui h2, .ui h3, .ui h4 { font-weight: 800; letter-spacing: -.025em; }
.ui h1 { font-size: clamp(2.1rem, 4.8vw, 3.3rem); }
.ui-card { border: 2px solid var(--c-outline); box-shadow: var(--shadow); }
.ui-card.flat { box-shadow: none; }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { border: 2px solid var(--c-outline); border-radius: 14px; box-shadow: 3px 3px 0 var(--c-pop); font-weight: 700;
  transition: transform .1s, box-shadow .1s, background .15s, opacity .15s; }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):hover { border-color: var(--c-outline); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--c-pop); }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-pop); }
: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; }
:is(.ui-btn.lime, .anvil-role-btn.anvil-role-btn-lime > button, a.anvil-role-btn.anvil-role-btn-lime) { background: var(--c-accent); color: var(--c-accent-ink); }
:is(.ui-btn.dark, .anvil-role-btn.anvil-role-btn-dark > button, a.anvil-role-btn.anvil-role-btn-dark) { background: var(--c-ink); color: var(--c-bg); }
: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.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) { border-color: var(--c-outline); }
:is(.ui-btn.sm, .anvil-role-btn.anvil-role-btn-sm > button, a.anvil-role-btn.anvil-role-btn-sm) { border-radius: 11px; box-shadow: 2px 2px 0 var(--c-pop); }
:is(.ui-btn.sm, .anvil-role-btn.anvil-role-btn-sm > button, a.anvil-role-btn.anvil-role-btn-sm):hover { box-shadow: 3px 3px 0 var(--c-pop); }
: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: 3px 3px 0 var(--c-pop); }
.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 {
  border: 2px solid var(--c-outline); border-radius: var(--radius-sm); }
.ui input:focus, .ui select:focus, .ui textarea:focus { border-color: var(--c-outline); box-shadow: 3px 3px 0 var(--c-brand); }
.ui :focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; }
.ui-check input { accent-color: var(--c-brand); }
.ui-note { background: var(--c-accent-soft); border: 2px solid var(--c-outline); }
.ui-error { border: 2px solid var(--c-bad); }
.ui-choice span { border: 2px solid var(--c-outline); }
.ui-choice input:checked + span { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-outline); box-shadow: 2px 2px 0 var(--c-pop); }
.ui-badge { border: 1.5px solid var(--c-outline); background: var(--c-surface); color: var(--c-ink); font-weight: 700; }
.ui-badge.brand { background: var(--c-brand); color: var(--c-brand-ink); }
.ui-badge.lime { background: var(--c-accent); color: var(--c-accent-ink); }
.ui-badge.good { background: var(--c-good-soft); color: var(--c-good); border-color: currentColor; }
.ui-badge.warn { background: var(--c-warn-soft); color: var(--c-warn); border-color: currentColor; }
.ui-badge.bad { background: var(--c-bad-soft); color: var(--c-bad); border-color: currentColor; }
.ui-seg { border: 2px solid var(--c-outline); background: var(--c-surface); padding: 3px; }
.ui-seg button { font-weight: 700; color: var(--c-muted); }
.ui-seg button.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: none; }
.ui-tabs { border-bottom: 2px solid var(--c-outline); }
.ui-tabs a, .ui-tabs button { font-weight: 700; margin-bottom: -2px; border-bottom-width: 4px; }
.ui-tabs .on { border-bottom-color: var(--c-brand); }
.ui-empty { border: 2px dashed var(--c-faint); background: color-mix(in srgb, var(--c-surface) 60%, transparent); }
.ui-empty :is(.ui-ic, .ic) { color: var(--c-brand); }
.ui-avatar { background: var(--c-accent); color: var(--c-accent-ink); border: 2px solid var(--c-outline); }
.ui-item { border: 2px solid var(--c-outline); }
.ui-skel { border: 2px solid var(--c-line); }
.ui-header { background: var(--c-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 2px solid var(--c-outline); }
.ui-brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; }
.ui-brand img { border-radius: 0; width: 36px; height: 36px; }
.ui .ui-nav a { font-weight: 700; border: 2px solid transparent; color: var(--c-muted); }
.ui .ui-nav a:hover { color: var(--c-ink); }
.ui .ui-footer-links a { color: var(--c-muted); }
.ui .ui-footer-links a:hover { color: var(--c-ink); }
.ui .ui-nav a.on { color: var(--c-accent-ink); background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-outline); }
.ui-avatar-btn { background: var(--c-brand); color: var(--c-brand-ink); border: 2px solid var(--c-outline); box-shadow: 2px 2px 0 var(--c-pop); font-weight: 800; }
.ui-menu { border: 2px solid var(--c-outline); box-shadow: var(--shadow-lg); }
.ui-footer { border-top: 2px solid var(--c-outline); background: var(--c-surface-2); }
.ui-toast { border: 2px solid var(--c-outline); box-shadow: 4px 4px 0 var(--c-pop); font-weight: 700; }
.ui-toast.ok { background: var(--c-accent); color: var(--c-accent-ink); }
.ui-modal { border: 2px solid var(--c-outline); box-shadow: var(--shadow-lg); }
.ui-modal-wrap { background: rgba(26, 16, 51, .55); }
.ui-stat b { font-weight: 800; }
input[type=range] { accent-color: var(--c-brand); }
input[type=color] { width: 44px; height: 40px; padding: 2px; border: 2px solid var(--c-outline); border-radius: 10px; background: var(--c-surface); cursor: pointer; }
@media (max-width: 720px) {
  .ui-shell .ui-tabbar:not(:empty) { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; background: var(--c-surface);
    border-top: 2px solid var(--c-outline); 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: 700 .75rem/1 var(--font-body); }
  .ui-tabbar a :is(.ui-ic, .ic) { width: 22px; height: 22px; }
  .ui-tabbar a.on { color: var(--c-ink); background: var(--c-accent); }
  .ui-shell:has(.ui-tabbar:not(:empty)) .ui-footer { padding-bottom: 72px; }
}


/* ===== a_core ===== */
.rs-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }
.rs-sticker { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 2px solid var(--c-outline); border-radius: 999px;
  background: var(--c-accent); color: var(--c-accent-ink); font: 800 .8rem/1.1 var(--font-body); box-shadow: 2px 2px 0 var(--c-pop); transform: rotate(-3deg); white-space: nowrap; }
.rs-sticker.pink { background: var(--c-brand); color: var(--c-brand-ink); transform: rotate(2deg); }
.rs-sticker.violet { background: var(--c-violet); color: #fff; }
.rs-sticker.plain { background: var(--c-surface); color: var(--c-ink); }
.rs-lock { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; color: var(--c-muted); font-weight: 600; }
.rs-lock :is(.ui-ic, .ic) { color: var(--c-good); }
.rs-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; font-weight: 600; font-size: .95rem; }
.rs-switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 999px; border: 2px solid var(--c-outline); background: var(--c-surface-2);
  position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.rs-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-ink); transition: transform .15s; }
.rs-switch input:checked { background: var(--c-accent); }
.rs-switch input:checked::after { transform: translateX(20px); }
.rs-switch small { display: block; font-weight: 400; color: var(--c-muted); font-size: .82rem; }
.rs-range { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
.rs-range > span { display: flex; justify-content: space-between; }
.rs-range > span b { font-weight: 700; color: var(--c-muted); font-size: .85rem; }
.rs-range input { width: 100%; }
.rs-progress { height: 14px; border: 2px solid var(--c-outline); border-radius: 999px; background: var(--c-surface); overflow: hidden; }
/* design-ok: side-tab (the bar's moving edge) */
.rs-progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--c-brand) 0 10px, color-mix(in srgb, var(--c-brand) 75%, #fff) 10px 20px);
  border-right: 2px solid var(--c-outline); transition: width .25s; animation: rs-stripes 1s linear infinite; background-size: 28px 28px; }
@keyframes rs-stripes { to { background-position: 28px 0; } }
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-chip { font: 700 .85rem/1 var(--font-body); padding: 9px 12px; border-radius: 999px; border: 2px solid var(--c-outline); background: var(--c-surface); color: var(--c-ink); cursor: pointer; }
.rs-chip.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 2px 2px 0 var(--c-pop); }
.rs-chip:disabled { opacity: .45; cursor: not-allowed; }


/* ===== landing ===== */
.page-landing .ui-main { overflow-x: clip; }
.lp-hero { position: relative; padding: 56px 0 30px; }
.lp-hero .ui-wrap { position: relative; z-index: 1; padding-top: 0; padding-bottom: 0; }
/* Before/after hero: a centred pitch, then one stage to drag across: the long video and its timeline on the left,
   the three reels it becomes on the right (both drawn by the app's own renderer). */
.lp-pitch { text-align: center; max-width: 860px; margin: 0 auto; }
.lp-pitch .lp-lead { margin: 0 auto 24px; }
.lp-pitch .lp-cta, .lp-pitch .lp-proof { justify-content: center; }
.lp-hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); line-height: .98; margin: 12px 0 18px; letter-spacing: -.03em; }
.lp-hero h1 em { font-style: normal; background: var(--c-accent); color: var(--c-accent-ink); padding: 0 .14em; border: 3px solid var(--c-outline); border-radius: 14px;
  box-shadow: 5px 5px 0 var(--c-pop); display: inline-block; transform: rotate(-2deg); margin: 6px 0; }
.lp-lead { font-size: 1.2rem; color: var(--c-muted); max-width: 33em; margin-bottom: 26px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-proof { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.lp-ba { --x: 50%; position: relative; margin: 36px auto 0; max-width: 1040px; height: 440px; border-radius: 22px; overflow: hidden; border: 3px solid var(--c-outline); box-shadow: var(--shadow-lg);
  user-select: none; background: var(--c-surface); }
.lp-ba .side { position: absolute; inset: 0; }
.lp-long { display: flex; flex-direction: column; padding: 14px; gap: 10px; background: var(--c-surface); }
.lp-long img { display: block; width: 100%; flex: 1; min-height: 0; border-radius: 12px; object-fit: cover; border: 2px solid var(--c-outline); }
.lp-long .tl { position: relative; height: 26px; border-radius: 8px; background: var(--c-surface-2); border: 2px solid var(--c-outline); overflow: hidden; }
/* design-ok: side-tab (clip markers on a timeline) */
.lp-long .tl i { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--c-outline); border-right: 2px solid var(--c-outline); }
.lp-long .tl b { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--c-ink); animation: lp-play 9s linear infinite; }
@keyframes lp-play { from { left: 0; } to { left: 100%; } }
.lp-long .len { position: absolute; left: 26px; bottom: 54px; font: 800 .8rem/1 var(--font-body); background: rgba(11, 7, 22, .8); color: #fff; padding: 6px 9px; border-radius: 8px; }
.lp-cuts { background: #0B0716; clip-path: inset(0 0 0 var(--x)); display: flex; gap: 22px; align-items: center; justify-content: center; padding-left: 20%; }
.lp-reel { padding: 7px; border: 3px solid var(--c-outline); border-radius: 22px; background: #0B0716; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); animation: lp-float 4s ease-in-out infinite; }
.lp-reel canvas { display: block; width: 150px; height: auto; border-radius: 15px; }
.lp-reel:nth-child(2) { animation-delay: -1.3s; transform: rotate(2deg); } .lp-reel:nth-child(3) { animation-delay: -2.6s; transform: rotate(-2deg); }
@keyframes lp-float { 50% { translate: 0 -8px; } }
.lp-ba .lbl { position: absolute; top: 14px; z-index: 3; font: 800 .78rem/1 var(--font-body); padding: 7px 10px; border-radius: 9px; border: 2px solid var(--c-outline); }
.lp-ba .lbl.l { left: 14px; background: var(--c-surface); color: var(--c-ink); }
.lp-ba .lbl.r { right: 14px; background: var(--c-accent); color: var(--c-accent-ink); }
.lp-ba .handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 4px; margin-left: -2px; background: var(--c-accent); z-index: 4; pointer-events: none; box-shadow: 0 0 0 2px var(--c-outline); }
.lp-ba .handle::after { content: "\2702"; position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--c-accent); color: var(--c-accent-ink);
  border: 3px solid var(--c-outline); display: grid; place-items: center; font: 800 1.4rem/1 var(--font-body); box-shadow: 4px 4px 0 var(--c-pop); }
.lp-ba input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 5; }
.lp-ba input:focus-visible ~ .handle::after { outline: 3px solid var(--c-ink); outline-offset: 3px; }
.lp-section { padding: 56px 0; }
.lp-section .ui-wrap { padding-top: 0; padding-bottom: 0; }
.lp-head { text-align: center; max-width: 660px; margin: 0 auto 34px; }
.lp-head p { color: var(--c-muted); font-size: 1.08rem; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.lp-step { position: relative; padding-top: 62px; }
.lp-step:nth-child(1) { transform: rotate(-1deg); } .lp-step:nth-child(3) { transform: rotate(1deg); }
.lp-step::before { counter-increment: s; content: counter(s); position: absolute; top: 16px; left: 20px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--c-outline);
  display: grid; place-items: center; background: var(--c-brand); color: var(--c-brand-ink); font: 800 1rem/1 var(--font-display); }
.lp-step .em { position: absolute; top: 14px; right: 18px; font-size: 1.8rem; }
.lp-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .lp-features { grid-template-columns: 1fr; } }
.lp-feature h3 { margin-bottom: 6px; }
.lp-feature p { color: var(--c-muted); margin: 0; }
.lp-strip { background: var(--c-ink); color: var(--c-bg); border-top: 2px solid var(--c-outline); border-bottom: 2px solid var(--c-outline); padding: 14px 0; overflow: hidden; white-space: nowrap; }
.lp-strip div { display: inline-block; animation: lp-marq 30s linear infinite; font: 800 1.2rem/1 var(--font-display); letter-spacing: -.01em; }
.lp-strip span { margin: 0 18px; color: var(--c-accent); }
@keyframes lp-marq { to { transform: translateX(-50%); } }
.lp-faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.lp-faq details { background: var(--c-surface); border: 2px solid var(--c-outline); border-radius: var(--radius); padding: 4px 20px; }
.lp-faq details[open] { box-shadow: var(--shadow); }
.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-link); font-size: 1.4rem; line-height: 1; }
.lp-faq details[open] summary::after { content: "–"; }
.lp-faq details p { color: var(--c-muted); margin: 0 0 16px; }
.lp-band { background: var(--c-brand); color: var(--c-brand-ink); border: 3px solid var(--c-outline); box-shadow: var(--shadow-lg); border-radius: 28px; padding: 44px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; transform: rotate(-.6deg); }
.ui .lp-band h2 { color: var(--c-brand-ink); margin: 0 0 6px; font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.lp-band p { margin: 0; font-weight: 600; }
@media (max-width: 900px) {
  .lp-hero { padding-top: 30px; }
  .lp-ba { height: 380px; }
  .lp-cuts { gap: 10px; padding-left: 30%; }
  .lp-reel canvas { width: 120px; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-band { padding: 30px 22px; }
  .lp-section { padding: 40px 0; }
}
@media (max-width: 480px) {
  .lp-ba { height: 320px; --x: 34%; }
  .lp-reel:nth-child(3) { display: none; }
  .lp-reel canvas { width: 104px; }
}
@media (prefers-reduced-motion: reduce) { .lp-reel, .lp-strip div, .lp-long .tl b { 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 .4s ease, filter .3s; }
.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 .2s; }
.ytf .ytf-cover:hover .ytf-play, .ytf .ytf-cover:focus-visible .ytf-play { transform: translate(-50%, -50%) scale(1.08); }
.ytf .ytf-cover:focus-visible { outline: 3px solid var(--c-brand); outline-offset: -3px; }
.ytf .ytf-len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.3; padding: 3px 7px; border-radius: 5px; }
.ytf .ytf-note { font-size: .8rem; color: var(--c-muted); margin: 10px 2px 0; }
@media (max-width: 800px) { .ytf .ytf-in { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
@media (max-width: 480px) { .ytf .ytf-play svg { width: 56px; height: 40px; } }


/* ===== home ===== */
.st-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.st-hero h1 { margin: 0; font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
.st-hero p { margin: 8px 0 0; color: var(--c-muted); font-size: 1.05rem; }
.st-drop { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 26px 28px; border: 3px dashed var(--c-outline);
  border-radius: 26px; background: var(--c-surface); cursor: pointer; transition: transform .12s, background .15s; overflow: hidden; }
.st-drop::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: var(--c-accent); opacity: .5; z-index: 0; }
.st-drop > * { position: relative; z-index: 1; }
.st-drop.over { background: var(--c-accent-soft); transform: scale(1.01); border-style: solid; }
.st-drop h2 { margin: 0 0 4px; font-size: 1.6rem; }
.st-drop p { margin: 0; color: var(--c-muted); }
.st-drop .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.st-under { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 4px 30px; }
.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.st-stat { padding: 16px 18px; border-radius: 20px; border: 2px solid var(--c-outline); box-shadow: var(--shadow); background: var(--c-surface); }
.st-stat:nth-child(1) { background: var(--c-accent); color: var(--c-accent-ink); transform: rotate(-1deg); }
.st-stat:nth-child(2) { background: var(--c-brand); color: var(--c-brand-ink); transform: rotate(1deg); }
.st-stat b { display: block; font: 800 2.1rem/1 var(--font-display); letter-spacing: -.03em; }
.st-stat span { font-weight: 700; font-size: .88rem; opacity: .85; }
.st-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.st-sec h2 { margin: 0; font-size: 1.5rem; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-bottom: 40px; }
.st-card { display: block; text-decoration: none; color: inherit !important; border: 2px solid var(--c-outline); border-radius: 20px; background: var(--c-surface);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .12s, box-shadow .12s; }
.st-card:hover { transform: translate(-2px, -2px) rotate(-.4deg); box-shadow: 6px 6px 0 var(--c-pop); }
.st-thumb { aspect-ratio: 16 / 9; background: var(--c-surface-2) center / cover; border-bottom: 2px solid var(--c-outline); position: relative; display: grid; place-items: center; }
.st-thumb.sample { background: linear-gradient(135deg, #8FD3FF, #FF8FC1); }
.st-thumb .pip { font-size: 3rem; filter: drop-shadow(3px 3px 0 #1A1033); }
.st-thumb :is(.ui-ic, .ic) { width: 40px; height: 40px; color: var(--c-faint); }
.st-thumb .rs-sticker { position: absolute; top: 10px; left: 10px; }
.st-thumb .len { position: absolute; right: 10px; bottom: 10px; background: var(--c-ink); color: var(--c-bg); font: 700 .78rem/1 var(--font-body); padding: 5px 8px; border-radius: 8px; }
.st-card .body { padding: 14px 16px 16px; }
.st-card h3 { margin: 0 0 6px; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.st-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.st-badge { text-align: center; padding: 16px 12px; border: 2px solid var(--c-outline); border-radius: 20px; background: var(--c-surface); }
.st-badge .em { font-size: 2.2rem; display: block; line-height: 1.1; margin-bottom: 6px; }
.st-badge b { display: block; font-family: var(--font-display); }
.st-badge small { color: var(--c-muted); }
.st-badge.got { background: var(--c-accent-soft); box-shadow: var(--shadow); transform: rotate(-1deg); }
.st-badge.got:nth-child(even) { transform: rotate(1.2deg); }
.st-badge:not(.got) { border-style: dashed; border-color: var(--c-faint); }
.st-badge:not(.got) .em { filter: grayscale(1); opacity: .35; }
.st-banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px;
  border: 2px solid var(--c-outline); border-radius: 18px; background: var(--c-accent-soft); box-shadow: var(--shadow); }
.st-banner p { margin: 0; font-weight: 600; }
.st-busy { text-align: center; }
.st-busy .em { font-size: 3rem; display: block; animation: st-bob 1s ease-in-out infinite; }
@keyframes st-bob { 50% { transform: translateY(-8px) rotate(6deg); } }
@media (max-width: 860px) {
  .st-drop { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 24px 18px; }
  .st-drop .btns { justify-content: center; }
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ===== templates ===== */
.tp-sec { margin: 6px 0 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tp-sec h2 { margin: 0; font-size: 1.45rem; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; margin-bottom: 38px; }
.tp-card { border: 2px solid var(--c-outline); border-radius: 22px; background: var(--c-surface); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s; }
.tp-card:hover { transform: rotate(-.8deg) translateY(-2px); }
.tp-card .pv { position: relative; background: #0B0716; padding: 12px 12px 0; display: grid; place-items: center; }
.tp-card .pv canvas { display: block; width: 100%; max-width: 150px; border-radius: 14px 14px 0 0; }
.tp-card .pv .rs-sticker { position: absolute; top: 10px; right: 10px; }
.tp-card .body { padding: 12px 14px 14px; display: grid; gap: 8px; flex: 1; align-content: start; border-top: 2px solid var(--c-outline); }
.tp-card h3 { margin: 0; font-size: 1.05rem; }
.tp-card .by { font-size: .82rem; color: var(--c-muted); }
.tp-card .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tp-tip { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border: 2px dashed var(--c-outline); border-radius: 18px; margin-bottom: 26px; background: var(--c-accent-soft); font-weight: 600; }


/* ===== brand ===== */
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.bk-prev { position: sticky; top: calc(var(--header-h) + 16px); text-align: center; }
.bk-prev .phone { display: inline-block; padding: 10px; border: 3px solid var(--c-outline); border-radius: 30px; background: #0B0716; box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.bk-prev canvas { display: block; border-radius: 20px; width: 240px; height: auto; }
.bk-form { display: grid; gap: 18px; }
.bk-form .ui-card h3 { display: flex; gap: 8px; align-items: center; }
.bk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.bk-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.bk-colors { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.bk-colors label { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; }
.bk-save { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; padding: 12px; border: 2px solid var(--c-outline); border-radius: 18px; background: var(--c-surface); box-shadow: var(--shadow); }
.bk-tpls { display: grid; gap: 10px; }
.bk-tpl { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--c-outline); border-radius: 14px; background: var(--c-surface); }
.bk-tpl .grow { flex: 1; min-width: 0; }
@media (max-width: 880px) { .bk-grid { grid-template-columns: 1fr; } .bk-prev { position: static; order: -1; } .bk-prev canvas { width: 200px; } }
@media (max-width: 480px) { .bk-two { grid-template-columns: 1fr; } .ui-shell:has(.ui-tabbar:not(:empty)) .bk-save { bottom: 76px; } }


/* ===== project ===== */
.pj-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.pj-head .grow { flex: 1; min-width: 220px; }
.pj-title { font: 800 clamp(1.4rem, 3vw, 2rem)/1.15 var(--font-display); letter-spacing: -.025em; border: 2px solid transparent !important; background: transparent !important;
  padding: 4px 8px !important; margin-left: -10px !important; min-height: 0 !important; box-shadow: none !important; width: 100%; color: var(--c-ink); }
.pj-title:hover, .pj-title:focus { border-color: var(--c-outline) !important; background: var(--c-surface) !important; }
.pj-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--c-muted); }
.pj-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.pj-stage { border: 2px solid var(--c-outline); border-radius: 22px; background: #000; overflow: hidden; box-shadow: var(--shadow); }
.pj-video { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.pj-video video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pj-video .big-play { position: absolute; width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--c-outline); background: var(--c-accent); color: var(--c-accent-ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 4px 4px 0 var(--c-pop); }
.pj-video .big-play :is(.ui-ic, .ic) { width: 30px; height: 30px; margin-left: 4px; }
.pj-video.playing .big-play { display: none; }
.pj-tl-wrap { background: var(--c-surface); border-top: 2px solid var(--c-outline); padding: 10px 12px 12px; }
.pj-tl { display: block; width: 100%; height: 104px; border-radius: 12px; cursor: pointer; touch-action: none; }
.pj-ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pj-time { font: 700 .92rem/1 var(--font-body); font-variant-numeric: tabular-nums; min-width: 98px; }
.pj-side { display: grid; gap: 18px; }
.pj-find h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pj-find .row { display: grid; gap: 6px; margin-bottom: 12px; }
.pj-find .row > span { font-weight: 700; font-size: .85rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; }
.pj-find .ui-seg { width: 100%; } .pj-find .ui-seg button { flex: 1; }
.pj-run { display: grid; gap: 8px; padding: 6px 0 2px; }
.pj-run b { font-family: var(--font-display); }
.pj-clips-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pj-clips-head h3 { margin: 0; }
.pj-clips { display: grid; gap: 12px; }
.pj-clip { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 10px; border: 2px solid var(--c-outline);
  border-radius: 18px; background: var(--c-surface); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.pj-clip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--c-pop); }
.pj-clip.sel { background: var(--c-accent-soft); box-shadow: var(--shadow); }
.pj-clip .th { width: 64px; aspect-ratio: 9 / 16; border-radius: 10px; border: 2px solid var(--c-outline); background: #222 center / cover; position: relative; }
.pj-clip .th b { position: absolute; left: -6px; top: -8px; background: var(--c-brand); color: var(--c-brand-ink); border: 2px solid var(--c-outline); border-radius: 999px;
  font: 800 .72rem/1 var(--font-body); padding: 4px 6px; }
.pj-clip h4 { margin: 0 0 3px; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-clip .meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--c-muted); }
.pj-clip .meta .ui-badge { font-size: .75rem; padding: 2px 7px; }
.pj-clip .acts { display: flex; gap: 6px; flex-direction: column; }
.pj-score { font: 800 .78rem/1 var(--font-body); background: var(--c-ink); color: var(--c-bg); padding: 3px 7px; border-radius: 999px; }
.pj-relink { text-align: center; padding: 34px 20px; border: 3px dashed var(--c-outline); border-radius: 22px; background: var(--c-surface); cursor: pointer; }
.pj-relink.over { background: var(--c-accent-soft); }
.pj-relink .em { font-size: 2.6rem; display: block; }
.pj-cap { font-size: .85rem; }
.pj-menu { position: relative; }
.pj-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 220px; background: var(--c-surface); border: 2px solid var(--c-outline);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.pj-pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer;
  font: 600 .9rem/1.2 var(--font-body); color: var(--c-ink); text-align: left; }
.pj-pop button:hover { background: var(--c-surface-2); }
.pj-pop button.danger { color: var(--c-bad); }
.pj-queue { display: grid; gap: 8px; max-height: 300px; overflow: auto; margin: 12px 0; }
.pj-queue .q { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--c-line); border-radius: 12px; }
.pj-queue .q.on { border-color: var(--c-outline); background: var(--c-accent-soft); }
.pj-queue .q .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pj-exp-canvas { display: block; margin: 10px auto; max-height: 300px; max-width: 100%; border: 2px solid var(--c-outline); border-radius: 14px; background: #000; }
@media (max-width: 960px) { .pj-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .pj-clip { grid-template-columns: 54px minmax(0, 1fr); }
  .pj-clip .th { width: 54px; }
  .pj-clip .acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .pj-tl { height: 92px; }
}


/* ===== clip ===== */
.page-clip .ui-footer { display: none; }
.ce-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.ce-head .grow { flex: 1; min-width: 180px; }
.ce-title { font: 800 1.45rem/1.15 var(--font-display) !important; letter-spacing: -.02em; border: 2px solid transparent !important; background: transparent !important;
  padding: 4px 8px !important; min-height: 0 !important; box-shadow: none !important; width: 100%; margin-left: -10px !important; color: var(--c-ink); }
.ce-title:hover, .ce-title:focus { border-color: var(--c-outline) !important; background: var(--c-surface) !important; }
.ce-saved { font: 700 .8rem/1 var(--font-body); color: var(--c-muted); min-width: 64px; }
.ce-grid { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 26px; align-items: start; }
.ce-left { position: sticky; top: calc(var(--header-h) + 14px); display: grid; gap: 14px; }
.ce-phone { position: relative; margin: 0 auto; padding: 12px; border: 3px solid var(--c-outline); border-radius: 34px; background: #0B0716; box-shadow: var(--shadow-lg); width: fit-content; max-width: 100%; }
.ce-phone canvas { display: block; border-radius: 22px; background: #000; touch-action: none; cursor: grab; max-width: 100%; height: auto; }
.ce-phone canvas.grab { cursor: grabbing; }
.ce-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); background: rgba(26,16,51,.85); color: #fff; font: 700 .75rem/1 var(--font-body);
  padding: 7px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; transition: opacity .3s; }
.ce-trans { display: flex; gap: 10px; align-items: center; }
.ce-trans input[type=range] { flex: 1; }
.ce-trans .t { font: 700 .85rem/1 var(--font-body); font-variant-numeric: tabular-nums; min-width: 82px; text-align: right; }
.ce-trim { padding: 14px; }
.ce-trim canvas { display: block; width: 100%; height: 64px; border-radius: 10px; touch-action: none; cursor: ew-resize; }
.ce-trim .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; font-size: .88rem; }
.ce-trim .nudge { display: inline-flex; align-items: center; gap: 4px; }
.ce-trim .nudge b { font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; }
.ce-tabs { position: sticky; top: var(--header-h); z-index: 5; background: var(--c-bg); padding-top: 4px; }
.ce-panel { display: grid; gap: 18px; }
.ce-sec h4 { margin: 0 0 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); font-family: var(--font-body); font-weight: 800; }
.ce-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.ce-look { border: 2px solid var(--c-outline); border-radius: 16px; background: var(--c-surface); padding: 6px 6px 8px; cursor: pointer; text-align: center; font: 700 .76rem/1.2 var(--font-body); color: var(--c-ink); }
.ce-look canvas { display: block; width: 100%; height: auto; border-radius: 10px; margin-bottom: 6px; }
.ce-look.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 3px 3px 0 var(--c-pop); transform: rotate(-1.5deg); }
.ce-layouts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ce-layout { border: 2px solid var(--c-outline); border-radius: 14px; background: var(--c-surface); padding: 10px 6px; cursor: pointer; text-align: center; font: 700 .78rem/1.2 var(--font-body); color: var(--c-ink); }
.ce-layout i { display: block; width: 26px; height: 44px; margin: 0 auto 6px; border: 2px solid currentColor; border-radius: 6px; position: relative; overflow: hidden; }
.ce-layout i::before { content: ""; position: absolute; background: var(--c-brand); }
.ce-layout[data-v=fill] i::before { inset: 0; }
.ce-layout[data-v=fit] i::before { left: 0; right: 0; top: 14px; height: 12px; } .ce-layout[data-v=fit] i { background: color-mix(in srgb, var(--c-brand) 30%, transparent); }
.ce-layout[data-v=framed] i::before { left: 3px; right: 3px; top: 14px; height: 11px; border-radius: 2px; outline: 2px solid currentColor; } .ce-layout[data-v=framed] i { background: var(--c-accent); }
.ce-layout[data-v=split] i::before { left: 0; right: 0; top: 0; height: 20px; border-bottom: 2px solid currentColor; } .ce-layout[data-v=split] i { background: var(--c-violet); }
.ce-layout[data-v=pip] i::before { left: 2px; top: 3px; width: 10px; height: 14px; border-radius: 2px; outline: 2px solid currentColor; background: var(--c-accent); } .ce-layout[data-v=pip] i { background: var(--c-brand); }
.ce-layout.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 3px 3px 0 var(--c-pop); }
.ce-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ce-grade { border: 2px solid var(--c-outline); border-radius: 14px; background: var(--c-surface); padding: 5px 5px 7px; cursor: pointer; font: 700 .74rem/1.2 var(--font-body); color: var(--c-ink); text-align: center; }
.ce-grade canvas { display: block; width: 100%; height: auto; border-radius: 9px; margin-bottom: 5px; background: #222; }
.ce-grade.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 3px 3px 0 var(--c-pop); transform: rotate(-1.5deg); }
.ce-words { display: flex; flex-wrap: wrap; gap: 5px; max-height: 168px; overflow: auto; padding: 2px; }
.ce-word { font: 600 .84rem/1 var(--font-body); padding: 7px 9px; border-radius: 10px; border: 2px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); cursor: pointer; }
.ce-word:hover { border-color: var(--c-outline); }
.ce-word.on { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-outline); }
.ce-word small { color: var(--c-muted); font-weight: 600; margin-left: 4px; font-size: .75rem; }
.ce-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ce-pop-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ce-pop-opts button { justify-content: flex-start; text-align: left; }
.sb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sb-table th { text-align: left; font: 800 .72rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); padding: 8px 6px; border-bottom: 2px solid var(--c-outline); }
.sb-table td { padding: 10px 6px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.sb-table td.n { font-weight: 800; color: var(--c-muted); width: 28px; }
.sb-table td.t { font-variant-numeric: tabular-nums; white-space: nowrap; width: 54px; }
.sb-table td.t button { font: 700 .82rem/1 var(--font-body); color: var(--c-link); background: none; border: 0; padding: 0; cursor: pointer; }
.sb-says { font-weight: 600; }
.sb-on { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sb-chip { display: inline-flex; gap: 4px; align-items: center; font: 700 .76rem/1.1 var(--font-body); padding: 5px 8px; border-radius: 999px; border: 2px solid var(--c-outline); background: var(--c-surface-2); color: var(--c-ink); }
.sb-chip.fx { background: var(--c-violet); color: #fff; }
.sb-chip.idea { border-style: dashed; background: var(--c-accent-soft); cursor: pointer; }
.sb-chip.idea.off { opacity: .45; text-decoration: line-through; }
.sb-on select.sb-add { width: auto !important; min-height: 0 !important; height: auto !important; font: 700 .76rem/1 var(--font-body) !important; padding: 6px 10px !important; border-radius: 999px !important;
  border: 2px dashed var(--c-faint) !important; background: transparent !important; color: var(--c-muted) !important; cursor: pointer; box-shadow: none !important; }
.sb-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font: 800 .9rem/1 var(--font-body); opacity: .7; }
.sb-x:hover { opacity: 1; color: var(--c-brand); }
.sb-wrap { max-height: 58vh; overflow: auto; margin: 10px 0; }
.sb-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .sb-table thead { display: none; }
  .sb-table, .sb-table tbody, .sb-table tr, .sb-table td { display: block; width: auto; }
  .sb-table tr { border-bottom: 2px solid var(--c-line); padding: 8px 0; }
  .sb-table td { border: 0; padding: 3px 0; }
  .sb-table td.n { display: none; }
}
.ce-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.ce-colors { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.ce-colors label { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; }
.ce-cues { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.ce-cue { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ce-cue button.t { font: 700 .78rem/1 var(--font-body); color: var(--c-link); background: none; border: 0; cursor: pointer; padding: 6px 0; text-align: left; font-variant-numeric: tabular-nums; }
.ce-cue input { min-height: 40px !important; padding: 7px 10px !important; }
.ce-cue.now input { box-shadow: 3px 3px 0 var(--c-accent) !important; }
.ce-callout { padding: 14px 16px; border: 2px dashed var(--c-outline); border-radius: 16px; background: var(--c-accent-soft); }
.ce-callout p { margin: 0 0 10px; font-weight: 600; }
.ce-post textarea { min-height: 150px; }
.ce-export { background: var(--c-brand-soft); }
.ce-exp-canvas { display: block; margin: 0 auto 12px; max-height: 340px; max-width: 100%; border: 2px solid var(--c-outline); border-radius: 16px; background: #000; }
.ce-done { text-align: center; }
.ce-done video { display: block; max-height: 360px; max-width: 100%; margin: 0 auto 14px; border: 2px solid var(--c-outline); border-radius: 16px; background: #000; }
.ce-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; max-height: 60vh; overflow: auto; padding: 4px; }
.ce-tpl { border: 2px solid var(--c-outline); border-radius: 16px; background: var(--c-surface); padding: 6px 6px 8px; cursor: pointer; text-align: left; color: var(--c-ink); font: inherit; }
.ce-tpl canvas { display: block; width: 100%; border-radius: 10px; margin-bottom: 6px; }
.ce-tpl b { display: block; font-size: .85rem; } .ce-tpl small { color: var(--c-muted); font-size: .74rem; }
.ce-tstyles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ce-ts, .ce-badge { border: 2px solid var(--c-outline); border-radius: 14px; background: #2A1F45; padding: 5px 5px 7px; cursor: pointer; font: 700 .74rem/1.2 var(--font-body); color: #fff; transition: transform .1s; }
.ce-ts canvas, .ce-badge canvas { display: block; width: 100%; height: auto; border-radius: 9px; }
.ce-ts span, .ce-badge small { display: block; margin-top: 5px; }
.ce-ts:hover, .ce-badge:hover, .ce-emo:hover { transform: rotate(-2deg) translateY(-1px); box-shadow: 3px 3px 0 var(--c-pop); }
.ce-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ce-emo-cat > span { font: 800 .72rem/1 var(--font-body); color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin: 10px 0 6px; }
.ce-emojis { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.ce-emo { font-size: 1.5rem; line-height: 1; aspect-ratio: 1; border: 2px solid var(--c-outline); border-radius: 12px; background: var(--c-surface); cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .1s; }
.ce-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-lrow { display: inline-flex; gap: 6px; align-items: center; border: 2px solid var(--c-outline); border-radius: 999px; padding: 6px 12px; background: var(--c-surface); font: 700 .82rem/1.1 var(--font-body); color: var(--c-ink); cursor: pointer; max-width: 100%; }
.ce-lrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.ce-lrow small { color: var(--c-muted); font-weight: 600; }
.ce-lrow.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 2px 2px 0 var(--c-pop); }
.ce-lrow.on small { color: inherit; }
.ce-led { background: var(--c-brand-soft); display: grid; gap: 16px; }
.ce-led-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ce-led-head b { font: 800 1.05rem/1.2 var(--font-display); flex: 1; min-width: 140px; }
.ce-led textarea { min-height: 64px; resize: vertical; }
.ce-fonts { display: flex; gap: 6px; flex-wrap: wrap; }
.ce-font { font-size: 1rem; padding: 8px 12px; border: 2px solid var(--c-outline); border-radius: 12px; background: var(--c-surface); color: var(--c-ink); cursor: pointer; line-height: 1.15; }
.ce-font.on { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: 2px 2px 0 var(--c-pop); }
.ce-sub { font: 800 .74rem/1 var(--font-body); color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; display: block; }
@media (max-width: 900px) {
  .ce-grid { grid-template-columns: minmax(0, 1fr); }
  .ce-grid > * { min-width: 0; }
  .ce-phone { padding: 8px; border-radius: 28px; }
  .ce-left { position: static; }
  .ce-phone canvas { max-height: 62vh; width: auto; }
  .ce-tabs { top: calc(var(--header-h) - 2px); }
}
@media (max-width: 480px) {
  .ce-two { grid-template-columns: 1fr; }
  .ce-layouts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ce-cards, .ce-pop-opts { grid-template-columns: 1fr; }
  .ce-head .ce-nav { display: none; }
  .ce-hide-sm { display: none; }
  .ce-tabs { gap: 0; }
  .ce-tabs button { padding: 12px 6px; font-size: .8rem; gap: 5px; }
  .ce-tabs button :is(.ui-ic, .ic) { display: none; }
  .ce-tstyles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ce-emojis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}


/* ===== admin ===== */
.ad-bars { display: flex; gap: 6px; align-items: flex-end; height: 160px; margin: 10px 0; }
.ad-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.ad-bar i { display: block; width: 100%; min-height: 3px; background: var(--c-brand); border: 2px solid var(--c-outline); border-radius: 6px 6px 0 0; }
.ad-bar span { font-size: .75rem; color: var(--c-muted); }
.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; }
}


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

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

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

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


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


/* ===== Reelstuber Forms pages ===== */
/* Labels that sit inside the old markup: role "t" keeps the text inline, "strong" bold */
.anvil-role-t, .anvil-role-t > .anvil-label-text { display: inline; font: inherit; color: inherit; }
.anvil-role-strong { font-weight: 700; }
/* item hosts: the old card is the real box */
.st-card-host, .st-badge-host, .tp-card-host, .rs-chip-host, .ce-look-host, .bk-tpl-host, .ad-bar-host { display: contents; }

/* ---- Studio (Pages/Home) */
.anvil-role-st-h1 { font: 800 clamp(1.9rem, 4.2vw, 2.8rem)/1.05 var(--font-display); letter-spacing: -.025em; color: var(--c-ink); margin: 0; text-wrap: balance; }
.anvil-role-st-num { display: block; font: 800 2.1rem/1 var(--font-display); letter-spacing: -.03em; }
.st-stat > .anvil-role-t { font-weight: 700; font-size: .88rem; opacity: .85; }
.anvil-role-st-banner-text { margin: 0; font-weight: 600; }
.anvil-role-st-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-bottom: 40px; }
.anvil-role-st-badges > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.anvil-role-st-title { font: 800 1.08rem/1.25 var(--font-display); margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anvil-role-st-len { position: absolute; right: 10px; bottom: 10px; background: var(--c-ink); color: var(--c-bg); font: 700 .78rem/1 var(--font-body); padding: 5px 8px; border-radius: 8px; }
.st-thumb .st-noimg { width: 40px; height: 40px; color: var(--c-muted); }
.anvil-role-st-badge-name { display: block; font-family: var(--font-display); font-weight: 800; }
.anvil-role-st-badge-desc { color: var(--c-muted); font-size: .85rem; }
.st-empty { margin-bottom: 40px; }
.st-drop .dz-ic { width: 76px; height: 76px; border-radius: 22px; background: var(--c-brand); border: 2px solid var(--c-outline); box-shadow: var(--shadow); display: grid; place-items: center; transform: rotate(-6deg); }
.st-drop .dz-ic .ic { width: 38px; height: 38px; color: var(--c-brand-ink); }

/* ---- Templates */
.anvil-role-tp-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; margin-bottom: 38px; }
.anvil-role-tp-title { font: 800 1.05rem/1.2 var(--font-display); margin: 0; }
.anvil-role-tp-by { font-size: .85rem; color: var(--c-muted); }
.tp-card .pv canvas { display: block; width: 100%; max-width: 150px; border-radius: 14px 14px 0 0; }
.tp-card .pv .rs-preview { display: grid; place-items: center; width: 100%; }
.tp-empty { margin-bottom: 38px; }

/* ---- Brand kit */
.anvil-role-bk-lead { color: var(--c-muted); margin-top: 6px; }
.bk-chips { margin-top: 12px; display: grid; gap: 6px; }
.bk-lab { font-size: .85rem; font-weight: 700; color: var(--c-muted); }
.anvil-role-rs-chips > div { display: flex; flex-wrap: wrap; gap: 6px; }
.anvil-role-bk-looks > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.anvil-role-bk-tpls > div { display: grid; gap: 10px; }
.bk-gap { margin-top: 12px; }
.bk-color { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; }
.bk-tpl-em { font-size: 1.6rem; }
.bk-prev .rs-preview canvas { display: block; border-radius: 20px; width: 240px; height: auto; }
.bk-prev-note { margin-top: 14px; }
.ce-look .rs-preview canvas { display: block; width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 880px) { .bk-prev .rs-preview canvas { width: 200px; } }

/* ---- Landing */
.lp-long .tl .tl-a { left: 8%; width: 14%; background: #FF3D8B; }
.lp-long .tl .tl-b { left: 38%; width: 18%; background: #C6F432; }
.lp-long .tl .tl-c { left: 70%; width: 12%; background: #7B5CFF; }
.lp-reel .rs-preview canvas { display: block; width: 150px; height: auto; border-radius: 15px; }
.lp-feature .ft-ic { width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--c-outline); display: grid; place-items: center; margin-bottom: 12px; background: var(--c-accent); color: var(--c-accent-ink); }
.lp-feature:nth-child(3n+2) .ft-ic { background: var(--c-brand); color: var(--c-brand-ink); }
.lp-feature:nth-child(3n) .ft-ic { background: var(--c-violet); color: #fff; }
.lp-feature .ft-ic .ic { width: 24px; height: 24px; }
.ytf .ytf-link { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .lp-reel .rs-preview canvas { width: 120px; } }
@media (max-width: 480px) { .lp-reel .rs-preview canvas { width: 104px; } }

/* ---- Admin (Reelstuber tabs) */
.anvil-role-ad-bars > div { display: flex; gap: 6px; align-items: flex-end; height: 160px; margin: 10px 0; }
.anvil-role-ad-bar-day { font-size: .75rem; color: var(--c-muted); }
.ad-usage-stats { margin-bottom: 18px; }
.ad-chart { margin-bottom: 18px; }
.ad-count { padding: 6px 0; border-bottom: 1px solid var(--c-line); }
.ad-tpl-em { font-size: 1.4rem; }

/* ---- editor screens: the engine draws everything inside */
.rs-screen-host { display: block; }

/* nav links hold a Label: keep them one line high */
.ui-nav .nav-link .anvil-label, .ui-tabbar .nav-link .anvil-label { display: inline; margin: 0; padding: 0; line-height: 1.2; }
.ui-nav .nav-link { display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
