:root {
  color-scheme: light;
  --ink: #0f1d13;
  --muted: #6f746c;
  --line: #e5e8e2;
  --line-strong: #d5dbd1;
  --panel: #fbfcf8;
  --panel-strong: #ffffff;
  --paper: #f7f8f4;
  --accent: #526b18;
  --accent-dark: #173f21;
  --accent-soft: #f0f6e8;
  --lime: #e6f452;
  --rose: #b42342;
  --gold: #8f6408;
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 46px rgba(22, 32, 24, 0.07);
  --shadow-soft: 0 10px 24px rgba(22, 32, 24, 0.055);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, var(--paper) 34rem),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 520px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  max-width: 1440px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-links[hidden] {
  display: none;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.primary-action.mobile-start-action {
  display: none;
}

.brief-panel,
.result-panel {
  min-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brief-panel {
  position: sticky;
  top: 18px;
  display: block;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 30px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
}

.brand-block {
  display: grid;
  align-content: start;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  padding: 0 0 26px;
  margin: 0 0 26px;
}

.brand-block p {
  max-width: 34rem;
}

.brand-block h1 {
  color: var(--accent-dark);
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

.brand-block > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.desktop-rail-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.desktop-rail-steps span,
.desktop-rail-status {
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 10px 14px;
}

.desktop-rail-status {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  margin-top: 2px;
  padding: 14px;
}

.desktop-rail-status span,
.desktop-rail-status strong {
  display: block;
}

.desktop-rail-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-block .eyebrow {
  color: var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.brand-block p,
.empty-state p,
.result-card p {
  color: var(--muted);
  line-height: 1.7;
}

.brief-form {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: visible;
  padding: 0;
}

.history-panel {
  border: 1px solid rgba(189, 201, 195, 0.72);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  grid-column: 2;
  margin: 12px 18px 0;
  padding: 14px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.history-heading h2 {
  font-size: 18px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.ledger-list {
  display: grid;
  gap: 8px;
}

.product-list {
  display: grid;
  gap: 8px;
}

.ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--panel-strong);
}

.product-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--panel-strong);
}

.product-item strong,
.product-item span {
  display: block;
}

.product-item strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.product-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.compact-action {
  padding: 8px 10px;
}

.ledger-item strong,
.ledger-item span {
  display: block;
}

.ledger-item strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.ledger-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.ledger-amount {
  font-size: 16px;
  white-space: nowrap;
}

.ledger-amount.charge {
  color: var(--rose);
}

.ledger-amount.refund {
  color: var(--accent-dark);
}

.history-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.history-item[aria-current="true"] {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--accent-soft);
}

.history-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.history-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

label,
legend {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 14px 18px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 150px;
  border-radius: 24px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 6px;
}

.brief-presets {
  display: grid;
  gap: 12px;
}

.brief-presets h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.brief-presets p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.brief-preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-preset-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 13px;
}

.brief-preset-actions button[aria-pressed="true"] {
  background: var(--lime);
  color: var(--ink);
}

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

.reference-upload h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
}

.reference-upload p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.reference-upload-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 98px;
  border: 1px dashed rgba(82, 107, 24, 0.42);
  border-radius: 24px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  padding: 16px;
  text-align: center;
}

.reference-upload-dropzone:hover,
.reference-upload-dropzone.is-dragging {
  border-color: var(--accent);
  background: #f6fadf;
}

.reference-upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reference-upload-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  padding: 9px 14px;
}

.reference-upload-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.reference-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.reference-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reference-clear-action {
  justify-self: start;
  min-height: 36px;
  padding: 8px 10px;
}

.reference-image-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  overflow: hidden;
}

.reference-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.reference-image-card span {
  display: block;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 7px;
}

