:root {
  --app-status-bar-canvas: #010202;
  --sc-viewport-block: 100dvh;
  color-scheme: dark light;
  --bg: #040506;
  --bg-deep: #010202;
  --ink: #f4efdf;
  --muted: #a5a092;
  --line: rgba(216, 190, 122, .115);
  --panel: rgba(5, 7, 8, .82);
  --panel-strong: rgba(7, 9, 10, .96);
  --surface-warm: #090b0c;
  --accent: #c39a4f;
  --accent-ink: #050607;
  --calm: #d9c79a;
  --gold: #d3b96f;
  --violet: #6d6aa8;
  --warn: #c5a052;
  --danger: #ff856d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .62);
  --glow: 0 18px 54px rgba(211, 185, 111, .05), 0 12px 42px rgba(217, 199, 154, .045);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .065);
  --shell-radius: 8px;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --sc-edge-fade: 12px;
  --sc-edge-band: #07090a;
  --shell-outline-color: color-mix(in srgb, var(--gold) 16%, transparent);
  --sc-shell-edge-color: rgba(7, 9, 10, .98);
  --sc-shell-edge-transparent: rgba(7, 9, 10, 0);
  --sc-shell-row-gap: 0;
  --sc-text-micro: 10px;
  --sc-text-small: 11px;
  --sc-text-body: 13px;
  --sc-gap-xs: 4px;
  --sc-gap-sm: 8px;
  --control-radius: 7px;
  --workflow-gap: 12px;
  --workflow-gap-mobile: 10px;
  --workflow-radius: 12px;
  --workflow-mode-tint: #7063b4;
  --workflow-mode-secondary: #80678f;
  --workflow-topic-tint: #86567a;
  --workflow-topic-secondary: #654e69;
  --workflow-settings-tint: #4c6aa0;
  --workflow-settings-secondary: #685b8a;
  --workflow-length-tint: #387e7e;
  --workflow-length-secondary: #4c6c9a;
  --workflow-creation-tint: #98702d;
  --workflow-result-tint: #475893;
  --workflow-result-secondary: #396185;
  --chip-w: 92px;
  --chip-w-mobile: 84px;
  --dock-bottom: max(8px, var(--sc-safe-bottom));
  --mode-air: rgba(109, 106, 168, .14);
  --mode-glow: rgba(211, 185, 111, .07);
  --reader-air: rgba(217, 199, 154, .055);
  --control-surface: #101518;
  --control-edge: #857553;
  --control-focus: #dec77f;
}

@media (display-mode: standalone) {
  :root {
    --sc-viewport-block: 100vh;
  }
}

/* STORYCAST-AUTH-ENTRY-001: StoryCast-owned equal-geometry auth presentation.
 * Frozen shared entry providers remain compatibility inputs; this layer owns
 * the target semantics and skin without changing Apps auth transport. */
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] {
  --auth-panel-max: 420px;
  --auth-mark-size: 60px;
  --auth-tab-height: 44px;
  --auth-control-height: 48px;
  --auth-check-size: 18px;
  --auth-check-gap: 8px;
  width: min(var(--auth-panel-max), 100%);
  min-height: 0;
  margin: auto;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  grid-template-areas: none;
  align-content: start;
  gap: 10px;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: clamp(22px, 5vw, 30px);
  background:
    radial-gradient(circle at 12% -8%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 94%, var(--gold) 6%), color-mix(in srgb, var(--panel-strong) 94%, var(--calm) 6%)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), 0 0 32px color-mix(in srgb, var(--gold) 10%, transparent), var(--inner-light);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] > :where(.auth-showcase, .auth-card, .auth-footer) {
  grid-area: auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] > :where(.auth-showcase, .auth-card, .auth-footer)::before {
  content: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand-mark {
  width: var(--auth-mark-size);
  height: var(--auth-mark-size);
  flex: 0 0 var(--auth-mark-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand-mark::after {
  content: none;
  display: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand strong {
  font-size: clamp(30px, 7vw, 40px);
  line-height: .92;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-descriptor {
  font-size: 12px;
  line-height: 1.2;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-card {
  display: grid;
  gap: 10px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tabs {
  width: 100%;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tab {
  min-height: var(--auth-tab-height);
  font-size: 14px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tabs {
  border-radius: 999px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tab {
  border-radius: 999px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tab.active {
  animation: storycast-auth-gold-pulse 3.8s ease-in-out infinite;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-form-stage {
  display: grid;
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tail-stage {
  display: grid;
  min-width: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 180ms ease;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"][data-auth-mode="register"][data-registration-gate-state]:not([data-registration-gate-state="open"]):not([data-registration-gate-state="unlocked"]) .auth-tail-stage {
  max-height: 80px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"][data-auth-mode="register"][data-registration-gate-state="open"] .auth-tail-stage,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"][data-auth-mode="register"][data-registration-gate-state="unlocked"] .auth-tail-stage {
  max-height: 160px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-form-pane,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-mode-tail {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 1;
  transform: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] :where(.auth-form-pane, .auth-mode-tail)[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(.97) translateY(6px);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] :where(.auth-form-pane, .auth-mode-tail)[inert] {
  user-select: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-form {
  display: grid;
  align-content: start;
  gap: 10px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] [data-app-entry-field] {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-input {
  min-height: var(--auth-control-height);
  padding-left: 38px;
  font-size: 16px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-input:focus {
  animation: storycast-auth-field-pulse 2.6s ease-in-out infinite;
}

@keyframes storycast-auth-field-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent), inset 0 1px 0 rgba(255,255,255,.055); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.055); }
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-submit {
  min-height: var(--auth-control-height);
  margin-top: 0;
  border-radius: 999px;
  transition: transform .18s ease;
  animation: storycast-auth-gold-pulse 3.8s ease-in-out infinite;
}

@keyframes storycast-auth-gold-pulse {
  0% { box-shadow: -4px 3px 15px -4px color-mix(in srgb, var(--gold) 32%, transparent); }
  50% { box-shadow: 4px 3px 15px -4px color-mix(in srgb, var(--gold) 48%, transparent); }
  100% { box-shadow: -4px 3px 15px -4px color-mix(in srgb, var(--gold) 32%, transparent); }
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-feedback-stage {
  min-height: 36px;
  display: grid;
  align-items: start;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-feedback-stage > * {
  grid-area: 1 / 1;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-status {
  min-height: 36px;
  display: grid;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-status[hidden],
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-fallback[hidden] {
  display: none !important;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-register-tail {
  display: grid;
  align-content: start;
  gap: 8px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-check {
  grid-template-columns: var(--auth-check-size) minmax(0, 1fr);
  gap: var(--auth-check-gap);
  align-items: start;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 14%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
  color: color-mix(in srgb, var(--muted) 92%, var(--ink));
  font-size: 12px;
  line-height: 1.35;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-check input {
  width: var(--auth-check-size);
  height: var(--auth-check-size);
  margin: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-check a {
  color: color-mix(in srgb, #a9a4ff 86%, var(--ink));
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-footer {
  display: block;
  align-self: auto;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-legal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px clamp(7px, 2.2vw, 11px);
  padding: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-legal a {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 420px) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] {
    gap: 10px;
    padding: 14px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand {
    gap: 12px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-brand strong {
    font-size: clamp(30px, 9vw, 34px);
  }
}

@media (max-height: 720px) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] {
    margin-block: 0;
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] :where(.auth-form-pane, .auth-mode-tail, .auth-tab) {
    transition: none;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] :where(.auth-tab.active, .auth-submit, .auth-input:focus) {
    animation: none;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v1"] .auth-tail-stage {
    transition: none;
  }
}

/* AUTH-ENTRY-CANON-V2 — one compact StoryCast-owned panel. */
html[data-ui-release] body.auth-visible {
  height: var(--sc-viewport-block);
  min-height: var(--sc-viewport-block);
  overflow: hidden;
}

html[data-ui-release]:has(body.auth-visible) {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html[data-ui-release] .auth-screen {
  place-items: center;
  padding: max(10px, var(--sc-safe-top)) max(10px, var(--sc-safe-right)) max(10px, var(--sc-safe-bottom)) max(10px, var(--sc-safe-left));
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] {
  width: min(420px, 100%);
  min-height: 0;
  align-self: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line));
  border-radius: 20px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 98%, var(--gold) 1.5%), color-mix(in srgb, var(--panel-strong) 98%, var(--calm) 1.5%)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), var(--inner-light);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] > :where(.auth-showcase, .auth-info-panel, .auth-card, .auth-footer) {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] > :where(.auth-showcase, .auth-info-panel, .auth-card, .auth-footer)::before {
  content: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .brand-mark.auth-brand-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 13px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-brand strong {
  font-size: 27px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-info-panel {
  display: block;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-intro {
  max-width: none;
  font-size: 13px;
  line-height: 1.42;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-card {
  display: grid;
  gap: 9px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-card-head {
  display: block;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-card-head p {
  color: color-mix(in srgb, var(--gold) 72%, var(--muted));
  font-size: 11px;
  letter-spacing: .02em;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-tab {
  min-height: 36px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-form {
  gap: 7px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-submit {
  min-height: 40px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-footer {
  display: grid;
  justify-items: center;
  gap: 6px;
  align-self: auto;
  text-align: center;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-footer > span {
  color: color-mix(in srgb, var(--gold) 72%, var(--muted));
  font-size: 10px;
  letter-spacing: .035em;
  line-height: 1.3;
  text-transform: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-legal {
  justify-content: center;
}

@media (max-height: 700px) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] {
    padding: 12px 14px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .brand-mark.auth-brand-mark {
    width: 38px;
    height: 38px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v2"] .auth-brand strong {
    font-size: 24px;
  }
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] {
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 98%, var(--gold) 1.5%), color-mix(in srgb, var(--panel-strong) 98%, var(--calm) 1.5%)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), var(--inner-light);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] > :where(.auth-showcase, .auth-info-panel, .auth-card, .auth-footer) {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] > :where(.auth-showcase, .auth-info-panel, .auth-card, .auth-footer)::before {
  content: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] .auth-card,
html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] .auth-footer {
  display: grid;
  gap: 8px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] .auth-intro {
  max-width: none;
  font-size: 13px;
  line-height: 1.42;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="compact-panel-v3"] [data-app-entry-account-copy] {
  color: color-mix(in srgb, var(--gold) 72%, var(--muted));
  font-size: 11px;
  line-height: 1.35;
}

body[data-mode="story"] {
  --workflow-mode-tint: #7063b4;
  --workflow-mode-secondary: #80678f;
  --workflow-result-tint: #475893;
  --workflow-result-secondary: #396185;
  --workflow-settings-tint: #4c6aa0;
  --workflow-settings-secondary: #685b8a;
  --mode-air: rgba(109, 106, 168, .15);
  --mode-glow: rgba(211, 185, 111, .075);
  --reader-air: rgba(109, 106, 168, .06);
}

body[data-mode="podcast"] {
  --workflow-mode-tint: #4079a3;
  --workflow-mode-secondary: #557397;
  --workflow-result-tint: #2e6389;
  --workflow-result-secondary: #435687;
  --workflow-settings-tint: #5c6693;
  --workflow-settings-secondary: #407383;
  --mode-air: rgba(217, 199, 154, .15);
  --mode-glow: rgba(104, 135, 182, .075);
  --reader-air: rgba(217, 199, 154, .065);
}

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: dark;
    --bg: #040506;
    --bg-deep: #010202;
    --ink: #f7efdd;
    --muted: #aaa394;
    --line: rgba(216, 190, 122, .13);
    --panel: rgba(6, 8, 9, .84);
    --panel-strong: rgba(8, 10, 11, .96);
    --surface-warm: #090b0c;
    --accent: #c7a157;
    --accent-ink: #050607;
    --calm: #e0cfa6;
    --gold: #d8be74;
    --violet: #716eb0;
    --warn: #c9a65d;
    --shadow: 0 24px 80px rgba(0, 0, 0, .62);
    --glow: 0 18px 62px rgba(216, 190, 122, .06), 0 12px 48px rgba(224, 207, 166, .05);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  min-height: 100%;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(118deg, rgba(216, 190, 122, .035), transparent 30%, rgba(217, 199, 154, .04) 58%, rgba(109, 106, 168, .035)),
    repeating-linear-gradient(90deg, rgba(216, 190, 122, .006) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 54%, #020303 100%);
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(216, 190, 122, .08) 0 1px, transparent 1.6px),
    radial-gradient(circle at 76% 22%, rgba(217, 199, 154, .08) 0 1px, transparent 1.7px),
    radial-gradient(circle at 42% 78%, rgba(247, 240, 223, .055) 0 1px, transparent 1.5px),
    linear-gradient(110deg, transparent 0 20%, rgba(216, 190, 122, .028) 32%, transparent 46% 66%, rgba(217, 199, 154, .03) 78%, transparent 100%);
  background-size: 180px 180px, 240px 240px, 210px 210px, 100% 100%;
  opacity: .54;
  mask-image: linear-gradient(180deg, black 0%, black 72%, transparent 100%);
  animation: ambientShift 22s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .34) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.024) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
  opacity: .18;
}

body[data-app-state="generating"]::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(216, 190, 122, .18) 0 1px, transparent 1.9px),
    radial-gradient(circle at 76% 24%, rgba(217, 199, 154, .15) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 78%, rgba(109, 106, 168, .13) 0 1px, transparent 1.8px),
    radial-gradient(circle at 50% 48%, rgba(216, 190, 122, .09), transparent 38%),
    linear-gradient(112deg, transparent 0 18%, rgba(216, 190, 122, .062) 34%, transparent 48% 62%, rgba(217, 199, 154, .054) 78%, transparent 100%);
  background-size: 170px 170px, 235px 235px, 205px 205px, 100% 100%, 130% 100%;
  opacity: .82;
  animation: none;
  transform: none;
  filter: none;
}

body[data-app-state="generating"]::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .38)),
    linear-gradient(120deg, transparent 0 22%, rgba(216, 190, 122, .045) 40%, transparent 58% 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.026) 0 1px, transparent 1px 4px);
  opacity: .48;
  animation: none;
}

.auth-screen {
  position: relative;
  z-index: 2;
  height: var(--sc-viewport-block);
  min-height: var(--sc-viewport-block);
  display: none;
  place-items: stretch center;
  padding: max(14px, var(--sc-safe-top)) max(12px, var(--sc-safe-right)) max(14px, var(--sc-safe-bottom)) max(12px, var(--sc-safe-left));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.auth-visible .auth-screen {
  display: grid;
}

body.auth-visible {
  height: auto;
  min-height: var(--sc-viewport-block);
  overflow-x: hidden;
  overflow-y: auto;
}

html:has(body.auth-visible) {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}

body.auth-visible .app-shell {
  display: none;
}

.auth-layout {
  width: min(980px, 100%);
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "showcase card"
    "info card"
    ". card"
    "footer footer";
  gap: 10px;
  align-items: stretch;
}

.auth-showcase,
.auth-info-panel,
.auth-card,
.auth-footer {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: var(--shell-radius);
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--panel-strong) 98%, var(--gold) 1%), color-mix(in srgb, var(--panel-strong) 98%, var(--calm) 1.5%) 64%, color-mix(in srgb, var(--panel-strong) 98%, var(--violet) .8%)),
    var(--panel-strong);
  box-shadow: 0 20px 58px rgba(0,0,0,.38), var(--inner-light);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
  overflow: hidden;
  position: relative;
}

.auth-showcase::before,
.auth-info-panel::before,
.auth-card::before,
.auth-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 26%, color-mix(in srgb, var(--gold) 4%, white 1%) 42%, transparent 60% 100%),
    radial-gradient(circle at 86% 16%, color-mix(in srgb, var(--calm) 3.5%, transparent), transparent 35%);
  opacity: .12;
}

.auth-showcase > *,
.auth-info-panel > *,
.auth-card > *,
.auth-footer > * {
  position: relative;
  z-index: 1;
}

.auth-showcase {
  grid-area: showcase;
  display: grid;
  align-content: center;
  gap: 0;
  padding: clamp(16px, 3vw, 22px);
}

.auth-showcase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark.auth-brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 15px;
}

.auth-brand-copy {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
}

.auth-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 36px);
  line-height: .9;
  letter-spacing: 0;
}

.auth-descriptor,
.auth-intro,
.auth-card-head p,
.auth-form-note {
  margin: 0;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  line-height: 1.35;
}

.auth-descriptor {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.auth-info-panel {
  grid-area: info;
  display: grid;
  align-content: center;
  padding: 15px 16px;
}

.auth-info-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.auth-info-copy strong {
  color: color-mix(in srgb, var(--gold) 76%, var(--ink));
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-intro {
  max-width: 540px;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-size: clamp(13px, 1.35vw, 15px);
  font-weight: 660;
  line-height: 1.38;
}

.auth-form-note {
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  font-size: 12px;
  font-weight: 680;
}

.auth-apps-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}

.auth-card {
  grid-area: card;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(16px, 3vw, 22px);
}

.auth-card-head {
  display: grid;
  gap: 5px;
}

.auth-card-head strong {
  font-size: 20px;
  line-height: 1.1;
}

.auth-card-head p {
  font-size: 12px;
  font-weight: 680;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 34%, var(--panel) 66%);
}

.auth-tab {
  min-height: 34px;
  border: 0;
  border-radius: calc(var(--control-radius) - 2px);
  color: var(--muted);
  background: linear-gradient(105deg, rgb(from color-mix(in srgb, var(--gold) 78%, white 4%) r g b / 0), rgb(from color-mix(in srgb, var(--accent) 30%, var(--gold)) r g b / 0) 62%, rgb(from color-mix(in srgb, var(--calm) 8%, var(--gold)) r g b / 0));
  font-weight: 720;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease;
}

.auth-tab.active {
  color: var(--accent-ink);
  background: linear-gradient(180deg, #fce8ac, #e9bc58 55%, #c49735);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form[hidden] {
  display: none !important;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: var(--control-radius);
  padding: 0 11px;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-warm) 48%, var(--panel-strong)), color-mix(in srgb, var(--panel-strong) 97%, var(--calm) 1.5%));
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

.auth-input:focus {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent), inset 0 1px 0 rgba(255,255,255,.055);
}

.auth-input-control {
  position: relative;
  display: block;
  min-width: 0;
}

.auth-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  pointer-events: none;
}

.auth-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: color-mix(in srgb, var(--muted) 92%, var(--ink));
  font-size: 12px;
  line-height: 1.3;
}

.auth-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--gold);
}

.auth-submit {
  margin-top: 2px;
}

.auth-status {
  margin: 0;
  min-height: 18px;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.auth-status[hidden] {
  display: none !important;
}

.auth-status[data-kind="error"] {
  color: color-mix(in srgb, var(--danger) 72%, var(--ink));
}

.auth-apps-link {
  width: 100%;
}

.auth-fallback[hidden] {
  display: none !important;
}

.auth-fallback {
  display: none;
}

.auth-screen[data-auth-entry-state="degraded"] .auth-fallback {
  display: inline-flex;
}

.auth-footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  align-self: end;
}

.auth-footer > span {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--gold) 72%, var(--muted));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-legal {
  justify-content: flex-end;
}

@media (prefers-color-scheme: light) {
  body {
    background:
      linear-gradient(118deg, rgba(216, 190, 122, .036), transparent 26%, rgba(224, 207, 166, .04) 54%, rgba(113, 110, 176, .034)),
      repeating-linear-gradient(90deg, rgba(216, 190, 122, .006) 0 1px, transparent 1px 72px),
      linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 50%, #020303 100%);
  }

  body::before {
    background:
      radial-gradient(circle at 12% 18%, rgba(216, 190, 122, .08) 0 1px, transparent 1.6px),
      radial-gradient(circle at 76% 22%, rgba(224, 207, 166, .08) 0 1px, transparent 1.7px),
      radial-gradient(circle at 42% 78%, rgba(255, 244, 223, .055) 0 1px, transparent 1.5px),
      linear-gradient(110deg, transparent 0 18%, rgba(216, 190, 122, .028) 30%, transparent 44% 64%, rgba(224, 207, 166, .03) 76%, transparent 100%);
    opacity: .54;
  }

  body::after {
    opacity: .18;
  }
}

button, textarea, input {
  font: inherit;
  letter-spacing: 0;
}

button { cursor: pointer; }

.app-shell {
  height: var(--sc-viewport-block);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--sc-shell-row-gap);
  padding: max(8px, var(--sc-safe-top)) max(10px, var(--sc-safe-right)) 0 max(10px, var(--sc-safe-left));
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.shell-header {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 7px;
  position: relative;
  z-index: 12;
}

.topbar {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  position: relative;
  z-index: 12;
}

:where(.top-panel, .action-dock) {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

:where(.top-panel, .action-dock) > * {
  position: relative;
  z-index: 1;
}

:where(.top-panel, .action-dock)::before,
:where(.top-panel, .action-dock)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
}

.top-panel {
  padding: 8px 10px 9px;
  border: 0;
  border-radius: var(--shell-radius) var(--shell-radius) 0 0;
  /* Фон живёт на ::before: он свисает за кромку и гаснет той же маской, что и
   * рамка на ::after. Прежний градиент ронял непрозрачность до .38 и там
   * обрывался -- содержимое было видно на 62% до кромки и на 100% сразу за
   * ней. Разрыв в 38 пунктов ровно на стыке и читался как ступенька. */
  background: none;
  z-index: 5;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Tail is half the shell row gap: the other half is genuine empty space
 * between where the fade ends and the workspace box begins, so the card
 * never visually rides under the gradient (owner's report). Proportional
 * ОТМЕНЕНО в v193: слой тумана удалён вместе с зазором. Шов закрыт, панель
 * ложится прямо на содержимое и тает по нему -- см. .top-panel::before. */
.top-panel::before {
  inset: 0 0 calc(-1 * var(--sc-edge-fade)) 0;
  background:
    linear-gradient(var(--sc-edge-band), var(--sc-edge-band)),
    var(--sc-shell-edge-color);
  background-repeat: no-repeat, repeat;
  background-position: 0 100%, 0 0;
  background-size: 100% var(--sc-edge-fade), auto;
  -webkit-mask-image: linear-gradient(
      180deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
  mask-image: linear-gradient(
      180deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Soft dissolving meeting edge: the outline mask reuses the fill's own
 * .80/.60/.48 stops so the gold line and the dark material recede at the
 * same rate and read as one dissolve. The outline still finishes at literal
 * transparent exactly at the panel's own bottom edge (no paint leaves the
 * box and no hard stroke survives the fade) while the fill continues below
 * .38 via its own borderless tail -- that final step is the only place the
 * two curves part ways, and it is too small to read as a separate line. */
@supports ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
  .top-panel::after {
    inset: 0 0 calc(-1 * var(--sc-edge-fade)) 0;
    border: 1px solid var(--shell-outline-color);
    border-bottom: 0;
    box-shadow: var(--inner-light);
    -webkit-mask-image: linear-gradient(
      180deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
    mask-image: linear-gradient(
      180deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
  background:
    radial-gradient(circle at 34% 24%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 43%),
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 8%, var(--panel-strong)), color-mix(in srgb, var(--calm) 4%, var(--panel-strong)));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--gold) 6%, transparent), inset 0 1px 0 rgba(255,255,255,.11);
  position: relative;
  color: color-mix(in srgb, var(--gold) 88%, white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-mark::after {
  display: none;
}

/* The authenticated header is the installed-PWA composition at one fixed size. */
html[data-ui-release] .shell-header .brand-block > .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transform: none;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.3vw, 36px);
  line-height: .95;
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-descriptor {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
}

.ghost-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, white 1.2%), color-mix(in srgb, var(--panel) 90%, black 6%));
  border-radius: var(--control-radius);
  padding: 0 10px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(16px);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.account-chip,
.section-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.account-chip {
  min-width: 54px;
  padding-inline: 11px;
}

.account-chip .action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .04em;
  line-height: 1;
}

.ghost-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-button:hover, .icon-button:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-1px);
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  width: var(--chip-w);
  min-width: var(--chip-w);
  max-width: var(--chip-w);
  border-radius: var(--control-radius);
  color: var(--ink);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 5%, var(--panel)), color-mix(in srgb, var(--calm) 4%, var(--panel))),
    color-mix(in srgb, var(--panel) 84%, transparent);
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 9px 24px color-mix(in srgb, var(--gold) 5%, transparent);
  backdrop-filter: blur(16px);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  cursor: pointer;
}

.wallet-card-chip {
  justify-content: center;
}

.balance-chip:hover, .balance-chip:focus-visible {
  border-color: color-mix(in srgb, var(--calm) 58%, var(--line));
  color: var(--ink);
  box-shadow: 0 10px 34px color-mix(in srgb, var(--calm) 22%, transparent);
  transform: translateY(-1px);
}

#balanceMain {
  display: block;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

#balanceSub {
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

.workspace {
  align-self: stretch;
  width: min(1120px, 100%);
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
  display: block;
  padding: 12px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: auto;
  scrollbar-width: none;
  /* Растворение содержимого у швов принадлежит закреплённым панелям, а не
   * этой коробке: с v192 маска середины снята, с v193 зазор и вертикальные
   * отступы равны нулю, поэтому панель ложится прямо на карточки и тает по
   * ним на глубину --sc-edge-fade. Профиль маски посчитан: на 14px от кромки
   * содержимое видно на 90%, плотная часть кончается на 6px -- то есть внутри
   * собственного отступа карточки (14px), до букв полоса не достаёт. */
  /* Вторая маска на том же шве снята: оба края теперь честно накрывает
   * свисающий край закреплённой панели. Два гашения подряд удваивали мутную
   * зону -- канон называет это «хвостом». */
}

.workspace::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.work-panel {
  min-height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--workflow-gap-mobile);
  align-content: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  position: relative;
}

