/* The mfadvisory.ai design system, applied to a working tool.
   IBM Plex on the Carbon palette: hairlines rather than shadows, one accent, and enough
   restraint that a number is the loudest thing on the page. */

:root {
  --blue: #0f62fe;
  --blue-hover: #0050e6;
  --blue-active: #0043ce;
  --blue-wash: #edf5ff;
  --ink: #161616;
  --ink-muted: #525252;
  --ink-subtle: #8c8c8c;
  --canvas: #ffffff;
  --layer: #f4f4f4;
  --hairline: #e0e0e0;
  --hairline-strong: #161616;
  --inverse: #0f1f3d;
  --inverse-2: #1b2d5b;
  --inverse-3: #24365f;
  --inverse-ink: #ffffff;
  --inverse-ink-muted: #c6cdd9;
  --accent-soft: #8fa3c4;
  --error: #da1e28;
  --error-wash: #fff1f1;
  --success: #24a148;
  --success-wash: #defbe6;
  --warn: #f1c21b;
  --warn-wash: #fcf4d6;

  --sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --s-xxs: 4px;  --s-xs: 8px;   --s-sm: 12px;  --s-md: 16px;
  --s-lg: 24px;  --s-xl: 32px;  --s-xxl: 48px; --s-section: 96px;
  --max: 1584px;
  --motion: cubic-bezier(.2, 0, .38, .9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 42px; line-height: 1.15; font-weight: 300; letter-spacing: -0.02em; }
h2 { font-size: 26px; line-height: 1.25; font-weight: 300; }
h3 { font-size: 16px; line-height: 1.35; }
p  { margin: 0 0 var(--s-md); color: var(--ink-muted); max-width: 66ch; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-subtle); margin-bottom: var(--s-xs);
}

/* ---------------------------------------------------------------- shell */
.masthead {
  background: var(--inverse); color: var(--inverse-ink);
  border-bottom: 1px solid var(--inverse-2);
  position: sticky; top: 0; z-index: 40;
}
.masthead-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--s-lg);
  display: flex; align-items: center; gap: var(--s-lg); height: 48px;
}
/* PRISM 17. The name carries the mark: solid stem, light numeral, and a hairline rule beneath
   in the accent - a prism splitting one beam, which is what the tool does to a submission. */
.brand { font-weight: 600; font-size: 16px; letter-spacing: .04em; white-space: nowrap;
         position: relative; padding-bottom: 3px; }
.brand span { color: var(--accent-soft); font-weight: 300; letter-spacing: .02em; }
.brand::after { content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 2px;
                background: var(--blue); }
