/*
 * Lynent design foundation. Shared by every page (marketing, auth, dashboard, checkout, docs, legal).
 *
 * Load order in each <head>:
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 *   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap">
 *   <link rel="stylesheet" href="/assets/tokens.css">
 *   <link rel="stylesheet" href="/your/page.css">
 *   <script src="/assets/motion.js"></script>   (no defer: it only flags <html> and waits for DOMContentLoaded)
 *
 * Rules: monochrome only. Status colours (--ok, --warn, --bad) are for badges, notices and toasts.
 * No gradients except .skeleton. No shadows, no backdrop-filter. Radius 4px controls, 6px panels.
 * Fonts are loaded with the <link> tag above (not @import) so the browser can fetch them early.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;

  /* surfaces + ink */
  --bg: #FFFFFF;
  --bg-2: #F5F5F5;
  --ink: #0A0A0A;
  --ink-2: #525252;
  --ink-3: #8A8A8A;
  --rule: #E5E5E5;
  --rule-strong: #0A0A0A;
  --rule-input: #8A8A8A;           /* control borders: 3.4:1 on white */
  --inverse-bg: #0A0A0A;
  --inverse-ink: #FFFFFF;
  --inverse-rule: #262626;
  --code-bg: #F5F5F5;
  --scrim: rgba(10, 10, 10, 0.48); /* modal backdrop only, never blurred */

  /* status (badges / notices / toasts only) */
  --ok: #1E7A46;
  --warn: #A15C00;
  --bad: #B42318;

  /* type */
  --font-sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.0625rem;   /* 17 */
  --fs-lg: 1.1875rem;   /* 19 */
  --fs-h4: 1.0625rem;
  --fs-h3: 1.3125rem;
  --fs-h2: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  --fs-h1: clamp(2.375rem, 1.4rem + 4.4vw, 4.75rem);
  --fs-display: clamp(2.75rem, 1.2rem + 6.4vw, 6rem);
  --lh-body: 1.55;
  --lh-tight: 1.04;
  --tracking-tight: -0.02em;
  --tracking-label: 0.08em;

  /* space (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* layout */
  --w-page: 1200px;
  --w-narrow: 760px;
  --w-measure: 68ch;
  --gutter: 16px;
  --header-h: 64px;

  /* shape */
  --r-control: 4px;
  --r-panel: 6px;
  --hairline: 1px solid var(--rule);
  --hairline-strong: 1px solid var(--rule-strong);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --dur-1: 150ms;   /* presses, hovers, focus */
  --dur-2: 180ms;   /* view crossfade, modal, toast out */
  --dur-3: 280ms;   /* toast in, fade-ups */
  --dur-4: 450ms;   /* rules drawing, headline lines, number roll */
  --stagger: 60ms;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

/* Inverted band: every component inside reads the swapped tokens, so buttons, code, rules and
   links flip automatically. Keep status badges out of inverted bands (contrast). */