.work-panel::before {
  display: none;
}

.work-panel > * {
  position: relative;
  z-index: 1;
}

body[data-app-state="generating"] .work-panel::after {
  content: "";
  position: absolute;
  inset: -18px -10px;
  z-index: 0;
  pointer-events: none;
  border-radius: calc(var(--workflow-radius) + 8px);
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 38%),
    radial-gradient(circle at 82% 40%, color-mix(in srgb, var(--calm) 12%, transparent), transparent 42%),
    linear-gradient(115deg, transparent 0 24%, color-mix(in srgb, var(--accent) 7%, transparent) 42%, transparent 62% 100%);
  opacity: .62;
  filter: blur(18px);
  animation: none;
  transform: none;
}

body[data-app-state="generating"] .creation-section {
  border-color: color-mix(in srgb, var(--gold) 38%, var(--calm) 18%);
  box-shadow:
    0 18px 46px rgba(0,0,0,.36),
    0 0 42px color-mix(in srgb, var(--gold) 10%, transparent),
    0 0 34px color-mix(in srgb, var(--calm) 6%, transparent),
    var(--inner-light);
}

body[data-app-state="generating"] .creation-section::before {
  opacity: .28;
  background:
    linear-gradient(112deg, transparent 0 20%, color-mix(in srgb, var(--gold) 12%, white 3%) 42%, color-mix(in srgb, var(--calm) 7%, transparent) 54%, transparent 74% 100%),
    radial-gradient(circle at 86% 12%, color-mix(in srgb, var(--calm) 7%, transparent), transparent 36%),
    radial-gradient(circle at 10% 86%, color-mix(in srgb, var(--violet) 6%, transparent), transparent 40%);
  transform: none;
  animation: none;
}

.work-section {
  --section-tint: var(--workflow-mode-tint);
  --section-tint-2: var(--workflow-mode-secondary);
  --section-fill-primary: 26%;
  --section-fill-secondary: 16%;
  --section-fill-floor: 12%;
  --section-corner-fill: 16%;
  --section-edge-strength: 50%;
  --section-glow-strength: 8%;
  --section-kicker-strength: 42%;
  --section-edge: color-mix(in srgb, var(--section-tint) var(--section-edge-strength), var(--line));
  min-width: 0;
  display: grid;
  gap: 11px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--section-edge);
  border-radius: var(--workflow-radius);
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--section-tint-2) 8%, transparent), transparent 48%),
    linear-gradient(140deg, color-mix(in srgb, var(--panel-strong) 92%, var(--section-tint) 8%), color-mix(in srgb, var(--panel-strong) 94%, var(--section-tint-2) 6%) 58%, color-mix(in srgb, var(--panel-strong) 88%, var(--section-tint) 12%)),
    var(--panel-strong);
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--section-tint-2) var(--section-corner-fill), transparent), transparent 48%),
    linear-gradient(140deg, color-mix(in srgb, var(--panel-strong), var(--section-tint) var(--section-fill-primary)), color-mix(in srgb, var(--panel-strong), var(--section-tint-2) var(--section-fill-secondary)) 58%, color-mix(in srgb, var(--panel-strong), var(--section-tint) var(--section-fill-floor))),
    var(--panel-strong);
  box-shadow: 0 14px 36px rgba(0,0,0,.25), 0 10px 30px color-mix(in srgb, var(--section-tint) var(--section-glow-strength), transparent), var(--inner-light);
  backdrop-filter: blur(20px);
  overflow: hidden;
  position: relative;
}

