/* Kiyuki Trust Center styles.
 *
 * Styling follows the 2.0 Signal prototype, 20 Oct 2026 (Will Gray: "follow
 * the signal prototype styling for everything"); before that, the prototypes'
 * login look, 16 Oct 2026. Copied, not linked: this file must stand alone.
 * Only the tokens and rules these pages use are here.
 *
 * The language, as Signal draws it:
 *   GROUND   the page colour with a faint dot grid, under a fixed top bar.
 *   RAISED   a flat face, a 2px rim running light (top-left) to dark
 *            (bottom-right), a shadow heavier below than above. Sheets, cards,
 *            buttons, the top bar's controls.
 *   WELL     pressed in: inputs, the NDA text, empty states, a switch's track.
 *   PRIMARY  the slate "ink" form: the face is the CTA colour. Never violet or
 *            the accent, which carry meaning elsewhere in the product.
 *
 * Dark is the default; light follows the operating system (no script, so no
 * toggle). A colour literal outside the token blocks is a bug.
 */

/* ---------- Fonts (self-hosted; no third-party requests) ---------- */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/be-vietnam-pro-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/be-vietnam-pro-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/be-vietnam-pro-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* ---------- Tokens: dark ---------- */
:root {
  color-scheme: dark;
  --font: "Be Vietnam Pro", Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-micro: 11.5px;
  --fs-sm:    12.5px;
  --fs-base:  13.5px;
  --fs-md:    14.5px;
  --fs-lg:    16.5px;
  --fs-xl:    21px;
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --lh-none:  1;
  --lh-tight: 1.3;
  --lh-body:  1.5;
  --tracking-tight: -.01em;
  --tracking-wide:  .12em;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-inner: 10px;
  --r-card: 14px;
  --r-sheet: 20px;

  --white: #fff;
  --black: #000;

  --bg:         #1a1f27;
  --bg-grid:    #29313d;
  --panel:      #252c37;
  --panel-2:    #2f3745;
  --border:     #46526a;
  --hairline:   #283140;
  --edge:       #48586f;
  --text:       #e6f0f8;
  --text-dim:   #a4b6c8;
  --text-faint: #75899d;
  --accent:     #6e8cff;
  --accent-soft:#232d3b;
  --violet:     #6f5bb8;
  --violet-lit: #b39cf0;
  --danger:     #e0405a;
  --acct-active:  #48b079;

  /* The CTA: slate, not a brand colour — a lit piece of the ground. */
  --cta:        #3b4658;
  --cta-lit:    #56667f;
  --on-cta:     #ffffff;

  /* The material. */
  --soft-face:      var(--panel);
  --soft-face-hi:   var(--panel-2);
  --soft-rim-top:   color-mix(in srgb, var(--panel) 86%, var(--white));
  --soft-rim-bot:   color-mix(in srgb, var(--panel) 80%, var(--black));
  --soft-ink:       rgb(0 0 0 / .6);
  --soft-sh:        0 -2px 5px rgb(255 255 255 / .07), 0 3px 5px -1px rgb(0 0 0 / .35), 0 10px 18px -4px rgb(0 0 0 / .5);
  --soft-sh-hover:  0 -2px 6px rgb(255 255 255 / .09), 0 4px 7px -1px rgb(0 0 0 / .4),  0 14px 24px -4px rgb(0 0 0 / .55);
  --soft-sh-sm:     0 -1px 4px rgb(255 255 255 / .07), 0 2px 4px -1px rgb(0 0 0 / .35), 0 7px 14px -5px rgb(0 0 0 / .45);
  --soft-sh-sm-hover: 0 -1px 4px rgb(255 255 255 / .09), 0 3px 6px -1px rgb(0 0 0 / .4), 0 10px 18px -5px rgb(0 0 0 / .5);
  --soft-sh-lg:     0 4px 8px -1px rgb(0 0 0 / .4), 0 24px 48px -12px rgb(0 0 0 / .6);
  --soft-sh-flat:   0 1px 2px rgb(0 0 0 / .3);
  --soft-well:      color-mix(in srgb, var(--panel) 85%, var(--black));
  --soft-well-sh:   inset 0 2px 4px rgb(0 0 0 / .4), inset 0 -1px 2px rgb(255 255 255 / .06);

  /* The LibreDesk support widget's launcher and chat panel (rules at the end of this file).
     One value for both schemes, as on kiyuki.ai and in APP. */
  --support-launcher-shadow: drop-shadow(0 1px 2px rgba(9, 14, 21, .14)) drop-shadow(0 4px 10px rgba(9, 14, 21, .10));
  --support-panel-shadow:    0 2px 6px rgba(9, 14, 21, .08), 0 12px 32px rgba(9, 14, 21, .14);
}

