:root {
  /* surface — warm cream */
  --canvas: #f4eee3;
  --panel: #fbf7f0;
  --panel-elevated: #ffffff;
  --panel-soft: #ede5d6;
  --sand: #e8d9c4;

  /* ink */
  --ink: #1a1613;
  --body: #3a352e;
  --muted: #6e675c;
  --faint: #938b7d;
  --ink-panel: #1c1815;
  --ink-panel-2: #2a241f;
  --on-ink: #f4eee3;

  /* coral — single accent */
  --coral: #d97757;
  --coral-deep: #bd5d3a;
  --coral-soft: rgba(217, 119, 87, 0.12);
  --coral-ring: rgba(217, 119, 87, 0.32);
  --coral-dot: #e0703a;

  /* line */
  --line: #e6decf;
  --line-strong: #d6ccb8;

  /* semantic (절제) */
  --success: #6e7b53;
  --error: #b5503c;

  /* elevation */
  --shadow-soft: 0 8px 24px rgba(40, 34, 24, 0.06);
  --shadow-raised: 0 18px 48px rgba(40, 34, 24, 0.08);

  /* radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* fonts */
  --font-serif: "Fraunces", "Noto Serif KR", Georgia, serif;
  --font-sans: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--body);
  background: var(--canvas);
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: fixed;
  left: 18px;
  top: 12px;
  z-index: 30;
  transform: translateY(-140%);
  background: var(--ink-panel);
  color: var(--on-ink);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 180ms ease;
}

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

.app-shell {
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  min-height: calc(100dvh - 48px);
  max-width: 1640px;
  margin: 0 auto;
}

.brief-panel,
.proposal-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-raised);
}

.brief-panel {
  position: relative;
  min-height: 0;
  overflow: visible;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(280px, 0.32fr) minmax(0, 1fr);
  /* 입력 방식 탭은 모든 폭에서 폼 위 — 탭·URL 칸은 margin-bottom 으로 띄우므로 행 간격은 0 */
  grid-template-areas:
    "intro tabs"
    "intro url"
    "intro form";
  grid-template-rows: auto auto 1fr;
  gap: 0 28px;
  align-items: start;
}

.brief-panel > .input-mode-toggle { grid-area: tabs; }
.brief-panel > .url-panel { grid-area: url; }

.proposal-panel {
  padding: 28px;
  overflow: hidden;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1640px;
  margin: 0 auto 24px;
  padding: 14px 18px 14px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.nav-brand {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
}

.nav-brand h1 {
  font-size: 20px;
}

.nav-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  background: var(--coral);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.nav-login:hover {
  transform: translateY(-1px);
  background: var(--coral-deep);
  box-shadow: 0 10px 22px rgba(189, 93, 58, 0.22);
}

.nav-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--body);
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.nav-pay:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--panel-elevated);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

.user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex: 0 0 auto;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-provider {
  color: var(--muted);
  font-weight: 500;
  flex: 0 0 auto;
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--body);
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.nav-logout:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.auth-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--coral);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.auth-toast[hidden] {
  display: none;
}

.auth-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.brand-home {
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
}

.brand-logo {
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
  object-fit: contain;
  display: inline-block;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: keep-all;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  max-width: 820px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--ink);
  word-break: keep-all;
  text-wrap: balance;
}

h3 {
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: keep-all;
  text-wrap: balance;
}

.brief-intro {
  grid-area: intro;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
}

.brief-intro strong {
  display: block;
  max-width: 22rem;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: keep-all;
  text-wrap: balance;
}

.brief-intro p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

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

.brief-intro dl div {
  min-width: 0;
  border-top: 2px solid var(--coral-soft);
  padding-top: 12px;
}

.brief-intro dt {
  font-family: var(--font-serif);
  color: var(--coral);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.brief-intro dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.brief-form {
  grid-area: form;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  padding-top: 0;
  align-items: end;
}

.brief-form > label:nth-of-type(1),
.brief-form > label:nth-of-type(2),
.brief-form > label:nth-of-type(4),
.brief-form > label:nth-of-type(5),
.brief-form > label:nth-of-type(7),
.brief-form > .field-row,
.brief-form > .primary-action {
  grid-column: span 6;
}

.brief-form > label:nth-of-type(3),
.brief-form > label:nth-of-type(6) {
  grid-column: span 12;
}

label {
  display: grid;
  gap: 7px;
  color: var(--body);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.5;
  min-height: 96px;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 4px var(--coral-ring);
}

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

.primary-action {
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  background: var(--coral);
  color: #fff;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  min-height: 48px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  background: var(--coral-deep);
  border-color: var(--coral-deep);
  box-shadow: 0 10px 22px rgba(189, 93, 58, 0.22);
}

.compact-action {
  width: auto;
  min-width: 160px;
}

.primary-action:active,
.toolbar-actions button:active,
.gemini-launcher button:active,
.image-actions button:active,
.mini-action:active {
  transform: translateY(0) scale(0.99);
}

.proposal-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

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

.toolbar-actions button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--body);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.toolbar-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.proposal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding-top: 22px;
  align-items: start;
}