.intent-section {
  --section-tint: var(--workflow-mode-tint);
  --section-tint-2: var(--workflow-mode-secondary);
  --section-fill-primary: 16%;
  --section-fill-secondary: 14%;
  --section-fill-floor: 12%;
  --section-corner-fill: 16%;
  --section-edge-strength: 46%;
  --section-glow-strength: 9%;
}

.topic-section {
  --section-tint: var(--workflow-topic-tint);
  --section-tint-2: var(--workflow-topic-secondary);
  --section-fill-primary: 26%;
  --section-fill-secondary: 28%;
  --section-fill-floor: 21%;
  --section-corner-fill: 17%;
  --section-edge-strength: 50%;
  --section-glow-strength: 8%;
}

.settings-section {
  --section-tint: var(--workflow-settings-tint);
  --section-tint-2: var(--workflow-settings-secondary);
  --section-fill-primary: 34%;
  --section-fill-secondary: 34%;
  --section-fill-floor: 30%;
  --section-corner-fill: 16%;
  --section-edge-strength: 56%;
  --section-glow-strength: 8%;
}

.length-section {
  --section-tint: var(--workflow-length-tint);
  --section-tint-2: var(--workflow-length-secondary);
  --section-fill-primary: 41%;
  --section-fill-secondary: 40%;
  --section-fill-floor: 36%;
  --section-corner-fill: 18%;
  --section-edge-strength: 62%;
  --section-glow-strength: 9%;
}

/* Shell meeting-edge box-shadow bleed fix: the ordinary .work-section
 * box-shadow blurs past the card's own border and shows through the
 * shell fade as a dark band. Only the card(s) actually adjacent to the
 * shell edge get a shorter shadow; .top-panel/.action-dock paint is
 * untouched. .length-section only qualifies while #runSurface is hidden
 * (idle/failure/recovery); once a run reveals #runSurface, whichever of
 * creation-section/result-section is visible becomes the true bottom
 * neighbor instead. */
.intent-section,
.length-section:has(+ #runSurface[hidden]),
.length-section:has(+ .billing-incident-panel[hidden] + #runSurface[hidden]),
#runSurface .creation-section,
#runSurface .result-section {
  box-shadow: 0 8px 20px rgba(0,0,0,.14), 0 6px 16px color-mix(in srgb, var(--section-tint) var(--section-glow-strength), transparent), var(--inner-light);
}

.billing-incident-panel {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: clamp(14px, 2vw, 18px);
  border: 1px solid color-mix(in srgb, var(--warn) 52%, var(--line));
  border-radius: var(--workflow-radius);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--warn) 14%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 94%, var(--warn) 6%), var(--panel-strong));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14), 0 6px 18px color-mix(in srgb, var(--warn) 8%, transparent), var(--inner-light);
}

.billing-incident-panel[hidden] {
  display: none !important;
}

.billing-incident-panel strong {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.25;
  letter-spacing: -.01em;
}

.billing-incident-panel p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.creation-section {
  --section-tint: var(--workflow-creation-tint);
  --section-tint-2: var(--workflow-mode-tint);
  --section-fill-primary: 9%;
  --section-fill-secondary: 7%;
  --section-fill-floor: 4%;
  --section-corner-fill: 12%;
  --section-edge-strength: 44%;
  --section-glow-strength: 6%;
}

.result-section {
  --section-tint: var(--workflow-result-tint);
  --section-tint-2: var(--workflow-result-secondary);
  --section-fill-primary: 12%;
  --section-fill-secondary: 10%;
  --section-fill-floor: 6%;
  --section-corner-fill: 18%;
  --section-edge-strength: 58%;
  --section-glow-strength: 9%;
}

#workPanel #runSurface {
  display: grid;
  gap: var(--workflow-gap);
}

#workPanel #runSurface:is([data-run-surface-state="generation"], [data-run-surface-state="failure"]) .result-section {
  display: none;
}

#workPanel #runSurface[data-run-surface-state="ready"] .creation-section {
  display: none;
}

#workPanel #runSurface[data-run-surface-state="ready"] .player-shell[data-player-state="empty"] {
  display: none;
}

#workPanel #runSurface[data-run-surface-state="recovery"] .player-shell[data-player-state="empty"] {
  display: none;
}

#workPanel #minutesSlider {
  min-height: 44px;
}

html[data-ui-release] #workPanel .intent-section {
  --recommendation-panel-size: clamp(248px, 27vw, 268px);
  min-height: var(--recommendation-panel-size);
  height: auto;
  max-height: none;
  padding-block: clamp(12px, 1.6vw, 15px);
}

html[data-ui-release] #workPanel .recommendation-copy {
  display: grid;
  grid-template-rows: auto minmax(114px, 1fr) 44px;
  min-width: 0;
  min-height: calc(var(--recommendation-panel-size) - 2 * clamp(12px, 1.6vw, 15px) - 2px);
  height: auto;
  gap: clamp(4px, .8vw, 8px);
}

html[data-ui-release] #workPanel #recommendationTitle {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.12;
  font-weight: 720;
}

html[data-ui-release] #workPanel .recommendation-header {
  display: block;
  min-width: 0;
}

html[data-ui-release] #workPanel .recommendation-carousel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: clamp(12px, 1.8vw, 16px);
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--gold) 11%, transparent), transparent 56%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 88%, var(--workflow-mode-tint) 12%), color-mix(in srgb, var(--panel-strong) 97%, black 3%));
  box-shadow:
    0 10px 30px color-mix(in srgb, black 24%, transparent),
    0 0 0 1px color-mix(in srgb, var(--gold) 8%, transparent),
    inset 0 1px rgba(255,255,255,.055);
}

html[data-ui-release] #workPanel .recommendation-carousel__viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
}

html[data-ui-release] #workPanel .recommendation-carousel__slides {
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-ui-release] #workPanel .recommendation-carousel__slide {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  touch-action: pan-y;
  outline: none;
  opacity: 1;
  transition: opacity 170ms ease;
}

html[data-ui-release] #workPanel .recommendation-carousel__slide::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html[data-ui-release] #workPanel .recommendation-carousel__slide:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 78%, white);
  border-radius: inherit;
}

html[data-ui-release] #workPanel .recommendation-carousel__viewport.is-swapping .recommendation-carousel__slide[aria-current="true"] {
  opacity: 0;
}

html[data-ui-release] #workPanel .recommendation-carousel__content {
  display: grid;
  align-content: safe center;
  gap: clamp(5px, .8vw, 8px);
  min-height: 100%;
  padding: clamp(9px, 1.2vw, 12px) clamp(11px, 1.6vw, 16px);
}

html[data-ui-release] #workPanel .recommendation-carousel__label {
  color: var(--gold);
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: .012em;
}

html[data-ui-release] #workPanel .recommendation-carousel__guidance {
  margin: 0;
  color: var(--ink);
  font-size: var(--sc-text-body);
  line-height: 1.35;
  font-weight: 620;
  overflow-wrap: anywhere;
}

html[data-ui-release] #workPanel .recommendation-carousel__example {
  margin: 0;
  color: var(--muted);
  font-size: var(--sc-text-small);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

html[data-ui-release] #workPanel .recommendation-carousel__example span {
  color: color-mix(in srgb, var(--muted) 72%, var(--gold));
}

html[data-ui-release] #workPanel .recommendation-carousel__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  max-width: calc(100% - 12px);
  min-height: 44px;
  align-self: center;
  gap: 2px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Внешняя цель остаётся 44x44, но видимая SVG-форма занимает 28x28. Этот
   внутренний moat сохраняет воздух до краёв карточки без потери touch target. */
html[data-ui-release] #workPanel .recommendation-carousel__button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: color-mix(in srgb, var(--ink) 78%, var(--gold));
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: color 150ms ease;
}

html[data-ui-release] #workPanel .recommendation-carousel__button:hover:not(:disabled),
html[data-ui-release] #workPanel .recommendation-carousel__button:focus-visible {
  color: var(--gold);
  background: transparent;
}

html[data-ui-release] #workPanel .recommendation-carousel__button:active:not(:disabled) {
  color: color-mix(in srgb, var(--gold) 84%, white);
}

html[data-ui-release] #workPanel .recommendation-carousel__button:disabled {
  opacity: .45;
  cursor: default;
}

html[data-ui-release] #workPanel .recommendation-carousel__button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 78%, white);
  outline-offset: -5px;
}

html[data-ui-release] #workPanel .recommendation-carousel__button-icon {
  display: block;
  width: 28px;
  height: 28px;
  overflow: visible;
  pointer-events: none;
}

html[data-ui-release] #workPanel .recommendation-carousel__button-surface {
  fill: currentColor;
  fill-opacity: .07;
  stroke: currentColor;
  stroke-opacity: .34;
  stroke-width: 1.25;
  transition: fill-opacity 150ms ease, stroke-opacity 150ms ease;
}

html[data-ui-release] #workPanel .recommendation-carousel__button-chevron {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-ui-release] #workPanel .recommendation-carousel__button:hover:not(:disabled) .recommendation-carousel__button-surface,
html[data-ui-release] #workPanel .recommendation-carousel__button:focus-visible .recommendation-carousel__button-surface {
  fill-opacity: .12;
  stroke-opacity: .62;
}

html[data-ui-release] #workPanel .recommendation-carousel__button:active:not(:disabled) .recommendation-carousel__button-surface {
  fill-opacity: .16;
}

html[data-ui-release] #workPanel .recommendation-carousel__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 0;
}

html[data-ui-release] #workPanel .recommendation-carousel__dot {
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

html[data-ui-release] #workPanel .recommendation-carousel__dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 78%, transparent);
  transition: width 180ms ease, background-color 180ms ease;
}

html[data-ui-release] #workPanel .recommendation-carousel__dot:is(:hover, :focus-visible)::before {
  background: color-mix(in srgb, var(--gold) 70%, var(--muted));
}

html[data-ui-release] #workPanel .recommendation-carousel__dot.is-active::before {
  width: 16px;
  background: var(--gold);
}

html[data-ui-release] #workPanel .recommendation-carousel__dot:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 78%, white);
  outline-offset: -2px;
}

html[data-ui-release] #workPanel .length-section {
  padding-block: clamp(10px, 1.5vw, 13px);
  gap: 8px;
}

html[data-ui-release] #workPanel .length-section .slider-wrap {
  display: block;
  min-width: 0;
}


html[data-ui-release] #workPanel .creation-feedback {
  min-height: 18px;
}

html[data-ui-release] #workPanel .creation-estimate,
html[data-ui-release] #workPanel .preflight-notice {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 76%, var(--gold));
  font-size: var(--sc-text-small);
  line-height: 1.35;
  font-weight: 640;
}

html[data-ui-release] #workPanel .creation-estimate {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-ui-release] #workPanel .preflight-notice {
  color: color-mix(in srgb, var(--danger) 68%, var(--ink));
}

html[data-ui-release] #workPanel .creation-estimate[hidden],
html[data-ui-release] #workPanel .preflight-notice[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #workPanel #runSurface { animation: none !important; }
  html[data-ui-release] #workPanel .recommendation-carousel__slide,
  html[data-ui-release] #workPanel .recommendation-carousel__dot::before,
  html[data-ui-release] #workPanel .recommendation-carousel__button,
  html[data-ui-release] #workPanel .recommendation-carousel__button-surface { transition: none; }
}

.work-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 30%, color-mix(in srgb, var(--section-tint) 5%, white 1%) 42%, transparent 56% 100%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--section-tint-2) 4%, transparent), transparent 34%);
  opacity: .16;
}

.work-section > * {
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  /* flex-start, а не flex-end: правый элемент шапки (бейдж) обязан вставать по
   * заголовку, а не по нижнему краю двухстрочного блока копий. Правка была
   * заявлена в v190, но в код тогда не попала -- перекос не проявлялся только
   * потому, что единственный бейдж в тот же заход был удалён. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.section-copy {
  display: grid;
  gap: var(--sc-gap-xs);
  min-width: 0;
}

.section-kicker {
  color: color-mix(in srgb, var(--section-tint) var(--section-kicker-strength), var(--ink));
  font-size: var(--sc-text-micro);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.section-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.12;
  font-weight: 720;
}

/* Бейдж шапки: единственный правый элемент в .section-head. Читается, а не
 * приглушается -- .section-note для этого не подходит. Держится по заголовку
 * благодаря align-items: flex-start выше. */
.section-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--calm);
  font-size: var(--sc-text-small);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.section-note {
  color: var(--muted);
  font-size: var(--sc-text-small);
  line-height: 1.15;
  white-space: nowrap;
}

.section-action-button {
  min-height: 30px;
  padding: 0 9px;
  color: color-mix(in srgb, var(--ink) 88%, var(--gold));
}

.section-description {
  margin: 0;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-size: var(--sc-text-body);
  line-height: 1.38;
}

.composer {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "label"
    "topic"
    "brief";
  align-self: start;
  align-items: stretch;
  align-content: start;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  position: relative;
  overflow: visible;
}

.player-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 24%, color-mix(in srgb, var(--gold) 10%, white 4%) 38%, transparent 53% 100%);
  opacity: .10;
  transform: translateX(-120%);
  animation: panelSheen 13s ease-in-out infinite;
}