/* ---------- Tokens: light ---------- */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg:         #eceef1;
    --bg-grid:    #dbdfe5;
    --panel:      #f7f8fa;
    --panel-2:    #e4e7ec;
    --border:     #c3cad4;
    --hairline:   #d9dde3;
    --edge:       #a9b3c0;
    --text:       #2f3542;
    --text-dim:   #576070;
    --text-faint: #737d8c;
    --accent:     #2761ff;
    --accent-soft:#dee6fb;
    --violet:     #7a63c9;
    --violet-lit: #5b47a0;
    --danger:     #c8102e;
    --acct-active:  #2f724f;

    --cta:        #2e3644;
    --cta-lit:    #4a5568;
    --on-cta:     #ffffff;

    --soft-face:      #f3f4f7;
    --soft-face-hi:   #f7f8fa;
    --soft-rim-top:   #fff;
    --soft-rim-bot:   #d9dde5;
    --soft-ink:       rgb(110 120 140 / .5);
    --soft-sh:        0 -2px 5px rgb(255 255 255 / .9),  0 3px 5px -1px rgb(110 120 140 / .22), 0 10px 18px -4px rgb(110 120 140 / .38);
    --soft-sh-hover:  0 -2px 6px rgb(255 255 255 / .95), 0 4px 7px -1px rgb(110 120 140 / .26), 0 14px 24px -4px rgb(110 120 140 / .42);
    --soft-sh-sm:     0 -1px 4px rgb(255 255 255 / .9),  0 2px 4px -1px rgb(110 120 140 / .22), 0 7px 14px -5px rgb(110 120 140 / .36);
    --soft-sh-sm-hover: 0 -1px 4px rgb(255 255 255 / .95), 0 3px 6px -1px rgb(110 120 140 / .26), 0 10px 18px -5px rgb(110 120 140 / .42);
    --soft-sh-lg:     0 -2px 6px rgb(255 255 255 / .6),  0 4px 8px -1px rgb(110 120 140 / .25), 0 24px 48px -12px rgb(60 70 90 / .45);
    --soft-sh-flat:   0 1px 2px rgb(110 120 140 / .12);
    --soft-well:      #e6e9ee;
    --soft-well-sh:   inset 0 2px 4px rgb(110 120 140 / .25), inset 0 -1px 2px rgb(255 255 255 / .9);
  }
}

/* ---------- Page: the ground ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100vh; }
body {
  background-color: var(--bg);
  /* Signal's canvas ground: a faint dot every 32px. */
  background-image: radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 0);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

/* ---------- Top bar ---------- */
/* Standing chrome is solid: the ground's own colour, a rule beneath. */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.spacer { flex: 1; }
/* The wordmark, then the place, behind a rule — as Signal's brand block. */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 22px;
  border-right: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
