:root {
  --bg: #efe6d8;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: rgba(255, 251, 244, 0.96);
  --ink: #1d1712;
  --muted: #62584d;
  --accent: #8a4426;
  --accent-soft: #cf8d67;
  --accent-deep: #4a2414;
  --gold: #b88a3b;
  --line: rgba(33, 22, 15, 0.11);
  --line-strong: rgba(72, 36, 20, 0.18);
  --shadow: 0 28px 90px rgba(41, 24, 10, 0.11);
  --shadow-soft: 0 20px 60px rgba(41, 24, 10, 0.08);
  --shadow-tight: 0 14px 36px rgba(41, 24, 10, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(circle at top left, rgba(218, 155, 104, 0.33), transparent 24%),
    radial-gradient(circle at top right, rgba(111, 56, 34, 0.18), transparent 22%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 20%, rgba(255, 255, 255, 0.03) 80%, transparent),
    radial-gradient(circle at 20% 15%, rgba(184, 138, 59, 0.05), transparent 12%),
    radial-gradient(circle at 78% 18%, rgba(138, 68, 38, 0.05), transparent 16%);
  mix-blend-mode: soft-light;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 22px 72px;
}

.global-notice {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin-bottom: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-radius: 18px;
  border: 1px solid rgba(160, 33, 33, 0.18);
  background: rgba(255, 246, 242, 0.96);
  color: #7b1d1d;
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(10px);
}

.global-notice-message {
  flex: 1 1 auto;
  line-height: 1.45;
}

.global-notice-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hero {
  margin-bottom: 30px;
  padding: 34px 36px 30px;
  border-radius: 34px;
  border: 1px solid rgba(74, 36, 20, 0.09);
  background:
    radial-gradient(circle at top right, rgba(184, 138, 59, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(248, 240, 229, 0.9));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 0%, rgba(255,255,255,0.32) 38%, transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(138, 68, 38, 0.03) 100%);
  pointer-events: none;
}

.mode-banner {
  margin-top: 18px;
  padding: 11px 15px;
  border-radius: 18px;
  background: rgba(138, 68, 38, 0.08);
  border: 1px solid rgba(138, 68, 38, 0.16);
  color: var(--accent);
  max-width: 48ch;
  font-size: 0.98rem;
  line-height: 1.35;
}

.mode-banner-dev {
  background: linear-gradient(135deg, rgba(128, 31, 18, 0.15), rgba(229, 122, 55, 0.22));
  border-color: rgba(128, 31, 18, 0.28);
  color: #5e2314;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: clamp(1.56rem, 2vw, 2.36rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4.8vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  max-width: 11ch;
}

.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  pointer-events: none;
}

.controls {
  padding: 26px;
}

.slider-preset-panel {
  margin: 12px 0 18px;
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(27, 23, 18, 0.08);
  box-shadow: var(--shadow-tight);
}

.slider-preset-panel h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.slider-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.preset-chip {
  display: grid;
  gap: 8px;
  text-align: left;
  align-items: start;
  min-height: 116px;
  padding: 22px 24px;
  border-radius: 28px;
  line-height: 1.25;
}

.preset-chip strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.preset-chip span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
  max-width: 28ch;
}

.project-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.featured {
  margin-top: 22px;
  padding: 26px;
}

.formatter {
  margin-top: 22px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.92), rgba(247, 239, 228, 0.88));
}

