*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    var(--color-canvas);
  background-size: 22px 22px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: var(--fw-regular);
  font-feature-settings: "ss01", "ss02", "cv11";
  line-height: 1.5;
  letter-spacing: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  min-width: 320px;
}

[hidden] {
  display: none !important;
}

body > main {
  flex-grow: 1;
}

body > main,
body > header,
body > footer,
body > nav {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: 0 auto;
}

.narrow-shell {
  max-width: var(--narrow-width);
}

.app-shell,
.public-shell,
.auth-shell {
  padding: clamp(2rem, 5vw, 3.5rem) 0 4rem;
}

footer {
  padding-bottom: 2rem;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 1.2rem;
  font-weight: var(--fw-semibold);
}

h3 {
  font-size: 0.98rem;
  font-weight: var(--fw-semibold);
}

p {
  margin: 0 0 1rem;
  word-break: break-word;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a.is-link {
  text-decoration: underline;
}

.enterprise-link {
  color: #000000;
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 2px solid var(--color-border);
  margin: 1.5rem 0;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: uppercase;
}

.meta-line {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.token-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.token-icon {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  color: var(--color-success);
}

.phosphor-icon {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
}

.token-amount.is-metric {
  gap: 0.42rem;
}

.token-amount.is-metric .token-icon {
  width: 0.78em;
  height: 0.78em;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
}

.page-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.page-breadcrumb a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.page-breadcrumb span:last-child {
  color: var(--color-text);
}

.measure-wide {
  max-width: 60ch;
}

.hint,
.form-note {
  color: var(--color-text-subtle);
  font-size: 0.86rem;
  display: inline-block;
}

.hint-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.hint-subtle {
  opacity: 0.6;
}

#main-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  max-width: none;
  margin: 0;
  background: rgba(255, 243, 216, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 3px 0 rgba(21, 21, 21, 0.08);
}

#main-nav section {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  height: 60px;
  margin: 0 auto;
}

#main-nav .fg1 {
  flex: 1;
}

#main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 0.65rem;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: var(--fw-regular);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

#main-nav a.selected {
  font-weight: var(--fw-semibold);
}

#main-nav a:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  text-decoration: none;
}

#main-nav a.selected {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.brand-link,
.brand-link:hover {
  background: transparent !important;
  border-color: transparent !important;
  padding-left: 0 !important;
  gap: 0.55rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  overflow: visible;
}

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

.brand-name {
  color: var(--color-text);
  font-weight: var(--fw-medium);
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-primary {
  background: var(--color-text) !important;
  border-color: var(--color-text) !important;
  color: #ffffff !important;
  box-shadow: 2px 2px 0 var(--color-primary);
}

.nav-primary:hover {
  background: #000 !important;
  border-color: #000 !important;
}

.token-count {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 0.7rem !important;
  background: var(--color-surface) !important;
  border: 2px solid var(--color-border) !important;
  border-radius: var(--radius-pill) !important;
  color: var(--color-success) !important;
  font-size: 0.82rem;
  font-weight: var(--fw-semibold);
  box-shadow: 2px 2px 0 var(--color-border);
}

.token-count .token-icon,
.button .token-icon,
.split-button .token-icon {
  color: currentColor;
}

.profile-link {
  padding: 0 0.2rem !important;
}

.profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  color: white;
  background-color: var(--avatar-color-start, var(--color-blue));
  background-image: linear-gradient(
    var(--avatar-angle, 120deg),
    var(--avatar-color-start, var(--color-blue)),
    var(--avatar-color-end, var(--color-pink))
  );
  border: 2px solid var(--color-border);
  border-radius: 100%;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(21, 21, 21, 0.45);
}

.profile-icon.is-large {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  box-shadow: 3px 3px 0 var(--color-border);
}

.profile-icon-demo {
  background-image: linear-gradient(120deg, var(--color-blue), var(--color-pink));
}

.flash-shell {
  position: fixed;
  top: calc(60px + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  gap: 0.5rem;
  width: max-content;
  max-width: min(calc(100% - 2 * var(--gutter)), 560px);
  pointer-events: none;
}

.flash-message {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: var(--fw-regular);
  box-shadow: var(--shadow-sm);
  transition: opacity 200ms ease, transform 200ms ease;
}

.flash-message.is-dismissing {
  opacity: 0;
  transform: translateY(-8px);
}

.flash-close {
  flex: 0 0 auto;
  margin-left: auto;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.flash-close:hover {
  opacity: 1;
  background: rgba(21, 21, 21, 0.08);
  box-shadow: none;
  transform: none;
}

.flash-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.flash-alert {
  background: var(--color-danger-soft);
  border-color: var(--color-border);
}

.flash-alert .flash-dot {
  background: var(--color-danger);
}

.flash-notice {
  background: var(--color-success-soft);
  border-color: var(--color-border);
}

.flash-notice .flash-dot {
  background: var(--color-success);
}

.control-header,
.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.control-header h1,
.profile-header h1 {
  margin: 0 0 0.5rem;
}

.control-header > div p:last-child,
.profile-header > div p:last-child {
  margin-bottom: 0;
}

.header-actions,
.row-actions,
.form-actions,
.job-choice-actions,
.purchase-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 1rem 0;
  background:
    linear-gradient(rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    var(--color-canvas);
  background-size: 22px 22px;
  background-attachment: fixed;
  border-top: 2px solid var(--color-border);
}

.form-actions-sticky::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 4px;
  background: var(--color-canvas);
  pointer-events: none;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem 0.7rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.5rem 0 0.8rem;
}

.section-heading:first-child {
  margin-top: 0;
}

.section-heading h2 {
  margin: 0;
}

.section-title-link {
  color: inherit;
  text-decoration: none;
}

.section-title-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.section-heading p {
  margin: 0.25rem 0 0;
}

.metric-panel,
.empty-state,
.quiet-panel,
.resource-row,
.job-choice-panel,
.form-panel,
.estimate-panel,
.preview-panel,
.job-side-panel,
.auth-panel,
.public-band article,
.profile-header,
.table-card,
.unlock-panel {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.form-panel,
.auth-panel,
.preview-panel,
.job-side-panel,
.quiet-panel,
.table-card {
  padding: 1.25rem;
}

.form-panel h1,
.form-panel h2 {
  margin-bottom: 1rem;
}

.optional-creative-panel > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.optional-creative-panel > summary::-webkit-details-marker {
  display: none;
}

.optional-creative-panel[open] > summary {
  margin-bottom: 1rem;
}

/* Card headers on the New Ad form all share the .form-panel h2 scale
   (1.2rem / semibold) so no one card's title reads larger than another. The
   Direction summary title and the Audience field label opt into it here. */
.optional-creative-title,
.field-panel-heading {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: var(--fw-semibold);
  line-height: 1.25;
}

.optional-creative-title {
  margin-right: auto;
}

.field-panel-heading {
  margin-bottom: 1rem;
}

.optional-creative-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0.15rem 0.45rem;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: var(--fw-semibold);
  line-height: 1.1;
}

.optional-creative-caret {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-subtle);
  transition: transform 120ms ease;
}

.optional-creative-panel[open] .optional-creative-caret {
  transform: rotate(180deg);
}

.panel-heading,
.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.panel-heading h2,
.field-heading label {
  margin-bottom: 0;
}

.field-heading {
  margin-bottom: 0.35rem;
}

.profile-header {
  align-items: center;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-title > div {
  min-width: 0;
}

.profile-title h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.profile-title h1,
.profile-title p {
  margin: 0;
}

.profile-title .meta-line {
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.75rem;
}

.profile-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.profile-links .button {
  width: 100%;
}

.metric-panel {
  padding: 1.1rem 1.15rem;
}

a.metric-panel-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: filter 120ms ease;
}

a.metric-panel-link:hover {
  filter: brightness(0.95);
}

.metric-panel:nth-child(4n + 1) {
  background: var(--color-surface);
}

.metric-panel:nth-child(4n + 2) {
  background: #e5f4ff;
}

.metric-panel:nth-child(4n + 3) {
  background: #fff0a8;
}

.metric-panel:nth-child(4n + 4) {
  background: #ffe0cf;
}

