:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #6f6a60;
  --line: #e8e2d8;
  --soft-line: rgba(23, 23, 23, 0.08);
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-soft: #fff1f1;
  --blue: #2563eb;
  --green: #138a63;
  --yellow: #f0b429;
  --purple: #7158e2;
  --shadow: 0 20px 70px rgba(24, 20, 16, 0.08);
  --red-shadow: 0 22px 70px rgba(220, 38, 38, 0.12);
  --radius: 8px;
  --home-content-width: 1280px;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(232, 226, 216, 0.42) 1px, transparent 1px),
    linear-gradient(180deg, rgba(232, 226, 216, 0.42) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 247, 0.98)),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  right: -210px;
  top: 122px;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.75) 0 28%, transparent 29%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(220, 38, 38, 0.08) 36px 38px, transparent 40px 58px),
    radial-gradient(circle at 50% 50%, rgba(220, 38, 38, 0.16), transparent 62%);
  opacity: 0.74;
  filter: blur(0.2px);
}

body::after {
  left: -260px;
  top: 398px;
  width: 540px;
  height: 360px;
  border-radius: 999px;
  background:
    repeating-radial-gradient(ellipse at 45% 45%, transparent 0 42px, rgba(220, 38, 38, 0.07) 44px 46px, transparent 48px 68px),
    radial-gradient(ellipse at 44% 46%, rgba(220, 38, 38, 0.11), transparent 58%);
  opacity: 0.62;
}

::selection {
  background: rgba(220, 38, 38, 0.18);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.auth-gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(620px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-card span {
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.auth-card h1 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 48px);
}

.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-card label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.auth-row input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #f8f9f5;
  color: var(--ink);
}

.auth-row input:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(226, 61, 61, 0.1);
}

.auth-error {
  margin: 12px 0 0 !important;
  color: var(--red-dark) !important;
  font-weight: 800;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 100vh;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 0 0 40px;
}

.topbar {
  display: flex;
  width: 100vw;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-left: calc(50% - 50vw);
  margin-bottom: 46px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.05);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
}

.top-tool-button {
  min-width: 112px;
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-lockup:hover {
  background: rgba(220, 38, 38, 0.06);
  transform: none;
}

.brand-lockup:focus-visible {
  outline: 3px solid rgba(220, 38, 38, 0.18);
  outline-offset: 3px;
}

.brand-lockup strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sigil {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: var(--red);
}

.brand-sigil svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
}

.hero-intro {
  display: grid;
  justify-items: center;
  margin: 0 auto 24px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  max-width: 1280px;
  margin: 0;
  font-size: clamp(42px, 3.6vw, 60px);
  line-height: 1.08;
  font-weight: 900;
}

h1 span {
  color: var(--red);
}

.hero-intro > p:last-child {
  max-width: 980px;
  margin: 15px 0 0;
  color: #626772;
  font-size: 18px;
  line-height: 1.62;
}

.hero-intro > .home-hero-subtitle {
  max-width: none;
  white-space: nowrap;
}

.extractor-history-button {
  margin-left: auto;
  min-width: 138px;
}

.home-view {
  display: grid;
  gap: 24px;
}

.home-tool-flow {
  display: grid;
  width: min(var(--home-content-width), 100%);
  gap: 16px;
  margin: 0 auto;
}

