/* libretalk.css — libretalk.eu design system v2.3 */

/* ---------- Fonts (self-hosted, Latin + Latin Extended) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-Italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSerif-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSerif-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* ---------- Tokens: light (default) ---------- */
:root {
  color-scheme: light;

  /* palette (ivy, the default scheme) */
  --bg: #f4f2eb;
  --text: #17201c;
  --muted: #5d6762;
  --faint: #8a928d;
  --line: #d3d2ca;
  --control-border: #858f89;
  --accent: #2f6b4a;
  --accent-hover: #265a3d;
  --on-accent: #fbfaf6;

  /* semantic */
  --success: #3d7a52;  --success-soft: #e1eee4;
  --warning: #a05a0c;  --warning-soft: #f5e8d3;
  --danger:  #b3412f;  --danger-soft:  #f5e0db;  --on-danger: #fbfaf6;
  --info:    #3a6c99;  --info-soft:    #e0eaf3;

  /* tones: derived from the accent, so every scheme matches */
  --tone-1: color-mix(in oklab, var(--accent) 10%, var(--bg));
  --tone-2: color-mix(in oklab, var(--accent) 18%, var(--bg));
  --tone-3: color-mix(in oklab, var(--accent) 28%, var(--bg));
  --wire:   color-mix(in oklab, var(--accent) 62%, var(--bg));
  --muted-strong: color-mix(in oklab, var(--muted) 55%, var(--text));        /* secondary text on tone-2 and tone-3 */
  --control-line: color-mix(in oklab, var(--control-border) 70%, var(--text)); /* field indicators and control outlines */

  /* foliage ramp: graded data only, identical in every scheme and theme */
  --ramp-1: #2f6b3a;  --ramp-1-ink: #f4f8f1;
  --ramp-2: #5e8f3e;  --ramp-2-ink: #10200d;
  --ramp-3: #9aae3c;  --ramp-3-ink: #1a2008;
  --ramp-4: #c79a2e;  --ramp-4-ink: #251a04;
  --ramp-5: #a4562d;  --ramp-5-ink: #fbf3ee;

  /* haze and the one shadow */
  --veil: color-mix(in oklab, var(--accent) 35%, #08110a);
  --veil-alpha: 42%;
  --shadow-lift: 0 12px 22px color-mix(in oklab, var(--text) 30%, transparent);

  /* type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-ui: 0.9375rem;   /* 15 */
  --fs-base: 1rem;      /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.25rem;     /* 20 */
  --fs-2xl: 1.5rem;     /* 24 */
  --fs-3xl: 2rem;       /* 32 */
  --fs-4xl: 2.5rem;     /* 40 */
  --fs-display: clamp(2.25rem, 7vw, 4.5rem);

  /* spacing */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-7: 32px; --space-8: 48px; --space-9: 64px; --space-10: 80px;

  /* shape: everything is a leaf */
  --leaf-lg: 26px 6px 26px 6px;
  --leaf-sm: 14px 4px 14px 4px;
  --leaf-sm-flip: 4px 14px 4px 14px;
  --leaf-xs: 6px 2px 6px 2px;
  --field-radius: 14px 14px 0 0;
  --round: 50%;

  /* layout */
  --content-max: 1600px;
  --prose-max: 68ch;
  --page-pad: clamp(16px, 4vw, 64px);
  --col-gap: clamp(32px, 5vw, 72px);
  --gutter: var(--space-8);
  --nav-h: 64px;
  --control-h: 40px;

  /* motion */
  --dur-fast: 150ms;
  --dur: 350ms;
  --dur-slow: 700ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (max-width: 599px), (pointer: coarse) { :root { --control-h: 44px; } }

/* ---------- Tokens: dark ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111714;
  --text: #edf0eb;
  --muted: #99a39d;
  --faint: #6f7a74;
  --line: #354039;
  --control-border: #6b766f;
  --accent: #7fbf98;
  --accent-hover: #96cdab;
  --on-accent: #0f1612;

  --success: #7cc096;  --success-soft: #1c2c22;
  --warning: #e3a95a;  --warning-soft: #33271a;
  --danger:  #ee8c7b;  --danger-soft:  #351f1b;  --on-danger: #1c0f0c;
  --info:    #8ab4de;  --info-soft:    #1c2834;

  --veil: color-mix(in oklab, var(--accent) 10%, #030604);
  --veil-alpha: 58%;
}

/* ---------- Color schemes (set with <html data-accent="...">) ----------
   A scheme replaces the page background, text, borders, and accent. Tones are
   derived from the accent above. Ivy is the default and lives in :root.
   Specificity: dark+scheme (3 attributes) beats light scheme (2), so every
   scheme works in both themes. */
:root[data-accent="tide"] {
  --bg: #eff2f4; --text: #16202a; --muted: #556270; --faint: #86929d; --line: #cfd6db;
  --control-border: #7d8b97; --accent: #2d5f8a; --accent-hover: #244f74; --on-accent: #f9fafb;
}
:root[data-accent="stone"] {
  --bg: #f1f1ef; --text: #1e2022; --muted: #5a5e62; --faint: #8b8e91; --line: #d4d4d0;
  --control-border: #84888b; --accent: #4a5560; --accent-hover: #3b444d; --on-accent: #fafaf9;
}
:root[data-accent="clay"] {
  --bg: #f6f0ea; --text: #2a1f1a; --muted: #6a5a50; --faint: #998a80; --line: #dccfc3;
  --control-border: #8f7e72; --accent: #a0522d; --accent-hover: #86431f; --on-accent: #fcf9f5;
}
:root[data-accent="ochre"] {
  --bg: #f6f2e6; --text: #231f12; --muted: #645d48; --faint: #948c76; --line: #dcd5be;
  --control-border: #8c846c; --accent: #8a6410; --accent-hover: #725009; --on-accent: #fcfaf1;
}
:root[data-accent="heather"] {
  --bg: #f3f0f4; --text: #231b27; --muted: #62566a; --faint: #928798; --line: #d8d0dd;
  --control-border: #8a7f92; --accent: #6b4a7a; --accent-hover: #583c65; --on-accent: #fbf9fc;
}
:root[data-theme="dark"][data-accent="tide"] {
  --bg: #10161b; --text: #e8eef3; --muted: #93a3b2; --faint: #6a7a88; --line: #2f3d4a;
  --control-border: #66798a; --accent: #8db8dc; --accent-hover: #a5c9e6; --on-accent: #0d1318;
}
:root[data-theme="dark"][data-accent="stone"] {
  --bg: #141516; --text: #ececea; --muted: #9a9c9f; --faint: #707275; --line: #38393c;
  --control-border: #6e7073; --accent: #b4bcc4; --accent-hover: #c8cfd5; --on-accent: #121416;
}
:root[data-theme="dark"][data-accent="clay"] {
  --bg: #181210; --text: #f3ebe5; --muted: #b0a095; --faint: #82746a; --line: #41352f;
  --control-border: #7d6e63; --accent: #d99a78; --accent-hover: #e5b094; --on-accent: #1a1009;
}
:root[data-theme="dark"][data-accent="ochre"] {
  --bg: #16140d; --text: #f0ecde; --muted: #a9a28a; --faint: #7c7560; --line: #3d3829;
  --control-border: #756e57; --accent: #d8b25a; --accent-hover: #e4c47a; --on-accent: #191208;
}
:root[data-theme="dark"][data-accent="heather"] {
  --bg: #15111a; --text: #eee9f2; --muted: #a597b0; --faint: #786b84; --line: #3b3245;
  --control-border: #73667f; --accent: #c3a3d0; --accent-hover: #d3b9de; --on-accent: #150f19;
}

/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sprout { from { opacity: 0; transform: scale(0.2) rotate(-50deg); } }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 1; } 70% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur); animation-timing-function: ease; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
       scroll-padding-top: calc(var(--nav-h) + var(--space-4)); }