.player-shell > * {
  position: relative;
  z-index: 1;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line));
  border-radius: var(--control-radius);
  padding: 3px;
  background: color-mix(in srgb, var(--bg) 56%, var(--panel) 44%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.mode-rail {
  width: 100%;
  margin: 0;
  padding-top: 7px;
  overflow: hidden;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  border-radius: calc(var(--control-radius) - 2px);
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.mode-button.active {
  color: var(--accent-ink);
  background:
    linear-gradient(180deg, #fce8ac, #e9bc58 55%, #c49735);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20), 0 6px 18px color-mix(in srgb, var(--gold) 6%, transparent);
}

.mode-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-bottom: 0;
}

.mode-heading strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 760;
}

.mode-heading span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-guide {
  margin: -2px 0 1px;
  max-width: 760px;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-size: 12px;
  line-height: 1.3;
}

.prompt-label {
  grid-area: label;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: 0;
  max-width: none;
  align-self: center;
}

.prompt-input,
.brief-field input,
.brief-field textarea {
  grid-area: topic;
  width: 100%;
  min-height: 58px;
  border: 1px solid color-mix(in srgb, var(--control-edge) 58%, var(--line));
  border-radius: var(--control-radius);
  padding: 10px 11px;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--control-surface) 86%, var(--panel-strong)), color-mix(in srgb, var(--control-surface) 72%, var(--panel-strong)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.prompt-input {
  resize: vertical;
  min-height: 82px;
}

.brief-field input,
.brief-field textarea {
  grid-area: auto;
  min-height: 42px;
  resize: vertical;
  padding: 9px 10px;
  font-size: 13px;
}

.brief-field textarea {
  min-height: 72px;
}

.prompt-input:focus,
.brief-field input:focus,
.brief-field textarea:focus {
  border-color: color-mix(in srgb, var(--control-focus) 76%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--control-focus) 16%, transparent), 0 14px 34px color-mix(in srgb, var(--calm) 9%, transparent);
}

.audience-option {
  min-width: 0;
}

.voice-option {
  min-width: 0;
}

.voice-select-label {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  color: var(--ink);
}

.voice-select-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-select-copy strong {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 760;
}

.voice-select-copy label {
  display: contents;
}

.voice-select-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.voice-select {
  min-width: min(42%, 190px);
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--control-edge) 72%, var(--line));
  border-radius: calc(var(--control-radius) - 3px);
  padding: 0 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--control-surface) 88%, var(--bg));
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  outline: none;
}

.voice-select:disabled {
  appearance: none;
  -webkit-appearance: none;
  opacity: 1;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  cursor: default;
}

.voice-select-actions {
  min-width: min(58%, 302px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.voice-select-actions .voice-select {
  min-width: 0;
  flex: 1 1 150px;
}

.voice-preview-button .voice-preview-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.voice-preview-button {
  min-width: 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: 50%;
  padding: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 88%, var(--gold) 5%);
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.voice-preview-button:hover:not(:disabled),
.voice-preview-button:focus-visible,
.voice-preview-button.is-active {
  border-color: color-mix(in srgb, var(--gold) 76%, var(--line));
  background: color-mix(in srgb, var(--panel) 82%, var(--gold) 10%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent);
  outline: none;
}

.voice-preview-button:disabled {
  cursor: default;
  opacity: .5;
}

.voice-preview-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.voice-preview-button.is-active .voice-preview-icon {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
}

.voice-preview-button.is-loading .voice-preview-icon {
  width: 12px;
  height: 12px;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: voice-preview-spin .72s linear infinite;
}

.voice-preview-status.is-error {
  display: block;
  padding: 6px 4px 0;
  color: var(--danger, #e79a91);
  font-size: 11px;
  line-height: 1.3;
}

.voice-preview-status[hidden] {
  display: none;
}

@keyframes voice-preview-spin {
  to { transform: rotate(360deg); }
}

.voice-select:focus-visible {
  border-color: color-mix(in srgb, var(--control-focus) 76%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--control-focus) 16%, transparent);
}

@media (max-width: 560px) {
  .voice-select-label {
    align-items: stretch;
    flex-direction: column;
  }

  .voice-select-actions {
    width: 100%;
    min-width: 0;
  }

  .voice-preview-button {
    min-width: 102px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-preview-button.is-loading .voice-preview-icon {
    animation-duration: 1.5s;
  }
}

.audience-check {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--control-edge) 34%, var(--line));
  color: var(--ink);
  cursor: pointer;
}

.audience-check:has(input:checked) {
  border-color: color-mix(in srgb, var(--gold) 62%, var(--line));
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--gold) 7%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.audience-check:has(input:focus-visible) {
  border-color: color-mix(in srgb, var(--gold) 74%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent);
}

.audience-check input {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid color-mix(in srgb, var(--control-edge) 62%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--control-surface) 88%, var(--bg));
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.audience-check input::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 78%, var(--bg));
  transition: left .18s ease, background .18s ease;
}

.audience-check input:checked {
  border-color: color-mix(in srgb, var(--gold) 64%, var(--line));
  background: color-mix(in srgb, var(--gold) 30%, var(--control-surface));
}

.audience-check input:checked::after {
  left: 23px;
  background: var(--gold);
}

.audience-check input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 72%, transparent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .audience-check input,
  .audience-check input::after {
    transition: none;
  }
}

.audience-check-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.audience-check-copy strong {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 760;
}

.audience-check-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}


.slider-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label meta"
    "range range";
  gap: 8px 12px;
  min-width: 0;
  align-items: center;
}


/* Своя дорожка и свой бегунок. До v194 это был стоковый системный контрол с
 * одним лишь accent-color: посреди нарисованного интерфейса он и создавал
 * ощущение формы. Заполненная часть считается из --minutes-fill, который
 * ставится там же, где обновляется значение -- в пользовательских путях, не в
 * цикле опроса. */
.slider-wrap > input[type="range"] {
  --minutes-fill: 20%;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.slider-wrap > input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--control-edge) 38%, var(--line));
  background:
    linear-gradient(90deg,
      var(--gold) 0,
      var(--gold) var(--minutes-fill),
      color-mix(in srgb, var(--control-surface) 86%, var(--bg)) var(--minutes-fill),
      color-mix(in srgb, var(--control-surface) 86%, var(--bg)) 100%);
}

.slider-wrap > input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--control-edge) 38%, var(--line));
  background:
    linear-gradient(90deg,
      var(--gold) 0,
      var(--gold) var(--minutes-fill),
      color-mix(in srgb, var(--control-surface) 86%, var(--bg)) var(--minutes-fill),
      color-mix(in srgb, var(--control-surface) 86%, var(--bg)) 100%);
}

.slider-wrap > input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--gold) 62%, var(--line));
  background: radial-gradient(circle at 50% 34%, var(--calm), var(--accent));
  box-shadow: 0 2px 10px color-mix(in srgb, black 42%, transparent);
  transition: transform .16s var(--ease-standard), box-shadow .16s var(--ease-standard);
}

.slider-wrap > input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--gold) 62%, var(--line));
  background: radial-gradient(circle at 50% 34%, var(--calm), var(--accent));
  box-shadow: 0 2px 10px color-mix(in srgb, black 42%, transparent);
}

.slider-wrap > input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.08);
}

.slider-wrap > input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 46%, transparent);
}

.slider-wrap > input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 46%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .slider-wrap > input[type="range"]::-webkit-slider-thumb {
    transition: none;
  }
}

@media (forced-colors: active) {
  .slider-wrap > input[type="range"] {
    forced-color-adjust: none;
    accent-color: auto;
  }

  .slider-wrap > input[type="range"]::-webkit-slider-runnable-track,
  .slider-wrap > input[type="range"]::-moz-range-track {
    background: ButtonFace;
    border-color: ButtonText;
  }

  .slider-wrap > input[type="range"]::-webkit-slider-thumb,
  .slider-wrap > input[type="range"]::-moz-range-thumb {
    background: Highlight;
    border-color: ButtonText;
  }
}


/* Показание, а не подпись: длительность крупно основным цветом, цена спокойной
 * плашкой рядом. Оба узла вынесены ИЗ <label> ползунка -- пока они лежали
 * внутри, они попадали в произносимое имя контрола («Минуты 12 мин 60 MC»). */
.length-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.length-readout__value {
  color: var(--ink);
  font-size: 26px;
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: -.015em;
}

.length-readout__price {
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--control-edge) 44%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--control-surface) 82%, var(--bg));
  color: var(--calm);
  font-size: var(--sc-text-small);
  font-weight: 700;
  white-space: nowrap;
}

/* Границы диапазона: раньше узнать, что у подкаста максимум 15 минут, можно было
 * только упёршись в край ползунка. Значения ставит app.js из лимитов режима. */
.length-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--sc-text-small);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}


#quoteValue {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: color-mix(in srgb, var(--gold) 70%, var(--muted));
  font-variant-numeric: tabular-nums;
}

.settings-accordion {
  grid-area: brief;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line));
  border-radius: var(--control-radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg) 40%, var(--panel) 60%), color-mix(in srgb, var(--panel) 94%, var(--calm) 1.5%));
  overflow: hidden;
}

.settings-accordion[hidden] {
  display: none !important;
}

.settings-summary {
  min-height: 42px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
}

.settings-accordion[open] .settings-summary::after {
  content: "–";
}

.settings-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-title strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.settings-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-count {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--gold) 76%, var(--muted));
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 74%, transparent);
}

.brief-accordion {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0 10px 10px;
}

.brief-panel {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.brief-panel[hidden] {
  display: none !important;
}

.brief-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
}

.brief-headline strong {
  font-size: 13px;
}

.brief-headline span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-group {
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 42%, var(--panel) 58%);
  overflow: hidden;
}

.brief-group summary {
  min-height: 36px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.brief-group summary::-webkit-details-marker {
  display: none;
}

.brief-group summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.brief-group[open] summary::after {
  content: "–";
}

.brief-group summary strong {
  font-size: 13px;
}

.brief-group summary span {
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.brief-grid.single {
  grid-template-columns: 1fr;
}

.brief-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.brief-field.compact {
  align-content: start;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--control-radius);
  padding: 0 18px;
  color: var(--accent-ink);
  background:
    linear-gradient(180deg, #fce8ac, #e9bc58 55%, #c49735);
  background-size: 100% 100%;
  font-weight: 760;
  line-height: 1.08;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--gold) 12%, transparent), 0 0 28px color-mix(in srgb, var(--calm) 5%, transparent), inset 0 1px 0 rgba(255,255,255,.24);
  animation: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 15px 34px color-mix(in srgb, var(--accent) 23%, transparent), 0 0 34px color-mix(in srgb, var(--calm) 13%, transparent);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}

.primary-button:is([data-generate-state="quote"], [data-generate-state="submitting"], [data-generate-state="active"], [data-generate-state="clearing"]):disabled {
  cursor: wait;
}

.status-line {
  margin: 0;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.28;
  text-align: left;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.status-line[hidden],
.status-line:empty {
  display: none !important;
}

.status-line[data-kind="error"] {
  color: color-mix(in srgb, var(--danger) 70%, var(--ink));
}

.progress-stage {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 0;
  min-width: 0;
  padding: 10px 11px 11px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
  border-radius: var(--control-radius);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--gold) 5%, transparent), transparent 46%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel-strong) 98%, var(--gold) 1%), color-mix(in srgb, var(--panel-strong) 98%, var(--calm) 1.5%));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255,255,255,.055);
  backdrop-filter: blur(16px) saturate(1.04);
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
  position: relative;
  overflow: hidden;
}

.progress-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 4%, transparent), transparent);
  opacity: .34;
}

body[data-app-state="generating"] .progress-stage {
  grid-template-rows: 34px 29px;
  min-height: 94px;
  border-color: color-mix(in srgb, var(--gold) 34%, var(--calm) 18%);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 48%),
    radial-gradient(circle at 86% 100%, color-mix(in srgb, var(--calm) 9%, transparent), transparent 44%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel-strong) 98%, var(--gold) 2.2%), color-mix(in srgb, var(--panel-strong) 98%, var(--calm) 2.4%));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, .30),
    0 0 30px color-mix(in srgb, var(--gold) 8%, transparent),
    inset 0 1px 0 rgba(255,255,255,.07);
}

body[data-app-state="generating"] .progress-stage::before {
  background:
    linear-gradient(100deg, transparent 0 18%, color-mix(in srgb, var(--gold) 12%, transparent) 38%, color-mix(in srgb, var(--calm) 8%, transparent) 52%, transparent 74% 100%);
  opacity: .52;
  transform: none;
  animation: none;
}

.progress-head,
.progress-steps,
.progress-stage .status-line,
.failure-details {
  position: relative;
  z-index: 1;
}

.failure-details {
  display: grid;
  gap: 5px;
  text-align: center;
}

.failure-details[hidden] {
  display: none !important;
}

.failure-reason,
.failure-billing {
  margin: 0;
  line-height: 1.35;
}

.failure-reason {
  color: color-mix(in srgb, var(--ink) 88%, var(--danger));
  font-size: var(--sc-text-body);
  font-weight: 650;
}

.failure-billing {
  color: color-mix(in srgb, var(--gold) 72%, var(--muted));
  font-size: var(--sc-text-small);
  font-weight: 640;
}

.progress-stage[data-progress-phase="failed"] .progress-steps {
  display: none;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  text-align: center;
  padding: 0;
}

#progressTitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 780;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#progressTitle::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 80%, white 4%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 26%, transparent);
}

.progress-stage[data-progress-phase="idle"] #progressTitle::before {
  background: color-mix(in srgb, var(--muted) 58%, var(--gold) 18%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 12%, transparent);
}

.progress-stage[data-progress-phase="failed"] #progressTitle::before {
  background: color-mix(in srgb, var(--danger) 72%, var(--gold) 8%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--danger) 24%, transparent);
}

.progress-stage[data-progress-phase="ready"] #progressTitle::before {
  background: color-mix(in srgb, var(--calm) 68%, var(--gold) 12%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--calm) 24%, transparent);
}

.progress-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding-top: 0;
}

.progress-steps::before {
  display: none;
}

.progress-step {
  min-width: 0;
  min-height: 29px;
  display: grid;
  gap: 5px;
  align-items: start;
  justify-items: center;
  justify-content: center;
  padding: 1px 2px 0;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  background: transparent;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.08;
  text-align: center;
  white-space: normal;
  position: relative;
  transition: color .18s ease, text-shadow .18s ease;
}

.progress-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel-strong) 82%, var(--muted) 8%);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--panel-strong) 88%, transparent);
}