.inverse {
  --bg: #0A0A0A;
  --bg-2: #141414;
  --ink: #FFFFFF;
  --ink-2: #A3A3A3;
  --ink-3: #737373;
  --rule: #262626;
  --rule-strong: #FFFFFF;
  --rule-input: #737373;
  --code-bg: #111111;
  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@media (min-width: 768px) { body { font-size: var(--fs-md); } }
img, svg, video { max-width: 100%; }
img { height: auto; }
::selection { background: var(--ink); color: var(--bg); }
[hidden], .hidden { display: none !important; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2, .h2 { font-size: var(--fs-h2); line-height: 1.08; }
h3, .h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
h4, .h4 { font-size: var(--fs-h4); letter-spacing: -0.005em; }
.display { font-size: var(--fs-display); line-height: 0.98; letter-spacing: -0.03em; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
.lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2); max-width: 58ch; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.measure { max-width: var(--w-measure); }
strong, b { font-weight: 600; }

/* labels, mono, numbers */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
}
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.num, .money { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: 'tnum' 1, 'lnum' 1; }
.money { font-family: var(--font-mono); letter-spacing: -0.01em; }

/* links: black, 1px underline with offset */
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: currentColor; transition: text-decoration-color var(--dur-1) var(--ease), text-underline-offset var(--dur-1) var(--ease); }
a:hover { text-underline-offset: 4px; }
.link-quiet { text-decoration-color: transparent; }
.link-quiet:hover { text-decoration-color: currentColor; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.link-arrow .icon { transition: transform var(--dur-1) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* focus: ring that animates in */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  animation: lyn-focus-in var(--dur-1) var(--ease);
}
@keyframes lyn-focus-in { from { outline-offset: 6px; outline-color: transparent; } to { outline-offset: 2px; } }

/* ------------------------------------------------------------------ layout */
.container { width: min(var(--w-page), 100% - 2 * var(--gutter)); margin-inline: auto; }
.container-narrow { width: min(var(--w-narrow), 100% - 2 * var(--gutter)); margin-inline: auto; }
.container-wide { width: min(1360px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.stack > * + * { margin-top: var(--s-4); }

/* hairline rules */
hr, .rule { border: 0; height: 1px; margin: 0; background: var(--rule); }
.rule-strong { background: var(--rule-strong); }
.rule-draw { transform-origin: 0 50%; }

/* ------------------------------------------------------------------ wordmark */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
/* Mark: the L on the ledger line, from /assets/brand/lynent-mark.svg (24-unit box, 18-unit glyph).
   Markup: <svg class="wordmark-mark" aria-hidden="true" focusable="false"><use href="/assets/brand/lynent-mark.svg#mark"/></svg>Lynent
   Fills with currentColor, so it turns white inside .inverse bands. At 1em the glyph is 0.75em tall:
   slightly taller than Plex Sans caps (0.70em), bottom on the baseline when line-height is 1. The negative
   side margins cancel the 3-unit padding in the 24-unit box, so the glyph starts at the link's left edge and
   the visible gap to the text is 0.375em (0.3em gap + the L's side bearing), the same ratio as lynent-logo.svg. */
.wordmark-mark {
  flex: 0 0 auto;
  display: block;
  width: 1em;
  height: 1em;
  margin: 0 -0.125em 0 -0.125em;
  fill: currentColor;
  overflow: visible;
}
.wordmark-sm { font-size: 1.0625rem; }
.wordmark-lg { font-size: 1.625rem; }

/* ------------------------------------------------------------------ icons */
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  overflow: visible;
}
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; stroke-width: 1.25; }
.icon-xl { width: 48px; height: 48px; stroke-width: 1; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --btn-bg: var(--bg);
  --btn-ink: var(--ink);
  --btn-border: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-control);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 500 var(--fs-sm)/1.2 var(--font-sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:hover { --btn-bg: var(--ink); --btn-ink: var(--bg); text-decoration: none; }
.btn:active:not([disabled]):not(.is-loading) { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }

/* .btn alone = secondary (white, 1px black border). .btn-secondary / .btn-ghost are aliases. */
.btn-primary { --btn-bg: var(--ink); --btn-ink: var(--bg); --btn-border: var(--ink); }
.btn-primary:hover { --btn-bg: var(--bg); --btn-ink: var(--ink); }

.btn-quiet { --btn-border: transparent; --btn-bg: transparent; padding-inline: 10px; }
.btn-quiet:hover { --btn-bg: var(--bg-2); --btn-ink: var(--ink); --btn-border: transparent; }

.btn-danger { --btn-ink: var(--bad); --btn-border: var(--bad); }
.btn-danger:hover { --btn-bg: var(--bad); --btn-ink: #FFFFFF; --btn-border: var(--bad); }

.btn-sm { min-height: 32px; padding: 6px 11px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: var(--fs-base); }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: 40px; min-width: 40px; }
.btn-icon.btn-sm { width: 32px; min-width: 32px; }

/* loading: label goes transparent (keeps the button width), spinner sits on top */
.btn.is-loading { cursor: progress; pointer-events: none; color: transparent; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--btn-ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: lyn-spin 700ms linear infinite;
}

/* bare icon button (toolbar, modal close, copy) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--bg-2); border-color: var(--rule); }
.icon-btn:active { transform: scale(.94); }

/* copy button: copy glyph morphs into a check (motion.js adds .is-copied) */
.copy-btn { position: relative; }
.copy-btn .icon { transition: opacity var(--dur-1) var(--ease), transform var(--dur-2) var(--ease); }
.copy-btn .icon-done { position: absolute; inset: 0; margin: auto; opacity: 0; transform: scale(.6) rotate(-12deg); }
.copy-btn.is-copied .icon-copy { opacity: 0; transform: scale(.6); }
.copy-btn.is-copied .icon-done { opacity: 1; transform: none; }
.copy-btn .copy-text { min-width: 4.5ch; text-align: left; }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
label, .field-label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-2); }
.input,
input[type='text'], input[type='email'], input[type='password'], input[type='url'],
input[type='number'], input[type='search'], input[type='tel'], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--rule-input);
  border-radius: var(--r-control);
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-base)/1.4 var(--font-sans);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
.inverse select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M6.75 9.5 12 14.75l5.25-5.25'/%3E%3C/svg%3E"); }
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M6.75 9.5 12 14.75l5.25-5.25'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
.input:hover, input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
.input:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.input:focus, input[type]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  animation: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input[aria-invalid='true'], .input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.input-mono, input.mono { font-family: var(--font-mono); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
/* prefix field, e.g. "$" before an amount */
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix > .affix { position: absolute; left: 12px; color: var(--ink-2); font-family: var(--font-mono); pointer-events: none; }
.input-affix > input { padding-left: 28px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 400; color: var(--ink-2); }
input[type='checkbox'], input[type='radio'] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--ink); flex: 0 0 auto; }

