/* Audited: ledger paper, blue attest ink, ruled columns. */

@font-face { font-family: "Plex"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #ECF2EC;        /* columnar pad green */
  --sheet: #FFFFFF;
  --ink: #1C2A23;          /* green-black ink */
  --muted: #56685E;
  --rule: #D2E2D1;         /* ledger ruling */
  --rule-strong: #8FB48C;
  --head: #F3F8F2;
  --hover: #F6FAF5;
  --attest: #2A4999;       /* blue approval ink */
  --attest-dark: #1F3878;
  --attest-tint: #E8EDF9;
  --ok: #1D6A43;   --ok-tint: #E1F1E6;
  --warn: #7A5200; --warn-tint: #FFF1D4;
  --error: #A1261C; --error-tint: #FBE7E5;
  --radius: 6px;
  --font: "Plex", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font);
  font-feature-settings: "tnum" 0; }
a { color: var(--attest); text-underline-offset: 2px; }
a:hover { color: var(--attest-dark); }
:focus-visible { outline: 2px solid var(--attest); outline-offset: 2px; border-radius: 3px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 19px; line-height: 1.3; font-weight: 600; margin: 0; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ top bar */
.topbar { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex;
  align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.firm { color: var(--muted); font-size: 14px; padding-left: 16px; border-left: 1px solid var(--rule);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--attest-tint); color: var(--attest-dark); font-weight: 500; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--muted); }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.account summary:hover, .account[open] summary { background: var(--hover); color: var(--ink); }
.account-menu { position: absolute; right: 0; top: 44px; z-index: 5; background: var(--sheet); min-width: 200px;
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px; box-shadow: 0 8px 24px rgba(28, 42, 35, .12); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0;
  background: none; font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; border-radius: 4px; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--hover); }
.account-menu .who { padding: 6px 10px 8px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--rule);
  margin-bottom: 4px; }

/* ------------------------------------------------------------------ page */
.page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 72px; }
.site-foot { max-width: 1120px; margin: -40px auto 0; padding: 0 20px 28px; color: var(--muted); font-size: 12.5px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--attest); }
.news { max-width: 820px; }
.news-date { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.news .plain-list li { font-size: 15px; }
.sheet.upcoming { background: var(--attest-tint); border-color: #C9D5F2; }
.upcoming-title { margin-top: 12px; }
.upcoming-title:first-child { margin-top: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px;
  flex-wrap: wrap; }
.page-head .lede { margin: 8px 0 0; color: var(--muted); max-width: 68ch; }
.crumbs { font-size: 14px; margin-bottom: 6px; }
.crumbs a { text-decoration: none; }
.stack > * + * { margin-top: 28px; }

.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.sheet-head { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  flex-wrap: wrap; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; font-size: 14px; }
.sheet-body { padding: 0 20px 20px; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--rule); background: var(--head);
  border-radius: 0 0 var(--radius) var(--radius); }

/* ------------------------------------------------------------------ ledger tables */
.table-wrap { overflow-x: auto; position: relative; }
.ledger { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 14px; }
.ledger th { background: var(--head); text-align: left; font-weight: 500; color: var(--muted); padding: 9px 14px;
  border-top: 1px solid var(--rule); border-bottom: 3px double var(--rule-strong); white-space: nowrap; }
.ledger td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger th + th, .ledger td + td { border-left: 1px solid var(--rule); }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: var(--hover); }
.ledger .num { text-align: right; white-space: nowrap; }
.ledger .nowrap { white-space: nowrap; }
.ledger .actions { text-align: right; width: 1%; white-space: nowrap; }
.ledger a.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.ledger a.row-link:hover { color: var(--attest); text-decoration: underline; }
.account-no { font-weight: 500; }
.sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ------------------------------------------------------------------ status */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--ok-tint); color: var(--ok); }
.status.warn { background: var(--warn-tint); color: var(--warn); }
.status.info { background: var(--attest-tint); color: var(--attest-dark); }
.status.error { background: var(--error-tint); color: var(--error); }

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; background: var(--ok-tint); color: var(--ok);
  border: 1px solid #BFE0CA; }
.flash.error { background: var(--error-tint); color: var(--error); border-color: #F1C4BF; }
.note { padding: 14px 16px; border-radius: var(--radius); background: var(--attest-tint); color: var(--attest-dark); }

/* ------------------------------------------------------------------ forms and buttons */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin: 0 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid #B9CDB8; border-radius: var(--radius);
  padding: 9px 11px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--attest); outline-offset: 0; border-color: var(--attest); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.form-row + .form-row { margin-top: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500;
  font-size: 14px; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--attest); background: var(--attest);
  color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--attest-dark); border-color: var(--attest-dark); color: #fff; }
.btn.quiet { background: var(--sheet); color: var(--attest); border-color: #BFCBEA; }
.btn.quiet:hover { background: var(--attest-tint); color: var(--attest-dark); }
.btn.block { width: 100%; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--error); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; }

details.reveal > summary { list-style: none; cursor: pointer; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal[open] > summary { display: none; }
details.reveal > summary.sr-only:focus-visible { position: static; width: auto; height: auto; margin: 0; clip: auto; padding: 14px 20px; }
.reveal-panel { padding: 20px; border-top: 1px solid var(--rule); }

.upload { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--rule-strong);
  border-radius: var(--radius); background: var(--head); }
.upload input[type=file] { font: inherit; font-size: 14px; flex: 1 1 260px; }

