:root {
  color-scheme: light;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #f6f7fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f0f2f7;
  --surface-strong: #e7eaf1;
  --foreground: #151821;
  --text-secondary: #666c7a;
  --text-tertiary: #8b91a0;
  --border: #e2e5ec;
  --border-strong: #d5d9e3;
  --primary: #181a22;
  --primary-hover: #2b2e39;
  --focus: #2563eb;
  --user: #137c60;
  --user-soft: #e8f6f1;
  --user-border: #b9e4d5;
  --data: #b23a51;
  --data-soft: #fcecf0;
  --data-border: #f2bdc8;
  --ai: #7133c6;
  --ai-soft: #f2ebfc;
  --ai-border: #dac4f4;
  --warning: #a66113;
  --warning-soft: #fff5e5;
  --shadow-sm: 0 1px 2px rgba(20, 24, 33, 0.04);
  --shadow-md: 0 12px 32px rgba(24, 26, 34, 0.07);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --motion-fast: 160ms;
  --motion-base: 240ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #111319;
  --surface: #181b23;
  --surface-raised: #1d2029;
  --surface-soft: #222630;
  --surface-strong: #2a2f3a;
  --foreground: #f4f5f7;
  --text-secondary: #b2b7c3;
  --text-tertiary: #858c9b;
  --border: #2b303b;
  --border-strong: #3a404c;
  --primary: #f4f5f7;
  --primary-hover: #ffffff;
  --focus: #7da6ff;
  --user: #55c7a5;
  --user-soft: #17372f;
  --user-border: #245d4d;
  --data: #f1849a;
  --data-soft: #43232d;
  --data-border: #713747;
  --ai: #b993f1;
  --ai-soft: #302347;
  --ai-border: #523a77;
  --warning: #f2b65e;
  --warning-soft: #3d2d18;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.24);
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
[role="button"] {
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.25;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--primary);
  color: var(--surface);
  padding: 10px 14px;
  text-decoration: none;
  transition: transform var(--motion-fast) ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 240px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 18px;
}

.brand {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  color: var(--foreground);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--primary);
  color: var(--surface);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--text-tertiary);
  font-size: 0.69rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 38px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 13px;
  font-size: 0.89rem;
  font-weight: 500;
  text-align: left;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--foreground);
}

.nav-item.is-active {
  background: var(--foreground);
  color: var(--surface);
}

.nav-item svg,
.topbar svg,
.button svg,
.role-label svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-status {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 15px;
}

.status-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 650;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 14%, transparent);
}

.sidebar-status p {
  margin: 9px 0 12px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.55;
}

.status-chip,
.format-badge,
.step-count,
.readiness-score {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 4px 9px;
  font-size: 0.67rem;
  font-weight: 600;
}

