@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { color-scheme: light; scroll-behavior: smooth; }
  body, h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
  ol, ul { margin: 0; padding: 0; list-style: none; }
  button, input, select { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  img, svg { display: block; max-width: 100%; }
}

@layer base {
  :root {
    --brand: #025975;
    --brand-dark: #013649;
    --brand-light: #e3f3f7;
    --brand-soft: #f0f8fa;
    --ai: #4338ca;
    --ai-light: #eeecff;
    --reservoir: #7c3aed;
    --reservoir-light: #f1ebfd;
    --success: #147d57;
    --success-light: #e7f6ef;
    --warning: #a15c08;
    --warning-light: #fff4df;
    --danger: #b42318;
    --danger-light: #fff0ef;
    --info: #176b87;
    --info-light: #e9f5f8;
    --ink: #17252b;
    --ink-2: #38505a;
    --muted: #637982;
    --faint: #8ea0a7;
    --border: #dce5e8;
    --border-strong: #c6d4d9;
    --surface: #fff;
    --surface-alt: #f6f9fa;
    --background: #f2f6f7;
    --overlay: rgba(8, 28, 37, .68);
    --focus: #006ee6;
    --shadow-sm: 0 1px 2px rgba(12, 39, 50, .05), 0 1px 4px rgba(12, 39, 50, .04);
    --shadow-md: 0 10px 34px rgba(12, 39, 50, .10);
    --radius-sm: .375rem;
    --radius-md: .625rem;
    --radius-lg: .875rem;
    --topbar-height: 4rem;
    --rail-width: 15rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }

  body { min-width: 20rem; min-height: 100vh; overflow-x: hidden; background: var(--background); }
  body::before {
    content: "";
    position: fixed;
    inset: var(--topbar-height) 0 auto;
    height: 15rem;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(ellipse at 18% 0%, rgba(2, 89, 117, .055), transparent 58%);
  }
  button, a { color: inherit; }
  button:not(:disabled), a { cursor: pointer; }
  button:disabled { cursor: not-allowed; opacity: .48; }
  :focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent); outline-offset: 2px; }
  ::selection { color: var(--brand-dark); background: #bceaf1; }
  h1 { font-size: clamp(1.65rem, 2.3vw, 2.25rem); line-height: 1.15; letter-spacing: -.035em; }
  h2 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -.015em; }
  h3 { font-size: .94rem; line-height: 1.35; }
  p { color: var(--ink-2); line-height: 1.55; }
  a { text-decoration: none; }
  code { font: .79rem/1.45 "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
  input, select {
    min-height: 2.5rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--surface);
  }
}