/* ------------------------------------------------------------------ tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums lining-nums;
}
.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-strong);
  text-align: left;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table.table-boxed th:first-child, .table.table-boxed td:first-child { padding-left: 16px; }
.table.table-boxed th:last-child, .table.table-boxed td:last-child { padding-right: 16px; }
.table .num, .table .money { text-align: right; white-space: nowrap; }
.table td.money { font-size: 0.95em; }
.table tbody tr { transition: background-color var(--dur-1) var(--ease); }
.table-hover tbody tr:hover, .table tbody tr.is-clickable:hover { background: var(--bg-2); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tfoot td { border-top: 1px solid var(--rule-strong); border-bottom: 0; font-weight: 600; }
.table caption { caption-side: bottom; padding-top: 10px; text-align: left; font-size: 13px; color: var(--ink-2); }

/* ------------------------------------------------------------------ code */
code, kbd, samp, pre { font-family: var(--font-mono); }
code {
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
pre {
  margin: 0 0 var(--s-4);
  padding: 16px 18px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
  color: var(--ink);
}
pre code { padding: 0; border: 0; background: none; font-size: inherit; overflow-wrap: normal; }
/* code block with a header strip (label left, copy button right) */
.code-block { margin: 0 0 var(--s-4); border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--code-bg); }
.code-block > .code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 4px 6px 4px 16px; border-bottom: 1px solid var(--rule);
}
.code-block > pre { margin: 0; border: 0; border-radius: 0 0 var(--r-panel) var(--r-panel); background: transparent; }
/* monochrome syntax tokens */
.tok-c { color: var(--ink-3); }                    /* comment */
.tok-k { font-weight: 600; }                       /* keyword / command / tag */
.tok-s { color: var(--ink-2); }                    /* string */
.tok-n { color: var(--ink); }                      /* number */
.tok-p { color: var(--ink-3); }                    /* punctuation */
.tok-a { text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; } /* attribute / flag */
/* typewriter caret */
.caret { display: inline-block; width: 0.6em; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: currentColor; animation: lyn-blink 1s steps(1) infinite; }
@keyframes lyn-blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ notices */
.notice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-control);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.notice > .icon { margin-top: 1px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 4px; }
.notice-title { display: block; font-weight: 600; margin-bottom: 2px; }
.notice-ok   { border-color: var(--ok);   }
.notice-ok   > .icon { color: var(--ok); }
.notice-warn { border-color: var(--warn); }
.notice-warn > .icon { color: var(--warn); }
.notice-bad  { border-color: var(--bad);  }
.notice-bad  > .icon { color: var(--bad); }
.notice-quiet { border-color: var(--rule); background: var(--bg-2); }

/* ------------------------------------------------------------------ badges (plain bordered text) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: var(--ink-2);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; stroke-width: 2; }
.badge-ok, .badge-good { color: var(--ok); }
.badge-warn { color: var(--warn); }
.badge-bad { color: var(--bad); }
.badge-neutral, .badge-info { color: var(--ink-2); }
.badge-ink { color: var(--bg); background: var(--ink); border-color: var(--ink); }  /* e.g. TEST MODE */

/* ------------------------------------------------------------------ panels */
.panel { border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--bg); padding: var(--s-5); }
.panel-muted { background: var(--bg-2); border-color: transparent; }

/* ------------------------------------------------------------------ loading */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lyn-spin 700ms linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 28px; height: 28px; border-width: 2px; }
@keyframes lyn-spin { to { transform: rotate(360deg); } }

