@import url("../tokens/fonts.css");

/* ==========================================================================
   Letterpress — fine printing on thick cotton paper.
   Everything is an impression: inset shadows cut into the sheet, a gleam on
   the lower lip. Colours, spacing, radii and shadows come from tokens.css.
   Rules: transform/opacity for movement; shadows change only on one element's
   hover/active/state; entrance animations fill BACKWARDS; no blur filters.
   ========================================================================== */

:root {
  /* motion: named after the press */
  --lp-platen: var(--ease-platen, cubic-bezier(.55, 0, .25, 1));
  --lp-release: var(--ease-release, cubic-bezier(.2, .7, .2, 1));
  --lp-feed: var(--ease-feed, cubic-bezier(.16, 1, .3, 1));
  --lp-lever: var(--ease-lever, cubic-bezier(.34, 1.32, .5, 1));
  --lp-roll: var(--ease-roll, cubic-bezier(.45, .05, .35, 1));
  --lp-t-kiss: var(--dur-kiss, 90ms);
  --lp-t-press: var(--dur-press, 160ms);
  --lp-t-lift: var(--dur-lift, 260ms);
  --lp-t-lever: var(--dur-lever, 360ms);
  --lp-t-feed: var(--dur-feed, 640ms);
  --lp-t-impress: var(--dur-impress, 900ms);
  --lp-t-roll: var(--dur-roll, 1000ms);

  --lp-ink: var(--accent);
  /* the bite of ink into the paper: a darker top inner edge on floods */
  --lp-bite: inset 0 2px 2px -1px rgba(20, 8, 4, .5), inset 0 -1px 0 rgba(255, 255, 255, .1), 0 1px 0 var(--gleam);
  --lp-bite-hover: inset 0 2px 4px rgba(20, 8, 4, .5), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 1px 0 var(--gleam);
  --lp-bite-deep: inset 0 4px 7px rgba(20, 8, 4, .62), inset 0 1px 2px rgba(20, 8, 4, .45), 0 1px 0 var(--gleam);
  /* blind deboss: no ink, only the bite */
  --lp-blind-fill: #e7dfd1;
  --lp-blind-type: 0 1px 0 rgba(255, 255, 255, .95), 0 -1px 0 rgba(80, 58, 34, .32);
  --lp-blind-type-deep: 0 1px 0 rgba(255, 255, 255, 1), 0 -1px 1px rgba(80, 58, 34, .45);
  --lp-emboss-type: 0 -1px 0 rgba(255, 255, 255, .95), 0 1px 1px rgba(80, 58, 34, .35);
  --lp-edge: rgba(255, 255, 255, .95);
  /* cotton: speckled fibre + soft cloud, both static SVG */
  --lp-fibre: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.36  0 0 0 0 0.27  0 0 0 0 0.16  0 0 0 -1.6 0.86'/></filter><rect width='260' height='260' filter='url(%23f)' opacity='0.42'/></svg>");
  --lp-cloud: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='520' height='520'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='0.011' numOctaves='3' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.34  0 0 0 0 0.2  0 0 0 0.9 -0.36'/></filter><rect width='520' height='520' filter='url(%23c)' opacity='0.22'/></svg>");
  --lp-mottle: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.96  0 0 0 0 0.9  0 0 0 -1.5 0.8'/></filter><rect width='160' height='160' filter='url(%23m)' opacity='0.22'/></svg>");
  color-scheme: light;
}
[data-theme="dark"] {
  color-scheme: dark;
  --lp-bite: inset 0 1px 2px rgba(60, 26, 6, .5), inset 0 -1px 0 rgba(255, 240, 220, .12), 0 1px 0 var(--gleam);
  --lp-bite-hover: inset 0 2px 3px rgba(60, 26, 6, .6), inset 0 -1px 0 rgba(255, 240, 220, .1), 0 1px 0 var(--gleam);
  --lp-bite-deep: inset 0 3px 6px rgba(50, 20, 4, .75), inset 0 1px 1px rgba(50, 20, 4, .55), 0 1px 0 var(--gleam);
  --lp-blind-fill: #0d0b09;
  --lp-blind-type: 0 1px 0 rgba(255, 232, 205, .24), 0 -1px 0 rgba(0, 0, 0, .9);
  --lp-blind-type-deep: 0 1px 0 rgba(255, 232, 205, .32), 0 -1px 1px rgba(0, 0, 0, 1);
  --lp-emboss-type: 0 -1px 0 rgba(255, 232, 205, .26), 0 1px 1px rgba(0, 0, 0, .95);
  --lp-edge: rgba(255, 232, 205, .2);
  --lp-fibre: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0 0.72  0 0 0 -1.6 0.86'/></filter><rect width='260' height='260' filter='url(%23f)' opacity='0.16'/></svg>");
  --lp-cloud: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='520' height='520'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='0.011' numOctaves='3' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.7  0 0 0 0 0.5  0 0 0 0.9 -0.36'/></filter><rect width='520' height='520' filter='url(%23c)' opacity='0.07'/></svg>");
  --lp-mottle: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.05  0 0 0 0 0.02  0 0 0 -1.5 0.8'/></filter><rect width='160' height='160' filter='url(%23m)' opacity='0.2'/></svg>");
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--lp-fibre), var(--lp-cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--lp-ink); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.lp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- inks: set --lp-ink for any component ---------- */
.lp-ink-accent { --lp-ink: var(--accent); }
.lp-ink-oxblood { --lp-ink: var(--oxblood); }
.lp-ink-navy { --lp-ink: var(--navy); }
.lp-ink-forest { --lp-ink: var(--forest); }
.lp-ink-copper { --lp-ink: var(--copper); }
.lp-ink-black { --lp-ink: var(--ink); }

