/* Opening Passport — web app stylesheet (UX-2). Colors come ONLY from tokens.css vars
 * (gated by tests/test_design_tokens.py). Class names are the pre-UX-2 vocabulary —
 * templates did not have to change to adopt this file. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root { color-scheme: light; }

* { box-sizing: border-box; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0; line-height: 1.5;
  background: var(--surface); color: var(--text);
  font-size: 15px;
}

/* ---- header / nav (TenderScan-adjacent: raised white bar, bordered) ------------------- */
header.appbar {
  background: var(--surface-raised); color: var(--text);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  padding: .6rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em;
  color: var(--primary); text-decoration: none; white-space: nowrap;
}
.brand .mark {
  display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.22em;
  margin-right: .4em; border: .16em solid var(--primary); border-radius: .25em;
  border-right-width: .38em;   /* the wordmark: an opening with its leaf */
}
.brand .phase { color: var(--text-muted); font-weight: 400; font-size: .8rem; }
header.appbar nav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
header.appbar nav a { color: var(--text); text-decoration: none; font-weight: 500;
                      font-size: .92rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
header.appbar nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }
header.appbar .who { color: var(--text-muted); font-size: .85rem; }
form.navsearch { display: inline-flex; gap: 0; margin: 0; }
form.navsearch input {
  min-width: 13rem; margin: 0; padding: .35rem .6rem; font-size: .9rem;
  border-radius: var(--radius) 0 0 var(--radius); border-right: 0;
}
form.navsearch button {
  margin: 0; border-radius: 0 var(--radius) var(--radius) 0;
  padding: .35rem .7rem; font-size: .9rem;
}

/* ---- layout: the content panel ---------------------------------------------------------- */
main {
  max-width: 1020px; margin: 1.2rem auto; padding: 1.2rem 1.6rem 2rem;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
h1 { font-size: 1.45rem; letter-spacing: -.01em; margin: .2rem 0 .8rem; }
h2 { font-size: 1.12rem; margin: 1.6rem 0 .5rem; }
h3 { font-size: 1rem; margin: .2rem 0 .4rem; }
.muted { color: var(--text-muted); }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
code { font-size: .85em; }

/* ---- tables (compliance density kept; whitespace lives in the chrome) ------------------- */
table { border-collapse: collapse; width: 100%; margin: .6rem 0 1.4rem; font-size: .92rem; }
th, td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left;
         vertical-align: top; }
th { background: var(--surface); font-weight: 600; }
tbody tr:hover { background: var(--surface); }

/* ---- pills: ONE component, one shape; semantic classes carry custody meaning ------------ */
.pill {
  display: inline-block; padding: .08rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.pill.current, .pill.ok, .pill.status-active { background: var(--saved); color: var(--on-saved); }
.pill.superseded, .pill.status-decommissioned { background: var(--inactive); color: var(--on-inactive); }
.pill.neutral { background: var(--neutral-pill-bg); color: var(--neutral-pill-text); font-weight: 500; }
.pill.warn { background: var(--queued); color: var(--on-queued); }
.pill.bad { background: var(--alarm); color: var(--on-alarm); }

/* ---- boxes / banners --------------------------------------------------------------------- */
.err {
  background: var(--alarm-soft-bg); border: 1px solid var(--alarm-soft-border);
  color: var(--alarm-soft-text); padding: .6rem .8rem; border-radius: var(--radius);
}
.alarm { background: var(--alarm-strong); color: var(--on-alarm-strong); padding: .6rem 1.2rem; }
.alarm a { color: var(--on-alarm-strong); }
.pressure { background: var(--pressure-bg); color: var(--on-pressure); padding: .4rem 1.2rem; }
.restricted {
  background: var(--restricted-bg); border: 1px solid var(--restricted-border);
  color: var(--restricted-text); padding: .6rem .8rem; border-radius: var(--radius);
}

/* ---- forms & buttons ---------------------------------------------------------------------- */
form.inline { display: inline; }
label { display: block; margin: .6rem 0 .15rem; font-weight: 600; font-size: .9rem; }
input, select, textarea {
  padding: .45rem .6rem; min-width: 18rem; max-width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-raised); color: var(--text); font: inherit; font-size: .95rem;
}
button, .btn {
  display: inline-block; background: var(--primary); color: var(--on-primary);
  padding: .45rem 1rem; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--primary); font: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover);
                           color: var(--on-primary); }
