/*
 * Precision UI layer
 * A restrained production-workbench system: quiet chrome, strong hierarchy,
 * consistent control geometry and image-first decision surfaces.
 */

:root {
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.16);
  --paper: #f5f5f7;
  --panel: #ffffff;
  --rail: #fbfbfd;
  --rail-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-soft: #eaf3ff;
  --cyan: #0071e3;
  --amber: #9a6700;
  --amber-soft: #fff8e6;
  --red: #d92d20;
  --red-soft: #fff0ef;
  --green: #16803c;
  --green-soft: #edf8f0;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, monospace;
}

/* Visual operator flow: product → selling points → channel images → single-image creative */
.v2-selling-intro,
.v2-listing-brief,
.v2-task-instruction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.v2-selling-intro strong,
.v2-listing-brief strong,
.v2-task-instruction strong { font-size: 13px; }
.v2-selling-intro p,
.v2-listing-brief p,
.v2-task-instruction p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.v2-selling-intro .v2-page-actions { flex: 0 0 auto; margin: 0; }

.v2-tier-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  gap: 1px;
}

.v2-tier-overview > div { display: grid; grid-template-columns: auto 46px; gap: 2px 16px; min-height: 92px; align-content: center; padding: 15px 18px; background: #fff; }
.v2-tier-overview span { align-self: center; width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.v2-tier-overview strong { grid-row: span 2; align-self: center; font-size: 28px; font-weight: 620; text-align: right; }
.v2-tier-overview small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.v2-tier-overview .tier-p0 span,.v2-point-tier.p0 { background: #1d1d1f; color: #fff; }
.v2-tier-overview .tier-p1 span,.v2-point-tier.p1 { background: #e9f1ff; color: #205da8; }
.v2-tier-overview .tier-p2 span,.v2-point-tier.p2 { background: #f0f0f2; color: #5b5b61; }

.v2-selling-tier { margin-top: 24px; }
.v2-selling-tier > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 9px; }
.v2-selling-tier > header > div { display: flex; align-items: center; gap: 11px; }
.v2-selling-tier > header > div > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #1d1d1f; color: #fff; font-size: 11px; font-weight: 700; }
.v2-selling-tier.tier-p1 > header > div > span { background: #e9f1ff; color: #205da8; }
.v2-selling-tier.tier-p2 > header > div > span { background: #eeeeF0; color: #5b5b61; }
.v2-selling-tier h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.v2-selling-tier header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.v2-selling-tier header > small { color: var(--muted); font-size: 10px; }
.v2-selling-list { display: grid; gap: 7px; }
.v2-selling-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 265px; gap: 16px; align-items: center; min-height: 126px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.v2-selling-row.needs_evidence,.v2-selling-row.blocked { border-color: #ecd8cf; background: #fffcfa; }
.v2-selling-rank { align-self: stretch; display: grid; align-content: space-between; justify-items: start; padding-right: 14px; border-right: 1px solid var(--line); }
.v2-selling-rank > b { padding: 5px 8px; border-radius: 8px; background: #1d1d1f; color: #fff; font-size: 10px; }
.tier-p1 .v2-selling-rank > b { background: #e9f1ff; color: #205da8; }
.tier-p2 .v2-selling-rank > b { background: #eeeeF0; color: #5b5b61; }
.v2-selling-rank small { display: block; }
.v2-selling-copy > span { color: var(--muted); font-size: 9px; }
.v2-selling-copy h3 { margin: 4px 0 6px; font-size: 16px; letter-spacing: -.018em; }
.v2-selling-copy p { margin: 0 0 5px; color: var(--ink-soft); font-size: 11px; }
.v2-selling-copy p b { color: var(--ink); font-weight: 620; }
.v2-selling-copy > small { color: var(--muted); font-size: 9.5px; }
.v2-selling-controls { display: grid; justify-items: end; gap: 13px; }
.v2-tier-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f5f5f7; }
.v2-tier-switch button { min-width: 40px; height: 27px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; }
.v2-tier-switch button:disabled { opacity: 1; background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.v2-tier-empty { padding: 22px; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--muted); font-size: 11px; text-align: center; }
.v2-removed-selling { margin-top: 24px; border-top: 1px solid var(--line); }
.v2-removed-selling summary { padding: 14px 2px; color: var(--muted); font-size: 11px; cursor: pointer; }
.v2-removed-selling summary span { margin-left: 6px; }
.v2-removed-selling article { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #eeeeF0; font-size: 11px; }

.v2-channel-summary,.v2-task-coverage { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: center; gap: 1px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.v2-channel-summary > div,.v2-task-coverage > div { display: grid; gap: 3px; min-height: 68px; align-content: center; padding: 12px 16px; background: #fff; }
.v2-channel-summary span,.v2-task-coverage span { color: var(--muted); font-size: 9px; }
.v2-channel-summary strong,.v2-task-coverage strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.v2-channel-summary > button,.v2-task-coverage > button { height: 100%; min-height: 68px; border: 0; border-radius: 0; background: #fff; }

.v2-listing-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.v2-listing-strip article { display: grid; gap: 9px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: opacity .16s ease,border-color .16s ease; }
.v2-listing-strip article.inactive { opacity: .48; }
.v2-listing-strip article > label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; cursor: pointer; }
.v2-listing-strip article > label input { accent-color: var(--blue); }
.v2-slot-canvas { position: relative; display: grid; aspect-ratio: 1; place-items: center; overflow: hidden; border-radius: 10px; background: linear-gradient(145deg,#f2f2f4,#e6e7ea); }
.v2-slot-canvas::before { content:""; position:absolute; inset:18%; border:1px solid rgba(120,120,126,.25); border-radius:38% 38% 18% 18%; background:#fff; box-shadow:0 8px 18px rgba(0,0,0,.06); }
.v2-slot-canvas b,.v2-slot-canvas i { position: relative; z-index: 1; }
.v2-slot-canvas b { font-family: var(--mono); font-size: 14px; }
.v2-slot-canvas i { position: absolute; bottom: 7px; color: var(--muted); font-size: 8px; font-style: normal; }
.v2-listing-strip article > div:last-child { min-width: 0; }
.v2-listing-strip article > div:last-child strong { font-size: 11px; }
.v2-listing-strip article > div:last-child p { overflow: hidden; margin: 3px 0; color: var(--ink-soft); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.v2-listing-strip article > div:last-child small { color: var(--muted); font-size: 8px; }

.v2-channel-task-list { display: grid; gap: 7px; }
.v2-channel-task-row { display: grid; grid-template-columns: 78px minmax(0,1fr) 272px; gap: 17px; align-items: center; min-height: 118px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.v2-channel-task-row.blocked { border-color: #ecd8cf; background: #fffcfa; }
.v2-channel-task-row.empty { min-height: 88px; border-style: dashed; background: rgba(255,255,255,.48); }
.v2-task-slot { align-self: stretch; display: grid; align-content: center; gap: 2px; padding-right: 14px; border-right: 1px solid var(--line); }
.v2-task-slot b { font-family: var(--mono); font-size: 18px; font-weight: 550; }
.v2-task-slot span,.v2-task-slot small { color: var(--muted); font-size: 9px; }
.v2-task-main h3 { margin: 6px 0 4px; font-size: 15px; }
.v2-task-main p { margin: 0 0 5px; color: var(--ink-soft); font-size: 11px; }
.v2-task-main > small { color: var(--muted); font-size: 9.5px; }
.v2-point-tier { display: inline-flex; min-height: 22px; align-items: center; margin-right: 5px; padding: 0 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.v2-point-tier.neutral { background: #eeeeF0; color: #5b5b61; }
.v2-task-empty-copy strong { font-size: 13px; }
.v2-task-empty-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.v2-channel-task-row > .primary-button { justify-self: end; }
.v2-channel-task-row .v2-task-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6px; }
.v2-channel-task-row .v2-task-actions > button { min-width: 0; height: 36px; }
.v2-task-order-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 4px; }
.v2-task-order-actions button { min-width: 30px !important; height: 28px !important; font-size: 9px !important; }

.v2-creative-brief { display: grid; grid-template-columns: 190px minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.v2-creative-brief > div { display: grid; gap: 2px; padding-right: 16px; border-right: 1px solid var(--line); }
.v2-creative-brief > div span,.v2-creative-brief > div small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.v2-creative-brief > div strong { font-size: 15px; }
.v2-creative-brief dl { display: grid; grid-template-columns: .75fr 1.35fr .8fr; gap: 16px; margin: 0; }
.v2-creative-brief dl div { min-width: 0; }
.v2-creative-brief dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.v2-creative-brief dd { overflow: hidden; margin: 0; font-size: 10.5px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.v2-task-filmstrip { display: grid; grid-auto-columns: minmax(145px,1fr); grid-auto-flow: column; gap: 6px; overflow-x: auto; margin-bottom: 13px; padding: 3px 2px 8px; }
.v2-task-filmstrip button { display: grid; min-width: 145px; min-height: 62px; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafafb; color: var(--ink); text-align: left; }
.v2-task-filmstrip button.active { border-color: rgba(7,104,215,.46); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(7,104,215,.12); }
.v2-task-filmstrip button.blocked { opacity: .56; }
.v2-task-filmstrip span,.v2-task-filmstrip i { color: var(--muted); font-size: 8.5px; font-style: normal; }
.v2-task-filmstrip strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.v2-creative-page .v2-creative-layout { grid-template-columns: 1fr; }
.v2-direction-stage > header { min-height: 88px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.v2-production-path { margin: 10px 0 14px; }
.v2-structural-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 10px 0 14px; padding: 11px 14px; border: 1px solid #dce9fa; border-radius: 12px; background: #f5f9ff; }
.v2-structural-note strong { font-size: 11px; }
.v2-structural-note span { color: var(--muted); font-size: 10px; }
.v2-guided-region { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.v2-guided-region > header { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.v2-guided-region > header > span { display: grid; min-width: 38px; height: 28px; place-items: center; border-radius: 8px; background: #f0f0f2; color: var(--muted); font-size: 9px; }
.v2-guided-region h3 { margin: 0; font-size: 13px; }
.v2-guided-region p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; }
.v2-guided-region .v2-region-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-guided-region .v2-region-filter button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: 10px; }
.v2-guided-region .v2-region-filter button.active { border-color: rgba(7,104,215,.4); background: var(--blue-soft); color: var(--blue); }

@media (max-width: 1080px) {
  .v2-selling-row,.v2-channel-task-row { grid-template-columns: 68px minmax(0,1fr); }
  .v2-selling-controls,.v2-channel-task-row .v2-task-actions,.v2-channel-task-row > .primary-button { grid-column: 2; justify-self: stretch; justify-items: stretch; }
  .v2-selling-controls { grid-template-columns: auto 1fr; align-items: center; }
  .v2-listing-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .v2-selling-intro,.v2-listing-brief,.v2-task-instruction { align-items: stretch; flex-direction: column; gap: 10px; }
  .v2-selling-intro .v2-page-actions { justify-content: stretch; }
  .v2-selling-intro .v2-page-actions button { flex: 1; }
  .v2-tier-overview,.v2-channel-summary,.v2-task-coverage { grid-template-columns: 1fr; }
  .v2-tier-overview > div { min-height: 72px; }
  .v2-selling-row,.v2-channel-task-row { grid-template-columns: 54px minmax(0,1fr); gap: 12px; padding: 12px; }
  .v2-selling-controls { grid-column: 1/-1; grid-template-columns: 1fr; justify-items: stretch; }
  .v2-selling-controls .v2-card-actions { flex-wrap: wrap; }
  .v2-listing-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v2-channel-task-row .v2-task-actions,.v2-channel-task-row > .primary-button { grid-column: 1/-1; }
  .v2-creative-brief { grid-template-columns: 1fr; gap: 10px; }
  .v2-creative-brief > div { padding: 0 0 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .v2-creative-brief dl { grid-template-columns: 1fr; gap: 8px; }
  .v2-creative-brief dd { white-space: normal; }
  .v2-task-filmstrip { grid-auto-columns: minmax(135px,72vw); }
}

.workspace-home-button {
  width: 100%;
  margin: 4px 0 14px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.workspace-home-button:hover,
.workspace-home-button:focus-visible { background: #f0f0f3; border-color: var(--line); outline: none; }
.workspace-home-button span,
.workspace-home-button small { display: block; }
.workspace-home-button span { font-size: 13px; font-weight: 680; }
.workspace-home-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.project-home { display: grid; gap: 18px; max-width: 1240px; margin: 0 auto; }
.project-home-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 28px 30px; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.project-home-head h2 { margin: 6px 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; }
.project-home-head p { margin: 0; color: var(--muted); }
.project-home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-home-card,
.project-home-add { min-height: 230px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.project-home-card.active { border-color: rgba(0, 113, 227, .44); box-shadow: 0 0 0 3px rgba(0, 113, 227, .08); }
.project-home-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; color: var(--muted); font-size: 10px; }
.project-home-card-top i { padding: 4px 7px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-style: normal; }
.project-home-card > strong,
.project-home-card > code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-home-card > strong { font-size: 17px; }
.project-home-card > code { margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.project-home-card dl { display: flex; gap: 18px; margin: 24px 0 18px; }
.project-home-card dl div { min-width: 0; }
.project-home-card dt { color: var(--muted); font-size: 9px; }
.project-home-card dd { margin: 3px 0 0; font-size: 11px; }
.project-home-card > button { width: 100%; }
.project-home-add { display: grid; place-content: center; gap: 5px; color: var(--muted); text-align: center; border-style: dashed; cursor: pointer; }
.project-home-add:hover { color: var(--blue); border-color: rgba(0, 113, 227, .5); background: var(--blue-soft); }
.project-home-add span { font-size: 28px; font-weight: 300; }
.project-home-add strong { color: var(--ink); font-size: 14px; }
.project-home-add small { font-size: 10px; }
.project-home-flow { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 15px 18px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 14px; font-size: 10px; }
.project-home-flow strong { margin-right: 8px; color: var(--ink); }
.project-home-flow i { color: #b5b5ba; font-style: normal; }

.v2-project-context { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto minmax(120px, 1fr); gap: 10px 14px; align-items: center; margin-bottom: 12px; padding: 12px 16px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 10px; }
.v2-project-context strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.v2-project-context i { padding-right: 14px; border-right: 1px solid var(--line); font-family: var(--mono); font-style: normal; }
.v2-production-controls { display: grid; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.v2-production-handoff { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; background: var(--blue-soft); border-radius: 12px; }
.v2-production-handoff strong,
.v2-production-handoff span { display: block; }
.v2-production-handoff span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.v2-generation-context { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 14px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 14px; }
.v2-generation-context > div { min-width: 0; padding: 15px 16px; background: #fff; }
.v2-generation-context span,
.v2-generation-context strong,
.v2-generation-context small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-generation-context span { color: var(--muted); font-size: 9px; }
.v2-generation-context strong { margin-top: 5px; font-size: 13px; }
.v2-generation-context small { margin-top: 4px; color: var(--muted); font-size: 9px; }

@media (max-width: 920px) {
  .project-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-project-context { grid-template-columns: auto 1fr auto; }
  .v2-project-context i { border: 0; }
  .v2-project-context span:last-of-type { grid-column: 1; }
  .v2-project-context strong:last-child { grid-column: 2 / -1; }
}

@media (max-width: 640px) {
  .project-home-head { align-items: stretch; flex-direction: column; padding: 22px; }
  .project-home-grid { grid-template-columns: 1fr; }
  .project-home-flow { display: none; }
  .v2-production-handoff { align-items: stretch; flex-direction: column; }
  .v2-generation-context { grid-template-columns: 1fr; }
}

/* Goal-to-creative decision chain --------------------------------------- */

.goal-source-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.goal-source-bar > button {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 58px;
  padding: 9px 42px 9px 12px;
  color: var(--ink);
  text-align: left;
  background: #f5f5f7;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.goal-source-bar > button:hover {
  background: #efeff3;
  border-color: var(--line);
}

.goal-source-bar > button:focus-visible {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 113, 227, 0.16);
}

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

.goal-source-bar span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.goal-source-bar strong {
  font-size: 13px;
}

.goal-source-bar small {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 11px;
  font-weight: 650;
}

.goal-handoff-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.goal-handoff-copy h3 {
  margin: 5px 0 5px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.goal-handoff-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.goal-handoff-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr) auto);
  gap: 8px;
  align-items: center;
}

.goal-handoff-flow > div {
  min-width: 0;
  padding: 11px 12px;
  background: #f5f5f7;
  border-radius: 10px;
}

.goal-handoff-flow > div.next {
  background: var(--blue-soft);
}

.goal-handoff-flow span,
.goal-handoff-flow strong {
  display: block;
}

.goal-handoff-flow span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.goal-handoff-flow strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-handoff-flow i {
  color: #a1a1a6;
  font-size: 12px;
  font-style: normal;
}

.creative-task-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.creative-task-workspace .creative-task-browser,
.creative-task-workspace .creative-brief-card {
  min-width: 0;
  margin: 0;
}

.creative-task-workspace .creative-task-browser {
  padding: 18px;
}

.creative-task-browser > header > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.creative-section-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
}

.creative-task-workspace .creative-group-tabs {
  padding-bottom: 10px;
}

.creative-task-workspace .creative-group-tabs button {
  min-width: 100px;
  min-height: 42px;
  padding: 8px 11px;
}

.creative-task-workspace .creative-task-list {
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 228px;
  overflow-y: auto;
}

.creative-task-workspace .creative-task-list button {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.creative-task-workspace .creative-brief-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 14px;
}

.creative-task-workspace .creative-brief-card h2 {
  margin: 6px 0;
  font-size: clamp(21px, 2vw, 28px);
}

.creative-task-workspace .creative-brief-card p strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.creative-brief-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.creative-brief-facts > div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #f5f5f7;
  border-radius: 9px;
}

.creative-brief-facts dt,
.creative-brief-facts dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.creative-brief-facts dt {
  color: var(--muted);
}

.creative-brief-facts dd {
  color: var(--ink-soft);
  font-weight: 650;
}

.creative-task-workspace .creative-brief-card > button {
  align-self: flex-start;
  margin-top: auto;
  min-height: 34px;
  padding: 0 12px;
  color: var(--blue);
  background: #f5f5f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.creative-task-workspace .creative-brief-card > button:hover {
  background: #ececf0;
}

.creative-choice-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr) auto);
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f5f5f7;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.creative-choice-chain > div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
}

.creative-choice-chain > div > span {
  display: grid;
  grid-row: 1 / 3;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 750;
}

.creative-choice-chain small,
.creative-choice-chain strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-choice-chain small {
  color: var(--muted);
  font-size: 8px;
}

.creative-choice-chain strong {
  font-size: 9px;
}

.creative-choice-chain i {
  color: #a1a1a6;
  font-size: 11px;
  font-style: normal;
}

.creative-people-step {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
  padding: 13px;
  background: #f7f7f8;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.creative-people-step .creative-profile-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.creative-people-step .creative-profile-grid label {
  min-width: 0;
}

.creative-people-step .creative-profile-grid select {
  background-color: #fff;
}

.creative-inherited-fact {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 7px 10px;
  background: #ececf0;
  border-radius: 9px;
}

.creative-inherited-fact span,
.creative-inherited-fact small {
  color: var(--muted);
  font-size: 11px;
}

.creative-inherited-fact strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.director-readonly-field {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 44px;
  padding: 8px 12px;
  background: #f5f5f7;
  border-radius: 9px;
}

.director-readonly-field span,
.director-readonly-field small {
  color: var(--muted);
  font-size: 11px;
}

.director-readonly-field strong {
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .goal-handoff-card,
  .creative-task-workspace,
  .creative-people-step {
    grid-template-columns: 1fr;
  }

  .creative-people-step .creative-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-source-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  .goal-source-bar {
    grid-template-columns: 1fr;
  }

  .goal-handoff-card {
    padding: 15px;
  }

  .goal-handoff-flow,
  .creative-choice-chain {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .goal-handoff-flow > div {
    min-width: 138px;
  }

  .creative-choice-chain > div {
    min-width: 142px;
  }

  .creative-task-workspace .creative-brief-card,
  .creative-task-workspace .creative-task-browser,
  .creative-people-step {
    padding: 15px;
  }

  .creative-people-step .creative-profile-grid {
    grid-template-columns: 1fr;
  }
}

html {
  background: var(--paper);
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: -0.006em;
  text-rendering: optimizeLegibility;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

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

.stage-content.is-updating [data-scene-profile],
.stage-content.is-updating [data-apply-story-template],
.stage-content.is-updating [data-creative-profile],
.stage-content.is-updating [data-output-goal],
.stage-content.is-updating [data-apply-regional-profile-all] {
  pointer-events: none;
}

[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.24) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active {
    transform: none;
  }
}

/* Application frame ----------------------------------------------------- */

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.side-rail {
  padding: 22px 14px 18px;
  color: var(--ink);
  background: rgba(251, 251, 253, 0.92);
  border-right: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(24px);
}

.brand-block {
  gap: 12px;
  min-height: 52px;
  padding: 0 10px 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: #fff;
  background: #1d1d1f;
  border-radius: 10px;
  font: 700 12px/1 var(--body);
  letter-spacing: -0.03em;
  box-shadow: none;
}

.brand-block strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.brand-block div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.meta-label,
.side-rail .meta-label {
  color: var(--muted);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.project-switcher {
  padding: 16px 10px;
  border-color: var(--line);
}

.project-button {
  gap: 10px;
  min-height: 54px;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 12px;
}

.project-button:hover {
  background: rgba(0, 0, 0, 0.035);
}

.project-thumb {
  width: 38px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
}

.project-button strong {
  color: var(--ink);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 650;
}

.project-button small {
  color: var(--muted);
  font-size: 10px;
}

.project-button > span[aria-hidden="true"] {
  position: relative;
  width: 16px;
  height: 16px;
  overflow: hidden;
  color: transparent;
}

.project-button > span[aria-hidden="true"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.project-menu {
  top: calc(100% - 4px);
  padding: 8px;
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14);
}

.project-menu button {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
}

.project-menu button:hover,
.project-menu button.active {
  background: #f0f0f2;
}

.stage-nav {
  gap: 18px;
  margin-top: 20px;
}

.stage-nav-group {
  display: grid;
  gap: 4px;
}

.stage-group-label {
  padding: 0 12px 5px;
  color: #86868b;
  font-size: 10px;
  font-weight: 600;
}

.stage-link {
  text-decoration: none;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 44px;
  padding: 0 12px;
  color: #515154;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 520;
  transition: background-color 140ms ease, color 140ms ease;
}

.review-card.missing-file .review-media {
  background: #f1f1f3;
}

.missing-file-state {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 210px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.missing-file-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.missing-file-state span {
  font-size: 11px;
}

.stage-link:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.stage-link:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.28) !important;
  outline-offset: 0 !important;
}

.stage-link.active {
  color: var(--ink);
  background: #e8e8ed;
  box-shadow: none;
  font-weight: 650;
}

.stage-link > span,
.stage-link.active > span {
  color: #86868b;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
}

.stage-link.active > span {
  color: var(--blue);
}

.stage-link em {
  min-width: 22px;
  padding: 4px 6px;
  color: #6e6e73;
  background: rgba(0, 0, 0, 0.06);
  font-family: var(--body);
  font-size: 10px;
}

.rail-footer {
  padding: 16px 10px 0;
  color: var(--ink-soft);
  border-color: var(--line);
  font-size: 11px;
}

.rail-footer small {
  color: #86868b;
}

.service-dot {
  width: 7px;
  height: 7px;
  background: #30a46c;
  border: 0;
  box-shadow: 0 0 0 3px rgba(48, 164, 108, 0.12);
}

.main-workspace {
  background: var(--paper);
}

.topbar {
  min-height: 88px;
  padding: 17px clamp(28px, 3.6vw, 52px);
  background: rgba(245, 245, 247, 0.82);
  border-color: var(--line);
  backdrop-filter: saturate(180%) blur(24px);
}

.topbar-copy {
  min-width: 0;
}

.topbar h1 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.topbar-copy > p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.topbar-actions {
  gap: 10px;
}

.lock-state {
  min-height: 48px;
  margin: 0;
  padding: 6px 12px 6px 7px;
  background: var(--green-soft);
  border-color: rgba(22, 128, 60, 0.16);
  border-radius: 12px;
}

.lock-icon {
  width: 30px;
  height: 30px;
  background: var(--green);
  border-radius: 9px;
}

.lock-state strong {
  font-size: 11px;
}

.lock-state small {
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
}

.quiet-button,
.primary-button,
.danger-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.quiet-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.quiet-button:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.primary-button {
  background: var(--blue);
  box-shadow: none;
}

.primary-button:hover {
  background: #0077ed;
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.2);
  transform: none;
}

.stage-content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px clamp(28px, 3.6vw, 52px) 88px;
}

.main-area,
.stage-content,
.stage-content > * {
  min-width: 0;
}

/* Shared content geometry ----------------------------------------------- */

.panel,
.metric-card,
.reference-card,
.constraint-section,
.plan-row,
.provider-card,
.review-card,
.issue-card,
.export-card,
.mini-panel,
.goal-section,
.creative-task-browser,
.advanced-product-data,
.advanced-direction-override {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.panel,
.goal-section,
.creative-task-browser {
  padding: 24px;
}

.section-title-row h2,
.goal-section h3,
.creative-task-browser h2 {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.section-title-row h2 {
  font-size: 20px;
}

.section-title-row p,
.goal-section > header p,
.creative-task-browser > header p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stage-content label,
.constraint-section label,
.director-field-grid label,
.scene-task-fields label,
.creative-profile-grid label,
.creative-region-row > label {
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 580;
}

.stage-content input,
.stage-content select,
.stage-content textarea,
.project-form-grid input,
.inspector-grid select,
.field-label textarea {
  min-height: 44px;
  padding: 10px 14px;
  color: var(--ink);
  background-color: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.015);
}

.stage-content select,
.project-form-grid select,
.inspector-grid select {
  max-width: 100%;
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

.stage-content input:hover,
.stage-content select:hover,
.stage-content textarea:hover {
  border-color: rgba(0, 0, 0, 0.24);
}

.stage-content input:focus,
.stage-content select:focus,
.stage-content textarea:focus {
  background-color: #fff;
  border-color: var(--blue);
}

.chip-button,
.library-group-filters button,
.creative-group-tabs button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 12px;
}

/* Recognizable six-step production rail -------------------------------- */

.stage-brief.stage-brief-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.36fr);
  margin-bottom: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.stage-brief-compact .workflow-progress {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 17px 20px 15px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.workflow-step {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #86868b;
}

.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 34px;
  right: 10px;
  height: 1px;
  background: #d2d2d7;
}

.workflow-step > span {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #6e6e73;
  background: #f5f5f7;
  border: 1px solid #d2d2d7;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 650;
}

.workflow-step > small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-right: 10px;
  background: #fff;
  font-size: 10px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step.done > span {
  color: #fff;
  background: #1d1d1f;
  border-color: #1d1d1f;
}

.workflow-step.current > span {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.10);
}

.workflow-step.done,
.workflow-step.current {
  color: var(--ink);
}

.stage-brief-summary {
  min-height: 62px;
  padding: 14px 20px;
}

.stage-brief-summary span {
  color: var(--blue);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 650;
}

.stage-brief-summary strong {
  font-size: 13px;
  font-weight: 580;
}

.stage-brief-compact .stage-brief-state {
  display: flex;
  min-width: 0;
  padding: 14px 20px;
  color: var(--muted);
  background: #fafafa;
  border: 0;
  border-left: 1px solid var(--line);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.stage-brief-compact .stage-brief-state.done {
  color: #477353;
  background: #f4faf5;
}

/* Goal and creative pages ------------------------------------------------ */

.goal-intro,
.creative-brief-card,
.library-head {
  align-items: center;
  margin-bottom: 18px;
  padding: 28px 30px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}

.goal-intro h2,
.creative-brief-card h2,
.library-head h2 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 680;
  letter-spacing: -0.045em;
}

.goal-intro p,
.creative-brief-card p,
.library-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.goal-intro .meta-label,
.creative-brief-card .meta-label,
.library-head .meta-label {
  color: var(--blue);
}

.goal-intro-system,
.creative-brief-result {
  flex: 0 0 min(390px, 38%);
  padding: 17px 18px;
  background: #f5f5f7;
  border: 0;
  border-radius: 14px;
}

.goal-intro-system span,
.creative-brief-result span,
.creative-brief-result small {
  color: var(--muted);
  font-family: var(--body);
  font-size: 10px;
}

.goal-intro-system strong,
.creative-brief-result strong {
  margin: 7px 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.system-responsibility-strip {
  gap: 10px;
  margin-bottom: 20px;
  padding: 4px 2px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.system-responsibility-strip span {
  margin-right: 6px;
  color: #86868b;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
}

.system-responsibility-strip b {
  padding: 6px 10px;
  color: #477353;
  background: #edf7ef;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 580;
}

.creative-profile-panel {
  margin-bottom: 28px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}

.creative-profile-panel > header {
  align-items: center;
  margin-bottom: 22px;
}

.creative-profile-panel > header h2 {
  margin-top: 7px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.creative-profile-panel > header small {
  font-size: 11px;
}

.creative-region-row {
  grid-template-columns: minmax(220px, 0.82fr) minmax(320px, 1.35fr) minmax(230px, 0.8fr);
  gap: 22px;
  align-items: center;
  padding: 20px;
  background: #f5f5f7;
  border: 0;
  border-radius: 16px;
}

.creative-region-row select,
.creative-profile-grid select {
  min-height: 46px;
  padding: 10px 42px 10px 14px;
  background-color: #fff;
  border-color: var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.creative-step-heading {
  gap: 11px;
}

.creative-step-heading > span,
.creative-scene-picker > header > div > span {
  width: 28px;
  height: 28px;
  color: #fff;
  background: #1d1d1f;
  border-radius: 50%;
  font-family: var(--body);
  font-size: 10px;
  font-weight: 650;
}

.creative-step-heading strong,
.creative-scene-picker > header strong {
  font-size: 13px;
  font-weight: 650;
}

.creative-step-heading small,
.creative-scene-picker > header small,
.creative-scene-picker > header > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.creative-product-gate {
  gap: 4px;
  min-height: 46px;
  padding-left: 22px;
  border-color: var(--line);
}

.creative-product-gate span,
.creative-product-gate small {
  color: var(--muted);
  font-size: 10px;
}

.creative-product-gate strong {
  font-size: 12px;
}

.creative-scene-picker {
  margin-top: 22px;
  padding-top: 22px;
}

.creative-scene-picker > header {
  align-items: center;
  margin-bottom: 14px;
}

.scene-choice-strip {
  grid-auto-columns: 184px;
  gap: 12px;
  padding: 2px 2px 14px;
}

.scene-choice-card {
  border-color: var(--line);
  border-radius: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.scene-choice-card:hover {
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.scene-choice-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.12);
}

.scene-choice-photo {
  height: 108px;
  background-color: #e8e8ed;
}

.scene-choice-photo i,
.route-visual i {
  left: 10px;
  bottom: 9px;
  font-family: var(--body);
  font-size: 9px;
  font-weight: 600;
}

.scene-choice-copy {
  gap: 5px;
  min-height: 64px;
  padding: 11px 12px 12px;
}

.scene-choice-copy strong {
  font-size: 12px;
}

.scene-choice-copy small {
  font-size: 10px;
}

.scene-choice-card.active .scene-choice-copy {
  background: var(--blue-soft);
}

.scene-route-panel {
  margin-top: 20px;
  padding: 20px;
  background: #f5f5f7;
  border: 0;
  border-radius: 16px;
}

.scene-route-panel > header {
  margin-bottom: 16px;
}

.scene-route-panel > header > b {
  color: var(--blue);
  font-family: var(--body);
  font-size: 11px;
}

.creative-route-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.creative-route-card {
  position: relative;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  min-height: 132px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.creative-route-card:hover {
  border-color: rgba(0, 113, 227, 0.40);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.creative-route-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.12);
}

.route-visual {
  min-height: 132px;
  background-color: #d2d2d7;
}

.route-visual::after {
  height: 48%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.42));
}

.route-schematic {
  display: none;
}

.route-copy {
  align-self: center;
  padding: 18px 58px 18px 18px;
}

.route-copy > span {
  color: var(--blue);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
}

.route-copy > strong {
  margin: 8px 0 6px;
  font-size: 16px;
  font-weight: 650;
}

.route-copy > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.creative-route-card > b {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 42px;
  margin: 0;
  padding: 7px 9px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.creative-route-card.active > b {
  color: #fff;
  background: var(--blue);
}

.creative-people-light {
  margin-top: 16px;
  border-color: var(--line);
  border-radius: 14px;
}

.creative-people-light > summary {
  min-height: 56px;
  padding: 14px 16px;
}

.creative-people-light > summary strong {
  font-size: 12px;
}

.creative-people-light > summary small,
.creative-people-light > summary b {
  font-size: 10px;
}

.creative-people-light .creative-profile-grid {
  gap: 14px;
  padding: 0 16px 16px;
}

.creative-profile-panel > footer {
  gap: 10px 20px;
  margin-top: 16px;
  padding-top: 16px;
  font-size: 10px;
}

.creative-profile-panel > footer button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(0, 113, 227, 0.16);
  border-radius: 10px;
  font-size: 11px;
}

.creative-task-browser {
  margin: 24px 0 16px;
}

.creative-group-tabs {
  gap: 8px;
  padding-bottom: 16px;
}

.creative-group-tabs button {
  min-height: 48px;
  padding: 10px 14px;
  background: #f5f5f7;
  border-color: transparent;
}

.creative-group-tabs button strong {
  font-size: 11px;
}

.creative-group-tabs button small {
  margin-top: 4px;
  font-size: 9px;
}

.creative-group-tabs button.active {
  color: var(--ink);
  background: #e8e8ed;
  border-color: transparent;
}

.creative-task-list button {
  grid-template-columns: 74px minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 12px 14px;
  border-color: var(--line);
  border-radius: 0;
}

.creative-task-list button:hover {
  background: #fafafa;
}

.creative-task-list button.active {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 var(--blue);
}

.creative-task-list button > span {
  color: var(--muted);
  font-family: var(--body);
  font-size: 11px;
}

.creative-task-list button div strong {
  font-size: 13px;
}

.creative-task-list button div small {
  font-size: 10px;
}

.creative-task-list button > b {
  color: var(--green);
  font-family: var(--body);
  font-size: 10px;
}

/* Image library ---------------------------------------------------------- */

.library-head {
  padding: 26px 30px;
}

.library-status-filters {
  gap: 10px;
  margin-bottom: 14px;
}

.library-status-filters button {
  min-height: 56px;
  padding: 0 16px;
  background: #fff;
  border-color: var(--line);
  border-radius: 14px;
}

.library-status-filters button:hover {
  border-color: var(--line-strong);
}

.library-status-filters button.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(0, 113, 227, 0.28);
}

.library-status-filters span,
.library-status-filters b {
  font-family: var(--body);
  font-size: 11px;
}

.filter-set {
  gap: 8px;
}

.chip-button {
  min-height: 38px;
  padding: 0 12px;
  background: #fff;
  border-color: var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.chip-button:hover {
  border-color: var(--line-strong);
}

.chip-button.active {
  color: #fff;
  background: #1d1d1f;
  border-color: #1d1d1f;
}

.review-grid {
  gap: 16px;
  margin-top: 16px;
}

.review-card {
  border-radius: 18px;
}

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

.review-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.12);
}

.review-media {
  aspect-ratio: 1.42;
}

.review-body {
  padding: 15px;
}

.review-title strong {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 620;
}

.review-title span {
  font-family: var(--body);
  font-size: 10px;
}

.review-body > p {
  min-height: 34px;
  margin: 8px 0 12px;
  font-size: 10px;
}

.review-card select {
  min-height: 42px;
}

/* Details and dialogs ---------------------------------------------------- */

.advanced-panel,
.form-section-card,
.claim-editor-card,
.director-form-section,
.scene-task-card {
  border-color: var(--line);
  border-radius: 14px;
}

.advanced-panel > summary,
.form-section-card > summary,
.claim-editor-card > summary,
.director-form-section > summary,
.scene-task-card > summary,
.advanced-product-data > summary,
.advanced-direction-override > summary {
  min-height: 64px;
  padding: 15px 18px;
}

.advanced-panel > summary::after,
.form-section-card > summary::after,
.claim-editor-card > summary::after,
.director-form-section > summary::after,
.scene-task-card > summary::after {
  color: var(--muted);
  font-size: 19px;
}

.project-dialog,
.image-dialog {
  border-radius: 20px;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .creative-region-row {
    grid-template-columns: minmax(190px, 0.9fr) minmax(260px, 1.2fr);
  }

  .creative-product-gate {
    grid-column: 1 / -1;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .creative-route-card {
    grid-template-columns: 138px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-copy > p,
  .lock-state {
    display: none;
  }

  .workflow-step > small {
    display: none;
  }

  .workflow-step:not(:last-child)::after {
    right: 8px;
  }

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

  .creative-route-card {
    grid-template-columns: 1fr;
  }

  .route-visual {
    min-height: 150px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .side-rail {
    position: sticky;
    height: auto;
    padding: 10px 14px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block,
  .project-switcher,
  .rail-footer,
  .stage-group-label {
    display: none;
  }

  .stage-nav,
  .stage-nav-group {
    display: flex;
    gap: 7px;
    margin: 0;
    overflow-x: auto;
  }

  .stage-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
  }

  .topbar {
    min-height: 74px;
    padding: 14px 18px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .topbar-actions .quiet-button,
  .topbar-actions .lock-state {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 40px;
    padding: 0 13px;
    font-size: 12px;
  }

  .stage-content {
    padding: 18px 16px 64px;
  }

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

  .stage-brief-compact .stage-brief-state {
    display: none;
  }

  .stage-brief-summary {
    padding: 13px 16px;
  }

  .goal-intro,
  .creative-brief-card,
  .library-head {
    gap: 20px;
    padding: 22px;
  }

  .creative-profile-panel,
  .goal-section,
  .creative-task-browser,
  .panel {
    padding: 18px;
  }

  .creative-region-row,
  .creative-route-grid,
  .creative-profile-grid,
  .creative-people-light .creative-profile-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .creative-region-row {
    gap: 16px;
    padding: 16px;
  }

  .creative-route-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .route-visual {
    min-height: 132px;
  }

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

@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;
  }
}

/* Commercial maturity v2 ------------------------------------------------
   The rail owns workflow position. Pages own one decision at a time. */

:root {
  --ink: #1d1d1f;
  --ink-soft: #515154;
  --muted: #6d6d72;
  --line: rgba(29, 29, 31, 0.09);
  --line-strong: rgba(29, 29, 31, 0.16);
  --paper: #f4f4f6;
  --panel: #fff;
  --rail: #fafafb;
  --blue: #0768d7;
  --blue-soft: #eef5ff;
  --green: #2d7a4f;
  --green-soft: #eef7f1;
  --amber: #936100;
  --amber-soft: #fff7e6;
  --red: #be3b34;
  --red-soft: #fff1ef;
  --radius: 14px;
  --radius-sm: 10px;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.side-rail {
  padding: 18px 12px 16px;
  background: rgba(250, 250, 251, 0.94);
}

.brand-block {
  min-height: 44px;
  padding: 0 8px 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #1d1d1f;
  border-radius: 10px;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-card .brand-mark {
  color: #fff;
}

.project-switcher {
  padding: 14px 8px 15px;
}

.project-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 16px;
  gap: 10px;
  min-height: 66px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid transparent;
}

.project-button:hover,
.project-button[aria-expanded="true"] {
  background: #fff;
  border-color: var(--line);
}

.project-button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
  align-content: center;
}

.project-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
  background-color: #ececee;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 142% auto;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 10px;
}

.project-thumb:not(.has-image)::before,
.project-thumb:not(.has-image)::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 8px;
  border-top: 1.5px solid #8b8b90;
  border-left: 1.5px solid #8b8b90;
}

.project-thumb:not(.has-image)::before {
  top: 12px;
  left: 12px;
}

.project-thumb:not(.has-image)::after {
  right: 12px;
  bottom: 12px;
  transform: rotate(180deg);
}

.project-button strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 660;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-button small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-chevron,
.project-button > span.project-chevron[aria-hidden="true"] {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  overflow: visible;
  color: var(--muted);
}

.project-chevron::after {
  display: none !important;
}

.project-chevron svg,
.icon-button svg,
[data-delete-annotation] svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-nav {
  gap: 14px;
  margin-top: 16px;
}

.stage-nav-group {
  gap: 2px;
}

.stage-group-label {
  padding: 0 10px 4px;
  color: #929297;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.stage-link {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 14px;
  gap: 7px;
  min-height: 40px;
  padding: 0 10px;
  color: #5f5f64;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  text-align: left;
}

.stage-link:hover {
  background: rgba(29, 29, 31, 0.035);
}

.stage-link.active {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.025);
}

.stage-link > .stage-index,
.stage-link.active > .stage-index {
  color: #929297;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stage-link.active > .stage-index {
  color: var(--blue);
}

.stage-link > .stage-label,
.stage-link.active > .stage-label {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-link em {
  min-width: 20px;
  padding: 3px 5px;
  color: var(--muted);
  background: #eeeeF0;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  text-align: center;
}

.stage-state {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
}

.stage-link.pending .stage-state::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  background: #c2c2c6;
  border-radius: 50%;
}

.stage-link.done .stage-state::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 4px;
  border-bottom: 1.5px solid var(--green);
  border-left: 1.5px solid var(--green);
  transform: rotate(-45deg);
}

.stage-link.active:not(.done) .stage-state::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(7, 104, 215, 0.12);
}

.rail-footer {
  padding: 13px 8px 0;
}

.topbar {
  min-height: 78px;
  padding: 14px clamp(24px, 3vw, 42px);
  background: rgba(244, 244, 246, 0.88);
}

.topbar h1 {
  margin-top: 4px;
  font-size: clamp(22px, 1.8vw, 27px);
  font-weight: 670;
  letter-spacing: -0.032em;
}

.topbar-copy > p {
  margin-top: 4px;
  font-size: 11px;
}

.lock-state {
  min-height: 42px;
  padding: 5px 10px 5px 6px;
  background: #fff;
  border-color: var(--line);
  border-radius: 10px;
}

.lock-icon {
  position: relative;
  width: 28px;
  height: 28px;
  background: transparent;
  border-radius: 8px;
}

.lock-icon::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--amber);
  border-radius: 50%;
}

.lock-state[data-state="approved"] .lock-icon::before {
  top: 7px;
  left: 8px;
  width: 9px;
  height: 5px;
  border: 0;
  border-bottom: 1.7px solid var(--green);
  border-left: 1.7px solid var(--green);
  border-radius: 0;
  transform: rotate(-45deg);
}

.lock-state[data-state="changed"] .lock-icon::before {
  content: "";
  top: 7px;
  left: 12px;
  width: 2px;
  height: 9px;
  background: var(--amber);
  border: 0;
  border-radius: 2px;
  box-shadow: 0 12px 0 -0.2px var(--amber);
}

.lock-state[data-state="pending"] .lock-icon::before {
  border-color: #a4a4a8;
}

.lock-state strong {
  font-size: 10px;
  font-weight: 650;
}

.lock-state small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.primary-button,
.quiet-button,
.danger-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
}

.primary-button {
  background: var(--blue);
  box-shadow: none;
}

.primary-button:hover:not(:disabled) {
  background: #005ec7;
  transform: none;
}

.stage-content {
  width: min(100%, 1504px);
  margin: 0 auto;
  padding: 24px clamp(24px, 3vw, 42px) 88px;
}

.stage-context {
  display: grid;
  grid-template-columns: 48px minmax(260px, 1fr) minmax(240px, 0.48fr);
  gap: 16px;
  align-items: center;
  min-height: 62px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stage-context-index {
  display: grid;
  align-content: center;
  min-height: 40px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.stage-context-index span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.stage-context-index small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.stage-context-copy,
.stage-context-state {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stage-context-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-context-copy span,
.stage-context-state small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-context-state {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.stage-context-state > span {
  color: var(--amber);
  font-size: 10px;
  font-weight: 650;
}

.stage-context-state.done > span {
  color: var(--green);
}

.stage-context.stage-context-compact {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 50px;
  margin-bottom: 12px;
  padding: 7px 12px;
}

.stage-context-compact .stage-context-index {
  min-height: 34px;
}

.stage-context-compact .stage-context-state {
  min-width: 62px;
}

.panel,
.goal-section,
.creative-profile-panel,
.creative-task-browser,
.generation-decision,
.generation-run-card,
.library-head,
.delivery-gate,
.export-card {
  border-color: var(--line);
  box-shadow: none;
}

.goal-intro,
.creative-brief-card,
.library-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
  padding: 20px 22px;
  border-radius: 16px;
}

.goal-intro h2,
.creative-brief-card h2,
.library-head h2 {
  margin: 5px 0 5px;
  font-size: clamp(20px, 1.8vw, 25px);
  font-weight: 670;
  letter-spacing: -0.035em;
}

.goal-intro p,
.creative-brief-card p,
.library-head p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.goal-intro-system,
.creative-brief-result {
  width: auto;
  padding: 13px 14px;
  background: #f5f5f7;
  border-radius: 11px;
}

.goal-intro-system strong,
.creative-brief-result strong {
  margin: 5px 0 3px;
  font-size: 13px;
}

.goal-section {
  margin-bottom: 10px;
  padding: 18px 20px;
  border-radius: 14px;
}

.goal-section > header {
  margin-bottom: 14px;
}

.goal-section > header > div > span {
  width: 22px;
  height: 22px;
  background: #f0f0f2;
  border-radius: 7px;
}

.goal-section h3,
.creative-task-browser h2 {
  font-size: 14px;
}

.goal-preset-card {
  min-height: 96px;
  padding: 14px;
  background: #fafafb;
  border-radius: 10px;
}

.goal-preset-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
}

.goal-preset-card.active {
  background: var(--blue-soft);
  border-color: rgba(7, 104, 215, 0.38);
  box-shadow: inset 0 0 0 1px rgba(7, 104, 215, 0.15);
}

.goal-claim-card {
  min-height: 68px;
  padding: 12px 13px;
  background: #fafafb;
}

.goal-approval-bar,
.creative-approval-bar {
  position: sticky;
  z-index: 12;
  bottom: 16px;
  border-color: rgba(29, 29, 31, 0.14);
  box-shadow: 0 10px 36px rgba(29, 29, 31, 0.12);
  backdrop-filter: saturate(180%) blur(20px);
}

.uploaded-reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reference-card {
  background: #fff;
  border-radius: 12px;
}

.reference-card img,
.reference-card .upload-preview {
  aspect-ratio: 1.36;
  object-fit: contain;
  background: #f0f0f2;
}

.reference-card .ref-meta {
  padding: 12px;
}

.asset-review-actions {
  grid-template-columns: minmax(56px, 0.8fr) minmax(92px, 1.2fr) 38px;
  gap: 6px;
}

.asset-review-actions button {
  min-height: 38px;
  font-size: 10px;
}

.asset-review-actions .icon-button,
.icon-button {
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
}

.reference-upload-slot {
  min-height: 92px;
  padding: 10px;
  background: #fafafb;
  border-color: #c9c9ce;
  border-radius: 10px;
}

.asset-system-check > summary,
.advanced-panel > summary,
.advanced-product-data > summary,
.advanced-generation-settings > summary,
.advanced-direction-override > summary,
.creative-people-light > summary {
  min-height: 56px;
  padding: 13px 16px;
}

.creative-profile-panel {
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 16px;
}

.creative-profile-panel > header {
  margin-bottom: 14px;
}

.creative-profile-panel > header h2 {
  font-size: 16px;
}

.creative-region-row {
  grid-template-columns: minmax(170px, 0.78fr) minmax(230px, 1.15fr) minmax(200px, 0.92fr);
  padding: 12px;
  background: #f7f7f8;
  border-color: var(--line);
}

.creative-step-heading > span,
.creative-scene-picker > header > div > span {
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
}

.scene-choice-strip {
  grid-auto-columns: 192px;
  gap: 10px;
  padding: 2px 2px 11px;
  scrollbar-color: #c6c6ca transparent;
}

.scene-choice-card {
  border-radius: 11px;
}

.scene-choice-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
}

.scene-choice-card.active {
  border-color: rgba(7, 104, 215, 0.44);
  box-shadow: inset 0 0 0 1px rgba(7, 104, 215, 0.12);
}

.scene-choice-copy strong {
  min-height: 34px;
  line-height: 1.4;
  white-space: normal;
}

.scene-choice-photo {
  height: 88px;
  background-position: center;
  background-size: cover;
}

.scene-route-panel {
  padding: 14px;
  background: #f7f9fc;
  border-color: rgba(7, 104, 215, 0.13);
  border-radius: 12px;
}

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

.creative-route-card {
  grid-template-columns: 130px minmax(0, 1fr) auto;
  min-height: 132px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.creative-route-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.creative-route-card.active {
  background: var(--blue-soft);
  border-color: rgba(7, 104, 215, 0.42);
  box-shadow: inset 0 0 0 1px rgba(7, 104, 215, 0.12);
}

.route-visual {
  min-height: 130px;
  border-radius: 11px 0 0 11px;
}

.creative-route-card > b {
  margin-right: 12px;
  padding: 5px 8px;
  background: #f0f0f2;
  border-radius: 999px;
}

.creative-task-browser {
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 14px;
}

.creative-group-tabs {
  gap: 6px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.creative-group-tabs button {
  min-width: 116px;
}

.creative-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.creative-task-list button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.creative-task-list button:hover {
  background: #fafafb;
}

.creative-task-list button.active {
  background: var(--blue-soft);
  border-color: rgba(7, 104, 215, 0.35);
  box-shadow: none;
}

.generation-decision {
  grid-template-columns: minmax(230px, 0.68fr) minmax(0, 1.32fr);
  padding: 20px;
  color: var(--ink);
  background: #fff;
  border-radius: 16px;
}

.generation-decision-copy .meta-label {
  color: var(--blue);
}

.generation-decision-copy h2 {
  color: var(--ink);
  font-size: 20px;
}

.generation-decision-copy p {
  color: var(--muted);
}

.generation-choice-grid button {
  min-height: 112px;
  color: var(--ink);
  background: #fafafb;
  border-color: var(--line);
}

.generation-choice-grid button:hover {
  border-color: var(--line-strong);
  transform: none;
}

.generation-choice-grid button.active {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: rgba(7, 104, 215, 0.4);
}

.generation-run-card {
  border-radius: 14px;
}

.library-status-filters {
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.library-status-filters button {
  min-height: 48px;
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
}

.library-status-filters button.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.04);
}

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

.review-card {
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.review-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.review-card.selected {
  border-color: rgba(7, 104, 215, 0.5);
  box-shadow: inset 0 0 0 1px rgba(7, 104, 215, 0.16);
}

.review-media {
  aspect-ratio: 1.32;
  background: #eeeef0;
}

.review-body {
  padding: 12px;
}

.selection-board-head,
.candidate-set-focus {
  border-color: var(--line);
  box-shadow: none;
}

.metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-height: 104px;
  padding: 14px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.metric-card strong {
  font-size: 24px;
}

.export-grid {
  gap: 10px;
}

.export-card {
  padding: 18px;
  border-radius: 14px;
}

.image-dialog,
.project-dialog {
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(29, 29, 31, 0.22);
}

.icon-button:hover {
  color: var(--ink);
  background: #f0f0f2;
}

[data-delete-annotation] {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
}

@media (min-width: 1460px) {
  .uploaded-reference-grid,
  .review-grid,
  .candidate-review-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .stage-context {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .stage-context-state {
    grid-column: 2;
    padding: 4px 0 0;
    border: 0;
  }

  .uploaded-reference-grid,
  .review-grid,
  .candidate-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .creative-region-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .creative-product-gate {
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .creative-route-grid,
  .more-story-templates .creative-route-grid {
    grid-template-columns: 1fr;
  }

  .creative-route-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .creative-route-card > b {
    display: none;
  }

  .route-visual {
    min-height: 126px;
  }

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

  .generation-decision {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .side-rail {
    z-index: 80;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 8px 12px 7px;
    background: rgba(250, 250, 251, 0.96);
  }

  .brand-block {
    display: block;
    min-height: 36px;
    padding: 0;
  }

  .brand-block .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-block > div,
  .project-switcher > .meta-label,
  .rail-footer,
  .stage-group-label {
    display: none;
  }

  .project-switcher {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .project-button {
    grid-template-columns: 36px minmax(0, 1fr) 16px;
    min-height: 36px;
    margin: 0;
    padding: 0 6px 0 0;
  }

  .project-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .project-button small {
    -webkit-line-clamp: 1;
  }

  .stage-nav {
    grid-column: 1 / -1;
    gap: 6px;
    padding-top: 1px;
  }

  .stage-nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .stage-link {
    flex: 0 0 auto;
    grid-template-columns: auto auto auto;
    gap: 6px;
    min-height: 38px;
    padding: 0 10px;
  }

  .stage-link .stage-state,
  .stage-link > em {
    display: none;
  }

  .stage-link > .stage-index,
  .stage-link > .stage-label,
  .stage-link.active > .stage-index,
  .stage-link.active > .stage-label {
    overflow: visible;
    font-size: 10px;
    text-overflow: clip;
  }

  .topbar {
    min-height: 66px;
    padding: 11px 14px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .topbar-copy > p {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 38px;
    padding: 0 11px;
    white-space: nowrap;
  }

  .stage-content {
    padding: 14px 12px 80px;
  }

  .stage-context {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    min-height: 58px;
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  .stage-context-copy span,
  .stage-context-state small {
    white-space: normal;
  }

  .stage-context-state {
    display: none;
  }

  .goal-intro,
  .creative-brief-card,
  .library-head {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .goal-intro h2,
  .creative-brief-card h2,
  .library-head h2 {
    font-size: 19px;
  }

  .goal-intro-system,
  .creative-brief-result {
    padding: 11px 12px;
  }

  .goal-preset-grid,
  .goal-claim-grid,
  .goal-two-column,
  .creative-route-grid,
  .uploaded-reference-grid,
  .reference-upload-grid,
  .review-grid,
  .candidate-review-grid,
  .metrics-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .goal-section,
  .creative-profile-panel,
  .creative-task-browser,
  .panel {
    padding: 15px;
  }

  .goal-section > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .creative-region-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .creative-product-gate {
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .scene-choice-strip {
    grid-auto-columns: min(70vw, 190px);
  }

  .creative-route-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .route-visual {
    min-height: 124px;
  }

  .goal-approval-bar,
  .creative-approval-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 8px;
    align-items: center;
    bottom: 10px;
    margin-right: 0;
    margin-left: 0;
    padding: 10px 11px;
  }

  .goal-approval-bar div > small,
  .creative-approval-bar div > small {
    display: none;
  }

  .goal-approval-bar div > strong,
  .creative-approval-bar div > strong {
    overflow: hidden;
    margin-bottom: 0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .goal-approval-bar .goal-approval-actions,
  .goal-approval-bar button,
  .creative-approval-bar button {
    width: 116px;
    min-width: 0;
  }

  .goal-approval-bar .goal-approval-actions {
    display: block;
  }
}

/* Keep the operator flow denser than the legacy review layouts. */
.v2-creative-page .v2-creative-layout { grid-template-columns: 1fr; }
.v2-creative-page .v2-direction-stage > header { min-height: 88px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.v2-creative-page .v2-structural-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 10px 0 14px; padding: 11px 14px; border: 1px solid #dce9fa; border-radius: 12px; background: #f5f9ff; }

/* Readability and click-target closure for the visual-operator path. */
.v2-selling-intro strong,
.v2-listing-brief strong,
.v2-task-instruction strong,
.v2-selling-tier h2,
.v2-selling-copy h3,
.v2-task-main h3,
.v2-creative-brief > div strong { font-size: 15px; }

.v2-selling-intro p,
.v2-listing-brief p,
.v2-task-instruction p,
.v2-selling-copy p,
.v2-task-main p,
.v2-creative-brief dd,
.v2-structural-note span,
.v2-guided-region p { font-size: 12px; line-height: 1.55; }

.v2-selling-tier header p,
.v2-selling-tier header > small,
.v2-selling-copy > small,
.v2-task-main > small,
.v2-task-slot span,
.v2-task-slot small,
.v2-listing-strip article > div:last-child p,
.v2-listing-strip article > div:last-child small,
.v2-creative-brief dt,
.v2-creative-brief > div span,
.v2-creative-brief > div small,
.v2-task-filmstrip span,
.v2-task-filmstrip i,
.v2-guided-region > header > span { font-size: 11px; }

.v2-tier-switch button,
.v2-guided-region .v2-region-filter button { min-height: 36px; font-size: 12px; }

.v2-channel-task-row .v2-task-actions > button,
.v2-channel-task-row > .primary-button,
.v2-selling-controls .v2-card-actions > button { min-height: 38px; }

.v2-listing-strip article > label,
.v2-slot-canvas i { font-size: 10px; }

.v2-listing-strip article > div:last-child strong,
.v2-task-filmstrip strong,
.v2-structural-note strong,
.v2-guided-region h3 { font-size: 13px; }

/* Persistent, honest generation feedback. Providers do not expose a reliable percent. */
.generation-live-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(260px, .9fr) auto;
  align-items: center;
  gap: 16px 22px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #d7e7fb;
  border-radius: 16px;
  background: #f7fbff;
  box-shadow: 0 8px 24px rgba(23, 78, 140, .06);
}
.generation-live-copy { display: grid; gap: 3px; min-width: 0; }
.generation-live-copy > span { color: #0877dd; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.generation-live-copy > strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.generation-live-copy > small,
.generation-live-actions > small { color: #687386; font-size: 11px; line-height: 1.45; }
.generation-live-progress {
  position: relative;
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceafb;
}
.generation-live-progress > i { position: absolute; inset: 0; border-radius: inherit; background: #087cf0; transform-origin: left; }
.generation-live-panel.is-active .generation-live-progress > i { width: 38%; animation: generation-progress 1.8s ease-in-out infinite alternate; }
.generation-live-panel.is-complete { border-color: #d9e8df; background: #f7fbf8; }
.generation-live-panel.is-complete .generation-live-progress { background: #dcece2; }
.generation-live-panel.is-complete .generation-live-progress > i { width: 100%; background: #238452; }
.generation-live-steps { display: flex; grid-column: 1 / 3; gap: 8px; margin: 0; padding: 0; list-style: none; }
.generation-live-steps li { color: #8a94a4; font-size: 11px; white-space: nowrap; }
.generation-live-steps li + li::before { content: "›"; margin-right: 8px; color: #b8c0cb; }
.generation-live-steps li.done { color: #1873c8; font-weight: 650; }
.generation-live-panel.is-complete .generation-live-steps li.done { color: #27764d; }
.generation-live-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
@keyframes generation-progress { from { transform: translateX(-18%); } to { transform: translateX(182%); } }

@media (max-width: 760px) {
  .generation-live-panel { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .generation-live-progress,
  .generation-live-steps { grid-column: 1; }
  .generation-live-steps { overflow-x: auto; padding-bottom: 2px; }
  .generation-live-actions { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .generation-live-panel.is-active .generation-live-progress > i { animation: none; width: 55%; }
}