/* ---------- type ---------- */
.lp-display, .lp-headline, .lp-title { font-family: var(--font-display); font-weight: 400; color: var(--ink); text-shadow: var(--type-deboss); margin: 0; }
.lp-display { font-size: clamp(40px, 8vw, 64px); line-height: 1.06; letter-spacing: -.01em; }
.lp-headline { font-size: clamp(30px, 5vw, 40px); line-height: 1.15; }
.lp-title { font-size: 26px; line-height: 32px; }
.lp-lede { font-style: italic; font-size: 20px; line-height: 30px; color: var(--ink-soft); margin: 0; }
.lp-label, .lp-overline { font-family: var(--font-body); font-weight: 700; font-size: 11px; line-height: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.lp-caption { font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.lp-small { font-size: 14px; line-height: 22px; }
.lp-figure { font-variant-numeric: lining-nums tabular-nums; }
.lp-inked { color: var(--lp-ink); }
.lp-deboss { text-shadow: var(--type-deboss); }
.lp-blind { color: var(--lp-blind-fill); text-shadow: var(--lp-blind-type); }
.lp-emboss-type { color: var(--paper); text-shadow: var(--lp-emboss-type); }
a.lp-link, .lp-link { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); transition: text-decoration-color var(--lp-t-press) var(--lp-release); }
.lp-link:hover { text-decoration-color: currentColor; }

/* ---------- motion: text impresses in, sheets are laid down ---------- */
@keyframes lp-impress {
  0%   { opacity: 0; transform: translateY(-2px) scale(1.012); text-shadow: 0 0 0 transparent; }
  42%  { opacity: .38; transform: translateY(-1px) scale(1.004); text-shadow: 0 0 0 transparent; }
  72%  { opacity: 1; transform: translateY(.5px) scale(.999); }
  100% { opacity: 1; transform: none; }
}
@keyframes lp-kiss-in { 0% { opacity: 0; } 50% { opacity: .4; } 100% { opacity: 1; } }
@keyframes lp-lay {
  0% { opacity: 0; transform: translateY(10px) rotate(-.4deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes lp-fade { from { opacity: 0; } to { opacity: 1; } }
.lp-impress-in { animation: lp-impress var(--lp-t-impress) var(--lp-platen) backwards; animation-delay: var(--lp-delay, 0ms); }
.lp-lay-in { animation: lp-lay 620ms var(--lp-feed) backwards; animation-delay: var(--lp-delay, 0ms); }
[data-lp-impress]:not(.lp-impressed) { opacity: 0; }
.lp-impressed { animation: lp-impress var(--lp-t-impress) var(--lp-platen) backwards; animation-delay: var(--lp-delay, 0ms); }

/* ---------- layout helpers used by previews and screens ---------- */
.lp-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-6); }
.lp-stack { display: flex; flex-direction: column; flex-wrap: nowrap; gap: var(--space-4); }
.lp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.lp-cap { width: 100%; margin-top: var(--space-2); }
.lp-cap:first-child { margin-top: 0; }

/* ---------- icons ---------- */
.lp-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- ornaments ---------- */
.lp-orn { display: inline-flex; flex: none; color: var(--lp-ink); line-height: 0; vertical-align: middle; }
.lp-orn svg { width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.lp-orn--impressed svg { filter: drop-shadow(0 1px 0 var(--gleam)); }
.lp-orn--blind { color: var(--lp-blind-fill); }
.lp-orn--blind svg { filter: drop-shadow(0 1px 0 var(--lp-edge)) drop-shadow(0 -1px 0 var(--shade)); }

.lp-rule { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-6) 0; color: var(--rule-strong); border: 0; height: auto; }
.lp-rule::before, .lp-rule::after { content: ""; flex: 1; height: 0; border-top: 1px solid var(--rule); box-shadow: 0 1px 0 var(--gleam); }
.lp-rule--plain::after { display: none; }
.lp-rule--double::before, .lp-rule--double::after { height: 4px; border-bottom: 1px solid var(--rule); }
.lp-rule--thick-thin::before, .lp-rule--thick-thin::after { height: 5px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); box-shadow: none; opacity: .75; }
.lp-rule--dotted::before, .lp-rule--dotted::after { border-top: 0; height: 2px; box-shadow: none; background-image: radial-gradient(circle, var(--rule-strong) .9px, transparent 1.2px); background-size: 6px 2px; }
.lp-rule .lp-orn { color: var(--lp-ink); }

/* ==========================================================================
   Button — rests as a kiss, deepens on hover, bites deep on press
   ========================================================================== */
.lp-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 42px; padding: 0 var(--space-6); min-width: 42px;
  border: 0; border-radius: var(--radius-plate);
  font: 700 12px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink); background: transparent; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--rule-strong), var(--impress-kiss);
  transition: box-shadow var(--lp-t-press) var(--lp-release), background-color var(--lp-t-press) var(--lp-release), color var(--lp-t-press);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.lp-btn__label { display: inline-flex; align-items: center; gap: var(--space-2); text-shadow: var(--type-deboss); transition: transform var(--lp-t-press) var(--lp-release), opacity var(--lp-t-press); }
.lp-btn:hover { box-shadow: inset 0 0 0 1px var(--ink), var(--impress); }
.lp-btn:active:not(:disabled), .lp-btn.is-pressing { box-shadow: inset 0 0 0 1px var(--ink), var(--impress-deep); transition-duration: var(--lp-t-kiss); transition-timing-function: var(--lp-platen); }
.lp-btn:active:not(:disabled) .lp-btn__label, .lp-btn.is-pressing .lp-btn__label { transform: translateY(1px); transition-duration: var(--lp-t-kiss); transition-timing-function: var(--lp-platen); }

/* flood: a solid of ink printed into the sheet */
.lp-btn--primary, .lp-btn--flood {
  color: var(--on-accent); background-color: var(--lp-ink); background-image: var(--lp-mottle);
  box-shadow: var(--lp-bite);
}
.lp-btn--primary .lp-btn__label { text-shadow: 0 -1px 0 rgba(0, 0, 0, .18); }
.lp-btn--primary:hover { box-shadow: var(--lp-bite-hover); }
.lp-btn--primary:active:not(:disabled), .lp-btn--primary.is-pressing { box-shadow: var(--lp-bite-deep); }
/* blind: no ink outline, only the bite */
.lp-btn--blind { background: var(--paper-sunk); box-shadow: var(--impress); }
.lp-btn--blind:hover { box-shadow: var(--impress-deep); }
.lp-btn--blind:active:not(:disabled) { box-shadow: var(--impress-deep), inset 0 4px 8px var(--shade); }
/* ghost: printed words, a hairline beneath */
.lp-btn--ghost { background: transparent; box-shadow: none; padding: 0 var(--space-3); }
.lp-btn--ghost .lp-btn__label { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 3px; transition: background-size var(--lp-t-lift) var(--lp-feed), transform var(--lp-t-press) var(--lp-release); }
.lp-btn--ghost:hover { box-shadow: none; }
.lp-btn--ghost:hover .lp-btn__label { background-size: 100% 1px; }
.lp-btn--ghost:active:not(:disabled) { box-shadow: var(--impress-kiss); }
/* danger: oxblood line */
.lp-btn--danger { color: var(--oxblood); box-shadow: inset 0 0 0 1px var(--oxblood), var(--impress-kiss); }
.lp-btn--danger:hover { box-shadow: inset 0 0 0 1px var(--oxblood), var(--impress); }
.lp-btn--danger:active:not(:disabled) { box-shadow: inset 0 0 0 1px var(--oxblood), var(--impress-deep); }