.my-library {
  margin-top: 22px;
  padding: 26px;
  background:
    radial-gradient(circle at top left, rgba(138, 68, 38, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(245, 237, 225, 0.92));
}

.video-export {
  margin-top: 22px;
  padding: 26px;
}

.promotion-suite {
  margin-top: 22px;
  margin-bottom: 34px;
  padding: 30px;
  border: 1px solid rgba(27, 23, 18, 0.08);
  border-radius: 34px;
  background:
    radial-gradient(circle at top left, rgba(164, 78, 42, 0.09), transparent 34%),
    radial-gradient(circle at bottom right, rgba(138, 68, 38, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.97), rgba(246, 239, 229, 0.92));
  box-shadow: var(--shadow-soft);
}

.community-indexer-panel {
  margin-top: 22px;
  margin-bottom: 30px;
  padding: clamp(24px, 3.5vw, 34px);
  display: grid;
  gap: 22px;
  border: 1px solid rgba(27, 23, 18, 0.08);
  background:
    radial-gradient(circle at top left, rgba(164, 78, 42, 0.08), transparent 32%),
    radial-gradient(circle at bottom right, rgba(138, 68, 38, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.97), rgba(246, 239, 229, 0.92));
  box-shadow: var(--shadow-soft);
}

.community-indexer-panel .featured-head {
  margin-bottom: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(138, 68, 38, 0.16);
}

.community-indexer-panel .featured-head > div:first-child {
  max-width: 42rem;
}

.community-indexer-panel .featured-copy {
  max-width: 34rem;
}

.community-indexer-panel .formatter-grid {
  gap: 18px;
}

.community-indexer-panel .sampler-panel {
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.7);
}

.community-indexer-panel .row {
  gap: 12px;
}

.community-indexer-panel .field {
  margin-bottom: 12px;
}

.community-indexer-panel label {
  font-size: 0.9rem;
}

.community-indexer-panel textarea {
  min-height: 228px;
  padding: 16px 18px;
  line-height: 1.5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.93rem;
}

.community-indexer-panel input[type="text"] {
  min-height: 54px;
  padding-inline: 18px;
}

.community-indexer-panel .actions {
  margin-top: 4px;
}

.community-indexer-panel .mcp-example {
  margin-top: 14px;
  min-height: 176px;
  background: rgba(72, 44, 25, 0.05);
}

.community-indexer-panel .campaign-atom-list {
  margin-top: 14px;
}

.community-indexer-panel .campaign-atom-card {
  padding: 18px 20px;
  align-items: start;
}

.community-indexer-panel .campaign-atom-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.community-indexer-panel .campaign-atom-card h3 {
  margin-top: 2px;
  font-size: 1.08rem;
}

.community-indexer-panel .campaign-atom-card .muted {
  margin-top: 6px;
}

.community-indexer-panel .campaign-status-pill {
  margin-top: 2px;
  white-space: nowrap;
}

.promotion-suite .featured-head {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(138, 68, 38, 0.18);
}

.promotion-suite h2 {
  max-width: 18ch;
}

.promotion-suite-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding-top: 18px;
}

.promotion-tool-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  background:
    radial-gradient(circle at top right, rgba(138, 68, 38, 0.09), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(250, 243, 235, 0.76));
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-tight);
}

.promotion-tool-card span {
  font-weight: 700;
  font-size: 1.02rem;
}

.promotion-tool-card small {
  color: var(--muted);
  line-height: 1.35;
}

.promotion-tool-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(57, 31, 17, 0.12);
}

.campaigns-panel {
  margin-top: 22px;
  margin-bottom: 30px;
  padding: 30px;
  background:
    radial-gradient(circle at top left, rgba(164, 78, 42, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.97), rgba(246, 239, 229, 0.92));
}

.translator {
  margin-top: 22px;
  padding: 26px;
}

.sampler {
  margin-top: 22px;
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(184, 138, 59, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(246, 238, 226, 0.9));
  border-color: rgba(138, 68, 38, 0.14);
}

.featured-head {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 20px;
}

.featured-head > div:first-child {
  max-width: 46rem;
}

.featured-copy {
  margin: 0;
  max-width: 30rem;
  align-self: end;
  padding: 0 0 0.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  justify-self: start;
}

.field-help {
  margin-top: 8px;
  line-height: 1.45;
}

.slider-help {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.slider-summary,
.slider-range-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.94rem;
}

.slider-range-copy strong {
  color: var(--ink);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sampler-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 22px;
}

.formatter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 22px;
}

.library-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.formatter-note {
  max-width: 44rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
}

.library-player-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.progress-meter {
  width: 100%;
  height: 12px;
  margin: 12px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 68, 38, 0.12);
  box-shadow: inset 0 0 0 1px rgba(27, 23, 18, 0.06);
}

.progress-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d7a15f);
  transition: width 0.35s ease;
}

.progress-meter-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.campaign-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.campaign-link-button {
  text-decoration: none;
}

.campaign-agent-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
  padding: 8px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-tight);
}