.home-tool-grid {
  display: grid;
  width: min(var(--home-content-width), 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

.home-downstream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.home-flow-label {
  justify-self: center;
  padding: 7px 14px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.home-tool-card {
  display: grid;
  min-height: 260px;
  align-content: start;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.home-persona-entry {
  min-height: 220px;
  border-color: rgba(220, 38, 38, 0.26);
  background: linear-gradient(135deg, rgba(255, 241, 241, 0.98), rgba(255, 255, 255, 0.94));
}

.home-tool-card:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
  transform: translateY(-2px);
}

.home-tool-card span {
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.home-tool-card strong {
  max-width: 520px;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.12;
}

.home-tool-card p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.home-persona-entry strong,
.home-persona-entry p {
  max-width: none;
}

.input-band {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 16px;
  width: min(var(--home-content-width), 100%);
  margin: 0 auto 18px;
  padding: 22px 28px 18px;
  border: 1px solid rgba(220, 38, 38, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 78px rgba(220, 38, 38, 0.1);
  backdrop-filter: blur(12px);
}

.input-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.input-title-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #1f2933;
}

.input-title-icon svg,
.button-icon svg,
.step-icon svg,
.preview-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.input-card-head label,
.link-form label {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 214px;
  gap: 18px;
  align-items: end;
}

.input-row textarea {
  min-width: 0;
  height: 116px;
  min-height: 116px;
  padding: 18px 20px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  line-height: 1.58;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.input-row textarea:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.input-row .primary-button {
  min-width: 214px;
  height: 60px;
  padding: 0 28px;
  font-size: 17px;
}

.input-submit-column {
  display: grid;
  width: 214px;
  gap: 8px;
  align-items: end;
}

.input-submit-column .primary-button {
  width: 100%;
}

.support-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.support-row em {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f0ea;
  color: #5d584f;
  font-style: normal;
  font-weight: 800;
}

.credit-notice {
  min-height: 20px;
  color: #6b6258;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.credit-notice strong,
.top-credit-balance strong {
  color: var(--red-dark);
  font-weight: 900;
}

.top-credit-balance {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 3px;
  padding: 0 14px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #4f352f;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.credit-notice.is-low {
  color: var(--red-dark);
}

.top-credit-balance.is-low {
  border-color: rgba(220, 38, 38, 0.42);
  background: rgba(220, 38, 38, 0.12);
  color: var(--red-dark);
}

.has-workspace-result .hero-intro {
  display: none;
}

.has-workspace-result .topbar {
  margin-bottom: 18px;
}

.has-workspace-result .input-band {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px;
  box-shadow: 0 12px 36px rgba(24, 20, 16, 0.06);
}

.has-workspace-result .input-row textarea {
  min-height: 72px;
}

.has-workspace-result .input-row .primary-button {
  height: 48px;
  font-size: 15px;
}

.primary-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  white-space: nowrap;
  box-shadow: 0 18px 34px rgba(220, 38, 38, 0.22);
}

.primary-button:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.22);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.remix-entry {
  height: 42px;
  padding: 0 18px;
}


.input-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.top-logout-button {
  min-width: 120px;
}

.button-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: currentColor;
}

.secondary-button:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
  transform: translateY(-1px);
}

.history-panel {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--soft-line);
  background: #fffaf7;
}

.history-head span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.history-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.history-card,
.history-empty {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.history-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  text-align: left;
}

.history-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding-top: 4px;
}

.history-card-actions .secondary-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.history-card-note {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.history-subhead {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.history-subhead .secondary-button {
  min-height: 40px;
  padding: 0 14px;
}

.history-card:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
}

.history-card-meta {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.history-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.history-card small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.history-list .sales-output-section {
  grid-column: 1 / -1;
}

.status-strip {
  display: grid;
  grid-template-columns: auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.status-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-step span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.status-step.is-done,
.status-step.is-active {
  color: var(--ink);
}

.status-step.is-done span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.status-step.is-active span {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.status-line {
  height: 1px;
  background: var(--line);
}

.status-line.is-done {
  background: var(--green);
}

.is-hidden {
  display: none !important;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 30;
  max-width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 28, 20, 0.18);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  padding: 14px 18px;
}

.app-toast.is-error {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
  color: var(--red);
}

.error-panel {
  display: grid;
  margin: 0 auto;
  width: min(980px, 100%);
}

.error-card {
  display: grid;
  justify-items: start;
  gap: 10px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
}

.error-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 0 11px;
}

.error-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
}

.error-card p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.empty-state {
  display: grid;
  width: min(1480px, 100%);
  margin: 0 auto;
  gap: 20px;
  padding: 0;
  text-align: center;
}

.sales-form-panel,
.sales-result-panel {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.sales-form-head span,
.sales-result-head span,
.sales-output-title span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.sales-form-head h2,
.sales-result-head h2 {
  margin: 6px 0 8px;
  font-size: 26px;
  line-height: 1.2;
}

.sales-form-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.sales-workspace,
.story-workspace,
.media-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 0.62fr);
  gap: 18px;
  align-items: stretch;
  height: calc(100vh - 112px);
  min-height: 620px;
  overflow: hidden;
}

.sales-form-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.sales-form-head,
.sales-result-head {
  padding: 18px;
  border-bottom: 1px solid var(--soft-line);
  background: #fffaf7;
}