.lp-btn--sm { height: 34px; padding: 0 var(--space-4); font-size: 11px; }
.lp-btn--lg { height: 52px; padding: 0 var(--space-8); font-size: 13px; }
.lp-btn--block { display: flex; width: 100%; }
.lp-btn .lp-icon { width: 16px; height: 16px; }
.lp-btn:disabled, .lp-btn[aria-disabled="true"] { cursor: not-allowed; color: var(--ink-soft); background: var(--paper); background-image: none; box-shadow: inset 0 0 0 1px var(--rule), var(--impress-kiss); }
.lp-btn:disabled .lp-btn__label { text-shadow: none; }
/* loading: three lozenges impress in turn */
.lp-btn__dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; opacity: 0; pointer-events: none; }
.lp-btn__dots i { width: 6px; height: 6px; background: currentColor; transform: rotate(45deg) scale(.6); opacity: .25; }
.lp-btn.is-loading { cursor: progress; }
.lp-btn.is-loading .lp-btn__label { opacity: 0; }
.lp-btn.is-loading .lp-btn__dots { opacity: 1; }
.lp-btn.is-loading .lp-btn__dots i { animation: lp-dot 1.05s var(--lp-platen) infinite; }
.lp-btn.is-loading .lp-btn__dots i:nth-child(2) { animation-delay: .15s; }
.lp-btn.is-loading .lp-btn__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lp-dot { 0%, 100% { opacity: .25; transform: rotate(45deg) scale(.6); } 35% { opacity: 1; transform: rotate(45deg) scale(1); } }

/* ---------- IconButton ---------- */
.lp-iconbtn { width: 40px; height: 40px; padding: 0; gap: 0; }
.lp-iconbtn .lp-icon { width: 18px; height: 18px; }
.lp-iconbtn--sm { width: 32px; height: 32px; }
.lp-iconbtn--sm .lp-icon { width: 15px; height: 15px; }
.lp-iconbtn--round { border-radius: var(--radius-groove); }
.lp-iconbtn[aria-pressed="true"] { color: var(--lp-ink); background: var(--paper-sunk); box-shadow: inset 0 0 0 1px var(--lp-ink), var(--impress-deep); }
.lp-iconbtn__count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lp-ink); color: var(--on-accent); font: 700 10px/18px var(--font-body); letter-spacing: 0; box-shadow: 0 0 0 2px var(--paper); font-variant-numeric: lining-nums; }

/* ==========================================================================
   Toggle — a lever in a debossed groove
   ========================================================================== */
