  :root {
    color-scheme: light;

    /* Material 3 tonal palette — Google baseline with adjustments */
    --primary:            #1A73E8;
    --primary-hover:      #185ABC;
    --primary-container:  #D3E3FD;
    --on-primary-container:#001B3E;

    --surface:            #FFFFFF;
    --surface-container-lowest: #FFFFFF;
    --surface-container-low:    #F8FAFD;
    --surface-container:        #F0F4F9;
    --surface-container-high:   #E7ECF0;
    --surface-container-highest:#DDE3EA;

    --on-surface:         #1F1F1F;
    --on-surface-variant: #444746;
    --on-surface-muted:   #757779;

    --outline:            #747775;
    --outline-variant:    #C4C7C5;
    --outline-thin:       #E1E3E1;

    --success:            #146C2E;
    --success-container:  #C8ECD0;
    --warning:            #8E4B10;
    --warning-container:  #FDDCC0;

    --sans: "Roboto", "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --mono: "Roboto Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

    /* Material 3 shape tokens */
    --shape-xs:  4px;
    --shape-sm:  8px;
    --shape-md:  12px;
    --shape-lg:  16px;
    --shape-xl:  28px;
    --shape-full:9999px;

    /* Material 3 elevation */
    --elev-1: 0 1px 2px rgba(0,0,0,0.05), 0 1px 3px 1px rgba(0,0,0,0.03);
    --elev-2: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px 2px rgba(0,0,0,0.06);
    --elev-3: 0 4px 8px 3px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --elev-4: 0 6px 10px 4px rgba(0,0,0,0.08), 0 2px 3px rgba(0,0,0,0.06);
  }

  html { font-size: 13px; }
  body {
    font-family: var(--sans);
    background: var(--surface-container-low);
    color: var(--on-surface);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    letter-spacing: 0.01em;
    margin: 0;
  }
  *, *::before, *::after { box-sizing: border-box; }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  input, select, textarea { font: inherit; color: inherit; }

  /* ============ APP BAR ============ */
  header {
    background: var(--surface);
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--elev-1);
  }
  .header-inner {
    width: 100%;
    padding: 11px 32px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    min-height: 58px;
  }
  .brand-title {
    font-weight: 600;
    font-size: 21px;
    color: var(--primary);
    letter-spacing: 0;
    line-height: 1.15;
    text-align: center;
  }
  .header-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    margin-left: 8px;
    font-size: 13px; color: var(--on-surface-variant);
  }
  .header-breadcrumb:empty { display: none; }
  .header-crumb-sep {
    color: var(--outline-variant); font-size: 11px;
  }
  .header-crumb {
    color: var(--on-surface-variant); font-weight: 400;
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .header-crumb-link {
    color: var(--primary); cursor: pointer; font-weight: 400;
  }
  .header-crumb-link:hover { text-decoration: underline; }
  .company-logo {
    height: 38px; width: auto;
    display: block;
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* ============ MAIN ============ */
  main {
    max-width: 1280px; margin: 0 auto;
    padding: 24px 32px 56px;
  }

  /* ============ BUTTONS — Material 3 ============ */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 18px; border-radius: var(--shape-full);
    font-size: 13px; font-weight: 500;
    letter-spacing: 0.006em;
    font-family: inherit;
    white-space: nowrap;
    transition: box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
    border: 0 solid transparent;
    position: relative;
    overflow: hidden;
  }
  .btn svg { width: 16px; height: 16px; }
  .btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
  .btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: var(--elev-1);
  }
  .btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--elev-2);
  }
  .btn-outline {
    color: var(--primary);
    border: 1px solid var(--outline-variant);
    background: transparent;
    padding: 6px 17px;
  }
  .btn-outline:hover {
    background: rgba(26,115,232,0.08);
    border-color: var(--primary);
  }
  .btn-text {
    color: var(--primary);
    background: transparent;
    padding: 7px 10px;
  }
  .btn-text:hover { background: rgba(26,115,232,0.08); }
  .btn-sm { padding: 4px 12px; font-size: 12px; }
  .btn-outline.btn-sm { padding: 3px 11px; }
  .btn-text.btn-sm { padding: 4px 8px; }
  .btn-lg { padding: 9px 24px; font-size: 13.5px; }
  .btn-md { padding: 7px 18px; font-size: 12.5px; }
  .btn-md svg { vertical-align: middle; }

  /* ============ FILES + PREVIEW (legacy — inert; new review view uses .rev-* + .review-preview-*) ============ */
  .files-section { margin-bottom: 20px; }
  /* ============ RESULTS TASKBAR ============ */
  .results-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin: 4px 0 16px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--shape-md);
    box-shadow: var(--elev-1);
  }
  .results-heading-left {
    display: flex; align-items: center; justify-content: flex-start;
    min-width: 0;
  }
  .results-heading-center {
    display: flex; align-items: center; justify-content: center;
    gap: 6px;
    min-width: 0;
  }
  .results-heading-right {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px;
    min-width: 0;
  }
  .results-title {
    font-family: "Google Sans", var(--sans);
    font-size: 16px;
    font-weight: 500;
    color: var(--on-surface);
    letter-spacing: -0.005em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    line-height: 1;
    padding: 0 8px;
  }

  /* Prev / Next — grayscale MD3 text buttons */
  .results-nav-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent; cursor: pointer;
    color: var(--on-surface-variant);
    font-family: var(--sans);
    font-size: 13px; font-weight: 500;
    line-height: 1;
    border-radius: var(--shape-full);
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
  }
  .results-nav-btn svg { display: block; }
  .results-nav-btn:hover:not(:disabled) {
    background: var(--surface-container);
    color: var(--on-surface);
  }
  .results-nav-btn:active:not(:disabled) {
    background: var(--surface-container-high);
  }
  .results-nav-btn:focus-visible {
    outline: 2px solid var(--outline);
    outline-offset: 2px;
  }
  .results-nav-btn:disabled {
    color: var(--outline-variant);
    cursor: not-allowed;
  }
  .results-nav-pos {
    font-size: 12px; color: var(--on-surface-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    padding: 0 4px;
  }

  /* ============ CARDS ============ */
  .card {
    background: var(--surface);
    border-radius: var(--shape-md);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--elev-1);
    transition: box-shadow 0.18s ease;
  }
  .card:hover { box-shadow: var(--elev-2); }
  .card-header {
    padding: 12px 18px 10px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
  }
  .card-header h2 {
    font-weight: 500;
    font-size: 14px; color: var(--on-surface);
    letter-spacing: 0;
    line-height: 1.3;
  }
  .card-body { padding: 2px 18px 16px; }
  .card-body.tight { padding: 0; }

  /* ============ TABLE ============ */
  table {
    width: 100%; border-collapse: collapse;
    font-size: 12.5px;
  }
  thead th {
    background: var(--surface-container-low);
    color: var(--on-surface-variant);
    font-weight: 500;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0.02em;
    padding: 9px 18px;
    text-align: left;
    border-bottom: 1px solid var(--outline-thin);
    white-space: nowrap;
  }
  tbody td {
    padding: 9px 18px;
    border-bottom: 1px solid var(--outline-thin);
    color: var(--on-surface);
    vertical-align: middle;
  }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr:hover td { background: var(--surface-container-low); }

  code {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--surface-container);
    padding: 2px 6px; border-radius: var(--shape-xs);
    color: var(--on-surface-variant);
    letter-spacing: 0;
  }
  .inventory-reason {
    font-size: 11.5px;
    color: var(--on-surface-variant);
  }
  .inventory-reason.muted { color: var(--on-surface-muted); }

  /* ============ BADGES / CHIPS ============ */
  .badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--shape-sm);
    font-size: 10px; font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
  }
  .badge-green {
    background: var(--success-container); color: var(--success);
    border-color: transparent;
  }
  .badge-orange {
    background: var(--warning-container); color: var(--warning);
    border-color: transparent;
  }
  .badge-blue {
    background: var(--primary-container); color: var(--on-primary-container);
    border-color: transparent;
  }
  .badge-computed {
    background: var(--surface-container-high); color: var(--on-surface-variant);
    border-color: transparent;
  }
  .badge-gray {
    background: var(--surface-container-high); color: var(--on-surface-variant);
    border-color: transparent;
  }

  /* ============ SUMMARY BODY ============ */
  .summary-text {
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--on-surface);
    white-space: pre-wrap;
    letter-spacing: 0.01em;
  }

  /* ============ COMPLETENESS ============ */
  .completion-hero {
    display: flex; align-items: center;
    gap: 20px; margin-bottom: 14px;
    padding: 16px 18px;
    background: var(--surface-container-low);
    border-radius: var(--shape-md);
  }
  /* Progress ring — the conic-gradient draws the arc; the inner white circle
     is the "hole" that turns the disk into a ring. Colors are set per-status
     via .is-low / .is-mid / .is-high on the ring. */
  .completion-ring {
    --pct: 0;
    --size: 104px;
    --thickness: 10px;
    --track: var(--surface-container-high);
    --fill: var(--primary);
    width: var(--size); height: var(--size);
    border-radius: 50%;
    background: conic-gradient(var(--fill) calc(var(--pct) * 1%), var(--track) 0);
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: background 0.4s ease;
  }
  .completion-ring-inner {
    width: calc(var(--size) - var(--thickness) * 2);
    height: calc(var(--size) - var(--thickness) * 2);
    border-radius: 50%;
    background: var(--surface);
    display: grid; place-items: center;
  }
  .completion-ring-number {
    font-size: 30px; font-weight: 500;
    color: var(--fill);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.4s ease;
  }
  .completion-ring-number .completion-score-pct {
    font-size: 14px; font-weight: 400;
    margin-left: 1px;
    opacity: 0.65;
  }
  /* Match the index-card completeness colors: low uses the same red
     (#D93025) as .completeness-low, mid/high already share the tokens. */
  .completion-ring.is-low  { --fill: #D93025; }
  .completion-ring.is-mid  { --fill: var(--primary); }
  .completion-ring.is-high { --fill: var(--success); }

  .completion-hero-text {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 6px;
  }
  .completion-summary {
    font-size: 13px;
    color: var(--on-surface);
    line-height: 1.4;
    font-weight: 500;
  }
  .completion-summary strong {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--on-surface);
  }
  .completion-explanation {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--on-surface-variant);
    max-width: 82ch;
    white-space: nowrap;
  }
  .completion-explanation strong { color: var(--on-surface); font-weight: 500; }
  .completion-explanation .nowrap { white-space: nowrap; }

  .completion-chips {
    display: flex; flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
  }
  .completion-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px 3px 9px;
    border-radius: var(--shape-sm);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0;
    border: 1px solid var(--outline-variant);
    background: var(--surface);
    color: var(--on-surface);
    font-variant-numeric: tabular-nums;
    transition: background 0.12s;
  }
  .completion-chip:hover { background: var(--surface-container); }
  .completion-chip-count {
    font-size: 10.5px;
    opacity: 0.6;
    font-weight: 400;
  }
  .completion-chip-full {
    background: var(--success-container);
    color: var(--success);
    border-color: transparent;
  }
  .completion-chip-full:hover { background: var(--success-container); filter: brightness(0.96); }
  .completion-chip-partial {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-color: transparent;
  }
  .completion-chip-empty {
    background: var(--surface);
    color: var(--on-surface-variant);
    border-color: var(--outline-variant);
  }

  .completion-docs {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-container);
    border-radius: var(--shape-sm);
    font-size: 11.5px;
  }
  .completion-docs-label {
    color: var(--on-surface-variant);
    font-weight: 500;
    margin-right: 2px;
  }
  .completion-docs-chip {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: var(--shape-sm);
    font-size: 10.5px; font-weight: 500;
    background: var(--warning-container); color: var(--warning);
  }

  .completion-drawer-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; border: 0;
    padding: 6px 10px;
    margin-top: 8px;
    margin-left: -10px;
    border-radius: var(--shape-full);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
  }
  .completion-drawer-toggle:hover { background: rgba(26,115,232,0.08); }
  .completion-drawer-caret { display: inline-flex; line-height: 0; }

  /* ============ EXTRACTED DATA ============ */
  /* Material 3 Primary Tabs — underline indicator, no borders, no pills */
  .tabs {
    display: flex; gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    align-items: stretch;
    border-bottom: 1px solid var(--outline-thin);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .tab-btn {
    padding: 9px 14px 8px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--on-surface-variant);
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
    letter-spacing: 0.006em;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    position: relative;
  }
  .tab-btn:hover {
    background: rgba(26,115,232,0.04);
    color: var(--on-surface);
  }
  .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
  }
  .tab-btn.active .badge {
    background: var(--primary-container);
    color: var(--on-primary-container);
  }
  .tab-btn .badge {
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
    font-size: 10px;
    padding: 1px 6px;
    letter-spacing: 0;
  }
  .tab-separator {
    display: inline-flex; align-self: center;
    width: 1px; height: 18px;
    background: var(--outline-thin);
    margin: 0 6px;
    flex-shrink: 0;
  }

  .field-list {
    display: grid;
    gap: 0;
    background: var(--surface);
    border-radius: var(--shape-sm);
    overflow: hidden;
  }
  .field-list-header {
    display: flex; align-items: center;
    padding: 8px 16px;
    background: var(--surface-container-low);
    gap: 12px;
    border-bottom: 1px solid var(--outline-thin);
  }
  .field-list-header span {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--on-surface-variant);
    text-transform: none;
    letter-spacing: 0.03em;
  }
  .field-name-header { min-width: 190px; max-width: 190px; }
  .field-value-header { flex: 1; }
  .source-header { width: 200px; text-align: left; flex-shrink: 0; }
  .other-sources-header { width: 240px; text-align: left; flex-shrink: 0; }

  .field-row {
    display: flex; align-items: center;
    padding: 8px 16px;
    background: var(--surface);
    gap: 12px;
    border-bottom: 1px solid var(--outline-thin);
    transition: background 0.12s;
  }
  .field-row:last-child { border-bottom: 0; }
  .field-row:hover { background: var(--surface-container-low); }
  .field-row .field-name {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--on-surface-variant);
    min-width: 190px;
    max-width: 190px;
    padding-top: 0;
    flex-shrink: 0;
  }
  .field-row .field-value {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--on-surface);
    flex: 1;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
  }
  .field-row .field-value.currency {
    font-weight: 500;
    letter-spacing: -0.005em;
  }
  .null-value {
    color: var(--on-surface-muted);
    font-weight: 400;
  }
  .source-col {
    width: 200px; flex-shrink: 0;
    display: flex; align-items: center;
  }
  .field-row .source-badge {
    font-size: 10.5px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: var(--shape-sm);
    background: var(--primary-container);
    color: var(--on-primary-container);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
    font-family: inherit;
    display: inline-block;
  }
  .field-row .other-sources {
    width: 240px;
    display: flex; flex-wrap: wrap; gap: 4px;
    justify-content: flex-start;
    flex-shrink: 0;
    align-items: center;
  }
  .source-badge-other {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px; border-radius: var(--shape-sm);
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
    font-family: inherit;
  }

  /* ============ EXPORT TOOLBAR ============ */
  .export-toolbar {
    margin-top: 20px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--shape-md);
    box-shadow: var(--elev-1);
  }
  .export-actions {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
  }
  .toolbar-divider {
    width: 1px; height: 20px;
    background: var(--outline-variant);
    margin: 0 4px;
  }
  .push-config {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--surface-container-low);
    border-radius: var(--shape-sm);
    display: none;
  }
  .push-config.open { display: block; }
  .push-config-row {
    display: flex; align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .push-label {
    font-size: 11.5px;
    color: var(--on-surface-variant);
    min-width: 88px;
    font-weight: 500;
  }
  .push-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--shape-xs);
    font-size: 12px;
    font-family: var(--mono);
    color: var(--on-surface);
    background: var(--surface);
    outline: 0;
    transition: border-color 0.12s;
  }
  .push-input:focus {
    border-color: var(--primary);
    border-width: 2px;
    padding: 6px 9px;
  }
  .push-config-actions {
    display: flex; gap: 8px;
    margin-top: 10px;
  }

  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }

  /* ============ HOME VIEW (Material) ============ */
  .home-hero {
    margin-bottom: 24px;
    max-width: 720px;
  }
  .home-title {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 28px;
    color: var(--on-surface);
    letter-spacing: -0.005em;
    line-height: 1.15;
    margin-bottom: 8px;
  }
  .home-subtitle {
    font-size: 14px;
    color: var(--on-surface-variant);
    line-height: 1.5;
    max-width: 62ch;
  }

  /* Form — Material outlined text fields */
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .form-field { display: flex; flex-direction: column; gap: 6px; }
  .form-field.full { grid-column: 1 / -1; }
  .form-label {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--on-surface-variant);
    letter-spacing: 0.03em;
  }
  .form-input, .form-select {
    padding: 9px 13px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--shape-xs);
    font-size: 13px;
    font-family: var(--sans);
    color: var(--on-surface);
    background: var(--surface);
    outline: 0;
    transition: border-color 0.12s;
    box-sizing: border-box;
    width: 100%;
  }
  .form-input::placeholder { color: var(--on-surface-muted); }
  .form-input:hover, .form-select:hover { border-color: var(--outline); }
  .form-input:focus, .form-select:focus {
    border-color: var(--primary);
    border-width: 2px;
    padding: 8px 12px;
  }
  .form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23444746' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3 5l3 3 3-3'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
  }
  .form-select:invalid { color: var(--on-surface-muted); }
  .form-select option { color: var(--on-surface); }

  /* Segmented button — Material 3 */
  .segmented {
    display: inline-flex;
    border: 1px solid var(--outline-variant);
    border-radius: var(--shape-full);
    padding: 0;
    width: 100%;
    overflow: hidden;
    background: var(--surface);
  }
  .segmented button {
    flex: 1;
    padding: 7px 14px;
    border: 0;
    background: transparent;
    color: var(--on-surface-variant);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    letter-spacing: 0.006em;
  }
  .segmented button:not(:last-child) { border-right: 1px solid var(--outline-variant); }
  .segmented button:hover:not(.on) {
    background: rgba(26,115,232,0.06);
    color: var(--on-surface);
  }
  .segmented button.on {
    background: var(--primary-container);
    color: var(--on-primary-container);
    font-weight: 500;
  }

  /* Source cards grid — Material */
  .source-subhead {
    font-size: 13px;
    color: var(--on-surface-variant);
    margin: 0 0 14px;
    line-height: 1.5;
  }
  .source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 340px);
    gap: 12px;
  }
  .source-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--shape-md);
    padding: 18px 18px 16px;
    display: flex; align-items: flex-start; gap: 14px;
    box-shadow: var(--elev-1);
    transition: box-shadow 0.15s, background 0.12s;
    text-align: left;
    font-family: var(--sans);
    color: inherit;
    cursor: default;
  }
  .source-card.disabled {
    opacity: 0.65;
    box-shadow: none;
    background: var(--surface-container);
  }
  .source-card.available { cursor: pointer; }
  .source-card.available:hover {
    background: rgba(26,115,232,0.04);
    box-shadow: var(--elev-2);
  }
  .source-card.available:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
  .source-card-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: var(--shape-full);
    background: var(--primary-container);
    color: var(--on-primary-container);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .source-card.disabled .source-card-icon {
    background: var(--surface-container-high);
    color: var(--on-surface-muted);
  }
  .source-card-icon svg { width: 18px; height: 18px; }
  .source-card-body {
    display: flex; flex-direction: column; gap: 3px;
    flex: 1; min-width: 0; padding-right: 84px;
  }
  .source-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--on-surface);
    letter-spacing: 0;
  }
  .source-card-desc {
    font-size: 12px;
    color: var(--on-surface-variant);
    line-height: 1.45;
  }
  .source-card-soon,
  .source-card-avail {
    position: absolute;
    top: 12px; right: 12px;
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--shape-sm);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.02em;
  }
  .source-card-soon {
    background: var(--warning-container); color: var(--warning);
  }
  .source-card-avail {
    background: var(--success-container); color: var(--success);
  }

  /* Drag-over highlight for the empty-state upload card */
  .upload-card.is-dragover {
    box-shadow: var(--elev-3);
    background: var(--primary-container);
  }

  /* Smooth cross-fade when the workspace switches between empty and populated. */
  #workspaceEmpty, #workspacePopulated { transition: opacity 220ms ease; }
  .workspace-fade-in {
    animation: workspaceFadeIn 260ms ease both;
  }
  @keyframes workspaceFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Back link — Material text button */
  .back-link-row { margin-bottom: 18px; }
  .back-link {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 0;
    padding: 6px 12px 6px 8px;
    margin-left: -8px;
    border-radius: var(--shape-full);
    color: var(--primary);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s;
    letter-spacing: 0.006em;
  }
  .back-link svg { display: block; }
  .back-link:hover { background: rgba(26,115,232,0.08); }

  /* Secondary alt-source row (coming-soon connector, compact) */
  .alt-source {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface-container);
    border-radius: var(--shape-md);
    opacity: 0.75;
  }
  .alt-source-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: var(--shape-full);
    background: var(--surface-container-high);
    color: var(--on-surface-muted);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .alt-source-icon svg { width: 15px; height: 15px; }
  .alt-source-body {
    display: flex; flex-direction: column; gap: 1px;
    flex: 1; min-width: 0;
  }
  .alt-source-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface);
    letter-spacing: 0;
  }
  .alt-source-desc {
    font-size: 12px;
    color: var(--on-surface-variant);
    line-height: 1.4;
  }
  .alt-source-soon {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--shape-sm);
    font-size: 10.5px; font-weight: 500;
    background: var(--warning-container); color: var(--warning);
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }

  /* Disabled button + coming-soon inline pill (Push to System) */
  .btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  .btn-soon-wrap {
    display: inline-flex; align-items: center; gap: 8px;
  }
  .btn-soon {
    font-size: 11.5px;
    color: var(--on-surface-variant, #6b7280);
  }

  @media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
  }