.hero-board,
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-board {
  grid-column: span 7;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(220px, 1fr);
  gap: 24px;
  padding: clamp(26px, 4vw, 48px);
  align-items: stretch;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, var(--panel-elevated), var(--panel) 60%, var(--panel-soft));
}

.hero-board > div:first-child {
  position: relative;
  z-index: 1;
}

.hero-board h3 {
  max-width: 760px;
  font-family: var(--font-serif);
  font-size: clamp(44px, 6.4vw, 92px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: keep-all;
}

.hero-board p:last-child {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  text-wrap: pretty;
}

.motion-strip {
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.85fr;
  gap: 14px;
  min-height: 240px;
  position: relative;
  z-index: 1;
}

.motion-strip span {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.motion-strip span:nth-child(1) {
  margin-top: 40px;
  background: var(--sand);
}

.motion-strip span:nth-child(2) {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(155deg, var(--coral), var(--coral-deep));
  border-color: var(--coral-deep);
  box-shadow: 0 18px 36px rgba(189, 93, 58, 0.2);
}

.motion-strip span:nth-child(3) {
  margin-top: 84px;
  background: var(--ink-panel);
  border-color: var(--ink-panel-2);
}

.card {
  padding: 24px;
}

.stack-card {
  grid-column: span 6;
}

/* 새 작업 순서: 2 무드보드 · 3 이미지프롬프트 · 4 기준이미지(STEP1 핵심) · 5 Gemini(STEP2 핵심) · 6 영상워크플로우 · 7 컷리스트 · 8 카피 · 9 영상 */
.proposal-grid > section:nth-child(2) {
  grid-column: span 5;
}

.proposal-grid > section:nth-child(3) {
  grid-column: span 7;
}

.proposal-grid > section:nth-child(4),
.proposal-grid > section:nth-child(5) {
  grid-column: 1 / -1;
}

.proposal-grid > section:nth-child(6),
.proposal-grid > section:nth-child(7),
.proposal-grid > section:nth-child(8),
.proposal-grid > section:nth-child(9) {
  grid-column: span 6;
}

.proposal-grid > .document-card {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 12px;
}

.mood-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.omni-module {
  display: grid;
  gap: 14px;
}

.gemini-launcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gemini-launcher button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--ink);
  padding: 10px 13px;
  cursor: pointer;
  min-height: 43px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.gemini-launcher button:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
  transform: translateY(-1px);
}

.api-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  margin-bottom: 12px;
  padding: 14px 16px;
}

.experimental-panel {
  margin-bottom: 0;
}

.api-panel summary {
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
}

.api-panel summary span {
  display: inline-block;
  margin-right: 8px;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.api-status {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--muted);
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  min-width: 0;
  /* 한글은 어절 단위로만 줄바꿈, 공백 없는 긴 주소만 어디서든 끊는다 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.overlay-note {
  margin-top: 6px;
  font-size: 13px;
}

/* 결과/편집·확장 패널이 그리드 1칸에 갇혀 세로로 붕괴하지 않도록 전체 폭 스팬 */
.brief-form > #apiStatus { grid-column: 1 / -1; }
.brief-form > #trialCta { grid-column: 1 / -1; justify-self: center; font-weight: 600; }
.brief-form > #trialCta[hidden] { display: none; }
.brief-form > .advanced-fields { grid-column: 1 / -1; }
#editStudio { grid-column: 1 / -1; }
#editStudio .api-status,
#editStudio input,
#editStudio textarea,
#editStudio button { max-width: 100%; box-sizing: border-box; }

.api-status.success {
  border-color: var(--success);
  color: #4c5738;
  background: rgba(110, 123, 83, 0.08);
}

.api-status.error {
  border-color: var(--error);
  color: var(--error);
  background: rgba(181, 80, 60, 0.07);
}

.generated-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.image-controls {
  display: grid;
  gap: 12px;
}

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

.image-actions button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--ink);
  padding: 10px 13px;
  cursor: pointer;
  min-height: 43px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.image-actions button:first-child {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.image-actions button:first-child:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
}

.image-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.image-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.generated-image-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  overflow: hidden;
}