/* The rule separates the brand from the switch; with no switch it has nothing to separate. */
.topbar:not(:has(.seg)) .brand { border-right: 0; padding-right: 0; }
.brand .logo { width: 64px; height: auto; display: block; }
.brand-sub {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.bar-who {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.bar-form { margin: 0; flex: none; }

/* The switch: a well, the chosen option the raised piece in it. */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
}
.seg a {
  padding: 6px 14px;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  color: var(--text-dim);
  text-decoration: none;
  transition: color .15s;
}
.seg a:hover { color: var(--text); }
.seg a.on {
  color: var(--text);
  background:
    linear-gradient(var(--soft-face-hi), var(--soft-face-hi)) padding-box,
    linear-gradient(165deg, var(--soft-rim-top) 15%, var(--soft-rim-bot) 85%) border-box;
  box-shadow: var(--soft-sh-sm);
}

/* ---------- Page shapes ---------- */
.page {
  width: 100%;
  margin: 0 auto;
  padding: 88px 16px 48px;
}
/* One centred sheet. */
.page--narrow, .page--wide {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.page--narrow { max-width: 448px; }
.page--wide   { max-width: 808px; }
.page--docs   { max-width: 1104px; }
.page--admin  { max-width: 1184px; }

/* A heading on the ground. */
.page-head { margin: 8px 4px 26px; }
.page-head .h, .page-head .lead { text-align: left; }
.page-head .lead { margin-bottom: 0; max-width: 72ch; }

/* ---------- Sheet: raised ---------- */
.sheet {
  width: 100%;
  padding: 28px 30px 24px;
  border: 2px solid transparent;
  border-radius: var(--r-sheet);
  background:
    linear-gradient(var(--soft-face), var(--soft-face)) padding-box,
    linear-gradient(170deg, var(--soft-rim-top) 15%, var(--soft-rim-bot) 85%) border-box;
  box-shadow: var(--soft-sh-lg);
  animation: rise .42s cubic-bezier(.22,.75,.28,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .std { animation: none; } }

.h {
  margin: 0 0 6px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -.021em;
  line-height: var(--lh-tight);
  text-align: center;
}
.lead {
  margin: 0 0 20px;
  font-size: var(--fs-base);
  color: var(--text-dim);
  text-align: center;
}
.note {
  margin: 16px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
  text-align: center;
}
.link, .linkbtn { color: var(--text-dim); text-decoration: none; }
.link:hover, .linkbtn:hover { color: var(--accent); }

/* ---------- Form ---------- */
.form { margin: 0; }
.lbl {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-dim);
}

/* Inputs are wells: a field is filled, never pressed. */
.in {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--r-inner);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.in::placeholder { color: var(--text-faint); }
.in:focus {
  border-color: var(--accent);
  box-shadow: var(--soft-well-sh), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* The primary action: the slate's brand form — the face is the CTA. */
.go {
  --ab: var(--cta);
  width: 100%;
  padding: 11px 0;
  margin-top: 4px;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--on-cta);
  border: 2px solid transparent;
  border-radius: var(--r-inner);
  background:
    linear-gradient(var(--ab), var(--ab)) padding-box,
    linear-gradient(160deg, color-mix(in srgb, var(--ab) 55%, var(--white)) 10%, color-mix(in srgb, var(--ab) 75%, var(--black)) 90%) border-box;
  box-shadow: 0 2px 3px -1px var(--soft-ink), 0 6px 12px -5px color-mix(in srgb, var(--ab) 45%, var(--soft-ink));
  cursor: pointer;
  transition: box-shadow .16s, transform .16s;
}
.go:hover {
  --ab: var(--cta-lit);
  box-shadow: 0 3px 5px -1px var(--soft-ink), 0 9px 16px -5px color-mix(in srgb, var(--ab) 50%, var(--soft-ink));
  transform: translateY(-1px);
}
.go:active { transform: none; box-shadow: var(--soft-sh-flat); }

/* Focus is not decoration: an opaque accent ring on every control. */
.go:focus-visible, .btn-quiet:focus-visible, .btn-icon:focus-visible, .link:focus-visible,
.linkbtn:focus-visible, .seg a:focus-visible, .brand:focus-visible, .nda:focus-visible, .std-h-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A raised control: sign out, search, row actions. */
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: var(--lh-none);
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  background:
    linear-gradient(var(--soft-face-hi), var(--soft-face-hi)) padding-box,
    linear-gradient(160deg, var(--soft-rim-top) 15%, var(--soft-bot, var(--soft-rim-bot)) 85%) border-box;
  box-shadow: var(--soft-sh-sm);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .16s, transform .16s;
}
.btn-quiet:hover, .btn-icon:hover {
  --soft-bot: color-mix(in srgb, var(--accent) 55%, var(--white));
  box-shadow: var(--soft-sh-sm-hover);
  transform: translateY(-1px);
}
.btn-quiet:active, .btn-icon:active { transform: none; box-shadow: var(--soft-sh-flat); }
/* In the top bar, the face matches the bar's other raised controls. */
.btn-bar { height: 34px; }

/* A square glyph control: the top bar's icon-button size, raised. */
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 34px;
  padding: 0;
  color: var(--text-dim);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  background:
    linear-gradient(var(--soft-face-hi), var(--soft-face-hi)) padding-box,
    linear-gradient(160deg, var(--soft-rim-top) 15%, var(--soft-bot, var(--soft-rim-bot)) 85%) border-box;
  box-shadow: var(--soft-sh-sm);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .16s, transform .16s, color .13s;
}
.btn-icon:hover { color: var(--text); }
.ico { width: 15px; height: 15px; display: block; fill: currentColor; }