.main {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: 240px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  padding: 16px clamp(22px, 4vw, 58px);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.save-state svg {
  width: 16px;
  color: var(--user);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
}

.moon-icon,
[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.view {
  display: none;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 44px clamp(22px, 4vw, 58px) 70px;
  animation: view-in var(--motion-base) ease-out;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-row,
.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.intro-row > div:first-child,
.view-heading > div:first-child {
  max-width: 720px;
}

.intro-row p,
.view-heading p {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
}

.legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-user i { background: var(--user); }
.legend-data i { background: var(--data); }
.legend-ai i { background: var(--ai); }

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 36px 0 20px;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
}

.stepper li:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 18px;
  right: -50%;
  left: 50%;
  height: 1px;
  background: var(--border-strong);
  content: "";
}

.stepper li.is-complete:not(:last-child)::after {
  background: var(--foreground);
}

.stepper button {
  display: grid;
  width: 100%;
  min-height: 76px;
  justify-items: center;
  border: 0;
  background: transparent;
  padding: 0 8px;
  text-align: center;
}

.stepper button > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  font-weight: 650;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.stepper button strong,
.stepper button small {
  display: block;
}

.stepper button strong {
  margin-top: 8px;
  font-size: 0.74rem;
}

.stepper button small {
  margin-top: 1px;
  color: var(--text-tertiary);
  font-size: 0.62rem;
}

.stepper button[aria-current="step"] > span,
.stepper li.is-complete button > span {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--surface);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-panel {
  min-height: 648px;
  padding: clamp(22px, 3vw, 34px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.panel-heading:has(#form-description[hidden]) {
  margin-bottom: 16px;
}

.panel-heading:has(#form-description[hidden]) h3 {
  margin-bottom: 0;
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 18px;
}

.panel-heading p {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.role-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-label svg {
  width: 14px;
  height: 14px;
}

.role-user { background: var(--user-soft); color: var(--user); }
.role-data { background: var(--data-soft); color: var(--data); }
.role-ai { background: var(--ai-soft); color: var(--ai); }

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

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

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

.field-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.field-section-heading .field-helper {
  max-width: 520px;
  margin-top: 4px;
}

.sequence-badge {
  flex: 0 0 auto;
  border: 1px solid var(--user-border);
  border-radius: 999px;
  background: var(--user-soft);
  color: var(--user);
  padding: 5px 9px;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.text-layer-list {
  display: grid;
  gap: 10px;
}

.text-layer-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, opacity var(--motion-fast) ease;
}

.text-layer-card:focus-within {
  border-color: color-mix(in srgb, var(--user) 62%, var(--border));
  background: var(--surface);
}

.text-layer-card.is-dragging {
  opacity: 0.48;
}

.text-layer-card.drop-before::before,
.text-layer-card.drop-after::after {
  position: absolute;
  right: 10px;
  left: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--user);
  content: "";
}

.text-layer-card.drop-before::before { top: -7px; }
.text-layer-card.drop-after::after { bottom: -7px; }

.drag-handle,
.text-layer-controls button,
.keyword-remove {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active { cursor: grabbing; }

.drag-handle svg,
.text-layer-controls svg,
.keyword-remove svg,
.keyword-add svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drag-handle svg {
  fill: currentColor;
  stroke: none;
}

.text-layer-content {
  min-width: 0;
}

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

.text-layer-heading > span {
  color: var(--text-tertiary);
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.text-layer-card input {
  min-height: 44px;
}

.text-layer-controls {
  display: grid;
  gap: 6px;
}

.text-layer-controls button {
  min-height: 44px;
  height: 44px;
}

.text-layer-controls button:disabled {
  border-color: transparent;
  background: transparent;
}

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

.field-label,
fieldset legend {
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 650;
}

.field-label .optional {
  color: var(--text-tertiary);
  font-weight: 500;
}

.field-helper {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--foreground);
  padding: 12px 14px;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: color-mix(in srgb, var(--foreground) 28%, var(--border));
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 12%, transparent);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

fieldset {
  margin: 0 0 24px;
  border: 0;
  padding: 0;
}

fieldset legend {
  margin-bottom: 10px;
}

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

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

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

.choice-card {
  position: relative;
  display: flex;
  min-height: 90px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 13px;
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.choice-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.choice-card:has(input:checked) {
  border-color: var(--user);
  background: var(--user-soft);
}

.choice-card input {
  width: 17px;
  min-height: 17px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--user);
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  font-size: 0.77rem;
}

.choice-card small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.67rem;
  line-height: 1.45;
}

.segment-control {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: min(320px, 100%);
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 4px;
}

.segment-control label {
  position: relative;
}

.segment-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.segment-control span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 600;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.segment-control input:checked + span {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.segment-control input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

.conditional-panel,
.system-card,
.review-card,
.data-save-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 18px;
}

.conditional-panel {
  margin-top: 10px;
}

.system-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.system-card .system-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--ai-soft);
  color: var(--ai);
}

.system-card svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-card strong,
.system-card span {
  display: block;
}

.system-card strong {
  font-size: 0.79rem;
}

.system-card span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.5;
}