/* =========================================================================
   Compatibility layer — maps class names emitted dynamically by app.js
   to Material tokens defined above. Same visual system, extended coverage.
   ========================================================================= */

.hidden { display: none !important; }

/* ---- Loading overlay (processing) ---- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s ease;
}
.loading-overlay.hidden { display: none !important; }
.loading-content { text-align: center; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--outline-thin);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content h2 {
  font-size: 16px; font-weight: 500;
  color: var(--on-surface); margin-bottom: 4px;
}
.loading-content p {
  color: var(--on-surface-variant); font-size: 13px;
}

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  padding: 8px 10px 8px 18px;
  border-radius: var(--shape-sm);
  font-size: 13px; font-weight: 400;
  z-index: 2000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: var(--elev-3);
  max-width: 420px;
  color: #E3E3E3;
  background: #2E3033;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0;
}
.toast.hidden { transform: translateY(12px); opacity: 0; pointer-events: none; }
.toast.error { background: #B3261E; color: white; }
.toast.success {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border: 1px solid rgba(26,115,232,0.35);
  box-shadow: var(--elev-3);
}
.toast-msg { flex: 1 1 auto; padding: 4px 0; }
/* Tonal button — same visual language as Material 3 tonal buttons so the
   action reads as clickable at a glance, distinct from the message text. */