.campaign-agent-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.campaign-agent-nav a:hover,
.campaign-agent-nav a.is-active {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 243, 235, 0.86));
  transform: translateY(-1px);
}

.campaign-preset-grid,
.campaign-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.campaign-subscription-panel {
  display: grid;
  gap: 22px;
  margin-bottom: 30px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(27, 23, 18, 0.1);
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 18%, rgba(164, 78, 42, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(247, 237, 226, 0.72));
  box-shadow: var(--shadow-soft);
}

.subscription-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.subscription-plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 24px;
  border: 1px solid rgba(27, 23, 18, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-tight);
}

.subscription-plan-card.is-featured {
  border-color: rgba(79, 132, 91, 0.36);
  box-shadow: 0 22px 70px rgba(79, 132, 91, 0.16);
}

.subscription-plan-card.is-selected {
  background:
    linear-gradient(180deg, rgba(245, 251, 246, 0.92), rgba(255, 255, 255, 0.78));
  border-color: rgba(79, 132, 91, 0.42);
}

.subscription-plan-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.subscription-plan-topline span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(79, 132, 91, 0.14);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscription-plan-card h3 {
  margin: 0;
}

.subscription-price {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 0.95;
}

.subscription-price span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.subscription-includes {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.subscription-includes li::before {
  content: "•";
  margin-right: 8px;
  color: var(--accent);
}

.subscription-margin-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.subscription-billing-note {
  max-width: 860px;
}

.campaign-preset-card,
.campaign-list-card,
.campaign-empty-state,
.campaign-selected-preset,
.campaign-detail-hero {
  border: 1px solid rgba(27, 23, 18, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-tight);
}

.campaign-preset-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  min-height: 100%;
}

.campaign-preset-card h3,
.campaign-list-card h3,
.campaign-detail-hero h3 {
  margin: 0;
}

.campaign-preset-card p,
.campaign-list-card p,
.campaign-detail-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.campaign-preset-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(164, 78, 42, 0.12);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.campaign-preset-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.campaign-preset-start {
  width: 100%;
  margin-top: auto;
}

.campaign-back-link {
  min-height: 52px;
  padding-inline: 24px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 243, 235, 0.82));
  border-color: rgba(138, 68, 38, 0.16);
  box-shadow: var(--shadow-tight);
}

.campaign-setup-form .actions {
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 8px;
}

.campaign-setup-form .actions > * {
  min-width: 168px;
}

.campaign-setup-form .campaign-back-link {
  min-height: 54px;
  padding-inline: 22px;
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 242, 234, 0.82));
}

.campaign-setup-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.campaign-selected-preset,
.campaign-empty-state,
.campaign-detail-hero {
  padding: 22px 24px;
}

.campaign-selected-preset {
  display: grid;
  gap: 6px;
}

.campaign-selected-preset span {
  color: var(--muted);
}

.campaign-list {
  display: grid;
  gap: 14px;
}

.campaign-list-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
}

.campaign-status-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(164, 78, 42, 0.12);
  color: var(--accent);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.campaign-output-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.campaign-analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.campaign-stat-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  background:
    radial-gradient(circle at top right, rgba(95, 143, 104, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(250, 244, 236, 0.74));
  box-shadow: var(--shadow-tight);
}

.campaign-stat-card span {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.campaign-stat-card strong {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1;
}

.campaign-stat-card small {
  color: var(--muted);
  line-height: 1.35;
}

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

.campaign-output-card {
  align-content: start;
}

.campaign-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.campaign-mini-grid span {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  line-height: 1.35;
}

.campaign-mini-grid strong {
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.campaign-atom-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 24px;
}

.campaign-atom-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(95, 143, 104, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(250, 244, 236, 0.78));
  box-shadow: var(--shadow-tight);
}

.campaign-atom-card h3,
.campaign-atom-card p {
  margin: 0;
}

.campaign-atom-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.platform-card-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.platform-connect-button {
  min-width: 178px;
}

.platform-connected-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #315f3d;
  background: rgba(95, 143, 104, 0.14);
  border: 1px solid rgba(95, 143, 104, 0.22);
  font-weight: 700;
}