.data-save-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  border-color: var(--data-border);
  background: var(--data-soft);
  color: var(--data);
  font-size: 0.71rem;
  font-weight: 600;
}

.upload-box {
  display: grid;
  min-height: 126px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 18px;
  text-align: center;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.upload-box svg {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  stroke: var(--text-secondary);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-box strong,
.upload-box span {
  display: block;
}

.upload-box strong {
  font-size: 0.76rem;
}

.upload-box span {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 0.67rem;
}

.upload-box:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.asset-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--data-border);
  border-radius: 10px;
  background: var(--data-soft);
  padding: 6px 8px 6px 10px;
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 600;
}

.asset-chip > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--data);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--data) 14%, transparent);
}

.asset-chip button {
  display: grid;
  width: 27px;
  min-height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
}

.asset-chip button:hover {
  background: color-mix(in srgb, var(--data) 12%, transparent);
  color: var(--data);
}

.asset-chip button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 1px;
}

.keyword-editor,
.keyword-list {
  display: grid;
  gap: 8px;
}

.keyword-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.keyword-number {
  color: var(--text-tertiary);
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.keyword-row input {
  min-height: 44px;
}

.keyword-remove {
  border-color: var(--border);
  color: var(--text-tertiary);
}

.keyword-remove:hover {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  color: var(--warning);
}

.keyword-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.keyword-count {
  color: var(--text-tertiary);
  font-size: 0.65rem;
}

.keyword-add {
  min-height: 44px;
  padding: 8px 12px;
}

.form-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 550;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.button:not(:disabled):active {
  transform: scale(0.98);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  background: var(--primary);
  color: var(--surface);
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.preview-column {
  display: grid;
  gap: 18px;
}

.preview-panel,
.readiness-panel {
  padding: 22px;
}

.banner-preview {
  position: relative;
  display: flex;
  aspect-ratio: 1200 / 628;
  min-height: 0;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(135deg, #252a38, #11131a 65%);
  color: #ffffff;
  padding: clamp(12px, 2.4vw, 28px);
  isolation: isolate;
}

.preview-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.12;
  background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000);
}

.preview-copy {
  max-width: 52%;
}

.preview-copy > span,
.preview-text {
  display: block;
}

.preview-copy > span {
  margin-bottom: 7px;
  color: rgba(255,255,255,.62);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-text-stack {
  display: grid;
  gap: clamp(3px, 0.5vw, 7px);
}

.preview-text {
  overflow-wrap: anywhere;
  line-height: 1.08;
}

.preview-text-general {
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.preview-text-secondary {
  font-size: clamp(0.82rem, 1.5vw, 1.15rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.preview-text-tertiary {
  font-size: clamp(0.58rem, 0.9vw, 0.72rem);
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.preview-text.is-placeholder {
  color: rgba(255,255,255,.34);
}

.preview-copy i {
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 13px;
  border-radius: 99px;
  background: #ffffff;
  opacity: 0.72;
}

.banner-preview[data-format="2800x800"] .preview-copy > span {
  margin-bottom: 4px;
}

.banner-preview[data-format="2800x800"] .preview-text-general {
  font-size: clamp(1rem, 2vw, 1.6rem);
}

.banner-preview[data-format="2800x800"] .preview-text-secondary {
  font-size: clamp(0.72rem, 1.2vw, 0.95rem);
}

.banner-preview[data-format="2800x800"] .preview-copy i {
  margin-top: 8px;
}

.preview-subject {
  display: grid;
  width: 39%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  text-align: center;
}

.preview-subject svg {
  width: 44%;
  stroke: rgba(255,255,255,.45);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-subject span {
  margin-top: -26%;
  color: rgba(255,255,255,.55);
  font-size: 0.62rem;
  font-weight: 600;
}

.banner-preview[data-align="right"] {
  flex-direction: row-reverse;
}

.banner-preview[data-align="right"] .preview-copy {
  text-align: right;
}

.banner-preview[data-align="right"] .preview-copy i {
  margin-left: auto;
}

.banner-preview[data-align="center"] {
  justify-content: center;
  text-align: center;
}

.banner-preview[data-align="center"] .preview-copy {
  position: absolute;
  z-index: 2;
  right: 15%;
  bottom: 13%;
  left: 15%;
  max-width: none;
}

.banner-preview[data-align="center"] .preview-copy i {
  margin-right: auto;
  margin-left: auto;
}

.banner-preview[data-align="center"] .preview-subject {
  width: 34%;
  transform: translateY(-18%);
}

.preview-watermark {
  position: absolute;
  right: 12px;
  bottom: 9px;
  color: rgba(255,255,255,.34);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.preview-meta div {
  min-width: 0;
}

.preview-meta span,
.preview-meta strong {
  display: block;
}

.preview-meta span {
  color: var(--text-tertiary);
  font-size: 0.62rem;
}

.preview-meta strong {
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-score {
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-track i {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--foreground);
  transition: width var(--motion-base) ease-out;
}

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

.checklist li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-tertiary);
  font-size: 0.69rem;
}

.checklist li span {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}

.checklist li.is-complete {
  color: var(--foreground);
}

.checklist li.is-complete span {
  position: relative;
  border-color: var(--user);
  background: var(--user);
}

.checklist li.is-complete span::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 4px;
  height: 7px;
  transform: rotate(45deg);
  border-right: 1.5px solid white;
  border-bottom: 1.5px solid white;
  content: "";
}

.view-heading {
  margin-bottom: 28px;
}

.data-notice {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  border: 1px solid var(--data-border);
  border-radius: var(--radius-md);
  background: var(--data-soft);
  padding: 16px 18px;
}

.data-notice .role-label {
  flex: 0 0 auto;
  margin: 0;
  background: var(--surface);
}

.data-notice strong,
.data-notice p {
  display: block;
}

.data-notice strong {
  font-size: 0.77rem;
}

.data-notice p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

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

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-thumb {
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  background: linear-gradient(135deg, #252a38, #11131a);
  color: rgba(255,255,255,.48);
}

.project-thumb svg {
  width: 46px;
  stroke: currentColor;
  stroke-width: 1.4;
}

.project-body {
  padding: 16px;
}

.project-body h3 {
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.project-body p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 0.62rem;
}

.empty-project {
  grid-column: 1 / -1;
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px;
  text-align: center;
}

.empty-project svg {
  width: 42px;
  stroke: var(--text-tertiary);
  stroke-width: 1.5;
}

.empty-project h3 {
  margin: 12px 0 4px;
}

.empty-project p {
  max-width: 340px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.workflow-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.workflow-summary article {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 17px;
}

.workflow-summary span,
.workflow-summary strong,
.workflow-summary p {
  display: block;
}

.workflow-summary span {
  margin-bottom: 16px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.workflow-summary strong {
  font-size: 0.75rem;
}

.workflow-summary p {
  margin: 2px 0 0;
  color: var(--text-tertiary);
  font-size: 0.65rem;
}

.workflow-lanes {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.workflow-stage {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  padding: clamp(22px, 4vw, 38px);
}

.workflow-stage:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.stage-number {
  color: var(--text-tertiary);
  font-size: 0.73rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.stage-content > p {
  max-width: 850px;
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.stage-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.65rem;
  font-weight: 600;
}

.node-user { border-color: var(--user-border); background: var(--user-soft); color: var(--user); }
.node-data { border-color: var(--data-border); background: var(--data-soft); color: var(--data); }
.node-ai { border-color: var(--ai-border); background: var(--ai-soft); color: var(--ai); }

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

.branch-grid article {
  border: 1px solid var(--user-border);
  border-radius: 13px;
  background: var(--user-soft);
  padding: 14px;
}

.branch-grid strong {
  color: var(--user);
  font-size: 0.76rem;
}

.branch-grid p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.66rem;
}

.offline-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  background: var(--ai-soft);
  padding: 12px;
}

.offline-callout strong {
  color: var(--ai);
  font-size: 0.68rem;
}

.offline-callout span {
  color: var(--text-secondary);
  font-size: 0.66rem;
}

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

.review-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  padding: 15px;
}

.review-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--surface-strong), transparent);
  content: "";
}

.review-card > * {
  position: relative;
}

.review-card strong,
.review-card span {
  display: block;
}

.review-card strong {
  margin-top: 68px;
  font-size: 0.75rem;
}

.review-card span {
  color: var(--text-tertiary);
  font-size: 0.64rem;
}

.offline-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  background: var(--ai-soft);
  color: var(--ai);
  padding: 4px 7px;
  font-size: 0.59rem;
  font-weight: 700;
}

.online-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  border: 1px solid var(--ai-border);
  border-radius: 999px;
  background: var(--ai-soft);
  color: var(--ai);
  padding: 4px 7px;
  font-size: 0.59rem;
  font-weight: 700;
}

.online-badge.user-badge {
  border-color: var(--user-border);
  background: var(--user-soft);
  color: var(--user);
}

.ai-status-card {
  align-items: start;
  border-color: var(--ai-border);
  background: linear-gradient(135deg, var(--ai-soft), var(--surface-soft));
}

.ai-status-card.is-complete {
  border-color: var(--user-border);
  background: linear-gradient(135deg, var(--user-soft), var(--surface-soft));
}

.ai-status-card.is-complete .system-icon {
  background: var(--user-soft);
  color: var(--user);
}

.ai-status-card.has-error {
  border-color: var(--data-border);
  background: linear-gradient(135deg, var(--data-soft), var(--surface-soft));
}

.ai-status-card.has-error .system-icon {
  background: var(--data-soft);
  color: var(--data);
}

.ai-progress {
  height: 6px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ai) 14%, transparent);
}

.ai-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: inherit;
  background: var(--ai);
  transition: transform 300ms ease;
}