button.secondary, .btn.secondary {
  background: var(--surface-raised); color: var(--primary); border-color: var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { border-color: var(--primary); background: var(--surface); }
button.danger, .btn.danger { background: var(--alarm); border-color: var(--alarm); color: var(--on-alarm); }
button.danger:hover, .btn.danger:hover { background: var(--alarm-strong); border-color: var(--alarm-strong); }

/* ---- cards -------------------------------------------------------------------------------- */
.row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-raised); box-shadow: var(--shadow);
  padding: .8rem 1rem; flex: 1; min-width: 16rem;
}

/* ---- on-page section menu (jumpbar) + the Copy-ID affordance -------------------------------- */
.jumpbar {
  display: flex; gap: .4rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-raised); padding: .55rem 0; margin: 0 0 1rem;
  border-bottom: 1px solid var(--border);
}
.jumpbar a {
  padding: .25rem .8rem; border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 500;
  white-space: nowrap;
}
.jumpbar a:hover { border-color: var(--primary); color: var(--primary); }
button.copyid { font-size: .8rem; padding: .15rem .7rem; margin-left: .4rem; }

/* ---- login: the brand's front door ---------------------------------------------------------- */
.login { max-width: 26rem; margin: 2.5rem auto; }
.login .brand.big { font-size: 1.5rem; }
.login input { width: 100%; min-width: 0; }
.login form button { width: 100%; padding: .55rem 1rem; font-size: 1rem; }

/* ---- mobile: point phones at the field app -------------------------------------------------- */
.fieldapp-hint {
  display: none; text-align: center; padding: .55rem .9rem;
  background: var(--surface-raised); border-bottom: 1px solid var(--border);
  color: var(--primary); font-size: .9rem; font-weight: 500; text-decoration: none;
}
@media (max-width: 640px), (pointer: coarse) and (max-width: 1024px) {
  .fieldapp-hint { display: block; }
}

/* ---- accessibility: visible focus everywhere (WCAG 2.4.7) --------------------------------- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

@media print {
  header.appbar, .noprint { display: none; }
  body { background: var(--surface-raised); }
  main { border: 0; box-shadow: none; margin: 0; max-width: none; }
}

/* ==== UX-3: the application shell (docs/ux-mockup-v3.html) ================================
 * Signed-in principals: 240px left sidebar (search under the logo, Records / Field / Admin,
 * account at the foot), collapsible to icons, a drawer below 900px; breadcrumb and the
 * persistent opening header above the page body. Chrome uses CATEGORY colours (the tint
 * pair, brand blue) — never custody colours. Anonymous pages keep header.appbar above. */
svg.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.shell-main { min-width: 0; }

.side {
  background: var(--surface-raised); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow: hidden auto;
}
.side .top { display: flex; align-items: center; gap: .6rem; padding: .9rem .9rem .5rem; min-height: 56px; }
.side .brand { display: inline-flex; align-items: center; gap: .45em; overflow: hidden; }
.side .brand .mark { margin-right: 0; }
.side .collapse, .side .close-drawer, .topbar .burger {
  border: 0; background: transparent; color: var(--text-muted); padding: .35rem;
  border-radius: var(--radius); display: inline-flex; cursor: pointer; font: inherit;
}
.side .collapse { margin-left: auto; }
.side .collapse:hover, .side .close-drawer:hover, .topbar .burger:hover { background: var(--surface); color: var(--text); }
.side .close-drawer { display: none; margin-left: auto; }
.side form.search {
  margin: .2rem .8rem .3rem; display: flex; align-items: center; gap: .5rem; padding: .1rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-muted);
}
.side form.search input { border: 0; background: transparent; font: inherit; font-size: .9rem; width: 100%;
                          min-width: 0; padding: .35rem 0; color: var(--text); }
