:root {
  --navy: #202656;
  --pink: #c6206e;
  --purple: #5b2c81;
  --blue: #2f9ad5;
  --green: #74ae43;
  --yellow: #f5c12a;
  --orange: #ec6125;
  --ink: #202656;
  --muted: #707895;
  --line: #dfe3ee;
  --paper: #f4f6fa;
  --panel: #ffffff;
  --white: #ffffff;
  --green-soft: #edf6e7;
  --orange-soft: #fff0e9;
  --blue-soft: #eaf6fc;
  --pink-soft: #fbe9f2;
  --purple-soft: #f1ebf5;
  --shadow: 0 14px 40px rgba(32, 38, 86, 0.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Be Vietnam Pro", Montserrat, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}
.auth-gate { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 24px; padding: 32px; background: radial-gradient(circle at top, #30386d 0, var(--navy) 48%, #151a43 100%); }
.auth-brand { display: flex; align-items: center; gap: 13px; color: white; }
.auth-brand img { width: 54px; height: 54px; object-fit: contain; }
.auth-brand span { display: grid; }
.auth-brand strong { font-family: Oswald, sans-serif; font-size: 28px; font-weight: 500; }
.auth-brand small { margin-top: 4px; color: rgba(255,255,255,.6); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-loading { display: grid; justify-items: center; gap: 12px; color: rgba(255,255,255,.72); font-size: 12px; }
.auth-loading .processing-spinner { border-color: rgba(255,255,255,.18); border-top-color: var(--pink); }
.auth-message { width: min(430px, 100%); padding: 28px; border-radius: 14px; background: white; box-shadow: var(--shadow); text-align: center; }
.auth-message h1 { margin: 0; font-family: Oswald, sans-serif; font-size: 28px; font-weight: 500; }
.auth-message p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
#clerk-sign-in { min-height: 440px; }
.workspace-label { align-self: center; max-width: 180px; overflow: hidden; color: rgba(255,255,255,.7); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-button { display: grid; place-items: center; min-width: 32px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.app-shell { height: 100%; display: grid; grid-template-rows: 78px 1fr; }
.topbar {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 4px solid var(--pink);
  color: white;
  background: var(--navy);
  box-shadow: 0 4px 18px rgba(32, 38, 86, .18);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-family: Oswald, sans-serif; font-size: 21px; font-weight: 500; letter-spacing: .03em; }
.brand-copy small { margin-top: 5px; color: rgba(255,255,255,.58); font-size: 8px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.project-title { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.project-title strong { outline: none; padding: 2px 8px; border-radius: 5px; font-family: Oswald, sans-serif; font-size: 18px; font-weight: 500; letter-spacing: .02em; }
.project-title strong:focus { background: rgba(255,255,255,.12); }
.eyebrow { color: var(--purple); font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.topbar .eyebrow { color: rgba(255,255,255,.5); }
.topbar-actions { display: flex; gap: 9px; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; cursor: pointer; font-weight: 700; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { color: white; background: var(--pink); box-shadow: 0 5px 14px rgba(198,32,110,.25); }
.button.primary:hover { background: #ae195e; }
.button.ghost { color: var(--navy); background: white; }
.button.outline { border: 1px solid var(--line); background: var(--white); }
.button.danger { color: #9b4938; background: transparent; }
.upload-trigger { display: flex; align-items: center; gap: 7px; }
.upload-trigger span { color: var(--pink); font-size: 17px; font-weight: 800; line-height: 1; }

.home-screen {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 28px;
  padding: 42px clamp(28px, 5vw, 72px);
  background:
    radial-gradient(circle at top left, rgba(198,32,110,.12), transparent 30%),
    linear-gradient(135deg, #f7f8fc 0%, #eef2f9 100%);
}
.home-hero, .home-library-panel {
  min-width: 0;
  align-self: start;
  padding: 30px;
  border: 1px solid rgba(223,227,238,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.home-hero h1 {
  max-width: 520px;
  margin: 8px 0 8px;
  color: var(--navy);
  font-family: Oswald, sans-serif;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.03;
}
.home-hero p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.home-actions { display: grid; gap: 12px; margin-top: 28px; }
.home-action {
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-areas: "icon title" "icon copy";
  gap: 3px 13px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--navy);
  background: white;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(32,38,86,.06);
}
.home-action:hover { border-color: rgba(198,32,110,.35); transform: translateY(-1px); }
.home-action.primary { border-color: rgba(198,32,110,.28); background: var(--pink-soft); }
.home-action-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: white;
  background: var(--pink);
  font-weight: 800;
}
.home-action:not(.primary) .home-action-icon { color: var(--purple); background: var(--purple-soft); }
.home-action strong { grid-area: title; font-family: Oswald, sans-serif; font-size: 22px; font-weight: 500; }
.home-action small { grid-area: copy; color: var(--muted); line-height: 1.4; }
.home-library-panel .section-title h2 { font-family: Oswald, sans-serif; font-size: 27px; font-weight: 500; }
.home-library-list { display: grid; gap: 10px; margin-top: 14px; }
.home-library-list .library-empty { background: white; }

.workspace { min-height: 0; display: grid; grid-template-columns: 74px minmax(500px, 1fr) 328px; }
.left-rail { display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 20px 10px; border-right: 1px solid #30386d; background: var(--navy); }
.left-rail nav { display: grid; gap: 12px; }
.rail-button { width: 55px; display: grid; justify-items: center; gap: 4px; padding: 8px 3px; border: 0; border-radius: 10px; color: rgba(255,255,255,.58); background: transparent; cursor: pointer; font-size: 10px; }
.rail-button:hover { color: white; background: rgba(255,255,255,.08); }
.rail-button.active { color: white; background: var(--pink); }
.rail-icon { font-size: 20px; line-height: 24px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer; font-size: 17px; }
.left-rail .icon-button { color: white; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.08); }

.canvas-panel { min-width: 0; position: relative; overflow: hidden; background: var(--paper); }
.canvas-toolbar { position: absolute; z-index: 20; top: 16px; left: 18px; right: 18px; display: flex; justify-content: space-between; pointer-events: none; }
.status-chip, .toolbar-group { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 254, 250, .9); box-shadow: 0 4px 18px rgba(48,48,42,.05); pointer-events: auto; color: var(--muted); font-size: 11px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #5e8c6f; }
.toolbar-group .icon-button { width: 25px; height: 25px; border: 0; background: transparent; }
#zoom-label { min-width: 34px; text-align: center; }
.canvas-viewport { width: 100%; height: 100%; overflow: auto; cursor: grab; }
.canvas-viewport:active { cursor: grabbing; }
.canvas {
  position: relative;
  width: 2400px;
  height: 1400px;
  transform-origin: 0 0;
  background-color: var(--paper);
  background-image: radial-gradient(#cbd1e1 1px, transparent 1px);
  background-size: 24px 24px;
}
.edge-layer { position: absolute; inset: 0; overflow: visible; }
.edge { fill: none; stroke: #7880a8; stroke-width: 2; marker-end: url(#arrow); }
.edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.edge-hit:hover + .edge { stroke: var(--pink); stroke-width: 3; }
.flow-node {
  position: absolute;
  width: 210px;
  min-height: 102px;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--pink);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(32, 38, 86, .1);
  cursor: grab;
  user-select: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.flow-node:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(32,38,86,.15); }
.flow-node.manual { border-top-color: var(--pink); }
.flow-node.automated { border-top-color: var(--green); }
.flow-node.decision { border-top-color: var(--blue); }
.flow-node.selected { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(91,44,129,.1), var(--shadow); }
.flow-node.connect-target { border-color: var(--pink); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(198,32,110,.12); } }
.node-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.node-type { display: flex; align-items: center; gap: 7px; text-transform: uppercase; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.type-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.manual .type-icon { color: var(--pink); background: var(--pink-soft); }
.automated .type-icon { color: #4e8428; background: var(--green-soft); }
.decision .type-icon { color: var(--blue); background: var(--blue-soft); transform: rotate(45deg); }
.decision .type-icon span { transform: rotate(-45deg); }
.node-cost { color: var(--navy); font-size: 11px; font-weight: 700; }
.node-title { overflow: hidden; margin: 0 0 13px; font-family: Oswald, sans-serif; font-size: 18px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.node-meta { display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid #e8eaf2; color: var(--muted); font-size: 10px; }
.node-meta span { max-width: 118px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.node-port { position: absolute; top: calc(50% - 6px); width: 12px; height: 12px; border: 2px solid var(--white); border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 1px #747da5; }
.node-port.input { left: -7px; }
.node-port.output { right: -7px; }
.connect-hint { position: fixed; z-index: 50; left: 50%; bottom: 92px; transform: translateX(-50%); padding: 10px 14px; border-radius: 8px; color: white; background: var(--navy); box-shadow: var(--shadow); font-size: 12px; }
.canvas-footer { position: absolute; z-index: 20; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: end; justify-content: space-between; pointer-events: none; }
.ai-button { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--purple); border-radius: 11px; color: white; background: var(--purple); box-shadow: var(--shadow); cursor: pointer; pointer-events: auto; text-align: left; }
.ai-button > span:last-child { display: grid; }
.ai-button small { color: rgba(255,255,255,.65); font-size: 9px; }
.spark { color: var(--yellow); font-size: 18px; }
.legend { display: flex; gap: 16px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,254,250,.9); pointer-events: auto; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.legend-dot.manual { background: var(--pink); }
.legend-dot.automated { background: var(--green); }
.legend-dot.decision { background: var(--blue); transform: rotate(45deg); }

.inspector, .analytics-panel { min-width: 0; overflow-y: auto; padding: 26px 24px; border-left: 1px solid var(--line); border-top: 4px solid var(--purple); background: var(--panel); }
.inspector-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 25px; }
.inspector-heading h2, .analytics-heading h2 { margin: 5px 0 0; font-family: Oswald, sans-serif; font-size: 27px; font-weight: 500; line-height: 1.15; }
#node-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #666960; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: var(--white); padding: 10px 11px; font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91,44,129,.1); }
textarea { resize: vertical; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.node-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.inspector-empty { display: grid; justify-items: center; align-content: center; height: 70%; text-align: center; color: var(--muted); }
.inspector-empty h2 { margin: 16px 0 4px; color: var(--ink); font-family: Oswald, sans-serif; }
.inspector-empty p { max-width: 220px; line-height: 1.5; }
.empty-icon { font-size: 42px; color: #aaa9a0; }

.analytics-panel { display: block; }
.analytics-heading p { margin: 8px 0 22px; color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric-card { min-width: 0; display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 10px; background: var(--white); box-shadow: 0 5px 14px rgba(32,38,86,.05); }
.metric-card:nth-child(3) { border-top-color: var(--green); }
.metric-card:nth-child(4) { border-top-color: var(--orange); }
.metric-card.accent { color: white; border-color: var(--pink); background: var(--pink); }
.metric-card span, .metric-card small { color: inherit; opacity: .7; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { font-family: Oswald, sans-serif; font-size: 25px; font-weight: 500; }
.path-section { margin-top: 27px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title h3 { margin: 0; font-family: Oswald, sans-serif; font-size: 19px; font-weight: 500; }
.section-title span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.path-card { margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.path-card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.path-card strong { font-size: 11px; }
.path-card .path-value { color: var(--purple); white-space: nowrap; }
.path-nodes { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
.opportunity-card { display: flex; gap: 10px; margin-top: 20px; padding: 14px; border-left: 4px solid var(--yellow); border-radius: 10px; background: #fff9e5; }
.opportunity-card strong { font-size: 11px; }
.opportunity-card p { margin: 4px 0 0; color: #6e675f; font-size: 10px; line-height: 1.45; }

dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-top: 5px solid var(--pink); border-radius: 12px; background: var(--panel); box-shadow: 0 30px 90px rgba(32,38,86,.3); }
dialog::backdrop { background: rgba(33,35,31,.42); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-heading { display: flex; align-items: center; gap: 13px; }
.dialog-heading h2 { margin: 4px 0 0; font-family: Oswald, sans-serif; font-size: 27px; font-weight: 500; }
.dialog-card > p { color: var(--muted); line-height: 1.5; }
.dialog-card textarea { margin-top: 5px; }
.spark.large, .import-glyph, .upload-glyph, .library-glyph, .conflict-glyph { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 12px; background: var(--purple-soft); font-size: 22px; }
.import-glyph { color: var(--purple); font-family: monospace; font-size: 13px; font-weight: 800; }
.upload-glyph { color: var(--pink); font-weight: 800; }
.library-glyph { color: var(--blue); font-size: 19px; font-weight: 800; }
.conflict-glyph { color: var(--pink); background: var(--pink-soft); font-weight: 800; }
.prompt-examples { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.prompt-examples button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.form-error { color: #a03e31 !important; }

.library-dialog { width: min(720px, calc(100vw - 32px)); }
.library-tabs { display: flex; gap: 5px; width: fit-content; margin-top: 14px; padding: 4px; border-radius: 9px; background: #eef0f7; }
.library-tabs button { padding: 7px 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.library-tabs button.active { color: var(--navy); background: white; box-shadow: 0 1px 4px rgba(32,38,86,.12); }
.library-list { display: grid; gap: 10px; max-height: 390px; overflow-y: auto; margin-top: 16px; }
.library-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 13px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; background: white; }
.library-item.active { border-left-color: var(--pink); background: var(--pink-soft); }
.library-item-copy { min-width: 0; display: grid; gap: 4px; }
.library-item strong { overflow: hidden; color: var(--navy); font-family: Oswald, sans-serif; font-size: 19px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.library-item span, .library-empty { color: var(--muted); font-size: 11px; line-height: 1.45; }
.library-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.library-item-actions .button { min-height: 32px; padding: 7px 9px; font-size: 10px; }
.library-item-actions .danger { color: #a03e31; }
.library-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 10px; background: #fafbfe; text-align: center; }

@media (max-width: 680px) {
  .home-screen { grid-template-columns: 1fr; padding: 22px; }
  .library-item { grid-template-columns: 1fr; }
  .library-item-actions { justify-content: flex-start; }
}

.conflict-dialog { width: min(600px, calc(100vw - 32px)); }
.conflict-options { display: grid; gap: 10px; margin-top: 18px; }
.conflict-option { display: grid; gap: 5px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); background: white; cursor: pointer; text-align: left; }
.conflict-option:hover { border-color: var(--purple); background: var(--purple-soft); }
.conflict-option.highlighted { border-color: rgba(198,32,110,.35); background: var(--pink-soft); }
.conflict-option strong { font-family: Oswald, sans-serif; font-size: 19px; font-weight: 500; }
.conflict-option span { color: var(--muted); font-size: 11px; line-height: 1.45; }

.upload-dialog { width: min(620px, calc(100vw - 32px)); }
.document-review-dialog { width: min(860px, calc(100vw - 32px)); }
.upload-dropzone {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  padding: 28px;
  border: 2px dashed #bcc3d8;
  border-radius: 12px;
  color: var(--muted);
  background: #f8f9fc;
  cursor: pointer;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.upload-dropzone:hover, .upload-dropzone.dragging { border-color: var(--pink); background: var(--pink-soft); transform: translateY(-1px); }
.upload-dropzone strong { color: var(--navy); font-family: Oswald, sans-serif; font-size: 22px; font-weight: 500; }
.upload-dropzone span { font-size: 13px; font-weight: 500; }
.upload-dropzone small { margin-top: 5px; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.dropzone-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 5px; border-radius: 50%; color: white; background: var(--pink); font-size: 26px !important; line-height: 1; }
.selected-file { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; background: white; box-shadow: 0 5px 14px rgba(32,38,86,.05); }
.file-type-badge { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 9px; color: white; background: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.file-details { min-width: 0; display: grid; gap: 4px; flex: 1; }
.file-details strong { overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-details span { color: var(--muted); font-size: 10px; }
.remove-file { flex: 0 0 32px; }
.upload-privacy { margin: 14px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.upload-processing { min-height: 255px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 35px; text-align: left; }
.upload-processing strong { color: var(--navy); font-family: Oswald, sans-serif; font-size: 23px; font-weight: 500; }
.upload-processing p { max-width: 360px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.processing-spinner { width: 42px; height: 42px; flex: 0 0 42px; border: 4px solid var(--pink-soft); border-top-color: var(--pink); border-radius: 50%; animation: document-spin .8s linear infinite; }
@keyframes document-spin { to { transform: rotate(360deg); } }
.upload-review { margin-top: 20px; }
.review-status { display: flex; gap: 14px; align-items: center; padding: 17px; border-radius: 11px; background: var(--green-soft); }
.review-status strong { color: var(--navy); font-family: Oswald, sans-serif; font-size: 19px; font-weight: 500; }
.review-status p { margin: 3px 0 0; color: #5e7650; font-size: 11px; line-height: 1.45; }
.review-check { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; color: white; background: var(--green); font-size: 20px; font-weight: 800; }
.review-list { display: grid; gap: 0; margin-top: 15px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.review-list > div { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: white; }
.review-list > div:last-child { border-bottom: 0; }
.review-list strong { color: var(--navy); font-size: 11px; }
.review-list small { grid-column: 2; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.review-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #bbc0ce; }
.review-dot.ready { background: var(--green); }
.review-dot.pending { background: var(--yellow); }
.review-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.review-metrics > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfe; text-align: center; }
.review-metrics strong { color: var(--navy); font-family: Oswald, sans-serif; font-size: 21px; font-weight: 500; }
.review-metrics span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.review-missing { margin-top: 15px; }
.missing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.missing-grid > div { display: grid; gap: 1px; padding: 10px; border-radius: 8px; background: var(--pink-soft); text-align: center; }
.missing-grid strong { color: var(--pink); font-family: Oswald, sans-serif; font-size: 20px; font-weight: 500; }
.missing-grid span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.review-sections { display: grid; gap: 10px; margin-top: 15px; }
.review-section { border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden; }
.review-section summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; color: var(--navy); cursor: pointer; font-size: 11px; font-weight: 800; }
.review-section summary span { font-family: Oswald, sans-serif; font-size: 17px; font-weight: 500; }
.review-section summary small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.review-step-editor { max-height: 310px; overflow-y: auto; display: grid; gap: 10px; padding: 0 14px 14px; }
.review-step-card { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfe; }
.review-step-card-top { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; }
.review-step-card-top span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--navy); font-size: 10px; font-weight: 800; }
.review-step-card input, .review-step-card select { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--navy); font: inherit; font-size: 11px; }
.review-step-card-top input { padding: 8px 9px; font-weight: 800; }
.review-step-fields { display: grid; grid-template-columns: 1fr 1fr 1fr 80px 80px; gap: 7px; margin-top: 9px; }
.review-step-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.review-step-fields input, .review-step-fields select { padding: 7px 8px; text-transform: none; letter-spacing: normal; }
.evidence-list { max-height: 240px; overflow-y: auto; display: grid; gap: 8px; margin: 0; padding: 0 14px 14px; list-style: none; }
.evidence-list li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 10px; border-radius: 8px; background: #f7f9fc; }
.evidence-list li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--purple); font-size: 10px; font-weight: 800; }
.evidence-list strong { color: var(--navy); font-size: 11px; }
.evidence-list p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.review-preview { margin-top: 15px; }
.review-preview ol { max-height: 190px; overflow-y: auto; display: grid; gap: 7px; margin: 9px 0 0; padding: 0; list-style: none; }
.review-preview li { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-left: 3px solid var(--blue); border-radius: 5px; color: var(--navy); background: #f7f9fc; font-size: 11px; font-weight: 600; }
.review-preview li.decision { border-left-color: var(--purple); }
.review-preview li.automated { border-left-color: var(--green); }
.review-preview li span { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%; color: white; background: var(--navy); font-size: 9px; }
.review-notices { margin-top: 13px; padding: 12px 14px; border-radius: 9px; color: #70540b; background: #fff7dc; }
.review-notices > strong { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.review-notices ul { display: grid; gap: 5px; margin: 7px 0 0; padding-left: 17px; font-size: 10px; line-height: 1.4; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 62px minmax(420px, 1fr) 290px; }
  .topbar { grid-template-columns: 220px 1fr auto; }
  .topbar .secondary-action { display: none; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; padding: 0 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small { display: none; }
  .project-title { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .left-rail { display: none; }
  .inspector, .analytics-panel { position: absolute; z-index: 40; right: 0; top: 78px; bottom: 0; width: min(88vw, 330px); box-shadow: -12px 0 35px rgba(32,38,86,.14); }
  .inspector.no-selection { display: none; }
  .legend { display: none; }
  .upload-trigger { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .upload-trigger .upload-icon { display: inline; font-size: 19px; }
  .upload-trigger .upload-label { display: none; }
  .upload-dialog .dialog-card { padding: 21px; }
  .upload-dropzone { min-height: 205px; padding: 22px 16px; }
}