.platform-card-actions:empty {
  display: none;
}

.campaign-asset-pill {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  background: rgba(255, 255, 255, 0.62);
  margin: 12px 0;
}

.campaign-asset-pill span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.campaign-asset-pill strong {
  overflow-wrap: anywhere;
}

.campaign-metadata-box {
  display: grid;
  gap: 10px;
}

.campaign-metadata-box input,
.campaign-metadata-box textarea {
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
}

.sampler-panel {
  padding: 24px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(27, 23, 18, 0.08);
  box-shadow: var(--shadow-tight);
}

.narration-cleanup-panel {
  margin-top: 12px;
  margin-bottom: 24px;
  padding: 30px 38px;
}

.narration-cleanup-panel h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.sampler-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.voice-button-grid,
.compare-voice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.voice-chip,
.compare-chip {
  padding-inline: 16px;
}

.compare-chip.is-selected {
  background: rgba(138, 68, 38, 0.11);
  border-color: rgba(138, 68, 38, 0.34);
  color: var(--accent);
}

.compare-panel h3 {
  margin: 0;
  font-size: 1.15rem;
}

.compare-panel .muted {
  line-height: 1.45;
}

@media (max-width: 780px) {
  .slider-preset-grid {
    grid-template-columns: 1fr;
  }
}

#compareVoicesBtn {
  width: 100%;
  margin-top: 18px;
}

#compareStatus {
  margin-top: 12px;
}

.book-card {
  overflow: hidden;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 236, 224, 0.88)),
    linear-gradient(135deg, rgba(201, 128, 95, 0.18), rgba(122, 59, 34, 0.06));
  border: 1px solid rgba(27, 23, 18, 0.08);
  box-shadow: var(--shadow-tight);
}