.lp-toggle { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.lp-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lp-toggle__groove {
  position: relative; flex: none; width: 60px; height: 30px; border-radius: var(--radius-groove);
  background-color: var(--paper-sunk); box-shadow: var(--impress), inset 0 0 0 1px var(--rule-strong);
  transition: background-color var(--lp-t-lever) var(--lp-platen), box-shadow var(--lp-t-lever) var(--lp-platen);
}
/* the slot the lever runs in */
.lp-toggle__groove::before { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--shade); box-shadow: 0 1px 0 var(--gleam); opacity: .7; transition: opacity var(--lp-t-lever); }
.lp-toggle__lever {
  position: absolute; top: 3px; left: 3px; width: 32px; height: 24px; border-radius: 12px;
  transition: transform var(--lp-t-lever) var(--lp-lever);
}
.lp-toggle__face {
  position: absolute; inset: 0; border-radius: inherit; background: var(--paper-raised); box-shadow: var(--emboss);
  display: flex; align-items: center; justify-content: center; gap: 3px;
}
.lp-toggle__face i { width: 1.5px; height: 10px; border-radius: 1px; background: var(--rule-strong); box-shadow: 1px 0 0 var(--gleam); }
.lp-toggle input:checked + .lp-toggle__groove { background-color: var(--lp-ink); background-image: var(--lp-mottle); box-shadow: var(--lp-bite-hover), inset 0 0 0 1px var(--lp-ink); }
.lp-toggle input:checked + .lp-toggle__groove::before { opacity: 0; }
.lp-toggle input:checked + .lp-toggle__groove .lp-toggle__lever { transform: translateX(22px); }
.lp-toggle__groove.is-throwing .lp-toggle__face { animation: lp-throw var(--lp-t-lever) var(--lp-platen); }
@keyframes lp-throw { 0% { transform: none; } 40% { transform: scaleX(1.16) scaleY(.92); } 100% { transform: none; } }
.lp-toggle:active .lp-toggle__face { transform: scale(.94); }
.lp-toggle input:focus-visible + .lp-toggle__groove { outline: 2px solid var(--focus); outline-offset: 3px; }
.lp-toggle__text { display: flex; flex-direction: column; line-height: 22px; }
.lp-toggle__hint { font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.lp-toggle.is-disabled { cursor: not-allowed; opacity: .55; }

/* ==========================================================================
   Checkbox & Radio — the press strikes a printer's ornament
   ========================================================================== */
.lp-choice { position: relative; display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; line-height: 24px; }
.lp-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lp-choice__box {
  position: relative; flex: none; width: 24px; height: 24px; margin-top: 0; border-radius: 2px;
  background: var(--paper-sunk); box-shadow: inset 0 0 0 1px var(--rule-strong), var(--impress);
  transition: box-shadow var(--lp-t-press) var(--lp-platen), transform var(--lp-t-kiss) var(--lp-platen);
}
.lp-choice--radio .lp-choice__box { border-radius: 50%; }
.lp-choice__box .lp-orn { position: absolute; inset: 3px; width: auto; height: auto; opacity: 0; transform: scale(1.5) rotate(-12deg); transition: opacity 120ms, transform 120ms; }
.lp-choice__box .lp-orn svg { filter: drop-shadow(0 1px 0 var(--gleam)); }
.lp-choice input:checked + .lp-choice__box { box-shadow: inset 0 0 0 1px var(--lp-ink), var(--impress-deep); }
.lp-choice input:checked + .lp-choice__box .lp-orn { opacity: 1; transform: none; transition: opacity 140ms var(--lp-platen), transform 260ms var(--lp-platen); }
.lp-choice:active .lp-choice__box { transform: scale(.92); }
.lp-choice input:focus-visible + .lp-choice__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-choice__text { display: flex; flex-direction: column; }
.lp-choice__hint { font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.lp-choice.is-disabled { cursor: not-allowed; opacity: .55; }
/* the strike: a brief deeper bite on the box when checked */
.lp-choice__box.is-struck { animation: lp-strike 300ms var(--lp-platen); }
@keyframes lp-strike { 0% { transform: scale(1); } 30% { transform: scale(.86); } 100% { transform: scale(1); } }
.lp-radiogroup { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.lp-radiogroup legend { padding: 0; margin-bottom: var(--space-3); }

/* ==========================================================================
   TextField — written on a printed rule, like an RSVP card
   ========================================================================== */
.lp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-field__label { display: block; }
.lp-field__wrap { position: relative; display: flex; align-items: center; gap: var(--space-2); }
.lp-field__wrap > .lp-icon { color: var(--ink-soft); }
.lp-field__input {
  width: 100%; min-width: 0; height: 40px; padding: 6px 0 4px; border: 0; border-radius: 0; background: transparent;
  font-size: 17px; line-height: 26px; color: var(--ink); outline: none;
}
.lp-field__input::placeholder { color: var(--ink-soft); opacity: 1; font-style: italic; }
.lp-field--line .lp-field__wrap { border-bottom: 1px solid var(--rule-strong); box-shadow: 0 1px 0 var(--gleam); }
/* the ink roller draws the rule in accent on focus */
.lp-field__ink { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--lp-ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 420ms var(--lp-feed); pointer-events: none; }
.lp-field--line .lp-field__wrap:focus-within .lp-field__ink { transform: scaleX(1); }
.lp-field--well .lp-field__wrap { padding: 0 var(--space-3); border-radius: var(--radius-plate); background: var(--paper-sunk); box-shadow: inset 0 0 0 1px var(--rule-strong), var(--impress); transition: box-shadow var(--lp-t-press) var(--lp-release); }
.lp-field--well .lp-field__wrap:focus-within { box-shadow: inset 0 0 0 1px var(--lp-ink), var(--impress-deep); }
.lp-field--well .lp-field__ink { display: none; }
.lp-field--well textarea.lp-field__input { height: auto; padding: 10px 0; resize: vertical; }
.lp-field__help { font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.lp-field__error { display: none; align-items: center; gap: 6px; font-style: italic; font-size: 13px; line-height: 18px; color: var(--oxblood); }
.lp-field.has-error .lp-field__error { display: flex; animation: lp-impress 520ms var(--lp-platen) backwards; }
.lp-field.has-error .lp-field__help { display: none; }
.lp-field.has-error .lp-field__wrap { border-bottom-color: var(--oxblood); }
.lp-field.has-error .lp-field__ink { background: var(--oxblood); transform: scaleX(1); }
.lp-field.has-error.lp-field--well .lp-field__wrap { box-shadow: inset 0 0 0 1px var(--oxblood), var(--impress); }
.lp-field.is-disabled { opacity: .55; }
.lp-field__count { margin-left: auto; font-style: italic; font-size: 12px; color: var(--ink-soft); font-variant-numeric: lining-nums; }

/* ==========================================================================
   Select — a line field that opens a sheet of options
   ========================================================================== */
.lp-select { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-select__trigger {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%;
  height: 40px; padding: 6px 2px 4px 0; border: 0; border-bottom: 1px solid var(--rule-strong); background: transparent; box-shadow: 0 1px 0 var(--gleam);
  font-size: 17px; text-align: left; cursor: pointer;
}
.lp-select__trigger .lp-icon { color: var(--ink-soft); transition: transform var(--lp-t-lift) var(--lp-feed); }
.lp-select.is-open .lp-select__trigger .lp-icon { transform: rotate(180deg); }
.lp-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-select__value.is-placeholder { color: var(--ink-soft); font-style: italic; }
.lp-select__trigger .lp-field__ink { bottom: -1px; }
.lp-select.is-open .lp-field__ink, .lp-select__trigger:focus-visible .lp-field__ink { transform: scaleX(1); }
.lp-select__trigger:focus-visible { outline: none; }
.lp-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); min-width: 200px; max-height: 280px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; border-radius: var(--radius-well);
  background-color: var(--paper-raised); background-image: var(--lp-fibre); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--rule);
  opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden;
  transition: opacity 180ms var(--lp-release), transform var(--lp-t-lift) var(--lp-feed), visibility 0s linear 260ms;
}
.lp-select.is-open .lp-menu, .lp-menu.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.lp-menu__item { display: flex; align-items: center; gap: var(--space-2); padding: 8px 10px; border-radius: var(--radius-plate); cursor: pointer; font-size: 16px; line-height: 22px; transition: box-shadow var(--lp-t-press), background-color var(--lp-t-press); }
.lp-menu__item small { margin-left: auto; font-style: italic; font-size: 13px; color: var(--ink-soft); }
.lp-menu__item .lp-orn { width: 14px; height: 14px; opacity: 0; transform: scale(1.4); transition: opacity 120ms, transform 220ms var(--lp-platen); }
.lp-menu__item.is-active { background: var(--paper-sunk); box-shadow: var(--impress-kiss); }
.lp-menu__item[aria-selected="true"] .lp-orn { opacity: 1; transform: none; }
.lp-menu__item[aria-selected="true"] { color: var(--lp-ink); }
.lp-menu__sep { height: 0; margin: 6px 4px; border-top: 1px solid var(--rule); }
.lp-menu--floating { position: absolute; left: auto; right: 0; top: calc(100% + 6px); }
.lp-dropdown { position: relative; display: inline-block; }
.lp-dropdown.is-open .lp-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }

/* ==========================================================================
   Tabs — a printer's rule with a lozenge slides beneath the chosen word
   ========================================================================== */
.lp-tabs { min-width: 0; }
.lp-tabs__list { position: relative; display: flex; gap: var(--space-6); padding-bottom: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.lp-tabs__list::before { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--rule); box-shadow: 0 1px 0 var(--gleam); }
.lp-tabs__list::-webkit-scrollbar { display: none; }
.lp-tab {
  position: relative; flex: none; padding: 12px 0 12px; border: 0; background: none; cursor: pointer;
  font: 700 12px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  transition: color var(--lp-t-press);
}
.lp-tab:hover { color: var(--ink); }
.lp-tab[aria-selected="true"] { color: var(--ink); text-shadow: var(--type-deboss); }
.lp-tab__count { margin-left: 6px; font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-soft); font-variant-numeric: lining-nums; }
.lp-tabs__bar { position: absolute; left: 0; bottom: 4px; width: 100px; height: 2px; background: var(--lp-ink); transform-origin: 0 50%; transition: transform 460ms var(--lp-feed); pointer-events: none; }
.lp-tabs__loz { position: absolute; left: 0; bottom: 1px; width: 7px; height: 7px; background: var(--lp-ink); box-shadow: 0 0 0 2px var(--paper); transition: transform 460ms var(--lp-feed); pointer-events: none; }
.lp-tabs__panel { padding-top: var(--space-6); }
.lp-tabs__panel[hidden] { display: none; }
.lp-tabs__panel.is-entering > * { animation: lp-kiss-in 420ms var(--lp-platen) backwards; }

/* ==========================================================================
   SegmentedControl — an embossed plate slides along a groove
   ========================================================================== */
.lp-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--radius-well); background: var(--paper-sunk); box-shadow: var(--impress), inset 0 0 0 1px var(--rule); max-width: 100%; }
.lp-seg--block { display: grid; }
.lp-seg__thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2)); border-radius: 4px; background-color: var(--paper-raised); background-image: var(--lp-fibre); box-shadow: var(--emboss); transition: transform var(--lp-t-lever) var(--lp-lever) }
.lp-seg__opt { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; padding: 8px 16px; border: 0; background: none; cursor: pointer; white-space: nowrap; font: 700 11px/18px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); transition: color var(--lp-t-press); }
.lp-seg__opt:hover { color: var(--ink); }
.lp-seg__opt[aria-checked="true"] { color: var(--ink); }
.lp-seg__opt span { display: inline-block; transition: transform var(--lp-t-press) var(--lp-release); }
.lp-seg__opt:active span { transform: translateY(1px); }

/* ==========================================================================
   Slider — a line gauge with an ink fill and an embossed quoin
   ========================================================================== */