.masthead nav { display: flex; gap: 2px; margin-left: var(--s-md); flex: 1; overflow-x: auto; }
.masthead nav button {
  background: none; border: 0; color: var(--inverse-ink-muted);
  font-family: var(--sans); font-size: 13px; padding: 0 var(--s-md); height: 48px;
  cursor: pointer; border-bottom: 3px solid transparent; transition: .11s var(--motion);
  white-space: nowrap;
}
.masthead nav button:hover { background: var(--inverse-2); color: #fff; }
.masthead nav button[aria-current="page"] { color: #fff; border-bottom-color: var(--blue); }
.role-pick {
  background: var(--inverse-2); color: #fff; border: 1px solid var(--inverse-3);
  font-family: var(--sans); font-size: 12px; padding: 6px var(--s-sm); cursor: pointer;
}
.role-pick:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: var(--s-xl) var(--s-lg) var(--s-section); }
.page-head { border-bottom: 1px solid var(--hairline); padding-bottom: var(--s-lg); margin-bottom: var(--s-xl); }
.page-head p { margin-bottom: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  padding: 11px var(--s-md); border: 1px solid transparent; cursor: pointer;
  transition: background .11s var(--motion), color .11s var(--motion);
  display: inline-flex; align-items: center; gap: var(--s-xs); min-height: 40px;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-primary:active:not(:disabled) { background: var(--blue-active); }
.btn-secondary { background: var(--inverse); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--inverse-2); }
.btn-tertiary { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-tertiary:hover:not(:disabled) { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--layer); }
.btn-row { display: flex; gap: var(--s-sm); flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards + grid */
.grid { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.cell { background: var(--canvas); padding: var(--s-lg); }

.tile { background: var(--canvas); padding: var(--s-lg); border-left: 3px solid var(--blue); }
.tile .k { font-size: 11px; font-family: var(--mono); letter-spacing: .06em;
           text-transform: uppercase; color: var(--ink-subtle); }
.tile .v { font-size: 30px; font-weight: 300; font-family: var(--mono);
           font-variant-numeric: tabular-nums; margin-top: var(--s-xs); letter-spacing: -.02em; }
.tile .s { font-size: 12px; color: var(--ink-muted); margin-top: var(--s-xxs); }
.tile.neutral { border-left-color: var(--ink-subtle); }
.tile.good { border-left-color: var(--success); }
.tile.bad  { border-left-color: var(--error); }

.card { border: 1px solid var(--hairline); background: var(--canvas); }
.card-head {
  padding: var(--s-md) var(--s-lg); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-md);
}
.card-head h3 { font-size: 15px; }
.card-body { padding: var(--s-lg); }
.card-body.flush { padding: 0; }

/* ---------------------------------------------------------------- tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: var(--layer); text-align: left; font-weight: 600; font-size: 12px;
  padding: var(--s-sm) var(--s-md); border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; white-space: nowrap;
}
table.data td { padding: var(--s-sm) var(--s-md); border-bottom: 1px solid var(--hairline); }
table.data tbody tr:hover { background: var(--blue-wash); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono);
                                       font-variant-numeric: tabular-nums; }
table.data tr.total td { font-weight: 600; border-top: 2px solid var(--hairline-strong);
                         background: var(--layer); }
.scroll-x { overflow-x: auto; }
.scroll-y { max-height: 540px; overflow-y: auto; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--hairline);
        margin-bottom: var(--s-lg); overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--sans); font-size: 13px; color: var(--ink-muted);
  padding: var(--s-sm) var(--s-md); cursor: pointer; white-space: nowrap;
  transition: .11s var(--motion);
}
.tabs button:hover { color: var(--ink); background: var(--layer); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue);
                                     font-weight: 600; }

/* ---------------------------------------------------------------- status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  font-family: var(--mono); letter-spacing: .04em; padding: 3px var(--s-xs);
  text-transform: uppercase;
}
.pill.ok   { background: var(--success-wash); color: #0e6027; }
.pill.warn { background: var(--warn-wash);    color: #684e00; }
.pill.bad  { background: var(--error-wash);   color: #a2191f; }
.pill.idle { background: var(--layer);        color: var(--ink-muted); }

.note {
  border-left: 3px solid var(--blue); background: var(--blue-wash);
  padding: var(--s-md) var(--s-lg); font-size: 13px; margin-bottom: var(--s-lg);
}
.note.warn { border-left-color: var(--warn); background: var(--warn-wash); }
.note.bad  { border-left-color: var(--error); background: var(--error-wash); }
.note.good { border-left-color: var(--success); background: var(--success-wash); }
.note p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- upload */
.drop {
  /* a <label> is inline by default, which collapses the whole drop target to a sliver */
  display: block; width: 100%; cursor: pointer;
  border: 1px dashed var(--hairline-strong); background: var(--layer);
  padding: var(--s-xxl); text-align: center; transition: .11s var(--motion);
}
.drop.over { background: var(--blue-wash); border-color: var(--blue); }
.drop input { display: none; }

/* ---------------------------------------------------------------- waterfall */
.wf { display: flex; align-items: flex-end; gap: var(--s-sm); height: 240px;
      padding-top: var(--s-lg); }
.wf-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
          align-items: center; gap: var(--s-xs); min-width: 0; }
.wf-bar { width: 100%; background: var(--blue); min-height: 2px; }
.wf-bar.neg { background: var(--error); }
.wf-bar.total { background: var(--inverse); }
.wf-lab { font-size: 10px; color: var(--ink-muted); text-align: center; line-height: 1.2;
          word-break: break-word; }
.wf-val { font-family: var(--mono); font-size: 10px; color: var(--ink); }

.bar-track { background: var(--layer); height: 8px; width: 100%; position: relative; }
.bar-fill  { background: var(--blue); height: 8px; }

/* ---------------------------------------------------------------- misc */
.stack > * + * { margin-top: var(--s-lg); }
.row { display: flex; gap: var(--s-md); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--s-md); }
/* auto-fill leaves the hairline showing where a row does not fill; auto-fit collapses it */
.sheet-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
              gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.sheet-item { background: var(--canvas); padding: var(--s-md); cursor: pointer;
              transition: .11s var(--motion); border-left: 3px solid transparent; }