.toast-action {
  flex-shrink: 0;
  border: none;
  background: rgba(168,199,250,0.18);
  color: #A8C7FA;
  font: inherit;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  padding: 6px 16px;
  border-radius: var(--shape-full);
  cursor: pointer;
  transition: background 0.15s ease;
}
.toast-action:hover { background: rgba(168,199,250,0.28); }
.toast-action:focus-visible {
  outline: 2px solid #A8C7FA;
  outline-offset: 2px;
}
/* On the red error toast, keep the action button legible against red — use
   white ink on white-tint rather than the dark-surface blue tint. */
.toast.error .toast-action {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.toast.error .toast-action:hover { background: rgba(255,255,255,0.26); }
/* On the light-blue success toast, use primary ink on a translucent primary tint
   so the action reads clearly against the pale container background. */
.toast.success .toast-action {
  background: rgba(26,115,232,0.12);
  color: var(--primary);
}
.toast.success .toast-action:hover { background: rgba(26,115,232,0.20); }
.toast.success .toast-action:focus-visible { outline-color: var(--primary); }

/* ---- Table container (Document Inventory wrapper) ---- */
.table-container { overflow-x: auto; }

/* ---- Underwriting summary body ---- */
.summary-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--on-surface);
  white-space: pre-wrap;
  letter-spacing: 0.01em;
}

/* ---- Field-value variants used inside .field-row ---- */
.field-row .field-value.currency { font-weight: 500; }
.field-row .field-value.date-value {
  font-family: var(--mono);
  color: var(--primary);
}
.field-row .field-value.boolean-true { color: var(--success); }
.field-row .field-value.boolean-false { color: var(--on-surface-muted); }
.field-row .field-value.null-value {
  color: var(--on-surface-muted);
  font-weight: 400;
}
.null-value {
  color: var(--on-surface-muted);
  font-weight: 400;
}

/* Fourth column of a field-row: source badge or Computed pill */
.field-row .field-source-cell {
  width: 200px;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}

/* Manual overwrite variant of source-badge */
.source-badge.source-badge-manual {
  background: var(--warning-container);
  color: var(--warning);
}

/* Small pill next to source when value was manually overridden */
.edited-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: var(--shape-sm);
  font-size: 10.5px; font-weight: 500;
  background: var(--warning-container);
  color: var(--warning);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

/* Conflict / warning indicator — filled pill so it reads as a "review this"
   affordance rather than a stray emoji. */
.conflict-icon {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 8px;
  width: 22px; height: 22px;
  border-radius: var(--shape-full);
  background: var(--warning-container);
  color: var(--warning);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, transform 0.12s;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(142, 75, 16, 0.18) inset;
}
.conflict-icon svg { width: 14px; height: 14px; display: block; }
.conflict-icon:hover {
  transform: scale(1.06);
  box-shadow: var(--elev-1), 0 0 0 1px rgba(142, 75, 16, 0.28) inset;
}
.conflict-icon.overridden {
  background: var(--primary-container);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.22) inset;
}
.conflict-icon.overridden:hover {
  box-shadow: var(--elev-1), 0 0 0 1px rgba(26, 115, 232, 0.32) inset;
}

