:root {
  --ink: #191b1a;
  --muted: #6c716e;
  --subtle: #969b98;
  --line: #dfe3df;
  --line-strong: #cbd1cc;
  --canvas: #f2f4f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --charcoal: #222624;
  --coral: #c84f62;
  --coral-soft: #f8e8eb;
  --teal: #286b70;
  --teal-soft: #e1f0ef;
  --amber: #9a6617;
  --amber-soft: #f7edd8;
  --green: #28704a;
  --green-soft: #dff0e7;
  --blue: #315d90;
  --blue-soft: #e5edf7;
  --danger: #a63d3d;
  --danger-soft: #f8e5e3;
  --sidebar: 216px;
  --topbar: 68px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  padding: 9px 10px;
  outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(40, 107, 112, .12); }
button:focus-visible { outline: 3px solid rgba(40, 107, 112, .22); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.25; }
h3 { font-size: 14px; line-height: 1.3; }
small { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  height: 100vh;
}
.sidebar {
  grid-row: 1 / 3;
  background: var(--charcoal);
  color: #f8f9f7;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 12px 14px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #f8f9f7;
  color: var(--charcoal);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}
.brand-mark.large { width: 52px; height: 52px; background: var(--charcoal); color: #fff; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { color: #acb2ae; font-size: 11px; }
.primary-nav { display: grid; gap: 4px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #cbd0cc;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 6px;
  text-align: left;
}
.nav-item:hover { background: #2d3230; color: #fff; }
.nav-item.is-active { background: #f5f6f4; color: var(--ink); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-item span { font-size: 13px; font-weight: 650; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 12px 9px 2px; border-top: 1px solid #393e3b; }
.sidebar-foot > div { display: grid; gap: 1px; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot span { color: #9da4a0; font-size: 10px; }
.health-dot, .presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.health-dot.is-healthy, .presence-dot { background: #45aa72; }
.health-dot.is-error { background: #e07171; }

.topbar {
  grid-column: 2;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  min-width: 0;
}
.topbar-title { display: grid; gap: 2px; }
.topbar-title > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .avatar-button, .send-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.icon-button:hover, .avatar-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.icon-button svg, .send-button svg { width: 17px; height: 17px; }
.avatar-button { border-radius: 50%; background: var(--coral-soft); border-color: transparent; color: var(--coral); font-size: 11px; font-weight: 800; }
.context-button {
  min-height: 38px;
  max-width: 260px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 5px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  text-align: left;
  column-gap: 8px;
}
.context-label { grid-column: 1; font-size: 9px; color: var(--muted); text-transform: uppercase; }
.context-button strong { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.context-button svg { grid-column: 2; grid-row: 1 / 3; width: 14px; align-self: center; }
.mobile-nav-button { display: none; }
.user-menu { position: relative; }
.user-popover {
  position: absolute;
  right: 0;
  top: 44px;
  width: 180px;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(21, 28, 24, .12);
  padding: 12px;
  display: grid;
  gap: 4px;
}
.user-popover span { color: var(--muted); font-size: 11px; }
.text-command { border: 0; background: transparent; color: var(--coral); padding: 8px 0 0; text-align: left; font-size: 12px; }

.workspace { grid-column: 2; min-width: 0; min-height: 0; overflow: hidden; }
.app-view { display: none; height: 100%; min-height: 0; }
.app-view.is-active { display: flex; flex-direction: column; }
.view-toolbar {
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-soft);
}
.toolbar-spacer { flex: 1; }
.segmented-control { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 2px; }
.segmented-control button, .plan-tabs button {
  border: 0;
  background: transparent;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.segmented-control button.is-active, .plan-tabs button.is-active { background: var(--charcoal); color: #fff; }
.segmented-control svg { width: 15px; height: 15px; }
.search-control { width: min(240px, 30vw); position: relative; }
.search-control svg { position: absolute; width: 15px; left: 9px; top: 10px; color: var(--muted); }
.search-control input { padding-left: 31px; min-height: 36px; }
.primary-button, .secondary-button, .danger-button {
  min-height: 36px;
  border-radius: 5px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.primary-button { color: #fff; background: var(--charcoal); border: 1px solid var(--charcoal); }
.primary-button:hover { background: #090b0a; }
.secondary-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }
.secondary-button:hover { background: var(--surface-soft); }
.danger-button { color: var(--danger); background: var(--surface); border: 1px solid #dfb8b4; }
.danger-button:hover { background: var(--danger-soft); }
.primary-button svg, .secondary-button svg, .danger-button svg { width: 15px; height: 15px; }
.full-width { width: 100%; }

.studio-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; flex: 1; }
.record-list { min-width: 0; border-right: 1px solid var(--line); background: var(--surface-soft); display: flex; flex-direction: column; }
.list-heading { min-height: 42px; padding: 0 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.list-heading span { color: var(--muted); }
.list-body { overflow: auto; padding: 7px; display: grid; align-content: start; gap: 5px; }
.sku-list-item {
  width: 100%; min-height: 72px; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 9px;
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 9px; text-align: left;
}
.sku-list-item:hover { background: var(--surface); border-color: var(--line); }
.sku-list-item.is-active { background: var(--surface); border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(20, 26, 23, .05); }
.sku-thumb { width: 46px; height: 52px; object-fit: cover; border-radius: 4px; background: #e8ebe8; }
.sku-item-copy { display: grid; min-width: 0; align-content: center; gap: 4px; }
.sku-item-copy > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sku-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sku-item-copy span, .sku-item-copy small { font-size: 10px; }
.record-detail { overflow: auto; background: var(--surface); min-width: 0; }
.empty-detail { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); }
.empty-detail svg { width: 30px; height: 30px; }
.empty-detail strong { color: var(--ink); font-size: 14px; }
.empty-detail span { font-size: 11px; }
.detail-heading { padding: 18px 22px 12px; display: flex; justify-content: space-between; gap: 16px; }
.record-type { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.detail-heading h2 { margin-top: 4px; }
.detail-heading-actions { display: flex; align-items: center; gap: 8px; }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; border-radius: 999px; padding: 0 8px; font-size: 10px; font-weight: 750; background: var(--surface-soft); color: var(--muted); }
.status-badge.ready, .status-badge.approved, .status-badge.complete { background: var(--green-soft); color: var(--green); }
.status-badge.blocked, .status-badge.failed { background: var(--danger-soft); color: var(--danger); }
.status-badge.review { background: var(--amber-soft); color: var(--amber); }
.status-badge.running { background: var(--blue-soft); color: var(--blue); }
.pipeline-rail { list-style: none; margin: 0; padding: 10px 22px 15px; display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); overflow-x: auto; }
.pipeline-rail li { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 7px; min-width: 100px; }
.pipeline-rail li::after { content: ""; position: absolute; left: 25px; right: -1px; top: 11px; height: 1px; background: var(--line-strong); }
.pipeline-rail li:last-child::after { display: none; }
.pipeline-rail li > span { position: relative; z-index: 1; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 9px; }
.pipeline-rail li strong { align-self: end; font-size: 10px; }
.pipeline-rail li small { grid-column: 2; font-size: 9px; white-space: nowrap; }
.pipeline-rail li.is-complete > span { background: var(--green); border-color: var(--green); color: #fff; }
.pipeline-rail li.is-current > span { border-color: var(--coral); color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.pipeline-rail li.is-blocked strong { color: var(--muted); }
.sku-summary-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-soft); padding: 11px 22px; }
.sku-summary-band dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 14px; }
.sku-summary-band div { min-width: 0; }
.sku-summary-band dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.sku-summary-band dd { margin: 3px 0 0; font-size: 11px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-workbench { padding: 16px 22px 28px; display: grid; gap: 20px; }
.media-section { display: grid; gap: 10px; }
.section-heading { min-height: 38px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading > div { display: grid; gap: 2px; }
.section-heading span { color: var(--muted); font-size: 10px; }
.media-placeholder { position: relative; background: #eef0ed; border: 1px dashed var(--line-strong); border-radius: 6px; min-height: 140px; display: grid; place-items: center; color: var(--subtle); overflow: hidden; }
.media-placeholder img, .media-placeholder video { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder svg { width: 23px; height: 23px; }
.single-preview { width: min(320px, 100%); aspect-ratio: 1 / 1; }
.three-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.three-preview-grid > div { aspect-ratio: 4 / 5; min-height: 0; }
.three-preview-grid span { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.video-preview { width: min(300px, 100%); aspect-ratio: 9 / 16; }
.preview-action { position: absolute; left: 8px; right: 8px; bottom: 8px; min-height: 34px; border: 1px solid rgba(255,255,255,.72); border-radius: 5px; background: rgba(20,24,23,.88); color: #fff; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; backdrop-filter: blur(8px); }
.preview-action svg { width: 15px; height: 15px; }
.preview-action.is-approved { background: rgba(21,103,76,.92); cursor: default; }
.preview-revise { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.75); border-radius: 5px; background: rgba(20,24,23,.82); color: #fff; display: grid; place-items: center; padding: 0; backdrop-filter: blur(8px); }
.preview-revise:hover { background: rgba(20,24,23,.96); }
.preview-revise svg { width: 15px; height: 15px; }
.version-strip { min-height: 30px; display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.version-chip { flex: 0 0 auto; min-width: 46px; min-height: 28px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--muted); padding: 4px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 9px; font-weight: 750; }
.version-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.version-chip.is-active { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.version-chip.is-complete::before { background: var(--green); }
.version-chip.is-running::before { background: var(--blue); }
.version-chip.is-failed::before { background: var(--danger); }

.director-context-bar { min-height: 58px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); display: flex; align-items: end; gap: 10px; }
.director-context-bar label { display: grid; gap: 3px; width: min(230px, 22vw); color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.director-context-bar select { min-height: 36px; color: var(--ink); text-transform: none; font-size: 11px; }
.campaign-progress { margin-left: auto; width: min(260px, 26vw); display: grid; gap: 5px; }
.campaign-progress > span { display: block; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.campaign-progress > span::after { content: ""; display: block; width: var(--progress, 0%); height: 100%; background: var(--teal); }
.campaign-progress strong { color: var(--muted); font-size: 9px; }
.director-layout { display: grid; grid-template-columns: minmax(330px, 42%) minmax(0, 1fr); min-height: 0; flex: 1; }
.creative-chat-pane, .live-plan-pane { min-width: 0; min-height: 0; background: var(--surface); display: flex; flex-direction: column; }
.creative-chat-pane { border-right: 1px solid var(--line); }
.pane-heading { min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pane-heading > div { display: flex; align-items: center; gap: 8px; }
.pane-heading strong { font-size: 12px; }
.creative-chat { flex: 1; min-height: 0; overflow: auto; padding: 15px; display: flex; flex-direction: column; gap: 11px; }
.chat-message { max-width: 86%; display: grid; gap: 3px; }
.chat-message.is-user { align-self: end; }
.chat-message.is-assistant { align-self: start; }
.chat-message small { font-size: 9px; }
.chat-message.is-user small { text-align: right; }
.message-bubble { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: var(--surface-soft); font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.chat-message.is-user .message-bubble { background: var(--teal-soft); border-color: #c5dfdc; }
.chat-empty { margin: auto; width: min(300px, 90%); display: grid; gap: 8px; text-align: center; color: var(--muted); font-size: 11px; }
.chat-empty strong { color: var(--ink); font-size: 13px; }
.chat-composer { margin: 0 12px 12px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px; display: flex; align-items: end; gap: 7px; background: var(--surface); }
.chat-composer:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(40,107,112,.1); }
.chat-composer textarea { min-height: 48px; max-height: 120px; border: 0; box-shadow: none; padding: 4px; }
.send-button { flex: 0 0 auto; background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.plan-heading > div:first-child { display: grid; gap: 2px; }
.plan-heading span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.plan-heading strong { font-size: 13px; }
.plan-actions { display: flex !important; gap: 7px; }
.plan-tabs { min-height: 43px; padding: 6px 12px; display: flex; align-items: center; gap: 3px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.plan-scroll { flex: 1; min-height: 0; overflow: auto; padding: 15px; }
.plan-panel { display: none; }
.plan-panel.is-active { display: grid; gap: 13px; }
.plan-field { display: grid; gap: 5px; }
.plan-field label, .app-dialog label, .two-column-fields > label { color: var(--muted); font-size: 10px; font-weight: 700; }
.plan-field textarea { font-size: 11px; background: var(--surface-soft); }
.plan-field textarea:disabled { color: var(--ink); opacity: 1; border-color: var(--line); }
.two-column-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.shot-plan-list, .beat-list { display: grid; gap: 10px; }
.shot-row, .beat-row { border: 1px solid var(--line); border-radius: 6px; padding: 11px; display: grid; gap: 8px; background: var(--surface-soft); }
.shot-row header, .beat-row header { display: flex; justify-content: space-between; gap: 8px; }
.shot-row header strong, .beat-row header strong { font-size: 11px; }
.shot-row header span, .beat-row header span { color: var(--muted); font-size: 9px; }
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; font-size: 10px; }
.shot-grid div { min-width: 0; }
.shot-grid span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.shot-grid strong { display: block; margin-top: 2px; font-size: 10px; font-weight: 550; line-height: 1.35; }
.video-plan-summary { border-bottom: 1px solid var(--line); padding-bottom: 12px; display: grid; gap: 8px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.summary-grid div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; padding: 8px; }
.summary-grid span { color: var(--muted); display: block; font-size: 8px; text-transform: uppercase; }
.summary-grid strong { display: block; margin-top: 3px; font-size: 10px; line-height: 1.35; }

.filter-row { display: flex; gap: 8px; }
.filter-row select { min-width: 145px; }
.source-health-strip { min-height: 38px; border-bottom: 1px solid var(--line); background: var(--surface-soft); padding: 7px 18px; display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.source-health-item { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 5px 7px; display: flex; align-items: center; gap: 6px; font-size: 9px; }
.source-health-item::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.source-health-item.is-error::before { background: var(--danger); }
.source-health-item.is-empty::before { background: var(--amber); }
.source-health-item span { color: var(--muted); }
.trend-gallery { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-content: start; gap: 11px; }
.trend-gallery.is-list { display: grid; grid-template-columns: 1fr; }
.trend-card { color: var(--ink); text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; display: grid; grid-template-rows: 150px auto; }
.trend-card:hover { border-color: var(--line-strong); box-shadow: 0 5px 16px rgba(20, 28, 23, .08); }
.trend-gallery.is-list .trend-card { grid-template-columns: 160px minmax(0, 1fr); grid-template-rows: 120px; }
.trend-poster { background: #e6e9e5; overflow: hidden; }
.trend-poster img { width: 100%; height: 100%; object-fit: cover; }
.trend-copy { padding: 10px; display: grid; gap: 6px; align-content: start; }
.trend-copy header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trend-tags { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.platform-tag { color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 3px 6px; font-size: 8px; font-weight: 750; }
.reference-type { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 5px; font-size: 8px; font-weight: 700; }
.trend-copy strong { font-size: 11px; line-height: 1.35; }
.trend-copy p { color: var(--muted); font-size: 9px; line-height: 1.4; }
.trend-data-row { margin-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 8px; }
.data-verification-badge { width: fit-content; border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px; font-size: 8px; font-weight: 750; white-space: nowrap; }
.data-verification-badge.is-official { color: #176a45; border-color: #8dcdb1; background: #e4f6ed; }
.data-verification-badge.is-platform { color: #12646b; border-color: #96cfd1; background: #e7f5f5; }
.data-verification-badge.is-auth { color: #845716; border-color: #dfc48f; background: #fff6df; }
.data-verification-badge.is-unverified { color: var(--muted); background: var(--surface-soft); }
.empty-gallery { grid-column: 1 / -1; padding: 70px 20px; text-align: center; color: var(--muted); font-size: 11px; }

.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; flex: 1; }
.admin-nav { border-right: 1px solid var(--line); background: var(--surface-soft); padding: 10px; display: grid; align-content: start; gap: 4px; }
.admin-nav button { min-height: 38px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 9px; padding: 0 10px; font-size: 11px; text-align: left; }
.admin-nav button.is-active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.admin-nav svg { width: 15px; height: 15px; }
.admin-content { overflow: auto; padding: 16px 20px 40px; background: var(--surface); }
.admin-panel { display: none; max-width: 980px; }
.admin-panel.is-active { display: grid; gap: 15px; }
.provider-table, .job-table, .service-list, .prompt-editor-list { display: grid; gap: 8px; }
.provider-row, .job-row, .service-row, .prompt-editor { min-height: 48px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); padding: 9px 11px; display: grid; align-items: center; gap: 8px; }
.provider-row { grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr) auto; }
.provider-row label { display: grid; gap: 2px; }
.provider-row label span, .prompt-editor label span, .config-version-row span { color: var(--subtle); font-size: 11px; }
.provider-row input { width: 100%; min-width: 0; }
.provider-row { grid-template-columns: 150px minmax(120px, 1fr) 100px; }
.provider-row strong, .service-row strong, .job-row strong { font-size: 11px; }
.provider-row span, .service-row span, .job-row span { color: var(--muted); font-size: 9px; }
.service-row { grid-template-columns: 16px minmax(0, 1fr) auto; }
.service-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.job-row { grid-template-columns: 45px minmax(100px, 1fr) 100px 100px; }
.prompt-editor textarea { margin-top: 7px; }
.prompt-editor label { display: grid; gap: 2px; }
.config-history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.section-heading.compact { margin-bottom: 8px; }
.section-heading.compact h3 { font-size: 13px; }
.config-version-list { display: grid; gap: 6px; }
.config-version-row { min-height: 46px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 6px 2px; }
.config-version-row > div { display: grid; gap: 2px; }
.compact-button { min-height: 32px; padding: 5px 8px; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--canvas); }
.login-panel { width: min(380px, 100%); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 28px; box-shadow: 0 18px 50px rgba(20, 28, 23, .09); display: grid; gap: 16px; }
.login-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.login-panel h1 { margin-top: 3px; font-size: 24px; }
.login-panel form { display: grid; gap: 7px; }
.login-panel label { color: var(--muted); font-size: 10px; font-weight: 700; margin-top: 4px; }
.form-error { min-height: 17px; color: var(--danger); font-size: 10px; }
.app-dialog { width: min(520px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0; box-shadow: 0 24px 70px rgba(16, 23, 19, .22); }
.app-dialog::backdrop { background: rgba(20, 24, 22, .46); }
.wide-dialog { width: min(680px, calc(100vw - 28px)); }
.app-dialog form { padding: 16px; display: grid; gap: 8px; }
.trend-detail-shell { padding: 16px; display: grid; gap: 13px; }
.trend-detail-grid { display: grid; grid-template-columns: minmax(180px, 42%) minmax(0, 1fr); gap: 14px; }
.trend-detail-poster { aspect-ratio: 4 / 5; max-height: 430px; border: 1px solid var(--line); border-radius: 6px; background: #e6e9e5; display: grid; place-items: center; overflow: hidden; }
.trend-detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.trend-detail-poster svg { width: 28px; color: var(--subtle); }
.trend-detail-data { min-width: 0; display: grid; gap: 13px; align-content: start; }
.trend-verification-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); padding: 9px; display: grid; gap: 8px; }
.trend-evidence-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
.trend-evidence-details div { min-width: 0; }
.trend-evidence-details span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.trend-evidence-details strong { display: block; margin-top: 2px; overflow-wrap: anywhere; font-size: 9px; font-weight: 600; }
.trend-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.trend-metric-grid div { border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); padding: 8px; }
.trend-metric-grid span, .field-kicker { display: block; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.trend-metric-grid strong { display: block; margin-top: 3px; font-size: 11px; }
.mechanics-list { margin-top: 6px; display: grid; gap: 5px; }
.mechanic-option { min-height: 34px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 10px; }
.mechanic-option input { width: 14px; height: 14px; padding: 0; }
.trend-detail-note { color: var(--muted); font-size: 10px; line-height: 1.45; }
.external-link { color: var(--teal); font-size: 10px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.external-link svg { width: 13px; height: 13px; }
.trend-dialog-actions { margin-top: 2px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dialog-heading span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.dialog-heading h2 { margin-top: 3px; }
.dialog-actions { border-top: 1px solid var(--line); margin: 8px -16px -16px; padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-soft); }
.revision-agent, .live-status-dock { position: fixed; z-index: 90; width: min(390px, calc(100vw - 28px)); border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); box-shadow: 0 18px 52px rgba(16,23,19,.2); overflow: hidden; }
.revision-agent { right: 18px; bottom: 18px; }
.revision-agent > header, .live-status-dock > header { min-height: 54px; padding: 9px 11px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.revision-agent > header > div, .live-status-dock > header > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.revision-agent header div div, .live-status-dock header div div { display: grid; gap: 2px; min-width: 0; }
.revision-agent header strong, .live-status-dock header strong { font-size: 11px; }
.revision-agent header small, .live-status-dock header small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.revision-agent-body { padding: 12px; display: grid; gap: 9px; }
.revision-agent-body > p { font-size: 11px; line-height: 1.45; }
.agent-proposal { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 5px; background: var(--surface-soft); padding: 9px; display: grid; gap: 5px; }
.agent-proposal > span { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.agent-proposal strong { font-size: 10px; line-height: 1.4; }
.agent-proposal p { color: var(--muted); font-size: 9px; line-height: 1.45; white-space: pre-wrap; }
.revision-agent > footer { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-soft); display: flex; justify-content: flex-end; gap: 7px; }
.live-status-dock { left: calc(var(--sidebar) + 18px); bottom: 18px; }
.live-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.live-progress-track { height: 4px; background: var(--line); }
.live-progress-track span { display: block; width: 8%; height: 100%; background: var(--teal); transition: width .25s ease; }
.live-status-copy { padding: 10px 12px 8px; display: grid; gap: 3px; }
.live-status-copy strong { font-size: 11px; }
.live-status-copy span { color: var(--muted); font-size: 9px; }
.live-timeline { max-height: 78px; overflow: auto; padding: 0 12px 10px; display: grid; gap: 4px; }
.live-timeline div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 7px; color: var(--muted); font-size: 8px; }
.live-timeline strong { color: var(--ink); font-size: 8px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 7px; width: min(360px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line-strong); border-left: 3px solid var(--teal); border-radius: 5px; background: var(--surface); box-shadow: 0 9px 28px rgba(20,28,23,.16); padding: 10px 12px; display: grid; gap: 3px; }
.toast.is-error { border-left-color: var(--danger); }
.toast strong { font-size: 11px; }
.toast span { color: var(--muted); font-size: 10px; line-height: 1.4; }

@media (max-width: 980px) {
  :root { --sidebar: 72px; }
  .brand-copy, .nav-item span, .sidebar-foot > div { display: none; }
  .brand-lockup { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .studio-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .director-layout { grid-template-columns: minmax(300px, 44%) minmax(0, 1fr); }
  .pipeline-rail { grid-template-columns: repeat(6, 110px); }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100vh; padding-top: 58px; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 224px; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 10px 0 30px rgba(16,23,19,.2); }
  .sidebar.is-open { transform: translateX(0); }
  .brand-copy, .nav-item span, .sidebar-foot > div { display: grid; }
  .nav-item { justify-content: flex-start; padding: 0 11px; }
  .topbar { position: fixed; z-index: 50; inset: 0 0 auto 0; height: 58px; padding: 0 10px; }
  .topbar-title > span { display: none; }
  .topbar-title h1 { font-size: 16px; }
  .mobile-nav-button { display: inline-grid; order: -1; }
  .context-button { max-width: 138px; }
  .workspace { min-height: calc(100vh - 58px); }
  .app-view { min-height: calc(100vh - 58px); }
  .view-toolbar { padding: 8px 10px; overflow-x: auto; }
  .search-control { min-width: 150px; width: 150px; }
  .primary-button span, .secondary-button.compact-label span { display: none; }
  .studio-layout { display: block; }
  .record-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .list-body { grid-auto-flow: column; grid-auto-columns: 210px; overflow-x: auto; }
  .record-detail { min-height: 620px; overflow: visible; }
  .detail-heading, .pipeline-rail, .sku-summary-band, .media-workbench { padding-left: 12px; padding-right: 12px; }
  .sku-summary-band dl { grid-template-columns: repeat(2, 1fr); }
  .three-preview-grid { grid-template-columns: repeat(3, 72vw); overflow-x: auto; }
  .director-context-bar { overflow-x: auto; align-items: end; padding: 8px 10px; }
  .director-context-bar label { min-width: 170px; width: 170px; }
  .campaign-progress { min-width: 180px; width: 180px; }
  .director-layout { display: block; }
  .creative-chat-pane { border-right: 0; height: 56vh; border-bottom: 1px solid var(--line); }
  .live-plan-pane { min-height: 72vh; }
  .plan-actions .secondary-button span, .plan-actions .primary-button span { display: none; }
  .trend-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .source-health-strip { padding-inline: 10px; }
  .trend-detail-grid { grid-template-columns: 1fr; }
  .trend-detail-poster { max-height: 280px; }
  .trend-dialog-actions { flex-wrap: wrap; }
  .admin-layout { display: block; }
  .admin-nav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .admin-nav button { min-width: max-content; }
  .admin-content { padding: 12px 10px 30px; }
  .provider-row { grid-template-columns: 1fr; }
  .job-row { grid-template-columns: 40px minmax(0, 1fr); }
  .job-row > :nth-child(n+3) { display: none; }
  .two-column-fields, .summary-grid, .shot-grid { grid-template-columns: 1fr; }
  .revision-agent, .live-status-dock { left: 14px; right: 14px; width: auto; }
  .revision-agent { bottom: 14px; }
  .live-status-dock { bottom: 14px; }
}

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