body {
  position: relative; margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-base) / 1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-family: var(--font-serif); font-weight: 500; font-size: var(--fs-4xl); line-height: 1.15; letter-spacing: -0.015em; }
h1.display { font-size: var(--fs-display); line-height: 1.05; }
h2 { font-size: var(--fs-3xl); line-height: 1.2; }
h3 { font-size: var(--fs-2xl); line-height: 1.25; }
h4 { font-size: var(--fs-xl);  line-height: 1.3; }
h5 { font-size: var(--fs-lg);  line-height: 1.35; }
@media (max-width: 599px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
}
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.lead { font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1.55; color: var(--muted); }
.prose { max-width: var(--prose-max); font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1.65; }
.mono, code, kbd, pre { font-family: var(--font-mono); }
code { font-size: 0.9em; background: var(--tone-1); padding: 2px 6px; border-radius: var(--leaf-xs); }
.eyebrow { font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-7) 0; }
img, svg { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-4); top: calc(var(--space-10) * -1); z-index: 60;
              padding: var(--space-2) var(--space-4); border-radius: var(--leaf-sm); background: var(--accent);
              color: var(--on-accent); font-weight: 500; text-decoration: none;
              transition: top var(--dur-fast) var(--ease); }
.skip-link:focus { top: var(--space-2); color: var(--on-accent); }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-thickness: 1px; transition: color var(--dur-fast); }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--content-max) + 2 * var(--page-pad));
             margin-inline: auto; padding-inline: var(--page-pad); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
        gap: 0 var(--col-gap); align-items: start; }