.metric-label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-value {
  margin: 0.6rem 0 0.35rem;
  color: var(--color-text);
  font-size: 2.2rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.small-value {
  font-size: 1.6rem;
}

.metric-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.resource-list {
  display: grid;
  gap: 0.7rem;
}

.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.resource-row.is-large {
  align-items: flex-start;
  padding: 1.2rem 1.25rem;
}

.resource-row h2,
.resource-row h3 {
  margin: 0 0 0.2rem;
  color: var(--color-text);
}

.resource-row h2 { font-size: 1.05rem; font-weight: var(--fw-semibold); }
.resource-row h3 { font-size: 0.95rem; font-weight: var(--fw-medium); }

.resource-row p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.stacked-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.list-row strong {
  display: block;
  color: var(--color-text);
  font-weight: var(--fw-semibold);
}

.list-row .meta-line {
  margin-top: 0.2rem;
  font-size: 0.85rem;
}

.token-reveal {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  overflow-x: auto;
}

.list-empty {
  margin: 1.25rem 0 0;
  padding: 1.1rem 1.15rem;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  border: 2px dashed var(--color-border-muted);
  border-radius: var(--radius-md);
  text-align: center;
}

.resource-card-link {
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.resource-card-link:hover {
  background: #ffffff;
  box-shadow: var(--shadow-md);
  transform: translate(-1px, -1px);
  text-decoration: none;
}

.resource-card-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.resource-card-cue {
  flex: 0 0 auto;
  color: var(--color-text-subtle);
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
}

.quiet-panel {
  color: var(--color-text-muted);
}

.performance-ranking-empty {
  padding: 2rem 1rem 1.5rem;
  color: var(--color-text-muted);
  text-align: center;
}

.performance-ranking-empty-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.65rem;
  color: var(--color-text-subtle);
}

.performance-ranking-empty h3 {
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.performance-ranking-empty p {
  margin: 0;
}

.dashboard-header {
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.dashboard-grid {
  display: grid;
  align-items: start;
  gap: 1.35rem;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.dashboard-project-rail {
  position: sticky;
  top: 88px;
}

.dashboard-project-rail .section-heading,
.dashboard-ads .section-heading {
  margin-top: 0;
}

.dashboard-project-link {
  align-items: center;
  padding: 0.8rem 0.85rem;
}

.dashboard-project-link .project-avatar {
  width: 42px;
  height: 42px;
}

.dashboard-project-link h3 {
  overflow-wrap: anywhere;
}

.dashboard-project-link .project-signals {
  margin-top: 0.35rem;
}

.dashboard-ad-gallery {
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.dashboard-ad-preview-link {
  grid-template-rows: auto;
}

.dashboard-ad-body h3 {
  margin-bottom: 0.15rem;
}

.dashboard-ad-project {
  color: var(--color-text);
}

.dashboard-ad-project:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.dashboard-ad-fallback {
  background:
    linear-gradient(135deg, rgba(249, 111, 53, 0.18), rgba(45, 120, 207, 0.16)),
    var(--color-surface-muted);
}

.dashboard-ad-fallback .phosphor-icon {
  width: 2rem;
  height: 2rem;
  color: var(--color-text-subtle);
}

.dashboard-empty-ads {
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-empty-ads h2,
.dashboard-empty-ads p {
  margin: 0;
}

.dashboard-empty-ads p {
  margin-top: 0.25rem;
  color: var(--color-text-muted);
}

.composition-waiting-panel {
  display: grid;
  place-items: center;
  gap: 0.85rem;
  min-height: min(70vh, 520px);
  text-align: center;
}

.loading-spinner {
  width: 1.9rem;
  height: 1.9rem;
  border: 3px solid var(--color-border-muted);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: button-spin 760ms linear infinite;
}

.egg-pan-loader {
  width: 220px;
  height: 160px;
  display: block;
  overflow: visible;
}

.egg-pan-loader.is-card {
  width: 78%;
  max-width: 200px;
  height: auto;
}

.egg-pan-loader__pan-group {
  transform-origin: 80px 80px;
  animation: egg-pan-swirl 2s linear infinite;
  animation-delay: var(--egg-pan-phase, 0ms);
  will-change: transform;
}

.egg-pan-loader__egg {
  transform-box: fill-box;
  transform-origin: center;
  animation: egg-swirl 2s linear infinite;
  animation-delay: var(--egg-pan-phase, 0ms);
  will-change: transform;
}

.egg-pan-loader__white {
  animation: egg-white-morph 3s linear infinite;
  animation-delay: var(--egg-pan-phase, 0ms);
}

.egg-pan-loader__yolk {
  transform-box: fill-box;
  transform-origin: center;
  animation: egg-yolk-jiggle 2s ease-in-out infinite;
  animation-delay: var(--egg-pan-phase, 0ms);
}

@keyframes egg-pan-swirl {
  0%    { transform: translate(0, 0) rotate(0deg); }
  12%   { transform: translate(-2px, 6px) rotate(-2.5deg); }
  22%   { transform: translate(3px, 9px) rotate(-3deg); }
  34%   { transform: translate(7px, 2px) rotate(-1deg); }
  46%   { transform: translate(6px, -5px) rotate(2.5deg); }
  58%   { transform: translate(-1px, -8px) rotate(4deg); }
  70%   { transform: translate(-6px, -3px) rotate(2.5deg); }
  82%   { transform: translate(-5px, 4px) rotate(-1deg); }
  92%   { transform: translate(-1px, 6px) rotate(-2.5deg); }
  100%  { transform: translate(0, 0) rotate(0deg); }
}

@keyframes egg-swirl {
  0%    { transform: translate(0, 0) rotate(0deg); }
  12%   { transform: translate(8px, -12px) rotate(8deg); }
  22%   { transform: translate(-6px, -16px) rotate(-5deg); }
  34%   { transform: translate(-14px, -6px) rotate(-10deg); }
  46%   { transform: translate(-12px, 10px) rotate(-6deg); }
  58%   { transform: translate(4px, 16px) rotate(8deg); }
  70%   { transform: translate(14px, 8px) rotate(10deg); }
  82%   { transform: translate(12px, -8px) rotate(5deg); }
  92%   { transform: translate(2px, -14px) rotate(-2deg); }
  100%  { transform: translate(0, 0) rotate(0deg); }
}

@keyframes egg-white-morph {
  0%   { d: path("M102 80 C102 89 92 97 80 97 C68 97 58 89 58 80 C58 71 68 63 80 63 C92 63 102 71 102 80 Z"); }
  20%  { d: path("M106 78 C106 88 94 95 80 94 C66 93 54 86 54 78 C54 70 66 63 80 64 C94 65 106 70 106 78 Z"); }
  40%  { d: path("M104 76 C104 88 92 96 78 94 C66 92 56 84 58 74 C60 64 70 60 84 62 C96 64 104 66 104 76 Z"); }
  60%  { d: path("M98 80 C98 92 90 100 80 100 C70 100 62 92 62 80 C62 68 70 60 80 60 C90 60 98 68 98 80 Z"); }
  80%  { d: path("M102 80 C100 92 88 96 76 94 C64 92 58 80 60 70 C62 60 74 56 86 60 C96 64 104 68 102 80 Z"); }
  100% { d: path("M102 80 C102 89 92 97 80 97 C68 97 58 89 58 80 C58 71 68 63 80 63 C92 63 102 71 102 80 Z"); }
}

@keyframes egg-yolk-jiggle {
  0%, 100% { transform: scale(1, 1); }
  20%      { transform: scale(1.03, 0.97); }
  40%      { transform: scale(0.98, 1.02); }
  60%      { transform: scale(1.02, 0.98); }
  80%      { transform: scale(0.98, 1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .egg-pan-loader__pan-group,
  .egg-pan-loader__egg,
  .egg-pan-loader__white,
  .egg-pan-loader__yolk {
    animation: none;
  }
}

.loading-bar {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.loading-bar[hidden] {
  display: none;
}

.loading-bar__track {
  position: relative;
  height: 0.85rem;
  width: 100%;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.loading-bar__fill {
  height: 100%;
  width: 0;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}

.loading-bar.is-running .loading-bar__fill {

  animation:
    loading-bar-fill var(--loading-bar-duration, 7s) cubic-bezier(0.16, 0.84, 0.44, 1) forwards,
    loading-bar-creep 600s linear var(--loading-bar-duration, 7s) forwards;
}

.loading-bar.is-looping .loading-bar__fill {
  animation: loading-bar-fill var(--loading-bar-duration, 7s) cubic-bezier(0.16, 0.84, 0.44, 1) infinite;
}

.loading-bar__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

@keyframes loading-bar-fill {
  0%   { width: 0; }
  55%  { width: 64%; }
  100% { width: 88%; }
}

@keyframes loading-bar-creep {
  0%   { width: 88%; }
  20%  { width: 94%; }
  45%  { width: 97%; }
  100% { width: 99.5%; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar.is-running .loading-bar__fill,
  .loading-bar.is-looping .loading-bar__fill {
    animation: none;
    width: 94%;
  }
}

.onboarding-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  max-width: 36rem;
  margin: clamp(3rem, 10vh, 6rem) auto 0;
  padding: 2.5rem 2rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.onboarding-icon {
  display: inline-flex;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-text);
}

.onboarding-card h1 {
  margin: 0;
}

.onboarding-card p {
  margin: 0 0 0.5rem;
  max-width: 30rem;
  color: var(--color-text-muted);
}

.empty-state,
.job-choice-panel,
.estimate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.empty-state h2,
.job-choice-panel h2 {
  margin: 0 0 0.35rem;
}

.empty-state p,
.job-choice-panel p {
  margin: 0;
  color: var(--color-text-muted);
}

.estimate-panel {
  align-items: stretch;
}

.estimate-panel > div {
  flex: 1;
}

.two-column,
.job-output-grid,
.public-band {
  display: grid;
  gap: 1.25rem;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-output-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
}

.public-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button,
button,
input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 36px;
  padding: 0.48rem 0.95rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--btn-shadow, var(--shadow-sm));
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.button[hidden],
button[hidden],
input[type=submit][hidden] {
  display: none;
}

.button:hover,
button:hover,
input[type=submit]:hover {
  background: #ffffff;
  text-decoration: none;
}

.button:active,
button:active,
input[type=submit]:active {
  transform: translate(1px, 1px);
  box-shadow: var(--btn-shadow-active, 2px 2px 0 var(--color-border));
}

.button:focus-visible,
button:focus-visible,
input[type=submit]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.button[disabled],
button[disabled],
input[type=submit][disabled],
.button.disabled,
button.disabled,
.button.is-disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.68;
}

.button.is-loading,
button.is-loading,
input[type=submit].is-loading {
  position: relative;
}

.is-locked,
.is-locked:focus {
  cursor: wait;
  opacity: 0.6;
  background-color: var(--color-surface-muted);
}

.button.is-loading::before,
button.is-loading::before {
  content: "";
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}

.button.is-loading > .phosphor-icon,
button.is-loading > .phosphor-icon {
  display: none;
}

input[type=submit].is-loading {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0.75rem center;
  background-repeat: no-repeat;
  background-size: 0.8em 0.8em;
}

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

.button.is-primary,
button.is-primary,
input[type=submit].is-primary {
  background: var(--color-primary);
  border-color: var(--color-border);
  color: var(--color-text);
}

.button.is-primary:hover,
button.is-primary:hover,
input[type=submit].is-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-border);
}

.button.is-primary[disabled],
button.is-primary[disabled],
input[type=submit].is-primary[disabled],
.button.is-primary.is-disabled {
  background: #4f8fd8;
  border-color: var(--color-border);
  color: var(--color-text);
}

.button.is-input-gated[disabled],
button.is-input-gated[disabled] {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

@keyframes button-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 168, 70, 0.55);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 10px rgba(255, 168, 70, 0);
  }
}

.button.is-pulsing,
button.is-pulsing,
input[type=submit].is-pulsing {
  animation: button-pulse 1.8s ease-in-out infinite;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .button.is-pulsing,
  button.is-pulsing,
  input[type=submit].is-pulsing {
    animation: none;
  }
}

.button.is-ghost,
button.is-ghost {
  border-color: transparent;
  box-shadow: none;
}

.button.is-danger,
button.is-danger {
  background: var(--color-danger);
  border-color: var(--color-border);
  color: #ffffff;
}

.button.is-link,
button.is-link {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}

.button.is-link:hover,
button.is-link:hover {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
}

.button.is-small,
button.is-small {
  min-height: 30px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
}

.button.is-tiny,
button.is-tiny {
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
}

.button.is-icon,
button.is-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}

.button.is-block,
button.is-block {
  display: flex;
  width: 100%;
}

.button .phosphor-icon,
button .phosphor-icon {
  width: 1em;
  height: 1em;
}

.button-group {
  display: inline-flex;
}

.button-group .button {
  border-radius: 0;
  box-shadow: none;
}

.button-group .button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.button-group .button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.button-group .button:not(:last-child) {
  border-right: 0;
}

.variant-button-group {
  margin-top: 0.35rem;
}

.variant-button {
  min-width: 42px;
  position: relative;
}

.variant-button input {
  position: absolute;
  inline-size: 1px !important;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.variant-button:has(input:checked) {
  background: var(--color-primary);
  border-color: var(--color-border);
  color: var(--color-text);
}

.variant-button:has(input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.split-button {
  gap: 0;
  min-height: 42px;
  padding: 0;
  overflow: hidden;
}

.split-button > .split-button-label,
.split-button > .split-button-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 42px;
  padding: 0.55rem 1rem;
}

.split-button .button-cost {
  border-left: 2px solid var(--color-border);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
}

.split-button.is-loading {
  padding: 0;
}

.split-button.is-loading::before {
  position: absolute;
  top: calc(50% - 0.45em);
  left: calc(1rem + 0.05em);
  z-index: 2;
  margin: 0;
}

.split-button.is-loading .split-button-label > .phosphor-icon {
  visibility: hidden;
}

/*
 * Buttons sit flat inside any container.
 *
 * A button carries its own raised drop shadow so it reads as liftable on the
 * bare paper canvas. Inside a card, panel, modal, row, or any other container
 * (whether it lifts itself or just frames content) a second shadow reads as a
 * double-lift and looks awkward. So instead of hand-tuning `box-shadow: none`
 * on individual buttons, we set the inherited `--btn-shadow` custom property
 * once on the container: it cascades to every descendant button at any depth
 * and to every variant (primary, danger, ghost, split, group) automatically.
 * Keep button styling global — never reach for a per-element shadow override.
 *
 * The `*-panel`, `*-card`, `*-modal`, `*-menu` naming conventions are matched by
 * substring so new containers that follow them are covered for free. Containers
 * that don't follow the convention are listed explicitly. `:where()` keeps the
 * whole selector at zero specificity so it never fights a button's own rules.
 */
:where(
  [class*="-panel"],
  [class*="-card"],
  [class*="-modal"],
  [class*="-menu"],
  .modal,
  .box,
  .empty-state,
  .composition-cta,
  .resource-row,
  .list-row,
  .token-reveal,
  .check-option,
  .toggle-option,
  .segmented-toggle,
  .asset-dropzone,
  .editor-sizebar,
  .public-band article,
  .profile-header,
  .payment-element-shell
) {
  --btn-shadow: none;
  --btn-shadow-active: none;
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.payment-element-shell {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.stacked-form,
.compact-form {
  display: grid;
  gap: 1rem;
}

label,
legend,
.label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
}

textarea,
select,
input[type=email],
input[type=password],
input[type=number],
input[type=text],
input[type=url],
input[type=tel],
input[type=date],
input[type=datetime-local],
input[type=time],
input[type=file] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(21, 21, 21, 0.14);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  line-height: 1.5;
  min-height: 8rem;
  padding: 0.65rem 0.7rem;
}

select,
input[type=file] {
  padding: 0.4rem 0.6rem;
}

textarea:focus,
select:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=number]:focus,
input[type=text]:focus,
input[type=url]:focus,
input[type=tel]:focus {
  border-color: var(--color-primary);
  box-shadow: 3px 3px 0 var(--color-border), 0 0 0 3px rgba(249, 111, 53, 0.2);
}

.field_with_errors input,
.field_with_errors textarea,
input.is-invalid,
textarea.is-invalid {
  border-color: var(--color-danger);
}

.field_with_errors label {
  color: var(--color-danger);
}

input[type=checkbox],
input[type=radio] {
  width: 16px !important;
  height: 16px;
  min-width: 16px !important;
  margin-right: 0.5rem;
  accent-color: var(--color-primary);
}

input[type=file]::-webkit-file-upload-button,
input[type=file]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: var(--color-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
}

input[type=file]::-webkit-file-upload-button:hover,
input[type=file]::file-selector-button:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.option-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.92rem;
  cursor: pointer;
}

.check-option:has(input:checked) {
  background: var(--color-yellow);
  border-color: var(--color-border);
}

.check-option span {
  font-weight: var(--fw-regular);
}

.check-option-inline {
  display: inline-flex;
  margin-bottom: 1rem;
}

.check-option-inline.is-compact {
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.surprise-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  cursor: pointer;
}

.surprise-toggle input {
  position: absolute;
  inline-size: 1px !important;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.surprise-toggle span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.3rem 0.65rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  line-height: 1.1;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.surprise-toggle.is-small span {
  min-height: 26px;
  padding: 0.22rem 0.55rem;
  font-size: 0.76rem;
}

.surprise-toggle input:checked + span {
  background: var(--color-primary);
  border-color: var(--color-border);
  color: var(--color-text);
}

.surprise-toggle input:focus-visible + span {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.surprise-field .field-body {
  max-height: 14rem;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 180ms ease, opacity 140ms ease, transform 180ms ease, margin-top 180ms ease;
}

.surprise-field.is-surprised .field-body {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.surprise-note {
  display: none;
  margin: 0.4rem 0 0;
  color: var(--color-text-subtle);
  font-size: 0.84rem;
}

.surprise-field.is-surprised .surprise-note {
  display: block;
  animation: surprise-note-in 160ms ease both;
}

@keyframes surprise-note-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.output-toggle {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.75rem 0.85rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-option.is-disabled {
  cursor: not-allowed;
}

.toggle-option:has(input:checked) {
  background: var(--color-primary-soft);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.toggle-option-rich {
  align-items: flex-start;
}

.toggle-option-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.toggle-option-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toggle-option-title {
  font-weight: 600;
}

/* Advisory marker for the Composed scene when the asset library is thin. Sits
   flush against the right edge of the option (the body flexes to fill the rest)
   and reads orange to signal "heads up" without looking like an error. The
   explanation rides on the tooltip controller, not a native title. */
.toggle-option-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 0.5rem;
  color: var(--color-orange);
  cursor: help;
}

.toggle-option-warning .phosphor-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.toggle-option-warning:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  border-radius: var(--radius-pill);
}

.toggle-option-cost {
  font-size: 0.85em;
  color: var(--color-text-muted);
}

.toggle-option-blurb {
  font-size: 0.85em;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.segmented-toggle {
  display: flex;
  margin-bottom: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.segmented-toggle.is-inline {
  display: inline-flex;
}

.segmented-option {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 38px;

  margin: 0;
  padding: 0.48rem 0.95rem;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.segmented-toggle.is-inline .segmented-option {
  flex: 0 0 auto;
}

.segmented-option:not(:last-child) {
  border-right: 2px solid var(--color-border);
}

.segmented-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-option:hover {
  background: #ffffff;
  color: var(--color-text);
}

.segmented-option:has(input:checked) {
  background: var(--color-primary);
  color: var(--color-text);
}

.segmented-option:has(input:checked):hover {
  background: var(--color-primary-hover);
}

.segmented-option:has(input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.workspace-section + .workspace-section {
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
  padding-top: clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--color-border);
}

.project-mode-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.project-mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.8rem 0.65rem;
  border-right: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.project-mode-tab:last-child {
  border-right: 0;
}

.project-mode-tab:hover {
  background: var(--color-primary-soft);
  color: var(--color-text);
  text-decoration: none;
}

.project-mode-tab.is-active {
  background: var(--color-primary);
  color: var(--color-text);
}

.project-mode-tab .phosphor-icon {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
}

@media (max-width: 36rem) {
  .project-mode-tab {
    flex-direction: column;
    gap: 0.2rem;
    padding-inline: 0.25rem;
    font-size: 0.72rem;
  }
}

.composition-board {
  scroll-margin-top: 84px;
}

.composition-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -0.25rem 0 1rem;
}

.composition-filter-chip {
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.composition-filter-chip:hover {
  color: var(--color-text);
  border-color: var(--color-border);
}

.composition-filter-chip[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-border);
  color: var(--color-text);
}

.composition-filter-chip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.composition-gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.composition-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.composition-card-link {
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--color-text);
  text-decoration: none;
}

.composition-card-link:hover {
  text-decoration: none;
}

.composition-card-link:hover .composition-card-media {
  box-shadow: var(--shadow-md);
}

.composition-card-link:focus-visible {
  border-radius: var(--radius-md);
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.composition-card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 16;
  min-height: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.composition-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.composition-preview {
  container-type: inline-size;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #151515;
}

.composition-preview-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composition-preview-pending {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(255,255,255,0.58);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0)),
    #151515;
}

.composition-preview-pending svg {
  width: 2.75rem;
  height: 2.75rem;
}

.composition-provider-overlay {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: calc(100% - 1.1rem);
}

.composition-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  color: #ffffff;
  background: color-mix(in srgb, var(--color-text) 88%, transparent);
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(21, 21, 21, 0.24);
}

.composition-provider-icon svg {
  width: 1rem;
  height: 1rem;
}

.composition-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1rem;
  color: var(--color-text-subtle);
  font-size: 0.86rem;
  font-weight: var(--fw-medium);
}

.composition-card-placeholder.is-cooking {
  position: relative;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  overflow: hidden;
  background: #fffdf8;
  isolation: isolate;
}

.composition-card-placeholder.is-cooking::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(0deg, rgba(255, 229, 186, 0.78), rgba(255, 244, 226, 0.95));
  transform: scaleY(var(--cooking-fill-start, 0));
  transform-origin: center bottom;
  animation: cooking-card-fill var(--cooking-fill-duration, 100s) linear forwards;
}

.composition-card-placeholder.is-cooking > * {
  position: relative;
  z-index: 1;
}

@keyframes cooking-card-fill {
  to {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composition-card-placeholder.is-cooking::before {
    animation: none;
  }
}

.composition-card-placeholder.is-cracked {
  background: var(--color-surface-muted);
}

.cracked-egg-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--color-danger, #c0392b);
}

.cracked-egg-placeholder__icon {
  width: clamp(3rem, 42%, 5rem);
  height: auto;
}

.composition-card-status {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
}

.composition-card-body {
  padding-top: 0.65rem;
}

.composition-card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 0.96rem;
  font-weight: var(--fw-medium);
}

.composition-card-body p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.composition-card-body .composition-card-meta {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--color-text-subtle, var(--color-text-muted));
}