.sales-copy-form {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  scrollbar-gutter: stable;
}

.story-question-panel,
.story-context-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.story-context-grid {
  display: grid;
  gap: 12px;
}

.story-context-grid label {
  display: grid;
  gap: 8px;
}

.story-context-grid label span,
.story-context-readonly span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.story-context-grid textarea {
  min-height: 70px;
}

.story-context-readonly {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: var(--radius);
  background: #fffaf7;
}

.story-context-readonly div {
  display: grid;
  gap: 6px;
}

.story-context-readonly p,
.story-context-readonly ul {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.story-context-readonly ul {
  padding-left: 18px;
}

.story-context-result-card dt {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.story-context-result-card dd {
  margin: 3px 0 0;
}

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

.story-mode-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.story-mode-grid input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--red);
}

.story-mode-grid span {
  display: grid;
  gap: 4px;
}

.story-mode-grid strong {
  color: var(--ink);
  font-size: 14px;
}

.story-mode-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.story-question-head {
  display: grid;
  gap: 4px;
}

.story-question-head span,
.story-question-card-head span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.story-question-head strong {
  color: var(--ink);
  font-size: 16px;
}

.story-question-list {
  display: grid;
  gap: 12px;
}

.story-question-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: var(--radius);
  background: #fffaf7;
}

.story-question-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-question-card-head strong {
  color: var(--ink);
  font-size: 15px;
}

.story-question-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.story-question-card label {
  display: grid;
  gap: 8px;
}

.story-question-card textarea {
  min-height: 88px;
}

.story-output-card {
  grid-column: 1 / -1;
}

.story-title-card p {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
}

.story-body-card {
  gap: 14px;
}

.story-body-card p + p {
  margin-top: 8px;
}

.story-request-card {
  margin-top: 4px;
}

.story-request-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.story-request-dl > div {
  display: grid;
  grid-template-columns: 6em 1fr;
  gap: 6px 12px;
  align-items: baseline;
}

.story-request-dl dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.story-request-dl dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}


.sales-type-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: var(--radius);
  background: #fffaf7;
}

.media-direct-form fieldset,
.story-form fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: var(--radius);
  background: #fffaf7;
}

.media-direct-form legend {
  padding: 0 6px;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.media-direct-form #mediaPrompt {
  min-height: 420px;
}

.media-prompt-counter {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.media-prompt-counter.is-over-limit,
.sales-parse-hint.is-error {
  color: var(--red-dark);
}

.sales-type-fieldset legend {
  padding: 0 6px;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.sales-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sales-type-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

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

.sales-type-grid label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.sales-type-grid input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--red);
}

.sales-copy-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.required-label::after {
  content: "*";
  margin-left: 4px;
  color: var(--red);
  font-weight: 900;
}

.sales-copy-form input,
.sales-copy-form select,
.sales-copy-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}

.sales-copy-form input {
  height: 46px;
  padding: 0 13px;
}

.sales-copy-form select {
  height: 46px;
  padding: 0 40px 0 13px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #6f6258 50%) calc(100% - 22px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #6f6258 50%, transparent 50%) calc(100% - 17px) 50% / 7px 7px no-repeat,
    #fff;
  cursor: pointer;
}

.sales-copy-form input::placeholder,
.sales-copy-form textarea::placeholder {
  color: #b7aea4;
  font-weight: 400;
  opacity: 1;
}

.sales-type-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
}

.sales-copy-form textarea {
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.6;
}

.sales-copy-form input:focus,
.sales-copy-form select:focus,
.sales-copy-form textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.sales-brief-fieldset {
  background: #fff;
}

.sales-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.media-product-upload {
  grid-template-columns: 1fr;
}

.sales-file-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.sales-upload-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
}

.tooltip-icon {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  cursor: help;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.tooltip-icon::after {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: none;
  width: min(360px, 72vw);
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 28, 20, 0.16);
  color: var(--ink);
  content: attr(aria-label);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
  white-space: normal;
}

.tooltip-icon:hover::after,
.tooltip-icon:focus-visible::after {
  display: block;
}

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

.sales-file-control {
  display: grid;
  min-height: 52px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.sales-file-control:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
}