.group { min-width: 0; }
.group > :first-child { margin-top: 0; }
.group > h3 { margin: var(--space-7) 0 var(--space-3); font-size: var(--fs-xl); }
.group > h3:first-child { margin-top: 0; }
.with-sidebar { display: grid; grid-template-columns: 1fr; gap: var(--space-7); }
@media (min-width: 960px) { .with-sidebar { grid-template-columns: 248px 1fr; } }

/* ---------- Logo ---------- */
.logo { display: block; height: 42px; width: auto; }
.logo.sm { height: 28px; }
.logo.lg { height: 60px; }
.logo.xl { height: 72px; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ---------- Motifs ---------- */
.lattice { position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 480px; pointer-events: none;
           -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.lattice > i { position: absolute; inset: 0; background: var(--accent); opacity: 0.2;
               -webkit-mask: url("motifs/lattice.svg") 0 0 / 36px 36px repeat;
               mask: url("motifs/lattice.svg") 0 0 / 36px 36px repeat; }
.trunk { position: relative; padding-left: var(--gutter); }
.vine { position: absolute; left: 0; top: 0; bottom: 0; width: var(--gutter); background: var(--accent);
        -webkit-mask: url("motifs/vine.svg") center top / 24px 80px repeat-y;
        mask: url("motifs/vine.svg") center top / 24px 80px repeat-y; }
.trunk > section { position: relative; margin-top: var(--space-10); padding-top: var(--space-7); }
.trunk > section > h2 { margin-bottom: var(--space-6); }
.trunk > section::before {          /* the slat */
  content: ""; position: absolute; top: 0; left: calc(var(--gutter) / -2 - 12px); right: 0; height: 2px;
  border-radius: 1px; background: linear-gradient(90deg, var(--wire) 55%, transparent); }
.trunk > section::after {           /* the diamond where slat and vine cross */
  content: ""; position: absolute; top: -3px; left: calc(var(--gutter) / -2 - 4px);
  width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }

.hub-hero { padding-top: var(--space-7); }
.hub-hero .lead { max-width: 52ch; margin-top: var(--space-5); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-top: var(--space-6); }
.js .hub-hero > * { animation: rise var(--dur-slow) var(--ease) both; }
.js .hub-hero > :nth-child(2) { animation-delay: 80ms; }
.js .hub-hero > :nth-child(3) { animation-delay: 160ms; }

/* scroll reveal: an enhancement. Content is visible without scripts, and a CSS failsafe
   shows it after 2s even if motion.js never loads. */
.js [data-reveal] > * { opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.js [data-reveal].is-visible > * { opacity: 1; transform: none; }
.js [data-reveal]:not(.is-visible) > * { animation: reveal-failsafe 0s 2s forwards; }
.js [data-reveal].is-visible > :nth-child(2) { transition-delay: 80ms; }
.js [data-reveal].is-visible > :nth-child(3) { transition-delay: 160ms; }
.js [data-reveal].is-visible > :nth-child(n + 4) { transition-delay: 240ms; }
.js .trunk > section[data-reveal]::before { transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--dur-slow) var(--ease); }
.js .trunk > section[data-reveal]::after { transform: rotate(45deg) scale(0);
  transition: transform var(--dur) var(--ease) 120ms; }
.js .trunk > section[data-reveal].is-visible::before { transform: none; }
.js .trunk > section[data-reveal].is-visible::after { transform: rotate(45deg) scale(1); }

/* ---------- Ivy leaf and tendril ---------- */
.ivy { width: 1em; height: 1em; overflow: visible; }
.ivy .blade { fill: var(--leaf-fill, var(--bg)); stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round;
              transition: fill var(--dur-fast); }
.ivy .veins { fill: none; stroke: var(--leaf-vein, currentColor); stroke-width: 1.3; stroke-linecap: round;
              transition: stroke var(--dur-fast); }
.ivy .stem { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.tendril { width: 44px; height: 10px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.tendril path { stroke-dasharray: 1; animation: draw 1.3s var(--ease) infinite; }

/* leaf toggle on the vine (Hub pages) */
.leaf-toggle { position: absolute; left: calc(var(--gutter) * -1); width: var(--gutter); height: 44px;
               display: grid; place-items: center; color: var(--accent); font-size: 28px; cursor: pointer; }
.leaf-toggle::before { content: ""; position: absolute; width: 32px; height: 32px; border-radius: var(--round); background: var(--bg); }
.leaf-toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.leaf-toggle .ivy { position: relative; transition: transform var(--dur-fast) var(--ease); }
.leaf-toggle:hover .ivy { transform: rotate(-8deg) scale(1.1); }
.leaf-toggle input:checked ~ .ivy { --leaf-fill: currentColor; --leaf-vein: var(--bg); }
.leaf-toggle input:focus-visible ~ .ivy { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Containers on tone-2 and tone-3 ----------
   Secondary text and plain (classless) links need a little more contrast on the stronger tones. */
.launcher-panel, .menu-panel, dialog.dialog, .estimate, .toast, .bulk-bar, [data-tip]::after { --muted: var(--muted-strong); }
:where(.panel, .upload, .launcher-panel, .menu-panel, dialog.dialog, .estimate, .notice) a:not([class]) { color: var(--accent-hover); }

/* ---------- Tooltips ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  padding: 6px 10px; border-radius: var(--leaf-xs); background: var(--tone-3); color: var(--text);
  font: 400 var(--fs-xs) / 1.3 var(--font-sans); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-fast) 500ms; }
@media (hover: hover) { [data-tip]:hover::after { opacity: 1; } }
[data-tip]:focus-visible::after { opacity: 1; transition-delay: 0s; }
details[open] > [data-tip]::after { display: none; }

/* ---------- Top navigation ---------- */
.site-nav { background: var(--bg); }
.site-nav .container { position: relative; display: flex; align-items: center; gap: var(--space-6); height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-app { font-weight: 500; font-size: var(--fs-ui); color: var(--muted);
             margin-inline-start: max(0px, calc(21px - var(--space-3)));
             padding-left: var(--space-3); border-left: 1px solid var(--line); line-height: 24px; }
.nav-links { display: flex; align-items: center; gap: var(--space-1); }
.nav-links a { display: inline-flex; align-items: center; height: var(--control-h); padding: 0 var(--space-3);
               border-radius: var(--leaf-sm); font-size: var(--fs-ui); font-weight: 500;
               color: var(--muted); text-decoration: none;
               transition: background var(--dur-fast), color var(--dur-fast), border-radius var(--dur) var(--ease); }
.nav-links a:active { background: var(--tone-2); color: var(--text); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .nav-links a:hover { background: var(--tone-1); color: var(--text); border-radius: var(--leaf-sm-flip); } }
.nav-links a[aria-current="page"] { background: var(--tone-2); color: var(--text); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.nav-actions form { display: flex; margin: 0; }
.identity { display: flex; align-items: center; gap: var(--space-2); margin-inline: var(--space-1);
            color: var(--muted); font-size: var(--fs-sm); }
.presence { display: inline-block; width: 7px; height: 7px; border-radius: var(--round);
            background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }

.icon-button { position: relative; display: grid; place-items: center; width: var(--control-h); height: var(--control-h);
               padding: 0; border: 0; border-radius: var(--leaf-sm); background: transparent; color: var(--text);
               cursor: pointer; list-style: none;
               transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.icon-button::-webkit-details-marker { display: none; }
.icon-button:active, details[open] > .icon-button { background: var(--tone-2); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .icon-button:hover { background: var(--tone-1); border-radius: var(--leaf-sm-flip); } }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor;
                   stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun, .theme-toggle .moon { position: absolute; inset: 0; margin: auto;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.theme-toggle .moon { opacity: 0; transform: rotate(70deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(-70deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: none; }

@media (max-width: 599px) {
  .identity, .brand-app { display: none; }
  .nav-links { display: none; }
}

/* ---------- Haze (menus on small screens, launcher everywhere) ---------- */
.launcher[open]::before {
  content: ""; position: fixed; inset: 0; z-index: 20;
  background: color-mix(in srgb, var(--veil) var(--veil-alpha), transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade var(--dur) var(--ease); }
@media (max-width: 599px) {
  .menu[open]::before {
    content: ""; position: fixed; inset: 0; z-index: 20;
    background: color-mix(in srgb, var(--veil) var(--veil-alpha), transparent);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: fade var(--dur) var(--ease); }
}
@media (prefers-reduced-transparency: reduce) {
  .launcher[open]::before, .menu[open]::before { -webkit-backdrop-filter: none; backdrop-filter: none;
    background: color-mix(in srgb, var(--veil) 80%, transparent); }
}
.launcher > summary, .menu > summary { position: relative; z-index: 21; }

/* ---------- App launcher ---------- */
.launcher { position: static; }
.launcher > summary { list-style: none; }
.launcher-panel { position: absolute; top: calc(100% - var(--space-1)); right: var(--page-pad); z-index: 21;
                  width: min(380px, calc(100vw - 2 * var(--page-pad)));
                  max-height: 70vh; overflow-y: auto; padding: 10px;
                  background: var(--tone-2); border-radius: var(--leaf-lg);
                  animation: rise var(--dur) var(--ease); }
.launcher-group { animation: rise var(--dur) var(--ease) both; }
.launcher-group:nth-child(2) { animation-delay: 60ms; }
.launcher-group:nth-child(3) { animation-delay: 120ms; }
.launcher-group + .launcher-group { margin-top: var(--space-3); }
.launcher-label { margin: 0; padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--fs-xs); color: var(--muted); }
.launcher-item { display: flex; align-items: center; }
.launcher-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3);
                 min-height: 48px; padding: var(--space-2) var(--space-3); border-radius: var(--leaf-sm);
                 color: var(--text); text-decoration: none;
                 transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.launcher-link:active { background: var(--tone-3); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .launcher-link:hover { background: var(--tone-3); color: var(--text); border-radius: var(--leaf-sm-flip); } }
.launcher-link[aria-current="true"] { background: var(--tone-3); }
.launcher-link > svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; color: var(--muted);
                       stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.launcher-name { display: block; font-size: var(--fs-ui); font-weight: 500; }
.launcher-desc { display: block; font-size: var(--fs-xs); color: var(--muted);
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launcher-fav { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
                border: 0; background: transparent; color: var(--accent); font-size: 22px; cursor: pointer; }
.launcher-fav .ivy { --leaf-fill: var(--tone-2); transition: transform var(--dur-fast) var(--ease); }
.launcher-fav:hover .ivy { transform: rotate(-8deg) scale(1.1); }
.launcher-fav[aria-pressed="true"] .ivy { --leaf-fill: currentColor; --leaf-vein: var(--tone-2); }
.launcher-status { display: flex; align-items: center; gap: var(--space-3); margin: 0; padding: var(--space-3);
                   font-size: var(--fs-sm); color: var(--muted); }
.launcher-all { margin: var(--space-2) var(--space-3) var(--space-1); }

/* ---------- Buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
          height: var(--control-h); padding: 0 var(--space-5); border: 0; border-radius: var(--leaf-sm);
          font: 500 var(--fs-ui) / 1 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer;
          transition: border-radius var(--dur) var(--ease), background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast); }
.button:active { transform: translateY(1px); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .button:hover { border-radius: var(--leaf-sm-flip); } }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:active { background: color-mix(in oklab, var(--accent) 72%, var(--text)); color: var(--on-accent); }
@media (hover: hover) { .button.primary:hover { background: var(--accent-hover); color: var(--on-accent); } }
.button.tonal { background: var(--tone-3); color: var(--text); }
.button.tonal:active { background: color-mix(in oklab, var(--tone-3) 78%, var(--text)); color: var(--text); }
@media (hover: hover) { .button.tonal:hover { background: color-mix(in oklab, var(--tone-3) 88%, var(--text)); color: var(--text); } }
.button.danger { background: var(--danger); color: var(--on-danger); }
.button.danger:active { background: color-mix(in oklab, var(--danger) 75%, var(--text)); color: var(--on-danger); }
@media (hover: hover) { .button.danger:hover { background: color-mix(in oklab, var(--danger) 86%, var(--text)); color: var(--on-danger); } }
.button.text { padding: 0 var(--space-1); border-radius: 0; background: none; color: var(--text);
               text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px;
               text-underline-offset: 6px; transition: color var(--dur-fast), text-underline-offset var(--dur) var(--ease); }
.button.text:active { color: var(--accent); text-underline-offset: 9px; transform: none; border-radius: 0; }
@media (hover: hover) { .button.text:hover { color: var(--accent); text-underline-offset: 9px; border-radius: 0; } }
.button.sm { height: 32px; padding: 0 var(--space-3); font-size: var(--fs-sm); }
.button.lg { height: 44px; padding: 0 var(--space-6); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; pointer-events: none; }
.button[aria-busy="true"] { pointer-events: none; }
.button.primary .tendril, .button.danger .tendril { stroke: currentColor; }
.button .tendril { stroke: currentColor; }

/* ---------- Fields ---------- */
.field { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); }
.field > label, .label { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.error-text { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--danger); }
.control { position: relative; }
.control::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent);
                  transform: scaleX(0); transition: transform var(--dur) var(--ease); }
.control:focus-within::after { transform: none; }
.input, .select, .textarea {
  display: block; width: 100%; height: var(--control-h); padding: 0 var(--space-3);
  border: 0; border-radius: var(--field-radius); background: var(--tone-1); color: var(--text);
  box-shadow: inset 0 -2px 0 var(--control-line); outline: none;
  font: 400 var(--fs-ui) / 1.4 var(--font-sans);
  transition: background var(--dur-fast); }
.input:hover, .select:hover, .textarea:hover, .input:focus, .select:focus, .textarea:focus { background: var(--tone-2); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { height: auto; min-height: 96px; padding: var(--space-3); resize: vertical; }
.field[data-invalid] .input, .field[data-invalid] .select, .field[data-invalid] .textarea { box-shadow: inset 0 -2px 0 var(--danger); }
.field[data-invalid] .control::after { background: var(--danger); transform: none; }
.input[disabled], .select[disabled], .textarea[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: inset 0 -2px 0 var(--line); }

/* checkbox, radio, switch: real inputs, replaced visually */
.check { position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; }
.check > input { position: absolute; left: 0; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.check .mark { position: relative; flex: none; width: 24px; height: 24px; border-radius: var(--leaf-xs);
               background: var(--tone-1); box-shadow: inset 0 0 0 2px var(--control-line);
               transition: background var(--dur-fast), box-shadow var(--dur-fast); }
.check .mark svg { position: absolute; inset: 0; width: 24px; height: 24px; fill: none; stroke: var(--on-accent);
                   stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
                   stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur-fast); }
.check > input:checked + .mark { background: var(--accent); box-shadow: none; }
.check > input:checked + .mark svg { stroke-dashoffset: 0; }
.check.radio .mark { border-radius: var(--round); }
.check.radio .mark::after { content: ""; position: absolute; inset: 6px; border-radius: var(--round); background: var(--accent);
                            transform: scale(0); transition: transform var(--dur) var(--ease); }
.check.radio > input:checked + .mark { background: var(--tone-1); box-shadow: inset 0 0 0 2px var(--accent); }
.check.radio > input:checked + .mark::after { transform: none; }
.check.switch .mark { width: 46px; height: 26px; border-radius: var(--leaf-sm); background: var(--tone-2); box-shadow: none; }
.check.switch .mark .ivy { position: absolute; left: 4px; top: 3px; width: 20px; height: 20px; color: var(--control-line);
                           transition: transform var(--dur) var(--ease), color var(--dur-fast); }
.check.switch > input:checked + .mark { background: var(--accent); }
.check.switch > input:checked + .mark .ivy { transform: translateX(20px); color: var(--on-accent);
                                             --leaf-fill: var(--on-accent); --leaf-vein: var(--accent); }
.check > input:focus-visible + .mark { outline: 2px solid var(--accent); outline-offset: 3px; }

/* upload */
.upload { padding: var(--space-5); background: var(--tone-1); border-radius: var(--leaf-lg); transition: background var(--dur-fast); }
.upload:hover, .upload[data-dragover] { background: var(--tone-2); }

/* ---------- Tabs and filters ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.tab { position: relative; display: inline-flex; }
.tab > input { position: absolute; inset: 0; margin: 0; opacity: 0; }
.tab > span { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px;
              color: var(--muted); font-size: var(--fs-ui); cursor: pointer; transition: color var(--dur-fast); }
.tab > span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
                     transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--dur) var(--ease); }
@media (hover: hover) { .tab:hover > span { color: var(--text); } .tab:hover > span::after { transform: scaleX(0.3); } }
.tab > input:checked + span { color: var(--text); }
.tab > input:checked + span::after { transform: none; }
.tab > input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none;
               font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

.accordion > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px;
                       padding: 0 var(--space-3); margin: 0 calc(var(--space-3) * -1); border-radius: var(--leaf-sm);
                       cursor: pointer; list-style: none; font-weight: 500;
                       transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.accordion > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .accordion > summary:hover { background: var(--tone-1); border-radius: var(--leaf-sm-flip); } }
.accordion > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0;
                              transform: rotate(45deg); transition: transform var(--dur-fast) var(--ease); }
.accordion[open] > summary::after { transform: rotate(-135deg); }

/* ---------- Panels, rows, tables ---------- */
.panel { background: var(--tone-1); border-radius: var(--leaf-lg); padding: var(--space-5); }
.panel > :last-child { margin-bottom: 0; }

.row-link { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
            padding: var(--space-3); margin-inline: calc(var(--space-3) * -1); border-radius: var(--leaf-sm);
            color: var(--text); text-decoration: none;
            transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.row-link:active { background: var(--tone-2); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .row-link:hover { background: var(--tone-1); color: var(--text); border-radius: var(--leaf-sm-flip); } }
.row-link .name { font-weight: 500; transition: transform var(--dur) var(--ease); }
.row-link:active .name { transform: translateX(3px); }
@media (hover: hover) { .row-link:hover .name { transform: translateX(3px); } }

.app-link { display: block; padding: var(--space-3); margin-inline: calc(var(--space-3) * -1); border-radius: var(--leaf-sm);
            color: var(--text); text-decoration: none;
            transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.app-link:active { background: var(--tone-2); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .app-link:hover { background: var(--tone-1); color: var(--text); border-radius: var(--leaf-sm-flip); } }
.app-name { display: block; font-size: var(--fs-3xl); font-weight: 500; line-height: 1.05; letter-spacing: -0.01em;
            transition: transform var(--dur) var(--ease); }
@media (min-width: 600px) { .app-name { font-size: var(--fs-4xl); } }
.app-link:active .app-name { transform: translateX(3px); }
@media (hover: hover) { .app-link:hover .app-name { transform: translateX(3px); } }
.app-desc { display: block; margin-top: var(--space-1); color: var(--muted); }
.app-row { position: relative; }
.app-row .leaf-toggle { top: 8px; }
.app-row.is-entering { animation: rise var(--dur) var(--ease) both; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
.table th { text-align: left; font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
            padding: var(--space-3) var(--space-4); background: var(--tone-1); }
.table th button { all: unset; display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer; }
.table th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover { background: var(--tone-1); }
.table tbody tr[aria-selected="true"] { background: var(--tone-2); }
.table.dense td, .table.dense th { padding-block: var(--space-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2);
            padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--leaf-sm);
            background: var(--tone-3); font-size: var(--fs-ui); }

/* ---------- Badges, status, notices, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 22px; padding: 0 var(--space-2);
         border-radius: var(--leaf-xs); font-size: var(--fs-xs); font-weight: 500; line-height: 1;
         background: var(--b, var(--tone-1)); color: color-mix(in srgb, var(--c, var(--muted)) 78%, var(--text)); }
.badge.accent  { --c: var(--accent);  --b: var(--tone-2); }
.badge.success { --c: var(--success); --b: var(--success-soft); }
.badge.warning { --c: var(--warning); --b: var(--warning-soft); }
.badge.danger  { --c: var(--danger);  --b: var(--danger-soft); }
.badge.info    { --c: var(--info);    --b: var(--info-soft); }
.status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: var(--round); background: var(--c, var(--muted)); }
.status.success { --c: var(--success); } .status.warning { --c: var(--warning); } .status.danger { --c: var(--danger); }

.notice { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--leaf-sm); background: var(--tone-1); }
.notice > svg { flex: none; width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: currentColor;
                stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.notice.success { background: var(--success-soft); } .notice.success > svg { color: var(--success); }
.notice.warning { background: var(--warning-soft); } .notice.warning > svg { color: var(--warning); }
.notice.danger  { background: var(--danger-soft); }  .notice.danger > svg  { color: var(--danger); }
.notice.info    { background: var(--info-soft); }    .notice.info > svg    { color: var(--info); }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--leaf-sm);
          background: var(--tone-3); font-weight: 600; font-size: var(--fs-sm); }
.avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.avatar.lg { width: 40px; height: 40px; font-size: var(--fs-base); }

/* ---------- Menus, dialogs, toasts ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu-panel { position: absolute; top: calc(100% + var(--space-2)); right: 0; z-index: 21; min-width: 200px; padding: 10px;
              background: var(--tone-2); border-radius: var(--leaf-lg); animation: rise var(--dur) var(--ease); }
.menu-item { display: flex; align-items: center; min-height: var(--control-h); padding: 0 var(--space-3);
             border-radius: var(--leaf-sm); color: var(--text); text-decoration: none; cursor: pointer;
             transition: background var(--dur-fast), border-radius var(--dur) var(--ease); }
.menu-item:active { background: var(--tone-3); border-radius: var(--leaf-sm-flip); }
@media (hover: hover) { .menu-item:hover { background: var(--tone-3); color: var(--text); border-radius: var(--leaf-sm-flip); } }

dialog.dialog { width: calc(100% - 2 * var(--space-4)); max-width: 480px; padding: var(--space-6); border: 0;
                background: var(--tone-2); color: var(--text); border-radius: var(--leaf-lg); }
dialog.dialog[open] { animation: rise var(--dur) var(--ease); }
dialog.dialog::backdrop { background: color-mix(in srgb, var(--veil) var(--veil-alpha), transparent);
                          -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.dialog[open]::backdrop { animation: fade var(--dur) var(--ease); }
@media (prefers-reduced-transparency: reduce) {
  dialog.dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none;
                            background: color-mix(in srgb, var(--veil) 80%, transparent); }
}
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); }

.toast { position: fixed; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); z-index: 40;
         display: flex; align-items: center; gap: var(--space-3); max-width: min(420px, calc(100% - 2 * var(--space-4)));
         padding: 10px 10px 10px var(--space-4); border-radius: var(--leaf-lg);
         background: var(--tone-3); color: var(--text); font-size: var(--fs-ui); line-height: 1.35;
         opacity: 0; visibility: hidden; transform: translate(-50%, 16px);
         transition: opacity var(--dur-fast) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur-fast); }
.toast.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.toast .ivy { flex: none; font-size: 20px; color: var(--accent); --leaf-fill: currentColor; --leaf-vein: var(--tone-3); }
.toast.is-open .ivy { animation: sprout var(--dur) var(--ease) 100ms both; }

/* ---------- Loading, empty, code, settings, drag ---------- */
.skeleton { height: 14px; margin-bottom: var(--space-3); border-radius: var(--leaf-xs); background: var(--tone-2);
            animation: pulse 1.6s ease-in-out infinite; }
progress.progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0;
                    border-radius: var(--leaf-xs); background: var(--tone-2); overflow: hidden; }
progress.progress::-webkit-progress-bar { background: var(--tone-2); }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: var(--leaf-xs); }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: var(--leaf-xs); }

.empty > p { font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--muted); max-width: var(--prose-max); }

.code-block { position: relative; }
.code-block pre { margin: 0; padding: 44px var(--space-4) var(--space-4); overflow-x: auto; border-radius: var(--leaf-sm);
                  background: var(--tone-1); font-size: var(--fs-sm); line-height: 1.5; }
.code-block pre code { background: none; padding: 0; }
.code-block .button { position: absolute; top: 6px; right: 6px; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0; }
@media (max-width: 599px) { .setting-row { flex-direction: column; align-items: flex-start; } }

.dragging { position: relative; z-index: 4; transform: rotate(7deg) scale(1.08); box-shadow: var(--shadow-lift); cursor: grabbing; }
.drop-caret { display: inline-block; width: 4px; border-radius: 2px; background: var(--accent); }
.drop-zone[data-over] { background: var(--tone-2); }

/* ---------- Auth and error panels ---------- */
.auth-wrap { display: grid; place-items: start center; padding-block: var(--space-9); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { margin-bottom: 30px; }
.error-panel { max-width: 640px; }
.estimate { margin-top: var(--space-5); padding: var(--space-3) var(--space-4); border-radius: var(--leaf-sm); background: var(--tone-2); }

/* ---------- Footer (slim, one line) ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--space-9); padding-block: 14px;
               font-size: var(--fs-sm); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.footer-links a, .footer-meta { color: var(--muted); }
.footer-links a:hover, .footer-meta:hover { color: var(--text); }
.footer-meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); text-decoration: none; }
.footer-meta:hover { text-decoration: underline; }

/* ---------- More contrast ---------- */
@media (prefers-contrast: more) {
  :root { --tone-1: color-mix(in oklab, var(--accent) 16%, var(--bg));
          --tone-2: color-mix(in oklab, var(--accent) 26%, var(--bg));
          --tone-3: color-mix(in oklab, var(--accent) 38%, var(--bg));
          --muted: color-mix(in oklab, var(--text) 85%, var(--bg)); }
}

/* ---------- Forced colors: tones vanish, so give shapes real outlines ---------- */
@media (forced-colors: active) {
  .panel, .upload, .launcher-panel, .menu-panel, dialog.dialog, .toast, .bulk-bar, .estimate, .notice,
  .input, .select, .textarea, .button.primary, .button.tonal, .button.danger, .badge, .avatar, code, .code-block pre
    { border: 1px solid CanvasText; }
  .check .mark { border: 1px solid CanvasText; }
  .check > input:focus-visible + .mark, :focus-visible { outline-color: Highlight; }
  .control:focus-within { outline: 2px solid Highlight; }
  .ivy .blade, .ivy .stem, .ivy .veins { stroke: CanvasText; }
  .lattice, .vine, .trunk > section::before, .trunk > section::after { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .js [data-reveal] > * { opacity: 1; transform: none; }
  .js .trunk > section[data-reveal]::before { transform: none; }
  .js .trunk > section[data-reveal]::after { transform: rotate(45deg); }
  .tendril path { stroke-dashoffset: 0; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 18mm; }
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --text: #000; --muted: #333; --line: #bbb; }
  body { background: #fff; color: #000; }
  .site-nav, .launcher, .theme-toggle, .lattice, .vine, .toast, .button, .skip-link,
  .trunk > section::before, .trunk > section::after { display: none !important; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .panel, .table tr, pre, .notice { break-inside: avoid; }
  .js [data-reveal] > * { opacity: 1; transform: none; }
}