/* ---- Field-search autocomplete dropdown ---- */
.field-search-wrapper {
  position: relative; margin-bottom: 12px;
}
.field-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-full);
  font-size: 13px;
  color: var(--on-surface);
  background: var(--surface);
  outline: 0;
  transition: border-color 0.12s;
  font-family: inherit;
}
.field-search-input:focus {
  border-color: var(--primary);
  border-width: 2px;
  padding: 9px 13px;
}
.field-search-input::placeholder { color: var(--on-surface-muted); }
.field-search-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--shape-md);
  box-shadow: var(--elev-3);
  z-index: 500;
  margin-top: 4px;
  display: none;
}
.field-search-dropdown.visible { display: block; }
.field-search-item {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--on-surface);
  transition: background 0.12s;
}
.field-search-item:hover,
.field-search-item.highlighted {
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.field-search-item mark {
  background: transparent; color: var(--primary); font-weight: 500;
}
.field-search-item .field-search-category {
  font-size: 10.5px; color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-left: 8px;
}
@keyframes flash-highlight {
  0%   { background: var(--warning-container); }
  70%  { background: var(--warning-container); }
  100% { background: var(--surface); }
}
.field-row.highlighted { animation: flash-highlight 2s ease-out; }

/* ---- Tab content visibility (data-tabs system) ---- */
.tab-content { display: none; }
.tab-content.active { display: block; }
/* Nested-object tabs behave like regular tabs; badge color signals the
   different field kind. */
.nested-tab-btn .badge {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* ---- Nested tables (Claims, Locations, Exposures, Limits, etc.) ---- */
.nested-table-container { overflow-x: auto; }
.nested-table {
  /* auto-layout + min-width: 100% lets columns size to their content and
     pushes overflow into the scroll container, so narrow "State"/"Zip"
     columns stay compact while "Address"/"Building Description" get room
     to breathe instead of wrapping into 3-line stacks. */
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.nested-table thead th {
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.03em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--outline-thin);
  text-align: left; white-space: nowrap;
}
.nested-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--outline-thin);
  color: var(--on-surface);
  vertical-align: top;
  /* Header labels (white-space: nowrap) set each column's floor width, so
     ID columns stay tight while long-text cells wrap at max-width. */
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nested-table tbody td.nested-currency {
  white-space: nowrap;
}
.nested-table tbody tr:hover { background: var(--surface-container-low); }
.nested-table tbody tr:last-child td { border-bottom: 0; }
.nested-table .nested-currency {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.limits-table td:first-child {
  font-weight: 500;
  color: var(--on-surface-variant);
  min-width: 160px;
}
.limits-table .limit-header {
  font-weight: 500;
}

/* ---- Extracted Data card header actions (Edit fields + active bar) ---- */
.extracted-data-actions {
  display: flex; align-items: center; gap: 8px;
}
.edit-active-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 4px 4px 14px;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-full);
}
.edit-active-bar.hidden { display: none; }
.edit-pending-count {
  font-size: 12px; font-weight: 500;
  color: var(--on-surface-variant);
  letter-spacing: 0.01em;
}

/* ---- Edit-mode inputs (scalar row inputs + nested-cell inputs) ---- */
.edit-mode-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-sm);
  background: var(--surface);
  color: var(--on-surface);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  outline: 0;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.edit-mode-input:hover { border-color: var(--outline); }
.edit-mode-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
  background: var(--surface);
}
.edit-mode-input::placeholder { color: var(--on-surface-muted); }
select.edit-mode-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23444746' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 10px;
  cursor: pointer;
}
.edit-mode-input[type="date"] { min-width: 140px; }
.edit-mode-input-wide { min-height: 68px; padding: 8px 10px; }
.edit-mode-input-cell { padding: 5px 8px; font-size: 12px; }

/* ---- Editable cells (edit mode toggle inside nested tables) ---- */
.editable-cell { padding: 8px 12px; border-bottom: 1px solid var(--outline-thin); vertical-align: top; }
.editable-cell.readonly-cell { color: var(--on-surface-variant); }
.editable-cell.edited-cell {
  background: rgba(26,115,232,0.06);
  box-shadow: inset 2px 0 0 var(--primary);
}
.editable-cell-value { display: inline-block; }

/* ---- Conflict popover (opened from conflict-icon) ---- */
.conflict-overlay { position: fixed; inset: 0; z-index: 900; }
.conflict-popover {
  position: fixed; z-index: 1000;
  background: var(--surface);
  border-radius: var(--shape-lg);
  box-shadow: var(--elev-3);
  border: 1px solid var(--outline-thin);
  min-width: 380px; max-width: 460px;
  padding: 0;
  overflow: hidden;
  animation: popover-in 0.15s ease;
}
@keyframes popover-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.conflict-popover-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--outline-thin);
}
.conflict-popover-header-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.conflict-popover-header h3 {
  margin: 0;
  font-size: 15px; font-weight: 500;
  color: var(--on-surface);
  line-height: 1.3;
  letter-spacing: 0;
}
.conflict-popover-meta {
  font-size: 11.5px;
  color: var(--on-surface-muted);
  letter-spacing: 0.02em;
}
.conflict-popover-reset {
  font-size: 11.5px; font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--shape-full);
  background: transparent;
  color: var(--primary);
  border: 0;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.conflict-popover-reset:hover { background: rgba(26,115,232,0.08); }
.conflict-popover-close {
  background: transparent; border: none;
  width: 28px; height: 28px;
  border-radius: var(--shape-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; cursor: pointer;
  color: var(--on-surface-variant); padding: 0;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.conflict-popover-close:hover {
  color: var(--on-surface);
  background: var(--surface-container);
}
.conflict-popover-body {
  padding: 8px;
  max-height: 360px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.conflict-popover-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--shape-md);
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.12s, border-color 0.12s;
  outline: none;
}
.conflict-popover-item.selectable { cursor: pointer; }
.conflict-popover-item.selectable:hover {
  background: var(--surface-container-low);
}
.conflict-popover-item.selectable:focus-visible {
  border-color: var(--primary);
}
.conflict-popover-item.winner {
  background: var(--success-container);
  border-color: transparent;
}
.conflict-popover-radio {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: var(--shape-full);
  border: 2px solid var(--outline);
  position: relative;
  transition: border-color 0.12s;
}
.conflict-popover-item.selectable:hover .conflict-popover-radio {
  border-color: var(--on-surface-variant);
}
.conflict-popover-item.winner .conflict-popover-radio {
  border-color: var(--success);
}
.conflict-popover-item.winner .conflict-popover-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--shape-full);
  background: var(--success);
}
.conflict-popover-item-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.conflict-popover-item-value {
  font-size: 13px; font-weight: 500;
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.35;
}
.conflict-popover-item-value .null-value {
  color: var(--on-surface-muted);
  font-weight: 400;
}
.conflict-popover-item-source {
  font-size: 11.5px;
  color: var(--on-surface-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: 0.01em;
}
.conflict-popover-item-default-tag {
  flex-shrink: 0;
  font-size: 10px; font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--shape-full);
  background: var(--surface);
  color: var(--on-surface-variant);
  border: 1px solid var(--outline-variant);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.conflict-popover-item.winner .conflict-popover-item-default-tag {
  background: var(--success);
  color: #fff;
  border-color: transparent;
}

/* ---- Field picker modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 1500;
  animation: modalFadeIn 0.14s ease-out;
}
.modal-overlay.hidden { display: none; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog {
  background: var(--surface);
  border-radius: var(--shape-lg);
  box-shadow: var(--elev-4);
  width: 100%; max-width: 840px; max-height: 84vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--outline-thin);
}
.modal-header h2 {
  margin: 0 0 4px; font-size: 18px; font-weight: 500;
  color: var(--on-surface);
}
.modal-subtitle {
  margin: 0; font-size: 13px;
  color: var(--on-surface-variant); line-height: 1.5;
  max-width: 640px;
}
.modal-close {
  background: transparent; border: none;
  padding: 6px; color: var(--on-surface-variant);
  cursor: pointer; border-radius: var(--shape-full);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--on-surface); background: var(--surface-container); }
.modal-toolbar {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--outline-thin);
  background: var(--surface-container-low);
}
.modal-search {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-full);
  font-size: 13px; font-family: inherit;
  background: var(--surface);
  color: var(--on-surface);
  outline: 0;
}
.modal-search:focus {
  border-color: var(--primary);
  border-width: 2px;
  padding: 9px 13px;
}
.modal-quick-actions { display: flex; gap: 4px; flex-shrink: 0; }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 24px; min-height: 0; }
.picker-category { margin-bottom: 22px; }
.picker-category:last-child { margin-bottom: 6px; }
.picker-category.hidden { display: none; }
.picker-category-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--outline-thin);
  margin-bottom: 10px; gap: 8px;
}
.picker-category-name {
  font-size: 11px; font-weight: 500;
  color: var(--on-surface-variant);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.picker-category-actions { display: flex; gap: 4px; align-items: center; }
.picker-category-count {
  font-size: 12px; color: var(--on-surface-muted);
  margin-right: 6px; font-variant-numeric: tabular-nums;
}
.picker-cat-btn {
  background: transparent; border: none;
  color: var(--primary); cursor: pointer;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: var(--shape-full);
  font-family: inherit; transition: background 0.12s;
}
.picker-cat-btn:hover { background: rgba(26,115,232,0.08); }
.picker-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
}
.picker-field {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: var(--shape-sm);
  cursor: pointer;
  font-size: 13px; color: var(--on-surface);
  transition: background 0.12s;
  user-select: none;
}
.picker-field:hover { background: var(--surface-container); }
.picker-field.hidden { display: none; }
.picker-field input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px; height: 16px;
  margin: 0; flex-shrink: 0;
}
.picker-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-footer {
  display: flex; justify-content: space-between;
  align-items: center; gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--outline-thin);
  background: var(--surface-container-low);
}
.modal-footer-right { display: flex; gap: 8px; flex-shrink: 0; }
.modal-count {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Completion empty state (before picking any fields) ---- */
.completion-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 28px 24px 24px;
  text-align: center;
}
.completion-empty-icon {
  width: 48px; height: 48px;
  border-radius: var(--shape-full);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: inline-flex; align-items: center; justify-content: center;
}
.completion-empty-text h3 {
  margin: 0 0 4px;
  font-size: 15px; font-weight: 500;
  color: var(--on-surface);
}
.completion-empty-text p {
  margin: 0 auto;
  font-size: 13px;
  color: var(--on-surface-variant);
  max-width: 460px;
  line-height: 1.55;
}