.sales-file-control strong {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.sales-file-control em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-parse-hint {
  margin: 0;
  color: #7b7168;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.sales-parse-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.sales-parse-status.is-error {
  color: var(--red-dark);
}

.sales-parse-status.is-success {
  color: #167047;
}

.sales-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sales-form-actions,
.sales-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sales-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sales-credit-notice {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #6b6258;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.sales-credit-notice strong {
  color: var(--red-dark);
  padding: 0 2px;
}

.sales-result-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.sales-output {
  display: grid;
  gap: 12px;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  scrollbar-gutter: stable;
}

.sales-output:has(.sales-output-empty:only-child) {
  align-content: start;
}

.sales-output-empty,
.sales-output-title,
.sales-output-card,
.sales-output-warning {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.sales-output-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.sales-output-empty p {
  max-width: 640px;
  margin: 0;
  color: #42483f;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.78;
}

.sales-output-title {
  padding: 16px;
  background: var(--red-soft);
}

.sales-output-title h3 {
  margin: 7px 0 0;
  font-size: 24px;
  line-height: 1.25;
}

.sales-output-card,
.sales-output-warning {
  padding: 16px;
}

.sales-output-warning {
  border-color: rgba(220, 38, 38, 0.32);
  background: var(--red-soft);
  color: var(--red-dark);
  font-weight: 800;
  line-height: 1.7;
}

.sales-output-section {
  display: grid;
  gap: 10px;
}

.sales-output-section + .sales-output-section {
  margin-top: 8px;
}

.sales-output-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 6px;
  background: var(--red-soft);
}

.sales-output-section-label span {
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-prompt-actions {
  padding-right: 8px;
  border-right: 1px solid rgba(220, 38, 38, 0.18);
}

.media-generate-button {
  min-height: 34px;
  padding: 8px 12px;
  white-space: nowrap;
}

.media-prompt-button {
  min-height: 34px;
  padding: 8px 12px;
  border-color: rgba(220, 38, 38, 0.22);
  background: #fff;
  color: var(--red-dark);
  white-space: nowrap;
}

.media-result-card {
  padding: 16px;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 6px;
  background: #fff;
}

.media-result-card.is-loading,
.media-result-card.is-error {
  line-height: 1.7;
}

.media-result-card.is-error {
  border-color: rgba(220, 38, 38, 0.32);
  background: var(--red-soft);
  color: var(--red-dark);
}

.media-result-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.media-result-head {
  margin-bottom: 12px;
}

.media-result-head span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.media-result-head h4 {
  margin: 5px 0 0;
  font-size: 18px;
}

.media-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.media-asset {
  display: grid;
  gap: 10px;
}

.media-asset img,
.media-asset video {
  width: 100%;
  max-height: 480px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #f8fafc;
  object-fit: contain;
}

.media-download-link {
  justify-self: start;
  text-decoration: none;
}

.sales-output-card h4 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.3;
}

.sales-output-card p,
.sales-output-card li {
  color: #42483f;
  font-size: 14px;
  line-height: 1.78;
  white-space: pre-wrap;
}

.sales-output-card p {
  margin: 0;
}

.sales-output-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.sales-history-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.sales-history-card:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
}

.sales-history-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.media-history-preview {
  width: 100%;
  max-height: 180px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}

.media-prompt-history-card p {
  white-space: pre-wrap;
}

.sales-history-card p,
.sales-history-card small,
.sales-history-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sales-history-detail-head {
  display: grid;
  gap: 10px;
}

.sales-history-detail-head .secondary-button {
  width: fit-content;
}

.sales-compliance-card {
  background: #fffaf7;
}

.ip-workspace,
.personas-workspace {
  display: grid;
  gap: 18px;
  width: min(1480px, 100%);
  margin: 0 auto;
}

.ip-page-head {
  display: grid;
  gap: 8px;
  padding: 20px 2px 4px;
}