.result-text-panel {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--reader-air) 88%, var(--line));
  border-radius: var(--control-radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--bg) 76%, var(--reader-air)), color-mix(in srgb, var(--panel) 95%, var(--mode-air)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.065), 0 10px 24px rgba(0,0,0,.14);
  overflow: hidden;
}

.result-text-panel[hidden] {
  display: none !important;
}

.result-text-panel summary {
  min-height: 52px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.result-text-panel summary::-webkit-details-marker {
  display: none;
}

.result-text-panel .result-text-toggle-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: color-mix(in srgb, var(--gold) 76%, var(--muted));
  font-size: 11px;
  line-height: 1;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
}

.result-text-panel .result-text-toggle-copy::before {
  content: "Открыть";
}

.result-text-panel[open] .result-text-toggle-copy::before {
  content: "Свернуть";
}

.result-text-panel summary > span:not(.result-text-toggle-copy) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.result-text-panel strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.result-text-panel em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-style: normal;
}

.result-text-body {
  margin: 0;
  padding: 15px 16px 19px;
  border-top: 1px solid color-mix(in srgb, var(--reader-air) 74%, transparent);
  color: color-mix(in srgb, var(--ink) 91%, var(--muted));
  font-size: 15px;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: none;
  overflow: visible;
}

.progress-step.done {
  color: color-mix(in srgb, var(--calm) 76%, var(--ink));
}

.progress-step.done::before {
  background: color-mix(in srgb, var(--calm) 64%, var(--gold) 10%);
  border-color: color-mix(in srgb, var(--calm) 58%, var(--line));
  box-shadow: 0 0 10px color-mix(in srgb, var(--calm) 20%, transparent), 0 0 0 2px color-mix(in srgb, var(--panel-strong) 92%, transparent);
}

.progress-step.active {
  color: var(--ink);
  text-shadow: 0 0 12px color-mix(in srgb, var(--gold) 28%, transparent);
}

.progress-step.active::before {
  background: color-mix(in srgb, var(--gold) 86%, white 4%);
  border-color: color-mix(in srgb, var(--gold) 62%, var(--calm));
  box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 28%, transparent), 0 0 0 2px color-mix(in srgb, var(--panel-strong) 92%, transparent);
}

body[data-app-state="generating"] .progress-step.active::before {
  animation: none;
}

.player-shell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--mode-air) 62%, var(--line));
  border-radius: var(--control-radius);
  background:
    linear-gradient(138deg, color-mix(in srgb, var(--panel-strong) 95%, var(--mode-glow)), color-mix(in srgb, var(--panel-strong) 96%, var(--mode-air)) 58%, color-mix(in srgb, var(--panel-strong) 98%, black 8%)),
    var(--panel-strong);
  box-shadow: 0 16px 40px rgba(0,0,0,.32), 0 8px 24px color-mix(in srgb, var(--gold) 3%, transparent), var(--inner-light);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.result-reset-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding-top: 2px;
}

.result-reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 166px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--workflow-result-tint) 58%, var(--gold) 22%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 74%, var(--workflow-result-tint));
  color: color-mix(in srgb, var(--ink) 92%, var(--gold));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.result-reset-button:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--gold) 48%, var(--workflow-result-tint));
  background: color-mix(in srgb, var(--panel-strong) 64%, var(--workflow-result-tint));
  transform: translateY(-1px);
}

.result-reset-row[data-next-action="required"] .result-reset-button:first-child {
  border-color: color-mix(in srgb, var(--gold) 52%, var(--workflow-result-tint));
  background: color-mix(in srgb, var(--panel-strong) 58%, var(--workflow-result-tint));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--gold) 8%, transparent), inset 0 1px 0 rgba(255, 255, 255, .075);
}

.result-reset-button:focus-visible,
.result-clear-action:focus-visible,
.result-text-panel summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 68%, var(--calm));
  outline-offset: 2px;
}

.result-clear-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482300;
  display: grid;
  place-items: center;
  padding:
    max(14px, var(--sc-safe-top))
    max(14px, var(--sc-safe-right))
    max(14px, var(--sc-safe-bottom))
    max(14px, var(--sc-safe-left));
  background: rgba(1, 3, 4, .76);
  backdrop-filter: blur(12px) saturate(.86);
  -webkit-backdrop-filter: blur(12px) saturate(.86);
  animation: resultClearBackdropIn .24s var(--ease-standard) both;
}

.result-clear-modal[hidden] {
  display: none;
}

.result-clear-modal__panel {
  width: min(100%, 410px);
  display: grid;
  gap: 13px;
  justify-items: center;
  padding: clamp(20px, 5vw, 28px);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--danger) 24%);
  border-radius: clamp(20px, 5vw, 28px);
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 95%, var(--danger) 4%), color-mix(in srgb, var(--panel-strong) 98%, black 4%));
  box-shadow: 0 28px 80px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.025), var(--inner-light);
  text-align: center;
  animation: resultClearPanelIn .3s var(--ease-standard) both;
}

.result-clear-modal__eyebrow {
  color: color-mix(in srgb, var(--gold) 86%, var(--ink));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}

.result-clear-modal h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 5.4vw, 24px);
  line-height: 1.14;
}

.result-clear-modal p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.48;
  text-align: center;
}

.result-clear-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 3px;
}

.result-clear-action {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--muted) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.result-clear-action.danger {
  border-color: color-mix(in srgb, var(--danger) 56%, var(--line));
  background: color-mix(in srgb, var(--danger) 16%, var(--panel-strong));
  color: color-mix(in srgb, var(--ink) 90%, var(--danger));
}

.result-clear-action:disabled {
  cursor: default;
  opacity: .56;
}

.result-clear-modal[data-pending="true"] .result-clear-modal__panel {
  cursor: progress;
}

/* Выход. До v194 окно исчезало мгновенно по атрибуту -- появлялось мягко, а
 * пропадало рывком. Анимация ставится только при пользовательском закрытии:
 * при смене режима окно обязано исчезать сразу, иначе повиснет над новым
 * содержимым. Скрытие в JS идёт по первому из двух условий. */
.result-clear-modal[data-closing="true"] {
  animation: resultClearBackdropOut .24s var(--ease-standard) both;
  pointer-events: none;
}

.result-clear-modal[data-closing="true"] .result-clear-modal__panel {
  animation: resultClearPanelOut .24s var(--ease-standard) both;
}

@keyframes resultClearBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes resultClearPanelOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(.99); }
}

@media (prefers-reduced-motion: reduce) {
  .result-clear-modal[data-closing="true"],
  .result-clear-modal[data-closing="true"] .result-clear-modal__panel {
    animation: none;
  }
}

@keyframes resultClearBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes resultClearPanelIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-reset-button:disabled {
  cursor: default;
  opacity: .55;
}

.player-main {
  display: grid;
  align-content: center;
  min-width: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.player-shell[data-player-state="empty"] .player-seek-row,
.player-shell[data-player-state="empty"] .track-meta {
  display: none;
}

.player-shell::before {
  animation: none;
  transform: none;
  opacity: .12;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 8%, transparent), transparent);
}

.play-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 36% 28%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-warm) 90%, var(--gold) 2.5%), color-mix(in srgb, var(--bg) 90%, var(--calm) 2.5%));
  position: relative;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--gold) 5%, transparent), inset 0 1px 0 rgba(255,255,255,.10);
}

.play-button::after {
  content: "";
  position: absolute;
  left: 52%;
  top: 50%;
  transform: translate(-42%, -50%);
  border-left: 11px solid color-mix(in srgb, var(--gold) 88%, white);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.play-button.playing::after {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 15px;
  border: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 88%, white) 0 35%, transparent 35% 65%, color-mix(in srgb, var(--gold) 88%, white) 65%);
}

.play-button:disabled {
  opacity: .38;
}

.track-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.18;
  font-weight: 740;
  letter-spacing: 0;
}

.player-seek-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin: 5px 0 4px;
}

.player-time {
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.seek-slider {
  grid-area: auto;
  width: 100%;
  height: 22px;
  min-width: 0;
  margin: 0;
  accent-color: var(--gold);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--gold) 16%, transparent));
  cursor: pointer;
}

.seek-slider:disabled {
  cursor: default;
  opacity: .46;
  filter: none;
}

@keyframes panelSheen {
  0%, 46% { transform: translateX(-120%); opacity: 0; }
  58% { opacity: .44; }
  78%, 100% { transform: translateX(120%); opacity: 0; }
}

@keyframes ambientShift {
  from { transform: translate3d(-2%, 0, 0) rotate(-1deg); }
  to { transform: translate3d(2%, -1%, 0) rotate(1deg); }
}

@keyframes brandPulse {
  0%, 100% { filter: saturate(1); transform: scaleY(1); }
  50% { filter: saturate(1.2); transform: scaleY(1.08); }
}

.track-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  min-width: 0;
}

.track-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Selector-Anchored Unified Edge v9: top material/frame fade begins just below the mode switch. */
.action-dock {
  --app-bottom-signal-gap: 4px;
  --mig-bottom-signal-gap: var(--app-bottom-signal-gap);
  left: auto;
  right: auto;
  bottom: auto;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 5px 8px 8px;
  border: 0;
  border-radius: 0 0 var(--shell-radius) var(--shell-radius);
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  z-index: 5;
}