@layer components {
  .skip-link {
    position: fixed; left: 1rem; top: .75rem; z-index: 100;
    padding: .65rem 1rem; border-radius: var(--radius-sm);
    color: white; background: var(--brand-dark); transform: translateY(-150%);
  }
  .skip-link:focus { transform: translateY(0); }
  .app-shell { min-height: 100vh; }
  #main-content { min-height: calc(100vh - var(--topbar-height)); }
  .topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-height);
    display: grid; grid-template-columns: minmax(16rem, 1fr) auto minmax(16rem, 1fr); align-items: center;
    gap: 1rem; padding: 0 1.5rem; border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
  }
  .brand { justify-self: start; display: flex; align-items: center; gap: .65rem; min-width: 0; }
  .brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; color: white; border-radius: .5rem; background: var(--brand); box-shadow: 0 5px 14px rgba(2, 89, 117, .2); }
  .brand-mark svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
  .brand-name { font-size: .94rem; font-weight: 700; color: var(--brand-dark); letter-spacing: -.02em; }
  .brand-divider { width: 1px; height: 1.45rem; background: var(--border); }
  .product-name { font-size: .94rem; font-weight: 600; color: var(--ink-2); }
  .primary-nav { align-self: stretch; display: flex; gap: .25rem; }
  .nav-link { position: relative; display: flex; align-items: center; gap: .5rem; padding: 0 1rem; color: var(--muted); font-size: .875rem; font-weight: 600; }
  .nav-link svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .nav-link:hover { color: var(--brand); background: var(--brand-soft); }
  .nav-link.active { color: var(--brand); }
  .nav-link.active::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
  .topbar-actions { justify-self: end; display: flex; align-items: center; gap: .5rem; }
  .demo-badge { display: inline-flex; align-items: center; gap: .45rem; min-height: 1.75rem; padding: .25rem .65rem; border: 1px solid #bddde3; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: .72rem; font-weight: 700; }
  .demo-badge:hover { border-color: var(--brand); background: var(--brand-light); }
  .demo-badge.live { color: #0c6848; border-color: #9ed5bf; background: var(--success-light); }
  .demo-badge.offline .status-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(161, 92, 8, .12); }
  .demo-badge.live .status-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(20, 125, 87, .12); }
  .status-dot { width: .42rem; height: .42rem; border-radius: 50%; background: #13a479; box-shadow: 0 0 0 3px rgba(19, 164, 121, .12); }
  .icon-button { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink-2); background: var(--surface); }
  .icon-button:hover { color: var(--brand); border-color: #aacbd5; background: var(--brand-soft); }
  .icon-button.subtle { width: 2rem; height: 2rem; border-color: transparent; background: transparent; }
  .icon-button svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .user-menu { display: flex; align-items: center; gap: .55rem; min-height: 2.65rem; padding: .25rem .45rem .25rem .3rem; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
  .user-menu:hover { background: var(--surface-alt); }
  .avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; color: white; background: linear-gradient(145deg, var(--brand), #0e718c); font-size: .7rem; font-weight: 800; }
  .user-copy { display: grid; line-height: 1.15; }
  .user-copy strong { font-size: .78rem; }
  .user-copy small { color: var(--muted); font-size: .68rem; }
  .user-menu > svg { width: .9rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .icon { width: 1rem; height: 1rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  .workspace-page, .dashboard-page { width: min(100%, 120rem); margin-inline: auto; padding: 2rem clamp(1.25rem, 3vw, 3.5rem) 3.5rem; }
  .page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
  .page-header h1 { margin: .35rem 0 .45rem; }
  .page-header > div:first-child > p { max-width: 48rem; }
  .breadcrumb { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
  .breadcrumb svg { width: .7rem; }
  .header-meta { flex: 0 0 auto; padding-bottom: .15rem; }
  .header-meta span { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .75rem; }
  .eyebrow { color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
  .surface { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
  .surface-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
  .surface-header h2 { margin: .3rem 0 .25rem; }
  .surface-header p:not(.eyebrow) { font-size: .83rem; }
  .surface-header.compact { padding-bottom: 1rem; }
  .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.5rem; padding: .55rem 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 700; transition: background .15s ease, border .15s ease, transform .15s ease; }
  .button:active:not(:disabled) { transform: translateY(1px); }
  .button-primary { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 4px 12px rgba(2, 89, 117, .14); }
  .button-primary:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
  .button-secondary { color: var(--brand-dark); border-color: var(--border-strong); background: white; }
  .button-secondary:hover { border-color: #91bdca; background: var(--brand-soft); }
  .button-block { width: 100%; }

  .workflow { margin-bottom: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
  .workflow ol { display: grid; grid-template-columns: repeat(4, 1fr); }
  .workflow-step { position: relative; min-width: 0; }
  .workflow-step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -.3rem; z-index: 2; width: .6rem; height: .6rem; border-top: 1px solid var(--border); border-right: 1px solid var(--border); background: white; transform: translateY(-50%) rotate(45deg); }
  .workflow-step button { width: 100%; min-height: 4.4rem; display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 0; background: transparent; text-align: left; }
  .workflow-step button:hover:not(:disabled) { background: var(--surface-alt); }
  .workflow-step.active button { background: var(--brand-soft); }
  .workflow-step.active::after { background: var(--brand-soft); }
  .step-number { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); background: white; font-size: .72rem; font-weight: 800; }
  .step-number svg { width: .85rem; }
  .workflow-step.active .step-number { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px rgba(2, 89, 117, .1); }
  .workflow-step.done .step-number { color: var(--success); border-color: #9bd2bd; background: var(--success-light); }
  .workflow-step button > span:last-child { display: grid; min-width: 0; }
  .workflow-step strong { font-size: .79rem; }
  .workflow-step small { margin-top: .15rem; color: var(--muted); font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .files-layout, .processing-layout, .delivery-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.25rem; align-items: start; }
  .main-surface { padding: 1.5rem; }
  .counter-badge { display: inline-flex; align-items: center; min-height: 1.75rem; padding: .25rem .6rem; border-radius: 999px; color: var(--brand); background: var(--brand-light); font-size: .72rem; font-weight: 700; white-space: nowrap; }
  .form-field { display: grid; gap: .35rem; margin-top: 1.25rem; }
  .form-field label { font-size: .78rem; font-weight: 700; }
  .field-hint { color: var(--muted); font-size: .7rem; }
  .field-error { min-height: 1rem; color: var(--danger); font-size: .7rem; }
  .form-field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-light); }
  .form-field input { width: min(100%, 32rem); padding: .55rem .7rem; }
  .drop-zone { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; margin-top: 1.25rem; padding: 1.3rem; border: 1px dashed #8bb8c3; border-radius: var(--radius-md); background: var(--brand-soft); transition: border .15s, background .15s; }
  .drop-zone.dragging { border-color: var(--brand); background: #def2f5; box-shadow: inset 0 0 0 2px rgba(2, 89, 117, .14); }
  .drop-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid #bfdee5; border-radius: .75rem; color: var(--brand); background: white; box-shadow: var(--shadow-sm); }
  .drop-icon svg { width: 1.3rem; height: 1.3rem; }
  .drop-zone h3 { margin-bottom: .25rem; }
  .drop-zone p { color: var(--muted); font-size: .72rem; }
  .drop-error { min-height: 1.3rem; margin-top: .35rem; color: var(--danger); font-size: .72rem; }
  .example-invite { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .35rem 0 1rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-alt); }
  .example-invite > div { display: flex; align-items: center; gap: .65rem; }
  .example-invite > div > svg { color: var(--ai); }
  .example-invite span { display: grid; gap: .1rem; }
  .example-invite strong { font-size: .76rem; }
  .example-invite small { color: var(--muted); font-size: .68rem; }
  .file-list-header { display: flex; align-items: center; gap: .75rem; margin: .7rem 0 .55rem; }
  .file-list-header h3 { margin-right: auto; }
  .file-list-header span { color: var(--muted); font-size: .7rem; }
  .text-button { padding: .2rem; border: 0; color: var(--brand); background: transparent; font-size: .7rem; font-weight: 750; }
  .text-button:hover { text-decoration: underline; }
  .file-list { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
  .file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; min-height: 4.1rem; padding: .65rem .75rem; }
  .file-row + .file-row { border-top: 1px solid var(--border); }
  .file-row:hover { background: #fbfcfc; }
  .file-type { display: grid; place-items: center; width: 2.1rem; height: 2.3rem; border-radius: .35rem; color: white; font-size: .65rem; font-style: normal; font-weight: 900; }
  .file-pdf { background: #c64d43; }
  .file-xlsx { background: #278263; }
  .file-json { background: #5664ae; }
  .file-copy { display: grid; gap: .15rem; min-width: 0; }
  .file-copy strong { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .file-copy small { color: var(--muted); font-size: .68rem; }
  .file-status { display: flex; align-items: center; gap: .35rem; color: var(--success); font-size: .7rem; font-weight: 700; }
  .empty-row { padding: 1.5rem; color: var(--muted); text-align: center; font-size: .8rem; }
  .summary-panel { position: sticky; top: calc(var(--topbar-height) + 1rem); padding: 1.5rem; overflow: hidden; }
  .summary-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: .24rem; background: linear-gradient(90deg, var(--brand), #21a8a9); }
  .summary-accent { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; margin-bottom: 1rem; border-radius: .75rem; color: var(--ai); background: var(--ai-light); }
  .summary-accent svg { width: 1.35rem; height: 1.35rem; }
  .summary-panel h2 { margin: .35rem 0 .65rem; font-size: 1.15rem; }
  .summary-panel > p:not(.eyebrow) { font-size: .8rem; }
  .summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.25rem 0; border-block: 1px solid var(--border); }
  .summary-stats div { padding: 1rem .4rem; }
  .summary-stats div + div { border-left: 1px solid var(--border); }
  .summary-stats dt { color: var(--muted); font-size: .65rem; }
  .summary-stats dd { margin-top: .2rem; font-size: 1.1rem; font-weight: 750; }
  .callout { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem; border: 1px solid transparent; border-radius: var(--radius-sm); }
  .callout p { font-size: .7rem; }
  .callout-info { margin-bottom: 1rem; color: var(--info); border-color: #c8e2e8; background: var(--info-light); }
  .callout-warning { color: var(--warning); border-color: #edcf97; background: var(--warning-light); }
  .callout-success { color: var(--success); border-color: #b5dfcf; background: var(--success-light); }
  .callout strong { display: block; margin-bottom: .1rem; font-size: .78rem; }
  .callout p { color: inherit; }

  .processing-hero { min-height: 33rem; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; text-align: center; }
  .processing-hero h2 { margin: .4rem 0 .5rem; font-size: 1.5rem; }
  .processing-hero > p:not(.eyebrow) { max-width: 35rem; }
  .processing-orbit { position: relative; display: grid; place-items: center; width: 6rem; height: 6rem; margin-bottom: 1.5rem; border: 1px solid #c7dfe5; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
  .processing-orbit::before, .processing-orbit::after { content: ""; position: absolute; border: 1px dashed #9bc6d1; border-radius: 50%; }
  .processing-orbit::before { inset: -.55rem; }
  .processing-orbit::after { inset: -1.1rem; opacity: .45; }
  .processing-orbit.running::before { border-top-color: var(--brand); animation: rotate 2.2s linear infinite; }
  .processing-orbit.running::after { border-bottom-color: var(--ai); animation: rotate 3.4s linear infinite reverse; }
  .processing-orbit.complete { color: white; border-color: var(--success); background: var(--success); }
  .processing-orbit.partial { color: white; border-color: var(--warning); background: var(--warning); }
  .processing-orbit > div { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: white; box-shadow: var(--shadow-md); }
  .processing-orbit.complete > div { color: var(--success); }
  .processing-orbit.partial > div { color: var(--warning); }
  .processing-orbit svg { width: 1.65rem; height: 1.65rem; }
  .progress-group { width: min(100%, 37rem); margin: 2rem 0 1.25rem; text-align: left; }
  .progress-label { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .75rem; }
  .progress-label span { color: var(--brand); font-weight: 800; }
  .progress-track { height: .55rem; border-radius: 999px; background: #e2ebee; overflow: hidden; }
  .progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #17a1a2); transition: width .4s ease; }
  .progress-track.indeterminate span { width: 42% !important; animation: indeterminate 1.25s ease-in-out infinite alternate; }
  .progress-group p { margin-top: .5rem; color: var(--muted); font-size: .7rem; }
  .processing-note { width: min(100%, 37rem); margin: 0 0 1rem; text-align: left; }
  .activity-panel { padding: 1.25rem; }
  .live-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .65rem; font-weight: 700; }
  .live-label > span { width: .45rem; height: .45rem; border-radius: 50%; background: var(--success); }
  .live-label.warning { color: var(--warning); }
  .live-label.warning > span { background: var(--warning); }
  .processing-summary-list { display: grid; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .processing-summary-list > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .7rem; padding: .58rem .7rem; background: var(--surface-alt); }
  .processing-summary-list > div + div { border-top: 1px solid var(--border); }
  .processing-summary-list dt { color: var(--muted); font-size: .61rem; font-weight: 700; }
  .processing-summary-list dd { font-size: .66rem; font-weight: 650; }
  .pipeline-list { padding: 1rem 0; }
  .pipeline-list li { position: relative; display: flex; align-items: flex-start; gap: .65rem; min-height: 3.55rem; }
  .pipeline-list li:not(:last-child)::after { content: ""; position: absolute; left: .78rem; top: 1.65rem; bottom: .25rem; width: 1px; background: var(--border); }
  .pipeline-list li > span { z-index: 1; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); background: white; font-size: .65rem; font-weight: 800; }
  .pipeline-list li.complete > span { color: white; border-color: var(--success); background: var(--success); }
  .pipeline-list li.active > span { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-light); }
  .pipeline-list li > div { display: grid; gap: .1rem; padding-top: .1rem; }
  .pipeline-list strong { font-size: .75rem; }
  .pipeline-list small { color: var(--muted); font-size: .65rem; }
  .mini-title { margin: .35rem 0 .65rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .compact-files { display: grid; gap: .35rem; }
  .compact-files li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .45rem; border-radius: var(--radius-sm); background: var(--surface-alt); }
  .compact-files li.has-issue { box-shadow: inset 3px 0 var(--warning); }
  .compact-files .file-type { width: 1.65rem; height: 1.8rem; font-size: .55rem; }
  .compact-files li > span:nth-child(2) { display: grid; min-width: 0; }
  .compact-files strong { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .compact-files small { color: var(--muted); font-size: .58rem; }
  .compact-status { color: var(--muted); }
  .compact-status.done { color: var(--success); }
  .compact-status.warning { color: var(--warning); }
  .quality-callout { display: flex; gap: .55rem; margin-top: 1rem; padding: .75rem; border: 1px solid; border-radius: var(--radius-sm); }
  .quality-callout.success { color: var(--success); border-color: #b5dfcf; background: var(--success-light); }
  .quality-callout.warning { color: var(--warning); border-color: #edcf97; background: var(--warning-light); }
  .quality-callout strong { display: block; font-size: .68rem; }
  .quality-callout p { margin-top: .15rem; color: inherit; font-size: .61rem; }
  .processing-issues { margin-top: 1rem; border: 1px solid #edcf97; border-radius: var(--radius-sm); background: var(--warning-light); overflow: hidden; }
  .processing-issues summary { display: flex; align-items: flex-start; gap: .55rem; padding: .75rem; color: var(--warning); cursor: pointer; list-style: none; }
  .processing-issues summary::-webkit-details-marker { display: none; }
  .processing-issues summary span { display: grid; gap: .12rem; }
  .processing-issues summary strong { font-size: .68rem; }
  .processing-issues summary small { font-size: .6rem; font-weight: 500; }
  .processing-issues ul { border-top: 1px solid #edcf97; background: white; }
  .processing-issues li { padding: .7rem; }
  .processing-issues li + li { border-top: 1px solid var(--border); }
  .processing-issues li > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .65rem; }
  .processing-issues li > div span { color: var(--danger); font-weight: 750; }
  .processing-issues li p { margin-top: .3rem; font-size: .65rem; }
  .processing-issues li > small { display: block; margin-top: .2rem; color: var(--muted); font-size: .59rem; }

  .review-shell { display: grid; grid-template-columns: var(--rail-width) minmax(30rem, 1fr) 19rem; min-height: min(67rem, calc(100vh - 14rem)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: clip; }
  .review-rail { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #f7fafb; }
  .rail-header { padding: 1.25rem; border-bottom: 1px solid var(--border); background: linear-gradient(150deg, white, #f2f8f9); }
  .rail-header h2 { margin: .35rem 0 .9rem; }
  .rail-progress > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .65rem; }
  .rail-progress > span strong { color: var(--brand); }
  .rail-progress > div { height: .32rem; border-radius: 999px; background: #dce8eb; overflow: hidden; }
  .rail-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
  .review-rail nav { flex: 1; padding: 1rem .65rem; }
  .rail-label { padding: 0 .6rem .45rem; color: var(--faint); font-size: .63rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
  .rail-item { position: relative; width: 100%; min-height: 2.7rem; display: flex; align-items: center; justify-content: space-between; padding: .55rem .65rem; border: 0; border-radius: .35rem; color: var(--ink-2); background: transparent; font-size: .74rem; font-weight: 650; text-align: left; }
  .rail-item:hover { color: var(--brand); background: white; }
  .rail-item.active { color: var(--brand-dark); background: var(--brand-light); }
  .rail-item.active::before { content: ""; position: absolute; left: -.65rem; width: 3px; height: 1.6rem; border-radius: 0 3px 3px 0; background: var(--brand); }
  .rail-item > span:last-child { min-width: 1.5rem; padding: .1rem .35rem; border-radius: 999px; color: var(--muted); background: white; font-size: .62rem; text-align: center; }
  .rail-summary { padding: 1rem .65rem; border-top: 1px solid var(--border); }
  .rail-summary button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .45rem; padding: .35rem .6rem; border: 0; color: var(--muted); background: transparent; font-size: .67rem; text-align: left; }
  .rail-summary button:hover { color: var(--ink); }
  .legend-dot { width: .48rem; height: .48rem; border-radius: 50%; }
  .legend-dot.conflict { background: var(--danger); }
  .legend-dot.pending { background: var(--warning); }
  .legend-dot.reviewed { background: var(--success); }
  .review-panel { min-width: 0; }
  .review-header { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; min-height: 6.6rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
  .review-header h2 { margin: .25rem 0; }
  .review-header p:not(.eyebrow) { max-width: 42rem; font-size: .75rem; }
  .review-quality-warning { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .75rem 1.5rem; color: var(--warning); border-bottom: 1px solid #edcf97; background: var(--warning-light); }
  .review-quality-warning strong { font-size: .72rem; }
  .review-quality-warning p { margin-top: .1rem; color: inherit; font-size: .64rem; }
  .review-assurance { display: grid; grid-template-columns: minmax(9rem, .7fr) minmax(28rem, 2fr); align-items: center; gap: .75rem 1rem; padding: .8rem 1.5rem; border-bottom: 1px solid var(--border); background: #f7fafb; }
  .review-assurance h3 { margin-top: .18rem; font-size: .78rem; }
  .review-assurance dl { display: grid; grid-template-columns: repeat(5, minmax(5.5rem, 1fr)); }
  .review-assurance dl > div { display: grid; gap: .12rem; padding: .25rem .65rem; border-left: 1px solid var(--border); }
  .review-assurance dt { color: var(--muted); font-size: .56rem; }
  .review-assurance dd { font-size: .72rem; font-weight: 750; }
  .review-assurance > p { grid-column: 2; color: var(--muted); font-size: .57rem; }
  .review-toolbar { position: sticky; top: var(--topbar-height); z-index: 5; display: flex; align-items: center; gap: .65rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }
  .search-field { position: relative; display: flex; align-items: center; width: min(100%, 24rem); }
  .search-field > svg { position: absolute; left: .7rem; z-index: 1; color: var(--muted); }
  .search-field input { width: 100%; padding: .5rem .7rem .5rem 2.15rem; font-size: .74rem; }
  .select-field select { padding: .45rem 2rem .45rem .65rem; font-size: .72rem; }
  .result-count { margin-left: auto; color: var(--muted); font-size: .68rem; white-space: nowrap; }
  .review-list { padding: 1rem 1.5rem 2rem; background: #fafcfc; }
  .review-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; padding: .75rem 1.5rem 1.25rem; border-top: 1px solid var(--border); background: #fafcfc; }
  .review-pagination > p { color: var(--muted); font-size: .64rem; }
  .review-pagination nav { display: flex; align-items: center; gap: .3rem; }
  .review-pagination button { min-width: 2rem; min-height: 2rem; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: .3rem; color: var(--ink-2); background: white; font-size: .65rem; font-weight: 700; }
  .review-pagination button:hover:not(:disabled) { color: var(--brand); border-color: #8ebcc7; background: var(--brand-soft); }
  .review-pagination button[aria-current="page"] { color: white; border-color: var(--brand); background: var(--brand); }
  .review-pagination button:disabled { color: var(--faint); cursor: not-allowed; }
  .pagination-gap { padding: 0 .15rem; color: var(--muted); }
  .field-card { margin-bottom: .65rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: white; overflow: hidden; }
  .field-card.expanded { border-color: #afcbd2; box-shadow: 0 4px 18px rgba(12, 39, 50, .06); }
  .field-summary { width: 100%; display: grid; grid-template-columns: auto minmax(13rem, 1.4fr) minmax(10rem, .8fr) auto auto; align-items: center; gap: .8rem; min-height: 4.3rem; padding: .7rem .85rem; border: 0; background: white; text-align: left; }
  .field-summary:hover { background: #fbfdfd; }
  .field-chevron { color: var(--muted); transition: transform .15s ease; }
  .field-card.expanded .field-chevron { transform: rotate(90deg); }
  .field-identity, .field-current { display: grid; gap: .16rem; min-width: 0; }
  .field-identity strong, .field-current strong { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .field-identity small, .field-current small { color: var(--muted); font-size: .61rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .field-current strong { color: var(--brand-dark); }
  .status-chip, .job-status { display: inline-flex; align-items: center; gap: .35rem; min-height: 1.55rem; padding: .18rem .48rem; border-radius: 999px; font-size: .61rem; font-weight: 750; white-space: nowrap; }
  .status-chip > span, .job-status > span { width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; }
  .status-chip.conflict, .job-status.failed { color: var(--danger); background: var(--danger-light); }
  .status-chip.pending, .job-status.partial { color: var(--warning); background: var(--warning-light); }
  .status-chip.reviewed, .job-status.completed { color: var(--success); background: var(--success-light); }
  .job-status.processing { color: var(--info); background: var(--info-light); }
  .candidate-count { color: var(--muted); font-size: .63rem; white-space: nowrap; }
  .field-detail { border-top: 1px solid var(--border); background: #fcfefe; }
  .field-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-alt); }
  .field-meta > span { display: grid; gap: .15rem; padding: .6rem 1rem; }
  .field-meta > span + span { border-left: 1px solid var(--border); }
  .field-meta small, .candidate-method small, .candidate-confidence small { color: var(--muted); font-size: .58rem; }
  .field-meta strong, .candidate-method strong, .candidate-confidence strong { font-size: .67rem; }
  .multi-value-note { display: flex; align-items: flex-start; gap: .5rem; padding: .65rem 1rem; color: var(--info); border-bottom: 1px solid #c8e2e8; background: var(--info-light); }
  .multi-value-note p { color: inherit; font-size: .64rem; }
  .candidate-fieldset { margin: 0; padding: .85rem; border: 0; }
  .candidate-fieldset legend { padding: 0 .15rem; color: var(--muted); font-size: .63rem; font-weight: 700; }
  .candidate-card { position: relative; display: flex; align-items: stretch; min-height: 4.7rem; margin-top: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: white; }
  .candidate-card.selected { border-color: #70aebd; box-shadow: inset 3px 0 var(--brand); }
  .candidate-card > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .candidate-card > input:focus-visible + .candidate-select { outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent); outline-offset: -3px; }
  .candidate-select { flex: 1; display: grid; grid-template-columns: auto minmax(9rem, 1fr) minmax(10rem, 1.35fr) minmax(6rem, .7fr) minmax(7rem, .8fr); align-items: center; gap: .7rem; min-width: 0; padding: .65rem .4rem .65rem .75rem; cursor: pointer; }
  .candidate-select:hover { background: #fafcfc; }
  .custom-control { position: relative; width: 1rem; height: 1rem; border: 1.5px solid var(--border-strong); border-radius: 50%; background: white; }
  input[type="checkbox"] + .candidate-select .custom-control { border-radius: .22rem; }
  .candidate-card > input:checked + .candidate-select .custom-control { border-color: var(--brand); background: var(--brand); }
  .candidate-card > input:checked + .candidate-select .custom-control::after { content: ""; position: absolute; left: .28rem; top: .1rem; width: .26rem; height: .48rem; border-right: 2px solid white; border-bottom: 2px solid white; transform: rotate(45deg); }
  input[type="radio"]:checked + .candidate-select .custom-control::after { left: .23rem; top: .23rem; width: .4rem; height: .4rem; border: 0; border-radius: 50%; background: white; }
  .candidate-value, .candidate-source, .candidate-method, .candidate-confidence { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; min-width: 0; }
  .candidate-value > strong { width: 100%; color: var(--ink); font-size: .94rem; }
  .candidate-value > strong small { font-size: .65rem; font-weight: 650; }
  .candidate-source { display: grid; gap: .15rem; }
  .candidate-source strong { font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .candidate-source small { color: var(--muted); font-size: .59rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .candidate-method, .candidate-confidence { display: grid; gap: .12rem; }
  .origin-chip, .applied-chip { display: inline-flex; align-items: center; min-height: 1.25rem; padding: .12rem .35rem; border-radius: .25rem; font-size: .54rem; font-weight: 800; }
  .origin-document, .origin-sheet { color: var(--brand-dark); background: var(--brand-light); }
  .origin-inferred { color: var(--ai); background: var(--ai-light); }
  .origin-default { color: #744c13; background: #f9edda; }
  .applied-chip { color: var(--muted); background: var(--surface-alt); }
  .evidence-button { align-self: center; display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; margin: 0 .6rem; padding: .3rem .5rem; border: 0; border-radius: .3rem; color: var(--brand); background: transparent; font-size: .61rem; font-weight: 750; }
  .evidence-button:hover { background: var(--brand-soft); }
  .evidence-panel { border-left: 1px solid var(--border); background: white; }
  .evidence-header { display: flex; align-items: flex-start; justify-content: space-between; min-height: 6.6rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); background: linear-gradient(155deg, white, #f8f5ff); }
  .evidence-header h2 { margin-top: .3rem; }
  .evidence-close { display: none; }
  .evidence-scroll { position: sticky; top: calc(var(--topbar-height) + 1rem); padding: 1rem 1.15rem 2rem; }
  .evidence-value { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
  .evidence-value small { width: 100%; color: var(--muted); font-size: .62rem; }
  .evidence-value > strong { font-size: 1.35rem; letter-spacing: -.025em; }
  .evidence-panel section { padding: 1rem 0; border-bottom: 1px solid var(--border); }
  .evidence-panel section h3 { margin-bottom: .65rem; }
  .evidence-list { display: grid; gap: .6rem; }
  .evidence-list div { display: grid; gap: .12rem; }
  .evidence-list dt { color: var(--muted); font-size: .58rem; }
  .evidence-list dd { font-size: .68rem; overflow-wrap: anywhere; }
  .evidence-panel blockquote { padding: .75rem; border-left: 3px solid var(--reservoir); border-radius: 0 .3rem .3rem 0; color: var(--ink-2); background: var(--reservoir-light); font-size: .69rem; line-height: 1.5; }
  .evidence-panel section p { margin-top: .6rem; font-size: .65rem; }
  .evidence-panel code { display: block; padding: .55rem; border: 1px solid var(--border); border-radius: .3rem; background: var(--surface-alt); }
  .rule-card { display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: start; }
  .rule-card > span { display: inline-grid; place-items: center; min-width: 2.3rem; min-height: 1.6rem; border-radius: .25rem; color: white; background: var(--ai); font-size: .62rem; font-weight: 800; }
  .rule-card p { margin: 0 !important; }
  .empty-state { display: grid; place-items: center; min-height: 16rem; color: var(--muted); text-align: center; }
  .empty-state svg { width: 2rem; height: 2rem; margin-bottom: .5rem; }
  .empty-state p { font-size: .75rem; }

  .delivery-main { padding: 2rem; }
  .delivery-illustration { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin-bottom: 1rem; border-radius: 50%; color: white; background: var(--success); box-shadow: 0 0 0 7px var(--success-light); }
  .delivery-illustration.warning { background: var(--warning); box-shadow: 0 0 0 7px var(--warning-light); }
  .delivery-illustration svg { width: 1.6rem; height: 1.6rem; }
  .delivery-quality-warning { margin-top: -.35rem; margin-bottom: 1rem; }
  .delivery-quality-warning button { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: 800; text-decoration: underline; }
  .delivery-main h2 { margin: .35rem 0 .45rem; font-size: 1.4rem; }
  .delivery-main > p:not(.eyebrow) { max-width: 45rem; }
  .delivery-main > .callout { margin: 1.5rem 0; }
  .artifact-grid { display: grid; gap: .65rem; }
  .artifact-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
  .artifact-card:hover { border-color: #afcbd2; background: #fcfefe; }
  .artifact-icon { display: grid; place-items: center; width: 2.8rem; height: 3.1rem; border-radius: .4rem; color: white; background: linear-gradient(145deg, var(--brand), #168a9c); font-size: .62rem; font-weight: 900; }
  .artifact-card h3 { font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
  .artifact-card > div > strong { display: block; margin-top: .15rem; font-size: .68rem; }
  .artifact-card p { margin-top: .15rem; color: var(--muted); font-size: .64rem; }
  .revision-panel { position: sticky; top: calc(var(--topbar-height) + 1rem); padding: 1.4rem; }
  .revision-panel h2 { margin: .3rem 0 1rem; }
  .revision-stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .revision-stats div { display: flex; align-items: center; justify-content: space-between; padding: .7rem; }
  .revision-stats div:nth-child(odd) { border-right: 1px solid var(--border); }
  .revision-stats div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .revision-stats dt { color: var(--muted); font-size: .63rem; }
  .revision-stats dd { font-size: .9rem; font-weight: 800; }
  .revision-panel hr { margin: 1.25rem 0; border: 0; border-top: 1px solid var(--border); }
  .revision-panel h3 { margin-bottom: .6rem; }
  .source-list { display: grid; gap: .55rem; margin-bottom: 1.25rem; }
  .source-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: center; }
  .source-list li > svg { color: var(--muted); }
  .source-list li > span { display: grid; min-width: 0; }
  .source-list strong { font-size: .65rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .source-list small { color: var(--muted); font-size: .57rem; }

  .dashboard-heading { align-items: center; }
  .dashboard-actions { display: flex; align-items: center; gap: .6rem; }
  .last-updated { color: var(--muted); font-size: .65rem; white-space: nowrap; }
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: .8rem; }
  .kpi-card { padding: 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); }
  .kpi-card > p { color: var(--muted); font-size: .68rem; font-weight: 650; }
  .kpi-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: .45rem 0 .15rem; }
  .kpi-card strong { font-size: 1.55rem; letter-spacing: -.03em; }
  .kpi-card span { padding: .18rem .35rem; border-radius: .25rem; font-size: .6rem; font-weight: 750; }
  .trend-positive { color: var(--success); background: var(--success-light); }
  .trend-warning { color: var(--warning); background: var(--warning-light); }
  .trend-neutral { color: var(--info); background: var(--info-light); }
  .kpi-card > small { color: var(--faint); font-size: .58rem; }
  .analytics-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
  .chart-card { min-width: 0; padding: 1.15rem; }
  .chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
  .chart-header h2 { margin-top: .25rem; font-size: .95rem; }
  .chart-header > strong { font-size: 1.25rem; }
  .chart-header > strong small { color: var(--muted); font-size: .55rem; font-weight: 600; }
  .line-chart { width: 100%; height: 10rem; overflow: visible; }
  .line-chart .grid-line { fill: none; stroke: #e5edef; stroke-width: .5; stroke-dasharray: 2 2; }
  .line-chart polyline { stroke: var(--brand); stroke-width: 2; }
  .line-chart circle { fill: white; stroke: var(--brand); stroke-width: 2; }
  .trend-card figcaption { margin-top: .35rem; color: var(--faint); font-size: .55rem; }
  .stacked-bar { display: flex; height: .65rem; margin: 1.4rem 0 1.1rem; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
  .stacked-bar i { display: block; height: 100%; }
  .bar-success { background: #1b9166; }
  .bar-warning { background: #e7a938; }
  .bar-danger { background: #d75b52; }
  .bar-info, .bar-blue { background: #3d8aaf; }
  .bar-teal { background: #118795; }
  .bar-purple { background: #7653b5; }
  .bar-legend { display: grid; gap: .65rem; }
  .bar-legend li { display: grid; grid-template-columns: auto 1fr auto 2.6rem; align-items: center; gap: .45rem; font-size: .66rem; }
  .legend-swatch { width: .5rem; height: .5rem; border-radius: 50%; }
  .bar-legend small { color: var(--muted); text-align: right; }
  .chart-data { margin-top: .8rem; }
  .chart-data summary { color: var(--brand); font-size: .6rem; font-weight: 700; }
  .chart-data table { width: 100%; margin-top: .5rem; border-collapse: collapse; font-size: .58rem; }
  .chart-data th, .chart-data td { padding: .3rem; border: 1px solid var(--border); text-align: left; }
  .insight-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: .8rem; margin-bottom: .8rem; }
  .contribution-card, .attention-card { padding: 1.15rem; }
  .contribution-list { padding-top: .7rem; }
  .contribution-row { display: grid; grid-template-columns: auto minmax(10rem, 1.3fr) minmax(6rem, 1fr) auto; align-items: center; gap: .7rem; padding: .48rem 0; }
  .contribution-row .file-type { width: 1.8rem; height: 1.95rem; font-size: .55rem; }
  .contribution-name { display: grid; min-width: 0; }
  .contribution-name strong { font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .contribution-name small { color: var(--muted); font-size: .56rem; }
  .contribution-bar { height: .38rem; border-radius: 999px; background: #e8eff1; overflow: hidden; }
  .contribution-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #20a2a2); }
  .contribution-bar i.failed { background: repeating-linear-gradient(45deg, #df7269 0 4px, #f2bbb6 4px 8px); }
  .contribution-row > strong { min-width: 4rem; font-size: .62rem; text-align: right; }
  .attention-list { padding-top: .55rem; }
  .attention-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; min-height: 4rem; padding: .55rem 0; }
  .attention-list li + li { border-top: 1px solid var(--border); }
  .attention-icon { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .45rem; }
  .attention-icon.danger { color: var(--danger); background: var(--danger-light); }
  .attention-icon.warning { color: var(--warning); background: var(--warning-light); }
  .attention-icon.info { color: var(--info); background: var(--info-light); }
  .attention-list strong { font-size: .68rem; }
  .attention-list p { margin-top: .1rem; color: var(--muted); font-size: .58rem; }
  .attention-list button { border: 0; color: var(--brand); background: transparent; font-size: .6rem; font-weight: 750; }
  .jobs-card { overflow: hidden; }
  .jobs-header { align-items: center; padding: 1rem 1.15rem; }
  .jobs-header .search-field { width: 16rem; }
  .table-scroll { overflow-x: auto; }
  .jobs-table { width: 100%; border-collapse: collapse; font-size: .68rem; }
  .jobs-table th, .jobs-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
  .jobs-table thead th { color: var(--muted); background: var(--surface-alt); font-size: .58rem; letter-spacing: .02em; text-transform: uppercase; }
  .jobs-table tbody tr:hover { background: #fbfdfd; }
  .jobs-table tbody th { font-weight: 650; }
  .jobs-table td > a { color: var(--brand); font-weight: 750; }
  .type-stack { display: inline-flex; margin-right: .35rem; }
  .type-stack i { padding: .12rem .25rem; border: 1px solid var(--border); color: var(--muted); background: var(--surface-alt); font-size: .48rem; font-style: normal; font-weight: 800; }
  .type-stack i + i { margin-left: -.05rem; }
  .jobs-table td small { color: var(--muted); font-size: .55rem; }
  .empty-cell { padding: 2rem !important; color: var(--muted); text-align: center !important; }

  .help-dialog { width: min(90vw, 34rem); max-height: min(90vh, 44rem); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: 0 25px 80px rgba(3, 29, 39, .28); }
  .help-dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
  .dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; }
  .dialog-header { border-bottom: 1px solid var(--border); }
  .dialog-header h2 { margin-top: .2rem; }
  .dialog-body { padding: 1.3rem; }
  .dialog-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
  .connection-copy { margin-bottom: 1rem; font-size: .78rem; }
  .dialog-field { display: grid; gap: .35rem; margin-top: .85rem; color: var(--ink-2); font-size: .72rem; font-weight: 750; }
  .dialog-field input { width: 100%; padding: .6rem .7rem; }
  .connection-note { margin-top: 1rem; }
  .dialog-error { margin-top: .85rem; padding: .65rem .75rem; border: 1px solid #f2b8b3; border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-light); font-size: .72rem; }
  .connection-footer { flex-wrap: wrap; }
  .dialog-spacer { flex: 1; }
  .button-danger { color: var(--danger); border-color: #e8b5b1; background: white; }
  .button-danger:hover { background: var(--danger-light); }
  .data-badge { display: inline-flex; align-items: center; width: max-content; margin-top: .45rem; padding: .2rem .45rem; border-radius: 999px; font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .data-badge.live { color: #0c6848; background: var(--success-light); }
  .data-badge.limited { color: var(--warning); background: var(--warning-light); }
  .data-badge.demo { color: var(--brand); background: var(--brand-light); }
  .dashboard-notice { margin: -.65rem 0 1rem; }
  .prose p, .prose li { font-size: .78rem; line-height: 1.65; }
  .prose ol { margin: .8rem 0; padding-left: 1.25rem; list-style: decimal; }
  .prose li + li { margin-top: .35rem; }
  .toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; }
  .toast { display: flex; align-items: center; gap: .6rem; max-width: 24rem; padding: .75rem 1rem; border: 1px solid #a9d9c6; border-radius: var(--radius-sm); color: #0c5f40; background: #effaf5; box-shadow: var(--shadow-md); font-size: .74rem; font-weight: 650; animation: toast-in .2s ease-out; }
  .toast-info { color: var(--info); border-color: #b7dce5; background: var(--info-light); }
  .toast-error { color: var(--danger); border-color: #efb5b0; background: var(--danger-light); }
}

@layer utilities {
  .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; }
  [hidden] { display: none !important; }
}

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes indeterminate { from { transform: translateX(-15%); } to { transform: translateX(155%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }

@media (max-width: 82rem) {
  .review-shell { grid-template-columns: 13rem minmax(30rem, 1fr); }
  .evidence-panel { position: fixed; inset: var(--topbar-height) 0 0 auto; z-index: 30; width: min(24rem, 92vw); box-shadow: -12px 0 35px rgba(12, 39, 50, .15); overflow-y: auto; }
  .evidence-close { display: inline-grid; }
  .review-shell.evidence-hidden .evidence-panel { display: none; }
}

@media (max-width: 68rem) {
  .topbar { grid-template-columns: 1fr auto; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; height: 2.8rem; justify-content: center; border-top: 1px solid var(--border); }
  .topbar { height: auto; min-height: var(--topbar-height); padding-top: .55rem; }
  .topbar-actions { grid-column: 2; }
  :root { --topbar-height: 7.35rem; }
  .files-layout, .processing-layout, .delivery-layout { grid-template-columns: 1fr; }
  .summary-panel, .revision-panel { position: static; }
  .summary-panel { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; }
  .summary-panel > * { grid-column: 2; }
  .summary-panel .summary-accent { grid-column: 1; grid-row: 1 / span 2; }
  .review-shell { grid-template-columns: 11rem minmax(28rem, 1fr); overflow-x: auto; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .trend-card { grid-column: 1 / -1; }
  .insight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 48rem) {
  :root { --topbar-height: 6.8rem; }
  .topbar { padding-inline: .8rem; gap: .5rem; }
  .brand-name, .brand-divider, .user-copy, .user-menu > svg, .demo-badge [data-connection-label] { display: none; }
  .demo-badge { min-width: 2.3rem; justify-content: center; padding-inline: .5rem; }
  .primary-nav { height: 2.6rem; }
  .nav-link { padding-inline: .8rem; }
  .workspace-page, .dashboard-page { padding: 1.1rem .75rem 2rem; }
  .page-header { display: block; }
  .header-meta { margin-top: .6rem; }
  .workflow ol { grid-template-columns: 1fr 1fr; }
  .workflow-step:nth-child(2)::after { display: none; }
  .workflow-step:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .workflow-step button { min-height: 3.8rem; padding: .6rem .7rem; }
  .workflow-step small { display: none; }
  .main-surface, .delivery-main { padding: 1rem; }
  .surface-header { display: block; }
  .counter-badge { margin-top: .5rem; }
  .drop-zone { grid-template-columns: auto 1fr; }
  .drop-zone .button { grid-column: 1 / -1; }
  .example-invite { align-items: stretch; flex-direction: column; }
  .file-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .file-status { display: none; }
  .processing-hero { min-height: 28rem; padding: 2rem 1rem; }
  .review-shell { display: block; min-height: 0; overflow: visible; }
  .evidence-panel { left: 0; right: 0; width: 100%; }
  .review-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  .rail-header { padding: 1rem; }
  .review-rail nav { display: flex; gap: .35rem; padding: .6rem; overflow-x: auto; }
  .rail-label { display: none; }
  .rail-item { width: auto; flex: 0 0 auto; min-height: 2.2rem; gap: .5rem; border: 1px solid var(--border); background: white; }
  .rail-item.active::before { display: none; }
  .rail-summary { display: none; }
  .review-header { display: block; padding: 1rem; }
  .review-header .button { margin-top: .8rem; }
  .review-quality-warning { grid-template-columns: auto 1fr; padding: .75rem; }
  .review-quality-warning .button { grid-column: 1 / -1; }
  .review-assurance { display: block; padding: .75rem; overflow-x: auto; }
  .review-assurance dl { min-width: 38rem; margin-top: .65rem; }
  .review-assurance > p { margin-top: .45rem; }
  .review-toolbar { top: var(--topbar-height); flex-wrap: wrap; padding: .65rem; }
  .search-field { width: 100%; max-width: none; }
  .result-count { margin-left: 0; }
  .review-list { padding: .65rem; }
  .review-pagination { align-items: flex-start; flex-direction: column; padding: .75rem; }
  .review-pagination nav { width: 100%; overflow-x: auto; padding-bottom: .2rem; }
  .field-summary { grid-template-columns: auto 1fr auto; gap: .55rem; }
  .field-current, .candidate-count { display: none; }
  .field-meta { grid-template-columns: 1fr; }
  .field-meta > span + span { border-left: 0; border-top: 1px solid var(--border); }
  .candidate-card { display: grid; grid-template-columns: 1fr auto; }
  .candidate-select { grid-template-columns: auto 1fr; grid-template-areas: "control value" ". source" ". method" ". confidence"; padding: .7rem; }
  .custom-control { grid-area: control; }
  .candidate-value { grid-area: value; }
  .candidate-source { grid-area: source; }
  .candidate-method { grid-area: method; }
  .candidate-confidence { grid-area: confidence; }
  .evidence-button { grid-column: 2; grid-row: 1; }
  .artifact-card { grid-template-columns: auto 1fr; }
  .artifact-card .button { grid-column: 1 / -1; }
  .dashboard-heading { display: block; }
  .dashboard-actions { margin-top: .8rem; flex-wrap: wrap; }
  .last-updated { width: 100%; }
  .kpi-grid, .analytics-grid { grid-template-columns: 1fr; }
  .trend-card { grid-column: auto; }
  .contribution-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .contribution-bar { display: none; }
  .jobs-header { display: grid; gap: .7rem; }
  .jobs-header .search-field { width: 100%; }
}

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