/* NextBeam Certificate Portal
   Palette and type taken from nextbeam.com:
     --e-global-color-primary  #17437C   navy
     --e-global-color-accent   #FF8110   orange
     --e-global-color-text     #333230
     --e-global-color-secondary#878683
     --blue-color              #063873
     --navy-dark               #152548
   Body and headings both use DM Sans on the public site. */

/* DM Sans is linked from base.html, in the page head, so the font request
   starts with the page rather than after this file has loaded. */

:root {
  --navy: #17437c;
  --navy-deep: #063873;
  --navy-dark: #152548;
  --orange: #ff8110;
  --orange-dark: #e6710a;
  --orange-soft: #fff3e6;

  --ink: #333230;
  --muted: #878683;
  --line: #e3e5e8;
  --line-strong: #cfd4da;
  --bg: #f7f8f9;
  --bg-warm: #f8f6f2;
  --card: #ffffff;

  --navy-soft: #eaf0f7;
  --ok: #14612f;
  --ok-soft: #e8f5ec;
  --warn: #8a5300;
  --warn-soft: #fdf3e2;
  --bad: #9b1c1c;
  --bad-soft: #fdecec;

  --radius: 6px;
  --radius-lg: 10px;
  /* Helvetica stands second, ahead of the platform stack. A machine without
     DM Sans fell through to -apple-system / Segoe UI, so the portal looked
     like whatever computer it was opened on; Helvetica and Arial are on
     effectively every machine and are close enough to DM Sans in proportion
     that the layout does not move. Arial follows for the few that have one
     and not the other. */
  --font: "DM Sans", Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }
a:hover { color: var(--navy-deep); }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 28px;
  background: #fff; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 34px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-text span { color: var(--muted); font-size: 12.5px; }

.nav { display: flex; align-items: center; gap: 20px; font-size: 14px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 500; }
.who { color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; line-height: 1.3; }
.who em { font-style: normal; color: var(--ink); font-weight: 700; }
.signout { color: var(--muted) !important; font-weight: 400 !important; }
.signout-form { display: inline; margin: 0; }
button.signout { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
button.signout:hover { text-decoration: underline; }

.page { max-width: 1240px; margin: 0 auto; padding: 26px 28px; }
.foot {
  max-width: 1240px; margin: 0 auto; padding: 8px 28px 32px;
  color: var(--muted); font-size: 12.5px;
}

/* ---- Headings and cards ---- */
h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.015em; }
h2 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.lede { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px;
}
.card.tight { padding: 14px 18px; }
.narrow { max-width: 440px; margin: 56px auto; }

/* ---- Forms ---- */
label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
span.label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus {
  outline: 3px solid var(--navy-soft); border-color: var(--navy);
}
.field { margin-bottom: 15px; }
.hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }

