:root {
  --if-orange: #c9670f;
  --if-orange-light: #e08a2a;
  --if-orange-pale: #fbf0e4;
  --if-charcoal: #242427;
  --if-header: #1b1b1e;
  --if-surface: #ffffff;
  --if-canvas: #f3f3f4;
  --if-border: #dedee1;
  --if-text: #1a1a1a;
  --if-text-sub: #626268;
  --if-danger: #aa2200;
  --if-danger-bg: #ffefec;
  --if-focus: #f0a351;
  --shadow-sm: 0 8px 22px rgb(26 26 26 / 7%);
  --shadow-lg: 0 24px 70px rgb(26 26 26 / 12%);
  --radius: 14px;
  --font: Calibri, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--if-canvas); color: var(--if-text); font-family: var(--font); font-size: 15px; line-height: 1.55; }
button, input { font: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-140%); background: #fff; color: #000; padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }

.app-header { background: var(--if-header); border-bottom: 3px solid var(--if-orange); color: #fff; }
.header-inner { max-width: 1180px; margin: 0 auto; min-height: 86px; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 66px; height: 60px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong { font-size: 25px; letter-spacing: .035em; }
.brand-copy span { margin-top: 5px; color: var(--if-orange-light); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; gap: 18px; }
.deterministic-pill { border: 1px solid rgb(224 138 42 / 45%); background: rgb(201 103 15 / 12%); color: #f6bb78; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.deterministic-pill span { margin-right: 5px; }
.workspace-name { color: #b9b9be; font-size: 13px; }

.page-shell { max-width: 1180px; min-height: calc(100vh - 146px); margin: 0 auto; padding: 46px 24px 72px; }
.page-heading, .audit-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 7px; color: var(--if-orange); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.12; }
h1 { max-width: 760px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.035em; }
h2 { font-size: 22px; letter-spacing: -.015em; }
.lede { max-width: 650px; margin: 12px 0 0; color: var(--if-text-sub); font-size: 17px; }
.ruleset-card { min-width: 190px; padding: 17px 20px; border: 1px solid var(--if-border); border-left: 4px solid var(--if-orange); background: #fff; box-shadow: var(--shadow-sm); border-radius: 9px; display: flex; flex-direction: column; }
.ruleset-card span, .ruleset-card small { color: var(--if-text-sub); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.ruleset-card strong { margin: 2px 0; font-size: 18px; }

.alert { margin-bottom: 22px; padding: 14px 17px; display: flex; gap: 10px; border-radius: 9px; }
.alert-error { border: 1px solid #e6b3a8; background: var(--if-danger-bg); color: var(--if-danger); }
.workspace-grid, .audit-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 22px; }
.upload-card, .workflow-card, .audit-panel, .action-panel { border: 1px solid var(--if-border); background: var(--if-surface); box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.upload-card { padding: 28px; }
.workflow-card, .action-panel { padding: 28px; background: var(--if-charcoal); color: #fff; border-color: var(--if-charcoal); box-shadow: var(--shadow-lg); }
.workflow-card .eyebrow, .action-panel .eyebrow { color: var(--if-orange-light); }
.card-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 23px; }
.step-number { width: 42px; height: 42px; display: grid; place-items: center; background: var(--if-orange-pale); color: var(--if-orange); border-radius: 9px; font-weight: 700; }
.upload-form { display: grid; gap: 14px; }
.drop-zone { position: relative; min-height: 205px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #babac0; background: #fafafa; border-radius: 11px; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.drop-zone:hover { border-color: var(--if-orange); background: #fffaf5; transform: translateY(-1px); }
.drop-zone:focus-within { outline: 3px solid rgb(240 163 81 / 35%); border-color: var(--if-orange); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; background: var(--if-orange-pale); color: var(--if-orange); }
.upload-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 18px; font-weight: 700; }
.drop-help { margin-top: 5px; color: var(--if-text-sub); font-size: 13px; }
.button { min-height: 46px; padding: 11px 18px; border-radius: 8px; border: 0; display: inline-flex; justify-content: center; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: var(--if-orange); color: #fff; box-shadow: 0 8px 18px rgb(201 103 15 / 22%); }
.button-primary:hover { background: #b65a0b; }
.button-secondary { border: 1px solid var(--if-orange-light); color: #f6b76f; background: transparent; }
.button-disabled { background: #45454a; color: #99999f; cursor: not-allowed; }
.button:focus-visible, a:focus-visible { outline: 3px solid var(--if-focus); outline-offset: 3px; }
.privacy-note { margin: 2px 0 0; display: flex; justify-content: center; gap: 7px; color: var(--if-text-sub); font-size: 12px; }
.privacy-note svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.workflow-list { margin: 25px 0 0; padding: 0; list-style: none; }
.workflow-list li { position: relative; min-height: 64px; display: flex; gap: 13px; color: #99999f; }
.workflow-list li::after { content: ""; position: absolute; left: 14px; top: 31px; bottom: 2px; width: 1px; background: #4a4a4f; }
.workflow-list li:last-child::after { display: none; }
.workflow-list li > span { position: relative; z-index: 1; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #55555b; background: var(--if-charcoal); border-radius: 50%; font-size: 11px; font-weight: 700; }
.workflow-list li div { display: flex; flex-direction: column; }
.workflow-list li strong { color: #d6d6da; font-size: 14px; }
.workflow-list li small { margin-top: 2px; }
.workflow-list li.active > span { border-color: var(--if-orange-light); background: var(--if-orange); color: #fff; }
.workflow-list li.active strong { color: #fff; }

.recent-section { margin-top: 42px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.record-count { color: var(--if-text-sub); font-size: 12px; }
.audit-table-wrap { overflow-x: auto; border: 1px solid var(--if-border); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th { padding: 12px 17px; background: var(--if-charcoal); color: #d9d9dc; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.audit-table td { padding: 15px 17px; border-top: 1px solid #ececef; }
.audit-table td:first-child { border-left: 5px solid var(--if-orange-light); }
.audit-table td strong, .audit-table td small { display: block; }
.audit-table td small { color: var(--if-text-sub); }
.row-link { color: var(--if-orange); font-weight: 700; text-decoration: none; white-space: nowrap; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: var(--if-orange-pale); color: var(--if-orange); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.status-large { padding: 7px 12px; }
.empty-state { min-height: 175px; border: 1px dashed #c8c8cc; display: grid; place-items: center; align-content: center; text-align: center; background: rgb(255 255 255 / 50%); border-radius: 11px; }
.empty-state > span { color: var(--if-orange); font-size: 28px; }
.empty-state strong { margin-top: 6px; }
.empty-state p { margin: 2px 0 0; color: var(--if-text-sub); }

.breadcrumb { display: flex; gap: 8px; margin-bottom: 24px; color: var(--if-text-sub); font-size: 13px; }
.breadcrumb a { color: var(--if-orange); font-weight: 700; text-decoration: none; }
.audit-hero { align-items: center; }
.audit-hero h1 { font-size: clamp(28px, 4vw, 44px); overflow-wrap: anywhere; }
.audit-panel { overflow: hidden; }
.panel-bar { padding: 13px 18px; display: flex; justify-content: space-between; gap: 12px; background: var(--if-charcoal); border-bottom: 3px solid var(--if-orange); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.panel-bar small { color: #aaaab0; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; }
.fact-grid div { padding: 18px 20px; border-bottom: 1px solid #e9e9eb; border-left: 5px solid var(--if-orange-light); }
.fact-grid div:nth-child(4n+2), .fact-grid div:nth-child(4n+3) { background: #f4f4f4; }
.fact-grid span, .fact-grid strong { display: block; }
.fact-grid span { color: var(--if-text-sub); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.fact-grid strong { margin-top: 4px; overflow-wrap: anywhere; }
.mono { font-family: "Courier New", monospace; }
.foundation-notice { margin: 20px; padding: 17px; display: flex; gap: 13px; background: var(--if-orange-pale); border-left: 4px solid var(--if-orange); border-radius: 7px; }
.foundation-notice p { margin: 3px 0 0; color: #5d4b3b; }
.notice-icon { color: var(--if-orange); }
.action-panel { align-self: start; }
.action-panel p:not(.eyebrow) { color: #babac0; }
.action-panel .button { width: 100%; margin-top: 11px; }
.button-danger { width: 100%; margin-top: 11px; border: 1px solid #d6806b; background: transparent; color: #ffb09e; }
.findings-panel { padding: 24px; }
.findings-panel h2 { margin-bottom: 16px; }
.finding { margin: 10px 0; padding: 14px 16px; border-left: 4px solid var(--if-orange); background: #fafafa; border-radius: 6px; }
.finding-fail { border-left-color: var(--if-danger); background: var(--if-danger-bg); }
.finding p { margin: 4px 0; }
.finding small { color: var(--if-text-sub); }

.app-footer { min-height: 60px; padding: 18px 24px; display: flex; justify-content: center; gap: 10px; border-top: 1px solid #d7d7da; color: var(--if-text-sub); font-size: 12px; }
.app-footer span { color: var(--if-orange); }

.login-shell { min-height: 560px; display: grid; place-items: center; }
.login-card { width: min(100%, 480px); padding: 38px; border: 1px solid var(--if-border); border-top: 4px solid var(--if-orange); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: clamp(30px, 5vw, 42px); }
.login-card .lede { margin-bottom: 25px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 6px; font-size: 13px; font-weight: 700; }
.login-form input { min-height: 48px; padding: 10px 13px; border: 1px solid #bdbdc2; border-radius: 8px; background: #fff; }
.login-form input:focus { outline: 3px solid rgb(240 163 81 / 35%); border-color: var(--if-orange); }
.login-form .button { margin-top: 13px; }
.login-card .privacy-note { margin-top: 18px; text-align: center; }

@media (max-width: 800px) {
  .header-meta .workspace-name { display: none; }
  .page-heading, .audit-hero { align-items: flex-start; flex-direction: column; }
  .workspace-grid, .audit-layout { grid-template-columns: 1fr; }
  .ruleset-card { width: 100%; }
}

@media (max-width: 560px) {
  .header-inner { padding-inline: 16px; }
  .brand img { width: 54px; height: 50px; }
  .brand-copy strong { font-size: 21px; }
  .deterministic-pill { display: none; }
  .page-shell { padding: 32px 16px 56px; }
  .upload-card, .workflow-card, .action-panel { padding: 21px; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact-grid div:nth-child(even) { background: #f4f4f4; }
  .panel-bar { align-items: flex-start; flex-direction: column; }
  .app-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

