/* Liso: a certificate manager.
   The recurring motif is the lifespan strip: a certificate's life drawn as a line, with the
   renewal window hatched in amber and a marker for today. Everything else stays quiet. */

:root {
  --paper: #eef2f1;
  --surface: #fbfcfb;
  --sunken: #e3e9e7;
  --ink: #12262e;
  --ink-soft: #1e3640;
  --on-ink-accent: #f2c872;
  --on-ink: #f2f6f5;
  --muted: #4f656d;
  --line: #c9d5d2;
  --line-strong: #98aca8;

  --ok: #0e7c66;
  --ok-tint: #d3ebe4;
  --ok-ink: #0a5d4c;
  --warn: #b7791f;
  --warn-tint: #f6e6c4;
  --warn-ink: #774800;
  --bad: #b42318;
  --bad-tint: #f8dbd7;
  --bad-ink: #8c1a11;
  --info: #2c5f9e;
  --info-tint: #dbe7f5;
  --info-ink: #1d4777;

  --focus: #2c5f9e;
  --shadow: 0 1px 2px rgb(18 38 46 / 0.08), 0 8px 24px -12px rgb(18 38 46 / 0.25);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --measure: 66ch;
  --page: 1060px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d191d;
    --surface: #132126;
    --sunken: #0a1316;
    --ink: #e5eeec;
    --ink-soft: #c5d4d1;
    --on-ink-accent: #8a5600;
    --on-ink: #0d191d;
    --muted: #93a9a9;
    --line: #26393e;
    --line-strong: #3d555b;

    --ok: #3fbf9f;
    --ok-tint: #11382f;
    --ok-ink: #7fe3c6;
    --warn: #e0a63a;
    --warn-tint: #3a2d12;
    --warn-ink: #f2c872;
    --bad: #f0766a;
    --bad-tint: #43201d;
    --bad-ink: #ffa097;
    --info: #7fabe3;
    --info-tint: #172c46;
    --info-ink: #a9c9f0;

    --focus: #7fabe3;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { 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(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--info-tint); color: var(--info-ink); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- type ------------------------------------------------------------- */

.display, h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; letter-spacing: -0.005em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono, code, pre, kbd { font-family: var(--mono); font-size: 0.86rem; font-variant-ligatures: none; }
.lede { font-size: 1.1rem; line-height: 1.55; max-width: var(--measure); color: var(--ink-soft); text-wrap: pretty; }
p { max-width: var(--measure); text-wrap: pretty; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ---- shell ------------------------------------------------------------ */

.shell-bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.shell-bar__inner {
  max-width: var(--page); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 28px; min-height: 60px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 650 1.35rem/1 var(--serif); letter-spacing: -0.02em; padding: 14px 0; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__link {
  position: relative; padding: 19px 12px 17px; text-decoration: none; color: var(--muted);
  font-weight: 560; white-space: nowrap; border-bottom: 3px solid transparent;
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.shell-bar__user { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 0.875rem; color: var(--muted); }
.shell-bar__user .break { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: var(--page); margin: 0 auto; padding: 36px 20px 96px; }
.page:focus { outline: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-header__text { min-width: 0; display: grid; gap: 8px; }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumb { font-size: 0.875rem; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.crumb:hover { color: var(--ink); text-decoration: underline; }

.section { margin-top: 44px; }
.section > h2 { margin-bottom: 6px; }
.section__intro { color: var(--muted); margin-bottom: 18px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack--lg { gap: 28px; }
.stack--sm { gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---- buttons ------------------------------------------------------------ */

.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--btn-line);
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; white-space: nowrap; transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { --btn-bg: var(--sunken); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--primary { --btn-bg: var(--ink); --btn-fg: var(--on-ink); --btn-line: var(--ink); }
.btn--primary:hover { --btn-bg: var(--ink-soft); --btn-line: var(--ink-soft); }
.btn--danger { --btn-fg: var(--bad-ink); --btn-line: var(--bad); }
.btn--danger:hover { --btn-bg: var(--bad-tint); }
.btn--solid-danger { --btn-bg: var(--bad); --btn-fg: var(--on-ink); --btn-line: var(--bad); }
.btn--solid-danger:hover { --btn-bg: var(--bad-ink); --btn-line: var(--bad-ink); }
.btn--quiet { --btn-bg: transparent; --btn-line: transparent; }
.btn--quiet:hover { --btn-bg: var(--sunken); }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn__spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- chips, badges, alerts ----------------------------------------------- */

.chip {
  --c: var(--muted); --c-bg: var(--sunken);
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--c-bg); color: var(--c); font-weight: 650; font-size: 0.8rem; white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip--ok { --c: var(--ok-ink); --c-bg: var(--ok-tint); }
.chip--warn { --c: var(--warn-ink); --c-bg: var(--warn-tint); }
.chip--warn::before { border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.chip--bad { --c: var(--bad-ink); --c-bg: var(--bad-tint); }
.chip--bad::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.chip--info { --c: var(--info-ink); --c-bg: var(--info-tint); }
.chip--busy::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 0.78rem; font-weight: 560; white-space: nowrap;
}
.badge--warn { border-color: var(--warn); color: var(--warn-ink); background: var(--warn-tint); }
.badge--ok { border-color: var(--ok); color: var(--ok-ink); background: var(--ok-tint); }

.alert {
  --a: var(--info); --a-bg: var(--info-tint); --a-ink: var(--info-ink);
  display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius); border-left: 4px solid var(--a);
  background: var(--a-bg); color: var(--a-ink); max-width: 78ch;
}
.alert--ok { --a: var(--ok); --a-bg: var(--ok-tint); --a-ink: var(--ok-ink); }
.alert--warn { --a: var(--warn); --a-bg: var(--warn-tint); --a-ink: var(--warn-ink); }
.alert--bad { --a: var(--bad); --a-bg: var(--bad-tint); --a-ink: var(--bad-ink); }
.alert__title { font-weight: 700; }
.alert p, .alert ul { max-width: none; }
.alert ul { list-style: disc; padding-left: 1.2em; }
.alert pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 0.82rem; }

/* ---- the lifespan strip ----------------------------------------------------- */

.strip { --now: 0%; --renew: 66.667%; --ok-w: 0%; --warn-w: 0%; --bad-w: 0%; position: relative; height: 24px; }
.strip__track { position: absolute; inset: 8px 0; border-radius: 3px; overflow: hidden; background: var(--sunken); }
.strip__safe { position: absolute; left: 0; top: 0; bottom: 0; width: var(--renew); background: var(--ok-tint); }
.strip__window {
  position: absolute; left: var(--renew); right: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, var(--warn-tint) 0 4px, color-mix(in srgb, var(--warn) 55%, var(--warn-tint)) 4px 6px);
}
.strip__fill { position: absolute; top: 0; bottom: 0; transform-origin: left center; animation: strip-grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.strip__fill--ok { left: 0; width: var(--ok-w); background: var(--ok); }
.strip__fill--warn { left: var(--renew); width: var(--warn-w); background: var(--warn); }
.strip__fill--bad { left: 0; width: var(--bad-w); background: var(--bad); }
@keyframes strip-grow { from { transform: scaleX(0); } }
.strip__now {
  position: absolute; top: 0; bottom: 0; left: var(--now); width: 3px; margin-left: -1.5px;
  background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--paper);
}
.strip--pending .strip__track { background: repeating-linear-gradient(90deg, var(--sunken) 0 6px, transparent 6px 10px); }
.strip--compact { height: 18px; }
.strip--compact .strip__track { inset: 5px 0; }
.strip--large { height: 34px; }
.strip--large .strip__track { inset: 11px 0; border-radius: 4px; }
.strip--large .strip__now { width: 4px; margin-left: -2px; }

.lifespan { display: grid; gap: 14px; }
.lifespan__dates { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.lifespan__date { display: grid; gap: 1px; }
.lifespan__date dt { color: var(--muted); font-size: 0.82rem; display: flex; gap: 7px; align-items: center; }
.lifespan__date dd { font-weight: 650; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
.swatch--safe { background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok); }
.swatch--window { background: repeating-linear-gradient(135deg, var(--warn-tint) 0 3px, var(--warn) 3px 4px); box-shadow: inset 0 0 0 1px var(--warn); }
.swatch--expiry { background: var(--bad); }

/* ---- certificate ledger ------------------------------------------------------- */

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 0 14px; min-height: 38px; font-weight: 600; font-size: 0.86rem; color: var(--muted); border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.segmented button:not([aria-pressed="true"]):hover { background: var(--sunken); color: var(--ink); }
.search { flex: 1; min-width: 200px; max-width: 360px; }

.ledger { border-top: 1px solid var(--ink); }
.ledger__row {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.35fr) 150px; gap: 8px 28px; align-items: center;
  padding: 18px 10px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.ledger__row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.ledger__row:hover .ledger__domain { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ledger__name { display: grid; gap: 4px; min-width: 0; }
.ledger__domain { font: 600 1.28rem/1.2 var(--serif); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ledger__names { color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.ledger__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ledger__life { display: grid; gap: 4px; min-width: 0; }
.ledger__headline { font-size: 0.88rem; color: var(--ink-soft); }
.ledger__status { justify-self: end; }

/* ---- forms ---------------------------------------------------------------------- */

.form { display: grid; gap: 30px; max-width: 760px; }
.form-section { display: grid; gap: 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section > legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font: 600 1.2rem/1.2 var(--serif); }
.form-section > legend + * { clear: both; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 620; }
.field__hint { color: var(--muted); font-size: 0.86rem; max-width: 62ch; }
.field__error { color: var(--bad-ink); font-size: 0.86rem; font-weight: 560; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field--invalid .input, .field--invalid .select, .field--invalid .chips { border-color: var(--bad); }
.input--mono { font-family: var(--mono); font-size: 0.88rem; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.check__text { display: grid; gap: 2px; }
.check__title { font-weight: 600; }
.check__hint { color: var(--muted); font-size: 0.86rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: text; }
.chips:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.chips__input { flex: 1; min-width: 140px; border: 0; background: transparent; padding: 6px; outline: none; }
.token {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: var(--radius);
  background: var(--sunken); border: 1px solid var(--line); font-size: 0.9rem;
}
.token button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 3px; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.token button:hover { background: var(--line); color: var(--ink); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.86rem; }
.quick button { border: 1px dashed var(--line-strong); background: transparent; border-radius: var(--radius); padding: 2px 10px; min-height: 28px; font-size: 0.86rem; }
.quick button:hover { background: var(--sunken); border-style: solid; }

.choices { display: grid; gap: 10px; }
.choice { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.choice:hover { border-color: var(--muted); }
.choice:has(> .choice__head > input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice:has(> .choice__head > input:disabled) { opacity: 0.6; }
.choice__head { display: grid; grid-template-columns: 22px 1fr; gap: 4px 12px; padding: 14px 16px; cursor: pointer; }
.choice__head:has(input:disabled) { cursor: not-allowed; }
.choice__head input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.choice__title { font-weight: 650; }
.choice__body { grid-column: 2; color: var(--muted); font-size: 0.88rem; max-width: 60ch; }
.choice__extra { margin: -4px 16px 16px 50px; display: grid; gap: 10px; }
.preview { padding: 10px 14px; background: var(--sunken); border-radius: var(--radius); font-size: 0.9rem; overflow-wrap: anywhere; }
.preview__label { color: var(--muted); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; }

/* ---- tables and key/value lists ---------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunken); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table--files td:first-child { white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.copyable { display: flex; align-items: flex-start; gap: 8px; }
.copyable code { flex: 1; min-width: 0; word-break: break-all; background: var(--sunken); padding: 5px 8px; border-radius: 3px; }

.code { position: relative; min-width: 0; max-width: 100%; background: var(--ink); color: var(--on-ink); border-radius: var(--radius); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 0.82rem; line-height: 1.6; tab-size: 2; }
.code__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent); font-size: 0.82rem; color: color-mix(in srgb, var(--on-ink) 75%, transparent); }
.code .btn { --btn-bg: transparent; --btn-fg: var(--on-ink); --btn-line: color-mix(in srgb, var(--on-ink) 35%, transparent); }
.code .btn:hover { --btn-bg: color-mix(in srgb, var(--on-ink) 14%, transparent); }

.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px; }
.panel--accent { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }
.panel--danger { border-color: var(--bad); }
.panel > h2, .panel > h3 { margin-bottom: 8px; }

.list { border-top: 1px solid var(--line); }
.list__item { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list__main { min-width: 0; display: grid; gap: 2px; }
.list__title { font-weight: 650; overflow-wrap: anywhere; }
a.list__item { text-decoration: none; color: inherit; }
a.list__item:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }

.feed__item { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.feed__glyph { width: 12px; height: 12px; margin: 6px 0 0 6px; border-radius: 50%; background: var(--muted); }
.feed__glyph--success { background: var(--ok); }
.feed__glyph--warning { background: var(--warn); border-radius: 2px; transform: rotate(45deg) scale(0.85); }
.feed__glyph--error { background: var(--bad); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.feed__time { color: var(--muted); font-size: 0.84rem; white-space: nowrap; }
.feed__where { color: var(--muted); font-size: 0.84rem; }

.empty { display: grid; gap: 14px; justify-items: start; padding: 48px 4px; border-top: 1px solid var(--ink); }
.empty h2 { font-size: 1.5rem; }
.progress { height: 4px; background: var(--sunken); border-radius: 2px; overflow: hidden; max-width: 340px; }
.progress::after { content: ""; display: block; height: 100%; width: 38%; background: var(--ink); border-radius: 2px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* ---- dialog and toasts ---------------------------------------------------------------------- */

dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(8 20 24 / 0.55); }
.dialog__body { padding: 24px 24px 8px; display: grid; gap: 10px; }
.dialog__actions { padding: 16px 24px 24px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; cursor: pointer; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 560; display: flex; gap: 10px; align-items: flex-start; border-left: 4px solid var(--ink-soft); animation: toast-in 0.18s ease-out; }
.toast--bad { background: var(--bad-tint); color: var(--bad-ink); border-left-color: var(--bad); }
.toast--ok { background: var(--ok-tint); color: var(--ok-ink); border-left-color: var(--ok); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---- sign in ------------------------------------------------------------------------------------ */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.auth__intro { padding: 56px clamp(24px, 5vw, 72px); display: grid; align-content: center; gap: 28px; background: var(--ink); color: var(--on-ink); }
.auth__intro .brand { padding: 0; color: inherit; }
.auth__intro h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.5rem); max-width: 15ch; }
.auth__intro .lede { color: color-mix(in srgb, var(--on-ink) 82%, transparent); }
.auth__demo { display: grid; gap: 12px; max-width: 520px; margin-top: 8px; }
.auth__demo .strip { --paper: var(--ink); }
.auth__demo .strip__track { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.auth__demo .strip__safe { background: color-mix(in srgb, var(--ok) 40%, transparent); }
.auth__demo .strip__now { background: var(--on-ink); }
.auth__captions { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: color-mix(in srgb, var(--on-ink) 78%, transparent); }
.auth__captions span:nth-child(2) { text-align: center; color: var(--on-ink-accent); }
.auth__captions span:last-child { text-align: right; }
.auth__form { padding: 56px clamp(24px, 5vw, 72px); display: grid; align-content: center; justify-items: start; gap: 22px; }
.auth__form .form { width: 100%; max-width: 420px; gap: 18px; }
.auth__tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); width: 100%; max-width: 420px; }
.auth__tab { border: 0; background: transparent; padding: 10px 0 11px; font: 600 1.05rem var(--serif); color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.auth__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- small screens ----------------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__intro { padding-block: 36px 40px; }
  .auth__form { padding-block: 36px 56px; }
}
@media (max-width: 760px) {
  .ledger__row { grid-template-columns: 1fr auto; padding-inline: 4px; }
  .ledger__life { grid-column: 1 / -1; grid-row: 2; }
  .ledger__status { grid-column: 2; grid-row: 1; align-self: start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .shell-bar__inner { gap: 4px 16px; }
  .shell-bar__user { order: 2; }
  .nav { order: 3; flex-basis: 100%; margin-inline: -8px; }
  .nav__link { padding-block: 12px 10px; }
  .page { padding-top: 24px; }
  .panel { padding: 16px; }
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table--stack td { display: block; border: 0; padding: 4px 14px; }
  .table--stack td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.8rem; }
  .table--files td::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- brand mark ---------------------------------------------------------------------------------------- */
.mark-bg { fill: var(--ink); }
.mark-ok { fill: var(--ok); }
.mark-warn { fill: var(--warn); }
.mark-now { fill: var(--on-ink); }
.auth__intro .mark-bg { fill: var(--on-ink); }
.auth__intro .mark-now { fill: var(--ink); }
.view-error { display: grid; gap: 14px; justify-items: start; padding: 48px 0; }

.hint-list { margin-top: 18px; }
.hint-list > h3 { margin-bottom: 8px; }