.lp-slider { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-slider__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.lp-slider__value { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--ink); text-shadow: var(--type-deboss); font-variant-numeric: lining-nums tabular-nums; }
.lp-slider__value small { font-family: var(--font-body); font-style: italic; font-size: 13px; color: var(--ink-soft); margin-left: 3px; }
.lp-slider__body { position: relative; height: 34px; }
.lp-slider__track { position: absolute; left: 0; right: 0; top: 10px; height: 10px; border-radius: var(--radius-groove); background: var(--paper-sunk); box-shadow: var(--impress), inset 0 0 0 1px var(--rule); overflow: hidden; }
.lp-slider__fill { position: absolute; inset: 0; background-color: var(--lp-ink); background-image: var(--lp-mottle); transform-origin: 0 50%; transform: scaleX(var(--v, 0)); box-shadow: inset 0 1px 2px rgba(20, 8, 4, .35); }
.lp-slider__ticks { position: absolute; left: 11px; right: 11px; top: 24px; height: 8px; background-image: linear-gradient(90deg, var(--rule-strong) 1px, transparent 1px); background-size: calc(10% - .1px) 6px; background-repeat: repeat-x; opacity: .7; }
.lp-slider__ticks::after { content: ""; position: absolute; right: -1px; top: 0; width: 1px; height: 6px; background: var(--rule-strong); }
.lp-slider input { position: absolute; inset: 0; width: 100%; height: 30px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.lp-slider input:focus { outline: none; }
.lp-slider input::-webkit-slider-runnable-track { height: 30px; background: transparent; }
.lp-slider input::-moz-range-track { height: 30px; background: transparent; }
.lp-slider input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: 4px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--lp-ink) 0 3px, transparent 3.5px), var(--paper-raised); box-shadow: var(--emboss), 0 2px 4px var(--shade); transition: transform var(--lp-t-press) var(--lp-lever); }
.lp-slider input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--lp-ink) 0 3px, transparent 3.5px), var(--paper-raised); box-shadow: var(--emboss), 0 2px 4px var(--shade); }
.lp-slider input:active::-webkit-slider-thumb { transform: scale(.9); }
.lp-slider input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-slider input:focus-visible::-moz-range-thumb { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-slider__scale { display: flex; justify-content: space-between; font-style: italic; font-size: 12px; line-height: 16px; color: var(--ink-soft); font-variant-numeric: lining-nums; }

/* ==========================================================================
   Card — a sheet of heavier stock laid on the page
   ========================================================================== */
.lp-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--space-6); border-radius: var(--radius-plate);
  background-color: var(--paper-raised); background-image: var(--lp-fibre);
  box-shadow: var(--shadow-stock), inset 0 0 0 1px var(--rule);
  transition: transform var(--lp-t-lift) var(--lp-release), box-shadow var(--lp-t-lift) var(--lp-release);
}
.lp-card--flat { background-color: transparent; background-image: none; box-shadow: inset 0 0 0 1px var(--rule); }
.lp-card--sunk { background-color: var(--paper-sunk); background-image: none; box-shadow: var(--impress); }
.lp-card--interactive { cursor: pointer; }
.lp-card--interactive::after { content: ""; position: absolute; inset: 0 -4px -6px 0; z-index: -1; }
.lp-card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--rule); }
.lp-card--interactive:active { transform: translateY(0); box-shadow: var(--shadow-stock), inset 0 0 0 1px var(--rule-strong); transition-duration: var(--lp-t-kiss); }
.lp-card__head { display: flex; align-items: flex-start; gap: var(--space-3); }
.lp-card__titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.lp-card__title { font-family: var(--font-display); font-size: 24px; line-height: 30px; margin: 0; text-shadow: var(--type-deboss); }
.lp-card__body { color: var(--ink-soft); font-size: 15px; line-height: 24px; }
.lp-card__body p { margin: 0; }
.lp-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--rule); box-shadow: inset 0 1px 0 var(--gleam); }

/* ==========================================================================
   Badge & Tag
   ========================================================================== */
.lp-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-plate); font: 700 10px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.lp-badge--line { color: var(--lp-ink); box-shadow: inset 0 0 0 1px var(--lp-ink), var(--impress-kiss); }
.lp-badge--flood { color: var(--on-accent); background-color: var(--lp-ink); background-image: var(--lp-mottle); box-shadow: var(--lp-bite); }
.lp-badge--blind { color: var(--ink-soft); background: var(--paper-sunk); box-shadow: var(--impress); }
.lp-badge--pill { border-radius: var(--radius-groove); }
.lp-badge .lp-orn { width: 10px; height: 10px; }
.lp-badge--flood .lp-orn { color: var(--on-accent); }
.lp-badge__dot { width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
.lp-tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: var(--radius-groove); background: var(--paper-sunk); box-shadow: var(--impress-kiss), inset 0 0 0 1px var(--rule); font-size: 14px; line-height: 1; color: var(--ink); transition: opacity 200ms, transform 200ms var(--lp-platen); }
.lp-tag--static { padding-right: 12px; }
.lp-tag__x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--ink-soft); transition: color var(--lp-t-press), box-shadow var(--lp-t-press); }
.lp-tag__x:hover { color: var(--oxblood); box-shadow: var(--impress); }
.lp-tag__x .lp-icon { width: 12px; height: 12px; stroke-width: 2; }
.lp-tag.is-leaving { opacity: 0; transform: scale(.9); }

/* ==========================================================================
   Avatar — an inked seal, or a blind monogram
   ========================================================================== */
.lp-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; font-family: var(--font-display); font-size: 16px; line-height: 1; letter-spacing: .02em; color: var(--on-accent); background-color: var(--lp-ink); background-image: var(--lp-mottle); box-shadow: var(--lp-bite); user-select: none; font-variant-numeric: lining-nums; }
.lp-avatar--blind { color: var(--lp-blind-fill); background: var(--paper); text-shadow: var(--lp-blind-type-deep); box-shadow: var(--impress), inset 0 0 0 1px var(--rule); }
.lp-avatar--line { color: var(--lp-ink); background: var(--paper-raised); box-shadow: inset 0 0 0 1.5px var(--lp-ink), inset 0 0 0 3.5px var(--paper-raised), inset 0 0 0 4.5px var(--lp-ink), var(--impress-kiss); }
.lp-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.lp-avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.lp-avatar--xl { width: 84px; height: 84px; font-size: 32px; }
.lp-avatar__status { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 2px var(--paper); }
.lp-avatar-stack { display: inline-flex; padding-left: 6px; }
.lp-avatar-stack .lp-avatar { margin-left: -6px; box-shadow: var(--lp-bite), 0 0 0 2px var(--paper); transition: transform var(--lp-t-press) var(--lp-release); }
.lp-avatar-stack .lp-avatar:not(.lp-avatar--sm):not(.lp-avatar--lg) { font-size: 13px; letter-spacing: -.04em; padding-right: 4px; }
.lp-avatar-stack .lp-avatar:hover { transform: translateY(-2px); z-index: 1; }
.lp-avatar-stack__more { color: var(--ink); background: var(--paper-sunk); background-image: none; font-family: var(--font-body); font-weight: 700; font-size: 12px; box-shadow: var(--impress), 0 0 0 2px var(--paper) !important; }