/* Mirrored: tail is half the shell row gap, see .top-panel::before. */
.action-dock::before {
  inset: calc(-1 * var(--sc-edge-fade)) 0 0 0;
  background:
    linear-gradient(var(--sc-edge-band), var(--sc-edge-band)),
    var(--sc-shell-edge-color);
  background-repeat: no-repeat, repeat;
  background-position: 0 0, 0 0;
  background-size: 100% var(--sc-edge-fade), auto;
  -webkit-mask-image: linear-gradient(
      0deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
  mask-image: linear-gradient(
      0deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Mirrored soft dissolving meeting edge for the dock: outline mask reuses
 * the fill's own .55/.75 stops (see .top-panel::after above for why). */
@supports ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
  .action-dock::after {
    inset: calc(-1 * var(--sc-edge-fade)) 0 0 0;
    border: 1px solid var(--shell-outline-color);
    border-top: 0;
    -webkit-mask-image: linear-gradient(
      0deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
    mask-image: linear-gradient(
      0deg,
      #000 0,
      #000 calc(100% - var(--sc-edge-fade)),
      rgba(0, 0, 0, .86) calc(100% - var(--sc-edge-fade) * 0.62),
      rgba(0, 0, 0, .42) calc(100% - var(--sc-edge-fade) * 0.28),
      transparent 100%
    );
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
}

.bottom-dock {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.bottom-dock .primary-button {
  align-self: stretch;
  min-height: 48px;
}

body[data-app-state="generating"] .bottom-dock .primary-button[disabled] {
  color: color-mix(in srgb, var(--accent-ink) 94%, black 6%);
  opacity: 1;
  background:
    linear-gradient(110deg, #f7dfa0, #e9bc58 56%, #f7dfa0);
  background-size: 190% 100%;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--gold) 18%, transparent), inset 0 1px 0 rgba(255,255,255,.18);
  background-position: 50% 50%;
  animation: none;
}

/* Bottom Signal v3: the shared primitive stays below StoryCast-owned shell edge and CTA. */
.action-dock[data-mig-bottom-chrome="v1"] {
  --mig-bottom-signal-text: rgba(236, 229, 210, .62);
  --mig-bottom-signal-accent: var(--gold);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, auto) var(--mig-bottom-signal-slot);
  gap: 0;
  padding: 5px 8px 8px;
}

.bottom-dock-actions {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  padding: 0;
}

.bottom-dock-signal {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: var(--app-bottom-signal-gap) 0 0;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 2px 0;
}

.legal-links a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

@media (min-width: 900px) {
  .work-panel {
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
    grid-template-areas:
      "intent creation"
      "topic result"
      "length result";
    gap: var(--workflow-gap);
    align-content: start;
  }

  .intent-section {
    grid-area: intent;
  }

  .topic-section {
    grid-area: topic;
  }

  .length-section {
    grid-area: length;
  }

  .creation-section {
    grid-area: creation;
  }

  .result-section {
    grid-area: result;
  }

  .prompt-input {
    min-height: 110px;
  }

  .mode-guide {
    max-width: 470px;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    height: auto;
    min-height: 100svh;
    min-height: 100dvh;
    place-items: stretch center;
    overflow: visible;
  }
  .auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "showcase"
      "info"
      "card"
      "footer";
  }
  .auth-showcase {
    padding: 14px;
  }
  .auth-info-panel {
    padding: 13px 14px;
  }
  .auth-card {
    padding: 14px;
  }
  .auth-footer {
    align-items: flex-start;
    flex-direction: column;
    align-self: stretch;
  }
  .auth-legal {
    justify-content: flex-start;
  }
  .app-shell {
    padding: max(8px, var(--sc-safe-top)) max(8px, var(--sc-safe-right)) 0 max(8px, var(--sc-safe-left));
  }
  .topbar {
    align-items: center;
    min-height: 56px;
  }
  .top-panel { padding: 8px; }
  .brand-descriptor { max-width: 240px; }
  .top-actions { gap: 4px; justify-content: flex-end; }
  .balance-chip {
    width: var(--chip-w);
    min-width: var(--chip-w);
    max-width: var(--chip-w);
    padding: 0 8px;
  }
  .workspace {
    min-height: 0;
    max-height: 100%;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .work-panel {
    gap: var(--workflow-gap-mobile);
    padding: 0;
  }
  .work-section {
    gap: 10px;
    padding: 12px;
  }
  .section-head {
    align-items: flex-start;
  }
  .composer {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "topic"
      "brief";
    min-height: 0;
  }
  .slider-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label meta"
      "range range";
    gap: 4px 10px;
  }
  .progress-stage {
    padding: 10px;
    gap: 8px;
  }
  .progress-steps {
    padding-top: 0;
  }
  .brief-headline { align-items: start; flex-direction: column; gap: 3px; }
  .mode-heading { align-items: start; flex-direction: column; gap: 3px; }
  .mode-heading span { white-space: normal; }
  .brief-headline span { white-space: normal; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-group summary span { display: none; }
  #progressTitle { font-size: 14px; }
  .progress-step {
    min-height: 28px;
    padding: 0 1px;
    font-size: 9px;
  }
  .player-shell {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 10px;
  }
  .play-button { width: 40px; height: 40px; }
  .play-button::after { left: 52%; top: 50%; }
  .action-dock {
    width: min(1120px, 100%);
    padding: 5px 8px 8px;
  }
  .bottom-dock {
    grid-template-columns: 1fr;
  }
  .primary-button { min-height: 44px; }
}

@media (max-height: 720px) {
  .auth-screen {
    height: auto;
    min-height: 100svh;
    min-height: 100dvh;
    place-items: start center;
    overflow: visible;
  }

  .auth-layout {
    min-height: auto;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "showcase card"
      "info card"
      "footer footer";
  }

  .auth-showcase,
  .auth-info-panel,
  .auth-card,
  .auth-footer {
    box-shadow: 0 16px 44px rgba(0,0,0,.30), var(--inner-light);
  }

  .auth-footer {
    align-self: stretch;
  }
}

@media (max-width: 860px) and (max-height: 720px) {
  .auth-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "showcase"
      "info"
      "card"
      "footer";
  }
}

@media (max-width: 460px) {
  .boot-orbit {
    width: 82px;
    height: 82px;
  }
  .boot-mark {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
    border-radius: 24px;
    font-size: 18px;
  }
  .boot-copy strong {
    font-size: clamp(1.38rem, 6vw, 1.72rem);
  }
  .auth-screen {
    padding: max(8px, var(--sc-safe-top)) max(8px, var(--sc-safe-right)) 0 max(8px, var(--sc-safe-left));
  }
  .auth-showcase {
    gap: 12px;
  }
  .auth-brand strong {
    font-size: 28px;
  }
  .auth-descriptor { font-size: 11px; }
  .brand-mark.auth-brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .topbar { gap: 8px; }
  .brand-name { font-size: 25px; }
  .brand-descriptor {
    max-width: 150px;
    font-size: 11px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
    font-size: 14px;
  }
  .ghost-button {
    min-height: 30px;
    padding: 0 7px;
  }
  .account-chip {
    min-width: 50px;
    padding-inline: 8px;
  }
  .account-chip .action-label {
    display: inline-flex;
    font-size: 10px;
  }
  .section-action-button span {
    display: none;
  }
  .balance-chip {
    display: inline-flex;
    min-height: 30px;
    width: var(--chip-w-mobile);
    min-width: var(--chip-w-mobile);
    max-width: var(--chip-w-mobile);
    padding: 0 7px;
    gap: 0;
    font-size: 13px;
  }
  #balanceSub { display: none; }
  .mode-switch { width: 100%; }
  .prompt-input { min-height: 66px; }
  .player-seek-row {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* StoryCast Surface v19 candidate layer
 * The historical filename is retained as a source entry. These bytes are
 * reminted into the current immutable candidate; historical releases stay frozen.
 * The frozen public/ legacy fallback never loads this file.
 */

html[data-ui-release] {
  --mig-safe-area-top: var(--sc-safe-top);
  --mig-safe-area-right: var(--sc-safe-right);
  --mig-safe-area-bottom: var(--sc-safe-bottom);
  --mig-safe-area-left: var(--sc-safe-left);
  --apps-wallet-test-safe-bottom: var(--sc-safe-bottom);
  --sc-workspace-width: 900px;
  --sc-shell-gutter: clamp(8px, 1.8vw, 18px);
  --sc-panel-radius: clamp(12px, 1.7vw, 18px);
  --sc-shell-row-gap: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #020304;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

html[data-ui-release] body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  isolation: isolate;
}

html[data-ui-release] body.auth-visible,
html[data-ui-release]:has(body.auth-visible) {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html[data-ui-release] .auth-screen {
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  padding: max(12px, var(--sc-safe-top)) max(10px, var(--sc-safe-right)) max(12px, var(--sc-safe-bottom)) max(10px, var(--sc-safe-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

html[data-ui-release] .auth-layout {
  width: min(940px, 100%);
  min-height: 100%;
  margin-inline: auto;
}

html[data-ui-release] .app-shell {
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  padding: max(8px, var(--sc-safe-top)) max(var(--sc-shell-gutter), var(--sc-safe-right)) 0 max(var(--sc-shell-gutter), var(--sc-safe-left));
  overflow: hidden;
}

html[data-ui-release] .app-shell :where(a, button, [role="button"], [role="tab"], input[type="checkbox"]) {
  touch-action: manipulation;
}

html[data-ui-release] :where(.shell-header, .topbar, .workspace, .action-dock) {
  width: min(var(--sc-workspace-width), 100%);
  max-width: 100%;
  margin-inline: auto;
}

html[data-ui-release] .top-panel {
  border-radius: var(--sc-panel-radius) var(--sc-panel-radius) 0 0;
  padding: clamp(8px, 1.2vw, 12px);
}

html[data-ui-release] .shell-header {
  gap: 0;
}

html[data-ui-release] .topbar {
  min-height: 52px;
}

html[data-ui-release] .brand-name {
  font-size: clamp(1.5rem, 4.2vw, 2rem);
  line-height: 1;
}

html[data-ui-release] .brand-descriptor {
  max-width: min(42vw, 390px);
}

html[data-ui-release] :where(.ghost-button, .balance-chip, .mode-button, .primary-button, .result-reset-button, .result-clear-action, .auth-submit) {
  min-height: 44px;
}

html[data-ui-release] :where(.prompt-input, .auth-input, .brief-field input, .brief-field textarea, .apps-buggiman-modal textarea) {
  font-size: max(16px, 1rem);
}

html[data-ui-release] :where(textarea, input, button, select, summary, a):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 78%, white 12%);
  outline-offset: 3px;
}

html[data-ui-release] .shell-header > .mode-rail {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 0 0;
}

html[data-ui-release] .mode-switch {
  width: 100%;
  min-height: 44px;
}

html[data-ui-release] .mode-button {
  position: relative;
  display: grid;
  place-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding-inline: 32px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: .01em;
}

html[data-ui-release] .mode-button > span {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  line-height: 1;
  text-align: center;
}

html[data-ui-release] .mode-operation-dot {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--calm) 82%, white 8%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--calm) 15%, transparent);
  opacity: 0;
  transform: translateY(-50%) scale(.72);
  transition: opacity 160ms ease, transform 160ms ease;
}

html[data-ui-release] .mode-button[data-operation-state="active"] .mode-operation-dot {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

html[data-ui-release] .operation-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 30px;
  margin-top: 4px;
}

html[data-ui-release] .operation-actions[hidden],
html[data-ui-release] .operation-text-button[hidden] {
  display: none !important;
}

html[data-ui-release] .operation-text-button {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  color: color-mix(in srgb, var(--muted) 80%, white 10%);
  background: transparent;
  font: inherit;
  font-size: .82rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}

html[data-ui-release] .operation-text-button:hover {
  color: var(--text);
}

html[data-ui-release] .workspace {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  padding: 12px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scroll-padding-block: var(--sc-edge-fade);
  scrollbar-width: none;
}

html[data-ui-release] .workspace::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html[data-ui-release] .work-panel,
html[data-ui-release] .work-panel:is(:not(.never)) {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: none;
  gap: clamp(9px, 1.4vw, 13px);
  align-content: start;
}

html[data-ui-release] :where(.intent-section, .topic-section, .settings-section, .length-section, .creation-section, .result-section) {
  grid-area: auto;
}

html[data-ui-release] .work-section {
  min-width: 0;
  gap: clamp(9px, 1.1vw, 12px);
  padding: clamp(12px, 1.8vw, 17px);
  border-radius: var(--sc-panel-radius);
}

html[data-ui-release] .intent-section {
  min-height: var(--recommendation-panel-size);
}

html[data-ui-release] .prompt-input {
  min-height: clamp(82px, 14vh, 118px);
  max-height: min(34dvh, 260px);
}

html[data-ui-release] .audience-check,
html[data-ui-release] .player-shell,
html[data-ui-release] .progress-stage,
html[data-ui-release] .result-text-panel {
  min-width: 0;
}

html[data-ui-release] :where(.slider-wrap > input[type="range"], .seek-slider) {
  min-height: 44px;
  touch-action: pan-x;
}

html[data-ui-release] .result-text-panel summary {
  min-height: 44px;
  align-items: center;
}

html[data-ui-release] .result-text-body {
  max-width: 72ch;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
}

html[data-ui-release] .player-shell {
  grid-template-columns: 44px minmax(0, 1fr);
}

html[data-ui-release] .play-button {
  width: 44px;
  height: 44px;
}

html[data-ui-release] .action-dock {
  padding-bottom: max(8px, var(--sc-safe-bottom));
}

html[data-ui-release] .action-dock[data-mig-bottom-chrome="v1"] {
  grid-template-rows: minmax(0, auto) var(--mig-bottom-signal-slot, 16px);
  padding: 5px 8px max(5px, var(--sc-safe-bottom));
}

html[data-ui-release] .bottom-dock-signal {
  min-width: 0;
  max-width: 100%;
  min-height: var(--mig-bottom-signal-slot, 16px);
  overflow: hidden;
}

html[data-ui-release] .apps-wallet-modal {
  --apps-wallet-test-safe-bottom: var(--sc-safe-bottom);
}

html[data-ui-release] .apps-wallet-modal__header {
  grid-row: 1;
}

html[data-ui-release] .apps-wallet-modal__notice {
  grid-row: 2;
}

html[data-ui-release] .apps-wallet-modal__scroll {
  grid-row: 3;
}

html[data-ui-release] .apps-wallet-modal__dock {
  grid-row: 4;
}

html[data-ui-release] .xapp-c1 {
  padding: max(20px, var(--sc-safe-top)) max(18px, var(--sc-safe-right)) max(20px, var(--sc-safe-bottom)) max(18px, var(--sc-safe-left));
}

html[data-ui-release] body[data-modal-active] {
  overflow: hidden;
}

html[data-ui-release] .storycast-first-use {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: grid;
  place-items: center;
  padding: max(18px, var(--sc-safe-top)) max(14px, var(--sc-safe-right)) max(18px, var(--sc-safe-bottom)) max(14px, var(--sc-safe-left));
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(10px) saturate(.9);
  -webkit-backdrop-filter: blur(10px) saturate(.9);
}

html[data-ui-release] .storycast-first-use__panel {
  width: min(520px, 100%);
  max-height: min(82dvh, 680px);
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 28px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: clamp(18px, 4vw, 26px);
  background-color: #0a0c0d;
  background-image:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 95%, var(--gold) 5%), color-mix(in srgb, var(--panel-strong) 95%, var(--calm) 5%));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .78), inset 0 1px 0 rgba(255, 255, 255, .08);
}

html[data-ui-release] .storycast-first-use [data-first-use-head] {
  padding: 18px 20px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
}

html[data-ui-release] .storycast-first-use [data-first-use-head] > div {
  display: grid;
  gap: 4px;
}

html[data-ui-release] .storycast-first-use [data-first-use-eyebrow] {
  color: color-mix(in srgb, var(--gold) 84%, white 8%);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

html[data-ui-release] .storycast-first-use [data-first-use-counter] {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

/* Смена карточек мягкая, как смена страниц загрузки: лента едет, входящая
   карточка проявляется со стороны движения. Переменную сдвига приходится
   регистрировать через @property — без регистрации Chromium подставляет её
   значение разом, и лента прыгает (общий скин по этой причине держит на
   ленте `transition: none`). */
@property --first-use-offset {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

/* Селектор с атрибутом обязателен: скин держит на корне
   `transition: opacity 150ms ease` со своей специфичностью, и правило меньшей
   силы не добавляет переход переменной, а молча проигрывает. */
html[data-ui-release] .storycast-first-use[data-first-use-root] {
  transition: opacity 150ms ease, --first-use-offset 340ms cubic-bezier(.22, .68, .24, 1);
}

html[data-ui-release] .storycast-first-use [data-first-use-slide][data-first-use-active="true"] {
  animation: storycast-first-use-page 300ms cubic-bezier(.22, .68, .24, 1) both;
}

html[data-ui-release] .storycast-first-use[data-first-use-direction="back"] [data-first-use-slide][data-first-use-active="true"] {
  animation-name: storycast-first-use-page-back;
}

@keyframes storycast-first-use-page {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes storycast-first-use-page-back {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] .storycast-first-use[data-first-use-root] {
    transition: none;
  }

  html[data-ui-release] .storycast-first-use [data-first-use-slide][data-first-use-active="true"] {
    animation: none;
  }
}

html[data-ui-release] .storycast-first-use [data-first-use-slides] {
  padding: 12px 0;
  overflow-x: hidden;
}

html[data-ui-release] .storycast-first-use [data-first-use-slide] {
  display: grid;
  align-content: center;
  box-sizing: border-box;
  min-height: 220px;
  padding: clamp(22px, 5vw, 38px) clamp(20px, 5vw, 34px);
  gap: 14px;
}

html[data-ui-release] .storycast-first-use h2,
html[data-ui-release] .storycast-first-use p {
  margin: 0;
}

/* Скин печатает заголовок в 24px весом 850 и тело в 16px холодным серым
   (`rgba(226,231,238,.7)`). Обе строки перебиваются только селектором не ниже
   скинового, поэтому здесь везде `.storycast-first-use [data-first-use-slide]`.
   Вес 850 у Georgia давал жёсткий, «резкий» контур; тон приведён к тёплому. */
html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slide] h2 {
  max-width: 24ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.62rem, 3.4vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.004em;
  text-wrap: balance;
  color: color-mix(in srgb, var(--ink) 94%, var(--gold));
}

html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slide] p {
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
  font-size: 15.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slide] [data-first-use-points] {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
  font-size: 15.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slide] [data-first-use-points] li {
  position: relative;
  padding-left: 20px;
}

html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slide] [data-first-use-points] li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .62em;
  inline-size: 6px;
  block-size: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 78%, transparent);
}

html[data-ui-release] .storycast-first-use[data-first-use-root] [data-first-use-slot="why_it_matters"] [data-first-use-points] {
  gap: 10px;
}

html[data-ui-release] .storycast-first-use [data-first-use-actions] {
  padding: 12px 20px 18px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
}

html[data-ui-release] .storycast-first-use [data-first-use-progress] {
  align-items: center;
}

html[data-ui-release] .storycast-first-use [data-first-use-dot] {
  flex: 0 0 auto;
  box-sizing: border-box;
  inline-size: 8px;
  block-size: 8px;
  min-inline-size: 0;
  min-block-size: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
}