.side nav { padding: .2rem .6rem; flex: 1; }
.side .group { font-size: .7rem; letter-spacing: .08em; color: var(--text-muted); font-weight: 600;
               padding: .9rem .5rem .3rem; white-space: nowrap; }
.side a.item {
  display: flex; align-items: center; gap: .65rem; padding: .48rem .55rem; margin: .1rem 0;
  border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500;
  font-size: .92rem; white-space: nowrap;
}
.side a.item:hover { background: var(--surface); color: var(--text); }
.side a.item.active { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.side .foot { border-top: 1px solid var(--border); padding: .7rem .8rem .9rem; display: flex; align-items: center; gap: .5rem; }
.side .account { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1; }
.side .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tint-blue-bg); color: var(--tint-blue-fg);
                display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.side .who { min-width: 0; line-height: 1.25; }
.side .who b { display: block; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .who span { font-size: .76rem; color: var(--text-muted); }
.side .foot button.small { padding: .25rem .6rem; font-size: .8rem; }

.shell.collapsed .side .brand span, .shell.collapsed .side .group, .shell.collapsed .side a.item span,
.shell.collapsed .side form.search, .shell.collapsed .side .who, .shell.collapsed .side .foot form { display: none; }
.shell.collapsed .side .top { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
.shell.collapsed .side .collapse { margin-left: 0; }
.shell.collapsed .side .collapse svg { transform: scaleX(-1); }
.shell.collapsed .side a.item { justify-content: center; padding: .55rem 0; }
.shell.collapsed .side nav { padding: .4rem .5rem; }
.shell.collapsed .side .foot { justify-content: center; }

.topbar { display: none; align-items: center; gap: .6rem; padding: .55rem .8rem;
          background: var(--surface-raised); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 6; }
.scrim { display: none; position: fixed; inset: 0; background: var(--text); opacity: .35; z-index: 8; }

/* breadcrumb + the persistent opening header */
.crumbs { font-size: .84rem; color: var(--text-muted); display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }
.ohead { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin: 0 0 1.1rem;
         display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-start; background: var(--surface-raised); }
.ohead .id { flex: 1 1 22rem; min-width: 0; }
.ohead h1 { font-size: 1.9rem; letter-spacing: -.02em; margin: 0; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ohead .loc { margin: .15rem 0 .1rem; font-weight: 500; }
.ohead .desc { color: var(--text-muted); font-size: .92rem; margin: 0 0 .6rem; }
.ohead .pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.ohead .side-block { flex: 0 1 20rem; display: grid; gap: .6rem; align-content: start; }
dl.meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .86rem; }
dl.meta dt { color: var(--text-muted); white-space: nowrap; }
dl.meta dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn.small { padding: .25rem .7rem; font-size: .8rem; }
.ident { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
         overflow-wrap: anywhere; white-space: normal; }      /* identifiers are never truncated */
.empty { color: var(--text-muted); font-weight: 400; font-style: italic; }

@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .topbar { display: flex; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 86vw; z-index: 9;
          height: auto; transform: translateX(-100%); transition: transform .18s ease-out; }
  .shell.drawer-open .side { transform: none; box-shadow: var(--shadow); }
  .shell.drawer-open .scrim { display: block; }
  .side .collapse { display: none; }
  .side .close-drawer { display: inline-flex; }
  /* a collapsed desktop preference never applies to the drawer */
  .shell.collapsed .side .brand span, .shell.collapsed .side .group, .shell.collapsed .side a.item span,
  .shell.collapsed .side .who, .shell.collapsed .side .foot form { display: initial; }
  .shell.collapsed .side form.search { display: flex; }
  .shell.collapsed .side a.item { justify-content: flex-start; padding: .48rem .55rem; }
  .shell.collapsed .side .top { justify-content: flex-start; }
  .shell.collapsed .side .foot { justify-content: flex-start; }
  .ohead { padding: .9rem 1rem; }
  .ohead h1 { font-size: 1.55rem; }
}
@media print {
  .side, .topbar, .scrim, .fieldapp-hint, .ohead .actions { display: none; }
  .shell, .shell.collapsed { display: block; }
}

/* ==== UX-4: the opening page (docs/ux-mockup-v3.html, screen 1) ==============================
 * Five grouped tabs over an overview card grid; the open group's members as a segmented row;
 * one version strip per component with the superseded versions reachable inline; the
 * opening-level event stream as a ledger. Tiles and chrome use CATEGORY tints; custody
 * colours keep their frozen meanings (green server-confirmed, red alarm, grey superseded,
 * amber not-yet-on-server, sand the keying wall). No table here may widen the page: the
 * record tables sit in .tablewrap and their cells wrap at any character. */

/* two-level record nav: five groups, then the members of the open group */
.subnav { display: flex; gap: .1rem; margin: 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subnav button { border: 0; background: transparent; padding: .55rem .9rem; font-size: .92rem; font-weight: 500;
                 color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
                 display: inline-flex; align-items: center; gap: .4em; border-radius: 0; }
.subnav button:hover { color: var(--text); background: transparent; border-color: transparent; border-bottom-color: var(--border-strong); }
.subnav button[aria-selected="true"], .subnav button[aria-selected="true"]:hover { color: var(--primary-text); border-bottom-color: var(--primary); }
.subnav button .n { font-size: .7rem; font-weight: 700; padding: 0 .4rem; border-radius: 999px;
                    background: var(--alarm-soft-bg); color: var(--alarm-soft-text); }
.members { display: flex; gap: .4rem; flex-wrap: wrap; padding: .7rem 0 .9rem; }
.members button { border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); border-radius: 999px;
                  padding: .22rem .85rem; font-size: .84rem; font-weight: 500; }
.members button:hover { border-color: var(--primary); color: var(--primary-text); background: var(--surface-raised); }
.members button[aria-pressed="true"] { background: var(--tint-blue-bg); color: var(--tint-blue-fg); border-color: var(--tint-blue-bg); }
.members button.keying { color: var(--text-muted); }
.members button.keying[aria-pressed="true"] { background: var(--neutral-pill-bg); color: var(--neutral-pill-text); border-color: var(--neutral-pill-bg); }
.members[hidden] { display: none; }
.panel { margin-top: .9rem; }
.panel[hidden] { display: none; }

/* overview grid: one skeleton per card (tile + title + version / three rows / one foot line) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; align-items: stretch; }
a.ccard { display: flex; flex-direction: column; gap: .6rem; background: var(--surface-raised); border: 1px solid var(--border);
          border-radius: 12px; box-shadow: var(--shadow); padding: .9rem 1rem; color: var(--text); text-decoration: none;
          transition: border-color .12s; min-width: 0; }
a.ccard:hover { border-color: var(--border-strong); color: var(--text); }
.ccard .head { display: flex; align-items: center; gap: .6rem; }
.ccard .tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.tile.blue   { background: var(--tint-blue-bg);   color: var(--tint-blue-fg); }
.tile.purple { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }
.tile.sky    { background: var(--tint-sky-bg);    color: var(--tint-sky-fg); }
.tile.slate  { background: var(--tint-slate-bg);  color: var(--tint-slate-fg); }
.tile.none   { background: var(--surface);        color: var(--border-strong); }
.tile.alarm  { background: var(--alarm-soft-bg);  color: var(--alarm-soft-text); }
.ccard .head h3 { margin: 0; font-size: .98rem; font-weight: 600; flex: 1; }
.ccard .head .ver { font-size: .72rem; color: var(--text-muted); text-align: right; }
.ccard dl { margin: 0; display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: .18rem .7rem; font-size: .86rem; }
.ccard dt { color: var(--text-muted); }
.ccard dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ccard ul.hw { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .86rem; }
.ccard ul.hw li b { display: block; font-weight: 600; }
.ccard ul.hw li span { display: block; color: var(--text-muted); font-size: .8rem; }
.ccard .foot { margin-top: auto; padding-top: .2rem; display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
               font-size: .82rem; color: var(--text-muted); }
a.ccard.keying { color: var(--text-muted); box-shadow: none; }
a.ccard.keying .head h3 { color: var(--text-muted); font-weight: 500; }
a.ccard.keying dd { font-weight: 400; }
a.ccard.keying:hover { border-color: var(--border); }
a.ccard.deficiency { border-color: var(--alarm-soft-border); border-left: 4px solid var(--alarm); }

/* version strip + the superseded versions, reachable inline */
.vstrip { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; background: var(--surface-raised);
          border: 1px solid var(--border); border-radius: 12px; padding: .7rem 1rem; margin-bottom: .9rem; box-shadow: var(--shadow); }
.vstrip .vnum { font-size: 1.05rem; font-weight: 700; }
.vstrip .vof { color: var(--text-muted); font-size: .88rem; }
.vstrip .spacer { flex: 1; }
.vstrip .link, button.link { border: 0; background: transparent; color: var(--primary-text); font-weight: 600; font-size: .86rem; padding: .2rem .3rem; }
.vstrip .link:hover, button.link:hover { background: transparent; color: var(--primary-hover); border-color: transparent; text-decoration: underline; }
.superseded { display: grid; gap: .4rem; margin: -.4rem 0 .9rem; }
.superseded[hidden] { display: none; }
.superseded .vrow { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .86rem; color: var(--text-muted);
                    background: var(--surface-raised); border: 1px solid var(--border); border-left: 4px solid var(--inactive);
                    border-radius: var(--radius); padding: .45rem .8rem; }
.superseded .vrow b { color: var(--text); font-weight: 600; }

/* panels */
.pcard { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 1rem 1.2rem; min-width: 0; }
.pcard h2 { font-size: 1.05rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pcard h3 { margin: .9rem 0 .3rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pcard h3:first-child { margin-top: 0; }
.pcard.reconcile { margin-bottom: 1rem; }
.kv { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .35rem 1rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .8rem;
        font-size: .86rem; color: var(--text-muted); margin: .8rem 0 0; }
.restricted-wall { background: var(--restricted-bg); border: 1px solid var(--restricted-border); color: var(--restricted-text);
                   border-radius: 12px; padding: 1rem 1.2rem; display: flex; gap: .8rem; align-items: flex-start; }
.restricted-wall svg.i { width: 1.6em; height: 1.6em; }
.restricted-wall p { margin: .2rem 0; }
.pill.quiet { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); font-weight: 500; }

/* record tables: never wider than the page -- wrap at any character, scroll inside the wrap as a last resort */
.tablewrap { overflow-x: auto; max-width: 100%; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0; table-layout: auto; }
table.list th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: .78rem; letter-spacing: .04em;
                padding: .3rem .5rem; border: 0; border-bottom: 1px solid var(--border); background: transparent; }
table.list td { padding: .45rem .5rem; border: 0; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--surface); }
table.list .sub { display: block; color: var(--text-muted); font-size: .8rem; font-weight: 400; }
table.list b.ident { font-weight: 600; }