/* ==========================================================================
   Tooltip — a small proof slip in ink
   ========================================================================== */
.lp-tip-host { position: relative; display: inline-flex; }
.lp-tip {
  position: absolute; z-index: 40; left: 50%; bottom: calc(100% + 10px); width: max-content; max-width: 240px;
  padding: 7px 11px 8px; border-radius: var(--radius-plate);
  background-color: var(--ink); color: var(--paper); font-style: italic; font-size: 13px; line-height: 18px; text-align: center;
  box-shadow: 0 8px 18px -10px rgba(20, 14, 8, .6);
  opacity: 0; transform: translate(-50%, 4px); pointer-events: none; visibility: hidden;
  transition: opacity 160ms var(--lp-release), transform 300ms var(--lp-feed), visibility 0s linear 300ms;
}
.lp-tip::after { content: ""; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--ink); transform: rotate(45deg); }
.lp-tip--bottom { bottom: auto; top: calc(100% + 10px); transform: translate(-50%, -4px); }
.lp-tip--bottom::after { top: 0; }
.lp-tip-host.is-tip .lp-tip { opacity: 1; transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.lp-tip b { font-style: normal; font-weight: 700; }
.lp-tip kbd { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 2px; font: 700 10px/16px var(--font-body); letter-spacing: .1em; color: var(--ink); background: var(--paper); font-style: normal; }

/* ==========================================================================
   Toast — a fresh print feeds out of the press slot
   ========================================================================== */
.lp-toasts { position: fixed; z-index: 90; top: 12px; right: 12px; width: min(380px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.lp-toasts--inline { position: relative; top: auto; right: auto; width: 100%; max-width: 400px; }
.lp-toast-slot { position: relative; overflow: hidden; padding: 4px 14px 22px; margin: 0 -14px -14px; pointer-events: none; }
/* the slot in the press bed: a debossed line the sheet emerges from */
.lp-toast-slot::before { content: ""; position: absolute; z-index: 2; left: 10px; right: 10px; top: 0; height: 3px; border-radius: 2px; background: var(--ink); opacity: .55; box-shadow: 0 1px 0 var(--gleam); transform-origin: 50% 0; transition: opacity 400ms var(--lp-release) 500ms, transform 400ms var(--lp-release) 500ms; }
.lp-toast-slot.is-fed::before { opacity: 0; transform: scaleX(.9); }
.lp-toast {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 4px var(--space-3); align-items: start;
  padding: 14px 12px 14px 16px; border-radius: 2px; pointer-events: auto;
  background-color: var(--paper-raised); background-image: var(--lp-fibre); color: var(--ink);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--rule);
  transform: translateY(calc(-100% - 8px));
}
.lp-toast-slot.is-fed .lp-toast { transform: none; transition: transform var(--lp-t-feed) var(--lp-feed); }
.lp-toast-slot.is-fed .lp-toast__title { animation: lp-impress 700ms var(--lp-platen) 260ms backwards; }
.lp-toast-slot.is-leaving .lp-toast { transform: translateY(-10px) rotate(-.6deg); opacity: 0; transition: transform 340ms var(--lp-release), opacity 260ms; }
.lp-toast__orn { width: 22px; height: 22px; margin-top: 1px; }
.lp-toast__title { font-weight: 700; font-size: 15px; line-height: 22px; text-shadow: var(--type-deboss); }
.lp-toast__msg { grid-column: 2; font-size: 14px; line-height: 21px; color: var(--ink-soft); }
.lp-toast__meta { grid-column: 2; display: flex; align-items: center; gap: var(--space-3); margin-top: 4px; }
.lp-toast__meta .lp-caption { font-size: 12px; }
.lp-toast__close { grid-column: 3; grid-row: 1; margin: -6px -2px 0 0; }
.lp-toast__edge { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--lp-ink); opacity: .8; transform-origin: 0 50%; }
.lp-toast-slot.is-fed .lp-toast__edge { animation: lp-drain var(--lp-life, 5200ms) linear forwards; }
.lp-toast:hover .lp-toast__edge { animation-play-state: paused; }
@keyframes lp-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ==========================================================================
   Modal — a sheet laid onto the platen
   ========================================================================== */
.lp-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.lp-modal[hidden] { display: none; }
.lp-modal__scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 300ms var(--lp-release); }
.lp-modal__panel {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: var(--space-8) var(--space-8) var(--space-6); border-radius: 2px;
  background-color: var(--paper-raised); background-image: var(--lp-fibre), var(--lp-cloud);
  box-shadow: var(--shadow-lift), 0 40px 80px -30px rgba(20, 14, 8, .5), inset 0 0 0 1px var(--rule);
  opacity: 0; transform: translateY(18px) rotate(.5deg) scale(.985);
  transition: transform 520ms var(--lp-feed), opacity 260ms var(--lp-release);
}
.lp-modal.is-open .lp-modal__scrim { opacity: 1; }
.lp-modal.is-open .lp-modal__panel { opacity: 1; transform: none; }
.lp-modal.is-open .lp-modal__title { animation: lp-impress var(--lp-t-impress) var(--lp-platen) 160ms backwards; }
.lp-modal__inner { position: relative; }
.lp-modal__orn { display: flex; justify-content: center; margin-bottom: var(--space-3); }
.lp-modal__title { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 30px; line-height: 36px; text-align: center; text-shadow: var(--type-deboss); }
.lp-modal__sub { margin: 0 0 var(--space-6); text-align: center; font-style: italic; color: var(--ink-soft); }
.lp-modal__body { font-size: 16px; line-height: 26px; }
.lp-modal__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); box-shadow: inset 0 1px 0 var(--gleam); }
.lp-modal__close { position: absolute; top: 10px; right: 10px; }
@media (max-width: 480px) { .lp-modal__panel { padding: var(--space-6) var(--space-4) var(--space-4); } .lp-modal__foot .lp-btn { flex: 1; } }

/* ==========================================================================
   Progress — ink coverage rolling across the forme
   ========================================================================== */