button, .btn {
  display: inline-block; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.btn-accent { background: var(--orange); border-color: var(--orange); }
.btn-accent:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-secondary:hover { background: var(--navy-soft); color: var(--navy-deep); }
.btn-quiet { background: #fff; color: var(--muted); border-color: var(--line-strong); font-weight: 500; }
.btn-quiet:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: #fff; color: var(--bad); border-color: #e6c4c4; }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
button.small, .btn.small { padding: 5px 11px; font-size: 13px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---- Notices ---- */
.notice { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.notice-error { background: var(--bad-soft); color: var(--bad); border: 1px solid #f0cfcf; }
.notice-warn  { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0e0c0; }
.notice-ok    { background: var(--ok-soft); color: var(--ok); border: 1px solid #c8e6d2; }
.notice-info  { background: var(--navy-soft); color: var(--navy-deep); border: 1px solid #cfe0f0; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; white-space: nowrap;
  background: var(--bg); border-bottom: 1px solid var(--line-strong);
}
tbody tr:hover { background: #fafbfc; }
td.nowrap, th.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

th a.sort { color: var(--muted); text-decoration: none; display: inline-flex; gap: 4px; }
th a.sort:hover { color: var(--navy); }
th a.sort .arrow { color: var(--orange); font-size: 10px; }

/* A sortable heading on the administration lists. Every heading carries the
   control, so an unsorted column shows a faint two-way mark rather than
   nothing: a column that looks inert is a column nobody discovers is
   sortable. */
a.colsort {
  color: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
a.colsort:hover { color: var(--navy); }
a.colsort.on { color: var(--navy); }
a.colsort .sortmark { font-size: 9px; opacity: .35; }
a.colsort:hover .sortmark { opacity: .7; }
a.colsort.on .sortmark { color: var(--orange); opacity: 1; }

/* The audit log.

   Six columns of wildly different shapes: an integer, a fixed-width timestamp,
   an email address, a dotted action name, a phrase and a sentence. Left to the
   browser, the table sized itself to the longest detail on the page — often a
   single 300-character line — and squeezed the other five to nothing while the
   timestamp wrapped mid-value.

   table-layout:fixed takes the decision away from the content: each column is
   the width set below whatever is in it. The two that must not wrap are held at
   their natural width, and the three that carry prose wrap and break on long
   runs, so one unbroken identifier cannot widen a column. */
table.auditlog { table-layout: fixed; width: 100%; min-width: 1040px; }
table.auditlog th, table.auditlog td {
  vertical-align: top;
  overflow-wrap: anywhere;   /* a 60-character token breaks rather than pushes */
  word-break: normal;
  white-space: normal;
  line-height: 1.35;
}
table.auditlog .c-id     { width: 72px;  text-align: right; white-space: nowrap; }
table.auditlog .c-at     { width: 176px; white-space: nowrap; }
table.auditlog .c-actor  { width: 190px; }
table.auditlog .c-action { width: 150px; }
table.auditlog .c-target { width: 26%; }
table.auditlog .c-detail { width: auto; }
/* The timestamp is the one value read by comparing digits down a column, so it
   is set in a face whose digits line up. */
table.auditlog .c-at time { font-variant-numeric: tabular-nums; font-size: 12px; }

td.pick, th.pick { width: 34px; text-align: center; padding-right: 0; }
/* "Certificate downloaded": a heading several words long over a column one
   checkbox wide, so the heading is allowed to wrap and set the width. */
th.got { width: 76px; white-space: normal; line-height: 1.15; font-size: 11px; }
/* The box is disabled because it reports rather than sets, and a browser draws
   a disabled checkbox in grey whatever accent-color says. It is drawn here
   instead, so a ticked box reads as ticked. */
td.got input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; margin: 0; vertical-align: middle;
  border: 1.5px solid var(--line-strong); border-radius: 3px; background: #fff;
  cursor: default;
}
td.got input[type=checkbox]:checked { background: var(--navy); border-color: var(--navy); }
td.got input[type=checkbox]:checked::after {
  content: "✓"; display: block; color: #fff;
  font-size: 11px; line-height: 12px; text-align: center;
}
input[type=checkbox] { width: auto; accent-color: var(--navy); }

.doc-title { font-weight: 700; color: var(--navy); text-decoration: none; display: inline-block; }
.doc-title:hover { text-decoration: underline; }
.doc-file { color: var(--muted); font-size: 12px; display: block; margin-top: 1px; }

/* ---- Filter bar ---- */
.filterbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filterbar .grow { flex: 1 1 220px; min-width: 180px; }
.daterange { display: flex; gap: 10px; flex: 0 0 auto; }
.daterange .field { flex: 0 0 182px; }
.daterange label { white-space: nowrap; }

.dropdown { position: relative; }
.dropdown > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: " ▾"; color: var(--muted); }
.dropdown[open] > summary { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.dropdown .panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  min-width: 250px; max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(21, 37, 72, .12); padding: 8px;
}
.dropdown .panel label {
  display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13.5px;
  padding: 5px 6px; margin: 0; border-radius: 4px; cursor: pointer;
}
.dropdown .panel label:hover { background: var(--bg); }
.dropdown .panel .empty { color: var(--muted); font-size: 13px; padding: 6px; }
/* A card whose subject is currently in force, so that the state of the portal
   is visible from across the room rather than only in the wording. */
.card-locked { border-color: #e6c4c4; background: var(--bad-soft); }
.card-locked .notice-warn { background: #fff; }

/* Bulk customer reassignment on the administration certificates page. The
   control sits in the heading of the column it changes, so the reader can see
   what the button will alter directly beneath it. */
.bulkassign { display: flex; flex-direction: column; gap: 6px; }
.bulkassign .colhead { margin: 0; font: inherit; color: inherit; }
.bulkassign-controls { display: flex; gap: 6px; align-items: center; }
.bulkassign-controls select {
  flex: 1 1 auto; min-width: 150px; padding: 5px 7px; font-size: 12.5px;
  text-transform: none; letter-spacing: 0;
}
.bulkassign-controls button { flex: 0 0 auto; white-space: nowrap; }

/* The role names are several words long, so the select is given the column
   rather than a default width that truncates them mid-word. */
td select[name="role"] { width: 100%; min-width: 190px; }

/* Field permissions on User management. It sits inside a table cell, so the
   panel flows in place rather than floating over the row below it. */
.fieldgrant { margin-top: 6px; }
.fieldgrant > summary {
  cursor: pointer; user-select: none; font-size: 12.5px; color: var(--muted);
}
.fieldgrant > summary:hover { color: var(--navy); }
.fieldgrant .panel {
  margin-top: 6px; padding: 8px; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.fieldgrant .panel label {
  display: flex; align-items: center; gap: 7px;
  font-weight: 400; font-size: 12.5px; margin: 0 0 3px;
}
.fieldgrant .panel button { margin-top: 6px; }

.count-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  background: var(--orange); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 17px;
}

/* ---- Pills and tags ---- */
.pill { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.pill-pending { background: var(--warn-soft); color: var(--warn); border-color: #f0e0c0; }
.pill-active  { background: var(--ok-soft); color: var(--ok); border-color: #c8e6d2; }
.pill-disabled{ background: #f0f2f5; color: var(--muted); }
.pill-locked  { background: var(--bad-soft); color: var(--bad); border-color: #f0cfcf; }
.pill-ocr { background: var(--orange-soft); color: #94500a; border-color: #f6ddc0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--navy-soft); color: var(--navy-deep); border: 1px solid #d6e2ef;
}
.tag-plain { background: #f0f2f5; color: var(--muted); border-color: var(--line); }

.meta { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 7px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.text {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; white-space: pre-wrap; font-size: 12.5px; max-height: 420px; overflow: auto;
}

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1 1 130px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 13px; }

/* The pager belongs to the table above it, and the card below it is a separate
   section. 16px above and the same below left the Previous and Next buttons
   reading as a heading for the possible-duplicate list rather than as the foot
   of the certificate list, so the space below is the larger of the two. */
.pager {
  display: flex; gap: 10px; align-items: center;
  margin-top: 16px; margin-bottom: 34px; font-size: 14px;
}

/* ---- Selection bar above the table ---- */
.selectbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--bg-warm);
}
.selectbar .count { font-weight: 700; font-size: 13.5px; }
.selectbar .spacer { flex: 1; }

.rules { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.rules li { margin: 2px 0; }

/* ---- Multi-value cells ---- */
/* Expanded: one value per line, no separating punctuation. */
.stack { display: flex; flex-direction: column; line-height: 1.35; }
.stack > span { white-space: nowrap; }
.multiple { font-style: italic; color: var(--navy-deep); cursor: help; white-space: nowrap; }
.multiple-count {
  display: inline-block; margin-left: 5px; padding: 0 5px; white-space: nowrap;
  background: var(--navy-soft); color: var(--navy-deep); border: 1px solid #d6e2ef;
  border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 16px;
}
td { vertical-align: top; }
td.pick, td.nowrap { vertical-align: top; }

.viewtoggle { display: flex; align-items: center; gap: 8px; }

/* ---- The field-filter panel, directly beneath the search bar ---- */
details.morefilters { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.morefilters > summary {
  cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--navy);
  list-style: none;
}
details.morefilters > summary::-webkit-details-marker { display: none; }
details.morefilters > summary::before { content: "▸ "; color: var(--muted); }
details.morefilters[open] > summary::before { content: "▾ "; }

/* ---- The document preview on a held upload ---- */
/* A reviewer may be at a different computer from the uploader, so the held file
   is read here. The panel is collapsed by default: the reason and the extracted
   values answer most rows without opening the document at all. */
/* The preview sits on its own row so the document has the table's full width;
   the row above it carries the file, the reason and the actions. */
tr.previewrow > td { border-top: 0; padding-top: 0; }
tr.previewrow .actions { margin-bottom: 6px; }
details.docpreview { margin-top: 2px; }
details.docpreview > summary {
  cursor: pointer; font-weight: 700; font-size: 13px; color: var(--navy);
  list-style: none; display: inline-block;
}
details.docpreview > summary::-webkit-details-marker { display: none; }
details.docpreview > summary::before { content: "\25B8  "; color: var(--muted); }
details.docpreview[open] > summary::before { content: "\25BE  "; }
details.docpreview iframe {
  width: 100%; height: 640px; margin-top: 8px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 4px;
}
details.docpreview .meta { margin: 6px 0 0; }

/* ---- The sync section on the Upload page ---- */
table.syncstatus { width: 100%; margin-top: 12px; font-size: 14px; }
table.syncstatus th {
  width: 130px; text-align: left; vertical-align: top; font-weight: 500;
  color: var(--muted); padding: 5px 14px 5px 0; border: 0;
}
table.syncstatus td { vertical-align: top; padding: 5px 0; border: 0; }
pre.synclog {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  margin: 6px 0 12px;
}

/* ---- Administration tabs ---- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
}
.tabs a {
  padding: 9px 16px;
  font-size: 14.5px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  border: 1px solid transparent; border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--navy); background: var(--bg); }
.tabs a.on {
  color: var(--navy); background: var(--card);
  border-color: var(--line); border-bottom-color: var(--card);
}

/* ---- User management rows ---- */
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions form { display: inline; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.pill-must-change { background: var(--orange-soft); color: #94500a; border-color: #f6ddc0; }

/* Right-aligned columns: identifiers read more easily aligned on their ends. */
th.right, td.right { text-align: right; }
td.right .stack { align-items: flex-end; }

/* The account link in the top bar keeps its quiet look but reads as a link. */
a.who { text-decoration: none; }
a.who:hover em { color: var(--navy); text-decoration: underline; }

/* ---- Correcting an extracted value ----
   One form per field, laid out as a row so the box and its button read as one
   control. The box wraps under the button below a phone's width rather than
   shrinking to nothing. */
.fieldedit {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.fieldedit .field { flex: 1 1 320px; margin-bottom: 0; }
.fieldedit textarea {
  width: 100%; font-family: inherit; font-size: 14px; line-height: 1.5;
  resize: vertical;
}
.fieldedit button { flex: 0 0 auto; }

/* The possible-duplicate list is a separate section below the certificate list
   and its pager, not a continuation of either. */
#similar-customers { margin-top: 34px; }

/* A pair is two rows: its values, then the two buttons across the whole table.
   The border between them is removed so the two read as one pair, and the pair
   is separated from the next by the border under the buttons. */
#similar-customers tbody tr:not(.pairactions) > td { border-bottom: 0; padding-bottom: 2px; }
#similar-customers tr.pairactions > td { padding-top: 4px; padding-bottom: 14px; }
#similar-customers tr.pairactions:hover { background: transparent; }
.pairbuttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- On/off switch (Global customer notifications) ---- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider {
  position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 46px;
  background: #b9c2cc; border-radius: 13px; transition: background .15s;
}
.switch .slider::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s;
}
.switch input:checked + .slider { background: var(--navy); }
.switch input:checked + .slider::after { left: 23px; }
.switch input:focus-visible + .slider { outline: 2px solid #1f4e79; outline-offset: 2px; }

/* ---- Wide administration tables ----
   The user list fills the page when the window is wider than the table's
   minimum, and scrolls sideways inside its card when it is narrower. */
.page.wide { max-width: none; }
table.userlist { table-layout: fixed; width: 100%; min-width: 1340px; }
table.userlist th, table.userlist td { overflow-wrap: anywhere; vertical-align: top; }
table.userlist .c-email { width: 16%; }
table.userlist .c-first, table.userlist .c-last { width: 7%; }
table.userlist tr.group-row td { background: var(--navy-soft, #eef2f7); font-weight: 600;
  font-size: 12.5px; padding: 6px 10px; }
table.userlist tr.row-awaiting td:first-child { box-shadow: inset 3px 0 0 #e8892b; }
table.userlist .c-status { width: 115px; }
table.userlist .c-customers { width: 15%; }
table.userlist .c-ps { width: 15%; }
table.userlist .c-role { width: 14.5%; }
table.userlist .c-notify { width: 150px; }
table.userlist .c-password { width: 11.5%; }
.dropdown .panel .panel-tools { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.dropdown .panel .panel-tools input[type=text] { flex: 1 1 120px; min-width: 0; padding: 4px 6px; font-size: 12.5px; }
.ps-list { font-size: 12.5px; }
/* What an account is assigned, one to a line, above the boxes that change it. */
.assigned-list { color: #000; gap: 2px; margin-bottom: 8px; }
.badge-unconfirmed { font-size: 11px; color: #8a5a00; white-space: nowrap; }
.ps-list .psno { white-space: nowrap; }
.ps-list summary { cursor: pointer; }
/* Checkbox labels in the user table: wrapped text lines up under the text,
   not under the box. */
table.userlist label:has(> input[type=checkbox]) { display: flex; gap: 6px; align-items: flex-start; }
table.userlist label:has(> input[type=checkbox]) > input { margin-top: 3px; flex: none; }

/* ---- Process specifications ---- */
/* Process Specifications: the table fits the page. The PS title and the
   product codes wrap; the two download buttons stack when the column is
   narrow rather than pushing the table past the right edge. */
table.pslist { table-layout: auto; width: 100%; }
/* The Distribution tab: one tbody per company, a rule between companies. */
table.distlist { table-layout: auto; width: 100%; }
table.distlist tbody.distcompany { border-top: 2px solid var(--line-strong); }
table.distlist tr.addrow input { width: 100%; padding: 4px 6px; font-size: 13px; }
table.distlist td form { margin: 0; }
/* A process specification's page: its contacts. */
table.pscontacts { table-layout: auto; width: 100%; }
table.pscontacts tr.addrow input, table.pscontacts tr.addrow select { width: 100%; padding: 4px 6px; font-size: 13px; }
table.pscontacts td form { margin: 0; }
table.pslist th.c-customer { width: 14%; }
table.pslist .c-ps { width: 24%; min-width: 150px; overflow-wrap: anywhere; }
table.pslist th.c-date { width: 11%; }
table.pslist td.codes { max-width: 260px; overflow-wrap: anywhere; }
table.pslist .actions { flex-wrap: wrap; gap: 6px; }
table.pslist .actions .btn { white-space: nowrap; }
textarea[data-autogrow] { overflow: hidden; resize: vertical; min-height: 2.4em; }
/* Inside the scrolling user table a floating panel would be clipped by the
   table's own scroll box, so the panels open in place and push the row down. */
table.userlist .dropdown .panel { position: static; min-width: 0 !important; max-height: 260px;
  box-shadow: none; margin-top: 6px; }
table.schedule { width: auto; min-width: 560px; }
table.schedule td { padding: 4px 8px 4px 0; border: 0; }
table.schedule th { border: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.schedule select, table.schedule input { min-width: 110px; }

.pill-browser { background: #f3eefc; color: #5b3a9a; font-size: 10.5px; }
/* In the user table a column is narrower than a select's natural width; the
   controls fill their column rather than spilling into the next one, and hint
   text wraps. */
table.userlist select, table.userlist input[type=text], table.userlist input[type=password] { width: 100%; max-width: 100%; min-width: 0; }
table.userlist .stack > span, table.userlist .hint { white-space: normal; }

/* A card that opens and closes: the heading is the summary. */
details.card.fold > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary h2 { margin: 0; display: inline; }
details.card.fold > summary::before { content: "▸"; color: var(--muted); }
details.card.fold[open] > summary::before { content: "▾"; }

/* An element given the hidden attribute stays hidden inside a dropdown
   panel, whose labels are otherwise laid out as flex rows. */
.dropdown .panel [hidden] { display: none !important; }
.count-badge[hidden] { display: none; }
/* A dropdown at the right-hand end of a row opens leftwards, so its panel
   stays inside the card. */
.dropdown .panel.panel-end { left: auto; right: 0; }

/* Identity-mode sign-in (login_identity.html): its steps are shown and hidden
   by login.js, and a hidden button or notice must stay hidden. */
.signin [hidden] { display: none !important; }
.signin section h2 { margin-top: 0; }

/* Upload page: queries by day of the week, and the full listing's pages a day. */
table.querydays { width: auto; min-width: 60%; font-size: 14px; }
table.querydays td.right, table.querydays th.right { text-align: right; }
table.listingpages { width: auto; }
table.listingpages td, table.listingpages th { padding: 3px 4px; border: 0; }
table.listingpages th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.listingpages input[type=text] { width: 3.6em; padding: 5px 6px; text-align: right; }
.listingpages-wrap { max-width: 100%; overflow-x: auto; }
/* A setting that does not apply (one API key: no choice of how to share). */
.field.disabled > label, .field.disabled .hint { color: #8a8f98; }
.field.disabled select { background: #f1f2f4; color: #8a8f98; cursor: not-allowed; }