.ai-status-card.is-complete .ai-progress i {
  background: var(--user);
}

.approval-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.approval-timeline li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 10px;
}

.approval-timeline li > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 750;
}

.approval-timeline strong,
.approval-timeline small {
  display: block;
}

.approval-timeline strong {
  font-size: 0.68rem;
}

.approval-timeline small {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 0.59rem;
}

.approval-timeline li.is-current {
  border-color: var(--user-border);
  background: var(--user-soft);
}

.approval-timeline li.is-current > span {
  border-color: var(--user);
  background: var(--user);
  color: #fff;
}

.approval-timeline li.is-complete {
  border-color: var(--user-border);
}

.approval-timeline li.is-complete > span {
  border-color: var(--user-border);
  background: var(--user-soft);
  color: var(--user);
}

.approval-stage {
  margin-top: 16px;
  border: 1px solid var(--user-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--user-soft), var(--surface-soft) 42%);
  padding: 16px;
}

.approval-stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.approval-stage-heading h4 {
  margin: 5px 0 4px;
  font-size: 0.86rem;
}

.approval-stage-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.66rem;
  line-height: 1.55;
}

.approval-stage-heading .role-label {
  flex: 0 0 auto;
  margin: 0;
}

.stage-number {
  color: var(--user);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.candidate-approval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.approval-image-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.approval-stage > .approval-image-card {
  margin-top: 14px;
}

.subject-image-shell {
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.subject-image-shell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.approval-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding: 12px;
}

.approval-image-actions strong,
.approval-image-actions span {
  display: block;
}

.approval-image-actions strong {
  font-size: 0.7rem;
}

.approval-image-actions span {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 0.6rem;
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.button-ghost:hover {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--foreground);
}

.ai-evidence {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 15px;
}

.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.palette-swatch {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 9px 4px 5px;
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 600;
}

.palette-swatch i {
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--foreground) 16%, transparent);
  border-radius: 50%;
  background: var(--swatch);
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.source-list a {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  padding: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.source-list a:hover {
  transform: translateY(-1px);
  border-color: var(--ai-border);
}

.source-list strong,
.source-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-list strong {
  font-size: 0.68rem;
}

.source-list span {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 0.6rem;
}

.generated-result {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.generated-result-heading,
.generated-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
}

.generated-result-heading strong,
.generated-result-heading span {
  display: block;
}

.generated-result-heading strong {
  margin-top: 6px;
  font-size: 0.78rem;
}

.generated-result-heading > span,
.generated-result-actions > span {
  color: var(--text-tertiary);
  font-size: 0.64rem;
}

.generated-image-shell {
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background: #0d0f14;
}

.generated-image-shell img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}