/* the event stream and the deficiency list: ledger rows (border colour = category, alarm for a critical finding) */
.ledger { display: grid; gap: .5rem; }
.lrow { background: var(--surface-raised); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
        border-radius: var(--radius); padding: .6rem .9rem; display: grid; gap: .25rem; min-width: 0; }
.lrow.blue { border-left-color: var(--primary); }
.lrow.purple { border-left-color: var(--tint-purple-fg); }
.lrow.alarm { border-left-color: var(--alarm); }
.lrow .t { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-weight: 600; }
.lrow .t .seq { color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lrow .d { font-size: .9rem; overflow-wrap: anywhere; }
.lrow .m { font-size: .84rem; color: var(--text-muted); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; overflow-wrap: anywhere; }

/* Record > Tag */
.tagwrap { display: grid; grid-template-columns: minmax(240px, 320px) minmax(260px, 1fr); gap: .9rem; align-items: start; }
.carriers { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.carriers svg { max-width: 100%; height: auto; }
.tagcap { font-size: .8rem; color: var(--text-muted); margin: .6rem 0 0; }
.claim { margin: .9rem 0 0; font-size: .9rem; color: var(--text-muted); line-height: 1.5; }
.claim b { color: var(--text); font-weight: 600; }
button.copyid.small { padding: .15rem .6rem; font-size: .8rem; margin: 0; }
@media (max-width: 720px) {
  .tagwrap { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: .1rem .6rem; }
  .kv dt { margin-top: .35rem; }
}