.ip-page-head span,
.persona-result-head span,
.persona-card-head span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.ip-page-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.ip-page-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.survey-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.survey-form,
.persona-result-panel,
.persona-detail-shell {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.survey-form {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(16px, 3vw, 28px);
}

.survey-basic-card,
.survey-question,
.persona-candidate-card,
.persona-detail-card,
.persona-edit-form,
.persona-empty-state {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.survey-basic-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.survey-basic-card textarea,
.survey-other-input,
.survey-extra-input,
.persona-edit-form input,
.persona-edit-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

.survey-basic-card textarea,
.survey-extra-input,
.persona-edit-form textarea {
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.6;
}

.survey-other-input,
.persona-edit-form input {
  height: 44px;
  padding: 0 12px;
}

.survey-basic-card textarea:focus,
.survey-other-input:focus,
.survey-extra-input:focus,
.persona-edit-form input:focus,
.persona-edit-form textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

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

.survey-module-head {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: var(--radius);
  background: #fffaf7;
}

.survey-module-head > span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.survey-module-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

.survey-module-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.survey-module-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}

.survey-step-dot {
  width: 34px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.12);
}

.survey-step-dot.is-active {
  background: var(--red);
}

.survey-step-dot.is-done {
  background: rgba(220, 38, 38, 0.45);
}

.survey-step-dot:disabled {
  cursor: not-allowed;
}

.survey-required-count {
  font-weight: 900;
}

.survey-question {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.survey-question-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.survey-question-head > span {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.survey-question h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.survey-question p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.survey-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.survey-question-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.survey-required-badge,
.survey-optional-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.survey-required-badge {
  background: var(--red-soft);
  color: var(--red-dark);
}

.survey-optional-badge {
  background: #f3f0eb;
  color: var(--muted);
}

.survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.survey-option {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.survey-option:hover {
  border-color: rgba(220, 38, 38, 0.32);
  background: var(--red-soft);
}

.survey-option.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.survey-option.is-disabled,
.survey-option:disabled {
  border-color: rgba(23, 23, 23, 0.06);
  background: #f3f0eb;
  color: #aaa39a;
  cursor: not-allowed;
}

.survey-other-label,
.persona-edit-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.survey-sticky-bar {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 250, 247, 0.96);
  box-shadow: 0 16px 40px rgba(24, 20, 16, 0.1);
}

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

.survey-progress-copy {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.survey-sticky-bar strong {
  color: var(--ink);
  font-size: 15px;
}

.persona-result-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.persona-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--soft-line);
  background: #fffaf7;
}

.persona-result-head h2 {
  margin: 6px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.persona-candidates,
.persona-detail-shell {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.persona-candidate-card,
.persona-detail-card,
.persona-edit-form,
.persona-empty-state {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.persona-text-block {
  display: grid;
  gap: 10px;
}

.persona-text-section {
  display: grid;
  gap: 6px;
}

.persona-text-block h4 {
  margin: 8px 0 0;
  color: var(--red-dark);
  font-size: 15px;
  line-height: 1.4;
}

.persona-text-block h4:first-child {
  margin-top: 0;
}

.persona-card-head h2,
.persona-card-head h3 {
  margin: 6px 0 0;
  line-height: 1.22;
}

.persona-card-head h2 {
  font-size: 28px;
}

.persona-card-head h3 {
  font-size: 21px;
}

.persona-positioning {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.55;
}

.persona-candidate-card p,
.persona-detail-card p {
  margin: 0;
  color: #42483f;
  font-size: 14px;
  line-height: 1.75;
}

.persona-fields {
  display: grid;
  gap: 8px;
  margin: 0;
}

.persona-fields dt {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.persona-fields dd {
  margin: 0;
  color: #42483f;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.persona-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.persona-tag-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.persona-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  border-color: rgba(220, 38, 38, 0.36);
  color: var(--red-dark);
}

.persona-edit-form label {
  display: grid;
  gap: 8px;
}

.persona-edit-modules {
  display: grid;
  gap: 12px;
}

.persona-edit-module {
  padding: 12px;
  border: 1px solid rgba(155, 46, 46, 0.14);
  border-radius: 8px;
  background: rgba(255, 248, 246, 0.62);
}

.persona-empty-state {
  justify-items: start;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.persona-empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.persona-empty-state p {
  margin: 0;
}

.persona-empty-state.is-error {
  border-color: rgba(220, 38, 38, 0.32);
  background: var(--red-soft);
  color: var(--red-dark);
  font-weight: 900;
}

.persona-warning-card {
  width: min(720px, 100%);
  max-width: 720px;
}

.persona-warning-card .modal-head {
  padding: 26px 30px 22px;
}

.persona-warning-card .modal-body {
  display: grid;
  gap: 14px;
  padding: 24px 30px 30px;
}

.persona-warning-card .modal-actions {
  margin-top: 8px;
}

.danger-confirm-button {
  border-color: #991b1b;
  background: #991b1b;
}

.danger-confirm-button:hover {
  border-color: #7f1d1d;
  background: #7f1d1d;
}

.persona-warning-text {
  max-width: 560px;
  margin: 0;
  color: #42483f;
  font-size: 15px;
  line-height: 1.75;
}

.empty-copy {
  display: grid;
  justify-items: center;
}

.empty-copy span {
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 900;
}

.empty-copy h2 {
  max-width: 680px;
  margin: 10px 0 10px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.14;
}

.empty-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.step-flow {
  display: grid;
  width: min(var(--home-content-width), 100%);
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: stretch;
  gap: 22px;
  margin: 0 auto;
}

.step-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  box-shadow: 0 14px 38px rgba(24, 20, 16, 0.06);
  backdrop-filter: blur(10px);
}

.step-card:hover {
  border-color: rgba(220, 38, 38, 0.26);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(24, 20, 16, 0.09);
}

.step-number {
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(23, 23, 23, 0.08);
  font-size: 34px;
  font-weight: 900;
}

.step-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff5f5, #ffe2e2);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.step-icon svg {
  width: 33px;
  height: 33px;
  stroke-width: 2;
}

.step-card .step-icon {
  grid-row: 1 / span 2;
}

.step-card h3 {
  grid-column: 2;
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.step-card p {
  grid-column: 2;
  margin: 8px 0 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.step-arrow {
  display: grid;
  place-items: center;
  color: rgba(23, 23, 23, 0.38);
  font-size: 40px;
  font-weight: 900;
}

.result-preview {
  width: min(var(--home-content-width), 100%);
  margin: 0 auto;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  padding: 18px 24px 16px;
  text-align: left;
  box-shadow: var(--shadow);
}

.result-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-preview-head span {
  display: block;
  width: 6px;
  height: 30px;
  border-radius: 999px;
  background: var(--red);
}

.result-preview-head h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.preview-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) minmax(360px, 1.55fr);
  gap: 12px;
  align-items: stretch;
}

.preview-item,
.preview-note {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.preview-item {
  display: grid;
  min-height: 118px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 16px 12px;
  text-align: center;
}

.preview-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #262626;
}

.preview-icon svg {
  stroke-width: 1.9;
}

.preview-item strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.preview-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}

.preview-note {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 18px;
}

.preview-note ul {
  display: grid;
  gap: 5px;
  align-content: start;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.preview-note li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-note li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #a8a29a;
}

.skeleton-lines {
  display: grid;
  align-content: center;
  gap: 7px;
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #f1f1f1;
}

.skeleton-line.short {
  width: 34%;
}

.skeleton-line.medium {
  width: 76%;
}

.skeleton-line.red {
  width: 68%;
  background: #fee2e2;
}


.result-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr);
  gap: 18px;
  align-items: start;
}

.source-panel {
  position: sticky;
  top: 18px;
  display: flex;
  max-height: calc(100vh - 36px);
  min-height: 520px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.source-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--soft-line);
  background: #fffaf7;
}