.composition-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.section-note {
  color: var(--color-text-muted);
}

.ad-show-layout {
  display: grid;
  grid-template-columns: minmax(240px, 400px) minmax(0, 1fr);
  align-items: start;
  gap: 1.35rem;
}

.ad-show-preview-column {
  display: grid;
  justify-items: center;
}

.ad-show-side {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.ad-show-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 400px);
  aspect-ratio: 9 / 16;
  min-height: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ad-show-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  margin: 0;
}

.ad-show-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
}

.ad-show-list dt {
  color: var(--color-text-subtle);
  font-size: 0.76rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
}

.ad-show-list dd {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.ad-show-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ad-show-details-header h2 {
  margin-bottom: 0;
}

.ad-show-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.heading-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.heading-with-icon svg {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  color: var(--color-primary);
}

.ad-reporting {
  min-width: 0;
}

.ad-reporting-heading {
  align-items: flex-start;
}

.ad-reporting-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
}

.ad-reporting-summary > div {
  min-width: 0;
  padding: 0.85rem 1rem;
  border-left: 1px solid var(--color-border);
}

.ad-reporting-summary > div:first-child {
  border-left: 0;
}

.ad-reporting-summary span,
.ad-run-dates dt,
.ad-performance-grid span,
.ad-run-chart-header span {
  display: block;
  color: var(--color-text-subtle);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.ad-reporting-summary strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-text);
  font-size: 1.2rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ad-reporting-empty {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  border: 2px dashed color-mix(in srgb, var(--color-border) 72%, transparent);
  border-radius: var(--radius-md);
}

.identifier-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.identifier-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
}

.identifier-key {
  font-weight: var(--fw-semibold);
  overflow-wrap: anywhere;
}

.identifier-value {
  flex: 1;
  min-width: 0;
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.identifier-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.identifier-form .field {
  flex: 1;
  min-width: 8rem;
  margin: 0;
}

.ad-reporting-empty h3,
.ad-reporting-empty p {
  margin: 0;
}

.ad-reporting-empty p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.ad-reporting-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-primary);
}

.ad-run-list {
  display: grid;
  border-top: 2px solid var(--color-border);
}

.ad-run-row {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 2px solid var(--color-border);
}

.ad-run-row-header,
.ad-run-actions,
.ad-run-refs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ad-run-row-header {
  justify-content: space-between;
  align-items: flex-start;
}

.ad-run-row-header h3,
.ad-run-row-header p {
  margin: 0;
}

.ad-run-row-header p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.ad-run-actions,
.ad-run-refs {
  flex-wrap: wrap;
}

.ad-run-dates,
.ad-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.6rem;
}

.ad-run-dates {
  margin: 0;
}

.ad-run-row .ad-run-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

.ad-run-row .ad-run-dates > div {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ad-run-row .ad-run-dates dd {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.ad-run-dates > div,
.ad-performance-grid > div {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.ad-run-dates dd,
.ad-performance-grid strong {
  margin: 0.15rem 0 0;
  color: var(--color-text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ad-run-chart {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
}

.ad-run-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.ad-run-chart-header strong {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
}

.ad-run-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0.55rem, 1fr));
  align-items: end;
  gap: 0.2rem;
  height: 5.25rem;
}

.ad-run-bar {
  position: relative;
  display: flex;
  align-items: end;
  min-width: 0;
  height: 100%;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-border) 22%, transparent);
  overflow: hidden;
}

