/* SC Risk Advisor — Mandati Design System, light theme only, fonts served locally (CSP font-src 'self'). */
@font-face { font-family: "Anton"; src: url("../fonts/anton-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Anton"; src: url("../fonts/anton-latin-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bevan"; src: url("../fonts/bevan-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bevan"; src: url("../fonts/bevan-latin-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bevan"; font-style: italic; src: url("../fonts/bevan-italic-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Bevan"; font-style: italic; src: url("../fonts/bevan-italic-latin-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Slabo 27px"; src: url("../fonts/slabo-27px-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Slabo 27px"; src: url("../fonts/slabo-27px-latin-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --navy: #003049; --navy-deep: #00233a; --slate: #386886; --royal: #0076be; --royal-hover: #0069aa;
  --teal: #089da5; --teal-bright: #54f9e9; --sage: #e9f2d8; --positive: #00c73f; --negative: #c1121f;
  --bg: #f7f5ef; --fg-1: var(--navy); --fg-2: var(--slate); --fg-3: #86a2b6;
  --border: #dee4e8; --border-strong: #bfc9d1; --surface-hover: #f1f4f5; --navy-8: #e9edef; --royal-14: #e0ecf7; --royal-6: #f2f7fc;
  --f-display: "Anton", "Oswald", "Helvetica Neue Condensed", sans-serif;
  --f-slab: "Bevan", Rockwell, Georgia, serif;
  --f-body: "Slabo 27px", Georgia, "Times New Roman", serif;
  --r-sm: 2px; --r-md: 4px; --r-lg: 8px;
  --shadow-1: 0 1px 2px rgba(0,48,73,.08); --shadow-2: 0 8px 24px -8px rgba(0,48,73,.18);
  /* risk levels: four bands, colour-blind safe order light → dark, plus the text label always shown */
  --lv-low: #e9f2d8; --lv-low-fg: #2c4a10;
  --lv-medium: #fbe7a1; --lv-medium-fg: #5a4300;
  --lv-high: #f2a65a; --lv-high-fg: #3d1d00;
  --lv-critical: #c1121f; --lv-critical-fg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg-1); font: 400 16px/1.55 var(--f-body); overflow-x: hidden; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; line-height: 1.05; color: var(--fg-1); }
h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 16px; }
h2 { font-size: clamp(22px, 3.2vw, 30px); margin: 0 0 14px; }
h3 { font-size: clamp(18px, 2.4vw, 22px); margin: 20px 0 10px; }
h4 { font-family: var(--f-slab); font-weight: 400; font-size: 18px; line-height: 1.3; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
small, .small { font-size: 14px; color: var(--fg-2); }
a { color: var(--royal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.eyebrow { font-family: var(--f-display); text-transform: uppercase; font-size: 13px; letter-spacing: .14em; color: var(--teal); margin: 0 0 6px; }
.lead { font-family: var(--f-slab); font-style: italic; font-size: 19px; line-height: 1.35; color: var(--fg-2); }

/* header */
.top { background: var(--bg); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.brand { text-decoration: none; color: var(--navy); display: flex; flex-direction: column; line-height: 1; }
.brand b { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: 22px; letter-spacing: .06em; }
.brand span { font-family: var(--f-display); text-transform: uppercase; font-size: 11px; letter-spacing: .16em; color: var(--teal); margin-top: 4px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-left: auto; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.nav a { color: var(--navy); text-decoration: none; padding: 8px 10px; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--border-strong); }
.nav a[aria-current="page"] { border-bottom-color: var(--royal); }
.nav form { margin: 0; }
.nav button { background: none; border: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--fg-2); cursor: pointer; padding: 8px 10px; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 80px; }
.read { max-width: 1080px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--fg-2); }

/* cards and grids */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 20px; margin: 0 0 16px; }
.card.narrow { max-width: 460px; margin: 32px auto; }
.card.warm { background: var(--sage); border-color: #d3e3b8; }
.card.inverse { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.inverse h2, .card.inverse h3 { color: #fff; } .card.inverse .eyebrow { color: var(--teal-bright); } .card.inverse a { color: #aafcf2; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid > .card { margin: 0; }
.kpi { font-family: var(--f-display); font-size: 40px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--fg-2); }
.note { background: var(--royal-14); border-radius: var(--r-md); padding: 12px 16px; margin: 0 0 16px; }
.warn { border-left: 4px solid var(--negative); background: #fbeeee; padding: 10px 14px; border-radius: var(--r-sm); margin: 0 0 16px; }
.ok-msg { border-left: 4px solid var(--teal); background: var(--royal-6); padding: 10px 14px; border-radius: var(--r-sm); margin: 0 0 16px; }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 400 15px/1 var(--f-body); padding: 11px 18px; border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--royal); color: #fff; } .btn-primary:hover { background: var(--royal-hover); color: #fff; }
.btn-outline { background: var(--bg); color: var(--navy); border-color: var(--border-strong); } .btn-outline:hover { background: var(--surface-hover); color: var(--navy); }
.btn-small { padding: 7px 12px; font-size: 14px; }
.btn-danger { background: var(--bg); color: var(--negative); border-color: var(--negative); }
form.inline { display: inline; margin: 0; }
label { display: block; font-family: var(--f-slab); font-size: 15px; margin: 14px 0 4px; }
label.check { display: inline-flex; gap: 8px; align-items: center; font-family: var(--f-body); font-size: 16px; margin: 4px 16px 4px 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; max-width: 100%; font: inherit; color: var(--fg-1); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 9px 11px;
}
textarea { min-height: 90px; resize: vertical; }
.fields { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); align-items: end; }
.fields .wide { grid-column: 1 / -1; }
.hint { font-size: 14px; color: var(--fg-2); margin: 4px 0 0; }
.actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.result { min-height: 1.5em; margin: 12px 0 0; }
.result.ok { color: var(--slate); } .result.ko { color: var(--negative); }

/* tables */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--slate); text-align: left; border-bottom: 1px solid var(--border-strong); padding: 8px 10px; }
td { border-bottom: 1px solid var(--border); padding: 9px 10px; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.na td { color: var(--fg-3); }

/* tags, levels, chips */
.tag { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 7px; border-radius: var(--r-sm); background: var(--navy-8); color: var(--navy); white-space: nowrap; }
.tag.teal { background: #dff3f4; color: #05666b; }
.lv { display: inline-block; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; line-height: 1; padding: 6px 8px; border-radius: var(--r-sm); white-space: nowrap; }
.lv-low { background: var(--lv-low); color: var(--lv-low-fg); }
.lv-medium { background: var(--lv-medium); color: var(--lv-medium-fg); }
.lv-high { background: var(--lv-high); color: var(--lv-high-fg); }
.lv-critical { background: var(--lv-critical); color: var(--lv-critical-fg); }
.lv-none { background: var(--navy-8); color: var(--fg-2); }

/* level ladder in the library */
.ladder { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 8px 0 16px; }
.ladder > div { border: 1px solid var(--border); border-top: 6px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 12px; background: var(--bg); }
.ladder .s-low { border-top-color: #a9c97a; } .ladder .s-medium { border-top-color: #e8c34a; }
.ladder .s-high { border-top-color: #f2a65a; } .ladder .s-critical { border-top-color: var(--lv-critical); }
.ladder p { margin: 6px 0 0; font-size: 15px; }

/* sources */
sup.src { font-size: 11px; line-height: 0; margin-left: 1px; }
sup.src a { text-decoration: none; }
ol.sources { font-size: 14px; padding-left: 1.6em; overflow-wrap: anywhere; }
ol.sources li { margin: 0 0 6px; }

/* risk list in library */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.cat-list li a { font-family: var(--f-slab); font-size: 17px; }

/* heat map */
.heat { display: grid; grid-template-columns: 34px repeat(5, minmax(0, 1fr)); gap: 3px; max-width: 520px; font-size: 13px; }
.heat .ax { display: flex; align-items: center; justify-content: center; color: var(--fg-2); font-family: var(--f-display); }
.heat .cell { aspect-ratio: 1.4 / 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 18px; }
.heat .cell.empty { opacity: .45; font-size: 12px; }
.heat-cap { display: flex; justify-content: space-between; max-width: 520px; padding-left: 37px; font-size: 13px; color: var(--fg-2); }

/* rating form rows */
.rate { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 12px; background: var(--bg); }
.rate.off { opacity: .6; }
.rate h4 { margin: 0 0 4px; }
.rate .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
details > summary { cursor: pointer; color: var(--royal); }
details { margin: 8px 0; }

/* helpers (no inline styles: the CSP blocks them) */
.card.inverse h1 { color: #fff; } .card.inverse .lead { color: #aafcf2; }
.search-row { display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 0 0 20px; }
.search-row label { margin: 0; }
.gap-top { margin-top: 12px; } .w45 { width: 45%; } .m0 { margin: 0; }
a.plain { color: inherit; text-decoration: none; } a.plain:hover { text-decoration: underline; }
label.check.option { display: flex; align-items: flex-start; margin: 8px 0; }
label.check.option input { margin-top: 5px; }
tr.current td { background: var(--royal-6); }

/* AI draft */
.ai-card { border-top: 4px solid var(--teal); }
.ai-box { border: 1px dashed var(--teal); background: #f0fafa; border-radius: var(--r-md); padding: 12px 14px; margin: 10px 0; }
.ai-box p { margin: 6px 0; }
.ai-box .actions { margin-top: 8px; align-items: center; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--navy); border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { border-bottom-color: var(--royal); }

.research-answer { overflow-wrap: anywhere; }
.research-answer h1, .research-answer h2, .research-answer h3 { font-size: 18px; margin: 14px 0 8px; }

@media (max-width: 640px) {
  .nav { margin-left: 0; width: 100%; }
  .card { padding: 16px; }
  .kpi { font-size: 34px; }
}
@media print {
  .top, .foot, .no-print, .actions { display: none !important; }
  body, html { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