.sheet-item:hover { background: var(--blue-wash); border-left-color: var(--blue); }
.sheet-item .t { font-weight: 600; font-size: 13px; }
.sheet-item .d { font-size: 11px; color: var(--ink-subtle); font-family: var(--mono);
                 margin-top: 2px; }
.hidden { display: none !important; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--hairline);
        border-top-color: var(--blue); border-radius: 50%; animation: sp .6s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  h1 { font-size: 30px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .wrap { padding: var(--s-lg) var(--s-md) var(--s-xxl); }
  .masthead-inner { padding: 0 var(--s-md); }
}

/* ================================================================ sign in */
.signin-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.signin-side {
  background: var(--inverse); color: var(--inverse-ink);
  padding: var(--s-section) var(--s-xxl); display: flex; flex-direction: column;
  justify-content: center; position: relative; overflow: hidden;
}
.signin-side::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 420px; height: 420px; border: 1px solid var(--inverse-2); border-radius: 50%;
}
.signin-side::before {
  content: ""; position: absolute; right: -40px; bottom: -40px;
  width: 260px; height: 260px; border: 1px solid var(--inverse-3); border-radius: 50%;
}
.signin-side h1 { color: #fff; margin-bottom: var(--s-md); position: relative; z-index: 1; }
.signin-side p { color: var(--inverse-ink-muted); max-width: 46ch; position: relative; z-index: 1; }
.signin-mark { font-size: 22px; font-weight: 600; letter-spacing: .06em;
               margin-bottom: var(--s-xxl); position: relative; z-index: 1; }
.signin-mark span { color: var(--accent-soft); font-weight: 300; }
.signin-form { padding: var(--s-section) var(--s-xxl); display: flex; flex-direction: column;
               justify-content: center; max-width: 560px; }
.field { margin-bottom: var(--s-lg); }
.field label { display: block; font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px var(--s-md); border: 0; border-bottom: 1px solid var(--ink);
  background: var(--layer); font-family: var(--sans); font-size: 14px; color: var(--ink);
}
.field input:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.who-list { display: grid; gap: 1px; background: var(--hairline);
            border: 1px solid var(--hairline); margin-top: var(--s-md); }
.who-list button {
  background: var(--canvas); border: 0; text-align: left; padding: var(--s-sm) var(--s-md);
  cursor: pointer; font-family: var(--sans); font-size: 12px; display: flex;
  justify-content: space-between; gap: var(--s-sm); transition: .11s var(--motion);
}
.who-list button:hover { background: var(--blue-wash); }
.who-list .u { font-family: var(--mono); color: var(--ink-muted); }

/* ================================================================ charts */
.donut { width: 210px; height: 210px; border-radius: 50%; position: relative; flex: none; }
.donut::after {
  content: ""; position: absolute; inset: 40px; background: var(--canvas); border-radius: 50%;
}
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column;
             align-items: center; justify-content: center; z-index: 1; }