/* Skeleton shimmer: the ONLY gradient in the system (grey to grey). */
.skeleton {
  display: block;
  min-height: 12px;
  border-radius: 3px;
  color: transparent !important;
  background: linear-gradient(90deg, #EFEFEF 0%, #EFEFEF 35%, #E0E0E0 50%, #EFEFEF 65%, #EFEFEF 100%);
  background-size: 300% 100%;
  animation: lyn-shimmer 1.4s linear infinite;
}
.inverse .skeleton { background: linear-gradient(90deg, #1A1A1A 0%, #1A1A1A 35%, #2A2A2A 50%, #1A1A1A 65%, #1A1A1A 100%); background-size: 300% 100%; }
.skeleton-text { height: 0.9em; margin: 0.35em 0; }
.skeleton-line { height: 12px; }
@keyframes lyn-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* drawn check mark (checkout success, onboarding complete). Markup is built by LynentMotion.drawCheck(). */
.check-draw { width: 56px; height: 56px; color: var(--ink); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.check-draw .cd-ring { stroke-dasharray: 164; stroke-dashoffset: 164; }
.check-draw .cd-tick { stroke-width: 2; stroke-dasharray: 30; stroke-dashoffset: 30; }
.check-draw.is-drawn .cd-ring { animation: lyn-draw 420ms var(--ease) forwards; }
.check-draw.is-drawn .cd-tick { animation: lyn-draw 300ms var(--ease) 300ms forwards; }
@keyframes lyn-draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ toasts (bottom-right) */
.toasts {
  position: fixed;
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--r-control);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.45;
  pointer-events: auto;
  animation: lyn-toast-in var(--dur-3) var(--ease) both;
}
.toast:not(:has(> .icon)) { grid-template-columns: minmax(0, 1fr); }
.toast > .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast-ok > .icon, .toast.success > .icon { color: var(--ok); }
.toast-warn > .icon { color: var(--warn); }
.toast-bad, .toast.error { border-color: var(--bad); }
.toast-bad > .icon, .toast.error > .icon { color: var(--bad); }
.toast.is-leaving { animation: lyn-toast-out var(--dur-2) var(--ease-in) both; }
@keyframes lyn-toast-in { from { opacity: 0; transform: translate(16px, 12px); } to { opacity: 1; transform: none; } }
@keyframes lyn-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: var(--r-panel);
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  transform: scale(.98);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal-backdrop.is-open .modal { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--rule); }
.modal-head h3, .modal-head h2 { margin: 0; font-size: var(--fs-h4); }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ view crossfade (dashboard) */
.view-in { animation: lyn-view-in var(--dur-2) var(--ease) both; }
@keyframes lyn-view-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ scroll reveals
   Hidden states apply only when motion.js has set html.motion-ok (JS on, motion allowed),
   so content is always visible without JS or with reduced motion.

   data-reveal="fade"   element fades in and rises 8px
   data-reveal="rule"   a child .rule-draw draws left to right, then [data-reveal-item] children fade in, staggered
   data-reveal="lines"  heading with .line > span children; each line slides up out of a mask, 60ms apart
   data-reveal="mask"   block uncovers left to right (clip-path), for tables and figures
   data-reveal="none"   observed only (gets .is-revealed for custom CSS / JS hooks)
*/
.motion-ok [data-reveal='fade'] { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); transition-delay: var(--reveal-delay, 0ms); }
.motion-ok [data-reveal='fade'].is-revealed { opacity: 1; transform: none; }

.motion-ok [data-reveal='rule'] .rule-draw { transform: scaleX(0); transition: transform var(--dur-4) var(--ease); }
.motion-ok [data-reveal='rule'] [data-reveal-item] {
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  transition-delay: calc(240ms + var(--i, 0) * var(--stagger));
}
.motion-ok [data-reveal='rule'].is-revealed .rule-draw { transform: none; }
.motion-ok [data-reveal='rule'].is-revealed [data-reveal-item] { opacity: 1; transform: none; }

[data-reveal='lines'] .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
[data-reveal='lines'] .line > span { display: inline-block; }
.motion-ok [data-reveal='lines'] .line > span { transform: translateY(105%); transition: transform var(--dur-4) var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.motion-ok [data-reveal='lines'].is-revealed .line > span { transform: none; }

/* The clip sits on the children, never on the observed element: a fully clipped target is never
   reported as intersecting by IntersectionObserver, so it would stay hidden. */
.motion-ok [data-reveal='mask'] > * { clip-path: inset(0 100% 0 0); transition: clip-path var(--dur-4) var(--ease); transition-delay: var(--reveal-delay, 0ms); }
.motion-ok [data-reveal='mask'].is-revealed > * { clip-path: inset(0 0 0 0); }

/* number roll: brief settle on change (motion.js toggles .is-rolling) */
.roll { display: inline-block; font-variant-numeric: tabular-nums; }
.roll.is-rolling { animation: lyn-roll var(--dur-3) var(--ease); }
@keyframes lyn-roll { from { transform: translateY(-3px); opacity: .55; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ a11y helpers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 2000; padding: 8px 12px; background: var(--ink); color: var(--bg); text-decoration: none; border-radius: var(--r-control); transition: top var(--dur-1) var(--ease); }
.skip-link:focus { top: 8px; }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  /* progress indicators stay meaningful, just slower */
  .spinner, .btn.is-loading::after { animation: lyn-spin 1.6s linear infinite !important; }
  .skeleton { animation: none !important; background: #EFEFEF; }
  .inverse .skeleton { background: #1A1A1A; }
  .caret { animation: none !important; }
  [data-reveal], [data-reveal] *, .rule-draw { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