/* ---- Completion drawer (missing fields grouped by category) ---- */
.completion-drawer-group + .completion-drawer-group { margin-top: 12px; }
.completion-drawer-group-label {
  display: block;
  font-size: 11px; font-weight: 500;
  color: var(--on-surface);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.completion-drawer-fields { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.completion-drawer-field {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--shape-sm);
  font-size: 12px; font-family: inherit;
  color: var(--on-surface);
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.completion-drawer-field:hover {
  background: var(--surface-container-low);
  border-color: var(--outline-variant);
}
.completion-drawer-field:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.22);
}
.completion-drawer {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface-container);
  border-radius: var(--shape-md);
}

/* ---- Field-edit modal (opened from a drawer pill) ---- */
.modal-dialog.modal-dialog-sm { max-width: 460px; }
.modal-footer.modal-footer-end { justify-content: flex-end; }
/* Clear-backdrop variant: keeps the page fully visible behind the dialog
   instead of dimming it. Overlay still captures clicks so backdrop-click-
   to-close works. A stronger shadow + hairline outline preserves the sense
   of elevation now that the dim isn't doing that work. */
.modal-overlay.modal-overlay-clear {
  background: transparent;
  animation: none;
}
.modal-overlay.modal-overlay-clear .modal-dialog {
  box-shadow: 0 12px 40px rgba(11,17,28,0.20), 0 0 0 1px var(--outline-thin);
}
/* Top-anchor variant: for small dialogs that would otherwise center off the
   top of a short viewport. Anchored just below the sticky header. */
.modal-overlay.modal-overlay-top {
  align-items: flex-start;
  padding: 96px 24px 24px;
}
.field-edit-input-wrap {
  display: flex; flex-direction: column;
  gap: 6px;
}
.field-edit-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--on-surface);
  background: var(--surface);
  box-sizing: border-box;
}
.field-edit-input:focus {
  outline: none;
  border-color: var(--primary);
  border-width: 2px;
  padding: 9px 11px;
}
.field-edit-input::placeholder { color: var(--on-surface-muted, #9AA0A6); }
.field-edit-hint {
  margin: 0;
  font-size: 13px; line-height: 1.55;
  color: var(--on-surface-variant);
}

/* ---- Data Completeness footer action row (drawer toggle + follow-up) ---- */
.completion-actions {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  /* Owns the gap above the row so the toggle can drop its own margin-top;
     with the toggle's asymmetric top margin removed, the button text lines
     up vertically with the "View missing fields" text. */
  margin-top: 8px;
}
.completion-actions .completion-drawer-toggle { margin-top: 0; }
/* Pushed to the trailing edge so it holds its position whether or not the
   drawer toggle is showing (the toggle is hidden when nothing is missing). */
.completion-followup-btn { margin-left: auto; }

/* ---- Broker follow-up modal ---- */
/* Wider than the shared small dialog (1.8x the 460px modal-dialog-sm) so the
   three fields and the draft body have room to breathe. Scoped to its own
   class so the shared field-edit modal keeps its size. */
.modal-dialog.followup-dialog { max-width: 828px; }
/* Compact header: a tight title-only ribbon (no oversized title, no tall
   band of empty space now that the subtitle is gone). */
#brokerFollowupOverlay .modal-header { padding: 14px 24px; align-items: center; }
#brokerFollowupOverlay .modal-header h2 { font-size: 15px; font-weight: 500; }
/* A touch more breathing room inside this dialog than the shared default. */
#brokerFollowupOverlay .modal-body { padding: 22px 28px; }

.copy-row { display: flex; flex-direction: column; gap: 7px; }
.copy-row + .copy-row { margin-top: 20px; }
.copy-row-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}
.copy-field { display: flex; align-items: center; gap: 12px; }
.copy-field.copy-field-body { align-items: flex-start; }
.copy-value {
  flex: 1; min-width: 0;
  padding: 10px 13px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-sm);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 13px;
  display: flex; align-items: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* An empty recipient field: never fabricated, shown as a muted placeholder
   with its copy icon disabled. */
.copy-value.is-empty {
  color: var(--on-surface-muted);
  font-style: italic;
  background: var(--surface-container-low);
}
textarea.copy-value-body {
  display: block; align-items: stretch;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px; line-height: 1.6;
  height: 260px; resize: vertical;
  overflow-y: auto;
}
/* Bare, self-explanatory copy control — the icon only, no button chrome.
   Same size in every row. A native title gives the "Copy content" tooltip. */
.copy-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--shape-sm);
  color: var(--primary);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.copy-icon svg { width: 18px; height: 18px; }
.copy-icon:hover { color: var(--primary-hover); background: rgba(26,115,232,0.08); }
.copy-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.copy-icon.copied { color: var(--success); }
.copy-icon.is-disabled { color: var(--on-surface-muted); cursor: not-allowed; opacity: 0.45; pointer-events: none; }
/* Align the body's icon with the first line of the textarea, not its middle. */
.copy-field.copy-field-body .copy-icon { align-self: flex-start; margin-top: 4px; }