.donut-mid .v { font-family: var(--mono); font-size: 21px; font-weight: 600; }
.donut-mid .k { font-size: 9px; color: var(--ink-subtle); text-transform: uppercase;
                letter-spacing: .06em; }
.legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; flex: 1; min-width: 0; }
.legend .li { display: flex; align-items: center; gap: var(--s-xs); }
.legend .sw { width: 14px; height: 14px; flex: none; border-radius: 2px; }
.legend .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .vv { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-muted); }

.hbars { display: flex; flex-direction: column; gap: var(--s-md); }
.hbar { display: grid; grid-template-columns: 170px 1fr 120px; gap: var(--s-md);
        align-items: center; font-size: 13px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .tr { background: var(--layer); height: 24px; position: relative; }
.hbar .fl { height: 24px; background: var(--blue); transition: width .3s var(--motion); }
.hbar .fl.alt { background: var(--accent-soft); }
.hbar .vv { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 24px; width: 100%; }
.stack > span { height: 24px; }

/* waterfall with a floating bar per step and a connector between them */
.wfall { position: relative; display: flex; align-items: flex-end; gap: 6px;
         height: 300px; padding: var(--s-lg) 0 0; }
.wfall-col { flex: 1; min-width: 0; position: relative; height: 100%;
             display: flex; flex-direction: column; }
.wfall-bar { position: absolute; left: 8%; width: 84%; background: var(--blue); }
.wfall-bar.neg { background: var(--error); }
.wfall-bar.total { background: var(--inverse); }
.wfall-val { position: absolute; left: 0; right: 0; text-align: center;
             font-family: var(--mono); font-size: 10px; color: var(--ink); }
.wfall-axis { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--hairline); }
/* bars that run down to the zero axis would otherwise sit on top of the labels */
.wfall-labs { display: flex; gap: 6px; margin-top: var(--s-md);
              padding-top: var(--s-xs); border-top: 1px solid var(--hairline); }
.wfall-labs div { flex: 1; min-width: 0; font-size: 10px; color: var(--ink-muted);
                  text-align: center; line-height: 1.25; word-break: break-word; }

/* The movement is broken out to the individual disclosure lines, which is a lot of bars, so
   each bucket - revenue, service expense, finance, cash flows - is given its own colour and a
   band beneath the chart saying where it starts and stops and what it came to. */
.wfall-bar.g-rev  { background: var(--c2); }
.wfall-bar.g-exp  { background: var(--c1); }
.wfall-bar.g-exp.neg { background: var(--c7); }
.wfall-bar.g-fin  { background: var(--c5); }
.wfall-bar.g-cash { background: var(--c3); }
.wfall-bar.g-rev.neg  { background: var(--c10); }
.wfall-bar.g-fin.neg  { background: var(--c9); }
.wfall-bar.g-cash.neg { background: var(--c8); }

.wfall-bands { display: flex; gap: 6px; margin-top: var(--s-sm); }
.wfall-band  { min-width: 0; padding: 4px 8px; border-radius: 2px;
               background: var(--layer); border-top: 3px solid var(--hairline); }