/* ------------------------------------------------------------------ empty states */
.empty { padding: 28px 20px; text-align: left; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 60ch; }

/* ------------------------------------------------------------------ steps (real sequences only) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 22px 48px; counter-increment: step; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px;
  border-radius: 50%; border: 1.5px solid var(--attest); color: var(--attest); font-weight: 600; font-size: 14px;
  display: grid; place-items: center; background: var(--sheet); font-variant-numeric: tabular-nums; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 4px; width: 1.5px;
  background: var(--rule); }
.steps > li.done::before { content: ""; background: var(--attest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.steps h3 { font-size: 15px; }
.steps p { color: var(--muted); font-size: 14px; margin: 2px 0 8px; max-width: 64ch; }
.steps .ui { font-weight: 500; color: var(--ink); white-space: nowrap; }

.copy-field { display: flex; gap: 8px; align-items: stretch; max-width: 560px; }
.copy-field code { flex: 1; display: flex; align-items: center; padding: 9px 12px; background: var(--sheet);
  border: 1px solid #B9CDB8; border-radius: var(--radius); font: 500 14px var(--font); color: var(--ink);
  overflow-x: auto; white-space: nowrap; }

.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.columns > *, .stack > *, .sheet { min-width: 0; }
.tabs { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
  text-decoration: none; font-size: 14px; }
.tabs a:hover { border-color: var(--attest); }

/* ------------------------------------------------------------------ connect page */
.plans { position: relative; }
.plan-choice { display: inline-flex; border: 1px solid #BFCBEA; border-radius: var(--radius); overflow: hidden; margin-bottom: 22px;
  background: var(--sheet); }
.plan-choice label { margin: 0; padding: 9px 16px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--attest);
  display: flex; flex-direction: column; line-height: 1.3; }
.plan-choice label + label { border-left: 1px solid #BFCBEA; }
.plan-choice label span { font-weight: 400; font-size: 12px; color: var(--muted); }
.plan-panel { display: none; }
#plan-own:checked ~ #panel-own, #plan-org:checked ~ #panel-org { display: block; }
#plan-own:checked ~ .plan-choice label[for=plan-own], #plan-org:checked ~ .plan-choice label[for=plan-org] {
  background: var(--attest); color: #fff; }
#plan-own:checked ~ .plan-choice label[for=plan-own] span, #plan-org:checked ~ .plan-choice label[for=plan-org] span { color: #DCE4F7; }
#plan-own:focus-visible ~ .plan-choice label[for=plan-own], #plan-org:focus-visible ~ .plan-choice label[for=plan-org] {
  outline: 2px solid var(--attest); outline-offset: -4px; }
.faq { margin: 0; }
.faq dt { font-weight: 500; margin-top: 14px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.plain-list { margin: 0 0 14px; padding-left: 18px; }
.plain-list li { margin-bottom: 8px; font-size: 14px; }
.aside { position: sticky; top: 20px; }
.diagram { overflow-x: auto; padding: 4px 20px 20px; }
.swipe-hint { display: none; margin: 0 20px 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .swipe-hint { display: block; } }
.diagram svg { display: block; width: 100%; min-width: 600px; max-width: 760px; height: auto; }

/* ------------------------------------------------------------------ sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { margin-bottom: 20px; }
.auth-card .sheet { padding: 28px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lede { color: var(--muted); margin-bottom: 22px; }
.auth-foot { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ log */
.log-filters { padding: 18px 20px 20px; }
.log-search { margin-bottom: 16px; }
.search-row { display: flex; gap: 8px; max-width: 720px; }
.search-row input { flex: 1; min-width: 0; }
.filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.filter-grid select, .filter-grid input { min-width: 0; height: 42px; }
@media (max-width: 900px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filter-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.filter-actions .download { margin-left: auto; font-size: 14px; }
.log-table { min-width: 1040px; }
.log-table td:nth-child(3) { min-width: 150px; }
.log-table td:nth-child(4) { min-width: 140px; }
.log-table td:nth-child(5) { min-width: 180px; }
.log-table td:nth-child(6) { min-width: 300px; }
.log-table .sub { white-space: nowrap; }
.log-table .status { margin: 0 6px 4px 0; vertical-align: 1px; }
.log-summary { font-size: 14px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 16px 20px;
  border-top: 1px solid var(--rule); }
.pager span { color: var(--muted); font-size: 14px; padding: 0 8px; }
.log-lead { font-size: 16px; margin: 0 0 16px; max-width: 75ch; }
.facts { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions .download { margin-left: 0; }
  /* Each entry as a card instead of a wide table. */
  .log-table { min-width: 0; }
  .log-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .log-table, .log-table tbody, .log-table tr, .log-table td { display: block; width: 100%; }
  .log-table tr { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  .log-table tbody tr:last-child { border-bottom: 0; }
  .log-table td, .log-table td + td { border: 0; padding: 2px 0; min-width: 0 !important; }
  .log-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
  .log-table td:first-child::before, .log-table td.actions::before { content: none; }
  .log-table td:first-child { font-weight: 500; }
  .log-table td.actions { text-align: left; width: auto; padding-top: 8px; }
  .log-table tbody tr:hover td { background: none; }
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .firm { display: none; }
  .nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
  .account { margin-left: auto; }
  .page { padding: 24px 16px 56px; }
  h1 { font-size: 24px; }
  .columns { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .tabs a { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
}