.ad-run-bar > span {
  display: block;
  width: 100%;
  height: max(0.25rem, var(--bar-height));
  background: var(--color-primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.ad-observation-panel {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.ad-observation-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.ad-observation-table {
  overflow-x: auto;
  border-top: 1px solid var(--color-border);
}

.ad-observation-table table {
  background: transparent;
}

.ad-observation-table table th,
.ad-observation-table table td {
  padding: 0.55rem 0.7rem;
  vertical-align: middle;
}

.ad-observation-table table th:last-child,
.ad-observation-table table td:last-child {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.ad-observation-table time,
.ad-observation-table td {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.ad-observation-table strong {
  color: var(--color-text);
  font-weight: var(--fw-medium);
}

.ad-observation-action .button {
  margin-left: auto;
}

/* Performance table: a wide, sortable metrics grid. Numbers right-align,
   status/platform columns are compact, and the ad name truncates so the
   metric columns keep their room. */
.perf-table table {
  width: 100%;
}

.perf-table th.is-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.perf-table th.is-sortable:hover {
  color: var(--color-text);
}

.perf-table th.is-sortable:focus-visible {
  outline: 2px solid var(--color-accent, currentColor);
  outline-offset: -2px;
}

.perf-sort-caret {
  display: inline-block;
  width: 0.7em;
  margin-left: 0.25rem;
  opacity: 0.55;
  font-size: 0.85em;
  vertical-align: middle;
}

.perf-table th.is-sorted-asc .perf-sort-caret::before {
  content: "\2191"; /* ↑ */
  opacity: 1;
}

.perf-table th.is-sorted-desc .perf-sort-caret::before {
  content: "\2193"; /* ↓ */
  opacity: 1;
}

.perf-table th.is-sortable:not(.is-sorted-asc):not(.is-sorted-desc) .perf-sort-caret::before {
  content: "\2195"; /* ↕ */
}

.perf-th-num {
  text-align: right;
}

.perf-th-num .perf-sort-caret {
  margin-left: 0.15rem;
}

.perf-table td.perf-th-num {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap;
}

.perf-th-center {
  text-align: center;
}

.perf-th-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ad name column: truncate long names with an ellipsis rather than letting
   them push the metric columns off screen. */
.perf-cell-ad {
  max-width: 16rem;
}

.perf-ad-name {
  display: block;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-platform-badge,
.perf-nodata {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.perf-platform-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.perf-nodata-icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

.clip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ad-observation-empty {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.ad-show-default-input {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.ad-tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.ad-tag-list > .tag {
  flex: 0 0 auto;
  width: fit-content;
}

.ad-tag-editor {
  display: grid;
  gap: 0.55rem;
}

.ad-tag-chip {
  gap: 0.2rem;
  padding-right: 0.22rem;
}

.ad-tag-chip-link {
  color: inherit;
  text-decoration: none;
}

.ad-tag-link,
.ad-tag-chip-link {
  text-decoration: none;
}

.ad-tag-link:hover,
.ad-tag-chip-link:hover {
  color: inherit;
  text-decoration: none;
}

.ad-tag-link:hover,
.ad-tag-chip:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

.ad-tag-chip-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
  color: var(--color-text-muted);
  opacity: 0;
  transition: color 120ms ease, opacity 120ms ease;
}

.ad-tag-chip-delete:hover,
.ad-tag-chip-delete:focus-visible {
  background: transparent;
  color: var(--color-danger);
  opacity: 1;
}

.ad-tag-chip:hover .ad-tag-chip-delete,
.ad-tag-chip:focus-within .ad-tag-chip-delete {
  opacity: 1;
}

.ad-tag-chip-delete:active {
  transform: none;
  box-shadow: none;
}

.ad-tag-chip-delete .phosphor-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.ad-tag-empty {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.ad-tag-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.ad-tag-entry input {
  min-width: 0;
}

.ad-tag-add {
  box-shadow: none;
}

.ad-show-secondary-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.editor-details .ad-show-secondary-actions,
.editor-details .ad-feedback-actions {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.ad-feedback-actions {
  align-items: center;
  gap: 0.25rem;
}

.ad-feedback-trigger,
button.ad-feedback-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  min-height: 0;
  padding: 0;
  color: var(--color-text-subtle);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.ad-feedback-trigger:hover,
button.ad-feedback-trigger:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
  box-shadow: none;
  text-decoration: none;
  transform: none;
}

.ad-feedback-trigger .phosphor-icon {
  width: 1.08rem;
  height: 1.08rem;
}

.ad-feedback-trigger.is-selected,
button.ad-feedback-trigger.is-selected {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

.ad-feedback-trigger.is-dimmed,
button.ad-feedback-trigger.is-dimmed {
  opacity: 0.42;
}

.ad-feedback-trigger.is-dimmed:hover,
button.ad-feedback-trigger.is-dimmed:hover {
  opacity: 0.78;
}

.ad-delete-form {
  margin: 0;
}

.ad-delete-button,
button.ad-delete-button {
  padding-left: 0;
  padding-right: 0;
  color: var(--color-text-subtle);
}

.ad-delete-button:hover,
button.ad-delete-button:hover {
  color: var(--color-danger);
}

.editor-details {
  width: 100%;
  max-width: none;
  margin: 0 0 2.5rem;
}

.ad-feedback-modal {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.ad-feedback-form {
  display: grid;
  gap: 1rem;
}

.creative-editor {
  max-width: 1100px;
}

.button.is-ghost {
  background: transparent;
  box-shadow: none;
}

.button.is-ghost:hover {
  background: var(--color-surface);
  transform: none;
  box-shadow: none;
}

.editor-breadcrumb {
  margin-bottom: 0.35rem;
}

.editor-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.editor-back {
  flex: 0 0 auto;
}

.editor-name-form {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  margin: 0;
}

.editor-name-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 1.15rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.editor-name-input:hover {
  border-color: var(--color-border-muted);
}

.editor-name-input:focus,
.editor-name-input:focus-visible {
  background: var(--color-surface);
  border-color: var(--color-border);
  outline: none;
}

.editor-save {
  flex: 0 0 auto;
}

.editor-download {
  position: relative;
  flex: 0 0 auto;
}

.editor-download > summary {
  list-style: none;
  cursor: pointer;
}

.editor-download > summary::-webkit-details-marker {
  display: none;
}

.editor-download-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 12rem;
  padding: 0.3rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.editor-download-menu form {
  margin: 0;
}

.editor-download-item {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-medium);
}

.editor-download-item:hover {
  background: var(--color-surface-muted);
  transform: none;
  box-shadow: none;
}

.editor-asset-menu-list {
  min-width: 16rem;
  max-height: min(28rem, 70vh);
  overflow: auto;
}

.editor-asset-item {
  align-items: center;
}

.editor-asset-item img {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-sm);
}

.editor-asset-item span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.editor-asset-item strong,
.editor-asset-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-asset-item small {
  color: var(--color-text-subtle);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
}

.editor-asset-empty {
  margin: 0;
  padding: 0.6rem 0.75rem;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
}

.editor-download-item--export[disabled] {
  opacity: 1;
  cursor: progress;
}

.editor-download-item__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid var(--color-border-muted);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: button-spin 760ms linear infinite;
}

.editor-download-item.is-busy .editor-download-item__icon {
  display: none;
}

.editor-download-item.is-busy .editor-download-item__spinner {
  display: inline-block;
}

.editor-sizebar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
  padding: 0.3rem;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.editor-size-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0.3rem;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.editor-size-button:hover {
  color: var(--color-text);
  background: var(--color-surface);
  transform: none;
  box-shadow: none;
}

.editor-size-button.is-active {
  color: #ffffff;
  background: var(--color-text);
  box-shadow: none;
}

.editor-size-button svg {
  width: 1.05rem;
  height: 1.05rem;
}

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.editor-preview-column {
  min-width: 0;
}

.creative-editor-stage {
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
}

.preview-sound-toggle {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 30;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0.72;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.preview-sound-toggle:hover {
  opacity: 1;
  background: rgba(16, 16, 20, 0.72);
}

.preview-sound-toggle.is-active {
  opacity: 1;
  background: var(--color-primary);
  color: var(--color-ink);
}

.preview-sound-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.preview-sound-toggle__icon {
  display: grid;
  place-items: center;
}

.preview-sound-toggle__icon--on {
  display: none;
}

.preview-sound-toggle.is-active .preview-sound-toggle__icon--off {
  display: none;
}

.preview-sound-toggle.is-active .preview-sound-toggle__icon--on {
  display: grid;
}

.sound-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  line-height: 1.1;
}

.sound-chip.is-muted {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.sound-chip.is-loading {
  background: var(--color-highlight);
}

.sound-chip.is-loading svg {
  animation: sound-chip-spin 900ms linear infinite;
}

@keyframes sound-chip-spin {
  to { transform: rotate(360deg); }
}

.sound-chip svg {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
}

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

.sound-chip-button {
  cursor: pointer;
  max-width: 100%;
  padding-right: 0.4rem;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.sound-chip-button:hover {
  border-color: var(--color-border);
  background: var(--color-highlight);
}

.sound-chip-button:active {
  transform: translate(1px, 1px);
}

.sound-chip-button:focus-visible {
  outline: 2px solid var(--color-border);
  outline-offset: 2px;
}

.sound-chip-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.sound-chip-caret {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: 0.1rem;
  opacity: 0.65;
}

.sound-chip-caret svg {
  width: 0.8rem;
  height: 0.8rem;
}

.sound-chip-button .sc-icon-silent {
  display: none;
}

.sound-chip-button.is-muted .sc-icon-sound {
  display: none;
}

.sound-chip-button.is-muted .sc-icon-silent {
  display: inline-flex;
}

.sound-chip-button.is-muted {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.ad-show-details.is-picking {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sound-library {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sound-library-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.sound-library-header h2 {
  margin: 0;
}

.sound-library-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.sound-library-back:hover {
  background: var(--color-highlight);
  color: var(--color-text);
}

.sound-library-back svg {
  width: 1.15rem;
  height: 1.15rem;
}

.sound-library-scroll {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  max-height: min(60vh, 30rem);
  overflow-y: auto;
  padding: 0.15rem;
  margin: -0.15rem;
}

.sound-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 2px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.sound-option:hover {
  border-color: var(--color-border);
}

.sound-option.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.sound-option.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

.sound-option-play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-paper-light);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.sound-option-play:hover {
  background: var(--color-highlight);
}

.sound-option-play:active {
  transform: translate(1px, 1px);
}

.sound-option-play svg {
  width: 0.95rem;
  height: 0.95rem;
}

.sound-option-play.is-static {
  border-color: transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: default;
}

.sound-option-play.is-static svg {
  width: 1.2rem;
  height: 1.2rem;
}

.sound-option-play-icon {
  display: inline-flex;
}

.sound-option-play .sc-pause {
  display: none;
}

.sound-option.is-playing .sound-option-play {
  background: var(--color-primary);
  color: #fff;
}

.sound-option.is-playing .sound-option-play .sc-play {
  display: none;
}

.sound-option.is-playing .sound-option-play .sc-pause {
  display: inline-flex;
}

.sound-option-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--fw-semibold);
  font-size: 0.82rem;
}

.sound-option-pick {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.sound-option-pick:hover {
  background: var(--color-highlight);
}

.sound-option.is-selected .sound-option-pick:hover {
  background: var(--color-primary);
}

.sound-option-pick-check {
  display: none;
  align-items: center;
}

.sound-option-pick-check svg {
  width: 1rem;
  height: 1rem;
}

.sound-option.is-selected .sound-option-pick {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.sound-option.is-selected .sound-option-pick-label {
  display: none;
}

.sound-option.is-selected .sound-option-pick-check {
  display: inline-flex;
}

.sound-library-empty {
  margin: 0.5rem 0;
  padding: 1rem;
  border: 2px dashed var(--color-border-muted);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.86rem;
  text-align: center;
}

.editor-inputs {
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

.editor-inputs > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  color: var(--color-text-subtle);
  font-size: 0.84rem;
  font-weight: var(--fw-semibold);
}

.editor-inputs > summary::-webkit-details-marker {
  display: none;
}

.editor-inputs > summary svg {
  width: 1rem;
  height: 1rem;
}

.editor-inputs[open] > summary {
  margin-bottom: 0.75rem;
}

.editor-inputs-grid {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: var(--color-surface-muted);
  border-radius: 12px;
}

.editor-inputs-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.editor-inputs-row dt {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.editor-inputs-row dd {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.4;
}

.editor-inputs-row.is-prompt dd {
  font-weight: var(--fw-semibold);
}

.editor-export-status {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  max-width: min(90vw, 28rem);
  padding: 0.5rem 1rem;
  color: #ffffff;
  background: var(--color-text);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

.editor-export-status:empty {
  display: none;
}

.font-toolbar {
  position: fixed;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  background: var(--color-text);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.font-toolbar[hidden] {
  display: none;
}

/* Floating over-limit warning shown while editing a text slot whose copy
   exceeds the template's character limit. Red so it reads as a hard limit. */
.copy-limit-badge {
  position: fixed;
  z-index: 60;
  max-width: min(280px, 80vw);
  padding: 0.3rem 0.6rem;
  background: var(--color-danger);
  color: #ffffff;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 0.74rem;
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.copy-limit-badge[hidden] {
  display: none;
}

.font-toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 30px;
  padding: 0.1rem 0.45rem;
  color: #ffffff;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: pointer;
}

.font-toolbar-button.is-grow {
  font-size: 1.05rem;
}

.font-toolbar-button.is-danger {
  color: #ffcbc2;
}

.font-toolbar-button.is-active {
  color: var(--color-highlight);
  background: rgba(255, 255, 255, 0.16);
}

.font-toolbar-button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: none;
  box-shadow: none;
}

.font-toolbar-button.is-danger:hover {
  color: #ffffff;
  background: #c93524;
}

.font-toolbar-button svg {
  width: 1rem;
  height: 1rem;
}

.font-toolbar-button .font-toolbar-minus,
.font-toolbar-button .font-toolbar-plus {
  margin-left: 0.05rem;
  font-size: 0.7em;
}

.font-toolbar-value {
  min-width: 2.1rem;
  padding: 0 0.15rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

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

.asset-library-panel {
  padding-top: 0;
}

.asset-library-panel .section-heading {
  align-items: flex-start;
  margin-bottom: 0.45rem;
}

.asset-actions {
  gap: 0.5rem;
}

.section-note {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
}

.asset-list {
  display: grid;
  gap: 0.55rem;
}

.asset-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(21, 21, 21, 0.12);
}

.asset-row:first-child {
  border-top: 2px solid var(--color-border);
}

.asset-row.is-audience {
  grid-template-columns: minmax(0, 1fr) auto;
}

.asset-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.asset-thumb:has(img) {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, rgba(21, 21, 21, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(21, 21, 21, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(21, 21, 21, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(21, 21, 21, 0.12) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

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

.asset-thumb-icon {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--color-text-subtle);
}

.asset-row-body {
  min-width: 0;
}

.asset-row h3,
.asset-row p {
  margin: 0;
}

.asset-row h3 {
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row p {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.asset-audio-preview {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 32px;
  margin-top: 0.35rem;
}

.asset-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.asset-row-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.asset-delete-form {
  display: contents;
}

.asset-delete {
  padding: 0.4rem 0.55rem;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-text-muted);
}

.asset-delete:hover {
  background: var(--color-surface-muted);
  box-shadow: none;
  transform: none;
  color: var(--color-danger, #e53e3e);
}

.asset-download {
  padding: 0.4rem 0.55rem;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-text-muted);
}

.asset-download:hover {
  background: var(--color-surface-muted);
  box-shadow: none;
  transform: none;
  color: var(--color-text);
}

.asset-list.is-uploads-only .asset-row--generated {
  display: none;
}

.asset-filter-toggle[aria-pressed="true"] {
  background: var(--color-text);
  color: #ffffff;
  border-color: var(--color-text);
  box-shadow: none;
}

.asset-filter-toggle[aria-pressed="true"]:hover {
  background: var(--color-text);
  opacity: 0.88;
}

.asset-generating-list {
  margin-bottom: 0.85rem;
}

.asset-row--pending,
.asset-row--failed {
  border-style: dashed;
}

.asset-row--failed {
  border-color: var(--color-danger, #c0392b);
}

.asset-thumb--status {
  background: var(--color-surface-muted);
}

.egg-pan-loader.is-asset {
  width: 100%;
  max-width: 56px;
  height: auto;
}

.asset-dismiss {
  margin: 0;
}

.asset-upload-modal,
.asset-generate-modal,
.asset-transparency-modal,
.audience-modal,
.feedback-modal {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.modal.asset-transparency-modal {
  width: 520px;
}

.asset-transparency-spinner {
  animation: button-spin 760ms linear infinite;
  transform-origin: center;
}

.feedback-modal,
.audience-modal {
  width: 540px;
}

.feedback-modal .segmented-toggle {
  box-shadow: none;
}

.audience-modal-form .field + .field {
  margin-top: 0.85rem;
}

.audience-modal-form .form-actions {
  margin-top: 1.25rem;
}

.field-with-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-with-action select {
  flex: 1 1 auto;
  min-width: 0;
}

.field-with-action .button {
  flex: 0 0 auto;
  min-height: 38px;
}

.form-error {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-danger-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.88rem;
}

.asset-generate-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.asset-generate-note svg {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
}

.modal-close,
button.modal-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  min-height: 0;
  padding: 0;
  color: var(--color-text-subtle);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.modal-close:hover,
button.modal-close:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
  box-shadow: none;
  transform: none;
}

.modal-close .phosphor-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.asset-dropzone {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem;
  background: var(--color-surface-muted);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.asset-dropzone.is-dragging {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(249, 111, 53, 0.18);
}

.asset-dropzone.is-compact {
  min-height: 180px;
  padding: 1.35rem;
}

.asset-dropzone.is-compact .asset-dropzone-title {
  font-size: 1.1rem;
}

.asset-dropzone-title {
  color: var(--color-text);
  font-size: 1.6rem;
  font-weight: var(--fw-semibold);
}

.asset-dropzone-copy {
  max-width: 30rem;
  color: var(--color-text-muted);
}

.asset-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.asset-upload-selected {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.asset-upload-selected ul {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.asset-upload-selected li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.asset-selection-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.asset-selection-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-selection-icon {
  display: grid;
  place-items: center;
  max-width: 2.4rem;
  color: var(--color-text-subtle);
  font-size: 0.62rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.asset-selection-body {
  min-width: 0;
}

.asset-selection-name {
  display: block;
  overflow: hidden;
  color: var(--color-text);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-selection-meta {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.asset-upload-progress {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.asset-upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.asset-upload-meter {
  height: 8px;
  overflow: hidden;
  background: var(--color-surface-muted);
  border-radius: var(--radius-pill);
}

.asset-upload-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-primary);
  transition: width 140ms ease;
}

.asset-upload-progress p {
  margin: 0.6rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.asset-upload-form .form-actions {
  margin-top: 1rem;
}

.danger-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 2rem;
  border-color: var(--color-border);
  background: var(--color-danger-soft);
}

.danger-panel h2,
.danger-panel p {
  margin: 0;
}

.danger-panel p {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0.28rem 0.5rem 0.16rem;
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag.is-success {
  background: var(--color-success-soft);
  color: var(--color-text);
}

.tag.is-danger {
  background: var(--color-danger-soft);
  color: var(--color-text);
}

.tag.is-live {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.tag.is-neutral {
  background: var(--color-surface);
  color: var(--color-text);
}

.property-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.45rem;
  padding: 0.24rem 0.5rem 0.2rem;
  background: var(--color-surface-muted);
  border-radius: var(--radius-sm);
  color: var(--color-text-subtle);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
}

.project-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  overflow: hidden;
}

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

.project-avatar.is-empty {
  background-color: var(--color-surface-muted);
}

.resource-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.field-with-preview {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.field-with-preview input {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-color-picker {
  display: grid;
  gap: 0.65rem;
}

.brand-color-list {
  display: grid;
  gap: 0.5rem;
}

.brand-color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-color-input {
  display: block;
  width: 58px;
  height: 42px;
  padding: 0.2rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(21, 21, 21, 0.14);
  cursor: pointer;
}

.brand-color-input:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 3px 3px 0 var(--color-border), 0 0 0 3px rgba(249, 111, 53, 0.2);
  outline: none;
}

.brand-color-name {
  flex: 1 1 auto;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
}

.brand-color-remove {
  width: 38px;
  height: 38px;
  padding: 0;
}

.brand-color-add {
  justify-self: start;
}

.brand-color-picker + .hint {
  margin-top: 0.4rem;
}

.project-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-regular);
}

.signal.is-complete {
  background: var(--color-success-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}

.preview-panel {
  min-height: 480px;
}

.artifact-preview-frame,
.artifact-image,
.artifact-video {
  display: block;
  width: auto;
  max-width: min(100%, 380px);
  height: auto;
  max-height: min(70vh, 700px);
  margin: 0 auto;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  object-fit: contain;
  overflow: hidden;
}

.artifact-preview-frame,
.artifact-video {
  aspect-ratio: 9 / 16;
  width: min(100%, 380px);
}

.qa-json {
  max-height: 260px;
  padding: 1rem;
  background: var(--color-ink);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: #f6f8fa;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow: auto;
}

.job-side-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.unlock-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface-muted);
}

.revision-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface-muted);
}

.revision-form {
  display: grid;
  gap: 0.65rem;
}

.revision-form textarea {
  min-height: 7rem;
}

.table-card {
  padding: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  background: var(--color-surface);
  border-collapse: separate;
  border-spacing: 0;
}

table th,
table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 2px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

table th {
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: uppercase;
}

table tr:last-child td {
  border-bottom: 0;
}

.price-tag {
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-tag.is-large {
  font-size: 1.7rem;
}

.price-period {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
}

.price-period.is-large {
  font-size: 0.95rem;
}

.purchase-summary {
  justify-content: space-between;
  margin: 1.25rem 0 0.5rem;
}

.bonus-badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
}

.product-list .resource-row.is-large {
  padding-top: 1.45rem;
  padding-bottom: 1.45rem;
}

.product-list .resource-row.is-large > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-list .resource-row.is-large h2 {
  margin-bottom: 0;
}

.product-card {
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 170ms ease, box-shadow 170ms ease, background-color 170ms ease;
}

.product-card:hover,
.product-card:focus-visible {
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  transform: translate(-3px, -4px);
  text-decoration: none;
}

.product-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.product-card:active {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}

.buy-cta {
  transform-origin: center;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 140ms ease, box-shadow 200ms ease;
}

.product-card:hover .buy-cta,
.product-card:focus-visible .buy-cta {
  transform: scale(1.2);
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.price-tag {
  transition: transform 200ms ease, opacity 200ms ease;
}

.product-card:hover .price-tag,
.product-card:focus-visible .price-tag {
  transform: translateX(-0.25rem);
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .buy-cta {
    transition: background-color 120ms ease;
  }
  .product-card:hover,
  .product-card:focus-visible {
    transform: none;
  }
  .product-card:hover .buy-cta,
  .product-card:focus-visible .buy-cta {
    transform: none;
  }
  .product-card:hover .price-tag,
  .product-card:focus-visible .price-tag {
    transform: none;
  }
}

.text-success {
  color: var(--color-green);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 60px);
}

.auth-panel {
  width: min(100%, 460px);
  padding: 1.75rem;
}

.auth-panel h1 {
  font-size: 1.6rem;
  font-weight: var(--fw-semibold);
  margin-bottom: 0.4rem;
}

.auth-panel p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.auth-panel--centered {
  width: min(100%, 420px);
  padding: 2.25rem 2rem;
  text-align: center;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-panel--centered p {
  max-width: 34ch;
  margin-inline: auto;
}

.auth-badge {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  color: var(--color-primary);
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.auth-badge svg {
  width: 1.75rem;
  height: 1.75rem;
}

.public-hero {
  display: grid;
  align-items: center;
  gap: clamp(2rem, 6vw, 4rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 360px);
  padding: 2rem 0 3rem;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 1rem;
  max-width: 18ch;
}

.hero-copy p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 50ch;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.hero-actions .button {
  min-height: 38px;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  font-size: 0.92rem;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.hero-proof span {
  padding: 0.3rem 0.6rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
}

.hero-preview {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 100%;
  max-width: 300px;
  background: var(--color-ink);
  border: 9px solid var(--color-ink);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ad-preview-bg {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 9 / 16;
  padding: 1.1rem;
  background-color: var(--color-yellow);
  background-image:
    radial-gradient(circle at 68% 46%, rgba(255, 255, 255, 0.9) 0 13%, rgba(255, 255, 255, 0) 13.5%),
    radial-gradient(circle at 58% 48%, rgba(249, 111, 53, 0.95) 0 15%, rgba(249, 111, 53, 0) 15.5%),
    linear-gradient(180deg, rgba(45, 120, 207, 0.08) 0 54%, rgba(21, 21, 21, 0.7) 100%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.ad-pill,
.ad-cta {
  align-self: flex-start;
  padding: 0.4rem 0.7rem;
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-size: 0.74rem;
  font-weight: var(--fw-medium);
}

.ad-copy {
  display: grid;
  gap: 0.4rem;
  color: #ffffff;
}

.ad-copy strong {
  font-size: 1.8rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: 1.05;
  letter-spacing: 0;
}

.ad-copy span {
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: var(--fw-regular);
  font-size: 0.86rem;
}

.ad-cta {
  align-self: stretch;
  border-radius: var(--radius-sm);
  text-align: center;
}

.public-story {
  margin-top: 1rem;
}

.public-band article {
  padding: 1.25rem;
}

.public-band h2 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: var(--fw-semibold);
}

.public-band p {
  margin: 0;
  color: var(--color-text-muted);
}

body.static.landing_v2 {
  --v2-ink: var(--color-ink);
  --v2-paper: var(--color-paper);
  --v2-paper-deep: var(--color-paper-deep);
  --v2-orange: var(--color-orange);
  --v2-red: var(--color-red);
  --v2-yellow: var(--color-yellow);
  --v2-green: var(--color-green);
  --v2-blue: var(--color-blue);
  --v2-pink: var(--color-pink);
  --v2-border: var(--color-border);
}

body.static.landing_v2 #main-nav {
  background: rgba(255, 243, 216, 0.92);
}

body.static.landing_v2 #main-nav a {
  border-radius: 7px;
  color: var(--v2-ink);
}

body.static.landing_v2 #main-nav a:hover,
body.static.landing_v2 #main-nav a.selected {
  background: #ffffff;
  border-color: var(--v2-border);
}

body.static.landing_v2 .nav-primary {
  background: var(--v2-ink) !important;
  border-color: var(--v2-ink) !important;
  color: #ffffff !important;
  box-shadow: 2px 2px 0 var(--v2-orange);
}

.landing-v2-shell {
  width: 100%;
  max-width: none;
  padding: 0 0 4rem;
}

.landing-v2-shell .button {
  border: 2px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--v2-border);
  font-weight: var(--fw-semibold);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.landing-v2-shell .button:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--v2-border);
}

.landing-v2-hero {
  position: relative;
  min-height: clamp(620px, calc(100vh - 60px), 760px);
  overflow: hidden;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(5rem, 10vw, 7rem);
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 207, 70, 0.9) 0 8rem, transparent 8.1rem),
    linear-gradient(135deg, #fff8e8 0%, #fff3d8 52%, #ffd6bf 100%);
  border-bottom: 3px solid var(--v2-border);
}

.landing-v2-hero::before {
  content: none;
}

.landing-v2-hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.landing-v2-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 1rem;
  padding: 0.24rem 0.7rem;
  background: var(--v2-yellow);
  border: 2px solid var(--v2-border);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--v2-border);
  color: var(--v2-ink);
  font-size: 0.82rem;
  font-weight: var(--fw-semibold);
}

.landing-v2-hero h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--v2-ink);
  font-size: clamp(4rem, 13vw, 9.5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
}

.landing-v2-lede {
  max-width: 54ch;
  margin: 1.25rem 0 1.6rem;
  color: #3d3327;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.42;
}

.landing-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-v2-primary-action {
  background: var(--v2-orange) !important;
  border-color: var(--v2-border) !important;
  color: var(--v2-ink) !important;
}

.landing-v2-secondary-action {
  background: #ffffff !important;
  color: var(--v2-ink) !important;
}

.landing-v2-hero-mascot {
  position: absolute;
  right: max(var(--gutter), calc((100vw - var(--content-width)) / 2));
  bottom: clamp(5rem, 4vw, 7rem);
  z-index: 0;
  width: min(40vw, 460px);
  max-height: 76%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(5px 6px 0 rgba(21, 21, 21, 0.2));
}

.landing-v2-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: -4.5rem auto 0;
  position: relative;
  z-index: 2;
  border: 3px solid var(--v2-border);
  background: #ffffff;
  box-shadow: 6px 6px 0 var(--v2-border);
}

.landing-v2-flow article {
  min-height: 230px;
  padding: 1.25rem;
  border-right: 2px solid var(--v2-border);
}

.landing-v2-flow article:nth-child(1) {
  background: #ffffff;
}

.landing-v2-flow article:nth-child(2) {
  background: #e5f4ff;
}

.landing-v2-flow article:nth-child(3) {
  background: #fff0a8;
  border-right: 0;
}

.landing-v2-flow article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  background: var(--v2-pink);
  border: 2px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--v2-border);
}

.landing-v2-step {
  margin: 0 0 0.35rem;
  color: #6d5f4e;
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
}

.landing-v2-flow h2 {
  margin-bottom: 0.5rem;
  color: var(--v2-ink);
  font-size: 1.35rem;
  letter-spacing: 0;
}

.landing-v2-flow p:last-child {
  color: #4c4034;
  font-size: 0.98rem;
}

.landing-v2-product {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
}

.landing-v2-product h2 {
  max-width: 13ch;
  color: var(--v2-ink);
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-v2-product p:not(.landing-v2-kicker) {
  max-width: 48ch;
  color: #4c4034;
  font-size: 1.05rem;
}

.landing-v2-product-visual {
  position: relative;
  padding-bottom: clamp(3rem, 7vw, 4.5rem);
}

.landing-v2-reel-preview {
  overflow: hidden;
  background: #fffaf0;
  border: 3px solid var(--v2-border);
  border-radius: 10px;
  box-shadow: 7px 7px 0 var(--v2-border);
}

.landing-v2-section-mascot {
  position: absolute;
  right: clamp(-1.5rem, -2vw, -0.75rem);
  bottom: -0.4rem;
  z-index: 2;
  width: min(34vw, 260px);
  filter: drop-shadow(4px 5px 0 rgba(21, 21, 21, 0.18));
  pointer-events: none;
}

.landing-v2-preview-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.85rem;
  background: var(--v2-green);
  border-bottom: 3px solid var(--v2-border);
}

.landing-v2-preview-bar span {
  width: 12px;
  height: 12px;
  background: #fffaf0;
  border: 2px solid var(--v2-border);
  border-radius: 50%;
}

.landing-v2-reel-window {
  overflow: hidden;
  padding: 1.2rem 0;
  background:
    linear-gradient(rgba(21, 21, 21, 0.05) 1px, transparent 1px),
    #f7e4ff;
  background-size: 18px 18px;
}

.landing-v2-reel-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: landing-v2-reel 24s linear infinite;
}

.landing-v2-ad-card {
  flex: 0 0 170px;
  padding: 0.7rem;
  background: #ffffff;
  border: 2px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--v2-border);
}

.landing-v2-ad-card p {
  margin: 0.65rem 0 0;
  color: var(--v2-ink);
  font-size: 0.86rem;
  font-weight: var(--fw-semibold);
}

.landing-v2-ad-image {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 2px solid var(--v2-border);
  border-radius: 6px;
}

.landing-v2-ad-image::before,
.landing-v2-ad-image::after {
  content: "";
  position: absolute;
  border: 2px solid var(--v2-border);
}

.landing-v2-ad-image::before {
  inset: 0.85rem 0.85rem auto;
  height: 52px;
  background: rgba(255, 255, 255, 0.82);
}

.landing-v2-ad-image::after {
  right: 1rem;
  bottom: 1rem;
  width: 54px;
  height: 54px;
  background: #ffffff;
  border-radius: 50%;
}

.landing-v2-ad-image-a {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.72) 0 22%, transparent 22%),
    var(--v2-orange);
}

.landing-v2-ad-image-b {
  min-height: 170px;
  background:
    linear-gradient(45deg, transparent 0 46%, rgba(255, 255, 255, 0.7) 46% 58%, transparent 58%),
    var(--v2-blue);
}

.landing-v2-ad-image-c {
  background:
    radial-gradient(circle at 30% 72%, rgba(255, 255, 255, 0.75) 0 2rem, transparent 2.05rem),
    var(--v2-green);
}

.landing-v2-ad-image-d {
  min-height: 120px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74) 0 36%, transparent 36%),
    var(--v2-yellow);
}

.landing-v2-formats {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 1.28fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
  padding-top: clamp(1rem, 3vw, 2rem);
}

.landing-v2-formats h2 {
  max-width: 11ch;
  color: var(--v2-ink);
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-v2-formats p:not(.landing-v2-kicker) {
  max-width: 50ch;
  color: #4c4034;
  font-size: 1.05rem;
}

.landing-v2-format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.landing-v2-format-grid article {
  min-height: 230px;
  padding: 1rem;
  background: #ffffff;
  border: 3px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--v2-border);
}

.landing-v2-format-grid article:nth-child(2) {
  background: #e5f4ff;
}

.landing-v2-format-grid article:nth-child(3) {
  background: #fff0a8;
}

.landing-v2-format-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  background: var(--v2-pink);
  border: 2px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--v2-border);
}

.landing-v2-format-grid h3 {
  margin-bottom: 0.55rem;
  color: var(--v2-ink);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.landing-v2-format-grid p {
  color: #4c4034;
  font-size: 0.96rem;
}

.landing-v2-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 150px;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
  padding: 1.25rem 1.25rem 1.25rem clamp(9rem, 18vw, 13rem);
  background: #151515;
  border: 3px solid var(--v2-border);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--v2-orange);
  color: #ffffff;
}

.landing-v2-footer-copy {
  display: grid;
  gap: 0.35rem;
}

.landing-v2-footer-copy p {
  max-width: 34ch;
  margin: 0;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: var(--fw-semibold);
}

.landing-v2-footer-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.landing-v2-footer-mascot {
  position: absolute;
  left: 1rem;
  bottom: -0.15rem;
  width: clamp(115px, 16vw, 180px);
  max-height: 190px;
  object-fit: contain;
  object-position: bottom left;
  filter: drop-shadow(4px 5px 0 rgba(249, 111, 53, 0.3));
}

.landing-v2-api {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 0.78fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
}

.landing-v2-api h2 {
  max-width: 12ch;
  color: var(--v2-ink);
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-v2-api p:not(.landing-v2-kicker) {
  max-width: 48ch;
  color: #4c4034;
  font-size: 1.05rem;
}

.landing-v2-code {
  overflow: hidden;
  background: #151515;
  border: 3px solid var(--v2-border);
  border-radius: 10px;
  box-shadow: 7px 7px 0 var(--v2-border);
}

.landing-v2-code-body {
  margin: 0;
  padding: 1.4rem 1.5rem;
  overflow-x: auto;
  color: #f4ede0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre;
}

.landing-v2-code-req { color: #ffcf46; font-weight: var(--fw-bold); }
.landing-v2-code-key { color: #7cc4ff; }
.landing-v2-code-str { color: #ffd6bf; }
.landing-v2-code-bool { color: var(--v2-orange); }
.landing-v2-code-tok { color: #9a8c78; }
.landing-v2-code-ok { color: #8be58b; font-weight: var(--fw-semibold); }

.landing-v2-agent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
}

.landing-v2-agent h2 {
  max-width: 16ch;
  color: var(--v2-ink);
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-v2-agent p:not(.landing-v2-kicker) {
  max-width: 56ch;
  color: #4c4034;
  font-size: 1.05rem;
}

.landing-v2-agent .code-block {
  width: 100%;
}

.landing-v2 .landing-v2-lede {
  max-width: 34ch;
}

.landing-v2 .landing-v2-actions {
  max-width: 34ch;
}

.landing-v2 .landing-v2-format-grid article {
  min-height: 0;
}

.landing-v2-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}

.landing-v2-card-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin: 0;
  background: var(--v2-pink);
  border: 2px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--v2-border);
}

.landing-v2-card-head h2,
.landing-v2-card-head h3 {
  margin: 0;
}

@keyframes landing-v2-reel {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 0.5rem));
  }
}

.style-guide-shell {
  display: grid;
  gap: 1.25rem;
}

.style-guide-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--color-yellow);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.style-guide-band h2,
.style-guide-band p {
  margin: 0;
}

.style-guide-band p {
  max-width: 58ch;
  color: var(--color-text-muted);
}

.style-guide-swatches {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.style-guide-swatch {
  display: grid;
  align-content: end;
  min-height: 118px;
  padding: 0.8rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.style-guide-swatch span {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}

.style-guide-swatch code {
  color: inherit;
  font-size: 0.78rem;
}

.style-guide-swatch.is-paper { background: var(--color-paper); }
.style-guide-swatch.is-ink { background: var(--color-ink); color: #ffffff; }
.style-guide-swatch.is-orange { background: var(--color-orange); }
.style-guide-swatch.is-yellow { background: var(--color-yellow); }
.style-guide-swatch.is-green { background: var(--color-green); color: #ffffff; }
.style-guide-swatch.is-blue { background: var(--color-blue); color: #ffffff; }
.style-guide-swatch.is-pink { background: var(--color-pink); }
.style-guide-swatch.is-red { background: var(--color-red); color: #ffffff; }

.style-guide-button-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.style-guide-buttons {
  display: grid;
  gap: 1rem;
}

.style-guide-buttons p {
  margin: 0;
}

.highlight {
  background-color: var(--color-highlight);
}

summary {
  cursor: pointer;
}

details summary::marker,
details[open] > summary::marker {
  content: normal;
}

.pagination {
  font-family: var(--font-sans);
  font-size: 1rem;
}

.pagination a,
.pagination em {
  padding: 0 0.25rem;
}

.pagination em.current {
  font-style: normal;
  opacity: 0.55;
  pointer-events: none;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(21, 21, 21, 0.45);
  cursor: pointer;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9000;
  width: 800px;
  max-width: 90vw;
  max-height: calc(90vh - 64px);
  overflow: auto;
  transform: translate(-50%, -50%);
}

.box {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.box:empty { display: none; }

.box.is-danger,
.box.is-red {
  background: var(--color-danger-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}

.box.is-blue,
.box.notice {
  background: var(--color-primary-soft);
}

.flashes {
  animation: flashes 5s forwards;
}

@keyframes flashes {
  0%   { transform: translateX(0);    opacity: 1; }
  1%   { transform: translateX(-6px); opacity: 1; }
  2%   { transform: translateX(6px);  opacity: 1; }
  3%   { transform: translateX(-6px); opacity: 1; }
  4%   { transform: translateX(0);    opacity: 1; }
  85%  { transform: translateX(0);    opacity: 1; }
  100% { transform: translateX(0);    opacity: 0; }
}

@media (max-width: 960px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-hero {
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }

  .hero-preview {
    order: -1;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .editor-details {
    max-width: 540px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 1rem;
  }

  #main-nav section {
    gap: 0.2rem;
    overflow-x: auto;
  }

  #main-nav a {
    flex-grow: 0;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .brand-name,
  .nav-links {
    display: none;
  }

  .control-header,
  .profile-header,
  .empty-state,
  .job-choice-panel,
  .estimate-panel,
  .danger-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-grid,
  .profile-metrics,
  .profile-links,
  .two-column,
  .ad-show-layout,
  .dashboard-grid,
  .job-output-grid,
  .dom-editor-grid,
  .public-band,
  .option-grid,
  .output-toggle {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .row-actions,
  .form-actions,
  .job-choice-actions,
  .hero-actions,
  .purchase-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions .button,
  .row-actions .button,
  .form-actions .button,
  .job-choice-actions .button,
  .hero-actions .button,
  .purchase-summary .button {
    width: 100%;
  }

  .list-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }

  .dashboard-project-rail {
    position: static;
  }

  .dashboard-ad-gallery {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .list-row form,
  .list-row .button {
    width: 100%;
    justify-content: center;
  }

  .asset-library-panel .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .asset-thumb {
    width: 56px;
    height: 56px;
  }

  .asset-row .tag {
    grid-column: 2;
    justify-self: start;
  }

  .asset-dropzone {
    min-height: 240px;
    padding: 1.4rem;
  }

  .asset-dropzone-title {
    font-size: 1.3rem;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .landing-v2-hero {
    min-height: auto;
    padding: 2.5rem var(--gutter) 18rem;
  }

  .landing-v2-hero h1 {
    font-size: clamp(3.4rem, 18vw, 5.4rem);
  }

  .landing-v2-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-v2-actions .button {
    width: 100%;
  }

  .landing-v2-hero-mascot {
    right: var(--gutter);
    bottom: 2.75rem;
    width: min(78vw, 320px);
    max-height: 290px;
  }

  .landing-v2-flow,
  .landing-v2-product,
  .landing-v2-api,
  .landing-v2-formats,
  .landing-v2-format-grid {
    grid-template-columns: 1fr;
  }

  .landing-v2-api-visual {
    order: 2;
  }

  .landing-v2-flow {
    margin-top: -2rem;
  }

  .landing-v2-flow article {
    min-height: 0;
    border-right: 0;
    border-bottom: 2px solid var(--v2-border);
  }

  .landing-v2-flow article:nth-child(3) {
    border-bottom: 0;
  }

  .landing-v2-product h2 {
    max-width: 14ch;
  }

  .landing-v2-format-grid article {
    min-height: 0;
  }

  .landing-v2-product-visual {
    padding-bottom: 7.5rem;
  }

  .landing-v2-section-mascot {
    right: 0.5rem;
    width: min(58vw, 220px);
  }

  .landing-v2-footer {
    align-items: stretch;
    min-height: 0;
    padding: 1.25rem;
  }

  .landing-v2-footer .button {
    width: 100%;
  }

  .landing-v2-footer-mascot {
    position: static;
    width: min(54vw, 170px);
    max-height: none;
    margin: -0.5rem auto 0;
  }

  .style-guide-band {
    flex-direction: column;
    align-items: stretch;
  }

  .style-guide-swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-v2-reel-track {
    animation: none;
  }
}

.api-docs {
  --api-nav-offset: 5rem;
}

.api-docs-hero {
  margin-bottom: 2rem;
}

.api-docs-hero h1 {
  margin-bottom: 0.6rem;
}

.api-docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 900px) {
  .api-docs-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }
}

.api-sidebar {
  min-width: 0;
}

@media (min-width: 900px) {
  .api-sidebar {
    position: sticky;
    top: var(--api-nav-offset);
    max-height: calc(100vh - var(--api-nav-offset) - 1rem);
    overflow-y: auto;
  }
}

.api-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.7rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
}

.api-search svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.api-search-input {
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 0.92rem;
}

.api-search-input:focus {
  outline: none;
}

.api-toc {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 1rem;
}

.api-toc-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.api-toc-heading {
  margin: 0.9rem 0 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.api-toc-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.api-toc-link:hover {
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.api-toc-link.is-section {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.api-toc-link .toc-path {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-method {
  flex-shrink: 0;
  width: 3.1rem;
  padding: 0.05rem 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--color-ink);
}

@media (max-width: 899px) {
  .api-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .api-toc-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .api-toc-heading {
    display: none;
  }

  .api-toc-link {
    border: 2px solid var(--color-border);
    background: var(--color-surface);
  }
}

.api-content {
  min-width: 0;
}

.api-section {
  scroll-margin-top: var(--api-nav-offset);
}

.api-section + .api-section {
  margin-top: 2.5rem;
}

.api-section-title {
  margin: 0 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--color-border);
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}

.api-quickstart {
  margin-top: 1.75rem;
}

.api-subsection-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}

.api-key-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.api-key-fresh-panel {
  padding: 1rem 1.1rem;
  background: var(--color-success-soft);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
}

.api-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.api-meta-label {
  margin: 0 0 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.api-placeholder-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.api-placeholder-note svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.api-docs p code,
.api-docs li code {
  padding: 0.1rem 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.api-group + .api-group {
  margin-top: 2.25rem;
}

.api-group-title {
  margin: 0 0 0.9rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  scroll-margin-top: var(--api-nav-offset);
}

.api-group-description {
  max-width: 72ch;
  margin: -0.35rem 0 1rem;
  color: var(--color-text-subtle);
  font-size: 0.95rem;
}

.api-endpoint-list {
  display: grid;
  gap: 1rem;
}

.api-endpoint {
  min-width: 0;
  padding: 1.15rem 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: var(--api-nav-offset);
}

.api-endpoint:target {
  border-color: var(--color-primary);
  box-shadow: 4px 4px 0 var(--color-primary);
}

.api-endpoint-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.api-endpoint-path {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  word-break: break-all;
  text-decoration: none;
}

.api-endpoint-path:hover {
  text-decoration: none;
  color: var(--color-primary);
}

.api-endpoint-anchor {
  display: inline-flex;
  opacity: 0;
  color: var(--color-text-muted);
  transition: opacity 120ms ease;
}

.api-endpoint-anchor svg {
  width: 0.95rem;
  height: 0.95rem;
}

.api-endpoint-path:hover .api-endpoint-anchor,
.api-endpoint:target .api-endpoint-anchor {
  opacity: 1;
}

.api-endpoint-summary {
  margin: 0 0 0.5rem;
  font-weight: var(--fw-semibold);
}

.api-endpoint .meta-line {
  margin-bottom: 0.5rem;
}

.api-empty {
  margin-top: 1.5rem;
  padding: 1.1rem;
  color: var(--color-text-muted);
  text-align: center;
  border: 2px dashed var(--color-border-muted);
  border-radius: var(--radius-md);
}

.method-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: var(--color-ink);
}

.method-get,
.toc-method.method-get { background: #bcd9ff; }
.method-post,
.toc-method.method-post { background: #aee4b0; }
.method-patch,
.toc-method.method-patch { background: var(--color-purple-soft); }
.method-put,
.toc-method.method-put { background: var(--color-purple-soft); }
.method-delete,
.toc-method.method-delete { background: var(--color-danger-soft); }

.api-response {
  margin-top: 0.85rem;
}

.api-response > summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
}

.api-response > summary:hover {
  color: var(--color-text);
}

.code-block {
  position: relative;
  min-width: 0;
  margin-top: 0.75rem;
  background: var(--color-ink);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.code-block-label {
  color: #c9bda9;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code-block-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: #c9bda9;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.code-block-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4ede0;
}

.code-block-copy:active {
  transform: none;
  box-shadow: none;
}

.code-block-copy.is-copied {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}

.code-block-copy svg {
  width: 0.85rem;
  height: 0.85rem;
}

.code-block-body {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  color: #f4ede0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre;
}

.code-block--compact .code-block-bar {
  padding: 0.55rem 0.6rem 0.55rem 1.1rem;
  border-bottom: none;
  list-style: none;
  cursor: pointer;
}

.code-block--compact .code-block-bar::marker,
.code-block--compact .code-block-bar::-webkit-details-marker {
  display: none;
}

.code-block-label-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.code-block-caret {
  width: 0.9rem;
  height: 0.9rem;
  color: #c9bda9;
  transition: transform 120ms ease;
}

.code-block--compact[open] .code-block-caret {
  transform: rotate(180deg);
}

.code-block--compact .code-block-label {
  font-size: 0.75rem;
}

.code-block--compact .code-block-copy {
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4ede0;
  font-size: 0.8rem;
}

.code-block--compact .code-block-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
}

.code-ph {
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 207, 70, 0.22);
  color: #ffd864;
  font-weight: var(--fw-semibold);
}

.api-placeholder-note .code-ph {
  background: var(--color-highlight);
  color: var(--color-ink);
}

.secret-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.secret-field-label {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.secret-field-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.secret-field-value {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  overflow-x: auto;
}

.secret-field-actions {
  display: flex;
  gap: 0.5rem;
}

.api-key-list .list-row {
  align-items: flex-start;
}

.list-row-main {
  min-width: 0;
}

.list-row.is-revoked {
  opacity: 0.62;
}

.button.is-quiet,
button.is-quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-text-muted);
}

.button.is-quiet:hover,
button.is-quiet:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-muted);
  color: var(--color-text);
}

.api-key-ref {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  word-break: break-all;
}

.key-reveal-toggle {
  margin-left: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.key-reveal-toggle:hover {
  color: var(--color-text);
}

.meta-line-quiet {
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.api-key-create {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--color-border);
}

.api-key-create-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.api-key-create-form .field {
  flex: 1 1 220px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .api-meta-grid {
    grid-template-columns: 1fr;
  }
}

.labs-nav {
  flex-wrap: wrap;
  max-width: 100%;
  margin-bottom: 1.5rem;
}

.labs-nav a.segmented-option {
  text-decoration: none;
}

.labs-nav a.segmented-option.is-active {
  background: var(--color-primary);
  color: var(--color-text);
}

.labs-nav a.segmented-option.is-active:hover {
  background: var(--color-primary-hover);
}

.labs-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.labs-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--color-text);
}

.labs-metric-value {
  font-size: 2rem;
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.labs-metric-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.labs-template-filters {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.labs-template-filter-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.labs-template-filter-label,
.labs-template-property-label {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: uppercase;
}

.labs-template-segmented {
  margin-bottom: 0;
  box-shadow: none;
}

.labs-template-segmented a.segmented-option {
  text-decoration: none;
}

.labs-template-segmented-option {
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.38rem 0.56rem;
  font-size: 0.78rem;
}

.labs-template-segmented-option.is-active {
  background: var(--color-primary);
  color: var(--color-text);
}

.labs-template-segmented-option.is-active:hover {
  background: var(--color-primary-hover);
}

.labs-template-filter-count,
.labs-template-filter-dimension {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.15rem;
  padding: 0 0.28rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  line-height: 1;
  opacity: 0.78;
}

.labs-template-filter-count {
  min-width: 1.35rem;
}

.labs-template-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.2;
}

.labs-template-summary strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.labs-template-summary-sep {
  color: var(--color-border);
}

.labs-template-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* All four aspect classes side-by-side: the QA rule that a template does not
   ship until it works at every size, made visible. */
.labs-template-aspect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
}

@media (max-width: 720px) {
  .labs-template-aspect-grid { grid-template-columns: repeat(2, 1fr); }
}

.labs-template-aspect {
  margin: 0;
  min-width: 0;
}

.labs-template-aspect figcaption {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted, #888);
  text-align: center;
}

.labs-template-issues {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.labs-template-preview {
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.labs-template-preview-frame {
  container-type: inline-size;
  aspect-ratio: var(--template-preview-aspect, 9 / 16);
  background: #151515;
  overflow: hidden;
}

.labs-template-preview-frame iframe {
  display: block;
  width: var(--template-preview-width, 1080px);
  height: var(--template-preview-height, 1920px);
  border: 0;
  background: #151515;
  transform: scale(calc(100cqw / var(--template-preview-width, 1080px)));
  transform-origin: top left;
  pointer-events: none;
}

.labs-template-preview-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 2px solid var(--color-border);
}

.labs-template-preview-meta h2 {
  margin: 0;
  font-size: 0.95rem;
}

.labs-template-preview-meta code {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  word-break: break-word;
}

.labs-template-properties {
  display: grid;
  gap: 0.85rem;
  padding: 0 0.75rem 0.85rem;
}

.labs-template-property {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.labs-template-property strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.labs-template-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.45rem;
}

.labs-template-mode-grid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.labs-template-properties .tag {
  min-height: 1.1rem;
  padding: 0.18rem 0.32rem 0.1rem;
  font-size: 0.55rem;
}

.labs-template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 640px) {
  .labs-template-filter-row,
  .labs-template-mode-grid {
    grid-template-columns: 1fr;
  }

  .labs-template-segmented {
    flex-wrap: wrap;
  }

  .labs-template-segmented-option {
    flex: 1 1 9rem;
  }

  .labs-template-segmented-option:not(:last-child) {
    border-right: 0;
  }

  .labs-template-filter-row {
    gap: 0.4rem;
  }
}

.labs-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.labs-search input[type="search"] {
  flex: 1 1 auto;
  max-width: 28rem;
}

.labs-result-count {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.labs-back {
  margin-bottom: 1rem;
}

.labs-rendered-sizes {
  margin-bottom: 1.5rem;
}

.labs-rendered-sizes h2 {
  margin-bottom: 0.75rem;
}

.labs-render-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 300px));
  align-items: start;
  gap: 1rem;
}

.labs-render-preview {
  width: 100%;
  max-width: 300px;
  margin: 0;
}

.labs-render-preview figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.labs-render-preview figcaption strong {
  color: var(--color-text);
}

.labs-preview-note {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.table-card table th a {
  color: inherit;
  text-decoration: none;
}

.table-card table th.is-sorted a {
  color: var(--color-text);
}

.labs-detail th {
  width: 12rem;
  white-space: nowrap;
}

.labs-detail code {
  word-break: break-all;
}

.labs-token-balance {
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.labs-token-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.labs-token-form .field {
  margin-bottom: 0;
}

.labs-token-form input[type="number"] {
  width: 9rem;
}

.labs-token-form .labs-token-note {
  flex: 1 1 14rem;
}

.labs-token-form .labs-token-note input {
  width: 100%;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.pagination a,
.pagination span {
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.85rem;
}

.pagination .current {
  background: var(--color-primary);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.4;
}

/* Tooltip (see tooltip_controller.js). The bubble is appended to <body> and
   positioned in page coordinates, so it can float over cards, modals, and
   anything with clipped overflow. Styled to match the app's chunky surfaces:
   solid border, hard offset shadow, no gradients. */
.tooltip-bubble {
  position: absolute;
  z-index: 9500;
  max-width: 15rem;
  padding: 0.45rem 0.6rem;
  background: var(--color-ink);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--color-paper-light);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip-bubble[data-placement="bottom"] {
  transform: translateY(-3px);
}

.tooltip-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .tooltip-bubble {
    transition: opacity 120ms ease;
    transform: none;
  }
}

.center {
  text-align: center;
}

/* =========================================================================
   Secondary ad landing page (/creative-api). Clay mascot, API + app pitch.
   Lives inside the standard centered content column (no full-bleed bands).
   ========================================================================= */
.ad-lp {
  --lp-ink: var(--color-ink);
  --lp-orange: var(--color-orange);
  --lp-yellow: var(--color-yellow);
  --lp-muted: #4a4032;
  --lp-shadow: 5px 5px 0 var(--lp-ink);
  --lp-shadow-sm: 3px 3px 0 var(--lp-ink);
  --lp-border: 3px solid var(--lp-ink);
  --lp-radius: 14px;
  color: var(--lp-ink);
  padding-bottom: 1rem;
}

.ad-lp .button {
  border: 2px solid var(--lp-ink);
  border-radius: var(--button-radius);
  box-shadow: var(--lp-shadow-sm);
  font-weight: var(--fw-semibold);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.ad-lp .button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--lp-ink); }
.ad-lp .button:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--lp-ink); }
.ad-lp-primary { background: var(--lp-orange) !important; color: var(--lp-ink) !important; }
.ad-lp-secondary { background: #fff !important; color: var(--lp-ink) !important; }

.ad-lp h1, .ad-lp h2, .ad-lp h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
.ad-lp code {
  padding: 0.06em 0.36em;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-muted);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.ad-lp-textlink {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--lp-ink); font-weight: var(--fw-semibold);
  text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 3px; text-decoration-color: var(--lp-orange);
}
.ad-lp-textlink:hover { color: var(--lp-orange); }
.ad-lp-textlink .phosphor-icon { width: 1em; height: 1em; }

.ad-lp-section { padding: clamp(2.75rem, 6vw, 4.25rem) 0; }
.ad-lp-section > h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.05;
}
.ad-lp-lead { margin: 0 0 1.75rem; max-width: 52ch; color: var(--lp-muted); font-size: 1.05rem; line-height: 1.5; }

/* ── Hero ─────────────────────────────────────────────── */
.ad-lp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}
.ad-lp-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800; line-height: 0.96;
}
.ad-lp-hero-lede { margin: 1rem 0 1.4rem; max-width: 40ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.45; color: var(--lp-muted); }
.ad-lp-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.ad-lp-actions-center { justify-content: center; }
.ad-lp-micro { margin: 0.95rem 0 1.5rem; font-size: 0.95rem; color: var(--lp-muted); }
.ad-lp-micro strong { color: var(--lp-ink); }

.ad-lp-hero-code {
  max-width: 520px;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);   /* breathing room below the action buttons */
  background: #1c1a17; border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow); overflow: hidden;
}
.ad-lp-code-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.8rem; background: #2a2723; border-bottom: 2px solid #000;
}
.ad-lp-code-bar span { width: 10px; height: 10px; border-radius: 50%; background: #514b43; }
.ad-lp-code-bar span:first-child { background: var(--lp-orange); }
.ad-lp-code-bar em { margin-left: auto; font-style: normal; font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: #8a8175; }
.ad-lp-code-body {
  margin: 0; padding: 1rem 1.1rem;
  font-family: var(--font-mono); font-size: clamp(0.76rem, 1.3vw, 0.9rem);
  line-height: 1.65; color: #f3ede1; white-space: pre; overflow-x: auto;
}
.ad-lp-c-req { color: var(--lp-yellow); font-weight: 700; }
.ad-lp-c-key { color: #ffb27a; }
.ad-lp-c-tok { color: #8a8175; }
.ad-lp-c-str { color: #9ad9a0; }
.ad-lp-c-ok { color: #7fd18a; }

/* Mascot cutouts: transparent PNGs, drop-shadow, integrated (no photo box). */
.ad-lp-cut { display: block; pointer-events: none; filter: drop-shadow(6px 8px 6px rgba(21,21,21,0.22)); }
.ad-lp-hero-mascot {
  justify-self: end;
  width: min(115%, 560px);
  margin-left: -8%;   /* lean toward / over the code card */
  margin-bottom: -2rem;
}

/* ── Two ways in (API + app): whole card is the link ──── */
.ad-lp-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.ad-lp-card {
  display: block; position: relative;
  padding: 1.5rem 1.5rem 1.9rem;
  background: #fff; border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow); color: var(--lp-ink); text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.ad-lp-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--lp-ink); text-decoration: none; }
.ad-lp-card:active { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--lp-ink); }
.ad-lp-card-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.ad-lp-card-head h3 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.ad-lp-card-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: var(--lp-yellow); border: 2px solid var(--lp-ink);
  border-radius: 10px; box-shadow: 2px 2px 0 var(--lp-ink);
}
.ad-lp-card-icon .phosphor-icon { width: 24px; height: 24px; }
.ad-lp-card p { margin: 0; color: var(--lp-muted); line-height: 1.5; }
.ad-lp-card-go { position: absolute; right: 1.25rem; bottom: 1.1rem; display: inline-flex; color: var(--lp-orange); transition: transform 140ms ease; }
.ad-lp-card-go .phosphor-icon { width: 1.4rem; height: 1.4rem; }
.ad-lp-card:hover .ad-lp-card-go { transform: translateX(5px); }

/* ── Agents: logo strip + copy-only setup prompt ──────── */
.ad-lp-agents { position: relative; }
.ad-lp-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem 2rem; margin: 0 0 1.6rem; color: var(--lp-muted); }
.ad-lp-logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: var(--fw-semibold); font-size: 1.05rem; color: inherit; text-decoration: none; }
.ad-lp-logo:hover { color: var(--lp-ink); }
.ad-lp-logo svg { width: 23px; height: 23px; }
.ad-lp-logo-glyph { width: 21px; height: 21px; color: var(--lp-ink); }
.ad-lp-quickstart-wrap { position: relative; }
.ad-lp-quickstart {
  position: relative; z-index: 1;   /* sits in front of the robot tucked behind it */
  padding: 1.4rem; margin-top: 0.5rem;
  background: var(--color-surface-muted); border: var(--lp-border);
  border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
}
/* Robot mascot tucked BEHIND the card: only its head + shoulders rise above the
   card's top edge. No drop-shadow — the card is the surface it sits behind, so
   there is no stray bottom border on the cutout. */
.ad-lp-robot {
  position: absolute; z-index: 0;
  right: clamp(0.5rem, 3vw, 2.5rem); bottom: 1.75rem;
  width: min(32%, 240px);
  pointer-events: none; display: block;
}

/* ── Loop: interactive stepper ────────────────────────── */
.ad-lp-steps {
  list-style: none; margin: 2.75rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.ad-lp-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center; padding: 0 0.4rem; }
.ad-lp-step:not(:last-child)::after {
  content: ""; position: absolute; top: 27px; left: 50%; width: 100%; height: 4px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--lp-ink) 0 6px, transparent 6px 12px);
  opacity: 0.28;
}
.ad-lp-step-num {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: #fff; border: 3px solid var(--lp-ink); border-radius: 999px; box-shadow: var(--lp-shadow-sm);
  animation: ad-lp-step-pulse 4s ease-in-out infinite; animation-delay: calc(var(--i) * 1s);
  transition: transform 140ms ease, background-color 140ms ease;
}
.ad-lp-step-num .phosphor-icon { width: 28px; height: 28px; }
.ad-lp-step-label { font-weight: var(--fw-semibold); }
.ad-lp-step:hover .ad-lp-step-num { transform: translateY(-5px) rotate(-6deg); background: var(--lp-yellow); }
@keyframes ad-lp-step-pulse {
  0%, 65%, 100% { background: #fff; transform: translateY(0); box-shadow: var(--lp-shadow-sm); }
  15%, 35% { background: var(--lp-orange); transform: translateY(-6px); box-shadow: 5px 7px 0 var(--lp-ink); }
}
@media (prefers-reduced-motion: reduce) { .ad-lp-step-num { animation: none; } }

/* ── On-brand: channel and customer-ad marquees ───────── */
.ad-lp-brand { display: block; }
.ad-lp-brand-head { max-width: 54ch; margin: 0 0 1.5rem; }
.ad-lp-brand-head h2 { margin: 0 0 0.5rem; font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; }

.ad-lp-marquee-wrap { position: relative; padding-bottom: 2.25rem; }
.ad-lp-marquee {
  position: relative; overflow: hidden;
  height: clamp(158px, 20vw, 210px);
  border: var(--lp-border); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
  background: linear-gradient(rgba(21,21,21,0.05) 1px, transparent 1px), var(--color-surface-muted);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.ad-lp-marquee-track {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 0; height: 100%;
  width: max-content; will-change: transform;
  animation: ad-lp-marquee 55s linear infinite;
}
/* JS takes over once loaded (data-js="on"); CSS animation is the no-JS fallback. */
.ad-lp-marquee[data-js="on"] .ad-lp-marquee-track { animation: none; }
@keyframes ad-lp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ad-lp-marquee-set { display: flex; align-items: center; gap: 0.5rem; padding-right: 0.5rem; height: 100%; flex: none; }
.ad-lp-marquee-ad {
  position: relative; flex: none; height: 78%; aspect-ratio: 4 / 5; margin: 0; overflow: hidden;
  border-radius: 6px; background: var(--lp-ink);
}
.ad-lp-marquee-ad video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-lp-marquee-ad--instagram-story { aspect-ratio: 9 / 16; }
.ad-lp-marquee-ad--feed-portrait { aspect-ratio: 4 / 5; }
.ad-lp-marquee-ad--square { aspect-ratio: 1; }
.ad-lp-marquee-ad--landscape { aspect-ratio: 1.91 / 1; }
.ad-lp-reel-mascot-wrap {
  position: absolute; left: 0; bottom: 0; z-index: 4; width: min(28%, 150px);
  cursor: help;
}
.ad-lp-reel-mascot { display: block; width: 100%; pointer-events: none; }
.ad-lp-reel-callout {
  position: absolute; left: 68%; bottom: calc(76% + 20px); width: max-content; max-width: min(190px, 58vw);
  padding: 0.65rem 0.8rem; color: var(--lp-ink); background: #fff;
  border: 2px solid var(--lp-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--lp-ink);
  font-size: 0.9rem; font-weight: var(--fw-semibold); line-height: 1.25;
  opacity: 0; visibility: hidden; transform: translate(-8px, 8px) rotate(-2deg);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}
.ad-lp-reel-callout::after {
  content: ""; position: absolute; left: 16px; bottom: -10px; width: 16px; height: 16px;
  background: #fff; border-right: 2px solid var(--lp-ink); border-bottom: 2px solid var(--lp-ink);
  transform: rotate(45deg);
}
.ad-lp-reel-mascot-wrap:hover .ad-lp-reel-callout,
.ad-lp-reel-mascot-wrap:focus .ad-lp-reel-callout {
  opacity: 1; visibility: visible; transform: translate(0, 0) rotate(-2deg);
}
.ad-lp-reel-mascot-wrap:focus-visible { outline: 3px solid var(--lp-orange); outline-offset: 3px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
  .ad-lp-marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .ad-lp-marquee-track { animation: none; }
}

/* Ad-platform logo rail: everywhere the ads can run. */
.ad-lp-vendors-label { margin: 1.4rem 0 1rem; color: var(--lp-muted); font-weight: var(--fw-semibold); font-size: 1.02rem; }
.ad-lp-vendors { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.9rem; }
.ad-lp-vendor {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--lp-muted); transition: color 140ms ease, transform 140ms ease;
}
.ad-lp-vendor:hover { color: var(--lp-ink); transform: translateY(-2px); }
.ad-lp-vendor svg { width: 26px; height: 26px; flex: none; }
.ad-lp-vendor-name { font-weight: var(--fw-semibold); font-size: 1rem; }
.ad-lp-channel-marquee {
  position: relative; height: 70px; margin: 0 0 1rem; overflow: hidden;
  border-radius: 14px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.ad-lp-channel-marquee-svg { position: absolute; width: 0; height: 0; pointer-events: none; }
.ad-lp-channel-marquee-track {
  display: flex; align-items: center; width: max-content; height: 100%; will-change: transform;
  animation: ad-lp-channel-marquee 34s linear infinite;
}
.ad-lp-channel-marquee[data-js="on"] .ad-lp-channel-marquee-track {
  animation: none; filter: url(#ad-lp-channel-marquee-blur);
}
.ad-lp-channel-marquee-set {
  flex: none; flex-wrap: nowrap; gap: 2rem; height: 100%; padding: 0 2rem; color: var(--lp-muted);
}
.ad-lp-channel-marquee-set .ad-lp-vendor { flex: none; }
.ad-lp-channel-marquee-edge { position: absolute; top: 0; bottom: 0; z-index: 3; width: 16%; cursor: ew-resize; }
.ad-lp-channel-marquee-edge--left { left: 0; }
.ad-lp-channel-marquee-edge--right { right: 0; }
@keyframes ad-lp-channel-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ad-lp-channel-marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .ad-lp-channel-marquee-track { animation: none; }
}

/* ── Cost ─────────────────────────────────────────────── */
.ad-lp-cost {
  margin: 0; padding: 1.6rem; text-align: center;
  background: linear-gradient(135deg, #fff4dc, #ffe6c9);
  border: var(--lp-border); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow);
  font-family: var(--font-display); font-weight: 800; line-height: 1.15;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
}

/* ── CTA ──────────────────────────────────────────────── */
.ad-lp-cta { text-align: center; padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; }
.ad-lp-cta h2 { margin: 0 0 1.25rem; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
.ad-lp-colophon { display: block; margin-top: 1.75rem; color: var(--lp-muted); font-size: 0.85rem; }
.ad-lp-colophon a { color: var(--lp-ink); text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .ad-lp-hero { grid-template-columns: 1fr; }
  .ad-lp-hero-mascot { grid-row: 1; justify-self: center; width: min(70%, 300px); margin: 0 auto 0.5rem; }
  .ad-lp-ways { grid-template-columns: 1fr; }
  .ad-lp-robot { width: min(42%, 160px); right: 0.5rem; }
  .ad-lp-reel-mascot-wrap { width: min(30%, 120px); }
}
@media (max-width: 520px) {
  .ad-lp-steps { grid-template-columns: 1fr 1fr; row-gap: 1.5rem; }
  .ad-lp-steps .ad-lp-step:not(:last-child)::after { display: none; }
}

/* ============================================================================
   /studio — third ad landing page. Cinematic, mascot-led: a full-bleed HD
   video hero of the Growth Chicken hand-cranking ads in his coop, then a
   deliberately minimal, elevated offer on brand paper.
   ========================================================================== */
.gc-studio {
  --gs-ink: var(--color-ink);
  --gs-orange: var(--color-orange);
  --gs-yellow: var(--color-yellow);
  --gs-paper: var(--color-paper);
  --gs-cream: #fff6e4;
  --gs-muted: #4a4032;
  --gs-border: 3px solid var(--gs-ink);
  --gs-shadow: 6px 6px 0 var(--gs-ink);
  --gs-shadow-sm: 3px 3px 0 var(--gs-ink);
  --gs-radius: 16px;
  color: var(--gs-ink);
  overflow-x: clip;
}
/* Break out of the global content-width cap so the hero is truly full-bleed;
   inner content is re-centered by .gc-studio-wrap / .gc-studio-hero-inner. */
body > main.gc-studio {
  width: 100%;
  max-width: none;
  margin: 0;
}
.gc-studio h1, .gc-studio h2, .gc-studio h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.02;
}

/* ---- HERO ---------------------------------------------------------------- */
.gc-studio-hero {
  position: relative;
  width: 100%;
  min-height: clamp(440px, 60vh, 700px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #f4c785 url("/assets/brand/gc-studio-hero-poster-f28bde3e.webp") center/cover no-repeat;
  isolation: isolate;
}
.gc-studio-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* cover preserves the video's aspect ratio (crops to fill, never stretches);
     center keeps the chicken framed as the hero height changes. */
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.gc-studio-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(20, 11, 4, 0.9) 0%, rgba(20, 11, 4, 0.62) 30%, rgba(20, 11, 4, 0.2) 58%, rgba(20, 11, 4, 0) 82%),
    linear-gradient(to right, rgba(20, 11, 4, 0.72) 0%, rgba(20, 11, 4, 0.24) 46%, rgba(20, 11, 4, 0) 72%);
}
.gc-studio-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: 0 auto;
  padding: 0 0 clamp(3rem, 7vh, 6rem);
  color: var(--gs-cream);
  max-width: 100%;
}
.gc-studio-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.85rem, 8vw, 6rem);
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}
.gc-studio-lede {
  max-width: 34rem;
  margin: 0 0 1.6rem;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.5;
  color: rgba(255, 246, 228, 0.92);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}