.reference-image-remove:hover {
  background: var(--panel-strong);
  border-color: rgba(15, 118, 110, 0.38);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

fieldset {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
  padding: 14px;
}

.advanced-settings {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.advanced-settings summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style-position: outside;
}

.advanced-settings-body {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.billing-estimate {
  font-weight: 900;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.platform-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.platform-grid input {
  width: 16px;
  height: 16px;
}

.primary-action,
.ghost-action,
.tab-button,
.copy-section,
.download-link {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
}

.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rewrite-select {
  width: auto;
  min-width: 132px;
  min-height: 40px;
  padding: 8px 10px;
}

.primary-action {
  min-height: 48px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: none;
}

.primary-action:hover {
  background: #d9ed35;
}

.primary-action,
.ghost-action,
.tab-button,
.copy-section,
.download-link,
.reference-upload-dropzone,
.history-item {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.primary-action:active,
.ghost-action:active,
.tab-button:active,
.copy-section:active,
.download-link:active,
.history-item:active {
  transform: translateY(1px);
}

.ghost-action:hover,
.copy-section:hover,
.download-link:hover,
.history-item:hover {
  border-color: rgba(82, 107, 24, 0.3);
  background: #f6fadf;
}

.primary-action:focus-visible,
.ghost-action:focus-visible,
.tab-button:focus-visible,
.copy-section:focus-visible,
.download-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(230, 244, 82, 0.42);
  outline-offset: 2px;
}

.inline-action {
  min-height: 40px;
  padding: 9px 12px;
}

.ghost-action,
.copy-section,
.download-link {
  background: var(--accent-soft);
  border-color: var(--line);
  color: var(--ink);
  padding: 10px 12px;
}

.ghost-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.result-toolbar {
  display: grid;
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 26px;
  margin-bottom: 0;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  max-width: none;
}

.toolbar-actions .meta-pill,
.toolbar-actions .inline-action,
.toolbar-actions .ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  overflow: hidden;
  padding-inline: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

.empty-state {
  display: grid;
  place-content: center;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 36px;
}

.empty-state h3 {
  color: var(--accent-dark);
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 8px;
}

.results {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.analysis-review {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.analysis-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.analysis-actions p {
  margin-bottom: 0;
  line-height: 1.7;
}

.tabs {
  display: grid;
  align-content: start;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 8px;
  overflow: auto;
}

.tab-button {
  width: 100%;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
}

.tab-button[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: transparent;
  box-shadow: none;
}

.result-content {
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px;
}

.mobile-nav {
  display: none;
}

.mobile-app-header,
.mobile-overview {
  display: none;
}

.result-card {
  display: grid;
  gap: 14px;
}

.analysis-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  margin-bottom: 14px;
  padding: 18px;
}

.analysis-card p {
  color: var(--muted);
  line-height: 1.7;
}

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

.analysis-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  padding: 12px;
}

.analysis-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.analysis-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.analysis-edit {
  min-height: 88px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.section-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 0;
  color: var(--accent-dark);
}

.content-list {
  margin: 0;
  padding-left: 20px;
  color: #28231f;
  line-height: 1.75;
}

.copy-box {
  white-space: pre-wrap;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #f3f8f6;
  padding: 14px;
  line-height: 1.75;
}

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

.meta-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 700;
}

.asset-progress-badge {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-progress-badge[data-state="pending"] {
  background: #fff6e8;
  color: #9a3412;
}

.asset-progress-badge[data-state="generating"] {
  background: #eef2ff;
  color: #3730a3;
}

.asset-progress-badge[data-state="ready"] {
  background: #dcfce7;
  color: #166534;
}

.video-task,
.image-task {
  display: grid;
  gap: 14px;
}

.video-task-header,
.video-task-actions,
.image-task-header,
.image-task-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.status-idle {
  background: #fff6e8;
  color: #9a3412;
}

.status-generating {
  background: #eef2ff;
  color: #3730a3;
}

.status-succeeded {
  background: #dcfce7;
  color: #166534;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.muted,
.error-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.error-text {
  color: var(--rose);
  font-weight: 700;
}

.video-preview {
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #111;
}

.image-preview {
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  object-fit: cover;
}

.download-link {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
  width: fit-content;
}

@media (min-width: 981px) {
  .brief-form > label,
  .brief-form > .field-grid,
  .brief-form > .reference-upload,
  .brief-form > .reference-image-actions,
  .brief-form > .reference-image-preview,
  .brief-form > fieldset {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 22px 0;
  }

  .brief-form > .reference-image-actions,
  .brief-form > .reference-image-preview {
    margin-top: 0;
  }

  .brief-form > .primary-action {
    margin-top: 22px;
  }

  .platform-grid label {
    border-radius: 999px;
    background: var(--accent-soft);
    padding: 10px 14px;
  }

  .result-toolbar > div:first-child {
    min-width: 150px;
  }

  .brief-panel > .history-panel:last-of-type {
    margin-bottom: 18px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .workspace,
  .results {
    grid-template-columns: 1fr;
  }

  .brief-panel,
  .result-panel {
    position: static;
    display: block;
    max-height: none;
    min-height: auto;
  }

  .results {
    height: auto;
  }

  .analysis-review {
    height: auto;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px;
  }
}

@media (max-width: 760px) {
  body {
    background: #fbfcfa;
  }

  .app-shell {
    padding: 0 0 104px;
  }

  .workspace {
    display: block;
  }

  .brief-panel,
  .result-panel {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #fbfcfa;
    box-shadow: none;
    padding: 0 18px 18px;
  }

  .mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
    margin: 0 -18px 0;
    border-bottom: 1px solid rgba(216, 223, 220, 0.78);
    background: rgba(251, 252, 250, 0.96);
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    backdrop-filter: blur(14px);
  }

  .mobile-app-header span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
  }

  .mobile-icon-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: var(--ink);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
  }

  .mobile-overview {
    display: grid;
    gap: 8px;
    margin: 0 0 6px;
  }

  .mobile-overview-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 10px;
    border: 0;
    border-top: 1px solid rgba(216, 223, 220, 0.86);
    border-bottom: 1px solid rgba(216, 223, 220, 0.86);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 9px 0;
    text-align: left;
  }

  .mobile-overview-hero strong {
    color: var(--accent-dark);
    font-size: 16px;
    line-height: 1.2;
  }

  .mobile-overview-hero p {
    grid-column: 2;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-photo-badge {
    grid-row: 1 / span 2;
    justify-self: start;
    border-radius: 999px;
    background: var(--lime);
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    padding: 8px 10px;
  }

  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 2px 0 8px;
  }

  .mobile-quick-actions button {
    display: block;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-quick-actions span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    border-radius: 999px;
    background: #eef3eb;
    color: var(--accent-dark);
    box-shadow: none;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-quick-actions button:nth-child(2) span,
  .mobile-quick-actions button:nth-child(3) span {
    background: var(--lime);
    color: var(--ink);
  }

  .mobile-quick-actions button:nth-child(4) span {
    background: var(--accent-dark);
    color: #fff;
  }

  .primary-action.mobile-start-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0 0 10px;
  }

  .brand-block {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--ink);
    gap: 8px;
    margin: 0;
    padding: 14px 0 10px;
  }

  .brand-block h1 {
    color: var(--accent-dark);
    font-size: 40px;
    letter-spacing: 0;
    line-height: 0.94;
  }

  .brand-block > p:not(.eyebrow) {
    color: var(--muted);
    display: -webkit-box;
    margin: 0;
    max-width: 22rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 13px;
    line-height: 1.5;
  }

  .desktop-rail-steps,
  .desktop-rail-status {
    display: none;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    font-size: 36px;
    line-height: 1;
  }

  h2 {
    font-size: 22px;
  }

  textarea {
    min-height: 104px;
  }

  .brief-form {
    gap: 0;
    border-top: 1px solid rgba(216, 223, 220, 0.86);
  }

  .brief-form > label,
  .brief-form > .brief-presets,
  .brief-form > .field-grid,
  .brief-form > .reference-upload,
  .brief-form > .reference-image-actions,
  .brief-form > .reference-image-preview,
  .brief-form > .advanced-settings,
  .brief-form > fieldset {
    border: 0;
    border-bottom: 1px solid rgba(216, 223, 220, 0.86);
    border-radius: 0;
    background: transparent;
    padding: 15px 0;
  }

  .brief-presets {
    gap: 10px;
  }

  .brief-presets h2 {
    font-size: 15px;
  }

  .brief-preset-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .brief-preset-actions button {
    width: 100%;
    min-height: 34px;
    padding: 7px 6px;
  }

  .brief-form > .reference-image-actions,
  .brief-form > .reference-image-preview {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .advanced-settings {
    margin: 0;
  }

  .advanced-settings-body {
    gap: 12px;
  }

  label,
  legend {
    gap: 6px;
    font-size: 13px;
  }

  input,
  select,
  textarea {
    border-color: rgba(216, 223, 220, 0.92);
    border-radius: 10px;
    background: #fff;
    padding: 10px 11px;
  }

  .reference-upload-dropzone {
    min-height: 72px;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
  }

  .reference-upload p,
  .reference-upload-hint {
    font-size: 11px;
    line-height: 1.45;
  }

  .reference-upload-action {
    min-height: 34px;
    padding: 7px 12px;
  }

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

  .brief-form > .primary-action {
    width: 100%;
    margin-top: 16px;
  }

  .history-panel {
    margin-top: 14px;
    padding-top: 14px;
  }

  .result-toolbar {
    gap: 14px;
    padding-bottom: 14px;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
  }

  .toolbar-actions .meta-pill,
  .toolbar-actions .inline-action,
  .toolbar-actions .ghost-action {
    width: 100%;
    min-height: 40px;
    text-align: center;
  }

  .toolbar-actions .meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }

  .toolbar-actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .empty-state {
    min-height: 340px;
    padding: 24px 10px;
  }

  .results {
    gap: 14px;
    padding-top: 14px;
  }

  .tabs {
    display: flex;
    gap: 8px;
    margin-inline: -16px;
    overflow-x: auto;
    padding: 0 16px 12px;
    scroll-snap-type: x proximity;
  }

  .tab-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 92px;
    text-align: center;
    scroll-snap-align: start;
  }

  .analysis-card,
  .section-block {
    padding: 14px;
  }

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

  .content-list {
    padding-left: 18px;
  }

  .copy-box {
    padding: 12px;
  }

  body[data-mobile-view="generate"] .result-panel,
  body[data-mobile-view="results"] .brief-panel,
  body[data-mobile-view="account"] .result-panel {
    display: none;
  }

  body[data-mobile-view="generate"] .history-panel,
  body[data-mobile-view="results"] .mobile-overview,
  body[data-mobile-view="account"] .brand-block,
  body[data-mobile-view="account"] .mobile-overview,
  body[data-mobile-view="account"] .brief-form {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 18px;
    bottom: 12px;
    left: 18px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 1px solid rgba(216, 223, 220, 0.9);
    border-radius: 999px;
    background: rgba(251, 252, 250, 0.96);
    box-shadow: 0 8px 22px rgba(16, 39, 34, 0.12);
    padding: 5px;
    backdrop-filter: blur(14px);
  }

  .mobile-nav button {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
  }

  .mobile-nav button[aria-current="true"] {
    background: var(--lime);
    color: var(--ink);
  }

  .legal-links {
    margin-bottom: 76px;
  }
}

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

@media (max-width: 560px) {
  .field-grid,
  .platform-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 104px;
  }

  input,
  select,
  textarea {
    padding: 10px 11px;
  }

  .reference-upload-dropzone {
    min-height: 78px;
    padding: 10px;
  }

  .result-toolbar,
  .analysis-actions,
  .section-heading,
  .video-task-actions,
  .image-task-actions,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rewrite-select {
    width: 100%;
  }

  .toolbar-actions {
    align-items: stretch;
  }

  .download-link,
  .inline-action,
  .asset-progress-badge {
    width: 100%;
    max-width: none;
  }
}
