/* Neema Connect loan book — staff screens.
   A working tool: quiet, dense where it helps, the brand navy in the frame and the
   brand red kept for the one destructive action. Self-hosted (the CSP allows 'self'
   only), light theme with every colour set explicitly.

   Type (changed to match LoanDisk: Source Sans, 14px body; the older note follows): Apple's system typeface, San Francisco (SF Pro, and SF Mono), through the system
   font stack — Apple's licence doesn't allow serving the font files from a website, and
   every Mac, iPhone and iPad already has them; other devices get their own system font.
   Sizes are Apple's Human Interface Guidelines text styles; line heights and tracking
   (letter-spacing) follow Apple's own web typography. Every size below is one of these
   styles — no other sizes. */

@font-face { font-family: "Source Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #030870;          /* Neema brand */
  --navy-soft: #1b2a8a;
  --red: #FF0000;           /* brand red, as on the website (Lameck, 2026-10-04: "use the red colour I provided") */
  --ground: #f3f5fa;        /* cool neutral, biased toward the navy */
  --surface: #ffffff;
  --ink: #141a2e;
  --muted: #5a6378;
  --line: #dde2ed;
  --focus: #3b5bdb;
  /* Accent lines across the top of boxes, as LoanDisk draws them (Lameck, 2026-10-04): one colour per kind of box. */
  --line-table: #00a7e1;    /* cyan: tables of figures */
  --line-form: #00a65a;     /* green: where you fill in or filter */
  --line-panel: #030870;    /* navy: every other panel */
  --head-table: #dff3fb;    /* table headings, a light tint of the cyan */

  --processing-ink: #7a4d00; --processing-bg: #fff2d6;
  --open-ink: #17603a;       --open-bg: #e1f3e7;
  --denied-ink: #8f1d24;     --denied-bg: #fbe6e8;
  --paid-ink: #1d4b85;       --paid-bg: #e3edfa;
  --neutral-ink: #4a5266;    --neutral-bg: #eceff5;

  --radius: 6px;
  --font: "Source Sans", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Apple HIG text styles: size, line height, tracking. */
  --title1: 24px;      --title1-lh: 1.14286;      --title1-tr: 0;
  --title2: 20px;      --title2-lh: 1.18182;      --title2-tr: 0;
  --title3: 18px;      --title3-lh: 1.2;          --title3-tr: 0;
  --headline: 16px;    --headline-lh: 1.29412;    --headline-tr: 0;   /* semibold */
  --body: 14px;        --body-lh: 1.46667;        --body-tr: 0;   /* was 17px: staff screens are dense */
  --subheadline: 14px; --subheadline-lh: 1.4;     --subheadline-tr: 0;
  --footnote: 12px;    --footnote-lh: 1.38462;    --footnote-tr: 0;
  --caption1: 11px;    --caption1-lh: 1.33337;    --caption1-tr: 0;
  --caption2: 10px;    --caption2-lh: 1.27273;    --caption2-tr: 0;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: var(--body)/var(--body-lh) var(--font); letter-spacing: var(--body-tr);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--navy-soft); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* frame */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 1560px; margin: 0 auto; padding: 10px 24px; min-height: 56px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px;
}
.wordmark { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.wordmark span { color: #FF0000; }   /* the rest of the lender's name after its first word (region.brand); kept red on the blue bar (Lameck, 2026-11-14) */
.wordmark em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .75; margin-left: 6px; }
.wordmark em.product { font-weight: 700; letter-spacing: .04em; opacity: .9; padding-left: 8px; margin-left: 4px; border-left: 1px solid rgba(255,255,255,.35); }
.wordmark em.product small { font-size: .78em; font-weight: 500; letter-spacing: 0; opacity: .8; }
.nav { display: flex; gap: 20px; }
.nav a { color: #dfe4ff; text-decoration: none; font-weight: 600; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
.nav a:hover { color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); white-space: nowrap; }
.who small { opacity: .7; margin-left: 4px; }
.who form { margin: 0; }
.link-button { background: none; border: 0; color: #dfe4ff; font: inherit; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); cursor: pointer; text-decoration: underline; padding: 0; }
.link-button:hover { color: #fff; }

.page { max-width: 1560px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.page-head h1 { margin: 0; font-size: var(--title1); line-height: var(--title1-lh); letter-spacing: var(--title1-tr); line-height: 1.25; text-wrap: balance; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.crumbs { font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.panel > h2 { margin: 0 0 12px; font-size: var(--title3); line-height: var(--title3-lh); letter-spacing: var(--title3-tr); }
.panel > h1 { margin: 0 0 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

/* facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts dt.indent { padding-left: 14px; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
.facts dt.indent + dd { font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); color: var(--muted); }
.alert-warn { background: #fff6e0; border-color: #f0d9a0; color: #6b4a00; }
.terms { white-space: pre-wrap; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); line-height: 1.6; max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fbfcfe; }
textarea.terms-input.short { min-height: 180px; }
textarea.terms-input { min-height: 320px; font-family: var(--mono); font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
.mono { font-family: var(--mono); font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stats span { display: block; color: var(--muted); font-size: var(--caption1); line-height: var(--caption1-lh); text-transform: uppercase; letter-spacing: .05em; }
.stats small { display: block; font-size: var(--caption1); }
.stats strong { font-size: var(--title3); line-height: var(--title3-lh); letter-spacing: var(--title3-tr); font-variant-numeric: tabular-nums; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
.page > .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); }
td { font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:nth-child(even) td { background: #fafbfe; }
tbody tr:hover td { background: #f1f6fd; }
th { font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); color: var(--ink); font-weight: 700; background: #e3eefb; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }

/* status */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--caption1); line-height: var(--caption1-lh); letter-spacing: var(--caption1-tr); font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-ink); }
.pill-processing { background: var(--processing-bg); color: var(--processing-ink); }
.pill-open { background: var(--open-bg); color: var(--open-ink); }
.pill-denied, .pill-defaulted { background: var(--denied-bg); color: var(--denied-ink); }
.pill-fully-paid { background: var(--paid-bg); color: var(--paid-ink); }

/* lists */
.doc-list, .plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plain li { display: flex; align-items: center; gap: 10px; }
.history { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.history blockquote { margin: 6px 0 0; padding: 6px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.notes { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }

/* alerts */
.alert { border-radius: var(--radius); padding: 12px 16px; margin: 0; border: 1px solid; }
.alert p { margin: 0 0 4px; }
.alert ul { margin: 0; padding-left: 20px; }
.alert-error { background: var(--denied-bg); border-color: #f1c2c7; color: var(--denied-ink); }
.alert-ok { background: #00a65a; border-color: #008d4c; color: #fff; font-weight: 600; }  /* the green banner of LoanDisk */

/* decision */
.decision .refusals { margin: 0 0 16px; padding-left: 20px; color: var(--denied-ink); }
.ok-text { color: var(--open-ink); font-weight: 600; }
.decision .decline { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.decision .decline label { width: 100%; }

/* forms */
label { display: flex; flex-direction: column; gap: 4px; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: var(--body); line-height: var(--body-lh); letter-spacing: var(--body-tr); color: var(--ink); background: var(--surface);
  border: 1px solid #c5ccdb; border-radius: 4px; padding: 8px 10px; min-width: 0;
}
/* One height for every box. A date box is otherwise taller than a text box beside it. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select { min-height: 43px; box-sizing: border-box; }
input[type="date"], input[type="month"] { height: 43px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
textarea { resize: vertical; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; margin-top: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
/* A long label that wraps onto two lines must not push its box lower than the one beside it:
   every label fills its row and its box sits at the bottom, so the boxes line up. */
.form-grid > label, .grid-3 > label { justify-content: flex-end; }
.form-actions { grid-column: 1 / -1; }
#check form { margin-top: 16px; }  /* the Import button doesn't touch the figures above it */
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 10px; }
.inline-form input { width: 120px; }
/* a button beside a box is as tall as the box */
.inline-form button, .inline-form .button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; }
details.assess { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.assess summary { cursor: pointer; font-weight: 600; color: var(--navy-soft); }

.button {
  font: inherit; font-weight: 600; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); background: var(--navy); color: #fff;
  border: 0; border-radius: 3px; padding: 6px 14px; cursor: pointer;
}
.button:hover { background: var(--navy-soft); }
.button-danger { background: var(--red); }
.button-danger:hover { background: #d40000; }
.button-small { padding: 4px 10px; font-size: var(--footnote); line-height: var(--footnote-lh); font-weight: 400; }
.button-quiet { background: transparent; color: var(--navy-soft); border: 1px solid #c5ccdb; }
.button-quiet:hover { background: #eef1f7; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
a.button { display: inline-flex; align-items: center; gap: 6px; height: auto; white-space: nowrap; }

/* settings: one form per document the website asks for */
.doc-settings { display: flex; flex-direction: column; gap: 12px; }
.doc-setting {
  display: grid; grid-template-columns: 70px minmax(160px, 2fr) minmax(140px, 1.2fr) minmax(130px, 1fr) 64px 70px;
  gap: 10px 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); margin: 0;
}
.doc-setting .wide { grid-column: 1 / 4; }
.doc-setting .checks { grid-column: 4 / -1; display: flex; gap: 16px; align-items: center; min-height: 40px; }
.doc-setting .check { white-space: nowrap; }
.doc-setting .check input { flex: none; width: 16px; height: 16px; }
.doc-setting .button { justify-self: start; }
.doc-setting.is-hidden { background: #f8f9fc; opacity: .75; }
.doc-setting input, .doc-setting select { width: 100%; }
.doc-setting input[type="checkbox"] { width: auto; }
@media (max-width: 900px) { .doc-setting { grid-template-columns: 1fr 1fr; } .doc-setting .wide, .doc-setting .checks { grid-column: 1 / -1; } }

/* settings: contents, and one form per payment method */
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 20px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
.settings-nav div { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.settings-nav span { font-size: var(--caption1); line-height: var(--caption1-lh); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.panel[id] { scroll-margin-top: 16px; }
.method-setting {
  display: grid; grid-template-columns: 70px minmax(160px, 320px) auto auto; justify-content: start;
  gap: 10px 16px; align-items: end; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin: 0;
}
.method-setting input { width: 100%; }
.method-setting input[type="checkbox"] { width: 16px; height: 16px; }
.method-setting .check { min-height: 40px; }
.method-setting.is-hidden { background: #f8f9fc; opacity: .75; }
@media (max-width: 600px) { .method-setting { grid-template-columns: 70px 1fr; } }
.method-setting.branch-setting { grid-template-columns: minmax(140px, 220px) minmax(180px, 1fr) minmax(120px, 180px) auto auto; justify-content: stretch; }
@media (max-width: 760px) { .method-setting.branch-setting { grid-template-columns: 1fr; } }

.sign-in { max-width: 400px; margin: 40px auto 0; width: 100%; }
.sign-in h1 { font-size: var(--title2); line-height: var(--title2-lh); letter-spacing: var(--title2-tr); }

/* the documents a borrower signs: laid out like the paper forms, and printable */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 960px;
  font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); line-height: 1.5; color: #111; }
.doc-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 14px; }
.doc-head h2 { font-size: var(--headline); line-height: var(--headline-lh); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; margin: 4px 0; }
.doc-head p { margin: 2px 0; }
.doc-lang { text-align: right; font-size: var(--caption1); line-height: var(--caption1-lh); letter-spacing: var(--caption1-tr); color: var(--muted); }
.doc h3 { font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); text-transform: uppercase; margin: 20px 0 6px; }
.doc h4 { font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); text-transform: uppercase; margin: 0 0 4px; }
table.form { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
table.form th, table.form td { border: 1px solid #9aa3b5; padding: 5px 8px; vertical-align: top; text-align: left; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
table.form th { background: #f1f3f8; font-weight: 600; width: 22%; text-transform: none; letter-spacing: 0; color: #222; font-size: var(--footnote); line-height: var(--footnote-lh); }
table.form tbody tr:last-child td, table.form tr:last-child td { border-bottom: 1px solid #9aa3b5; }
table.form thead th { font-size: var(--caption1); line-height: var(--caption1-lh); letter-spacing: var(--caption1-tr); }
table.form thead th { width: auto; }
table.form td.num, table.form th.num { text-align: right; white-space: nowrap; }
table.form tr.band th { background: #dfe3ec; text-align: center; text-transform: uppercase; }
table.form tr.sub th { background: #eef0f5; }
table.form tr.total td { font-weight: 700; background: #f7f8fb; }
table.form small, .doc small { color: #555; font-weight: 400; }
.doc-list-points { margin: 0; padding-left: 20px; }
.doc-list-points li { margin-bottom: 4px; }
.doc-terms { white-space: pre-wrap; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); margin: 16px 0; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.sig-group { display: flex; flex-direction: column; gap: 8px; }
.sig-group > p { margin: 0; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
.sig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sig p { margin: 4px 0 0; font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
.sig-mark { height: 70px; border-bottom: 1px solid #111; display: flex; align-items: flex-end; }
.sig-mark img { max-height: 66px; max-width: 100%; }
.e-sig { font-style: italic; color: var(--navy-soft); font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); }
.doc-foot { margin-top: 18px; font-size: var(--caption2); line-height: var(--caption2-lh); letter-spacing: var(--caption2-tr); color: #555; word-break: break-all; }
@media (max-width: 700px) { .signatures, .sig-pair { grid-template-columns: 1fr; } .doc { padding: 16px; } }
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
}

/* countersigning on the loan page */
.countersign { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.countersign input[type="file"] { padding: 6px; }

.settlement { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.settlement h3 { margin: 0 0 8px; font-size: var(--headline); line-height: var(--headline-lh); letter-spacing: var(--headline-tr); font-weight: 600; }

/* the Loans page */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
.tabs a span { color: var(--muted); font-size: var(--caption1); line-height: var(--caption1-lh); letter-spacing: var(--caption1-tr); margin-left: 4px; }
.tabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs a[aria-current="page"] span { color: #cfd6ea; }
td.overdue { color: var(--denied-ink); font-weight: 600; }
.inline-form input[type="date"] { width: 170px; }
.inline-form input[type="month"] { width: 190px; }
.statement-list { margin-bottom: 12px; }

/* arrears and collections */
.collect-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.collect-actions select { width: auto; }
.sub-head { font-size: var(--headline); line-height: var(--headline-lh); letter-spacing: var(--headline-tr); font-weight: 600; margin: 20px 0 8px; }
.collection-log blockquote { white-space: pre-wrap; }
.collection-log .delivery { margin-top: 8px; }
.collection-log .delivery select { max-width: 260px; }
.wording { margin-top: 16px; }
textarea.terms-input.sms { min-height: 70px; }
.letter { font-size: var(--body); line-height: var(--body-lh); letter-spacing: var(--body-tr); }
.letter-head { text-align: right; border-bottom: 2px solid #111; margin-bottom: 20px; padding-bottom: 10px; }
code { font-family: var(--mono); font-size: var(--caption1); line-height: var(--caption1-lh); letter-spacing: var(--caption1-tr); background: #eef1f7; padding: 1px 4px; border-radius: 3px; }
.letter .doc-terms { font-size: var(--body); line-height: var(--body-lh); letter-spacing: var(--body-tr); }

/* AI */
.ai-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.ai-provider { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ai-provider h3 { margin: 0 0 4px; font-size: var(--headline); line-height: var(--headline-lh); letter-spacing: var(--headline-tr); font-weight: 600; }
.ai-provider.is-hidden { background: #f8f9fc; }
.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flags li { font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr);
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 12px; align-items: start; }
.flags li > .pill { justify-self: start; margin-top: 1px; }  /* labels differ in width: the sentences still line up */
@media (max-width: 520px) { .flags li { grid-template-columns: 1fr; gap: 4px; } }
.ai-docs summary { cursor: pointer; }
.ai-docs .facts { margin: 8px 0 4px 16px; }
label.check input[type="checkbox"] { flex: none; width: 16px; height: 16px; }

.ai-box { border: 1px dashed #b8c1d6; border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; background: #fbfcff; }
.ai-box h3 { font-size: var(--headline); line-height: var(--headline-lh); letter-spacing: var(--headline-tr); font-weight: 600; margin: 0 0 6px; }
.ai-box h4 { font-size: var(--footnote); line-height: var(--footnote-lh); letter-spacing: var(--footnote-tr); margin: 8px 0 4px; text-transform: uppercase; color: var(--muted); }
.ai-box ul { margin: 0; padding-left: 18px; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.reply-form { margin-top: 10px; }
.review { margin: 8px 0 0; }
.task-form select { min-width: 220px; }
.wording label > .pill { align-self: flex-start; }

.who-link { color: #fff; text-decoration: none; }
.who-link small { color: #b9c2ec; }
.who-link:hover { text-decoration: underline; }
.narrow-panel { max-width: 480px; }
.audit-filters { margin: 0; }
.pager { margin-top: 12px; }
td form.inline-form select { width: auto; }
.inline-form input[type="file"] { width: auto; }
.inline-form.search input { width: 320px; max-width: 100%; }
.inline-form .grow { flex: 1; }
.inline-form .grow input { width: 100%; }
.consent-text { white-space: pre-wrap; line-height: 1.55; margin: 12px 0; }
.sign-lines td { height: 36px; min-width: 60%; }
.walk-in .spaced { height: 12px; }

/* two-step sign-in */
.qr { margin: 12px 0; }
.qr svg { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 6px; }
.recovery-codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; line-height: 1.9; }

/* The practice loan book (training.py): impossible to mistake for the real one. */
.practice-banner { background: repeating-linear-gradient(135deg, #fde68a 0 18px, #fcd34d 18px 36px);
  color: #3b2a00; text-align: center; padding: 8px 16px; font-size: 15px; }
.practice-banner a { color: inherit; font-weight: 600; }
.outbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.outbox li { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 12px 14px; }
.outbox pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inline-form input[name="reason"] { width: 280px; }

/* The dashboard (charts.py): plain SVG, coloured from here. Blue and orange are the first two
   colours of the checked chart palette; text is never coloured like its series. */
.chart-figure { margin: 0; }
.chart-figure figcaption { font-weight: 600; margin-bottom: 8px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .value-text { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chart .bar-1 { fill: #2a78d6; }
.chart .bar-2 { fill: #eb6834; }
.chart .bar-3 { fill: #3d4454; }   /* a third series: dark neutral, apart from the blue and orange */
.chart path:hover, .chart rect.bar-1:hover, .chart rect.bar-2:hover { opacity: .8; }
.legend { list-style: none; display: flex; gap: 18px; margin: 0 0 6px; padding: 0; color: var(--muted); font-size: var(--subheadline); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch-bar-1 { background: #2a78d6; }
.swatch-bar-2 { background: #eb6834; }
.swatch-bar-3 { background: #3d4454; }
.chart-table { margin-top: 8px; }
.chart-table summary { cursor: pointer; color: var(--navy-soft); font-size: var(--subheadline); }
.link-tiles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-tiles a { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.link-tiles a:hover { border-color: var(--navy-soft); }
.link-tiles strong { font-size: var(--title3); line-height: var(--title3-lh); min-width: 2ch; font-variant-numeric: tabular-nums; }
@media (forced-colors: active) {
  .chart .bar-1 { fill: CanvasText; }
  .chart .bar-2 { fill: GrayText; }
  .swatch-bar-1 { background: CanvasText; }
  .swatch-bar-2 { background: GrayText; }
  .chart .bar-3 { fill: Canvas; stroke: CanvasText; }
  .swatch-bar-3 { background: Canvas; border: 1px solid CanvasText; }
}

/* the loan page, laid out as on LoanDisk: the borrower across the top, the loan in one row, tabs */
.borrower-card { padding: 16px 20px; }
.borrower-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; }
.borrower-name { margin: 0; font-size: 1.05rem; line-height: 1.3; font-weight: 700; }   /* as LoanDisk's (Lameck, 2026-11-11) */
.borrower-title { display: flex; align-items: center; gap: 10px; }
.borrower-title .gauge-small { width: 52px; max-width: 52px; }
.borrower-title .gauge { margin: 0; }
.borrower-id { font-size: .8rem; }
.borrower-top p { margin: 2px 0 0; }
.borrower-meta { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: .82rem; color: var(--muted); }   /* compact, as LoanDisk's */
.borrower-meta .button-small { font-size: .75rem; padding: 1px 8px; }
.borrower-meta li { display: flex; gap: 8px; align-items: baseline; }
.borrower-meta li span { color: var(--muted); }
.borrower-meta li span::after { content: ":"; }
.borrower-meta li.wide { flex-basis: 100%; }
.loan-summary { border: 1px solid var(--line); border-radius: var(--radius); border-top: 3px solid #4aa3df; }
.loan-summary td, .loan-summary th { white-space: nowrap; }
.loan-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 0; }
.loan-tabs button { font: inherit; font-size: var(--subheadline); line-height: var(--subheadline-lh); letter-spacing: var(--subheadline-tr);
  padding: 6px 11px; font-size: var(--footnote); line-height: var(--footnote-lh); border: 0; border-radius: 0; cursor: pointer; background: #2c3553; color: #fff; }
.loan-tabs button:hover { background: #3b4670; }
.loan-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--navy); }
.loan-table td, .loan-table th { padding: 8px 10px; }
/* the schedule: today's marker and the totals */
tr.today td { background: #cdd5e6; font-weight: 700; }
tr.totals td, tr.totals th { background: #f2f5fb; font-weight: 700; border-top: 2px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; }
.toolbar .inline-form { margin: 0; }
.stats div { padding: 10px 14px; }

/* repayments, as on LoanDisk: a toolbar over the table, and the Add repayment drawer */
.repayment-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 8px; }
.repayment-search { margin-left: auto; flex-direction: row; align-items: center; gap: 8px; font-size: var(--subheadline); color: var(--ink); }
.repayment-search input { width: 240px; }
.center { text-align: center; }
.drawer { position: fixed; inset: 0; display: none; z-index: 60; }
.drawer:target { display: flex; }
.drawer-backdrop { flex: 1; background: rgba(20, 26, 46, .45); }
.drawer-panel { width: min(680px, 100%); background: var(--surface); overflow-y: auto; padding: 0 0 24px; box-shadow: -8px 0 24px rgba(0,0,0,.2); }
.drawer-panel h3 { margin: 0; padding: 16px 24px 8px; text-align: center; font-size: var(--title2); line-height: var(--title2-lh); }
.autofill { margin: 0 24px 14px; padding: 10px 14px; background: #f2f5fb; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.autofill button { font: inherit; background: none; border: 0; padding: 0; color: var(--navy-soft); cursor: pointer; text-decoration: underline; }
.drawer-band { margin: 0 24px 12px; padding: 14px 16px; background: #d9deea; border-radius: var(--radius); font-size: var(--subheadline); line-height: var(--subheadline-lh); }
.drow { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; align-items: center; padding: 0 24px; margin-bottom: 14px; }
.drow > label:first-child { text-align: right; font-size: var(--subheadline); font-weight: 700; color: var(--ink); }
.drow.wide { grid-template-columns: 1fr; }
.drow input, .drow select { width: 100%; }
.drawer-panel > p.muted { padding: 0 24px; }
.drawer-actions { display: flex; justify-content: space-between; margin: 20px 24px 0; padding: 14px 16px; background: #d9deea; border-radius: var(--radius); }
.drawer-actions a.button { text-decoration: none; }
@media (max-width: 560px) { .drow { grid-template-columns: 1fr; } .drow > label:first-child { text-align: left; } }
.cell-action { margin-top: 6px; }
.cell-action .button { display: inline-block; text-decoration: none; }
.drow.wide > label:first-child { text-align: left; font-weight: 400; }
.repayment-pager { display: flex; justify-content: flex-end; gap: 8px; margin: 8px 0 0; }
.repayment-search select { width: auto; min-width: 70px; }

/* the Terms tab, as on LoanDisk: facts in rows, dark bands between the groups, a status timeline */
.details-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.kv th { width: 16rem; font-weight: 700; }
.kv tr.band th { background: #5b6b84; color: #fff; width: auto; border-bottom: 0; }
.kv tr.note td { border-bottom: 0; color: var(--muted); }
.timeline-head { margin: 22px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .when { margin-left: auto; color: var(--muted); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
@media print { .topbar, .loan-tabs, .details-actions, .practice-banner { display: none; } [data-tab][hidden] { display: none; } }
.button-green { background: #00a65a; } .button-green:hover { background: #008d4c; }

/* the calendar, as on LoanDisk: coloured events by kind */
.cal-filters { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.cal-show { display: flex; gap: 10px; border: 0; padding: 0; margin: 0; align-items: center; }
.cal-show legend { float: left; margin-right: 10px; font-weight: 700; }
.cal-show label.check { padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; }
.cal-disbursed { border-left-color: #e08e0b; } .cal-expiring { border-left-color: var(--red); }
.cal-due { border-left-color: #0b7bd6; } .cal-payments { border-left-color: #0a7a2a; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 10px; flex-wrap: wrap; }
.cal-nav h2 { margin: 0; }
table.cal { width: 100%; table-layout: fixed; border-collapse: collapse; }
table.cal th, table.cal td { border: 1px solid var(--line); vertical-align: top; padding: 4px; }
table.cal td { height: 110px; }
table.cal-week td { height: 260px; }
table.cal-day td { height: auto; min-height: 200px; }
table.cal td.other { background: #f6f7fb; color: var(--muted); }
table.cal td.today { background: #fdf3d9; }
.cal-date { font-weight: 700; margin-bottom: 3px; }
a.cal-event { display: block; margin: 1px 0; padding: 1px 5px; border-radius: 2px; color: #fff; font-size: var(--caption1); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.cal-event.cal-disbursed { background: #e08e0b; } a.cal-event.cal-expiring { background: var(--red); }
a.cal-event.cal-due { background: #0b7bd6; } a.cal-event.cal-payments { background: #0a7a2a; }
a.cal-event { border-left: 0; }

/* lists with search, sorting, paging and hide-columns (datatable.js) */
.dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0; }
.dt-bar .dt-search, .dt-bar .dt-size { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.dt-bar .dt-search { margin-right: auto; }
.dt-bar select { width: auto; min-width: 70px; }
.dt-cols { position: relative; }
.dt-cols summary { list-style: none; display: inline-block; cursor: pointer; }
.dt-cols div { position: absolute; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 4px; min-width: 190px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 16px; flex-wrap: wrap; }
th.sortable { cursor: pointer; }
th.sortable::after { content: " ⇅"; color: var(--muted); font-weight: 400; }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--ink); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--ink); }
.row-actions { display: flex; gap: 4px; }
.row-actions a { padding: 2px 8px; border: 1px solid #c5ccdb; border-radius: 3px; background: var(--surface); text-decoration: none; }
details.show-more { margin-top: 8px; text-align: center; }
details.show-more > summary { display: inline-block; cursor: pointer; background: #e4e7ee; padding: 2px 10px; border-radius: 3px; font-weight: 700; }
details.show-more[open] > summary::before { content: "− "; }
details.show-more > summary::before { content: "+ "; }
details.show-more .more-body { text-align: left; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

/* the Admin page: groups of links in three columns */
.admin-find { max-width: 420px; margin-bottom: 18px; }
.admin-hub { columns: 3 280px; column-gap: 40px; }
.admin-group { break-inside: avoid; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-group h2 { margin: 0 0 6px; font-size: var(--subheadline); line-height: var(--subheadline-lh); }
.admin-group ul { margin: 0; padding-left: 18px; }
.admin-group li { margin: 3px 0; }

/* the edit-borrower form, laid out like LoanDisk's: label on the left, box on the right */
.editform h2.band { margin: 22px 0 10px; padding: 12px 16px; background: #d9deea; border-radius: var(--radius); font-size: var(--subheadline); line-height: var(--subheadline-lh); }
.editform h2.band:first-of-type { margin-top: 0; }
.erow { display: grid; grid-template-columns: 14rem minmax(0, 36rem); gap: 12px; align-items: center; margin: 0 0 12px; padding: 0 4px; }
.erow > label { font-weight: 700; text-align: right; }
@media (max-width: 720px) { .erow { grid-template-columns: 1fr; } .erow > label { text-align: left; } }

.send-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin: 8px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.send-forms textarea { width: 100%; }

/* the borrower health meter */
.gauge { width: 100%; max-width: 440px; display: block; margin: 8px auto 0; }
.gauge-label { font-size: 5px; font-weight: 700; fill: #fff; }
.gauge-small { width: 84px; max-width: 84px; margin: 0; }
.meter-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.meter-dial { text-align: center; }
.meter-band { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.meter-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.meter-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.history-grid { border-collapse: collapse; }
.history-grid th, .history-grid td { padding: 4px 10px; text-align: center; }
.hg { display: inline-block; min-width: 1.6em; border-radius: 50%; font-weight: 700; }
.hg-ok { color: #2e8b3d; } .hg-none { color: var(--muted); }
.hg-late { color: #fff; background: #f26b21; } .hg-2 { background: #cf2e33; } .hg-3, .hg-4, .hg-5, .hg-6, .hg-7 { background: #8b1a1f; }
@media (max-width: 800px) { .meter-top { grid-template-columns: 1fr; } }

.row-actions a, .row-actions .star { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  border: 1px solid #c5ccdb; border-radius: 3px; background: var(--surface); color: #222; cursor: pointer; }
.row-actions .star[aria-pressed="true"] { color: #e0a800; }
.row-actions .star[aria-pressed="true"] path { fill: currentColor; }

/* people's names are bold wherever they are listed */
.person { font-weight: 700; }

/* a link that looks like a button is not underlined, whatever the page or state */
a.button, a.button:hover, a.button:focus, a.button:active, .button-row a, .repayment-tools a, .details-actions a { text-decoration: none; }

/* the borrower strip: a small icon stands for the label (the label is its tooltip) */
.borrower-meta li .meta-icon { color: var(--muted); display: inline-flex; align-self: center; }
.borrower-meta li .meta-icon::after { content: none; }

/* the pre-screen and credit report forms: two compact columns, small boxes */
.ps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 6px 0 14px; }
.ps-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ps-field label { font-size: var(--footnote); line-height: var(--footnote-lh); font-weight: 600; color: var(--ink); }
.ps-field input, .ps-field select { font: inherit; font-size: var(--footnote); padding: 4px 8px; width: 12rem; max-width: 100%;
  border: 1px solid #c5ccdb; border-radius: 3px; background: var(--surface); }
.ps-field input.ps-narrow { width: 6rem; }
.ps-field small { font-size: var(--caption1); line-height: var(--caption1-lh); color: var(--muted); }
.ps-field small .pill { font-size: var(--caption2); padding: 1px 6px; }
.prescreen-form .sub-head { margin: 12px 0 4px; font-size: var(--subheadline); }
@media (max-width: 760px) { .ps-grid { grid-template-columns: 1fr; } }
#prescreen .ps-field input, #prescreen .ps-field select, #credit-review .ps-field input, #credit-review .ps-field select,
#prescreen .prescreen-form > label input, #credit-review .prescreen-form > label input {
  min-height: 28px; height: 28px; padding: 3px 8px; font-size: var(--footnote); }

/* the Assessment tab's steps, in the order the work is done */
.steps { padding: 10px 14px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.steps li a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 4px; border: 1px solid var(--line);
  border-top: 3px solid #c5ccdb; color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--footnote); }
.steps li b { display: inline-block; min-width: 1.4em; color: var(--muted); }
.steps li small { font-weight: 400; color: var(--muted); font-size: var(--caption1); }
.steps li.done a { border-top-color: #17a34a; } .steps li.done b::after { content: " ✓"; color: #17a34a; }
.steps li.todo a { border-top-color: var(--navy); background: #f4f6fc; }
.steps li.warn a { border-top-color: #d9650b; }
.steps li.skip a { opacity: .65; }
@media (max-width: 760px) { .steps ol { grid-auto-flow: row; grid-template-columns: 1fr; } }
.recommendations { margin: 0 0 10px; padding: 8px 10px; background: #f4f6fc; border-left: 3px solid var(--navy); }

/* Receipt icons on each repayment: print, PDF, email (as LoanDisk). */
.receipt-tools { white-space: nowrap; }
.receipt-tools .inline-form { display: inline; margin: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px;
  border: 1px solid var(--line, #c9cfdb); border-radius: 4px; background: #fff; color: #333; padding: 0;
  cursor: pointer; text-decoration: none; vertical-align: middle; }
.icon-button:hover { background: #eef1f8; text-decoration: none; }
.icon-button .meta-icon { display: inline-flex; }
.receipt-tools button.icon-button { height: 24px; min-height: 0; padding: 0; margin: 0; line-height: 1; font: inherit; }
.choice { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 6px; }
.choice legend { font-weight: 600; padding: 0 4px; }
.choice input[name="id_number"] { max-width: 260px; }

/* Buttons by what they do, as LoanDisk colours its own (2026-10-04, Lameck): each keeps white or dark text readable
   (4.5:1 or better). Navy stays for saving a form, red for what can't be undone. */
.button-add { background: #007a43; color: #fff; border: 1px solid #007a43; }
.button-add:hover { background: #00663a; }
.button-send { background: #0a7ea4; color: #fff; border: 1px solid #0a7ea4; }
.button-send:hover { background: #086a8a; }
.button-money { background: #b45309; color: #fff; border: 1px solid #b45309; }
.button-money:hover { background: #973f06; }
.button-doc { background: #fff; color: var(--navy); border: 1px solid #b9c2d3; box-shadow: 0 1px 1px rgba(3,8,112,.06); }
.button-doc:hover { background: #eef1f7; border-color: var(--navy-soft); }
.button-green { background: #007a43; } .button-green:hover { background: #00663a; }
/* A small button is small wherever it sits, in a form or not (the email buttons were taller). */
.inline-form .button-small, form .button-small { min-height: 0; padding: 4px 10px; }
.details-actions.button-row { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }

/* Every report one click away (as LoanDisk's Reports menu). */
.report-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: var(--footnote); }
.report-nav a { text-decoration: none; }
.report-nav a[aria-current="page"] { font-weight: 700; color: var(--ink, #111); }
/* The Borrowers and Loans reports: a block per borrower or loan, three rows each. */
.balances .block-head th { background: #e9ecf1; text-align: left; }
.balances .row-due th, .balances .row-due td { color: #b42318; }
.balances .row-paid th, .balances .row-paid td { color: #007a43; }
.balances .row-net th { color: inherit; }
.balances .grand-total .block-head th { background: var(--navy, #000066); color: #fff; }
.balances .grand-total td, .balances .grand-total th { font-weight: 700; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Staff's own calendar entries (LoanDisk's purple "Events"). */
.cal-events { border-left-color: #6b2fa0; }
a.cal-event.cal-events, span.cal-event.cal-events { background: #6b2fa0; color: #fff; }
span.cal-event { display: block; margin: 1px 0; padding: 1px 5px; border-radius: 2px; font-size: var(--caption1); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#add-event > summary { list-style: none; display: inline-flex; margin-bottom: 8px; }
#add-event > summary::-webkit-details-marker { display: none; }
#add-event > summary.button-add, #add-event > summary.button-add:hover { color: #fff; cursor: pointer; }
#add-event[open] > form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }

/* ---- Accent lines (LoanDisk's coloured "double lines") -------------------------------------------- */
.panel { border-top: 3px solid var(--line-panel); }
.panel:has(> form:first-child), .panel:has(> .cal-filters), .panel:has(> h2 + form), #add-event[open] > form,
.drawer form { border-top: 3px solid var(--line-form); }
.table-wrap, .table-wrap.loan-summary { border-top: 3px solid var(--line-table); }
.table-wrap > table > thead th, table.loan-table thead th, .loan-summary thead th { background: var(--head-table); }
.balances tbody th { background: transparent; }
.stats div { border-top: 3px solid var(--line-table); }
tr.totals td, tr.totals th, .balances .grand-total .block-head th { background: var(--line-panel); color: #fff; border-top: 0; }
tr.totals td a { color: #fff; }

/* SMS and email templates in Settings */
.template-list { display: grid; gap: 4px; margin-bottom: 14px; }
.template-row > summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-row.is-hidden > summary { opacity: .65; }

/* "Everything done" and the status timeline: one column per kind of information, so lines read across. */
.history-table td { vertical-align: top; }
.history-table td:last-child { white-space: normal; min-width: 280px; }
.timeline li { display: grid; grid-template-columns: 130px 140px 170px 1fr; gap: 4px 14px; align-items: baseline; }
.timeline li .when { margin-left: 0; }
.timeline li .pill { justify-self: start; }
@media (max-width: 720px) { .timeline li { grid-template-columns: 1fr 1fr; } }
.history-table a.mono { font-size: var(--footnote); text-decoration: none; }
.evidence-hint { margin: 4px 0 6px; padding: 6px 10px; border-left: 3px solid var(--line-form, #00a65a); background: #f6f8fb; color: #1f2937; }
.witness-wait { border: 1px solid #f0d58a; background: #fff8e6; border-radius: 4px; padding: 10px 14px; margin: 10px 0; }
.saved-signature { max-width: 260px; max-height: 110px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.check-inline { display: flex; align-items: center; gap: 8px; }

/* System checks | Our own checks (2026-10-15): the own-checks fields show only when that side is on. */
.assessed-where { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.assessed-where legend { font-weight: 600; padding: 0 4px; }
.toggle { display: inline-flex; border: 1px solid #b9c2d3; border-radius: 999px; overflow: hidden; margin: 2px 0 6px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label { padding: 6px 16px; cursor: pointer; font-size: var(--footnote); color: var(--navy); background: #fff; }
.toggle input:checked + label { background: var(--navy); color: #fff; font-weight: 600; }
.toggle input:focus-visible + label { outline: 2px solid var(--navy-soft); outline-offset: -2px; }
.assessed-where .elsewhere-fields { display: none; margin-top: 6px; }
.assessed-where:has(input[value=elsewhere]:checked) .elsewhere-fields { display: grid; }
.assessed-where:has(input[value=elsewhere]:checked) .toggle-system { display: none; }
form:has(.assessed-where input[value=elsewhere]:checked) .system-only { display: none; }
.prescreen-form .assessed-where { margin-bottom: 12px; }

/* What changed in a document (2026-10-18): before and after, line by line. */
.changes { list-style: none; padding: 0; margin: 4px 0 12px; font-family: var(--mono, monospace); font-size: var(--footnote); }
.changes li { padding: 3px 8px; border-left: 3px solid transparent; }
.change-removed { background: #fdecec; border-left-color: #c62828 !important; text-decoration: line-through; text-decoration-color: #c6282880; }
.change-added { background: #e8f5e9; border-left-color: #2e7d32 !important; }
.change-mark { font-family: var(--font, sans-serif); font-weight: 600; font-size: 0.85em; margin-right: 6px; text-decoration: none; display: inline-block; min-width: 2.5em; }

/* Settings → Emails about new applications (2026-10-22): room for a whole address. */
#application-emails input[name=address] { width: 34ch; max-width: 100%; }

/* Delete loan, in the Terms tab's row of buttons after Copy loan, as LoanDisk has it (2026-10-24). */
form.delete-loan { display: contents; }

/* Edit loan ▾ on the Terms tab (2026-10-24): a menu as LoanDisk's, opened by a click, no script. */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-items { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; background: #fff;
  border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 40, .12); padding: 6px 0; display: grid; }
details.menu .menu-items a { padding: 8px 16px; color: var(--ink); text-decoration: none; font-size: var(--footnote); }
details.menu .menu-items a:hover, details.menu .menu-items a:focus { background: #eef2fb; }
details.menu .menu-head { padding: 8px 16px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--line); margin-top: 4px; }
details.menu .menu-items .muted { padding: 4px 16px 8px; }

/* Before deleting a loan (confirm.js): a red box like LoanDisk's "Are you sure you want to delete this loan?". */
dialog.confirm-box { border: none; border-radius: 4px; padding: 0; width: min(720px, calc(100vw - 32px)); color: #fff;
  background: #d9412e; box-shadow: 0 12px 40px rgba(0, 0, 40, .3); }
dialog.confirm-box::backdrop { background: rgba(10, 16, 40, .45); }
dialog.confirm-box .confirm-head { display: flex; justify-content: space-between; align-items: flex-start; background: #d33725; padding: 22px 18px 18px; }
dialog.confirm-box .confirm-title { margin: 0; font-size: 21px; font-weight: 500; color: #fff; }
dialog.confirm-box .confirm-x { background: none; border: none; color: rgba(255, 255, 255, .6); font-size: 22px; line-height: 1; cursor: pointer; }
dialog.confirm-box .confirm-text { margin: 0; padding: 22px 18px; background: #dd4b39; line-height: 1.5; }
dialog.confirm-box .confirm-actions { display: flex; justify-content: space-between; padding: 18px; background: #d33725; }
dialog.confirm-box .confirm-button { background: transparent; color: #fff; border: 1px solid #fff; border-radius: 3px; padding: 8px 14px; font: inherit; cursor: pointer; }
dialog.confirm-box .confirm-button:hover, dialog.confirm-box .confirm-button:focus-visible { background: rgba(255, 255, 255, .15); }
/* Add a business: the people table's inputs fill their cells (2026-10-24). */
.people-table input:not([type="checkbox"]), .people-table select { width: 100%; min-width: 9rem; }
.people-table td { vertical-align: middle; }
/* A filled loan agreement on screen (business_agreement.html, loan_templates.html preview) (2026-10-24). */
.agreement-text { max-width: 52rem; line-height: 1.55; }
.agreement-text p { margin: 0 0 .6rem; }
.agreement-text ul { margin: 0 0 .8rem 1.2rem; }
.agreement-title { text-align: center; margin: 0 0 1rem; }
.agreement-heading { margin: 1.1rem 0 .3rem; font-size: 1rem; }
.template-body { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.45; width: 100%; }
fieldset.late-part { border: 1px solid var(--line); padding: .5rem .8rem .8rem; margin: 0; }
.signature-image { max-width: 220px; max-height: 90px; border: 1px solid var(--line, #ddd); background: #fff; padding: 2px; }
.email-body, .signoff-text { white-space: pre-wrap; font-family: inherit; background: #f7f8fb; border: 1px solid var(--line, #dde2ed); padding: 12px 14px; border-radius: 6px; margin: 0; }

/* Accounting: a menu down the left and the statement beside it, as LoanDisk lays it out (Lameck, 2026-11-01), in our colours. */
.acct { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.acct-menu { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--line-panel); border-radius: var(--radius); padding: 10px 0; position: sticky; top: 12px; }
.acct-menu h3 { margin: 12px 16px 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.acct-menu a { display: block; padding: 7px 16px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.acct-menu a:hover { background: var(--ground); }
.acct-menu a[aria-current="page"] { border-left-color: var(--navy); background: var(--ground); color: var(--navy); font-weight: 600; }
.acct-filter { border-top: 3px solid var(--line-form); }
.acct-filter form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; }
.acct-filter label { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.acct-table { border-top: 3px solid var(--line-table); }
.acct-table table { width: 100%; border-collapse: collapse; }
.acct-table th { background: var(--head-table); text-align: left; padding: 8px 10px; }
.acct-table td { padding: 7px 10px; border-top: 1px solid var(--line); }
.acct-table .num, .acct td.num, .acct th.num { text-align: right; font-variant-numeric: tabular-nums; }
.acct-table tr.total td { font-weight: 700; border-top: 2px solid var(--ink); background: var(--ground); }
.acct-table tr.group td { font-weight: 700; color: var(--navy); background: var(--ground); }
.acct .neg { color: var(--denied-ink); }
.acct-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.acct-balances .box { border: 1px solid var(--line); border-top: 3px solid var(--line-table); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.acct-balances .box strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.align-end { align-self: end; }
/* minmax(0, 1fr): a wide table scrolls in its own box instead of widening the page at phone width. */
@media (max-width: 800px) { .acct { grid-template-columns: minmax(0, 1fr); } .acct-menu { position: static; } .acct section.panel { overflow-x: auto; } }
.acct section.panel + section.panel { margin-top: 14px; }
.acct .top-form { border-top: 3px solid var(--line-form); }
.acct .alert { margin-top: 12px; }
.acct .basis-row { display: flex; gap: 16px; align-items: center; padding-bottom: 8px; }
.acct .inline-radio { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.acct .flush { margin: 8px 0 0; }
.acct .span-all { grid-column: 1 / -1; }
.acct .amount-box { width: 130px; }
.acct .lock-form { border-top: 3px solid var(--line-form); padding-top: 14px; }

/* Edit and Delete beside a repayment (LoanDisk's layout, 2026-11-02). */
.repayment-action { margin-right: 0.75rem; font-weight: 600; }
.repayment-delete { color: var(--danger, #a4262c); }

/* Wide report tables scroll inside their panel (2026-11-03). */
.scroll-x { overflow-x: auto; }

/* Datanamix checks in the Assessment steps */
.card-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 12px; }
.card-row > .mini-card { flex: 1 1 260px; }
.mini-card { border: 1px solid var(--line, #dfe3ea); border-radius: 8px; padding: 10px 12px; background: var(--panel-soft, #fafbfd); margin-bottom: 10px; }
.mini-card h3 { margin: 0 0 6px; font-size: 1rem; }
.mini-card .kv { margin: 6px 0; }
ul.choice { padding-left: 1.1em; }
ul.choice a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Walk-in application (2026-11-04) */
.walkin-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.walkin-steps li { flex: 1 1 140px; padding: 8px 10px; border-radius: 8px; background: #eef1f6; font-size: .85rem; }
.walkin-steps li.done { background: #e3f4ea; color: #14633a; font-weight: 700; }
.walkin-steps li.on { background: var(--navy, #0b1f6b); color: #fff; font-weight: 700; }
.walkin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .walkin-two { grid-template-columns: 1fr; } }
.test-box { border: 2px dashed #f5a623; background: #fff8e8; border-radius: 8px; padding: 10px 12px; }
.form-grid.three { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Walk-in: every field is three rows (label, box, hint) shared with the fields beside it,
   so the boxes line up whether or not a label wraps, says "(optional)" or has a hint below. */
.walk-in .form-grid { row-gap: 0; }
.walk-in .form-grid > label { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; margin-bottom: 14px; justify-content: stretch; }
.walk-in .form-grid > label > .lbl { align-self: end; }
.walk-in .form-grid > label > .lbl small { font-weight: 400; }
.walk-in .form-grid > label > small { align-self: start; }
.walk-in .form-grid > label.check { grid-row: span 3; display: flex; align-self: center; margin-bottom: 14px; }
.walk-in .form-grid > p { grid-row: span 3; align-self: center; margin: 0 0 14px; }
.walkin-capture { position: sticky; bottom: 0; background: var(--panel, #fff); border-top: 1px solid #dfe3ea; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 5; }
.inline-details { display: inline-block; }

/* Add a document: the dates a kind has (document-kind.js); `hidden` wins over the flex layout of labels and rows. */
[data-document-dates][hidden], [data-date-start][hidden], [data-dates-hint][hidden] { display: none; }
/* Add bulk repayments (2026-11-07) */
.bulk-grid input, .bulk-grid select { min-width: 0; width: 100%; }
.bulk-grid .bulk-loan { width: 9em; } .bulk-grid .bulk-amount { width: 7em; text-align: right; }
.bulk-grid select[data-col="method"] { min-width: 9.5em; }
.bulk-grid tr.bulk-error td { background: #fff4f2; }
.bulk-defaults { margin-bottom: 8px; }
.sheet-cols { display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media print { .report-nav, .no-print, .nav, header.top { display: none !important; } .panel { border: 0; box-shadow: none; } }
.sheet-blank { display: inline-block; min-width: 6em; border-bottom: 1px solid #9aa3b5; height: 1.1em; }
/* Borrower notes and restrictions (2026-11-07) */
.borrower-note { border-left: 3px solid #f0d9a0; padding: 4px 10px; margin-bottom: 8px; }
.borrower-note p { margin: 2px 0; }
/* classes some pages already used without a style (re-review, 2026-11-07) */
.alert-info { background: #e8f1fb; border-color: #b9d3f0; color: #17406b; }
.alert-inline { display: inline-block; padding: 6px 10px; }

/* Risk and insights (LoanDisk's AI Insights tab, 2026-11-11) */
.risk-badge { display: inline-block; padding: 6px 12px; border-radius: 6px; font-weight: 600; border: 1px solid currentColor; }
.risk-low { color: #1e7a3a; background: #e6f4ea; } .risk-medium { color: #8a5a00; background: #fcf1d8; }
.risk-high { color: #a12a25; background: #fbe6e4; } .risk-critical { color: #fff; background: #7a0b0b; }
.risk-gauge { width: 100%; max-width: 420px; height: auto; display: block; margin: 6px 0 12px; }
.risk-factors { max-width: 640px; }
.ladder-scroll { overflow-x: auto; margin: 16px 0 8px; }
.ladder-track { position: relative; width: max-content; min-width: 100%; }   /* as wide as its steps: the line follows when it scrolls */
.ladder-line { position: absolute; left: 0; top: 7px; width: 100%; height: 4px; overflow: visible; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.ladder-n2 .ladder { grid-template-columns: repeat(2, minmax(96px, 1fr)); } .ladder-n3 .ladder { grid-template-columns: repeat(3, minmax(96px, 1fr)); }
.ladder-n4 .ladder { grid-template-columns: repeat(4, minmax(96px, 1fr)); } .ladder-n5 .ladder { grid-template-columns: repeat(5, minmax(96px, 1fr)); }
.ladder-n6 .ladder { grid-template-columns: repeat(6, minmax(96px, 1fr)); } .ladder-n7 .ladder { grid-template-columns: repeat(7, minmax(96px, 1fr)); }
.ladder-n8 .ladder { grid-template-columns: repeat(8, minmax(96px, 1fr)); }
.ladder li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: var(--caption1, .85rem); color: var(--muted); }
.ladder .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c8ccc6; background: #fff; }
.ladder li.done .dot { background: #3fa34d; border-color: #3fa34d; }
.ladder li.current .dot { background: #f0a020; border-color: #f0a020; box-shadow: 0 0 0 4px #fbe3b8; }
.ladder li.current strong { color: inherit; }
.insight-headline { border-left: 4px solid #2a6fb0; background: #eef4fb; padding: 10px 14px; border-radius: 4px; }
.insight-box { border-left: 4px solid; padding: 8px 14px; border-radius: 4px; margin: 12px 0; }
.insight-box h3 { margin-top: 4px; }
.insight-risks { border-color: #e3b341; background: #fdf6e7; } .insight-actions { border-color: #3fa34d; background: #edf7ef; }

/* Loan files in folders (LoanDisk's loan Files tab, 2026-11-11) */
.loan-files { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 24px; margin-top: 16px; }
@media (max-width: 760px) { .loan-files { grid-template-columns: 1fr; } }
.file-folder { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; }
.file-folder > summary { cursor: pointer; font-weight: 600; }
.folder-icon { display: inline-block; width: 16px; height: 12px; margin-right: 6px; border-radius: 2px; background: #f2c14e; vertical-align: -1px; }
.file-list { list-style: none; margin: 6px 0 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.file-actions > summary { cursor: pointer; font-size: var(--caption1, .85rem); color: var(--muted); }
.file-actions form, .file-actions a { margin-top: 6px; }
.loan-files-upload { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; align-self: start; }
.drop-zone { display: block; border: 2px dashed var(--line); border-radius: 6px; padding: 24px 12px; text-align: center; color: var(--muted); }
.drop-zone input { display: block; margin: 10px auto 0; max-width: 100%; }
.file-folder.drop-over, .drop-zone.drop-over { outline: 2px dashed #2a6fb0; outline-offset: 2px; background: #eef4fb; }
.file-list li[draggable="true"] { cursor: grab; }
.pre-wrap { white-space: pre-wrap; margin-top: 4px; }

/* The ribbon (ribbon.py; Lameck, 2026-11-14: "implement the ribbon"), as LoanDisk's: a top bar, the main menu with
   drop-downs, and the section's pages. */
.ribbon { background: none; color: #fff; }
.ribbon .util { background: var(--navy); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: stretch; }
.ribbon .util-left, .ribbon .util-right { display: flex; flex-wrap: wrap; align-items: stretch; }
/* the wordmark sits on the bar's own blue (Lameck, 2026-11-14) */
.ribbon .wordmark { background: none; padding: 9px 16px; display: flex; align-items: center; }
.ribbon .util-cell { color: #fff; text-decoration: none; padding: 9px 13px; display: flex; gap: 7px; align-items: center; white-space: nowrap; border-left: 1px solid rgba(255,255,255,.18); font-size: var(--subheadline); margin: 0; }
.ribbon a.util-cell:hover, .ribbon .util-cell.on { background: rgba(0,0,0,.16); }
.ribbon .util-cell .link-button { color: #fff; text-decoration: none; }
.ribbon .util-cell .link-button:hover { text-decoration: underline; }
.ribbon .who-link small { color: #dbe6ff; }
.ribbon .bell { position: relative; }
.ribbon .bell-count { background: #f59f00; color: #1b1b1b; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }
.ribbon .mainnav { background: #0b1240; display: flex; flex-wrap: wrap; justify-content: center; padding: 0 10px; }
.ribbon .mi { position: relative; }
.ribbon .mi > a { color: #fff; text-decoration: none; display: flex; gap: 6px; align-items: center; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
.ribbon .mi > a:hover, .ribbon .mi:focus-within > a { background: rgba(255,255,255,.09); }
/* the section you are in: a light tab that runs into the row of its pages below (Lameck, 2026-11-14: scheme B) */
.ribbon .mi.on > a { background: #f3f5fa; color: var(--navy); font-weight: 600; }
.ribbon .mi.on > a:hover, .ribbon .mi.on:focus-within > a { background: #f3f5fa; }
.ribbon .caret { font-size: 10px; opacity: .8; }
.ribbon .drop { display: none; position: absolute; top: 100%; left: 0; z-index: 20; background: #fff; min-width: 240px; padding: 6px 0; border-radius: 0 0 6px 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ribbon .drop a { display: block; padding: 7px 16px; color: var(--ink); text-decoration: none; }
.ribbon .drop a:hover, .ribbon .drop a:focus { background: #eef2fa; }
.ribbon .mi:hover .drop, .ribbon .mi:focus-within .drop { display: block; }
.ribbon svg.ri { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ribbon .mi > a svg.ri { width: 14px; height: 14px; }       /* the menu row, smaller as LoanDisk's (Lameck, 2026-11-22) */
.ribbon .subnav { background: #f3f5fa; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 8px 16px; font-size: var(--footnote); }
.ribbon .subnav a { color: #1f5fa8; text-decoration: none; white-space: nowrap; }
.ribbon .subnav a:hover { text-decoration: underline; }
.ribbon .subnav a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.ribbon .subnav .count { background: #f59f00; color: #1b1b1b; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; margin-left: 4px; }
@media (max-width: 760px) {
  .ribbon .mainnav, .ribbon .subnav, .ribbon .util-right { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .ribbon .util-right { width: 100%; }
  .ribbon .drop, .ribbon .caret { display: none !important; }
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 30; background: #fff; color: var(--navy); padding: 8px 14px; font-weight: 700; }
.skip-link:focus { left: 8px; top: 8px; }

/* Add business loan and the calculator: the form beside its Loan preview (LoanDisk's Add Loan), and the "still needed" bar. */
.with-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 20px; align-items: start; }
.with-preview > .preview-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 1100px) { .with-preview { grid-template-columns: minmax(0, 1fr); } .with-preview > .preview-panel { position: static; max-height: none; } }
.preview-panel > h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview-lead span { display: block; color: var(--muted); font-size: var(--caption1); }
.preview-lead strong { font-size: var(--title1); }
.preview-lead small { display: block; }
.preview-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.preview-trio dt, .preview-lines dt { color: var(--muted); font-weight: 400; }
.preview-trio dd { margin: 0; font-weight: 600; }
.preview-lines { margin: 0 0 12px; }
.preview-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.preview-lines dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.preview-lines .total dt, .preview-lines .total dd { color: var(--ink); font-weight: 700; font-size: var(--headline); }
.preview-lines summary { cursor: pointer; }
.loan-table.compact th, .loan-table.compact td { padding: 4px 6px; font-size: var(--caption1); }
.section-badge { margin-left: 8px; vertical-align: middle; }
.needs-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; margin-top: 16px; }
.needs-bar.needs-done [data-needs-text] { color: var(--open-ink); font-weight: 600; }
.needs-bar.needs-open [data-needs-text] { color: var(--processing-ink); font-weight: 600; }
.needs-bar .button-row { margin: 0; }
html { scroll-padding-bottom: 80px; }   /* the sticky still-needed bar never hides the field in use */

/* The dashboard, as LoanDisk's branch dashboard (dashboard_book.py) */
.dash-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tiles a, .tiles div { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; color: var(--ink); text-decoration: none; }
.tiles a:hover { border-color: var(--focus); }
.tiles span { display: block; font-size: var(--caption1); color: var(--muted); }
.tiles strong { font-size: var(--title2); }
.tiles small { display: block; color: var(--muted); }
.tiles .warn { background: var(--denied-bg); border-color: #e8b4b8; }
.meter { height: 8px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.meter > i { display: block; height: 100%; background: #2a78d6; }
.meter.m-0 > i { width: 0; } .meter.m-1 > i { width: 1%; } .meter.m-2 > i { width: 2%; } .meter.m-3 > i { width: 3%; } .meter.m-4 > i { width: 4%; } .meter.m-5 > i { width: 5%; } .meter.m-6 > i { width: 6%; } .meter.m-7 > i { width: 7%; } .meter.m-8 > i { width: 8%; } .meter.m-9 > i { width: 9%; } .meter.m-10 > i { width: 10%; } .meter.m-11 > i { width: 11%; } .meter.m-12 > i { width: 12%; } .meter.m-13 > i { width: 13%; } .meter.m-14 > i { width: 14%; } .meter.m-15 > i { width: 15%; } .meter.m-16 > i { width: 16%; } .meter.m-17 > i { width: 17%; } .meter.m-18 > i { width: 18%; } .meter.m-19 > i { width: 19%; } .meter.m-20 > i { width: 20%; } .meter.m-21 > i { width: 21%; } .meter.m-22 > i { width: 22%; } .meter.m-23 > i { width: 23%; } .meter.m-24 > i { width: 24%; } .meter.m-25 > i { width: 25%; } .meter.m-26 > i { width: 26%; } .meter.m-27 > i { width: 27%; } .meter.m-28 > i { width: 28%; } .meter.m-29 > i { width: 29%; } .meter.m-30 > i { width: 30%; } .meter.m-31 > i { width: 31%; } .meter.m-32 > i { width: 32%; } .meter.m-33 > i { width: 33%; } .meter.m-34 > i { width: 34%; } .meter.m-35 > i { width: 35%; } .meter.m-36 > i { width: 36%; } .meter.m-37 > i { width: 37%; } .meter.m-38 > i { width: 38%; } .meter.m-39 > i { width: 39%; } .meter.m-40 > i { width: 40%; } .meter.m-41 > i { width: 41%; } .meter.m-42 > i { width: 42%; } .meter.m-43 > i { width: 43%; } .meter.m-44 > i { width: 44%; } .meter.m-45 > i { width: 45%; } .meter.m-46 > i { width: 46%; } .meter.m-47 > i { width: 47%; } .meter.m-48 > i { width: 48%; } .meter.m-49 > i { width: 49%; } .meter.m-50 > i { width: 50%; } .meter.m-51 > i { width: 51%; } .meter.m-52 > i { width: 52%; } .meter.m-53 > i { width: 53%; } .meter.m-54 > i { width: 54%; } .meter.m-55 > i { width: 55%; } .meter.m-56 > i { width: 56%; } .meter.m-57 > i { width: 57%; } .meter.m-58 > i { width: 58%; } .meter.m-59 > i { width: 59%; } .meter.m-60 > i { width: 60%; } .meter.m-61 > i { width: 61%; } .meter.m-62 > i { width: 62%; } .meter.m-63 > i { width: 63%; } .meter.m-64 > i { width: 64%; } .meter.m-65 > i { width: 65%; } .meter.m-66 > i { width: 66%; } .meter.m-67 > i { width: 67%; } .meter.m-68 > i { width: 68%; } .meter.m-69 > i { width: 69%; } .meter.m-70 > i { width: 70%; } .meter.m-71 > i { width: 71%; } .meter.m-72 > i { width: 72%; } .meter.m-73 > i { width: 73%; } .meter.m-74 > i { width: 74%; } .meter.m-75 > i { width: 75%; } .meter.m-76 > i { width: 76%; } .meter.m-77 > i { width: 77%; } .meter.m-78 > i { width: 78%; } .meter.m-79 > i { width: 79%; } .meter.m-80 > i { width: 80%; } .meter.m-81 > i { width: 81%; } .meter.m-82 > i { width: 82%; } .meter.m-83 > i { width: 83%; } .meter.m-84 > i { width: 84%; } .meter.m-85 > i { width: 85%; } .meter.m-86 > i { width: 86%; } .meter.m-87 > i { width: 87%; } .meter.m-88 > i { width: 88%; } .meter.m-89 > i { width: 89%; } .meter.m-90 > i { width: 90%; } .meter.m-91 > i { width: 91%; } .meter.m-92 > i { width: 92%; } .meter.m-93 > i { width: 93%; } .meter.m-94 > i { width: 94%; } .meter.m-95 > i { width: 95%; } .meter.m-96 > i { width: 96%; } .meter.m-97 > i { width: 97%; } .meter.m-98 > i { width: 98%; } .meter.m-99 > i { width: 99%; } .meter.m-100 > i { width: 100%; }
.collect-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.activity td.num, .activity th.num { white-space: nowrap; }
.big-figure { font-size: var(--title1); }
#portfolio .grid-2 > div, .grid-2 > section { min-width: 0; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
/* E-signatures board (signing_board.py), as LoanDisk's */
.sign-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: start; }
.sign-col { background: #f6f8fc; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 160px; }
.sign-col-warn { background: var(--denied-bg); }
.sign-col h2 { font-size: var(--headline); margin: 2px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.sign-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.sign-card:hover { border-color: var(--focus); }
.sign-card strong { display: block; } .sign-card small { display: block; color: var(--muted); }
.sign-dots { display: inline-block; margin: 4px 0; }
.sign-dots .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; background: #d6dbe6; }
.sign-dots .dot.ok { background: var(--open-ink); } .sign-dots .dot.late { background: var(--denied-ink); }
.sign-card .sign-dots { display: block; }

/* E-signatures for any document: the pages with their boxes (sign-pages.js, sign-designer.js) */
.sign-pages { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; margin: 1rem 0; }
.sign-page { position: relative; margin: 0; width: 100%; max-width: 820px; box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; }
.sign-page img { display: block; width: 100%; height: auto; user-select: none; }
.sign-page figcaption { position: absolute; bottom: -1.3rem; right: 0; }
.sign-page-edit { cursor: crosshair; }
.sign-box { position: absolute; box-sizing: border-box; border: 2px dashed #b8860b; background: rgba(255, 221, 87, .35);
  font-size: .72rem; line-height: 1.1; overflow: hidden; padding: 1px 3px; color: #3d2f00; }
.sign-box input[type="text"], .sign-box input:not([type]) { width: 100%; height: 100%; border: 0; background: transparent; font-size: .8rem; padding: 0; }
.sign-box .check { display: flex; align-items: center; gap: .25rem; height: 100%; margin: 0; }
.sign-page-edit .sign-box { cursor: move; touch-action: none; }
.sign-box-on { border-style: solid; border-color: #1f5fbf; background: rgba(120, 170, 255, .35); }
.sign-grip { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: #1f5fbf; cursor: nwse-resize; }
.sign-box:not(.sign-box-on) .sign-grip { display: none; }
.sign-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin: .5rem 0; }
.sign-tools { position: sticky; top: 0; z-index: 5; }
.sign-person { border: 1px solid #ddd; border-radius: 6px; padding: .5rem .9rem; margin: .5rem 0; }

/* custom repayment cycles: a grid of tick boxes (dates of the month, days of the week) */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .15rem .5rem; margin: .25rem 0 .5rem 1.5rem; }

/* An assessment step folds once it is done (Lameck, 2026-11-27: "After completing a check should be able to close and
   expand the item"): the heading opens and closes it. */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "\25B8"; color: var(--muted, #667085); font-size: 14px; }
details.fold[open] > summary::before { content: "\25BE"; }
details.fold > summary h2 { margin: 0; }
details.fold > summary .fold-hint { margin-left: auto; font-size: 13px; color: var(--muted, #667085); }
details.fold > summary:hover .fold-hint { text-decoration: underline; }
details.fold[open] > summary .fold-closed, details.fold:not([open]) > summary .fold-open { display: none; }