/* ---------- Sign-in code ---------- */
.who { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); }
.in--code {
  font-family: var(--mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  letter-spacing: .4em;
  text-indent: .4em; /* balances the trailing letter-spacing so the digits sit centred */
  text-align: center;
}
.err {
  margin: 0 0 16px;
  padding: 9px 12px;
  border-radius: var(--r-inner);
  font-size: var(--fs-sm);
  color: var(--text);
  background: color-mix(in srgb, var(--danger) 16%, var(--soft-well));
  text-align: center;
}
.form--inline .note { margin-top: 16px; }
/* A form button that reads as a link: "Send a new code" must POST. Every
   property a browser gives a button by default is reset here, so it renders
   exactly as the .link beside it; colour, hover and focus ring are shared
   with .link above, so the two cannot drift apart. */
.linkbtn {
  -webkit-appearance: none;
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  line-height: normal; /* a button lays out as inline-block: this makes its box, and so its focus ring, the height of the inline link's */
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  text-decoration: none;
  vertical-align: baseline;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

/* ---------- NDA: a well, text to read ---------- */
.nda {
  max-height: 50vh;
  overflow: auto;
  padding: 16px 20px;
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
  font-size: var(--fs-base);
  color: var(--text);
}
.nda h2, .nda h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: 12px 0 6px; }
.nda p, .nda li { color: var(--text-dim); }
.nda ol, .nda ul { margin: 6px 0 10px; padding-left: 24px; }
.nda li + li { margin-top: 4px; }
.nda :first-child { margin-top: 0; }

/* ---------- Documents: one raised card per standard, on the ground ---------- */
.stds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px; /* room for each card's shadow, so none lands on the next */
}
.std {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 18px 16px;
  border: 2px solid transparent;
  border-radius: var(--r-card);
  background:
    linear-gradient(var(--soft-face), var(--soft-face)) padding-box,
    linear-gradient(165deg, var(--soft-rim-top) 15%, var(--soft-rim-bot) 85%) border-box;
  box-shadow: var(--soft-sh);
  animation: rise .42s cubic-bezier(.22,.75,.28,1) both;
}
.std-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
/* The icon sits IN the card: a small well. */
.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: var(--text-dim);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
}
.std-head-text { min-width: 0; flex: 1 1 auto; }
/* The eye to the standard's page sits at the head's right. */
.std-open { flex: none; }
.std-h-link { color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.std-h-link:hover { color: var(--accent); }
.std-h {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
}
.std-d {
  margin: 3px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.std-empty {
  margin: auto 0 0; /* sits at the foot, so empty cards in a row line up */
  padding: 14px 12px;
  border-radius: var(--r-lg);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
  font-size: var(--fs-sm);
  color: var(--text-faint);
  text-align: center;
}
.std-docs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.std-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-top: 1px solid var(--hairline);
}
.std-doc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.std-doc-title { font-weight: var(--fw-medium); color: var(--text); overflow-wrap: anywhere; }
.std-doc-meta { font-family: var(--mono); font-size: var(--fs-micro); color: var(--text-faint); }
.std-doc-acts { display: flex; gap: 8px; flex: none; }
/* A card's foot: the count, and Download all. Sits at the foot so cards in a row line up. */
.std-foot, .std-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.std-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hairline); }
.std-bar { padding: 0 2px 12px; }
.std-count { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); }
.btn-all { gap: 8px; height: 34px; }
/* A standard's own page: one wide card under the heading. */
.std--page { margin-bottom: 18px; }
.std--page .std-empty { margin: 0; }
.back { margin: 0 4px 14px; }
.back .link { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
/* Each part of "DOC-001 · Version 0.1 · 2026-10-20" stays whole; the line breaks only between parts. */
.nowrap { white-space: nowrap; }

/* ---------- Document modal (20 Oct 2026; no script) ----------
 * The documents page with a dialog drawn over it: a dimmed backdrop (a link back
 * to /documents) and a raised sheet framing the PDF. On a phone the frame is
 * hidden and Open / Download are shown large instead (see Narrow screens). */
body:has(.modal) { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 40%, var(--black) 60%);
  opacity: .72;
  cursor: default;
}
.modal-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(92vh, 100%);
  padding: 16px 18px 12px;
  border: 2px solid transparent;
  border-radius: var(--r-sheet);
  background:
    linear-gradient(var(--soft-face), var(--soft-face)) padding-box,
    linear-gradient(170deg, var(--soft-rim-top) 15%, var(--soft-rim-bot) 85%) border-box;
  box-shadow: var(--soft-sh-lg);
  animation: rise .3s cubic-bezier(.22,.75,.28,1) both;
}
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.modal-head-text { flex: 1 1 auto; min-width: 0; }
.modal-h {
  margin: 0 0 2px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
}
.modal-head .std-doc-meta { margin: 0; }
.modal-acts { display: flex; gap: 8px; flex: none; }
.modal-dl { height: 34px; gap: 8px; }
/* The PDF sits in a well: the frame is read, not pressed. */
.modal-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
}
.modal-phone { display: none; }
.modal-fallback {
  margin: 10px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
  text-align: center;
}
@media (prefers-reduced-motion: reduce) { .modal-sheet { animation: none; } }