.generated-result-actions {
  border-top: 1px solid var(--border);
}

.final-result {
  margin-top: 18px;
}

.cost-note {
  margin: 10px 0 0;
  color: var(--text-tertiary);
  font-size: 0.64rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .source-list {
    grid-template-columns: 1fr;
  }

  .generated-result-heading,
  .generated-result-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .generated-result-actions .button {
    width: 100%;
  }

  .approval-timeline,
  .candidate-approval-grid {
    grid-template-columns: 1fr;
  }

  .approval-stage-heading,
  .approval-image-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-stage-heading .role-label {
    align-self: flex-start;
  }

  .approval-image-actions .button,
  .approval-row .button {
    width: 100%;
  }
}

.approval-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.approval-row .button {
  min-height: 44px;
  padding: 8px 12px;
}

.composition-summary {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 11px 0;
  font-size: 0.72rem;
}

.summary-row span {
  color: var(--text-secondary);
}

.summary-row strong {
  max-width: 55%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--foreground);
  color: var(--surface);
  padding: 12px 15px;
  box-shadow: var(--shadow-md);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-column {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  }

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

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding-bottom: 72px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    padding: 5px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    min-height: 46px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
  }

  .mobile-nav button.is-active {
    background: var(--foreground);
    color: var(--surface);
  }

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