.source-head span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.source-head h2 {
  margin: 12px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.source-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.source-segments {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.source-caption,
.source-diagnostics,
.source-segment,
.source-empty {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.source-caption,
.source-diagnostics {
  padding: 14px;
}

.source-diagnostics {
  border-color: rgba(220, 38, 38, 0.28);
  background: var(--red-soft);
}

.source-diagnostics span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #7a4038;
  font-size: 12px;
  font-weight: 900;
}

.source-diagnostics p {
  margin: 0;
  color: #7a4038;
  font-size: 13px;
  line-height: 1.65;
}

.source-diagnostics p + p {
  margin-top: 8px;
}

.source-caption span,
.source-segment-index {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.source-caption p,
.source-segment-text {
  margin: 0;
  color: #42483f;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.source-segment {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  text-align: left;
}

.source-segment:hover,
.source-segment.is-active {
  border-color: rgba(220, 38, 38, 0.34);
  background: var(--red-soft);
}

.source-segment.is-active .source-segment-index {
  background: var(--red);
}

.time-end {
  opacity: 0.72;
}

.source-empty {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.insight-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.insight-head span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.insight-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.preview-card,
.rail-card,
.analysis-board,
.analysis-card {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.preview-card {
  display: block;
  min-height: 0;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.preview-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #f6f2eb;
}

.meta-row .platform-pill {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.1);
  color: var(--red-dark);
}

.preview-copy h2 {
  max-width: 720px;
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.12;
}

.preview-copy p {
  max-width: 680px;
  margin: 0 0 22px;
  color: #4e554c;
  font-size: 16px;
  line-height: 1.75;
}

.score-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fffaf7;
}

.radar-chart {
  display: grid;
  min-height: 320px;
  place-items: center;
}

.radar-chart svg {
  width: min(430px, 100%);
  height: auto;
  min-height: 300px;
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: #e4ddd2;
  stroke-width: 1;
}

.radar-axis {
  stroke: #e4ddd2;
  stroke-width: 1;
}

.radar-area,
.radar-shape {
  fill: rgba(226, 61, 61, 0.22);
  stroke: var(--red);
  stroke-linejoin: round;
  stroke-width: 3;
}

.radar-point {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2;
}

.radar-label {
  fill: #4e554c;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

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

.radar-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.radar-head strong {
  font-size: 18px;
  line-height: 1.2;
}

.analysis-board {
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--soft-line);
  background: #f6f2eb;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.tab-panel {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tab-panel.is-active {
  display: grid;
}

.analysis-card {
  min-height: 184px;
  padding: 18px;
}

.analysis-card.wide {
  min-height: 140px;
}

.card-index {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 20px;
  padding: 0 9px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.analysis-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.analysis-card p {
  margin: 0;
  color: #535a51;
  line-height: 1.7;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(23, 23, 23, 0.46);
}

.modal-card {
  display: flex;
  width: min(1180px, 100%);
  max-height: min(88vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 28, 20, 0.22);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 24px 30px 22px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.modal-head span {
  color: var(--red-dark);
  font-size: 15px;
  font-weight: 900;
}

.modal-head h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.14;
}

.icon-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.icon-button:hover {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: var(--red-dark);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.remix-form {
  display: grid;
  gap: 16px;
  padding: 26px 30px 18px;
}

.remix-form label,
.remix-controls label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.remix-form textarea,
.remix-controls select {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  outline: none;
  background: #fffaf7;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.remix-form textarea {
  min-height: 140px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.6;
}

.remix-controls select {
  height: 50px;
  padding: 0 14px;
}

.remix-form textarea:focus,
.remix-controls select:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.remix-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.remix-credit-notice {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  padding: 0;
  color: #6b6258;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.remix-credit-notice strong {
  color: var(--red-dark);
  font-weight: 900;
  padding: 0 2px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  height: 54px;
  min-height: 54px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 900;
}

.remix-output {
  display: grid;
  gap: 12px;
  padding: 0 30px 26px;
}

.remix-output-head,
.remix-output-card,
.remix-loading {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.remix-output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: var(--red-soft);
}

.remix-output-head h3 {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.remix-output-head span,
.remix-output-card span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
}

.remix-output-card,
.remix-loading {
  padding: 16px;
}

.remix-output-card h4 {
  margin: 8px 0 10px;
  font-size: 18px;
}

.remix-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.remix-card-title-row h4 {
  margin-bottom: 10px;
}

.remix-section-copy {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 13px;
}

.remix-output-card p,
.remix-output-card li,
.remix-loading {
  color: #42483f;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.remix-output-card p,
.remix-output-card li {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.remix-output-card ul,
.remix-output-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.remix-script-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remix-script-list li {
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fffaf7;
}

.remix-script-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.remix-visual-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

body.has-modal {
  overflow: hidden;
}

.is-loading .status-step.is-active span {
  animation: pulse 0.9s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .preview-note {
    grid-column: 1 / -1;
  }
}

@media (min-width: 781px) and (max-height: 760px) {
  .topbar {
    min-height: 58px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: clamp(36px, 3vw, 50px);
  }

  .hero-intro {
    margin-bottom: 14px;
  }

  .hero-intro > p:last-child {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.45;
  }

  .input-band {
    margin-bottom: 10px;
    padding: 14px 20px 12px;
  }

  .input-row textarea {
    height: 78px;
    min-height: 78px;
  }

  .input-row .primary-button {
    height: 50px;
  }

  .empty-state {
    gap: 12px;
  }

  .step-card {
    min-height: 82px;
    padding: 12px 16px;
  }

  .step-icon {
    width: 48px;
    height: 48px;
  }

  .step-icon svg {
    width: 26px;
    height: 26px;
  }

  .result-preview {
    padding: 12px 18px 10px;
  }

  .result-preview-head {
    margin-bottom: 10px;
  }

  .preview-item {
    min-height: 82px;
    padding: 8px;
  }

  .preview-icon {
    width: 28px;
    height: 28px;
  }
}

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

  .source-panel {
    position: static;
    max-height: none;
    min-height: 0;
  }

  .workspace {
    width: min(100%, calc(100vw - 24px));
    padding: 14px 0 40px;
  }

  .input-band {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .topbar {
    margin-bottom: 26px;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding-top: 0;
  }

  .brand-lockup {
    width: 100%;
  }

  .hero-intro {
    margin-bottom: 22px;
  }

  .hero-intro > p:last-child {
    font-size: 15px;
  }

  .hero-intro > .home-hero-subtitle {
    max-width: 100%;
    white-space: normal;
  }

  .extractor-history-button,
  .top-tool-button,
  .top-logout-button {
    width: 100%;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .auth-row .primary-button {
    width: 100%;
  }

  .history-head .secondary-button,
  .remix-entry,
  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    width: 100%;
  }

  .insight-head,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .remix-controls {
    grid-template-columns: 1fr;
  }

  .history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .history-subhead,
  .history-card-actions,
  .remix-card-title-row,
  .remix-output-head,
  .sales-output-section-label {
    align-items: stretch;
    flex-direction: column;
  }

  .history-card-actions .secondary-button,
  .remix-section-copy,
  .media-actions,
  .media-action-group,
  .media-prompt-button,
  .media-generate-button {
    width: 100%;
  }

  .media-actions,
  .media-action-group {
    justify-content: stretch;
  }

  .media-prompt-actions {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(220, 38, 38, 0.18);
  }

  .history-list {
    grid-template-columns: 1fr;
  }

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

  .input-row {
    grid-template-columns: 1fr;
  }

  .sales-form-actions,
  .sales-result-head,
  .sales-type-head,
  .survey-sticky-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-form-actions .primary-button,
  .sales-form-actions .secondary-button,
  .sales-result-head .secondary-button,
  .sales-type-actions .secondary-button,
  .survey-sticky-bar .primary-button,
  .persona-actions .secondary-button,
  .persona-actions .primary-button {
    width: 100%;
  }

  .sales-type-actions {
    width: 100%;
  }

  .sales-workspace,
  .story-workspace,
  .media-workspace,
  .survey-shell,
  .sales-form-grid,
  .sales-upload-row,
  .home-downstream-grid,
  .home-tool-grid,
  .story-mode-grid,
  .sales-type-grid {
    grid-template-columns: 1fr;
  }

  .sales-workspace,
  .story-workspace,
  .media-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sales-form-panel,
  .sales-result-panel {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .sales-form-panel {
    position: static;
  }

  .sales-copy-form,
  .sales-output {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .input-row .primary-button {
    width: 100%;
    min-width: 0;
  }

  .input-submit-column {
    width: 100%;
  }

  .top-credit-balance {
    justify-content: center;
    width: 100%;
  }

  .input-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .extractor-history-button {
    margin-left: 0;
  }

  .step-flow {
    grid-template-columns: 1fr;
  }

  .step-arrow {
    display: none;
  }

  .preview-items {
    grid-template-columns: 1fr;
  }

  .preview-note {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .status-line {
    display: none;
  }

  .preview-card {
    min-height: 0;
  }

  .tab-panel.is-active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 34px;
  }

  .preview-copy h2 {
    font-size: 26px;
  }

  .primary-small {
    display: none;
  }

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

  .brand-sigil {
    width: 34px;
    height: 34px;
  }

  .brand-lockup strong {
    font-size: 16px;
  }

  .support-row em {
    flex: 1 1 auto;
    justify-content: center;
  }

  .result-preview,
  .step-card,
  .preview-card,
  .analysis-board {
    padding: 14px;
  }
}
