:root {
      color-scheme: light;
      --navy: #001427;
      --text-on-dark: #fff;
      --nav-tab-color: #d9e0dc;
      --nav-active: #17344a;
      --button-primary-hover: #17344a;
      --teal: #708d81;
      --gold: #f4d58d;
      --red: #bf0603;
      --dark-red: #8d0801;
      --page: #f6f5f1;
      --surface: #ffffff;
      --surface-muted: #f0f0eb;
      --ink: #001427;
      --muted: #5e6b70;
      --line: #d8dcd7;
      --line-dark: #aeb7b2;
      --focus-ring: #001427;
      --button-muted-hover: #e6e7e1;
      --dropzone-surface: #fbfbf9;
      --disabled-bg: #e5e7e2;
      --disabled-ink: #4a5a5f;
      --success-bg: #e4eee8;
      --success-ink: #244638;
      --warning-bg: #fbf2d9;
      --warning-ink: #66500f;
      --error-bg: #f7e4e2;
      --error-ink: #8d0801;
      --radius: 10px;
      --content-width: 1120px;
      --panel-gap: 18px;
    }

    * { box-sizing: border-box; }
    html { min-width: 320px; scroll-behavior: smooth; }
    body {
      margin: 0;
      background: var(--page);
      color: var(--ink);
      font-family: 'Switzer', sans-serif;
      font-size: 16px;
      line-height: 1.5;
    }
    em, i { font-style: normal; }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
      outline: 3px solid var(--focus-ring);
      outline-offset: 3px;
    }
    .shell { width: min(var(--content-width), calc(100% - 48px)); margin: 0 auto; }

    .topbar {
      min-height: 72px;
      background: var(--navy);
      color: var(--text-on-dark);
    }
    .topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
    .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-on-dark); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.04em; }
    .icon-mask {
      display: inline-block;
      flex: none;
      pointer-events: none;
      width: 18px;
      height: 18px;
      background-color: currentColor;
      mask-image: var(--icon-image);
      mask-repeat: no-repeat;
      mask-position: center;
      mask-size: contain;
      -webkit-mask-image: var(--icon-image);
      -webkit-mask-repeat: no-repeat;
      -webkit-mask-position: center;
      -webkit-mask-size: contain;
    }
    .brand-icon { width: 26px; height: 26px; color: var(--gold); }
    .nav-tabs { display: flex; align-items: stretch; gap: 6px; min-height: 72px; }
    .nav-tab {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      padding: 0 16px;
      color: var(--nav-tab-color);
      background: transparent;
      border: 0;
      border-bottom: 3px solid transparent;
      font-weight: 500;
    }
    .nav-tab:hover { color: var(--text-on-dark); }
    .nav-tab[aria-current="page"] { color: var(--text-on-dark); background: var(--nav-active); }
    .nav-icon { width: 19px; height: 19px; }

    main { padding: 42px 0 64px; }
    .page-view[hidden], [hidden] { display: none !important; }
    .page-intro { max-width: 720px; margin-bottom: 28px; }
    h1, h2, h3, p { margin-top: 0; }
    .page-title { margin-bottom: 10px; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.045em; font-weight: 600; }
    h2 { margin-bottom: 7px; font-size: 22px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; }
    h3 { margin-bottom: 6px; font-size: 17px; line-height: 1.25; font-weight: 600; }
    .lede { max-width: 640px; margin-bottom: 0; color: var(--muted); font-size: 17px; }

    .steps {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0 0 24px;
      padding: 15px 18px;
      color: var(--muted);
      background: var(--surface-muted);
      border-radius: var(--radius);
      font-size: 14px;
    }
    .has-results .steps { display: none; }
    .step { display: inline-flex; align-items: center; gap: 8px; }
    .step-number { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
    .step-separator { color: var(--line-dark); }

    .panel {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }
    .start-panel { padding: 24px; }
    .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
    .panel-copy { margin: 0; color: var(--muted); }
    .field { display: grid; gap: 7px; margin-bottom: 16px; }
    .field label, .decision legend { font-size: 15px; font-weight: 600; }
    .select-wrap { position: relative; max-width: 360px; }
    .select-wrap select {
      appearance: none;
      -webkit-appearance: none;
      width: 100%; min-height: 46px; padding: 10px 50px 10px 12px;
      color: var(--ink); background: var(--surface); border: 1px solid var(--line-dark); border-radius: 6px;
    }
    .select-wrap select::-ms-expand { display: none; }
    .select-wrap select:focus { outline: none; box-shadow: none; border-color: var(--line-dark); }
    .select-wrap select:focus-visible { outline: 1px solid var(--focus-ring); outline-offset: 1px; }
    .select-icon {
      position: absolute;
      top: 50%;
      right: 16px;
      width: 16px;
      height: 16px;
      color: var(--muted);
      transform: translateY(-50%) rotate(90deg);
    }
    .field-hint { margin: 0; color: var(--muted); font-size: 13px; }
    .optional-label { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
    .brand-field textarea { width: 100%; min-height: 76px; margin-top: 7px; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-dark); border-radius: 6px; resize: vertical; }
    .batch-note { margin: 10px 0; }

    .dropzone {
      display: flex;
      align-items: center;
      gap: 16px;
      min-height: 142px;
      padding: 22px;
      background: var(--dropzone-surface);
      border: 1px dashed var(--line-dark);
      border-radius: 8px;
      transition: background-color 120ms ease;
      cursor: pointer;
    }
    .dropzone:hover, .dropzone.dragover { background: var(--surface-muted); }
    .upload-icon-wrap { display: grid; place-items: center; width: 48px; height: 48px; flex: none; color: var(--navy); background: var(--surface-muted); border-radius: 7px; }
    .upload-icon { width: 25px; height: 25px; }
    .dropzone-copy { flex: 1; min-width: 0; }
    .dropzone-title { display: block; margin-bottom: 3px; font-weight: 600; }
    .dropzone-hint { display: block; color: var(--muted); font-size: 14px; }
    .browse-label, .button-primary, .button-secondary, .button-quiet {
      display: inline-flex; justify-content: center; align-items: center; gap: 9px;
      min-height: 44px; padding: 10px 16px; border: 0; border-radius: 6px; font-weight: 600; text-decoration: none;
    }
    .browse-label, .button-secondary { color: var(--ink); background: var(--surface-muted); }
    .browse-label:hover, .button-secondary:hover { background: var(--button-muted-hover); }
    .button-primary { color: var(--text-on-dark); background: var(--navy); }
    .button-primary:hover { background: var(--button-primary-hover); }
    .button-primary:disabled { color: var(--disabled-ink); background: var(--disabled-bg); cursor: not-allowed; }
    .button-quiet { color: var(--ink); background: transparent; padding-inline: 8px; }
    .button-quiet:hover { background: var(--surface-muted); }
    .button-quiet:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
    .button-icon { width: 18px; height: 18px; }
    .file-input {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .file-input:focus-visible + .dropzone { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

    .selected-file {
      display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 15px;
      margin-top: 14px; padding: 12px; background: var(--surface-muted); border-radius: 8px;
    }
    .selected-preview { width: 84px; height: 66px; object-fit: contain; background: var(--surface); border-radius: 4px; }
    .selected-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
    .selected-meta { display: block; color: var(--muted); font-size: 13px; }
    .start-actions { display: flex; align-items: center; gap: 16px; margin-top: 17px; }
    .action-note { margin: 0; color: var(--muted); font-size: 13px; }

    .review-results { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr); gap: 18px; margin-top: 22px; align-items: start; }
    .result-panel, .decision-panel { padding: 22px; }
    .result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
    .status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
    .status-badge .status-icon { width: 17px; height: 17px; }
    .status-badge.pass { color: var(--success-ink); background: var(--success-bg); }
    .status-badge.fail { color: var(--error-ink); background: var(--error-bg); }
    .status-badge.partial { color: var(--warning-ink); background: var(--warning-bg); }
    .status-badge.error { color: var(--error-ink); background: var(--error-bg); }
    .result-note { margin: -7px 0 16px; color: var(--muted); font-size: 14px; }
    .asset-preview {
      display: grid; place-items: center; min-height: 230px; margin-bottom: 18px; padding: 12px;
      background: var(--surface-muted); border-radius: 6px;
    }
    .asset-preview img { display: block; max-width: 100%; max-height: 310px; object-fit: contain; }
    .score-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .score-label { margin: 0; font-weight: 600; }
    .score-caption { display: block; color: var(--muted); font-size: 13px; }
    .score-value { color: var(--navy); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 20px; }
    .checks-section { margin: 16px 0 20px; }
    .check-list, .evidence-list { list-style: none; padding: 0; margin: 0; }
    .check-list li, .evidence-list li { display: grid; grid-template-columns: minmax(100px, 0.7fr) 1fr; gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
    .check-list strong { font-size: 14px; }
    .check-list small, .evidence-list small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .evidence-list { margin-top: 10px; }
    .evidence-list li { display: grid; grid-template-columns: 1fr; }
    .metric { padding: 12px; background: var(--surface-muted); border-radius: 6px; }
    .metric-value { display: block; font-size: 18px; font-weight: 600; }
    .metric-label { color: var(--muted); font-size: 13px; }
    .list-heading { display: flex; align-items: center; gap: 8px; margin: 17px 0 8px; font-size: 15px; font-weight: 600; }
    .list-heading .icon-mask { width: 18px; height: 18px; }
    .finding-list { margin: 0; padding-left: 22px; }
    .finding-list li { padding: 4px 0 4px 2px; }
    .empty-copy { margin: 0; color: var(--muted); }
    .suggestion-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
    .suggestion-list li { display: grid; grid-template-columns: 17px 1fr; gap: 8px; color: var(--muted); }
    .suggestion-list .icon-mask { width: 17px; height: 17px; margin-top: 3px; }
    .decision-panel h2 { margin-bottom: 5px; }
    .decision-help { margin: 0 0 19px; color: var(--muted); font-size: 14px; }
    .decision { display: grid; gap: 9px; margin: 0 0 18px; padding: 0; border: 0; }
    .decision legend { margin-bottom: 3px; }
    .decision-option { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
    .decision-option:hover { background: var(--dropzone-surface); }
    .decision-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }
    .decision-option span { font-weight: 500; }
    .note-field { display: grid; gap: 6px; margin: 0 0 15px; }
    .note-field label { font-weight: 600; font-size: 14px; }
    .note-field textarea { width: 100%; min-height: 84px; resize: vertical; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-dark); border-radius: 6px; }
    .decision-required { color: var(--error-ink); font-size: 13px; }
    .prompt-guidance-panel { margin-top: var(--panel-gap); }
    .save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .save-message { min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }
    .save-message.success { color: var(--success-ink); }
    .fix-prompt { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
    .fix-prompt h3 { margin-bottom: 6px; }
    .fix-prompt p { margin-bottom: 0; color: var(--muted); white-space: pre-wrap; }

    .history-intro { margin-bottom: 24px; }
    .history-loading { margin: -8px 0 16px; color: var(--muted); font-size: 14px; }
    .history-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; overflow: hidden; }
    .history-stat { padding: 17px 20px; }
    .history-stat + .history-stat { border-left: 1px solid var(--line); }
    .history-stat strong { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
    .history-stat span { color: var(--muted); font-size: 14px; }
    .history-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 18px; align-items: start; }
    .history-panel { padding: 20px; }
    .history-panel > h2 { margin-bottom: 16px; }
    .category-list, .prompt-list { display: grid; gap: 8px; }
    .category-row, .prompt-row { padding: 12px; background: var(--surface-muted); border-radius: 6px; }
    .category-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .category-row strong { font-variant-numeric: tabular-nums; }
    .prompt-row h3 { margin-bottom: 4px; }
    .prompt-row small { color: var(--muted); }
    .prompt-row p { margin: 8px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
    .table-wrap { overflow-x: auto; }
    .review-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
    .review-table th, .review-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
    .review-table th { color: var(--muted); font-size: 13px; font-weight: 600; }
    .review-table td:first-child, .review-table th:first-child { padding-left: 0; }
    .review-table td:last-child, .review-table th:last-child { padding-right: 0; }
    .result-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
    .result-text.pass { color: var(--success-ink); }
    .result-text.fail, .result-text.error { color: var(--error-ink); }
    .result-text .icon-mask { width: 16px; height: 16px; }
    .override-note { color: var(--muted); font-size: 12px; }
    .empty-state { padding: 16px; color: var(--muted); background: var(--surface-muted); border-radius: 6px; }
    .empty-state p { margin: 0 0 12px; }

    @media (max-width: 860px) {
      .review-results, .history-grid { grid-template-columns: 1fr; }
      .review-results { max-width: 680px; margin-inline: auto; }
    }
    @media (max-width: 600px) {
      .shell { width: min(100% - 28px, var(--content-width)); }
      .topbar-inner { min-height: 64px; gap: 8px; }
      .topbar { min-height: 64px; }
      .brand { font-size: 18px; }
      .brand-icon { width: 23px; height: 23px; }
      .nav-tabs { min-height: 64px; gap: 0; }
      .nav-tab { justify-content: center; gap: 4px; padding: 0 6px; font-size: 13px; }
      .nav-icon { width: 17px; height: 17px; }
      main { padding: 30px 0 44px; }
      .page-intro { margin-bottom: 21px; }
      .lede { font-size: 16px; }
      .steps { align-items: flex-start; flex-direction: column; gap: 5px; padding: 13px 15px; }
      .step-separator { display: none; }
      .start-panel, .result-panel, .decision-panel { padding: 17px; }
      .panel-heading { display: block; margin-bottom: 17px; }
      .dropzone { min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 16px; }
      .dropzone-copy { flex-basis: calc(100% - 65px); }
      .browse-button { margin-left: 60px; }
      .selected-file { grid-template-columns: 64px minmax(0, 1fr); }
      .selected-preview { width: 64px; height: 58px; }
      .selected-file .button-quiet { grid-column: 2; justify-self: start; }
      .start-actions { align-items: stretch; flex-direction: column; gap: 9px; }
      .start-actions .button-primary { width: 100%; }
      .action-note { text-align: center; }
      .result-heading { align-items: flex-start; flex-direction: column; }
      .asset-preview { min-height: 180px; }
      .metrics { gap: 9px; }
      .check-list li { grid-template-columns: 1fr; gap: 3px; }
      .history-stats { grid-template-columns: 1fr; }
      .history-stat + .history-stat { border-left: 0; border-top: 1px solid var(--line); }
      .review-table { min-width: 590px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
    }
    @media (prefers-color-scheme: dark) {
      :root {
        color-scheme: dark;
        --page: #001427;
        --surface: #0a0e17;
        --surface-muted: #111827;
        --ink: #f0f4f8;
        --nav-tab-color: #c1cad0;
        --muted: #a8b2d1;
        --line: #2a3042;
        --line-dark: #5e6b70;
        --focus-ring: #c1cad0;
        --button-muted-hover: #202838;
        --dropzone-surface: #0a0e17;
        --disabled-bg: #2a3042;
        --disabled-ink: #c1cad0;
        --success-bg: #173b30;
        --success-ink: #c4ddce;
        --warning-bg: #423617;
        --warning-ink: #f4d58d;
        --error-bg: #431a19;
        --error-ink: #ffb3ac;
      }
      .score-value { color: var(--gold); }
    }