.lp-progress { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-progress__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.lp-progress__pct { font-style: italic; font-size: 14px; color: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; }
.lp-progress__track { position: relative; height: 14px; border-radius: 2px; background: var(--paper-sunk); box-shadow: var(--impress), inset 0 0 0 1px var(--rule); overflow: hidden; }
.lp-progress--thin .lp-progress__track { height: 8px; }
.lp-progress__sheet { position: absolute; inset: 0; transform: translateX(calc((var(--v, 0) - 1) * 100%)); transition: transform var(--lp-t-roll) var(--lp-roll); }
.lp-progress__ink { position: absolute; inset: 0; background-color: var(--lp-ink); background-image: var(--lp-mottle); box-shadow: inset 0 1px 2px rgba(20, 8, 4, .4); }
/* the leading edge: uneven ink where the roller just passed */
.lp-progress__ink::after { content: ""; position: absolute; top: 0; bottom: 0; right: -3px; width: 6px; background: radial-gradient(circle at 0 30%, var(--lp-ink) 2px, transparent 2.5px), radial-gradient(circle at 0 75%, var(--lp-ink) 2.5px, transparent 3px); }
/* the roller itself: a small embossed cylinder riding the edge */
.lp-progress__roller { position: absolute; top: -1px; bottom: -1px; right: -6px; width: 10px; border-radius: 5px; background: repeating-linear-gradient(180deg, var(--paper-raised) 0 2px, var(--paper-sunk) 2px 3px); box-shadow: var(--emboss); opacity: 0; transition: opacity 300ms; }
.lp-progress.is-rolling .lp-progress__roller { opacity: 1; }
.lp-progress.is-done .lp-progress__roller { opacity: 0; }
.lp-progress__end { width: 16px; height: 16px; opacity: 0; transform: scale(1.5) rotate(-20deg); transition: opacity 160ms, transform 320ms var(--lp-platen); }
.lp-progress.is-done .lp-progress__end { opacity: 1; transform: none; }
.lp-progress--indeterminate .lp-progress__sheet { transition: none; width: 40%; transform: none; animation: lp-roll-back 1.6s var(--lp-roll) infinite alternate; }
.lp-progress--indeterminate .lp-progress__roller { opacity: 1; }
@keyframes lp-roll-back { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ==========================================================================
   Impression — the deboss / emboss surface
   ========================================================================== */
.lp-impression { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: var(--space-4) var(--space-6); border-radius: var(--radius-plate); color: var(--lp-ink); text-align: center; transition: box-shadow 320ms var(--lp-platen); }
.lp-impression--seal { border-radius: 50%; padding: 0; aspect-ratio: 1; }
.lp-impression--bare { padding: 0; }
.lp-impression--deboss { background: var(--paper-sunk); box-shadow: var(--impress); }
.lp-impression--deboss > * { text-shadow: var(--type-deboss); }
.lp-impression--kiss { background: var(--paper); box-shadow: var(--impress-kiss); }
.lp-impression--deep { background: var(--paper-sunk); box-shadow: var(--impress-deep); }
.lp-impression--blind { background: var(--paper); box-shadow: var(--impress); color: var(--lp-blind-fill); }
.lp-impression--blind, .lp-impression--blind * { text-shadow: var(--lp-blind-type-deep); }
.lp-impression--blind .lp-orn { color: var(--lp-blind-fill); }
.lp-impression--blind .lp-orn svg { filter: drop-shadow(0 1px 0 var(--lp-edge)) drop-shadow(0 -1px 0 var(--shade)); }
.lp-impression--emboss { background: var(--paper-raised); box-shadow: var(--emboss), 0 2px 6px -2px var(--shade); color: var(--paper-raised); }
[data-theme="dark"] .lp-impression--emboss { box-shadow: inset 0 1px 0 rgba(255, 232, 205, .16), inset 0 -1px 0 rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .8); }
[data-theme="dark"] .lp-impression--blind .lp-impression__ring { box-shadow: inset 0 1px 0 #000, 0 1px 0 var(--lp-edge); }
.lp-impression--emboss, .lp-impression--emboss * { text-shadow: var(--lp-emboss-type); }
.lp-impression--emboss .lp-orn { color: var(--paper-raised); }
.lp-impression--emboss .lp-orn svg { filter: drop-shadow(0 -1px 0 var(--lp-edge)) drop-shadow(0 1px 1px var(--shade)); }
.lp-impression__ring { position: absolute; inset: 6px; border-radius: inherit; box-shadow: inset 0 0 0 1px currentColor, 0 1px 0 var(--gleam); opacity: .7; pointer-events: none; }
.lp-impression--blind .lp-impression__ring { box-shadow: inset 0 1px 0 var(--shade), 0 1px 0 var(--gleam); opacity: 1; }
.lp-impression.is-striking { animation: lp-strike-plate 520ms var(--lp-platen); }
@keyframes lp-strike-plate { 0% { transform: scale(1); } 35% { transform: scale(.975); } 100% { transform: scale(1); } }
.lp-impression.is-striking > :not(.lp-impression__ring) { animation: lp-impress 700ms var(--lp-platen) backwards; }

/* ==========================================================================
   PressProof — a proof sheet with crop marks, registration and edition info
   ========================================================================== */
.lp-proof { position: relative; padding: 18px; min-width: 0; }
.lp-proof__sheet {
  position: relative; display: flex; flex-direction: column; min-height: 100%;
  padding: var(--space-8) var(--space-6) var(--space-4); background-color: var(--paper-raised); background-image: var(--lp-fibre), var(--lp-cloud);
  box-shadow: var(--shadow-stock), inset 0 0 0 1px var(--rule);
  transition: transform var(--lp-t-lift) var(--lp-release), box-shadow var(--lp-t-lift) var(--lp-release);
}
.lp-proof--lift .lp-proof__sheet::after { content: ""; position: absolute; inset: 0 -4px -6px 0; z-index: -1; }
.lp-proof--lift:hover .lp-proof__sheet { transform: translateY(-2px) rotate(-.25deg); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--rule); }
.lp-proof__crop { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.lp-proof__crop::before, .lp-proof__crop::after { content: ""; position: absolute; background: var(--ink-soft); opacity: .8; }
.lp-proof__crop::before { width: 12px; height: 1px; }
.lp-proof__crop::after { width: 1px; height: 12px; }
.lp-proof__crop--tl { left: 2px; top: 2px; } .lp-proof__crop--tl::before { left: 0; top: 16px; } .lp-proof__crop--tl::after { left: 16px; top: 0; }
.lp-proof__crop--tr { right: 2px; top: 2px; } .lp-proof__crop--tr::before { right: 0; top: 16px; } .lp-proof__crop--tr::after { right: 16px; top: 0; }
.lp-proof__crop--bl { left: 2px; bottom: 2px; } .lp-proof__crop--bl::before { left: 0; bottom: 16px; } .lp-proof__crop--bl::after { left: 16px; bottom: 0; }
.lp-proof__crop--br { right: 2px; bottom: 2px; } .lp-proof__crop--br::before { right: 0; bottom: 16px; } .lp-proof__crop--br::after { right: 16px; bottom: 0; }
.lp-proof__reg { position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink-soft); opacity: .8; }
.lp-proof__reg::before, .lp-proof__reg::after { content: ""; position: absolute; background: var(--ink-soft); }
.lp-proof__reg::before { left: -3px; right: -3px; top: 6.5px; height: 1px; }
.lp-proof__reg::after { top: -3px; bottom: -3px; left: 6.5px; width: 1px; }
.lp-proof__bar { position: absolute; top: 9px; right: var(--space-6); display: flex; gap: 2px; }
.lp-proof__bar i { width: 10px; height: 10px; background: var(--c); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .25); }
.lp-proof__slug { position: absolute; top: 9px; left: var(--space-6); font: 700 9px/10px var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.lp-proof__content { flex: 1; display: flex; flex-direction: column; }
.lp-proof__foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--space-4); margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--rule); box-shadow: inset 0 1px 0 var(--gleam); }
.lp-proof__edition { font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); font-variant-numeric: lining-nums; }
.lp-proof__edition b { font-style: normal; font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--ink); }
.lp-proof__stamp { position: absolute; right: 10%; bottom: 22%; width: 112px; height: 112px; color: var(--forest); opacity: 0; transform: scale(1.6) rotate(-4deg); pointer-events: none; }
.lp-proof__stamp svg { width: 100%; height: 100%; overflow: visible; }
.lp-proof.is-approved .lp-proof__stamp { opacity: .9; transform: rotate(-14deg); transition: opacity 120ms var(--lp-platen), transform 360ms var(--lp-platen); }
.lp-proof.is-stamping .lp-proof__sheet { animation: lp-strike-plate 520ms var(--lp-platen) 90ms; }