/* ---- Upload progress bar (shown briefly during upload from Home) ---- */
.upload-progress {
  margin-top: 16px;
  display: flex; align-items: center; gap: 12px;
}
.upload-progress-bar {
  flex: 1; height: 6px;
  background: var(--surface-container-high);
  border-radius: var(--shape-full);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%; width: 0%;
  background: var(--primary);
  border-radius: var(--shape-full);
  transition: width 0.3s ease;
}
.upload-progress-text {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

/* ---- Small icon inside a button (utility from prior stylesheet) ---- */
.btn-icon-svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- File-item extension chip (dynamic renderFiles) ---- */
.file-item .file-ext {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  padding: 3px 5px;
  border-radius: var(--shape-xs);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  text-transform: uppercase;
  min-width: 32px; text-align: center;
  letter-spacing: 0.05em;
}

/* ---- Preview body content types ---- */
.preview-body iframe,
.preview-body object {
  width: 100%; height: 100%;
  min-height: 500px;
  border: none;
}
.preview-body pre {
  padding: 0; margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--on-surface-variant);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- XLSX sheet preview (from previewFile) ---- */
.xlsx-sheet { padding: 12px 16px; }
.xlsx-sheet + .xlsx-sheet { border-top: 1px solid var(--outline-thin); }
.xlsx-sheet-name {
  font-size: 13px; font-weight: 500;
  color: var(--primary); margin-bottom: 8px;
}
.xlsx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.xlsx-table thead th {
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  border: 1px solid var(--outline-thin);
  white-space: nowrap;
}
.xlsx-table tbody td {
  padding: 5px 10px;
  border: 1px solid var(--outline-thin);
  color: var(--on-surface);
  vertical-align: top;
}
.xlsx-table tbody tr:hover { background: var(--primary-container); }

/* ---- File delete X (per file row in review view) ---- */
.file-delete {
  opacity: 0;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  border-radius: var(--shape-full);
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 16px; line-height: 1;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
  margin-left: 4px;
  font-family: inherit;
}
.file-item:hover .file-delete { opacity: 1; }
.file-delete:hover { color: var(--warning); background: var(--warning-container); }

/* ---- Push status pill (Push to System result) ---- */
.push-status {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: var(--shape-sm);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}
.push-status.success { background: var(--success-container); color: var(--success); }
.push-status.error   { background: #FADAD8; color: #B3261E; }
.push-status .push-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px; vertical-align: middle;
}

/* ═════════════════════════════════════════════════════════════════════
   BATCH INDEX VIEW
   ═════════════════════════════════════════════════════════════════════ */

.batch-heading {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 10px; padding: 4px 4px;
}
.batch-heading-titles {
  display: flex; flex-direction: column;
  min-width: 0;
}
.batch-heading-title {
  font-family: "Google Sans", var(--sans);
  font-size: 18px; font-weight: 500; color: var(--on-surface);
  letter-spacing: -0.01em; line-height: 1.25;
}
.batch-heading-meta {
  font-size: 12px; color: var(--on-surface-variant);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.batch-heading > span {
  font-family: "Google Sans", var(--sans);
  font-size: 22px; font-weight: 500; color: var(--on-surface);
  letter-spacing: -0.01em;
}
.batch-heading-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.batch-delete-btn {
  color: var(--on-surface-variant);
}
.batch-delete-btn:hover { color: #B3261E; background: rgba(179,38,30,0.08); }

.batch-summary-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-md);
  font-size: 13px; color: var(--on-surface-variant); line-height: 1.6;
}
.batch-summary-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--shape-full);
  font-size: 12px; font-weight: 500;
  background: var(--surface-container);
}
.batch-summary-chip.chip-ready { background: var(--success-container); color: var(--success); }
.batch-summary-chip.chip-review { background: var(--warning-container); color: var(--warning); }
.batch-summary-chip.chip-attention { background: #FADAD8; color: #B3261E; }
.batch-summary-chip.chip-failed { background: #FADAD8; color: #B3261E; }
.batch-summary-tiv {
  margin-left: auto; font-weight: 600; color: var(--on-surface);
  font-size: 13px;
}
.batch-summary-failed { color: #B3261E; font-weight: 500; }
.batch-progress-track {
  flex: 1; min-width: 120px; height: 6px;
  background: var(--surface-container);
  border-radius: 3px; overflow: hidden;
}
.batch-progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--primary);
  transition: width 0.5s ease;
}
.batch-elapsed {
  font-size: 12px; color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.batch-sort-label { font-size: 12.5px; color: var(--on-surface-variant); }
.batch-sort-select {
  font-size: 12.5px; padding: 4px 8px;
  border: 1px solid var(--outline-variant); border-radius: var(--shape-xs);
  background: var(--surface); color: var(--on-surface);
  font-family: inherit; cursor: pointer;
}

.batch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.batch-search-empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--on-surface-muted);
  border: 1px dashed var(--outline-thin);
  border-radius: var(--shape-md);
  background: var(--surface-container-low);
}
.batch-search-empty svg { color: var(--outline-variant); margin-bottom: 12px; }
.batch-search-empty-title {
  font-family: "Google Sans", var(--sans);
  font-size: 14px; font-weight: 500;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
}
.batch-search-empty-hint {
  font-size: 12px; color: var(--on-surface-muted);
}

/* ── Submission Card ── */
.batch-card {
  background: var(--surface);
  border-radius: var(--shape-lg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid var(--outline-thin);
  cursor: default;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.batch-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  border-color: var(--outline-variant);
}

.batch-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
}
.batch-card-identity {
  flex: 1; min-width: 0;
  /* Reserve two lines of title height and vertically center the name within
     it, so a one-line insured name sits centered in the same space a two-line
     name fills — keeping the stats row below aligned across the grid.
     The title metrics are declared here and consumed by .batch-card-name below
     so the reserved height and the actual text can never drift apart. They must
     be an explicit calc, NOT `em`: this element inherits the 13px root size
     (html{font-size:13px}), so `2.6em` here would reserve 33.8px rather than the
     37.7px two lines of the 14.5px title actually occupy. */
  --title-size: 14.5px;
  --title-lh: 1.3;
  display: flex; align-items: center;
  min-height: calc(var(--title-size) * var(--title-lh) * 2); /* exactly 2 title lines */
}
.batch-card-name {
  font-family: "Google Sans", var(--sans);
  font-size: var(--title-size); font-weight: 500; color: var(--on-surface);
  line-height: var(--title-lh); word-break: break-word;
  letter-spacing: -0.005em;
  /* Clamp long names to two lines with an ellipsis so no card grows taller;
     the identity block above reserves the height and centers this vertically. */
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* Deep-link guard: hide every view until the JS shows the right one */
html.is-deep-linking main > section { visibility: hidden; }

/* Review status: pill with circular checkmark + "Reviewed" text */
.review-status {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0; cursor: pointer;
  user-select: none;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-full);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.review-status:hover {
  background: var(--surface-container-low);
  border-color: var(--outline);
}

.review-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--outline-variant);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.review-check svg { display: block; }
.review-status:hover .review-check { border-color: var(--outline); }
.review-status.is-reviewed .review-check {
  border-color: var(--success);
  background: var(--success);
  color: #FFFFFF;
}
.review-check:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.review-label {
  font-family: var(--sans);
  font-size: 13px; font-weight: 400;
  color: var(--on-surface);
  line-height: 1;
  white-space: nowrap;
}

/* Completeness color coding */
.completeness-high { color: var(--success) !important; }
.completeness-mid  { color: var(--primary) !important; }
.completeness-low  { color: #D93025 !important; }

/* Key metrics row */
.batch-card-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--outline-thin);
  border-bottom: 1px solid var(--outline-thin);
  background: var(--surface-container-low);
}
.batch-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 4px 12px;
  gap: 4px;
}
.batch-stat + .batch-stat {
  border-left: 1px solid var(--outline-thin);
}
.batch-stat-value {
  font-family: "Google Sans", var(--sans);
  font-size: 16px; font-weight: 500; color: var(--on-surface);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.01em;
}
.batch-stat-label {
  font-size: 10.5px; color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  line-height: 1;
  font-weight: 500;
}
.batch-stat.has-conflicts .batch-stat-value {
  color: #D93025; font-weight: 600;
}

/* Footer: actions left + downloads right */
.batch-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  gap: 8px;
  min-height: 46px;
  box-sizing: border-box;
}
.batch-card-footer-left {
  display: flex; align-items: center; gap: 4px;
}
.batch-card-footer-right {
  display: flex; align-items: center; gap: 4px;
}

.batch-card-action {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--outline-variant);
  background: transparent; cursor: pointer;
  color: var(--primary);
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--shape-full);
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
  letter-spacing: 0.005em;
}
.batch-card-action svg { display: block; }
.batch-card-action:hover {
  background: rgba(26,115,232,0.08); border-color: var(--primary);
}

/* Card download buttons — grey, not blue */
.batch-card-download-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--outline-variant);
  background: transparent; cursor: pointer;
  color: var(--on-surface-variant);
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--shape-full);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  line-height: 1;
  letter-spacing: 0.005em;
}
.batch-card-download-btn svg { display: block; }
.batch-card-download-btn:hover {
  background: var(--surface-container); color: var(--on-surface); border-color: var(--outline);
}

.batch-triage {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: var(--shape-full);
}
.triage-ready      { background: var(--success-container); color: var(--success); }
.triage-review     { background: var(--warning-container); color: var(--warning); }
.triage-attention  { background: #FADAD8; color: #B3261E; }
.triage-processing { background: var(--primary-container); color: var(--primary); }
.triage-queued     { background: var(--surface-container); color: var(--on-surface-muted); }

/* Summary dialog */
.summary-dialog {
  border: none; border-radius: var(--shape-lg);
  box-shadow: var(--elev-4);
  padding: 0; max-width: 640px; width: 90vw;
  background: var(--surface); color: var(--on-surface);
}
.summary-dialog::backdrop {
  background: rgba(0,0,0,0.35);
}
.summary-dialog-inner {
  padding: 24px 28px;
}
.summary-dialog-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.summary-dialog-name {
  font-family: "Google Sans", var(--sans);
  font-size: 18px; font-weight: 500; color: var(--on-surface);
  margin: 0; line-height: 1.3;
}
.summary-dialog-close {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--on-surface-muted); border-radius: var(--shape-sm);
  transition: background 0.12s;
}
.summary-dialog-close:hover {
  background: var(--surface-container-high);
}
.summary-dialog-body {
  font-size: 13px; line-height: 1.7;
  color: var(--on-surface-variant);
  white-space: pre-wrap; word-break: break-word;
}

/* Processing / queued states */
.batch-card-processing { cursor: default; }
.batch-card-processing:hover { box-shadow: var(--elev-1); transform: none; }
.batch-card-queued:hover { box-shadow: var(--elev-1); transform: none; }
.batch-card-queued { opacity: 0.6; }