.gc-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.gc-studio-actions-center { justify-content: center; }
.gc-studio .button {
  border: 2px solid var(--gs-ink);
  border-radius: var(--button-radius);
  box-shadow: var(--gs-shadow-sm);
  font-weight: var(--fw-semibold);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.gc-studio .button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--gs-ink); }
.gc-studio .button:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--gs-ink); }
.gc-studio-primary { background: var(--gs-orange) !important; color: var(--gs-ink) !important; }
.gc-studio-secondary {
  background: rgba(255, 246, 228, 0.94) !important;
  color: var(--gs-ink) !important;
}

/* ---- shared layout ------------------------------------------------------- */
.gc-studio-wrap {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin: 0 auto;
}

/* ---- THE PITCH ----------------------------------------------------------- */
.gc-studio-band {
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
  background: var(--gs-paper);
  border-top: var(--gs-border);
}
.gc-studio-band h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
}
.gc-studio-sub {
  max-width: 42rem;
  margin: 0 0 2.6rem;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--gs-muted);
}
.gc-studio-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.gc-studio-card {
  padding: 1.6rem 1.5rem;
  background: var(--color-surface);
  border: var(--gs-border);
  border-radius: var(--gs-radius);
  box-shadow: var(--gs-shadow);
}
.gc-studio-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  color: var(--gs-orange);
  background: var(--color-primary-soft);
  border: 2px solid var(--gs-ink);
  border-radius: 12px;
}
.gc-studio-card-icon .phosphor-icon { width: 28px; height: 28px; }
.gc-studio-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}
.gc-studio-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--gs-muted);
}
.gc-studio-card code {
  padding: 0.06em 0.36em;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-muted);
  border-radius: 5px;
  font-size: 0.88em;
}