html[data-ui-release] .storycast-first-use [data-first-use-dot][aria-current="step"] {
  inline-size: 22px;
  background: var(--gold);
  box-shadow: 0 0 16px color-mix(in srgb, var(--gold) 55%, transparent);
}

html[data-ui-release] .storycast-first-use button {
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--gold) 65%, transparent);
  border-radius: var(--control-radius);
  color: var(--accent-ink);
  background: linear-gradient(110deg, color-mix(in srgb, var(--gold) 84%, white 5%), color-mix(in srgb, var(--calm) 12%, var(--gold)));
  font-weight: 800;
}

html[data-ui-release] .storycast-first-use [data-first-use-control="skip"],
html[data-ui-release] .storycast-first-use [data-first-use-control="back"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border-color: color-mix(in srgb, var(--gold) 18%, var(--line));
}

/* Apps v5 stays byte-exact. StoryCast owns only this consumer-side rail
 * allocator so the provider control remains reachable in every visual viewport. */
html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"] {
  box-sizing: border-box;
  left: var(--sc-provider-rail-left, calc(100% - 52px)) !important;
  top: var(--sc-provider-rail-top, 50%) !important;
  right: auto !important;
  bottom: auto !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
  border-radius: 14px;
  opacity: .88;
  transform: none !important;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

html[data-ui-release] body[data-storycast-provider-rail-placement="dock"] .bottom-dock-actions {
  padding-right: 52px;
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"]:hover {
  opacity: 1;
  transform: translateX(-2px) !important;
  background: rgba(34, 30, 21, .94);
  border-color: color-mix(in srgb, var(--gold) 82%, white 8%);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .34), 0 0 22px color-mix(in srgb, var(--gold) 20%, transparent);
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"]:focus-visible {
  opacity: 1;
  transform: translateX(-3px) !important;
  background: rgba(40, 34, 22, .98);
  border-color: color-mix(in srgb, var(--gold) 92%, white 8%);
  box-shadow: 0 0 0 3px rgba(5, 6, 7, .96), 0 0 0 5px color-mix(in srgb, var(--gold) 84%, white 10%);
  outline: 2px solid color-mix(in srgb, var(--gold) 88%, white 12%);
  outline-offset: 3px;
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"]:active {
  opacity: 1;
  transform: translateX(-1px) !important;
  background: rgba(52, 42, 22, .98);
  border-color: color-mix(in srgb, var(--gold) 96%, white 12%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .34), inset 0 1px 5px rgba(0, 0, 0, .44);
  filter: brightness(1.08);
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"]:disabled,
html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .42;
  transform: none !important;
  filter: grayscale(.7) saturate(.45);
  border-color: color-mix(in srgb, var(--muted) 46%, transparent);
  background: rgba(20, 20, 20, .84);
  box-shadow: none;
}

/* Apps v5 owns the semantic modal lease but its frozen provider CSS leaves the
 * external rail perceptible. StoryCast projects the exact provider modal owner
 * and suppression lease into complete visual/hit-test suppression without
 * coupling that invariant to one immutable StoryCast release id. */
html[data-ui-release] body[data-overlay-root][data-modal-active="provider-buggiman"] > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-apps-provider-modal-suppressed="true"] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

html[data-ui-release] body[data-overlay-root][data-modal-active="first-use"] > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-apps-provider-modal-suppressed="true"],
html[data-ui-release] body[data-overlay-root][data-modal-active="wallet"] > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-apps-provider-modal-suppressed="true"] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-suppressed="true"],
html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-suppressed="true"]:hover,
html[data-ui-release] body > .apps-buggiman-rail[data-apps-buggiman-reporter="true"][data-suppressed="true"]:focus-visible {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 12px)) !important;
}

@media (min-width: 700px) {
  html[data-ui-release] {
    --sc-shell-gutter: clamp(14px, 2.2vw, 28px);
  }

  html[data-ui-release] .work-section {
    padding-inline: clamp(16px, 2.5vw, 22px);
  }

  html[data-ui-release] .topic-section .composer,
  html[data-ui-release] .settings-section .audience-option,
  html[data-ui-release] .settings-section .voice-option,
  html[data-ui-release] .progress-stage,
  html[data-ui-release] .player-shell,
  html[data-ui-release] .result-text-panel {
    max-width: 780px;
  }
}

@media (max-width: 699px) {
  html[data-ui-release] {
    --sc-panel-radius: 13px;
    --sc-shell-row-gap: 0;
  }

  html[data-ui-release] .app-shell {
    padding-inline: max(8px, var(--sc-safe-left)) max(8px, var(--sc-safe-right));
  }

  html[data-ui-release] .topbar {
    gap: 7px;
    min-height: 46px;
  }

  html[data-ui-release] .brand-block {
    gap: 8px;
  }

  html[data-ui-release] .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  html[data-ui-release] .brand-name {
    font-size: clamp(1.3rem, 6.2vw, 1.65rem);
  }

  html[data-ui-release] .brand-descriptor {
    max-width: min(35vw, 160px);
    font-size: .7rem;
  }

  html[data-ui-release] .account-chip {
    min-width: 48px;
    padding-inline: 7px;
  }

  html[data-ui-release] .balance-chip {
    width: clamp(74px, 22vw, 86px);
    min-width: clamp(74px, 22vw, 86px);
    max-width: clamp(74px, 22vw, 86px);
    padding-inline: 6px;
  }

  html[data-ui-release] .work-section {
    padding: 12px;
  }

  html[data-ui-release] .section-description,
  html[data-ui-release] .mode-guide {
    line-height: 1.35;
  }

  html[data-ui-release] .storycast-first-use {
    place-items: end center;
    padding: 0;
  }

  html[data-ui-release] .storycast-first-use__panel {
    width: 100%;
    max-height: min(88dvh, 680px);
    padding: 20px max(16px, var(--sc-safe-right)) max(20px, var(--sc-safe-bottom)) max(16px, var(--sc-safe-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  html[data-ui-release] .storycast-first-use [data-first-use-slide] {
    min-height: 190px;
  }
}

@media (max-width: 360px) {
  html[data-ui-release] .brand-descriptor {
    display: none;
  }

  html[data-ui-release] .top-actions {
    gap: 3px;
  }

  html[data-ui-release] .balance-chip {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    font-size: .76rem;
  }

  html[data-ui-release] .section-head {
    gap: 8px;
  }

}

@media (max-height: 620px) and (max-width: 699px) {
  html[data-ui-release] .top-panel {
    padding-block: 6px;
  }

  html[data-ui-release] .topbar {
    min-height: 40px;
  }

  html[data-ui-release] .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  html[data-ui-release] .mode-switch,
  html[data-ui-release] .mode-button { min-height: 44px; }
}

@media (max-height: 280px) and (max-width: 360px) {
  html[data-ui-release] {
    --sc-shell-row-gap: 0;
  }

  html[data-ui-release] .app-shell {
    padding-top: max(2px, var(--sc-safe-top));
  }

  html[data-ui-release] .top-panel {
    padding: 2px 4px;
  }

  html[data-ui-release] .topbar {
    min-height: 44px;
  }

  html[data-ui-release] .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  html[data-ui-release] .brand-name {
    font-size: 1.2rem;
  }

  html[data-ui-release] .brand-descriptor {
    display: none;
  }

  html[data-ui-release] .mode-switch {
    min-height: 44px;
    padding: 0;
  }

  html[data-ui-release] .mode-button {
    min-height: 44px;
  }

  html[data-ui-release] .action-dock[data-mig-bottom-chrome="v1"] {
    --app-bottom-signal-gap: 0px;
    padding: 0 3px var(--sc-safe-bottom);
  }

  html[data-ui-release] .bottom-dock .primary-button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] *,
  html[data-ui-release] *::before,
  html[data-ui-release] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  html[data-ui-release] :where(.work-section, .top-panel, .action-dock, .player-shell, .progress-stage, .storycast-first-use__panel) {
    border: 1px solid CanvasText;
    box-shadow: none;
  }
}

@layer mig-app-entry-foundation {
  [data-app-entry-root] {
    display: grid;
    inline-size: min(100%, 900px);
    margin-inline: auto;
    gap: var(--app-entry-gap, 16px);
  }

  [data-app-entry-region="identity"],
  [data-app-entry-region="description"],
  [data-app-entry-region="auth"],
  [data-app-entry-region="account-help"] {
    min-inline-size: 0;
  }

  [data-app-entry-region="identity"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  [data-app-entry-identity] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-inline-size: 0;
  }

  [data-app-entry-copy] {
    display: grid;
    gap: 6px;
    max-inline-size: var(--app-entry-copy-inline, 62ch);
  }

  [data-app-entry-auth-tabs] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  [data-app-entry-auth-pane][hidden],
  [data-first-use-slide][hidden],
  [data-first-use-control][hidden] {
    display: none;
  }

  [data-app-entry-form] {
    display: grid;
    gap: 12px;
  }

  [data-app-entry-form] label {
    display: grid;
    gap: 6px;
    min-inline-size: 0;
  }

  [data-app-entry-form] input,
  [data-app-entry-form] button,
  [data-app-entry-auth-tabs] button,
  [data-first-use-control] {
    min-block-size: 44px;
  }

  [data-app-entry-feedback] {
    min-block-size: 1.35em;
    overflow-wrap: anywhere;
  }

  [data-first-use-root] {
    position: absolute;
    inset: 0;
    z-index: var(--app-first-use-z, 40);
    display: grid;
    place-items: center;
    padding: var(--app-first-use-overlay-padding, 16px);
  }

  [data-first-use-root][hidden] {
    display: none;
  }

  [data-first-use-panel] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    inline-size: min(100%, var(--app-first-use-panel-inline, 680px));
    max-block-size: calc(100% - 2 * var(--app-first-use-panel-clearance, 8px));
    min-inline-size: 0;
    overflow: hidden;
    outline: none;
  }

  [data-first-use-head],
  [data-first-use-actions] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-inline-size: 0;
  }

  [data-first-use-slides] {
    min-block-size: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  [data-first-use-slide] {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  [data-first-use-progress] {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  [data-first-use-dot] {
    inline-size: 8px;
    block-size: 8px;
    border-radius: 999px;
  }

  [data-first-use-actions] {
    flex-wrap: wrap;
  }

  [data-first-use-action-group] {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
  }

  @media (max-width: 420px) {
    [data-app-entry-root] {
      gap: var(--app-entry-gap-compact, 12px);
    }

    [data-first-use-root] {
      padding: var(--app-first-use-overlay-padding-compact, 8px);
    }

    [data-first-use-head] {
      align-items: start;
    }

    [data-first-use-actions] {
      align-items: stretch;
    }

    [data-first-use-action-group] {
      inline-size: 100%;
      margin-inline-start: 0;
    }

    [data-first-use-action-group] > * {
      flex: 1 1 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    [data-app-entry-root],
    [data-first-use-root],
    [data-first-use-panel],
    [data-first-use-slide] {
      scroll-behavior: auto;
      transition-duration: 0.01ms;
      animation-duration: 0.01ms;
      animation-iteration-count: 1;
    }
  }
}

/*
 * Canonical region projection.
 * Release builders append the foundation after the app skin so this
 * structural rule wins legacy column placement without owning colors,
 * typography, materials, safe areas or product copy. The two phantom-ID
 * branches are a deliberate specificity escrow: :is() matches through the
 * attribute branch, while its specificity outranks historical body/app/id
 * selectors without priority flags or app-specific patches.
 */
:is(#mig-app-entry-root-a, [data-app-entry-root]):is(#mig-app-entry-root-b, [data-app-entry-root]) {
  inline-size: min(100%, 900px);
  max-inline-size: 900px;
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "identity"
    "description"
    "auth"
    "account-help";
}

:is(#mig-app-entry-root-a, [data-app-entry-root]):is(#mig-app-entry-root-b, [data-app-entry-root]) > [data-app-entry-region="identity"] {
  grid-area: identity;
}

:is(#mig-app-entry-root-a, [data-app-entry-root]):is(#mig-app-entry-root-b, [data-app-entry-root]) > [data-app-entry-region="description"] {
  grid-area: description;
}

:is(#mig-app-entry-root-a, [data-app-entry-root]):is(#mig-app-entry-root-b, [data-app-entry-root]) > [data-app-entry-region="auth"] {
  grid-area: auth;
}

:is(#mig-app-entry-root-a, [data-app-entry-root]):is(#mig-app-entry-root-b, [data-app-entry-root]) > [data-app-entry-region="account-help"] {
  grid-area: account-help;
}

/*
 * State truth must outrank app skins as reliably as the region projection.
 * Some historical skins give visible slide/control selectors app-level
 * specificity. These escrow selectors keep the native `hidden` contract
 * authoritative without priority flags and without per-app overrides.
 */
:is(#mig-app-entry-pane-hidden-a, [data-app-entry-auth-pane]):is(#mig-app-entry-pane-hidden-b, [data-app-entry-auth-pane])[hidden],
:is(#mig-first-use-slide-hidden-a, [data-first-use-slide]):is(#mig-first-use-slide-hidden-b, [data-first-use-slide])[hidden],
:is(#mig-first-use-control-hidden-a, [data-first-use-control]):is(#mig-first-use-control-hidden-b, [data-first-use-control])[hidden],
:is(#mig-first-use-root-hidden-a, [data-first-use-root]):is(#mig-first-use-root-hidden-b, [data-first-use-root])[hidden] {
  display: none;
}
/* STORYCAST-WORKBENCH-V21-OWNER
 * StoryCast successor workbench source.
 * This file is appended only to a new immutable candidate. The active v20
 * source closure remains untouched until compatibility-first activation. */

html[data-ui-release] {
  --sc-route-motion-duration: 180ms;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--gold) 4%, transparent), transparent 42%),
    linear-gradient(180deg, #020304 0%, #040506 52%, #020304 100%);
}

html[data-ui-release] body {
  background: transparent;
}

html[data-ui-release] .topbar {
  align-items: stretch;
}

html[data-ui-release] :where(.brand-block, .top-actions) {
  min-height: 44px;
}

html[data-ui-release] .top-actions {
  align-self: stretch;
}

html[data-ui-release] .top-actions > :where(a, button) {
  min-height: 44px;
  align-self: stretch;
}

html[data-ui-release] :where(
  .composer,
  .prompt-input,
  .audience-option,
  .audience-check,
  .voice-option,
  .voice-select-label,
  .length-readout,
  .slider-wrap,
  .progress-stage,
  .player-shell,
  .result-text-panel
) {
  width: 100%;
  max-width: 100%;
}

html[data-ui-release] #workPanel {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--sc-route-motion-duration) cubic-bezier(.22, .68, .24, 1),
    transform var(--sc-route-motion-duration) cubic-bezier(.22, .68, .24, 1);
  will-change: auto;
}

/* Поверхности секций не гаснут никогда. Прежний переход уводил весь рабочий
 * столбец в opacity: 0 на 130ms, а столбец -- это и есть панели: сквозь него
 * было видно почти чёрный фон оболочки. Гасить нечего, поэтому чернеть нечему;
 * въезжает только содержимое секций. Оттенки режима меняются в commitMode, то
 * есть в тот момент, когда это содержимое ещё прозрачно. */
html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > * {
  animation: storycast-mode-rise .28s var(--ease-standard) both;
  will-change: opacity, transform;
}

/* Ярусы по роли, а не по глубине: правило действует на ПРЯМЫХ детей секции, до
 * внуков оно не достаёт. Крупное движется дольше, тихое быстрее -- слоистость
 * даёт разная длительность, а не сдвиг по времени. Ребёнок, не попавший ни в
 * один ярус, движется базовой длительностью выше. */
html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > .section-head {
  animation-duration: .38s;
}

html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > :is(
  .composer,
  .slider-wrap,
  .voice-option,
  .progress-stage,
  .player-shell,
  .recommendation-carousel
) {
  animation-duration: .3s;
}

html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > :is(
  .audience-option,
  .result-text-panel,
  .result-reset-row
) {
  animation-duration: .28s;
}

html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > :is(
  .creation-feedback,
  .length-scale,
  .length-readout
) {
  animation-duration: .24s;
}

@keyframes storycast-mode-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 7px, 0) scale(.988);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] #workPanel[data-mode-transition="entering"] .work-section > * {
    animation: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  html[data-ui-release] :where(.ghost-button, .balance-chip, .mode-button):hover {
    border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
    box-shadow: 0 10px 30px color-mix(in srgb, var(--gold) 14%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] #workPanel {
    transition: none;
    transform: none;
  }
}

/* STORYCAST-WORKBENCH-V26-PROVIDER-EDGE
 * Apps v5 owns reporter semantics and modal behavior. StoryCast owns only the
 * visual-viewport allocator: the locked 44x44 control stays on the viewport
 * edge, never enters the bounded workbench or bottom action panel, and never
 * reserves layout width.
 */

html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"] {
  position: fixed !important;
  left: auto !important;
  right: var(--sc-provider-rail-right, max(0px, var(--sc-safe-right))) !important;
  top: var(--sc-provider-rail-top, 50%) !important;
  bottom: auto !important;
  box-sizing: border-box;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
  border-radius: 14px;
  opacity: .88;
  transform: translateY(-50%) !important;
  transition:
    opacity 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"]:hover {
  opacity: 1;
  transform: translateY(-50%) !important;
  background: rgba(34, 30, 21, .94);
  border-color: color-mix(in srgb, var(--gold) 82%, white 8%);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .34), 0 0 22px color-mix(in srgb, var(--gold) 20%, transparent);
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"]:focus-visible {
  opacity: 1;
  transform: translateY(-50%) !important;
  background: rgba(40, 34, 22, .98);
  border-color: color-mix(in srgb, var(--gold) 92%, white 8%);
  box-shadow: 0 0 0 3px rgba(5, 6, 7, .96), 0 0 0 5px color-mix(in srgb, var(--gold) 84%, white 10%);
  outline: 2px solid color-mix(in srgb, var(--gold) 88%, white 12%);
  outline-offset: 3px;
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"]:active:not(:disabled) {
  opacity: 1;
  transform: translateY(-50%) !important;
  background: rgba(52, 42, 22, .98);
  border-color: color-mix(in srgb, var(--gold) 96%, white 12%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .34), inset 0 1px 5px rgba(0, 0, 0, .44);
  filter: brightness(1.08);
}