.generated-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--panel-soft);
  cursor: zoom-in;
}

.generated-image-card div {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.generated-image-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}

.omni-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--ink-panel-2);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 86% 14%, rgba(217, 119, 87, 0.34), transparent 22rem),
    linear-gradient(135deg, var(--ink-panel), var(--ink-panel-2));
  color: var(--on-ink);
  padding: 20px;
}

.omni-hero h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.05;
}

.omni-hero p:last-child {
  margin: 0;
  max-width: 720px;
  color: rgba(244, 238, 227, 0.74);
  line-height: 1.5;
}

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

.omni-grid article,
.revision-prompts {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  padding: 14px;
}

.omni-grid h5,
.revision-prompts h5 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ink);
}

.omni-grid ul {
  margin: 0;
  padding-left: 20px;
}

.omni-grid li {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.master-prompt {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral-soft);
}

.revision-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.revision-prompts h5 {
  flex-basis: 100%;
}

.mood-card {
  min-height: 220px;
  display: grid;
  align-content: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--on-ink);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.mood-card:nth-child(1) {
  background: linear-gradient(165deg, var(--coral), var(--coral-deep));
  border-color: var(--coral-deep);
}

.mood-card:nth-child(2) {
  background: linear-gradient(165deg, var(--ink-panel-2), var(--ink-panel));
  border-color: var(--ink-panel-2);
}

.mood-card:nth-child(3) {
  background: linear-gradient(165deg, #8a7a5f, #5f5037);
  border-color: #5f5037;
}

.mood-card:nth-child(4) {
  background: linear-gradient(165deg, #7a8a5f, #515f3a);
  border-color: #515f3a;
}

.mood-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.46), transparent 60%);
}

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

.mood-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.mood-card p {
  margin: 0;
  line-height: 1.5;
  color: rgba(244, 238, 227, 0.86);
}

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

.prompt-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  padding: 16px;
}

.prompt-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.prompt-item h4 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}

.mini-action {
  flex: 0 0 auto;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--body);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.mini-action:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.helper-copy {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workflow-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-elevated);
  margin-bottom: 12px;
  padding: 14px 16px;
}

.workflow-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.workflow-note ol {
  margin: 0;
  padding-left: 20px;
}

.workflow-note li,
.workflow-note p {
  color: var(--muted);
  line-height: 1.5;
}

.workflow-note p {
  margin: 8px 0 0;
}

.gemini-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.gemini-steps li {
  color: var(--body);
  line-height: 1.55;
}

.gemini-steps li::marker {
  color: var(--coral);
  font-weight: 700;
}

.gemini-steps b {
  color: var(--ink);
}

.keycap {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin: 0 1px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-elevated);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}

.keycap-or {
  color: var(--muted);
  font-size: 13px;
}

.note-why {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.note-why b {
  color: var(--coral-deep);
}

.note-date {
  color: var(--faint);
}

.section-hint {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-hint b {
  color: var(--coral-deep);
}

.workflow-note.pulse {
  animation: notePulse 1.6s ease;
}

@keyframes notePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 87, 0);
    border-color: var(--line);
  }
  30% {
    box-shadow: 0 0 0 4px var(--coral-soft);
    border-color: var(--coral);
  }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-note.pulse {
    animation: none;
    border-color: var(--coral);
  }
}

.prompt-item p,
.shot-list li,
.copy-card p {
  color: var(--muted);
  line-height: 1.55;
}