/* Wells for "nothing here". */
.empty {
  padding: 28px 16px;
  border-radius: var(--r-lg);
  background: var(--soft-well);
  box-shadow: var(--soft-well-sh);
  text-align: center;
}
.empty-h { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-medium); }
.empty .note { margin-top: 6px; }
/* The documents page's no-manifest state is a sheet on the ground. */
.sheet.empty { background:
    linear-gradient(var(--soft-face), var(--soft-face)) padding-box,
    linear-gradient(170deg, var(--soft-rim-top) 15%, var(--soft-rim-bot) 85%) border-box;
  box-shadow: var(--soft-sh-lg); padding: 36px 16px; }

/* ---------- Admin (ADR-0055): sheets of flat tables ---------- */
.group + .group { margin-top: 24px; }
.group { padding: 20px 22px 18px; }
.group-h {
  margin: 0 0 12px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
}
.group form:last-child, .group .row-form { margin-bottom: 0; }
.dim { color: var(--text-faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.note--left { text-align: left; margin: 0 0 10px; }
.link--strong { color: var(--text); font-weight: var(--fw-medium); }
.notice {
  margin: 0 0 20px;
  padding: 9px 12px;
  border-radius: var(--r-inner);
  font-size: var(--fs-sm);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--soft-well));
  box-shadow: var(--soft-well-sh);
  text-align: center;
}
.page--admin > .err { margin-bottom: 20px; }
.addform {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0 12px;
  align-items: end;
}
.addform .go { width: auto; padding: 10px 20px; margin: 0 0 16px; }
.searchform { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.searchform .in { margin: 0; }
.searchform .btn-quiet { flex: none; height: 38px; }

/* Signal's table: tracked micro headers over a rule, hairlines between rows. */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.tbl th {
  padding: 10px 12px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 11px 12px;
  vertical-align: top;
  color: var(--text-dim);
  border-bottom: 1px solid var(--hairline);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.tbl td:first-child { color: var(--text); }
.tbl .num { text-align: right; }
.tbl td.num { font-family: var(--mono); }
.tbl code { font-family: var(--mono); font-size: var(--fs-micro); }
.row-form { margin: 0; }
.row-form .btn-quiet { height: 28px; padding: 0 10px; white-space: nowrap; }
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  font-weight: var(--fw-medium);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.tag--off  { background: color-mix(in srgb, var(--text-faint) 22%, transparent); }
.tag--lock { background: color-mix(in srgb, var(--violet-lit) 30%, transparent); }
.tag--view { background: color-mix(in srgb, var(--text-faint) 22%, transparent); }
/* Where access came from (Apex / Manual): an outline, so it never reads as a status. */
.tag--src  { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-dim); }
/* A draft published by PUBLISH_DRAFTS (test phase only): the same outline, beside a title or count. */
.tag--draft { margin-left: 6px; vertical-align: 0.1em; font-family: inherit; letter-spacing: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Narrow screens ---------- */
@media (max-width: 720px) {
  /* Phones: near full-screen, no frame (mobile browsers often cannot draw a PDF
     in one; the frame is lazy, so hidden it never loads or logs), Open and
     Download large instead. */
  .modal { padding: 10px; }
  .modal-sheet { height: auto; max-height: 100%; overflow: auto; padding: 16px 14px 14px; }
  .modal-frame { display: none; }
  .modal-dl { display: none; }
  .modal-phone { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
  .modal-phone .go, .modal-phone .btn-quiet {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 16px; margin: 0; text-decoration: none; font-size: var(--fs-md);
  }
  .addform { grid-template-columns: 1fr; }
  .addform .go { width: 100%; }
  .topbar { gap: 12px; padding: 0 16px; }
  .brand { padding-right: 12px; }
  .bar-who { display: none; }
}
@media (max-width: 480px) {
  .sheet { padding: 24px 18px 20px; }
  .group { padding: 18px 16px 16px; }
  .brand-sub { display: none; }
  .brand { border-right: 0; padding-right: 0; }
  .seg a { padding: 6px 10px; }
  .page { padding-top: 80px; }
}

/* LibreDesk support widget (help.kiyuki.ai/widget.js, v2.9.0): the script sets a 90%-black drop shadow inline on its launcher button and its chat panel. No class or id on the button, so it is matched by its aria-controls, which points at the panel's id. !important is needed to beat the inline style. Same two rules as kiyuki.ai (CMS public/site.css, 7acc6fa). Re-check these selectors after a LibreDesk upgrade. */
button[aria-controls^="libredesk-widget-"] {
  filter: var(--support-launcher-shadow) !important;
}
iframe[id^="libredesk-widget-"] {
  box-shadow: var(--support-panel-shadow) !important;
}
