    :root {
      color-scheme: light;
      --ink: #18212f;
      --muted: #667085;
      --line: #d8dee8;
      --panel: #ffffff;
      --bg: #f5f7fb;
      --accent: #0f766e;
      --warn: #b45309;
      --danger: #b42318;
      --surface: #ffffff;
    }

    html[data-theme="dark"] {
      color-scheme: dark;
      --ink: #f8fafc;
      --muted: #94a3b8;
      --line: rgba(148,163,184,.24);
      --panel: rgba(15,23,42,.82);
      --bg: #080b12;
      --accent: #29e59b;
      --warn: #f59e0b;
      --danger: #ff5f7e;
      --surface: rgba(15,23,42,.82);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--ink);
    }

    body.modal-open {
      overflow: hidden;
    }

    main {
      width: min(720px, calc(100vw - 32px));
      margin: 0 auto;
      padding: 48px 0 64px;
    }

    header {
      text-align: center;
      margin-bottom: 40px;
    }

    .brand-home {
      width: fit-content;
      margin: 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      color: var(--ink);
      text-decoration: none;
    }

    .brand-home:hover {
      color: var(--ink);
    }

    .header-actions {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: 14px;
    }

    .plugin-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(120px, 1fr));
      gap: 10px;
      width: min(310px, 100%);
      margin: 0 auto;
    }

    .plugin-tile {
      display: grid;
      grid-template-columns: 32px 1fr;
      gap: 9px;
      align-items: center;
      text-align: left;
      min-height: 54px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--panel);
      color: var(--ink);
      padding: 9px 10px;
      box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
      cursor: pointer;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }

    .plugin-tile:hover {
      transform: translateY(-1px);
      border-color: rgba(15, 118, 110, .38);
      box-shadow: 0 8px 22px rgba(16, 24, 40, .08);
    }

    .plugin-tile:disabled,
    .plugin-tile.is-disabled {
      cursor: not-allowed;
      opacity: .58;
      transform: none;
      box-shadow: none;
    }

    .plugin-tile img {
      width: 32px;
      height: 32px;
      border-radius: 7px;
      object-fit: contain;
      background: #f8fafc;
    }

    html[data-theme="dark"] .plugin-tile img {
      background: rgba(255,255,255,.08);
    }

    .plugin-title {
      display: block;
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
      line-height: 1.1;
    }

    .plugin-status {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      line-height: 1.2;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    h1, h2, h3, p {
      margin: 0;
    }

    h1 {
      font-size: 28px;
      line-height: 1.15;
      letter-spacing: 0;
    }

    h2 {
      font-size: 19px;
      line-height: 1.25;
      letter-spacing: 0;
    }

    h3 {
      font-size: 15px;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .subtle {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
    }

    .nav-link {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 6px;
      text-decoration: none;
      color: var(--accent);
      font-size: 13px;
      font-weight: 700;
    }

    .panel, .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    }

    html[data-theme="dark"] .panel,
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .plugin-tile {
      box-shadow: 0 18px 50px rgba(0,0,0,.28);
    }

    .panel {
      padding: 16px;
    }

    .stack {
      display: grid;
      gap: 12px;
    }

    .button-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    button {
      border: 0;
      border-radius: 8px;
      background: var(--accent);
      color: white;
      padding: 10px 18px;
      font-weight: 700;
      font-size: 14px;
      cursor: pointer;
    }

    button.secondary {
      background: #344054;
    }

    html[data-theme="dark"] button.secondary,
    html[data-theme="dark"] a.btn.secondary-link {
      background: rgba(51,65,85,.92);
    }

    button:disabled {
      opacity: .55;
      cursor: not-allowed;
    }

    a.btn {
      display: inline-block;
      border-radius: 8px;
      background: var(--accent);
      color: white;
      padding: 10px 18px;
      font-weight: 700;
      font-size: 14px;
      text-decoration: none;
      cursor: pointer;
    }

    a.btn.secondary-link {
      background: #344054;
    }

    .badge {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      font-weight: 800;
      background: #d1fae5;
      color: #065f46;
    }

    .badge.warn {
      background: #fef3c7;
      color: var(--warn);
    }

    .badge.neutral {
      background: #eef2f6;
      color: #344054;
    }

    .badge.danger {
      background: #fee4e2;
      color: var(--danger);
    }

    .field {
      display: grid;
      gap: 6px;
    }

    .field label {
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .field input[type="text"],
    .field input[type="email"] {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: #fbfcfe;
      color: var(--ink);
      font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    html[data-theme="dark"] .field input[type="text"],
    html[data-theme="dark"] .field input[type="email"] {
      background: rgba(2,6,23,.72);
      color: var(--ink);
    }

    /* Upload zone */
    .upload-zone {
      border: 2px dashed var(--line);
      border-radius: 12px;
      padding: 52px 24px;
      text-align: center;
      cursor: pointer;
      background: var(--panel);
      transition: border-color 0.15s, background 0.15s;
      position: relative;
    }

    .upload-zone:hover,
    .upload-zone.drag-over {
      border-color: var(--accent);
      background: #f0fdf9;
    }

    html[data-theme="dark"] .upload-zone:hover,
    html[data-theme="dark"] .upload-zone.drag-over {
      background: rgba(41,229,155,.08);
    }

    .upload-zone input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }

    .upload-icon {
      width: 48px;
      height: 48px;
      margin: 0 auto 16px;
      background: #f0fdf9;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    html[data-theme="dark"] .upload-icon {
      background: rgba(41,229,155,.08);
    }

    .upload-icon svg {
      width: 24px;
      height: 24px;
      stroke: var(--accent);
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* Validation state cards */
    .validation-card {
      border-radius: 8px;
      padding: 16px;
      display: grid;
      gap: 8px;
    }

    .validation-card.valid {
      background: #f0fdf9;
      border: 1px solid #6ee7b7;
    }

    html[data-theme="dark"] .validation-card.valid {
      background: rgba(41,229,155,.08);
      border-color: rgba(41,229,155,.32);
    }

    .validation-card.error {
      background: #fff8f8;
      border: 1px solid #fca5a5;
    }

    html[data-theme="dark"] .validation-card.error {
      background: rgba(255,95,126,.08);
      border-color: rgba(255,95,126,.28);
    }

    .validation-card.parsing {
      background: #fbfcfe;
      border: 1px solid var(--line);
    }

    html[data-theme="dark"] .validation-card.parsing,
    html[data-theme="dark"] .placeholder-card,
    html[data-theme="dark"] .returning-col.locked {
      background: rgba(2,6,23,.42);
    }

    /* Report ready modal */
    .modal-shell[hidden] {
      display: none;
    }

    .modal-shell {
      position: fixed;
      inset: 0;
      z-index: 40;
    }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(24, 33, 47, 0.56);
    }

    .modal-panel {
      position: relative;
      width: min(440px, calc(100vw - 24px));
      margin: 0 auto;
      top: 50%;
      transform: translateY(-50%);
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 20px 48px rgba(16, 24, 40, 0.22);
      padding: 32px;
      text-align: center;
    }

    .modal-panel .stack {
      align-items: center;
    }

    /* Processing modal */
    .processing-shell[hidden] {
      display: none;
    }

    .processing-shell {
      position: fixed;
      inset: 0;
      z-index: 40;
    }

    .processing-positioner {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      pointer-events: none;
    }

    .processing-receipt {
      width: min(430px, 100%);
      max-height: calc(100vh - 32px);
      overflow: auto;
      pointer-events: auto;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
      padding: 26px;
      text-align: left;
    }

    .processing-receipt-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 20px;
    }

    .processing-eyebrow,
    .processing-receipt-id {
      display: block;
    }

    .processing-eyebrow {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .1em;
      text-transform: uppercase;
    }

    .processing-receipt-id {
      margin-top: 4px;
      color: var(--ink);
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 11px;
    }

    .processing-live {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      flex: 0 0 auto;
      color: var(--accent);
      font-size: 11px;
      font-weight: 800;
    }

    .processing-live i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: currentColor;
      box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
      animation: processing-pulse 1.6s ease-in-out infinite;
    }

    .processing-live[data-state="stalled"] {
      color: var(--danger);
    }

    .processing-live[data-state="stalled"] i {
      animation: none;
    }

    .processing-receipt h2 {
      font-size: 20px;
      letter-spacing: -.02em;
    }

    .processing-receipt > .subtle {
      margin-top: 7px;
    }

    .processing-stages {
      position: relative;
      display: grid;
      gap: 0;
      margin: 24px 0 18px;
      padding: 0;
      list-style: none;
    }

    .processing-stages::before {
      content: "";
      position: absolute;
      top: 15px;
      bottom: 15px;
      left: 8px;
      width: 1px;
      background: var(--line);
    }

    .processing-stages li {
      position: relative;
      display: grid;
      grid-template-columns: 17px 1fr auto;
      align-items: center;
      gap: 11px;
      min-height: 42px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
    }

    .processing-stages small {
      color: var(--muted);
      font-size: 10px;
      font-weight: 750;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .stage-marker {
      position: relative;
      z-index: 1;
      width: 17px;
      height: 17px;
      border: 1px solid var(--line);
      border-radius: 50%;
      background: var(--panel);
    }

    .processing-stages li[data-state="active"] {
      color: var(--ink);
    }

    .processing-stages li[data-state="active"] .stage-marker {
      border-color: var(--accent);
      box-shadow: inset 0 0 0 4px var(--panel);
      background: var(--accent);
    }

    .processing-stages li[data-state="active"] small {
      color: var(--accent);
    }

    .processing-stages li[data-state="complete"] {
      color: var(--ink);
    }

    .processing-stages li[data-state="complete"] .stage-marker {
      border-color: var(--accent);
      background: var(--accent);
    }

    .processing-stages li[data-state="complete"] .stage-marker::after {
      content: "";
      position: absolute;
      left: 4px;
      top: 2px;
      width: 5px;
      height: 8px;
      border: solid #fff;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
    }

    .processing-stages li[data-state="blocked"] .stage-marker {
      border-color: var(--danger);
      background: var(--danger);
    }

    .processing-stages li[data-state="blocked"] small {
      color: var(--danger);
    }

    .processing-elapsed {
      min-height: 18px;
      margin: 0 0 14px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.45;
    }

    .processing-receipt .secondary {
      width: 100%;
    }

    @keyframes processing-pulse {
      50% { opacity: .45; transform: scale(.88); }
    }

    @media (max-width: 600px) {
      main {
        padding: 28px 0 40px;
      }
      header {
        margin-bottom: 28px;
      }
      .processing-receipt {
        padding: 22px 20px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .processing-live i { animation: none; }
    }

    /* Pre-upload curiosity panel */
    .curiosity-panel {
      margin-bottom: 28px;
    }

    .curiosity-headline {
      text-align: center;
      font-size: 15px;
      color: var(--muted);
      margin-bottom: 18px;
      line-height: 1.5;
    }

    .curiosity-headline b {
      color: var(--ink);
      font-weight: 700;
    }

    .ghost-chart {
      width: 100%;
      height: 140px;
      opacity: 0.22;
      animation: ghost-pulse 2.6s ease-in-out infinite;
      margin-bottom: 18px;
      display: block;
    }

    @keyframes ghost-pulse {
      0%, 100% { opacity: 0.18; }
      50%      { opacity: 0.34; }
    }

    .placeholder-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

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

    .placeholder-card {
      position: relative;
      border: 1px dashed var(--line);
      border-radius: 8px;
      padding: 14px 12px;
      background: #fbfcfe;
      text-align: center;
      min-height: 78px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 6px;
    }

    .placeholder-card .label {
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .placeholder-card .body {
      font-size: 22px;
      color: #c8cdd6;
      font-weight: 600;
      line-height: 1;
    }

    .placeholder-card .wiggle {
      position: absolute;
      top: 6px;
      right: 9px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
      opacity: 0.55;
      transition: transform 0.2s, color 0.2s;
    }

    .placeholder-card:hover .wiggle {
      transform: rotate(-10deg) scale(1.15);
      color: var(--accent);
      opacity: 1;
    }

    /* Returning-user two-panel overlay */
    .returning-panel {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1px;
      background: var(--line);
      border: 1px solid var(--line);
      border-radius: 10px;
      overflow: hidden;
      margin-bottom: 18px;
    }
    @media (max-width: 540px) {
      .returning-panel { grid-template-columns: 1fr; }
    }
    .returning-col {
      background: var(--surface);
      padding: 14px;
    }
    .returning-col.locked {
      background: #f8f9fb;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-align: center;
      min-height: 100px;
    }
    .returning-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 6px;
    }
    .returning-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 8px;
      line-height: 1.3;
    }
    .returning-stat {
      font-size: 18px;
      font-weight: 700;
      color: var(--ink);
    }
    .returning-stat-label {
      font-size: 10px;
      color: var(--muted);
    }
    .returning-lock-icon {
      width: 24px; height: 24px;
      stroke: var(--muted); fill: none;
      stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
      opacity: 0.4;
    }
    .returning-locked-text {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.4;
    }

    .return-reason {
      padding-top: 2px;
      text-align: center;
    }

    .return-reason > p {
      margin-bottom: 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .return-reason-options {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 7px;
    }

    .return-reason-options button {
      min-height: 34px;
      padding: 7px 11px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--surface);
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      transition: border-color .16s ease, background .16s ease, color .16s ease;
    }

    .return-reason-options button:hover,
    .return-reason-options button:focus-visible {
      border-color: var(--accent);
      color: var(--ink);
    }

    .return-reason-options button.selected {
      border-color: var(--accent);
      background: color-mix(in srgb, var(--accent) 12%, var(--surface));
      color: var(--accent);
    }
  