.prompt-item code {
  display: block;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-item code .hl,
.prompt-item code b {
  color: var(--coral-deep);
}

.shot-list {
  margin: 0;
  padding-left: 24px;
}

.shot-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.shot-list li::marker {
  color: var(--coral);
}

.copy-sets {
  display: grid;
  gap: 10px;
}

.document-card {
  grid-column: 1 / -1;
}

.document-card textarea {
  min-height: 460px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.copy-card {
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  padding: 12px 14px;
}

.copy-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink-panel);
  color: var(--on-ink);
  border: 1px solid var(--ink-panel-2);
  border-radius: var(--radius-pill);
  padding: 11px 16px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 생성 결과 미리보기 모달 */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 19, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.preview-dialog {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: min(900px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
  padding: 20px;
}

.preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.preview-close:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.preview-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 80px);
  margin: 8px auto 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.preview-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.preview-proposal {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}

.preview-open {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  color: var(--body);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.preview-open:hover {
  transform: translateY(-1px);
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

@media (max-width: 1080px) {
  .workspace,
  .proposal-grid,
  .hero-board {
    grid-template-columns: 1fr;
  }

  .brief-panel {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "tabs"
      "url"
      "form";
    grid-template-rows: none;
  }

  .brief-panel > .brief-intro { margin-bottom: 22px; }

  .motion-strip {
    min-height: 180px;
  }

  .proposal-grid > section,
  .proposal-grid > section:nth-child(2),
  .proposal-grid > section:nth-child(3),
  .proposal-grid > section:nth-child(4),
  .proposal-grid > section:nth-child(5),
  .proposal-grid > section:nth-child(6),
  .proposal-grid > section:nth-child(7),
  .proposal-grid > section:nth-child(8),
  .proposal-grid > section:nth-child(9),
  .proposal-grid > .document-card {
    grid-column: 1 / -1;
  }

  .brief-form > label:nth-of-type(1),
  .brief-form > label:nth-of-type(2),
  .brief-form > label:nth-of-type(4),
  .brief-form > label:nth-of-type(5),
  .brief-form > label:nth-of-type(7),
  .brief-form > .field-row,
  .brief-form > .primary-action {
    grid-column: span 6;
  }

  .brief-form > label:nth-of-type(3),
  .brief-form > label:nth-of-type(6) {
    grid-column: span 12;
  }
}

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

  .top-nav {
    margin-bottom: 12px;
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .nav-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .nav-brand h1 {
    font-size: 17px;
  }

  .top-nav .eyebrow {
    display: none;
  }

  .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .user-chip {
    max-width: 150px;
    font-size: 13px;
    padding: 7px 11px;
  }

  .user-provider {
    display: none;
  }

  .nav-login {
    padding: 10px 16px;
  }

  .workspace {
    gap: 12px;
    min-height: auto;
  }

  .proposal-panel,
  .brief-panel {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .proposal-toolbar,
  .section-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .prompt-item-header {
    display: grid;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions button,
  .gemini-launcher button,
  .image-actions button {
    width: 100%;
  }

  .revision-prompts {
    display: grid;
  }

  .revision-prompts .mini-action {
    width: 100%;
  }

  .mood-cards,
  .omni-grid,
  .generated-images,
  .api-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .brief-form {
    grid-template-columns: 1fr;
  }

  .brief-form > label:nth-of-type(1),
  .brief-form > label:nth-of-type(2),
  .brief-form > label:nth-of-type(3),
  .brief-form > label:nth-of-type(4),
  .brief-form > label:nth-of-type(5),
  .brief-form > label:nth-of-type(6),
  .brief-form > label:nth-of-type(7),
  .brief-form > .field-row,
  .brief-form > .primary-action {
    grid-column: 1 / -1;
  }

  .omni-hero {
    display: grid;
  }

  .hero-board {
    min-height: auto;
    padding: 22px;
  }

  .hero-board h3 {
    font-size: clamp(36px, 13vw, 56px);
  }

  .motion-strip {
    grid-template-columns: repeat(3, 1fr);
    min-height: 140px;
  }

  .motion-strip span:nth-child(1) {
    margin-top: 22px;
  }

  .motion-strip span:nth-child(3) {
    margin-top: 44px;
  }

  .brief-intro {
    padding: 16px;
  }

  .brief-intro dl {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px;
  }

  h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .toast {
    width: calc(100% - 24px);
    border-radius: var(--radius-md);
    text-align: center;
  }
}

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

@media print {
  body {
    background: #fff;
  }

  .brief-panel,
  .toolbar-actions,
  .toast {
    display: none;
  }

  .workspace,
  .proposal-grid,
  .hero-board {
    display: block;
  }

  .proposal-panel,
  .hero-board,
  .card {
    box-shadow: none;
    page-break-inside: avoid;
    margin-bottom: 12px;
  }
}

/* ─── URL-only 온보딩: 입력 모드 토글 ─────────────────────────── */
.is-hidden {
  display: none !important;
}

.input-mode-toggle {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border: 1px solid rgba(40, 34, 24, 0.14);
  border-radius: 12px;
  background: rgba(40, 34, 24, 0.04);
}

.mode-tab {
  flex: 1;
  min-height: 42px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.mode-tab:hover {
  background: rgba(40, 34, 24, 0.06);
}

.mode-tab.active {
  background: var(--coral);
  color: #fff;
}

.mode-tab:focus-visible {
  outline: 2px solid var(--coral-ring);
  outline-offset: 2px;
}

.url-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.url-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.url-panel input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(40, 34, 24, 0.18);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}

.url-panel input:focus-visible {
  outline: 2px solid var(--coral-ring);
  outline-offset: 1px;
  border-color: var(--coral);
}

.url-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #6e675c;
  word-break: keep-all;
}