.batch-card-error {
  font-size: 12px; color: #B3261E;
  padding: 0 16px 14px; line-height: 1.4;
}
.skeleton-text {
  color: var(--on-surface-muted) !important;
}

.mini-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 1.5px solid var(--primary-container);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

@media (max-width: 700px) {
  .batch-cards-grid { grid-template-columns: 1fr; }
  .batch-controls { flex-direction: column; align-items: stretch; }
  .batch-controls-right { justify-content: flex-end; }
}

/* ============================================================
   HOME VIEW — upload-only, centered
   ============================================================ */
.home-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex; flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: calc(100vh - 140px);
  gap: 16px;
}

/* Upload zone — Material Design 3 elevated surface */
.upload-zone {
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-lg);
  padding: 34px 48px 30px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.upload-zone:hover {
  border-color: var(--outline-variant);
  background: #EEF4FF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
}
.upload-zone:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.18);
}
.upload-zone.is-dragover {
  border-color: var(--primary);
  background: #EEF4FF;
  box-shadow: 0 4px 12px rgba(26,115,232,0.18);
}
.upload-zone.is-uploading {
  pointer-events: none;
  opacity: 0.75;
  border-color: var(--outline-thin);
  background: var(--surface);
}

.upload-icon-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--primary);
  margin: 0 auto 12px;
  transition: transform 0.2s ease;
}
.upload-icon-circle svg { width: 24px; height: 24px; display: block; }
.upload-zone:hover .upload-icon-circle { transform: translateY(-2px); }

.upload-headline {
  font-family: "Google Sans", var(--sans);
  font-size: 19px; font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.upload-sub {
  font-family: var(--sans);
  font-size: 13px; color: var(--on-surface-variant);
  line-height: 1.5;
}
.upload-link {
  color: var(--primary); font-weight: 500;
}
/* Two-mode hint inside the upload zone — MD3 tonal container */
.upload-modes {
  display: flex; align-items: stretch; justify-content: center;
  gap: 12px;
  margin: 20px auto 0;
  max-width: 100%;
  padding: 12px 16px;
  background: var(--surface-container-low);
  border-radius: var(--shape-md);
}
.upload-mode {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
  text-align: left;
  padding: 6px 6px;
  color: var(--on-surface-variant);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.45;
}
.upload-mode-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--primary);
  flex-shrink: 0;
}
.upload-mode-icon svg { width: 16px; height: 16px; display: block; }
.upload-mode-text { flex: 1; min-width: 0; }
.upload-mode-divider {
  display: flex; align-items: center;
  font-size: 10px; color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0 4px;
  font-weight: 500;
}

.upload-formats-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px;
  margin-top: 18px;
}
.upload-formats-label {
  font-family: var(--sans);
  font-size: 11.5px; color: var(--on-surface-muted);
  margin-right: 6px;
  letter-spacing: 0.02em;
}
.upload-format-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-full);
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

@media (max-width: 620px) {
  .home-container { padding: 20px 16px; min-height: calc(100vh - 120px); }
  .upload-zone { padding: 32px 20px 24px; }
  .upload-modes { flex-direction: column; gap: 8px; }
  .upload-mode-divider { justify-content: center; padding: 0; }
}

/* ============================================================
   REVIEW VIEW — professional two-panel document review
   ============================================================ */
.review-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 4px 4px;
  margin-bottom: 10px;
}
.review-header-left {
  display: flex; align-items: center; gap: 18px;
  min-width: 0;
}
.review-title-block {
  display: flex; flex-direction: column;
  min-width: 0;
}
.review-title {
  font-family: "Google Sans", var(--sans);
  font-size: 17px; font-weight: 500;
  color: var(--on-surface);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.review-summary {
  font-size: 12px; color: var(--on-surface-variant);
  margin-top: 2px;
}
.review-header-right {
  display: flex; align-items: center;
}
.review-header-right .btn svg { margin-left: 6px; }
.review-process-btn {
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  gap: 6px;
  box-shadow: var(--elev-1);
  background: #2E7CF6;
}
.review-process-btn:hover {
  box-shadow: var(--elev-2);
  background: #1F6FEF;
}
.review-process-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
  box-shadow: none;
}
.review-process-btn svg { display: block; }

.review-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  height: calc(100vh - 200px);
  min-height: 480px;
}
@media (max-width: 900px) {
  .review-layout { grid-template-columns: 1fr; height: auto; }
}

.review-sidebar {
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.review-sidebar-header {
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 11px; font-weight: 600;
  color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-thin);
}
.review-sidebar-list {
  flex: 1; overflow-y: auto;
  padding: 8px;
}

/* Submission group */
.rev-sub {
  border-radius: var(--shape-md);
  overflow: hidden;
  margin-bottom: 4px;
}
.rev-sub-header {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); text-align: left;
  border-radius: var(--shape-md);
  transition: background 0.15s ease;
}
.rev-sub-header:hover { background: var(--surface-container-low); }
.rev-sub.rev-sub-open .rev-sub-header {
  background: var(--surface-container-low);
}
.rev-sub-chevron {
  display: inline-flex; color: var(--on-surface-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.rev-sub.rev-sub-open .rev-sub-chevron { transform: rotate(90deg); }
.rev-sub-icon {
  display: inline-flex; color: var(--primary);
  flex-shrink: 0;
}
.rev-sub-name {
  flex: 1;
  font-family: "Google Sans", var(--sans);
  font-size: 13px; font-weight: 500;
  color: var(--on-surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
  letter-spacing: -0.005em;
}
.rev-sub-meta {
  font-family: var(--sans);
  font-size: 11px; color: var(--on-surface-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.rev-sub-files {
  display: none;
  padding: 4px 0 8px 30px;
}
.rev-sub.rev-sub-open .rev-sub-files { display: block; }

/* File row: preview button (flex 1) + delete button, revealed on hover */
.rev-file-row {
  display: flex; align-items: center;
  position: relative;
  border-radius: var(--shape-sm);
  transition: background 0.12s, opacity 0.18s, transform 0.18s;
}
.rev-file-row:hover { background: var(--surface-container-low); }
.rev-file-row.is-removing { opacity: 0; transform: translateX(-6px); pointer-events: none; }

.rev-file {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 6px 10px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); text-align: left;
  border-radius: var(--shape-sm);
}
.rev-file.active { background: var(--primary-container); }
.rev-file.active .rev-file-name { color: var(--on-primary-container); font-weight: 500; }
.rev-file-ext {
  font-family: var(--mono);
  font-size: 9px; font-weight: 600;
  padding: 3px 5px;
  border-radius: var(--shape-xs);
  background: var(--surface-container-high);
  color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  min-width: 34px; text-align: center;
  line-height: 1;
  flex-shrink: 0;
}
.rev-file.active .rev-file-ext {
  background: rgba(26,115,232,0.16);
  color: var(--on-primary-container);
}
.rev-file-name {
  flex: 1;
  font-size: 12px; color: var(--on-surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

.rev-file-delete {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--warning-container);
  color: var(--warning);
  border-radius: 50%;
  cursor: pointer;
  margin-right: 8px; flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, transform 0.12s, background 0.12s;
}
.rev-file-row:hover .rev-file-delete,
.rev-file-delete:focus-visible { opacity: 1; }
.rev-file-delete:hover {
  background: #F5C68A;
  transform: scale(1.08);
}

/* Preview panel — MD3 surface */
.review-preview {
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.review-preview-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--on-surface-muted);
  text-align: center;
}
.review-preview-empty svg {
  color: var(--outline-variant);
  margin-bottom: 8px;
  padding: 12px;
  background: var(--surface-container-low);
  border-radius: 50%;
  width: 64px; height: 64px;
  box-sizing: content-box;
}
.review-preview-empty-title {
  font-family: "Google Sans", var(--sans);
  font-size: 15px; font-weight: 500;
  color: var(--on-surface);
  letter-spacing: -0.005em;
}
.review-preview-empty-hint {
  font-family: var(--sans);
  font-size: 12.5px; color: var(--on-surface-muted);
  max-width: 300px; line-height: 1.5;
}
.review-preview-shown {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0;
}
.review-preview-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--outline-thin);
  background: var(--surface-container-low);
  flex-shrink: 0;
}
.review-preview-name {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  color: var(--on-surface);
  letter-spacing: 0;
}
.review-preview-body {
  flex: 1; overflow: auto;
  min-height: 0;
  background: var(--surface);
}
.review-preview-body iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}
.review-preview-body .review-preview-image-wrap {
  padding: 20px; text-align: center;
}
.review-preview-body .review-preview-image-wrap img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--shape-sm);
}
.review-preview-body .review-preview-text {
  padding: 20px 24px;
  font-size: 13px; line-height: 1.7;
  color: var(--on-surface-variant);
}
.review-preview-body .review-preview-pre {
  padding: 16px 20px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px; line-height: 1.65;
  color: var(--on-surface-variant);
  white-space: pre-wrap; word-break: break-word;
}
.review-preview-body .review-preview-loading,
.review-preview-body .review-preview-error {
  padding: 40px 24px;
  text-align: center;
  color: var(--on-surface-muted);
  font-size: 13px;
}
.review-preview-body .review-preview-error { color: var(--warning); }