/* ---- FINAL CTA ----------------------------------------------------------- */
.gc-studio-cta {
  padding: clamp(3.5rem, 9vh, 6rem) 0 clamp(2.5rem, 6vh, 4rem);
  background: var(--gs-paper);
  text-align: center;
}
.gc-studio-cta h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
}
.gc-studio-cta p {
  margin: 0 0 1.8rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--gs-muted);
}
.gc-studio-colophon {
  display: block;
  margin-top: 2.4rem;
  font-size: 0.85rem;
  color: var(--gs-muted);
}
.gc-studio-colophon a { color: var(--gs-ink); text-decoration: underline; }

/* ---- EXPANDED BODY ------------------------------------------------------- */
/* Full-bleed paper band that re-hosts the /creative-api .ad-lp component set,
   re-centered by .gc-studio-wrap. The nested .ad-lp scope supplies its own
   tokens, so those components render identically to the /creative-api page. */
.gc-studio-more {
  background: var(--gs-paper);
  border-top: var(--gs-border);
}
.gc-studio-more .ad-lp { padding-bottom: 0; }
/* The band's own top/bottom rhythm is carried by the first/last ad-lp-section. */
.gc-studio-more .ad-lp-section:first-child { padding-top: clamp(3.5rem, 9vh, 6.5rem); }
.gc-studio-more .ad-lp-section:last-child { padding-bottom: clamp(3.5rem, 9vh, 6.5rem); }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 820px) {
  .gc-studio-trio { grid-template-columns: 1fr; }
  .gc-studio-hero { min-height: clamp(420px, 66vh, 620px); align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .gc-studio-hero-video { display: none; }
}