html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"]:disabled,
html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"][aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .42;
  transform: translateY(-50%) !important;
  filter: grayscale(.7) saturate(.45);
  border-color: color-mix(in srgb, var(--muted) 46%, transparent);
  background: rgba(20, 20, 20, .84);
  box-shadow: none;
}

html[data-ui-release] body[data-overlay-root] > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"][data-apps-provider-modal-suppressed="true"],
html[data-ui-release] body > .apps-buggiman-rail[data-apps-provider-owner="20260723-apps-shell-return-v6"][data-apps-buggiman-reporter="true"][data-suppressed="true"] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-50%) !important;
}

/* STORYCAST-STANDALONE-FRAME-V32: UA viewport plus opposing insets are the
 * single installed frame; app content inherits that solved block size. */
@media (display-mode: standalone) {
  html[data-ui-release] {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  html[data-ui-release] body {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  html[data-ui-release] .app-shell,
  html[data-ui-release] .auth-screen {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }
}

/* STORYCAST-AUTH-ENTRY-001-CASCADE-CLOSE
 * The frozen canonical projection intentionally owns broad region stacking
 * with ID-level specificity. StoryCast closes only its accepted successor
 * root after that provider so the compact 420px panel remains authoritative
 * at desktop sizes while the provider stays untouched for other apps. */
html[data-ui-release] :is(#storycast-entry-root-a, .auth-layout[data-auth-entry-canon="storycast-entry-v1"]):is(#storycast-entry-root-b, .auth-layout[data-auth-entry-canon="storycast-entry-v1"]) {
  inline-size: min(100%, var(--auth-panel-max));
  max-inline-size: var(--auth-panel-max);
  grid-template-areas: none;
}

html[data-ui-release] :is(#storycast-entry-root-a, .auth-layout[data-auth-entry-canon="storycast-entry-v1"]):is(#storycast-entry-root-b, .auth-layout[data-auth-entry-canon="storycast-entry-v1"]) > [data-app-entry-region] {
  grid-area: auto;
}

/* STORYCAST-AUTH-ENTRY-002: Apps v103 geometry transferred into StoryCast's
 * app-local palette and auth/gate ownership. The v1 block above remains
 * historical source evidence; only this v2 root is selected by current HTML. */
html[data-ui-release] .auth-screen:has(.auth-layout[data-auth-entry-canon="storycast-entry-v2"]) {
  --sc-auth-panel-inline: min(100%, 440px);
  grid-template-columns: var(--sc-auth-panel-inline);
  place-items: safe center;
  align-content: safe center;
  justify-content: center;
  padding: clamp(8px, 2.5vw, 18px);
  overflow-x: hidden;
  overflow-y: auto;
}

html[data-ui-release] .auth-screen.auth-screen--anchored:has(.auth-layout[data-auth-entry-canon="storycast-entry-v2"]) {
  align-items: safe start;
  align-content: start;
}

html[data-ui-release] :is(#storycast-entry-v2-a, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]):is(#storycast-entry-v2-b, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]) {
  --auth-panel-max: 560px;
  --auth-entry-padding: clamp(14px, 3vw, 22px);
  --auth-entry-rhythm: clamp(10px, 2vw, 14px);
  --auth-mark-size: clamp(58px, 11vw, 66px);
  --auth-tab-height: 44px;
  --auth-control-height: 48px;
  box-sizing: border-box;
  inline-size: min(100%, var(--auth-panel-max));
  max-inline-size: var(--auth-panel-max);
  min-block-size: 0;
  align-self: safe center;
  margin: auto;
  padding: var(--auth-entry-padding);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: none;
  grid-template-rows: auto;
  align-content: start;
  gap: var(--auth-entry-rhythm);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  border-radius: clamp(22px, 5vw, 30px);
  background:
    radial-gradient(circle at 12% -8%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 34%),
    linear-gradient(155deg, color-mix(in srgb, var(--panel-strong) 95%, var(--gold) 5%), color-mix(in srgb, var(--panel-strong) 95%, var(--calm) 5%)),
    var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42), 0 0 30px color-mix(in srgb, var(--gold) 8%, transparent), var(--inner-light);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
}

html[data-ui-release] :is(#storycast-entry-v2-a, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]):is(#storycast-entry-v2-b, .auth-layout[data-auth-entry-canon="storycast-entry-v2"])[data-auth-anchored="true"] {
  align-self: start;
  margin-bottom: 0;
}

html[data-ui-release] :is(#storycast-entry-v2-a, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]):is(#storycast-entry-v2-b, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]) > [data-app-entry-region] {
  grid-area: auto;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] > [data-app-entry-region]::before {
  content: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand {
  display: grid;
  grid-template-columns: var(--auth-mark-size) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2.5vw, 18px);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand-mark,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand-mark img {
  display: block;
  width: var(--auth-mark-size);
  height: var(--auth-mark-size);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand-mark {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand-mark::after {
  content: none;
  display: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  text-align: left;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand strong {
  margin: 0;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-descriptor {
  max-width: 34ch;
  text-wrap: balance;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-size: clamp(13px, 2.7vw, 15px);
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 9px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 0;
  padding: 3px;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-deep) 64%, transparent);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-tab {
  display: inline-flex;
  min-width: 0;
  min-height: var(--auth-tab-height);
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  background: linear-gradient(105deg, rgb(from color-mix(in srgb, var(--gold) 78%, white 4%) r g b / 0), rgb(from color-mix(in srgb, var(--accent) 30%, var(--gold)) r g b / 0) 62%, rgb(from color-mix(in srgb, var(--calm) 8%, var(--gold)) r g b / 0));
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, filter 160ms ease, transform 160ms ease;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-tab.active {
  border-color: transparent;
  color: var(--accent-ink);
  background: linear-gradient(180deg, #fce8ac, #e9bc58 55%, #c49735);
  box-shadow: 0 0 16px color-mix(in srgb, var(--gold) 38%, transparent);
  animation: storycast-auth-gold-pulse 3.8s ease-in-out infinite;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-tab:hover:not([aria-disabled="true"]),
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] [aria-disabled="true"] {
  pointer-events: none;
  opacity: .58;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-zone {
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-zone--animating {
  overflow: hidden;
  transition: height 320ms cubic-bezier(.22, .68, .24, 1);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-pane-stack,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-status {
  position: relative;
  display: grid;
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-form-pane {
  grid-area: 1 / 1;
  display: grid;
  min-width: 0;
  width: 100%;
  visibility: hidden;
  opacity: 0;
  transform: scale(.97) translateY(6px);
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(.22, .68, .24, 1), transform 180ms cubic-bezier(.22, .68, .24, 1), visibility 0s linear 180ms;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-form-pane[data-auth-pane-state="active"] {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
  animation: storycast-auth-reveal 180ms cubic-bezier(.22, .68, .24, 1) both;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-form:focus {
  outline: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-form {
  display: grid;
  align-content: start;
  gap: 8px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] [data-app-entry-field] {
  display: grid;
  gap: 4px;
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--auth-control-height);
  padding: 11px 14px 11px 40px;
  border-radius: 15px;
  font-size: 16px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-submit {
  width: 100%;
  min-height: var(--auth-control-height);
  margin: 0;
  border-radius: 999px;
  cursor: pointer;
  animation: storycast-auth-gold-pulse 3.8s ease-in-out infinite;
  transition: filter 160ms ease, transform 160ms ease;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-submit:disabled {
  cursor: progress;
  opacity: .62;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-status {
  min-height: 0;
  place-items: stretch;
  color: var(--muted);
  text-align: center;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"][data-auth-mode="register"] .storycast-auth-status {
  padding-top: 12px;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-status > * {
  grid-area: 1 / 1;
  min-width: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-mode-tail[aria-hidden="true"] {
  display: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-register-tail[aria-hidden="false"] {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 54px;
  text-align: left;
  animation: storycast-auth-reveal 180ms cubic-bezier(.22, .68, .24, 1) both;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-status {
  box-sizing: border-box;
  display: grid;
  min-height: 54px;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent);
  border-radius: 11px;
  color: color-mix(in srgb, var(--danger) 42%, white);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  font-size: 12px;
  line-height: 1.3;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-status[data-kind="pending"] {
  border-color: color-mix(in srgb, var(--calm) 36%, transparent);
  color: color-mix(in srgb, var(--calm) 76%, white);
  background: color-mix(in srgb, var(--calm) 12%, transparent);
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-status[hidden],
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-fallback[hidden] {
  display: none !important;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"][data-auth-feedback-visible] .storycast-auth-status > :not(.auth-status):not(.auth-fallback) {
  visibility: hidden;
  pointer-events: none;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  background: transparent;
  font-size: 12.5px;
  line-height: 1.42;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  cursor: pointer;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-check a,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a:hover,
html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a:focus-visible {
  color: color-mix(in srgb, var(--gold) 86%, var(--ink));
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-footer {
  display: block;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, max-content);
  align-items: center;
  justify-content: center;
  gap: 0 12px;
  padding: 0;
}

html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: color-mix(in srgb, var(--muted) 78%, var(--ink));
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

@keyframes storycast-auth-reveal {
  from { opacity: 0; transform: scale(.97) translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
  html[data-ui-release] .auth-screen:has(.auth-layout[data-auth-entry-canon="storycast-entry-v2"]) {
    padding: 8px;
  }

  html[data-ui-release] :is(#storycast-entry-v2-a, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]):is(#storycast-entry-v2-b, .auth-layout[data-auth-entry-canon="storycast-entry-v2"]) {
    --auth-entry-padding: 14px;
    --auth-entry-rhythm: 10px;
    border-radius: 25px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-brand strong {
    font-size: clamp(28px, 8vw, 34px);
  }
}

@media (max-width: 350px) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a {
    grid-column: span 2;
    justify-content: center;
    font-size: 10.5px;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a:nth-last-child(2) { grid-column: 2 / span 2; }
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .auth-legal a:last-child { grid-column: 4 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] :where(.auth-tab, .auth-form-pane, .auth-register-tail, .auth-submit) {
    animation: none;
    transition: none;
  }

  html[data-ui-release] .auth-layout[data-auth-entry-canon="storycast-entry-v2"] .storycast-auth-zone--animating {
    transition: none;
  }
}

/* Must follow every responsive generic .brand-mark rule. */
html[data-ui-release] .shell-header .brand-block > .brand-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transform: none;
}