/* ── Batch Search ── */
.batch-controls {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding: 0 2px;
}
.batch-controls-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.batch-search-wrap {
  position: relative; flex: 1; max-width: 320px;
}
.batch-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--on-surface-variant); pointer-events: none;
}
.batch-search-input {
  width: 100%; padding: 9px 12px 9px 34px;
  border: 1px solid var(--outline-variant); border-radius: var(--shape-full);
  background: var(--surface); color: var(--on-surface);
  font-size: 13px; font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.batch-search-input:hover {
  border-color: var(--outline);
}
.batch-search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}
.batch-search-icon { left: 12px; }
.batch-search-input::placeholder { color: var(--on-surface-variant); }

/* ── Portfolio Analytics ── */
.portfolio-panel {
  margin-bottom: 16px;
}
.portfolio-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; width: 100%;
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-sm);
  cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--on-surface);
  transition: background 0.12s;
}
.portfolio-toggle:hover { background: var(--surface-container-low); }
.portfolio-toggle-chevron {
  transition: transform 0.2s;
  color: var(--on-surface-variant);
}
.portfolio-panel.is-open .portfolio-toggle-chevron {
  transform: rotate(90deg);
}
.portfolio-panel.is-open .portfolio-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.portfolio-body {
  border: 1px solid var(--outline-thin);
  border-top: none;
  border-radius: 0 0 var(--shape-sm) var(--shape-sm);
  background: var(--surface);
  padding: 16px;
}
.portfolio-body.hidden { display: none; }
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}
.portfolio-kpi-row {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--outline-thin);
  margin-bottom: 4px;
}
.portfolio-kpi {
  flex: 1; min-width: 120px;
  text-align: center;
  padding: 8px;
}
.portfolio-kpi-value {
  font-size: 24px; font-weight: 600; color: var(--primary);
  font-family: "Google Sans", var(--sans);
}
.portfolio-kpi-label {
  font-size: 11px; color: var(--on-surface-variant);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
  margin-top: 2px;
}
.portfolio-chart-card {
  background: var(--surface-container-low);
  border-radius: var(--shape-sm);
  padding: 14px;
  min-height: 200px;
}
.portfolio-chart-card h4 {
  font-size: 13px; font-weight: 600; color: var(--on-surface);
  margin: 0 0 10px;
}
.portfolio-chart {
  width: 100%; min-height: 180px;
}
.portfolio-bar-chart {
  display: flex; flex-direction: column; gap: 6px;
}
.portfolio-bar-row {
  display: flex; align-items: center; gap: 8px;
}
.portfolio-bar-label {
  font-size: 12px; color: var(--on-surface-variant);
  min-width: 80px; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: right;
}
.portfolio-bar-track {
  flex: 1; height: 20px;
  background: var(--surface-container);
  border-radius: var(--shape-xs);
  overflow: hidden;
}
.portfolio-bar-fill {
  height: 100%; border-radius: var(--shape-xs);
  background: var(--primary);
  transition: width 0.4s ease;
  min-width: 2px;
}
.portfolio-bar-value {
  font-size: 12px; font-weight: 500; color: var(--on-surface);
  min-width: 50px;
}
.portfolio-donut {
  display: flex; align-items: center; gap: 16px;
}
.portfolio-donut-ring {
  width: 100px; height: 100px; flex-shrink: 0;
}
.portfolio-donut-legend {
  display: flex; flex-direction: column; gap: 4px;
}
.portfolio-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--on-surface-variant);
}
.portfolio-legend-dot {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.portfolio-legend-count {
  font-weight: 600; color: var(--on-surface);
  margin-left: auto; min-width: 20px; text-align: right;
}

/* ── Batch Notes ── */
.batch-notes-panel {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-sm);
  overflow: hidden;
}
.batch-notes-panel.hidden { display: none; }
.batch-notes-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--outline-thin);
}
.batch-notes-header h4 { font-size: 13px; font-weight: 600; margin: 0; color: var(--on-surface); }
.batch-notes-count { font-size: 12px; color: var(--on-surface-variant); }
.batch-notes-list {
  max-height: 200px; overflow-y: auto;
}
.batch-note-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--outline-thin);
}
.batch-note-item:last-child { border-bottom: none; }
.batch-note-text {
  flex: 1; font-size: 13px; color: var(--on-surface);
  line-height: 1.4;
}
.batch-note-meta {
  font-size: 11px; color: var(--on-surface-variant);
  margin-top: 2px;
}
.batch-note-delete {
  flex-shrink: 0; padding: 2px;
  color: var(--on-surface-variant); cursor: pointer;
  opacity: 0; transition: opacity 0.12s;
}
.batch-note-item:hover .batch-note-delete { opacity: 1; }
.batch-note-delete:hover { color: #B3261E; }
.batch-notes-input {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--outline-thin);
}
.batch-note-input {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--outline-variant); border-radius: var(--shape-xs);
  background: var(--surface); color: var(--on-surface);
  font-size: 13px; font-family: inherit;
}
.batch-note-input:focus { outline: none; border-color: var(--primary); }
.batch-notes-empty {
  padding: 16px; text-align: center;
  font-size: 12px; color: var(--on-surface-variant);
}

/* ── Compare Mode ── */
.compare-bar {
  position: sticky; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--shape-full);
  box-shadow: var(--elev-4);
  max-width: 360px;
  margin: 12px auto;
}
.compare-bar.hidden { display: none; }
.compare-bar-count { font-size: 13px; font-weight: 500; flex: 1; }
.compare-bar .btn-primary { background: #fff; color: var(--primary); }
.compare-bar .btn-primary:hover { background: #f0f0f0; }
.compare-bar .btn-text { color: rgba(255,255,255,0.8); }
.compare-bar .btn-text:hover { color: #fff; background: rgba(255,255,255,0.15); }

.batch-card.compare-mode {
  cursor: pointer;
  position: relative;
}
.batch-card.compare-selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: rgba(26,115,232,0.04);
}
.batch-card.compare-selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.compare-dialog {
  border: none; border-radius: var(--shape-lg);
  box-shadow: var(--elev-4);
  max-width: 95vw; width: 1100px;
  max-height: 85vh;
  padding: 0;
  background: var(--surface);
}
.compare-dialog::backdrop { background: rgba(0,0,0,0.4); }
.compare-dialog-inner {
  display: flex; flex-direction: column;
  max-height: 85vh;
}
.compare-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--outline-thin);
}
.compare-dialog-header h3 {
  font-family: "Google Sans", var(--sans);
  font-size: 18px; font-weight: 500; margin: 0;
}
.compare-dialog-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.compare-table {
  width: 100%; border-collapse: collapse;
}
.compare-table th, .compare-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--outline-thin);
  font-size: 13px;
}
.compare-table th {
  font-weight: 600; color: var(--on-surface);
  background: var(--surface-container-low);
  position: sticky; top: 0;
}
.compare-table td { color: var(--on-surface-variant); }
.compare-table .compare-field-label {
  font-weight: 500; color: var(--on-surface);
  min-width: 160px;
}
.compare-table .compare-best {
  color: var(--success); font-weight: 600;
}
.compare-table .compare-worst {
  color: var(--warning);
}
.compare-section-header td {
  font-weight: 600; color: var(--primary);
  background: var(--primary-container);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 6px 12px;
}

/* ── Retry Button ── */
.btn-xs {
  padding: 2px 10px; font-size: 11px; border-radius: var(--shape-xs);
}
.batch-retry-btn {
  margin-left: auto;
}

/* ── Recent batch rows (home view) ── */
.recent-batch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--outline-thin);
  border-radius: var(--shape-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.recent-batch-row:hover {
  border-color: var(--outline-variant);
  background: var(--surface-container-lowest);
  box-shadow: var(--elev-1);
}
.rb-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-container);
  color: var(--primary);
  border-radius: var(--shape-sm);
}
.rb-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.rb-main {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--on-surface);
}
.rb-count { font-weight: 500; }
.rb-date { color: var(--on-surface-variant); font-size: 12px; }
.rb-status {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--shape-full);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-left: auto;
}
.rb-status-done     { background: var(--success-container); color: var(--success); }
.rb-status-progress { background: var(--primary-container); color: var(--primary); }
.rb-status-partial  { background: var(--warning-container); color: var(--warning); }
.rb-status-failed   { background: #FADAD8; color: #B3261E; }
.rb-names {
  font-size: 12px; color: var(--on-surface-variant);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rb-arrow {
  color: var(--on-surface-muted); flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}
.recent-batch-row:hover .rb-arrow {
  color: var(--primary);
  transform: translateX(2px);
}