.book-cover {
  position: relative;
  min-height: 220px;
  padding: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  overflow: hidden;
  color: #fff9f3;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.28), transparent 28%),
    linear-gradient(145deg, var(--cover-a, #8b4d33), var(--cover-b, #402116));
}

.book-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-monogram {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.16);
  border: 1px solid rgba(255, 250, 243, 0.22);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.book-runtime {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(25, 16, 12, 0.52);
  border: 1px solid rgba(255, 250, 243, 0.26);
  backdrop-filter: blur(6px);
  font-size: 0.8rem;
}

.book-body {
  padding: 16px 18px 18px;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 68, 38, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.book-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.book-author {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.96rem;
}

.book-description {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.book-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.audio-dock {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(27, 23, 18, 0.09);
}

.audio-dock audio {
  width: 100%;
  margin-top: 10px;
}

.featured-dock {
  margin-bottom: 18px;
}

.translation-library {
  margin-top: 8px;
}

.sidecar {
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(27, 23, 18, 0.08);
  box-shadow: var(--shadow-tight);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field-toggle {
  align-content: start;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-stack {
  display: grid;
  gap: 10px;
}

.file-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(252, 248, 242, 0.84)),
    radial-gradient(circle at top right, rgba(184, 138, 59, 0.08), transparent 30%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-picker:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 68, 38, 0.26);
  background: rgba(255, 255, 255, 0.94);
}

.file-picker-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(138, 68, 38, 0.1);
  color: var(--accent);
  font-size: 1.18rem;
  line-height: 1;
}

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

.file-picker-label {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.file-picker-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
  text-align: left;
}

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

.wallet-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(74, 36, 20, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 251, 246, 0.54)),
    radial-gradient(circle at top right, rgba(184, 138, 59, 0.08), transparent 24%);
}

.account-shell {
  margin-bottom: 22px;
}

.account-shell.is-signed-in .wallet-bar {
  margin-bottom: 0;
  padding: 30px 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.account-shell.is-signed-in .wallet-entry {
  max-width: none;
}

.wallet-copy {
  max-width: 46ch;
}

.account-title {
  margin: 0;
  font-size: clamp(1.56rem, 2vw, 2.36rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.account-status {
  margin-top: 10px;
  font-size: 0.98rem;
}

.wallet-entry {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  max-width: 860px;
}

.account-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.account-option-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 220px;
  padding: 28px 26px;
  border-radius: 28px;
  border: 1px solid rgba(74, 36, 20, 0.12);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  box-shadow: var(--shadow-tight);
}

.account-option-card:hover {
  transform: translateY(-2px);
}

.account-option-card.is-selected {
  border-color: rgba(138, 68, 38, 0.3);
  background: rgba(255, 252, 248, 0.88);
}

.account-option-card-wallet.is-selected {
  border-color: rgba(86, 132, 97, 0.34);
  background: rgba(245, 251, 246, 0.88);
}

.account-option-icon {
  width: 66px;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 1.7rem;
  line-height: 1;
}

.account-option-icon-email {
  background: rgba(228, 215, 200, 0.75);
  color: #7a5d47;
}

.account-option-icon-wallet {
  background: rgba(207, 232, 220, 0.88);
  color: #3d7550;
}

.account-option-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.account-option-copy {
  color: var(--muted);
  line-height: 1.45;
}

.guest-mode-note {
  margin: -2px 0 18px;
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  max-width: 860px;
}

.project-composer {
  display: grid;
  gap: 8px;
}

.wallet-hint {
  margin-top: 8px;
  max-width: 48ch;
  font-size: 1rem;
  line-height: 1.45;
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  align-items: center;
  justify-self: start;
}

.wallet-auth-panel {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(74, 36, 20, 0.09);
  border-radius: 22px;
  background: rgba(247, 251, 247, 0.84);
}

.wallet-auth-panel.is-signed-in {
  padding: 0;
  border: 0;
  background: transparent;
}

.wallet-auth-panel.is-signed-in .wallet-auth-copy {
  display: none;
}

.wallet-auth-copy {
  max-width: 42ch;
  line-height: 1.45;
}

.email-auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 10px 12px;
  padding: 14px;
  border: 1px solid rgba(74, 36, 20, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.email-auth-panel input {
  min-width: 0;
}

.email-auth-field {
  display: grid;
  gap: 6px;
}

.email-auth-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.account-email-btn {
  align-self: end;
  justify-self: start;
  padding-inline: 22px;
}

.email-auth-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  grid-column: 1 / -1;
}

.account-email-cancel {
  align-self: end;
}

.wallet-connect-btn {
  background: linear-gradient(180deg, #5f8f68, #4d7a58);
  color: #f7f5ef;
}

.wallet-actions button,
.wallet-link {
  white-space: nowrap;
}

.wallet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  text-decoration: none;
}

.wallet-label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.media-source-row {
  align-items: start;
}

.media-source-row .field {
  align-content: start;
}

.media-source-row .file-picker,
.media-source-row select {
  min-height: 76px;
}

.field-support {
  min-height: 3.6rem;
  display: block;
  line-height: 1.35;
}

label {
  font-size: 0.94rem;
  color: #2d241c;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(43, 28, 18, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(138, 68, 38, 0.42);
  box-shadow: 0 0 0 4px rgba(138, 68, 38, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

input[readonly] {
  color: var(--muted);
}

.link-field-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(43, 28, 18, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(252, 247, 241, 0.86)),
    radial-gradient(circle at top right, rgba(138, 68, 38, 0.09), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.56);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.link-field-shell:focus-within {
  border-color: rgba(138, 68, 38, 0.36);
  box-shadow: 0 0 0 4px rgba(138, 68, 38, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.link-field-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(138, 68, 38, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.link-field-shell input {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.link-field-shell input:focus {
  box-shadow: none;
  background: transparent;
}

.promotion-suite-head {
  margin-bottom: 0;
}

textarea {
  resize: vertical;
}

.slider-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.slider input[type="range"] {
  width: 100%;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 18px;
  color: var(--muted);
}

.cleanup-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  margin-top: 20px;
}

.cleanup-toggles label {
  display: flex;
  align-items: start;
  gap: 10px;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.payment-choice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(74, 36, 20, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 244, 0.62)),
    radial-gradient(circle at top right, rgba(95, 143, 104, 0.1), transparent 28%);
  box-shadow: var(--shadow-tight);
}

.payment-choice-panel strong {
  display: block;
  font-size: 1.05rem;
}

.payment-choice-panel p:last-child {
  margin-bottom: 0;
}

.payment-choice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

button,
.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(57, 31, 17, 0.12);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(180deg, #9d5331, var(--accent));
  color: #fff9f4;
  box-shadow: 0 12px 28px rgba(138, 68, 38, 0.22);
}

.secondary {
  background: linear-gradient(180deg, #d79a78, var(--accent-soft));
  color: #2d160d;
  box-shadow: 0 12px 26px rgba(138, 68, 38, 0.12);
}

.ghost {
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(27, 23, 18, 0.14);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(41, 24, 10, 0.06);
}

.wallet-actions .ghost {
  padding-inline: 20px;
}

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

.outputs {
  padding-left: 18px;
  margin: 10px 0 0;
}

.library-list {
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 8px;
}

.library-list-compact {
  max-height: 720px;
}

.library-list::-webkit-scrollbar {
  width: 10px;
}

.library-list::-webkit-scrollbar-track {
  background: rgba(27, 23, 18, 0.05);
  border-radius: 999px;
}

.library-list::-webkit-scrollbar-thumb {
  background: rgba(138, 68, 38, 0.28);
  border-radius: 999px;
}

.outputs a {
  color: var(--accent);
  font-weight: 600;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
}

.library-item {
  list-style: none;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(27, 23, 18, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-tight);
}

.library-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.library-title {
  display: block;
  font-size: 1.03rem;
}

.library-author {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.library-meta .edition-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(138, 68, 38, 0.09);
  color: var(--accent);
  font-weight: 600;
}

.library-tagline {
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

.library-actions {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.library-actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.library-play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  background: rgba(138, 68, 38, 0.12);
  border: 1px solid rgba(138, 68, 38, 0.18);
  color: var(--accent);
  font-weight: 600;
}

.library-play-button:hover {
  background: rgba(138, 68, 38, 0.16);
}

.library-sublist {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.library-inline-player {
  margin-top: 12px;
}

.library-inline-player audio {
  width: 100%;
}

#jobPlayer {
  margin-top: 14px;
}

#jobPlayer audio {
  width: 100%;
}

.error {
  color: #a02121;
}

code {
  word-break: break-all;
  background: rgba(138, 68, 38, 0.08);
  padding: 2px 5px;
  border-radius: 7px;
}

@media (max-width: 920px) {
  .grid,
  .row,
  .slider-group,
  .formatter-grid,
  .campaign-preset-grid,
  .campaign-detail-grid,
  .subscription-plan-grid,
  .campaign-analytics-grid,
  .library-grid,
  .sampler-grid,
  .promotion-suite-actions,
  .featured-head,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .campaign-list-card {
    align-items: stretch;
    flex-direction: column;
  }

  .campaign-agent-nav {
    border-radius: 24px;
  }

  .campaign-mini-grid,
  .campaign-atom-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px 24px 24px;
  }

  h1 {
    max-width: 12ch;
  }

  .cleanup-toggles {
    grid-template-columns: 1fr;
  }

  .narration-cleanup-panel {
    padding: 24px 22px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 22px 14px 56px;
  }

  .global-notice {
    top: 8px;
    padding: 12px 14px;
    gap: 10px;
    align-items: flex-start;
  }

  .global-notice-close {
    min-height: 40px;
  }

  .wallet-bar {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .account-shell.is-signed-in .wallet-bar {
    padding: 24px 20px;
  }

  .account-option-grid {
    grid-template-columns: 1fr;
  }

  .email-auth-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .account-choice-row > *,
  .wallet-actions,
  .wallet-bar .ghost,
  .actions > * {
    width: 100%;
  }

  .account-email-btn {
    justify-self: stretch;
  }

  .email-auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    flex-direction: column;
  }

  .payment-choice-panel {
    grid-template-columns: 1fr;
  }

  .payment-choice-actions {
    justify-content: stretch;
  }

  .payment-choice-actions > * {
    width: 100%;
  }

  .library-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .library-actions a,
  .library-actions button,
  .library-play-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .library-head {
    flex-direction: column;
  }
}

.mcp-example {
  background: rgba(72, 44, 25, 0.07);
  border: 1px solid rgba(72, 44, 25, 0.12);
  border-radius: 22px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-x: auto;
  padding: 18px 20px;
  white-space: pre;
}