@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  .main {
    padding-bottom: 24px;
  }

  .mobile-nav {
    position: static;
    right: auto;
    bottom: 0;
    left: auto;
    margin: 0 12px 12px;
  }
}

@media (max-width: 680px) {
  .topbar {
    min-height: 72px;
    padding: 12px 18px;
  }

  .save-state {
    display: none;
  }

  .view {
    padding: 28px 16px 54px;
  }

  .intro-row,
  .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .responsibility-legend {
    justify-content: flex-start;
  }

  .stepper {
    margin-top: 28px;
  }

  .stepper button {
    min-height: 52px;
    padding: 0 2px;
  }

  .stepper button > span {
    width: 32px;
    height: 32px;
  }

  .stepper button strong,
  .stepper button small {
    display: none;
  }

  .stepper li:not(:last-child)::after {
    top: 15px;
  }

  .form-panel,
  .preview-panel,
  .readiness-panel {
    padding: 20px;
  }

  .form-panel {
    min-height: 0;
  }

  .panel-heading {
    margin-bottom: 24px;
  }

  .field-row,
  .choice-grid,
  .choice-grid.two-column,
  .preview-column,
  .project-grid,
  .branch-grid,
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .choice-card {
    min-height: 72px;
  }

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

  .field-section-heading,
  .keyword-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .keyword-add {
    width: 100%;
  }

  .banner-preview[data-format="2800x800"] .preview-copy > span,
  .banner-preview[data-format="2800x800"] .preview-copy i,
  .banner-preview[data-format="2800x800"] .preview-subject span {
    display: none;
  }

  .data-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .workflow-stage {
    grid-template-columns: 1fr;
  }

  .workflow-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .offline-callout {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .topbar-actions {
    gap: 6px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

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

  .text-layer-card {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 10px;
  }

  .text-layer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

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