/* ==========================================================================
   Widgets
   ========================================================================== */
/* StatPlate */
.lp-stat { display: flex; flex-direction: column; gap: 6px; }
.lp-stat__figure { display: flex; align-items: baseline; gap: var(--space-2); }
.lp-stat__value { font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--ink); text-shadow: var(--type-deboss); font-variant-numeric: lining-nums tabular-nums; }
.lp-stat__unit { font-style: italic; font-size: 15px; color: var(--ink-soft); }
.lp-stat__delta { display: inline-flex; align-items: center; gap: 4px; font-style: italic; font-size: 13px; line-height: 18px; }
.lp-stat__delta.is-up { color: var(--forest); } .lp-stat__delta.is-down { color: var(--oxblood); }
.lp-stat__delta .lp-icon { width: 13px; height: 13px; stroke-width: 2; }
.lp-stat__spark { display: block; width: 100%; height: 48px; margin-top: 4px; overflow: visible; }
.lp-stat__spark .line { fill: none; stroke: var(--lp-ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.lp-stat__spark .base { stroke: var(--rule); stroke-width: 1; }
.lp-stat__spark .dot { fill: var(--lp-ink); }
.lp-stat__spark .hatch-line { stroke: var(--lp-ink); stroke-width: 1; opacity: .35; }

/* Ledger */
.lp-ledger { display: flex; flex-direction: column; gap: 0; font-variant-numeric: lining-nums tabular-nums; }
.lp-ledger__row { display: flex; align-items: baseline; gap: 6px; padding: 7px 0; font-size: 15px; line-height: 22px; }
.lp-ledger__row .lp-ledger__name { flex: none; max-width: 65%; }
.lp-ledger__row small { display: block; font-style: italic; font-size: 12px; line-height: 16px; color: var(--ink-soft); }
.lp-ledger__leader { flex: 1; min-width: 16px; height: 1px; align-self: flex-end; margin-bottom: 7px; background-image: radial-gradient(circle, var(--rule-strong) .8px, transparent 1.1px); background-size: 5px 2px; background-repeat: repeat-x; }
.lp-ledger__amt { flex: none; text-align: right; }
.lp-ledger__amt.is-changed { animation: lp-impress 640ms var(--lp-platen) backwards; }
.lp-ledger__total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 3px double var(--ink); }
.lp-ledger__total .lp-label { color: var(--ink); }
.lp-ledger__total-amt { font-family: var(--font-display); font-size: 32px; line-height: 1; text-shadow: var(--type-deboss); color: var(--ink); }
.lp-ledger__note { margin-top: 6px; font-style: italic; font-size: 12px; line-height: 16px; color: var(--ink-soft); text-align: right; }

/* Swatchbook */
.lp-swatches { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--space-3); }
.lp-swatch { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 8px; border: 0; border-radius: var(--radius-plate); background: var(--paper-raised); box-shadow: var(--shadow-stock), inset 0 0 0 1px var(--rule); cursor: pointer; text-align: left; transition: transform var(--lp-t-lift) var(--lp-release), box-shadow var(--lp-t-press) var(--lp-release); }
.lp-swatch::after { content: ""; position: absolute; inset: 0 -4px -6px 0; z-index: -1; }
.lp-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--rule-strong); }
.lp-swatch__chip { position: relative; height: 48px; border-radius: 2px; background-color: var(--c); background-image: var(--lp-mottle); box-shadow: inset 0 1px 2px rgba(20, 8, 4, .35); display: flex; align-items: center; justify-content: center; }
.lp-swatch--blind .lp-swatch__chip { background: var(--paper); box-shadow: var(--impress); }
.lp-swatch__chip .lp-orn { width: 20px; height: 20px; color: var(--on-accent); opacity: 0; transform: scale(1.5) rotate(-15deg); transition: opacity 120ms, transform 280ms var(--lp-platen); }
.lp-swatch--blind .lp-swatch__chip .lp-orn { color: var(--lp-blind-fill); }
.lp-swatch--blind .lp-swatch__chip .lp-orn svg { filter: drop-shadow(0 1px 0 var(--lp-edge)) drop-shadow(0 -1px 0 var(--shade)); }
.lp-swatch__name { font-size: 13px; line-height: 16px; font-weight: 700; color: var(--ink); padding: 0 2px; }
.lp-swatch__code { font-style: italic; font-size: 11px; line-height: 14px; color: var(--ink-soft); padding: 0 2px; }
.lp-swatch[aria-checked="true"] { transform: translateY(1px); box-shadow: var(--impress-deep), inset 0 0 0 1.5px var(--ink); background: var(--paper-sunk); }
.lp-swatch[aria-checked="true"] .lp-orn { opacity: 1; transform: none; }

/* PressLog */
.lp-log { position: relative; margin: 0; padding: 0; list-style: none; }
.lp-log::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 1px; background: var(--rule); box-shadow: 1px 0 0 var(--gleam); }
.lp-log__item { position: relative; display: grid; grid-template-columns: 21px 1fr auto; gap: 0 var(--space-3); padding: 8px 0; }
.lp-log__mark { position: relative; z-index: 1; width: 21px; height: 21px; padding: 3px; border-radius: 50%; background: var(--paper-raised); }
.lp-log__mark .lp-orn { width: 15px; height: 15px; }
.lp-log__title { font-size: 15px; line-height: 22px; }
.lp-log__title b { font-weight: 700; }
.lp-log__detail { grid-column: 2; font-style: italic; font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.lp-log__time { grid-column: 3; grid-row: 1; font-style: italic; font-size: 12px; line-height: 22px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: lining-nums; }
.lp-log__item.is-new { animation: lp-lay 600ms var(--lp-feed) backwards; }

/* ==========================================================================
   Reduced motion: keep every state, drop the travel
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  [data-lp-impress]:not(.lp-impressed) { opacity: 1; }
}