.wfall-band b { display: block; font-size: 10px; letter-spacing: .3px;
                text-transform: uppercase; color: var(--ink-3); font-weight: 600;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfall-band span { font-size: 12px; font-family: var(--mono); color: var(--ink); }
.wfall-band.b-rev  { border-top-color: var(--c2); }
.wfall-band.b-exp  { border-top-color: var(--c1); }
.wfall-band.b-fin  { border-top-color: var(--c5); }
.wfall-band.b-cash { border-top-color: var(--c3); }
.wfall-band.b-open { border-top-color: var(--ink-3); }

/* the same lines as a table, for anyone who wants to read the figures rather than the shape */
.mv-table { width: 100%; border-collapse: collapse; margin-top: var(--s-lg); }
.mv-table td { padding: 5px 8px; border-bottom: 1px solid var(--hairline); font-size: 12px; }
.mv-table td.n { text-align: right; font-family: var(--mono);
                 font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-table tr.grp td { background: var(--layer); font-weight: 600; font-size: 11px;
                      letter-spacing: .3px; text-transform: uppercase; color: var(--ink-3); }
.mv-table tr.tot td { font-weight: 600; border-top: 1px solid var(--ink-3); }
.mv-table tr.ln td:first-child { padding-left: var(--s-lg); color: var(--ink-2); }

/* ================================================================ validation */
.chk { display: grid; grid-template-columns: 90px 1fr 110px; gap: var(--s-md);
       padding: var(--s-sm) var(--s-md); border-bottom: 1px solid var(--hairline);
       align-items: start; font-size: 13px; }
.chk:last-child { border-bottom: 0; }
.chk .ref { font-family: var(--mono); font-size: 11px; color: var(--ink-subtle); }
.chk .what { font-weight: 400; }
.chk .det { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.chk .sheet { font-size: 11px; color: var(--ink-subtle); font-family: var(--mono); margin-top: 2px; }
.chk.failed { background: var(--error-wash); }
.chk.failed.warning { background: var(--warn-wash); }
.chk .st { text-align: right; }
.rowlist { margin-top: var(--s-xs); font-family: var(--mono); font-size: 11px;
           color: var(--ink-muted); max-height: 110px; overflow: auto; }

@media (max-width: 900px) {
  .signin-wrap { grid-template-columns: 1fr; }
  .signin-side { padding: var(--s-xxl) var(--s-lg); }
  .signin-form { padding: var(--s-xxl) var(--s-lg); }
  .hbar { grid-template-columns: 110px 1fr 90px; }
}

/* charts breathe more than a data cell does */
.chart-cell { background: var(--canvas); padding: var(--s-xl); }
.chart-cell h3 { margin-bottom: var(--s-lg); }
.chart-note { font-size: 11px; color: var(--ink-subtle); margin-top: var(--s-md); }
.filter-bar { position: sticky; top: 48px; z-index: 20; background: var(--canvas);
              border: 1px solid var(--hairline); border-left: 3px solid var(--blue);
              margin-bottom: var(--s-lg); }

/* The three criteria sit side by side because they apply side by side - each one narrows what
   the others have already narrowed, and the line above says what that leaves you looking at. */
.filter-row   { display: flex; flex-wrap: wrap; align-items: flex-end;
                gap: var(--s-lg); justify-content: space-between; }
.filter-lead  { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.filter-lead strong { font-size: 14px; color: var(--ink); }
.filter-picks { display: flex; flex-wrap: wrap; gap: var(--s-md); flex: 1 1 auto; }
.filter-acts  { display: flex; align-items: center; gap: var(--s-md); }
.pick         { display: flex; flex-direction: column; gap: 3px; }
.pick > span  { font-size: 11px; letter-spacing: .32px; text-transform: uppercase;
                color: var(--ink-3); }
.pick select  { border: 1px solid var(--hairline); background: var(--layer);
                min-width: 172px; }
.pick select:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ================================================================ a dashboard with colour
   The Carbon palette is deliberately sober, which suits a statement but leaves a dashboard
   flat. These are the accents it allows - full-strength blues, teal, magenta, purple, warm
   amber - used only where a chart needs to tell one series from another. The statements keep
   the quiet palette; only the dashboard is allowed to be loud. */
:root {
  --c1: #0f62fe;  --c2: #009d9a;  --c3: #8a3ffc;  --c4: #ee5396;
  --c5: #ff832b;  --c6: #198038;  --c7: #1192e8;  --c8: #a56eff;
  --c9: #fa4d56;  --c10:#005d5d;
  --tile-1: linear-gradient(135deg, #0f62fe 0%, #4589ff 100%);
  --tile-2: linear-gradient(135deg, #009d9a 0%, #08bdba 100%);
  --tile-3: linear-gradient(135deg, #8a3ffc 0%, #a56eff 100%);
  --tile-4: linear-gradient(135deg, #ee5396 0%, #ff7eb6 100%);
  /* the second row carries the balance-sheet figures - warmer, and still full strength, so
     the eye reads it as a second set rather than as a footnote to the first */
  --tile-5: linear-gradient(135deg, #ff832b 0%, #ffb784 100%);
  --tile-6: linear-gradient(135deg, #198038 0%, #42be65 100%);
  --tile-7: linear-gradient(135deg, #005d5d 0%, #009d9a 100%);
  --tile-8: linear-gradient(135deg, #6929c4 0%, #8a3ffc 100%);
}

/* the headline figures, as cards that carry their own colour */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-md); }
.kpi {
  padding: var(--s-lg); color: #fff; position: relative; overflow: hidden;
  min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
}
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255, 255, 255, .10);
}
.kpi .k { font-family: var(--mono); font-size: 10px; letter-spacing: .09em;
          text-transform: uppercase; opacity: .85; position: relative; z-index: 1; }
.kpi .v { font-family: var(--mono); font-size: 27px; font-weight: 600; letter-spacing: -.02em;
          margin: var(--s-xs) 0 2px; position: relative; z-index: 1; }
.kpi .s { font-size: 11px; opacity: .8; position: relative; z-index: 1; }
.kpi.a { background: var(--tile-1); }
.kpi.b { background: var(--tile-2); }
.kpi.c { background: var(--tile-3); }
.kpi.d { background: var(--tile-4); }
.kpi.e { background: var(--tile-5); }
.kpi.f { background: var(--tile-6); }
.kpi.g { background: var(--tile-7); }
.kpi.h { background: var(--tile-8); }
.kpi.plain { background: var(--inverse); }

/* the smaller counters sit quieter, but still carry a colour edge */
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-md);
        margin-top: var(--s-md); }
.mini .m { background: var(--canvas); border: 1px solid var(--hairline);
           border-top: 4px solid var(--c1); padding: var(--s-md) var(--s-lg); }
.mini .m:nth-child(2) { border-top-color: var(--c2); }
.mini .m:nth-child(3) { border-top-color: var(--c3); }
.mini .m:nth-child(4) { border-top-color: var(--c9); }
.mini .k { font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
           text-transform: uppercase; color: var(--ink-subtle); }
.mini .v { font-family: var(--mono); font-size: 25px; font-weight: 300; margin-top: 2px; }

.chart-cell { border: 1px solid var(--hairline); }
.chart-cell + .chart-cell { border-left: 0; }
@media (max-width: 1100px) {
  .kpis, .mini { grid-template-columns: repeat(2, 1fr); }
  .chart-cell + .chart-cell { border-left: 1px solid var(--hairline); }
}
@media (max-width: 720px) { .kpis, .mini { grid-template-columns: 1fr; } }


/* ================================================================ the assistant
   Findings are read at a glance and triaged, so severity is carried in colour and in a word -
   colour alone excludes anyone who cannot see it, and a printed page has none. */
.finding      { border: 1px solid var(--hairline); border-left: 4px solid var(--ink-subtle);
                padding: var(--s-md) var(--s-lg); margin-bottom: var(--s-md);
                background: var(--canvas); }
.finding.high { border-left-color: var(--error); }
.finding.medium { border-left-color: var(--warn); }
.finding-head { display: flex; align-items: baseline; gap: var(--s-sm); }
.finding-head h3 { margin: 0; font-size: 15px; flex: 1 1 auto; }
.finding .sev { font-size: 10px; font-weight: 700; letter-spacing: .4px;
                text-transform: uppercase; padding: 2px 8px; border-radius: 2px;
                background: var(--layer); color: var(--ink-2); }
.finding .sev.high   { background: var(--error-wash); color: var(--error); }
.finding .sev.medium { background: var(--warn-wash); color: #8a6d00; }
.finding .ref { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.finding p    { margin: var(--s-xs) 0 var(--s-sm); font-size: 13px; max-width: 86ch; }
.finding-figs { display: flex; flex-wrap: wrap; gap: var(--s-md); }
.finding-figs span { font-size: 12px; color: var(--ink-2); font-family: var(--mono); }
.finding-figs b { font-family: var(--sans); font-weight: 600; color: var(--ink-3);
                  text-transform: uppercase; font-size: 10px; letter-spacing: .3px; }
.finding-src  { margin-top: var(--s-xs); font-size: 11px; color: var(--ink-3); }

.para         { border-left: 3px solid var(--blue); padding: var(--s-sm) var(--s-lg);
                margin-bottom: var(--s-lg); }
.para-ref     { font-family: var(--mono); font-size: 11px; color: var(--blue);
                font-weight: 600; }
.para h3      { margin: 2px 0 var(--s-xs); font-size: 15px; }
.para p       { font-size: 13.5px; line-height: 1.6; max-width: 90ch; color: var(--ink); }
.para-src     { font-size: 11px; color: var(--ink-3); }


/* The line that says what this pane is, before the output starts. It sits on the navy so it
   reads as the product talking rather than as another result panel. */
.sell        { background: var(--inverse); color: var(--inverse-ink);
               padding: var(--s-lg) var(--s-xl); margin: var(--s-lg) 0;
               border-left: 4px solid var(--c2); }
.sell h3     { margin: 0 0 var(--s-xs); font-size: 17px; font-weight: 600;
               color: var(--inverse-ink); letter-spacing: -.2px; }
.sell p      { margin: 0; font-size: 13.5px; line-height: 1.65; max-width: 96ch;
               color: var(--inverse-ink-muted); }
.sell strong { color: var(--inverse-ink); font-weight: 600; }

/* ------------------------------------------------------------------ PRISM 9 additions
   The IFRS 9 portal walks a submission through eight steps rather than filtering one
   dataset, so it needs a step rail in the masthead and a headline strip. Everything else is
   the shared system above, deliberately - these are two doors into one suite. */

/* The step rail lives in the dark masthead, so it takes the masthead's colours rather than
   the light tab-strip treatment a page-level nav would get. */
.masthead .tabs {
  display: flex; gap: 2px; margin-left: var(--s-md); flex: 1; overflow-x: auto;
  border: 0;
}
.masthead .tabs .tab {
  background: none; border: 0; color: var(--inverse-ink-muted);
  font-family: var(--sans); font-size: 13px; padding: 0 var(--s-md); height: 48px;
  cursor: pointer; border-bottom: 3px solid transparent; transition: .11s var(--motion);
  white-space: nowrap;
}
.masthead .tabs .tab:hover:not(:disabled) { background: var(--inverse-2); color: #fff; }
.masthead .tabs .tab.on { color: #fff; border-bottom-color: var(--blue); }
/* A step that is not reachable yet is shown, not hidden: the sequence is the instruction. */
.masthead .tabs .tab.off, .masthead .tabs .tab:disabled {
  color: var(--accent-soft); opacity: .55; cursor: not-allowed;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
         gap: 1px; background: var(--hairline); border: 1px solid var(--hairline);
         margin: 0 0 var(--s-lg); }
.stats .stat { background: var(--canvas); padding: var(--s-md) var(--s-lg); }
.stats .stat .k { font-size: 12px; color: var(--ink-muted); letter-spacing: .02em;
                  text-transform: uppercase; margin-bottom: var(--s-xxs); }
.stats .stat .v { font-size: 30px; font-weight: 300; letter-spacing: -0.02em;
                  font-variant-numeric: tabular-nums; }

/* A trap is the most useful thing on a requirements page, so it is allowed to be seen. */
.warnbox { display: block; background: var(--warn-wash); border-left: 2px solid var(--warn);
           padding: var(--s-xs) var(--s-sm); }

p.ok   { color: var(--success); }
p.bad  { color: var(--error); }
p.warn { color: #8a6d00; }
