@import url("/static/fonts.css");
:root {
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #dbe2ea;
  --line-strong: #c5ced9;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-blue: #eff6ff;
  --blue: #1667d9;
  --blue-deep: #0d4faa;
  --green: #16845b;
  --green-soft: #e9f8f1;
  --orange: #a85b08;
  --orange-soft: #fff7e8;
  --red: #bd2c2c;
  --red-soft: #fff0f0;
  --sidebar: #101522;
  --sidebar-muted: #9da9ba;
  --shadow: 0 10px 30px rgba(31, 42, 68, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 16px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
.monthly-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.monthly-period select { width: auto; min-width: 180px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.monthly-downloads { margin-top: 24px; justify-content: flex-start; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--surface-soft); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 244px;
  flex-direction: column;
  background: var(--sidebar);
  color: #fff;
  border-right: 1px solid #20293a;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; height: 82px; padding: 0 24px; border-bottom: 1px solid #263043; }
.brand-lockup > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup strong { font-size: 18px; }
.brand-lockup small { margin-top: 4px; color: var(--sidebar-muted); font-size: 12px; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 6px; background: #2777ea; font-weight: 800; }
.main-nav { display: grid; gap: 5px; padding: 24px 14px; }
.main-nav a, .sidebar-foot a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; border-radius: 6px; color: var(--sidebar-muted); font-size: 14px; font-weight: 650; }
.main-nav a:hover, .sidebar-foot a:hover { color: #fff; background: #1a2333; }
.main-nav a.active, .sidebar-foot a.active { color: #fff; background: #223454; box-shadow: inset 3px 0 0 #4b96ff; }
.sidebar-foot { display: grid; gap: 13px; margin-top: auto; padding: 18px 14px 22px; border-top: 1px solid #263043; }
.sidebar-foot > span { padding: 0 13px; color: #728095; font-size: 11px; }

.main-content { min-height: 100vh; margin-left: 244px; padding: 42px clamp(28px, 4vw, 64px) 72px; }
.mobile-header { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 4px 0 7px; max-width: 920px; font-size: 32px; line-height: 1.16; }
.page-head p { margin: 0; max-width: 850px; color: var(--muted); line-height: 1.5; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.breadcrumb { display: flex; gap: 8px; margin: -10px 0 18px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--blue); }
.head-actions, .action-buttons, .card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.head-actions form, .action-buttons form { margin: 0; }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.button { min-height: 40px; gap: 8px; padding: 0 15px; border-radius: 5px; font-size: 13px; white-space: nowrap; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-deep); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.button.secondary:hover { border-color: #8998aa; background: #f9fafb; }
.button.ghost { color: var(--blue); background: transparent; border-color: #b9d5fa; }
.button.ghost:hover { background: var(--surface-blue); }
.button.danger { color: var(--red); background: #fff; border-color: #efb4b4; }
.icon-button { width: 38px; height: 38px; padding: 0; border-radius: 5px; color: var(--ink-soft); background: #fff; border-color: var(--line); }
.text-link { color: var(--blue); font-size: 13px; font-weight: 750; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin: -16px 0 24px; padding: 12px 15px; border: 1px solid; border-radius: 5px; font-size: 13px; line-height: 1.45; }
.notice.success { color: #126344; background: var(--green-soft); border-color: #a7dfc7; }
.notice.error { color: #972424; background: var(--red-soft); border-color: #efb4b4; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { min-height: 132px; padding: 22px 24px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.kpi strong { display: block; font-size: 31px; line-height: 1; }
.kpi strong.kpi-date { font-size: 23px; line-height: 1.2; }
.kpi small { display: block; margin-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.kpi.emphasis { background: var(--surface-blue); }
.kpi.emphasis strong { color: var(--blue); }

.panel { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 3px 14px rgba(31, 42, 68, .04); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .data-table th:first-child, .panel.flush .data-table td:first-child { padding-left: 24px; }
.panel.flush .data-table th:last-child, .panel.flush .data-table td:last-child { padding-right: 24px; }
.section-block { margin-top: 32px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2, .action-strip h2, .run-callout h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.section-head p, .action-strip p, .run-callout p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 820px; }
.data-table th { height: 42px; padding: 0 14px; color: #536174; background: #f1f4f8; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); font-size: 10px; font-weight: 800; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px; border-bottom: 1px solid #e8edf2; color: var(--ink-soft); font-size: 13px; line-height: 1.35; vertical-align: middle; }
.data-table tbody tr:nth-child(even) td { background: #fbfcfd; }
.data-table tbody tr:hover td { background: #f3f7fc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table.compact td { padding-top: 11px; padding-bottom: 11px; }
.cell-title { display: block; max-width: 440px; color: var(--ink); font-weight: 750; }
.cell-title:hover { color: var(--blue); }
.data-table td small, .data-table td .muted-line { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.row-action { width: 54px; text-align: right; }
.row-action .icon-button { margin-left: auto; }
.muted { color: var(--muted); }

.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 800; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.status.ready, .status.completed { color: #116343; background: var(--green-soft); }
.status.warning, .status.queued { color: var(--orange); background: var(--orange-soft); }
.status.running { color: #0b57b5; background: #e8f2ff; }
.status.failed, .status.cancelled, .status.interrupted { color: var(--red); background: var(--red-soft); }
.chip-row, .topic-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .topic-list span { display: inline-flex; padding: 5px 8px; border: 1px solid #d7e0ea; border-radius: 4px; color: #425168; background: #f8fafc; font-size: 11px; }

.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 5px; }
.empty-state.compact { padding: 26px 18px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }

.study-list { display: grid; gap: 12px; }
.study-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: center; gap: 28px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.study-row:hover { border-color: #aab7c7; box-shadow: var(--shadow); }
.study-main h2 { margin: 10px 0 4px; max-width: 780px; font-size: 17px; }
.study-main h2 a:hover { color: var(--blue); }
.study-main p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.study-facts { display: grid; grid-template-columns: repeat(3, minmax(92px, auto)); gap: 24px; margin: 0; }
.study-facts div { min-width: 90px; }
.study-facts dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.study-facts dd { margin: 7px 0 0; color: var(--ink); font-size: 15px; font-weight: 750; }

.run-callout { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 24px; padding: 24px 26px; border: 1px solid #b9d5fa; border-left: 4px solid var(--blue); border-radius: 5px; background: #f7fbff; }
.run-form { display: flex; align-items: flex-end; gap: 10px; }
.run-form label { color: var(--muted); font-size: 11px; font-weight: 750; }
.run-form input { display: block; min-height: 40px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.run-form label small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }

.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.brand-card { padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.brand-card-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.brand-card h3 { margin: 0; font-size: 16px; }
.brand-card h3 a:hover { color: var(--blue); }
.brand-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 5px; color: #fff; background: #1f6ed8; font-weight: 800; }
.avatar.large { width: 52px; height: 52px; font-size: 21px; }
.brand-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brand-metrics div { padding: 13px 10px 13px 0; }
.brand-metrics span { display: block; color: var(--muted); font-size: 10px; }
.brand-metrics strong { display: block; margin-top: 5px; font-size: 17px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.two-column > .panel { min-width: 0; }
.brand-title { display: flex; align-items: center; gap: 15px; }

.action-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 0; padding: 18px 20px; border: 1px solid var(--line); background: #fff; }
.brand-detail-grid .panel { margin-top: 0; }
.subhead { margin: 24px 0 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.entity-list { display: grid; }
.entity-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.entity-list > div:last-child { border-bottom: 0; }
.entity-list span { color: var(--muted); }
.deliverable-list { display: grid; }
.deliverable-list > div { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.deliverable-list > div > svg { color: var(--blue); }
.deliverable-list strong, .deliverable-list span { display: block; }
.deliverable-list span { margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.definition-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 20px 0 0; border-top: 1px solid var(--line); }
.definition-list div { padding: 13px 8px 8px 0; }
.definition-list dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.definition-list dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; }

.toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.toolbar.split { justify-content: space-between; }
.search-field, .select-field { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.search-field input, .select-field select { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; text-transform: none; }
.search-field input { width: min(420px, 70vw); padding: 0 12px; }
.select-field select { min-width: 170px; padding: 0 34px 0 10px; }
.mini-progress { width: 110px; height: 5px; overflow: hidden; border-radius: 3px; background: #dfe6ee; }
.mini-progress i { display: block; height: 100%; background: var(--blue); }

.job-status { padding: 22px 24px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.job-status-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.job-status-head strong { font-size: 13px; }
.progress-track { height: 9px; margin-top: 18px; overflow: hidden; border-radius: 5px; background: #e5eaf0; }
.progress-track i { display: block; height: 100%; background: var(--blue); transition: width .25s ease; }
.job-meta { display: flex; flex-wrap: wrap; gap: 30px; margin: 20px 0 0; }
.job-meta div { min-width: 100px; }
.job-meta dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.job-meta dd { margin: 4px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.terminal-panel { margin-top: 20px; overflow: hidden; border: 1px solid #263246; border-radius: 6px; background: #101722; box-shadow: var(--shadow); }
.terminal-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; color: #d9e2ef; border-bottom: 1px solid #2b374b; }
.terminal-head div { display: flex; align-items: center; gap: 8px; }
.terminal-head span { color: #7f8da1; font-size: 10px; text-transform: uppercase; }
.terminal-panel pre { height: 470px; margin: 0; padding: 18px; overflow: auto; color: #c8d5e5; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

.project-form { display: grid; gap: 14px; }
.ai-assistant { display:grid; grid-template-columns:minmax(240px,.75fr) minmax(0,1.4fr); gap:28px; margin-bottom:14px; padding:22px 24px; border:1px solid #111; border-left:4px solid #f00; background:#fff; }
.ai-assistant h2 { margin:5px 0 6px; font-size:18px; }
.ai-assistant p { max-width:480px; margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.ai-label { color:#f00; font-size:10px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.ai-assistant-action { display:grid; gap:9px; }
.ai-assistant-action textarea,.ai-plan-box textarea { width:100%; padding:11px 12px; border:1px solid var(--line-strong); background:#fff; resize:vertical; line-height:1.45; }
.ai-assistant-action > div,.ai-plan-actions { display:flex; align-items:center; gap:12px; }
.ai-feedback { color:var(--muted); font-size:11px; line-height:1.4; }
.form-section { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.form-section-intro { display: flex; align-items: flex-start; gap: 12px; }
.form-section-intro > span { display: grid; width: 32px; height: 32px; place-items: center; color: var(--blue); background: var(--surface-blue); border-radius: 5px; font-size: 11px; font-weight: 800; }
.form-section-intro h2 { margin: 2px 0 5px; font-size: 16px; }
.form-section-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-fields label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.form-fields label.wide { grid-column: 1 / -1; }
.form-fields input, .form-fields textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: #fff; outline: none; }
.form-fields input { min-height: 42px; padding: 0 11px; }
.form-fields textarea { padding: 11px; resize: vertical; line-height: 1.45; }
.form-fields input:focus, .form-fields textarea:focus, .search-field input:focus, .select-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 103, 217, .12); }
.form-fields small { color: var(--muted); font-weight: 400; }
.choice-grid { display: grid; gap: 9px; }
.choice, .provider-choice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.provider-choice { align-items: center; justify-content: space-between; cursor: default; }
.choice:hover { background: #f8fafc; }
.choice input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue); }
.choice strong, .choice small, .provider-choice strong, .provider-choice small { display: block; }
.choice strong, .provider-choice strong { font-size: 13px; }
.choice small, .provider-choice small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.provider-choice select { min-height: 36px; min-width: 150px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0 0; }

.key-list { display: grid; }
.key-list > div { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; border-bottom: 1px solid var(--line); }
.key-list > div:last-child { border-bottom: 0; }
.key-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--blue); background: var(--surface-blue); border-radius: 5px; }
.key-list strong, .key-list span { display: block; }
.key-list strong { font-size: 13px; }
.key-list div > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.path-list { display: grid; margin: 0; }
.path-list div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.path-list div:last-child { border-bottom: 0; }
.path-list dt { color: var(--muted); font-size: 11px; font-weight: 750; }
.path-list dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.guide-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.guide-panel h2 { margin: 0 0 5px; font-size: 17px; }
.guide-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.guide-panel code { padding: 11px 13px; color: #dbeafe; background: #172235; border-radius: 4px; font-size: 12px; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .kpi-grid, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .study-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .study-facts { grid-column: 1 / -1; grid-row: 2; }
  .study-row > .icon-button { grid-column: 2; grid-row: 1; }
  .action-strip { align-items: flex-start; flex-direction: column; }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(8, 15, 26, .42); }
  body.nav-open .sidebar-backdrop { display: block; }
  .main-content { margin-left: 0; padding: 84px 18px 52px; }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 15; display: flex; height: 62px; align-items: center; gap: 12px; padding: 0 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
  .mobile-brand { font-size: 14px; font-weight: 800; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 27px; }
  .page-head .button { width: 100%; }
  .head-actions { width: 100%; }
  .head-actions form, .head-actions .button { flex: 1; }
  .head-actions form .button { width: 100%; }
  .run-callout { align-items: flex-start; flex-direction: column; }
  .run-form { width: 100%; }
  .run-form label { flex: 1; }
  .run-form input { width: 100%; }
  .brand-grid { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 1fr; }
  .ai-assistant,.ai-plan-box { grid-template-columns:1fr; }
  .form-fields { grid-template-columns: 1fr; }
  .form-fields label.wide { grid-column: auto; }
  .guide-panel { align-items: flex-start; flex-direction: column; }
  .guide-panel code { width: 100%; overflow-x: auto; }
}

@media (max-width: 560px) {
  .main-content { padding-right: 14px; padding-left: 14px; }
  .kpi-grid, .kpi-grid.three, .kpi-grid.four { grid-template-columns: 1fr; }
  .kpi { min-height: 112px; border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
  .panel { padding: 20px 16px; }
  .panel.flush { padding: 0; }
  .study-row { gap: 14px; padding: 18px 16px; }
  .study-facts { grid-template-columns: 1fr 1fr; gap: 16px; }
  .run-form { align-items: stretch; flex-direction: column; }
  .brand-card-head { grid-template-columns: 40px minmax(0, 1fr); }
  .brand-card-head .status { grid-column: 2; justify-self: start; }
  .brand-metrics { grid-template-columns: 1fr 1fr; }
  .brand-metrics div:last-child { grid-column: 1 / -1; }
  .action-buttons, .action-buttons form, .action-buttons .button { width: 100%; }
  .action-buttons form .button { width: 100%; }
  .toolbar, .toolbar.split { align-items: stretch; flex-direction: column; }
  .search-field input, .select-field select { width: 100%; }
  .definition-list { grid-template-columns: 1fr; }
  .path-list div { grid-template-columns: 1fr; gap: 5px; }
  .form-section { padding: 20px 16px; }
  .ai-assistant { padding:18px 16px; }
  .ai-assistant-action > div { align-items:stretch; flex-direction:column; }
  .ai-assistant-action .button,.ai-plan-actions .button { width:100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .terminal-head span { display: none; }
  .terminal-panel pre { height: 420px; }
}

/* Refine Direct: tokens from the supplied Performance Flows reference. */
:root { --ink:#000; --ink-soft:#383838; --muted:#666; --line:#dedede; --line-strong:#b8b8b8; --surface-soft:#f2f2f2; --surface-blue:#f2f2f2; --blue:#111; --blue-deep:#333; --sidebar:#000; --sidebar-muted:#b3b3b3; --shadow:none; font-family:Barlow,ui-sans-serif,system-ui,sans-serif; }
.sidebar { border-color:#292929; }
.brand-lockup { flex-wrap:wrap; align-content:center; gap:7px; height:108px; border-color:#292929; }
.brand-lockup img { display:block; width:126px; height:auto; }
.brand-lockup > span:last-child { flex-basis:100%; }
.brand-lockup small { text-transform:uppercase; font-size:10px; letter-spacing:.17em; }
.main-nav a,.sidebar-foot a { border-radius:0; }
.main-nav a.active,.sidebar-foot a.active { background:#222; box-shadow:inset 3px 0 0 #f00; }
.main-nav a:hover,.sidebar-foot a:hover { background:#1a1a1a; }
.sidebar-foot { border-color:#292929; }
.page-head h1 { font-weight:900; letter-spacing:-.035em; font-size:clamp(30px,3.2vw,44px); }
.eyebrow { letter-spacing:.12em; color:#666; }
.brand-dot { color:#f00; }
.panel,.kpi,.brand-card,.run-callout,.job-status,.terminal-panel { border-radius:0; box-shadow:none; }
.button,.icon-button,input,select,textarea,.chip,.avatar { border-radius:2px; }
.button { font-size:14px; min-height:42px; }
.button.ghost { border-color:var(--line-strong); }
.button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid #111; outline-offset:4px; }
input:focus,select:focus,textarea:focus { border-color:#111; box-shadow:0 0 0 2px #ddd; }
.run-callout { background:#fff; border:1px solid #111; border-top:3px solid #111; }
.kpi.emphasis { background:#000; border-color:#000; }
.kpi.emphasis span,.kpi.emphasis small,.kpi.emphasis strong { color:#fff; }
.progress-track i { background:#111; }
.terminal-panel { background:#111; border-color:#333; }
.terminal-head { color:#fff; border-color:#333; cursor:pointer; }
.terminal-panel pre { height:320px; color:#ddd; }
summary { cursor:pointer; font-weight:650; }
.technical-details { margin-top:24px; padding-top:16px; border-top:1px solid var(--line); }
.job-help { font-size:18px; line-height:1.5; max-width:760px; }
.field-help { font-size:14px; color:var(--muted); line-height:1.5; }
.invite-form { display:grid; grid-template-columns:minmax(220px,2fr) minmax(160px,1fr) auto; gap:16px; align-items:end; padding:24px 0 0; }
.invite-form label,.invite-result label { display:grid; gap:8px; font-size:14px; font-weight:600; }
.invite-form input,.invite-form select,.invite-result input { width:100%; min-width:0; min-height:44px; border:1px solid var(--line-strong); background:#fff; padding:10px 12px; }
.invite-result { padding:24px; margin:24px 0; background:#f2f2f2; border-left:3px solid #111; }
.invite-result h3 { margin-top:0; }
.invite-result input { margin-bottom:16px; }
.user-action-list { display:grid; gap:8px; padding:12px 0; }
.user-action-list form { margin:0; }
#users-table td { vertical-align:top; }
#users-table strong { overflow-wrap:anywhere; }
.concept-flow { display:grid; grid-template-columns:1fr auto 1fr auto 1fr; align-items:stretch; gap:16px; margin:0 0 24px; }
.concept-flow > div { padding:20px; border:1px solid var(--line); background:#fff; }
.concept-flow > div > span { display:grid; width:28px; height:28px; place-items:center; margin-bottom:14px; color:#fff; background:#000; font-weight:800; }
.concept-flow strong { font-size:18px; }
.concept-flow p { margin:7px 0 0; color:var(--muted); font-size:13px; line-height:1.45; }
.concept-flow > i { align-self:center; color:#777; font-style:normal; font-size:22px; }
.creation-choices { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:24px; }
.creation-card { display:block; padding:28px; border:1px solid var(--line); background:#fff; }
.creation-card h2 { margin:10px 0 8px; font-size:24px; }
.creation-card > p { color:var(--muted); line-height:1.5; }
.creation-card.primary-choice { color:#fff; background:#000; border-color:#000; }
.creation-card.primary-choice .eyebrow,.creation-card.primary-choice p { color:#bbb; }
.creation-card.primary-choice > strong { display:block; margin-top:28px; color:#fff; }
.study-picker { display:grid; margin-top:22px; border-top:1px solid var(--line); }
.study-picker a { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 0; border-bottom:1px solid var(--line); }
.study-picker a:hover b { text-decoration:underline; }
.study-picker span,.study-picker small { display:block; }
.study-picker small { margin-top:4px; color:var(--muted); font-size:11px; }
.study-picker b { white-space:nowrap; font-size:12px; }
.shared-study-banner,.relationship-note { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:18px; margin-bottom:20px; padding:18px 20px; border:1px solid var(--line); background:#fff; }
.shared-study-banner p,.relationship-note p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.relationship-note > span { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.form-outcome { padding:20px 24px; border-left:3px solid #000; background:#f2f2f2; }
.form-outcome p { margin:6px 0 0; color:var(--muted); font-size:13px; line-height:1.5; }
.next-step { margin:24px 0; padding:26px; border:1px solid #000; border-top:3px solid #000; background:#fff; }
.next-step h2 { margin:7px 0; font-size:22px; }
.next-step p { max-width:760px; margin:0 0 18px; color:var(--muted); line-height:1.5; }
.empty-state .button { margin-top:18px; }
.skip-link { position:fixed; z-index:100; top:8px; left:8px; padding:12px; background:white; transform:translateY(-150%); }
.skip-link:focus { transform:translateY(0); }
.auth-page { background:#f2f2f2; }
.auth-brand { background:#000; color:#fff; min-height:72px; display:flex; align-items:center; gap:24px; padding:20px 32px; }
.auth-brand span { font-size:12px; text-transform:uppercase; letter-spacing:.12em; color:#bbb; }
.auth-card { max-width:460px; margin:10vh auto; padding:36px; background:white; border:1px solid var(--line); }
.auth-card h2 { font-size:36px; font-weight:900; margin:12px 0 28px; }
.auth-card form,.auth-card label { display:grid; gap:12px; }
.auth-card input { min-width:0; width:100%; border:1px solid #aaa; padding:12px; }
.auth-card p { font-size:14px; color:#555; margin:4px 0; }
.publication-form { display:grid; gap:18px; }
.publication-head { margin-bottom:20px; }
.publication-status { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,.85fr); align-items:center; gap:24px; margin-bottom:18px; padding:20px 22px; border:1px solid var(--line); border-left:4px solid #111; background:#fff; }
.publication-status.is-live { border-left-color:#087a3b; }
.publication-status > div:first-child { display:flex; align-items:center; gap:14px; }
.publication-status strong,.publication-status p { display:block; }
.publication-status p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.share-link { display:flex; min-width:0; }
.share-link input { min-width:0; width:100%; padding:10px 12px; border:1px solid var(--line-strong); background:#f7f7f7; color:#333; }
.share-link .button { flex:0 0 auto; }
.next-step.compact { margin-top:0; }
.publication-security .section-head,.plan-builder .section-head { align-items:flex-start; }
.publication-security .section-head > div,.plan-builder .section-head > div { display:grid; grid-template-columns:auto 1fr; column-gap:12px; }
.publication-security .section-head h2,.plan-builder .section-head h2 { align-self:center; }
.publication-security .section-head p,.plan-builder .section-head p { grid-column:2; margin-top:3px; }
.step-number { display:grid; grid-row:1 / span 2; width:32px; height:32px; place-items:center; color:#fff; background:#000; font-size:11px; font-weight:850; }
.secure-badge { display:inline-flex; align-items:center; gap:7px; color:#087a3b; font-size:11px; font-weight:850; text-transform:uppercase; }
.form-grid { display:grid; gap:16px; margin-top:20px; }
.form-grid.two { grid-template-columns:1fr 1fr; align-items:end; }
.form-grid label,.plan-notes,.partner-toolbar label { display:grid; gap:7px; color:var(--ink-soft); font-size:12px; font-weight:750; }
.form-grid input,.form-grid textarea,.plan-notes textarea,.partner-toolbar input { min-width:0; width:100%; padding:11px 12px; border:1px solid var(--line-strong); background:#fff; outline:0; resize:vertical; }
.ai-plan-box { display:grid; grid-template-columns:minmax(180px,.55fr) minmax(260px,1.25fr) auto; align-items:center; gap:16px; margin:18px 0; padding:16px; border:1px solid #111; border-left:4px solid #f00; background:#fafafa; }
.ai-plan-box > div:first-child { display:grid; gap:3px; }
.ai-plan-box strong,.ai-plan-box small { display:block; }
.ai-plan-box strong { font-size:13px; }
.ai-plan-box small { color:var(--muted); font-size:10px; line-height:1.4; }
.ai-plan-actions { align-items:flex-start; flex-direction:column; }
.ai-plan-actions .button { white-space:nowrap; }
.form-grid small { color:var(--muted); font-weight:400; line-height:1.4; }
.toggle-card { grid-template-columns:auto 1fr; align-items:start; gap:12px!important; padding:14px; border:1px solid var(--line); cursor:pointer; }
.toggle-card input { width:18px; height:18px; margin:1px 0 0; accent-color:#111; }
.toggle-card strong,.toggle-card small { display:block; }
.toggle-card small { margin-top:4px; }
.selection-count { padding:6px 9px; color:#fff; background:#111; font-size:11px; font-weight:800; }
.partner-toolbar { display:flex; align-items:end; justify-content:space-between; gap:18px; margin-top:22px; padding:14px 0; border-top:1px solid var(--line); }
.partner-toolbar label { width:min(440px,100%); }
.text-button { padding:8px 0; border:0; color:#555; background:none; cursor:pointer; font-size:12px; font-weight:750; text-decoration:underline; }
.partner-selector { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-height:560px; overflow:auto; border:1px solid var(--line); }
.partner-option { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; min-width:0; padding:15px; border-bottom:1px solid var(--line); cursor:pointer; }
.partner-option:nth-child(odd) { border-right:1px solid var(--line); }
.partner-option:hover { background:#f7f7f7; }
.partner-option:has(input:checked) { background:#f1f7f4; box-shadow:inset 3px 0 #087a3b; }
.partner-option > input { position:absolute; opacity:0; pointer-events:none; }
.partner-check { display:grid; width:20px; height:20px; place-items:center; border:1px solid #888; background:#fff; }
.partner-option input:checked + .partner-check { border-color:#111; background:#111; }
.partner-option input:checked + .partner-check::after { content:'✓'; color:#fff; font-size:12px; font-weight:900; }
.partner-copy { min-width:0; }
.partner-copy strong,.partner-copy small,.partner-copy em { display:block; overflow:hidden; text-overflow:ellipsis; }
.partner-copy strong { white-space:nowrap; font-size:13px; }
.partner-copy small { margin-top:3px; color:var(--muted); font-size:11px; }
.partner-copy em { margin-top:6px; color:#777; font-size:10px; font-style:normal; white-space:nowrap; }
.partner-score { min-width:62px; text-align:right; }
.partner-score strong,.partner-score small { display:block; }
.partner-score strong { font-size:20px; }
.partner-score small { color:var(--muted); font-size:9px; text-transform:uppercase; }
.plan-notes { margin-top:18px; }
.sticky-actions { position:sticky; z-index:4; bottom:12px; padding:12px; border:1px solid var(--line); background:rgba(255,255,255,.96); backdrop-filter:blur(8px); }
.danger-zone { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-top:28px; padding:20px 22px; border:1px solid #efb7b7; background:#fffafa; }
.danger-zone strong { color:#a42323; }
.danger-zone p { margin:4px 0 0; color:#7a5555; font-size:12px; }
.client-access-page { min-height:100vh; background:#f2f2f2; }
.client-access-brand { min-height:76px; display:flex; align-items:center; gap:22px; padding:20px 32px; color:#fff; background:#000; }
.client-access-brand span { color:#aaa; font-size:10px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.client-access-card { width:min(480px,calc(100% - 32px)); margin:9vh auto; padding:38px; border:1px solid #ccc; background:#fff; }
.client-access-card h1 { margin:8px 0 10px; font-size:38px; letter-spacing:-.04em; }
.client-access-card > p { margin:0 0 24px; color:#5d5d5d; line-height:1.5; }
.client-access-card form,.client-access-card label { display:grid; gap:10px; }
.client-access-card input { width:100%; min-height:46px; padding:11px 12px; border:1px solid #888; }
.client-access-card button { margin-top:6px; }
.client-access-card > small { display:block; margin-top:22px; color:#888; font-size:10px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
@media(max-width:800px) { .invite-form { grid-template-columns:1fr; } .auth-card { margin:40px 16px; } .auth-brand { padding:20px; } .auth-brand span { font-size:10px; } }
@media(max-width:560px) {
  html,body { max-width:100%; overflow-x:hidden; }
  .main-content, .panel { min-width:0; }
  .project-form,.form-section,.form-fields,.choice-grid { width:100%; min-width:0; }
  .form-fields input,.form-fields textarea { width:100%; min-width:0; max-width:100%; }
  .breadcrumb { flex-wrap:wrap; }
  .key-list > div { grid-template-columns:38px minmax(0,1fr); padding:12px 0; }
  .key-list > div > .status { grid-column:2; justify-self:start; }
  .section-head { flex-wrap:wrap; }
  .user-actions { min-width:112px; }
  .concept-flow { grid-template-columns:1fr; }
  .concept-flow > i { display:none; }
  .creation-choices { grid-template-columns:1fr; }
  .creation-card { padding:22px 18px; }
  .study-picker a { align-items:flex-start; flex-direction:column; gap:9px; }
  .shared-study-banner,.relationship-note { grid-template-columns:1fr; gap:10px; }
  .provider-choice { align-items:stretch; flex-direction:column; }
  .provider-choice select { width:100%; }
  .publication-status,.form-grid.two { grid-template-columns:1fr; }
  .publication-status > div:first-child,.danger-zone { align-items:flex-start; flex-direction:column; }
  .share-link { flex-direction:column; }
  .partner-selector { grid-template-columns:1fr; max-height:500px; }
  .partner-option:nth-child(odd) { border-right:0; }
  .partner-toolbar { align-items:stretch; flex-direction:column; }
  .client-access-brand { padding:20px; }
  .client-access-card { margin:36px auto; padding:28px 22px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
.data-table th { color:#555; background:#f2f2f2; }
.data-table td { border-bottom-color:#e8e8e8; }
.data-table tbody tr:nth-child(even) td { background:#fcfcfc; }
.data-table tbody tr:hover td { background:#f5f5f5; }
.status.running { color:#111; background:#e8e8e8; }
.chip,.topic-list span { color:#444; background:#f6f6f6; border-color:#ddd; }
.avatar { background:#111; }
.terminal-head span { color:#aaa; }
.progress-track,.mini-progress { background:#e5e5e5; }
.editorial-table td { vertical-align:top; min-width:110px; }
.editorial-table td:first-child { min-width:240px; }
.editorial-table small { display:block; margin-top:5px; max-width:330px; color:#666; line-height:1.4; }
.editorial-form { display:grid; gap:20px; }
.table-scroll { max-width:100%; overflow-x:auto; }
.editorial-form label { display:grid; min-width:0; gap:7px; color:var(--ink-soft); font-size:13px; font-weight:700; }
.editorial-form input:not([type=hidden]),.editorial-form select,.editorial-form textarea { width:100%; min-width:0; min-height:44px; padding:11px 12px; border:1px solid var(--line-strong); background:#fff; color:var(--ink); font:inherit; font-weight:400; }
.editorial-form input:focus-visible,.editorial-form select:focus-visible,.editorial-form textarea:focus-visible { outline:2px solid #111; outline-offset:2px; }
.editorial-form select:disabled { background:#f5f5f5; color:#555; opacity:1; }
.editorial-form .form-grid { margin-top:0; }
.editorial-form .form-grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.editorial-form textarea { resize:vertical; }
.editorial-form small,.editorial-form .field-note { margin:0; color:#666; font-size:12px; font-weight:400; line-height:1.5; }
.editorial-form [hidden] { display:none; }
.editorial-options summary { cursor:pointer; color:#555; font-weight:700; }
.editorial-options .form-grid { margin-top:16px; }
.editorial-method summary { cursor:pointer; font-weight:800; }
.editorial-method p { max-width:1000px; line-height:1.6; color:#555; }
@media(max-width:680px) { .editorial-form .form-grid.two { grid-template-columns:minmax(0,1fr); } }

/* Operator workflow for the managed GEO service. */
.service-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; list-style:none; margin:0 0 24px; padding:0; }
.service-steps li { display:flex; align-items:center; gap:12px; padding:16px; border:1px solid var(--line); border-radius:6px; background:var(--white, #fff); }
.service-steps li > span { display:grid; place-items:center; width:30px; height:30px; flex-shrink:0; border-radius:50%; background:var(--ink); color:#fff; font-weight:700; }
.service-steps small { display:block; margin-top:4px; color:var(--muted); }
.run-form select { max-width:100%; min-height:42px; border:1px solid var(--line); border-radius:5px; padding:8px; background:#fff; color:var(--ink); }
.editorial-method > p { color:var(--muted); line-height:1.5; }
@media (max-width:700px) { .service-steps { grid-template-columns:1fr; gap:8px; } .run-form { width:100%; flex-wrap:wrap; } .run-form label { min-width:0; width:100%; } }
