/* QUIETPASS service site: design tokens, base styles and shared components.
   First-party only. The site CSP allows no inline style, no data: images and no web fonts. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans CJK SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #060a12;
  --bg-2: #0a1120;
  --surface: #0e1628;
  --surface-2: #131d34;
  --surface-3: #1a2745;
  --glass: rgba(8, 13, 25, .68);
  --field: rgba(7, 12, 24, .72);
  --hover: rgba(150, 185, 255, .08);
  --line: rgba(150, 185, 255, .12);
  --line-2: rgba(150, 185, 255, .22);
  --ink: #eaf0ff;
  --ink-2: #aab7d6;
  --ink-3: #8696b9;
  --accent: #34dcb7;
  --accent-2: #3fb0ff;
  --accent-text: #5ff0cb;
  --on-accent: #03201a;
  --grad-accent: linear-gradient(135deg, #7bf7da 0%, #34dcb7 46%, #3fb0ff 100%);
  --grad-text: linear-gradient(100deg, #8ff9e0 0%, #43e0bd 38%, #4db6ff 100%);
  --accent-glow: rgba(52, 220, 183, .42);
  --one: #ffd58a;
  --one-text: #ffd58a;
  --one-2: #ff9f73;
  --one-glow: rgba(255, 190, 110, .5);
  --grad-one: linear-gradient(100deg, #ffe3a3 0%, #ffc070 50%, #ff9f73 100%);
  --ring: rgba(95, 240, 203, .38);
  --spot: rgba(95, 240, 203, .13);
  --ok: #45e6a2;
  --warn: #ffc35c;
  --danger: #ff8392;
  --info: #7cbcff;
  --orb-1: rgba(52, 220, 183, .17);
  --orb-2: rgba(63, 176, 255, .16);
  --orb-3: rgba(255, 195, 92, .07);
  --grid-line: rgba(150, 185, 255, .055);
  --shadow-soft: rgba(0, 0, 0, .42);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --sh-2: 0 1px 1px rgba(0, 0, 0, .18), 0 4px 10px -2px rgba(0, 0, 0, .28), 0 18px 36px -12px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .05) inset;
  --sh-3: 0 2px 2px rgba(0, 0, 0, .2), 0 10px 20px -4px rgba(0, 0, 0, .34), 0 34px 64px -18px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .07) inset;

  --r-sm: .6rem;
  --r-md: .95rem;
  --r-lg: 1.4rem;
  --r-xl: 1.9rem;
  /* The one content width of the whole service: public pages, account and console share it. */
  --shoulder: clamp(74rem, 70vw, 120rem);
  --gut: clamp(1rem, 4vw, 2rem);
  --top-h: 4.25rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --fs-xs: .75rem;
  --fs-sm: .82rem;
  --fs-lg: 1rem;
  --fs-xl: clamp(1.05rem, .98rem + .3vw, 1.2rem);
  --fs-2xl: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  --fs-hero: clamp(1.9rem, 1.2rem + 2.6vw, 2.7rem);
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f5fb;
    --bg-2: #e8eef8;
    --surface: #ffffff;
    --surface-2: #f6f8fd;
    --surface-3: #edf1fa;
    --glass: rgba(255, 255, 255, .72);
    --field: rgba(255, 255, 255, .9);
    --hover: rgba(18, 36, 80, .06);
    --line: rgba(18, 36, 80, .11);
    --line-2: rgba(18, 36, 80, .2);
    --ink: #0a1226;
    --ink-2: #434f6e;
    --ink-3: #596688;
    --accent-text: #0a7a67;
    --accent-glow: rgba(14, 160, 134, .32);
    --one: #d9822b;
    --one-text: #945100;
    --one-2: #c5503a;
    --one-glow: rgba(217, 130, 43, .34);
    --grad-one: linear-gradient(100deg, #e0912e 0%, #d9722b 55%, #c5503a 100%);
    --ring: rgba(14, 160, 134, .3);
    --spot: rgba(14, 160, 134, .1);
    --ok: #08754c;
    --warn: #8f5400;
    --danger: #c52b44;
    --info: #1f6fc2;
    --orb-1: rgba(52, 220, 183, .22);
    --orb-2: rgba(63, 176, 255, .2);
    --orb-3: rgba(255, 195, 92, .14);
    --grid-line: rgba(18, 36, 80, .06);
    --shadow-soft: rgba(18, 36, 80, .14);
    --grad-text: linear-gradient(100deg, #0a9d82 0%, #0b8f9e 45%, #1c74d6 100%);
    --sh-1: 0 1px 2px rgba(18, 36, 80, .1), 0 1px 0 rgba(255, 255, 255, .9) inset;
    --sh-2: 0 1px 1px rgba(18, 36, 80, .06), 0 4px 10px -2px rgba(18, 36, 80, .1), 0 18px 36px -14px rgba(18, 36, 80, .2), 0 1px 0 rgba(255, 255, 255, .9) inset;
    --sh-3: 0 2px 2px rgba(18, 36, 80, .08), 0 10px 20px -4px rgba(18, 36, 80, .14), 0 34px 64px -20px rgba(18, 36, 80, .3), 0 1px 0 rgba(255, 255, 255, .9) inset;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5fb;
  --bg-2: #e8eef8;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --surface-3: #edf1fa;
  --glass: rgba(255, 255, 255, .72);
  --field: rgba(255, 255, 255, .9);
  --hover: rgba(18, 36, 80, .06);
  --line: rgba(18, 36, 80, .11);
  --line-2: rgba(18, 36, 80, .2);
  --ink: #0a1226;
  --ink-2: #434f6e;
  --ink-3: #596688;
  --accent-text: #0a7a67;
  --accent-glow: rgba(14, 160, 134, .32);
  --one: #d9822b;
  --one-text: #945100;
  --one-2: #c5503a;
  --one-glow: rgba(217, 130, 43, .34);
  --grad-one: linear-gradient(100deg, #e0912e 0%, #d9722b 55%, #c5503a 100%);
  --ring: rgba(14, 160, 134, .3);
  --spot: rgba(14, 160, 134, .1);
  --ok: #08754c;
  --warn: #8f5400;
  --danger: #c52b44;
  --info: #1f6fc2;
  --orb-1: rgba(52, 220, 183, .22);
  --orb-2: rgba(63, 176, 255, .2);
  --orb-3: rgba(255, 195, 92, .14);
  --grid-line: rgba(18, 36, 80, .06);
  --shadow-soft: rgba(18, 36, 80, .14);
  --grad-text: linear-gradient(100deg, #0a9d82 0%, #0b8f9e 45%, #1c74d6 100%);
  --sh-1: 0 1px 2px rgba(18, 36, 80, .1), 0 1px 0 rgba(255, 255, 255, .9) inset;
  --sh-2: 0 1px 1px rgba(18, 36, 80, .06), 0 4px 10px -2px rgba(18, 36, 80, .1), 0 18px 36px -14px rgba(18, 36, 80, .2), 0 1px 0 rgba(255, 255, 255, .9) inset;
  --sh-3: 0 2px 2px rgba(18, 36, 80, .08), 0 10px 20px -4px rgba(18, 36, 80, .14), 0 34px 64px -20px rgba(18, 36, 80, .3), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

/* The operator console uses a warm accent so it is never mistaken for the customer site. */
:root[data-surface="operator"] {
  --accent: #ffb84d;
  --accent-2: #ff8f5a;
  --accent-text: #ffcd6b;
  --on-accent: #2a1600;
  --grad-accent: linear-gradient(135deg, #ffe08a 0%, #ffb84d 48%, #ff8f5a 100%);
  --grad-text: linear-gradient(100deg, #ffe08a 0%, #ffb84d 45%, #ff9a6a 100%);
  --accent-glow: rgba(255, 184, 77, .4);
  --ring: rgba(255, 184, 77, .4);
  --spot: rgba(255, 184, 77, .12);
  --orb-1: rgba(255, 184, 77, .15);
  --orb-2: rgba(255, 143, 90, .12);
  --orb-3: rgba(63, 176, 255, .08);
}

@media (prefers-color-scheme: light) {
  :root[data-surface="operator"]:not([data-theme="dark"]) {
    --accent-text: #8f4f00;
    --accent-glow: rgba(214, 140, 20, .3);
    --ring: rgba(214, 140, 20, .32);
    --spot: rgba(214, 140, 20, .1);
    --grad-text: linear-gradient(100deg, #c27400 0%, #d4620a 50%, #c2410c 100%);
  }
}

:root[data-surface="operator"][data-theme="light"] {
  --accent-text: #8f4f00;
  --accent-glow: rgba(214, 140, 20, .3);
  --ring: rgba(214, 140, 20, .32);
  --spot: rgba(214, 140, 20, .1);
  --grad-text: linear-gradient(100deg, #c27400 0%, #d4620a 50%, #c2410c 100%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
@media (min-width: 80rem) {
  html { font-size: clamp(1rem, calc(.86rem + .2vw), 1.125rem); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .938rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* clip, not hidden: when a popup locks the page, hidden would turn body into a scroll box and Safari then loses the sticky header. */
  overflow-x: hidden;
  overflow-x: clip;
  overflow-wrap: anywhere;
}
main { flex: 1 0 auto; display: block; outline: 0; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd { font-family: var(--font-mono); }
b, strong { font-weight: 650; }
::selection { background: var(--ring); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: .4rem; }
[hidden] { display: none !important; }

/* The fixed backdrop: drifting colour orbs under a faint grid.
   The layer is exactly the viewport (never larger) and drifts by moving its
   background, not by transforming an oversized box: a bigger-than-viewport
   fixed layer can stretch the scrollable area on newer mobile Safari and leave
   blank space below the footer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(50% 50% at 8% 8%, var(--orb-1), transparent 70%),
    radial-gradient(44% 44% at 92% 19%, var(--orb-2), transparent 70%),
    radial-gradient(52% 52% at 60% 100%, var(--orb-3), transparent 72%);
  background-repeat: no-repeat;
  background-size: 115% 115%;
  background-position: 50% 50%;
}
@media (min-width: 48rem) and (hover: hover) {
  body::before { animation: drift 46s ease-in-out infinite alternate; }
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 72%);
}
@keyframes drift {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1.1rem;
  background: var(--accent); color: var(--on-accent); border-radius: 999px; font-weight: 650; text-decoration: none;
  transition: top .25s var(--ease);
}
.skip:focus { top: 1rem; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-2); }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: var(--shoulder); margin-inline: auto; padding-inline: max(var(--gut), env(safe-area-inset-left)) max(var(--gut), env(safe-area-inset-right)); }

/* Reading progress bar, driven by script. */
.scrollbar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70; pointer-events: none; }
.scrollbar i { display: block; height: 100%; background: var(--grad-accent); transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); box-shadow: 0 0 12px var(--accent-glow); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s;
  view-transition-name: site-top;
}
.top.is-stuck {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 30px -22px rgba(0, 0, 0, .7);
}
.top-in { display: flex; align-items: center; gap: .25rem 1rem; min-height: var(--top-h); }
.brand { display: inline-flex; align-items: center; gap: .65rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .03em; flex: 0 1 auto; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 2.1rem; height: 2.1rem; filter: drop-shadow(0 4px 14px var(--accent-glow)); transition: transform .5s var(--spring); }
.brand:hover .brand-mark { transform: translateY(-2px) scale(1.06); }
.brand-name { display: grid; line-height: 1.08; font-size: .952rem; }
.brand-name small { display: flex; align-items: center; gap: .55rem; margin-top: .22rem; color: var(--ink-2); font-size: .82rem; font-weight: 600; line-height: 1; }
.brand-cn { margin-right: -.3em; letter-spacing: .3em; }
.brand-tag { padding-left: .6rem; border-left: 1px solid var(--line-2); color: var(--ink-3); font-size: .72rem; font-weight: 650; letter-spacing: .14em; white-space: nowrap; }
.brand-tag b { margin-right: -.2em; background: var(--grad-one); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font-weight: 750; }
@media (max-width: 26rem) { :root:not(:has(.top-shell)) .brand-tag { display: none; } }
.badge { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--accent-text); background: var(--hover); }
.nav { display: flex; align-items: center; gap: .15rem; margin-inline: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .35rem .9rem; border-radius: 999px; color: var(--ink-2); font-size: .895rem; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.nav .nav-extra, .nav .nav-theme { display: none; }
.nav .nav-theme { align-items: center; min-height: 2.75rem; padding: .35rem .9rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: .895rem; text-align: left; }
.nav .nav-theme:hover { color: var(--ink); background: var(--hover); }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; min-width: 0; margin-left: auto; }
.nav + .top-actions { margin-left: 0; }
.top-actions form { margin: 0; display: contents; }

.icon-btn {
  width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); position: relative;
  transition: color .2s, background-color .2s, border-color .2s, transform .35s var(--spring);
}
.icon-btn:hover { color: var(--ink); background: var(--hover); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .i { grid-area: 1 / 1; transition: transform .5s var(--spring), opacity .3s; }
[data-theme-toggle] .i-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="light"] [data-theme-toggle] .i-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="light"] [data-theme-toggle] .i-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) [data-theme-toggle] .i-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
  :root:not([data-theme]) [data-theme-toggle] .i-moon { opacity: 1; transform: none; }
}
.nav-toggle .i-shut, .side-toggle .i-shut { opacity: 0; transform: rotate(-90deg) scale(.5); }
.nav-toggle[aria-expanded="true"] .i-shut, .side-toggle[aria-expanded="true"] .i-shut { opacity: 1; transform: none; }
.nav-toggle[aria-expanded="true"] .i-open, .side-toggle[aria-expanded="true"] .i-open { opacity: 0; transform: rotate(90deg) scale(.5); }

@media (max-width: 56rem) {
  .top-in { flex-wrap: wrap; row-gap: 0; }
  /* The first row keeps its height when the menu opens below it, so the mark and buttons stay put. */
  .top-in > .brand, .top-in > .top-actions { min-height: var(--top-h); }
  .nav { order: 4; width: 100%; margin: 0; padding-bottom: .5rem; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav .nav-extra { display: inline-flex; }
  .js .nav { display: none; }
  .js .nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: .15rem; padding: .5rem 0 1rem; animation: sheet-in .35s var(--ease); }
  .js .nav a, .js .nav .nav-theme { padding: .8rem 1rem; font-size: .952rem; border-radius: var(--r-sm); }
  .top-actions { margin-left: auto; }
  .nav + .top-actions { margin-left: auto; }
  .top:has(.nav.is-open) { background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom-color: var(--line); }
}
@media (min-width: 56.01rem) {
  .nav-toggle { display: none !important; }
  [data-surface="operator"] .top-in:has(.nav a:nth-child(2)) { flex-wrap: wrap; row-gap: 0; }
  [data-surface="operator"] .nav:has(a:nth-child(2)) { order: 4; width: 100%; display: flex; flex-wrap: wrap; padding-bottom: .5rem; }
  [data-surface="operator"] .nav a { padding-inline: .7rem; }
  [data-surface="operator"] .top-actions { margin-inline-start: auto; }
}
@media (max-width: 34rem) {
  .top-actions .btn-ghost { display: none; }
}
@media (max-width: 30rem) {
  .top-actions [data-theme-toggle] { display: none; }
  .nav .nav-theme { display: inline-flex; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(-.5rem); } to { opacity: 1; transform: none; } }

/* ---------- Application shell: customer centre and operator console ---------- */
:root { --side-w: 15.75rem; --side-rail: 4.75rem; }
.top-shell .top-in { display: flex; flex-wrap: nowrap; align-items: center; gap: .6rem 1rem; padding-inline: max(var(--gut), env(safe-area-inset-left)) max(var(--gut), env(safe-area-inset-right)); }
.top-shell .top-actions { flex-wrap: nowrap; margin-left: auto; }
.who { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: .25rem .85rem .25rem .7rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--hover); color: var(--accent-text); font-size: var(--fs-xs); font-weight: 650; white-space: nowrap; }
.who .i { width: 1.05rem; height: 1.05rem; }
.nav-badge { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; color: var(--on-accent); background: var(--grad-accent); font-size: .75rem; font-weight: 760; font-style: normal; line-height: 1; }
.shell { flex: 1 0 auto; display: block; min-width: 0; }
.shell-col { display: flex; flex-direction: column; min-width: 0; min-height: calc(100dvh - var(--top-h)); }
.shell-col > main { flex: 1 0 auto; }
.side { display: flex; flex-direction: column; gap: .8rem; padding: .9rem 1rem 1rem; border-bottom: 1px solid var(--line); }
.side-nav { display: grid; gap: .12rem; align-content: start; }
.side-group { margin: 1.1rem .75rem .35rem; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .14em; }
.side-group:first-child { margin-top: .15rem; }
.sb-link {
  position: relative; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: .5rem .8rem;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-2); font-size: .895rem; font-weight: 560; text-align: left; text-decoration: none;
  transition: color .2s, background-color .25s, box-shadow .25s;
}
.sb-link:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.sb-link .i { width: 1.25rem; height: 1.25rem; transition: color .2s, transform .4s var(--spring); }
.sb-link:hover .i { transform: scale(1.12); }
.sb-link.is-here { color: var(--ink); background: linear-gradient(90deg, var(--hover), transparent 92%); box-shadow: inset 0 0 0 1px var(--line); }
.sb-link.is-here .i { color: var(--accent-text); }
.sb-link.is-here::before { content: ""; position: absolute; left: -1rem; top: .6rem; bottom: .6rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-accent); box-shadow: 0 0 14px var(--accent-glow); }
.sb-link .nav-badge { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: .12rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.side-theme { display: none; }
.side { view-transition-name: site-side; }
.scrim { display: none; }
.foot-shell { margin-top: 2rem; }
.foot-shell .foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding: 1rem var(--gut); }
.foot-note { color: var(--ink-3); font-size: var(--fs-xs); letter-spacing: .12em; }
@media (min-width: 62rem) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; transition: grid-template-columns .45s var(--ease); }
  html[data-side="rail"] .shell { grid-template-columns: var(--side-rail) minmax(0, 1fr); }
  .side-toggle { display: none !important; }
  .side { position: sticky; top: var(--top-h); height: calc(100dvh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-bottom: 0; border-right: 1px solid var(--line); }
  html[data-side="rail"] .side { padding-inline: .8rem; }
  html[data-side="rail"] .sb-link { justify-content: center; padding-inline: 0; }
  html[data-side="rail"] .sb-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html[data-side="rail"] .sb-link.is-here::before { left: -.8rem; }
  html[data-side="rail"] .side-group { height: 1px; margin: .8rem .6rem; padding: 0; overflow: hidden; color: transparent; background: var(--line); }
  html[data-side="rail"] .sb-link .nav-badge { position: absolute; top: .3rem; right: .55rem; min-width: .6rem; height: .6rem; padding: 0; font-size: 0; margin: 0; }
  .side-collapse .i { transition: transform .45s var(--spring); }
  html[data-side="rail"] .side-collapse .i { transform: scaleX(-1); }
}
@media (max-width: 61.99rem) {
  .js .side {
    position: fixed; z-index: 49; inset: var(--top-h) auto 0 0; width: min(19rem, 88vw); padding-bottom: max(1rem, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
    border: 0; border-right: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--sh-3);
    transform: translateX(-104%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s;
  }
  .js .side.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
  .js .side.is-open + .scrim { display: block; position: fixed; z-index: 48; inset: 0; background: rgba(3, 6, 12, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in .3s ease-out; }
  body:has(.side.is-open) { overflow: hidden; }
  .top-shell:has(~ .shell .side.is-open) { background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom-color: var(--line); }
  .side-collapse { display: none; }
}
.top-shell .brand { flex: 0 1 auto; min-width: 2.75rem; justify-content: center; }
.top-shell .brand-name { white-space: nowrap; }
.top-shell .icon-btn, .top-shell .btn { flex: none; }
.top-shell .top-in { container-type: inline-size; }
/* Container units follow the root font size, so this also holds when the reader enlarges the text. */
@container (max-width: 20rem) { .brand-tag { display: none; } }
@container (max-width: 17.5rem) { .brand-name, .badge-op, .who { display: none; } }
@media (max-width: 40rem) {
  .top-shell .who, .top-shell .btn-text { display: none; }
  .top-shell .top-actions .btn-sm { padding-inline: .8rem; }
}
@media (max-width: 30rem) {
  .top-shell .badge-op { display: none; }
  .side-theme { display: flex; }
}

/* ---------- Home-screen app: phone tab bar, offline notice, installed window ---------- */
/* The bar grows with larger text only up to a fixed size, so it never takes over the screen; --tab-h is its height. */
:root { --tab-h: calc(min(3.1rem, 64px) + 2 * min(.3rem, 6px) + 1px); }
.tabbar { display: none; }
@media (max-width: 61.99rem) {
  .tabbar { position: fixed; z-index: 40; inset: auto 0 0 0; display: flex; align-items: stretch; gap: min(.15rem, 3px); padding: min(.3rem, 6px) max(.35rem, env(safe-area-inset-right)) calc(min(.3rem, 6px) + env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); border-top: 1px solid var(--line-2); background: var(--glass); -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px); view-transition-name: site-tabs; }
  .tabbar > a, .tabbar > button { position: relative; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; align-content: center; gap: min(.15rem, 3px); min-height: min(3.1rem, 64px); padding: min(.2rem, 4px) .1rem; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font-size: min(.72rem, 5vw, 18px); font-weight: 600; line-height: 1.2; text-decoration: none; }
  .tabbar > a:hover { text-decoration: none; }
  .tabbar .i { width: min(1.35rem, 7vw, 28px); height: min(1.35rem, 7vw, 28px); }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar > [aria-current="page"], .tabbar > [aria-expanded="true"] { color: var(--accent-text); background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
  .tabbar .nav-badge { position: absolute; top: .1rem; left: calc(50% + .35rem); min-width: 1.15rem; height: 1.15rem; margin: 0; padding: 0 .3rem; font-size: .66rem; }
  .has-shell .shell-col { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .has-shell .toasts { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + .6rem); }
  html:has(.tabbar) { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + .5rem); }
  /* On a full page the record's actions follow its content; a floating bar rests on top of the tab bar. */
  .shell-col .drawer-foot { position: static; padding-bottom: .9rem; }
  .shell-col .mx-bar { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + .6rem); }
  /* A conversation keeps the whole height for its messages and composer. */
  .page-chat .tabbar { display: none; }
  .has-shell.page-chat .shell-col { padding-bottom: 0; }
  .has-shell.page-chat .toasts { bottom: max(1.2rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 61.99rem) and (max-height: 30rem) {
  :root { --tab-h: calc(min(2.75rem, 52px) + 2 * min(.2rem, 4px) + 1px); }
  .tabbar { padding-block: min(.2rem, 4px) calc(min(.2rem, 4px) + env(safe-area-inset-bottom)); }
  .tabbar > a, .tabbar > button { grid-auto-flow: column; justify-content: center; gap: min(.35rem, 6px); min-height: min(2.75rem, 52px); }
  .tabbar .nav-badge { left: auto; right: .2rem; }
}
/* A floating note: it never shifts the page and never takes a tap. */
.net-banner { position: fixed; z-index: 55; top: calc(var(--top-h) + .4rem); left: 50%; translate: -50% 0; display: flex; align-items: center; gap: .5rem; width: -webkit-max-content; width: max-content; max-width: calc(100% - 1.5rem); margin: 0; padding: .45rem .95rem; border: 1px solid var(--warn); border-radius: 1.4rem; background: var(--surface-2); box-shadow: var(--sh-3); color: var(--warn); font-size: var(--fs-sm); font-weight: 620; line-height: 1.4; pointer-events: none; }
.net-banner .i { flex: none; width: 1.15rem; height: 1.15rem; }
.is-standalone .foot-shell { display: none; }
/* The back button takes its room from the name, so the header stays on one row. */
@media (max-width: 26rem) { .top-in:has(> .app-back:not([hidden])) .brand-name { display: none; } }
@container (max-width: 14rem) { .top-shell .app-back:not([hidden]) ~ .brand { display: none; } }
@media (max-width: 56rem) { .nav .nav-theme.nav-install { display: inline-flex; } }
.foot-form { display: contents; }
.foot-form button { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; border: 0; background: transparent; color: var(--ink-2); font-size: var(--fs-sm); }
.foot-form button:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  --press: 1;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .55rem;
  min-height: 2.9rem; padding: .7rem min(1.4rem, 5vw); border-radius: 999px;
  font-size: .91rem; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; letter-spacing: .01em;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  transition: transform .3s var(--spring), translate .4s var(--spring), box-shadow .3s var(--ease), background-color .25s, color .25s, border-color .25s, opacity .25s;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .1s; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .i { transition: transform .35s var(--spring); }
.btn:hover .i-arrow, .btn:hover .i:last-child { transform: translateX(3px); }
.btn-primary {
  color: var(--on-accent); background: var(--grad-accent); background-size: 140% 140%; background-position: 0% 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 1px 0 rgba(255, 255, 255, .5) inset, 0 10px 28px -8px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, .22);
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .6) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform .85s var(--ease);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset, 0 1px 0 rgba(255, 255, 255, .55) inset, 0 16px 36px -8px var(--accent-glow), 0 3px 8px rgba(0, 0, 0, .25); }
.btn-primary:hover::before { transform: translateX(130%); }
.btn-ghost { background: var(--hover); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--ring); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--hover); }
.btn-sm { min-height: 2.75rem; padding: .45rem min(1rem, 3.5vw); font-size: .852rem; }
.btn-lg { min-height: 3.4rem; padding: .85rem min(1.9rem, 6vw); font-size: .965rem; }
.btn-block { width: 100%; }
.btn .rip { position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: scale(0); animation: rip .7s var(--ease) forwards; pointer-events: none; }
.btn-ghost .rip, .btn-quiet .rip { background: var(--ring); }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
.btn.is-loading { pointer-events: none; }
.btn .spinner { display: none; width: 1.15em; height: 1.15em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: .75; }
.btn.is-loading:not(:has(.spinner))::after { content: ""; width: 1.05em; height: 1.05em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards and depth ---------- */
.card {
  position: relative;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 62%);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  transition: box-shadow .4s var(--ease), border-color .4s;
}
.card:hover { box-shadow: var(--sh-3); }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 62%);
}
.card:hover::after { opacity: 1; }
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 65%, var(--ring));
    opacity: .55; transition: opacity .4s;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
  .card:hover::before { opacity: 1; }
}
:root[data-theme="light"] .card::before { background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 60%, var(--ring)); }
.tilt { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; will-change: transform; }
.tilt.is-tilting { transition-duration: .08s; }

/* ---------- Reveal and motion ---------- */
.js .rv { opacity: 0; translate: 0 1.6rem; transition: opacity .9s var(--ease) var(--rd, 0s), translate 1s var(--ease) var(--rd, 0s); animation: rv-safe .01s 3s forwards; }
.js .rv.tilt { transition: opacity .9s var(--ease) var(--rd, 0s), translate 1s var(--ease) var(--rd, 0s), transform .35s var(--ease), box-shadow .4s var(--ease); }
.js .rv.in { opacity: 1; translate: none; animation: none; }
@keyframes rv-safe { to { opacity: 1; translate: none; } }
.stagger > .rv:nth-child(1) { --rd: .02s; }
.stagger > .rv:nth-child(2) { --rd: .1s; }
.stagger > .rv:nth-child(3) { --rd: .18s; }
.stagger > .rv:nth-child(4) { --rd: .26s; }
.stagger > .rv:nth-child(5) { --rd: .34s; }
.stagger > .rv:nth-child(6) { --rd: .42s; }
.stagger > .rv:nth-child(7) { --rd: .5s; }
.stagger > .rv:nth-child(n+8) { --rd: .56s; }
.auth-side > .rv:nth-child(1) { --rd: .05s; }
.auth-side > .rv:nth-child(2) { --rd: .15s; }
.auth-side > .rv:nth-child(3) { --rd: .27s; }
.auth-side > .rv:nth-child(4) { --rd: .38s; }

.pulse-dot { position: relative; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent-glow); }
.pulse-dot::after { content: ""; position: absolute; inset: -.3rem; border-radius: 50%; border: 1px solid var(--accent); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; background-size: 160% 100%; animation: sheen 8s ease-in-out infinite alternate; }
@keyframes sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.eyebrow { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .9rem .35rem .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--hover); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; }
.eyebrow .i { width: 1.1em; height: 1.1em; }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.4rem; }
.field { position: relative; min-width: 0; }
.field input {
  width: 100%; min-width: 0; min-height: 3.6rem; padding: 1.5rem 3rem .5rem 3rem; border-radius: var(--r-md);
  background: var(--field); border: 1px solid var(--line-2); color: var(--ink); font-size: .938rem; line-height: 1.3;
  transition: border-color .2s, box-shadow .25s var(--ease), background-color .2s;
  appearance: none; -webkit-appearance: none;
}
.field input:hover { border-color: var(--ring); }
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.field .lbl { position: absolute; left: 3rem; top: 1.15rem; color: var(--ink-3); font-size: .938rem; line-height: 1.3; pointer-events: none; transform-origin: 0 0; transition: transform .25s var(--ease), color .2s; }
.field input:focus + .lbl, .field input:not(:placeholder-shown) + .lbl { transform: translateY(-.62rem) scale(.76); color: var(--accent-text); }
.field .ico { position: absolute; left: 1.05rem; top: 1.2rem; width: 1.3rem; height: 1.3rem; color: var(--ink-3); transition: color .2s; pointer-events: none; }
.field input:focus ~ .ico, .field:focus-within .ico { color: var(--accent-text); }
.field input:not(:placeholder-shown):not(:focus):invalid { border-color: var(--danger); }
.field input:not(:placeholder-shown):not(:focus):invalid + .lbl { color: var(--danger); }
.field.is-bad input { border-color: var(--danger); animation: shake .45s var(--ease); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.reveal { position: absolute; right: .5rem; top: .4rem; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 50%; color: var(--ink-3); transition: color .2s, background-color .2s; }
.reveal:hover { color: var(--ink); background: var(--hover); }
.reveal .i { grid-area: 1 / 1; transition: transform .4s var(--spring), opacity .25s; }
.reveal .i-hide { opacity: 0; transform: scale(.4); }
.reveal[aria-pressed="true"] .i-hide { opacity: 1; transform: none; }
.reveal[aria-pressed="true"] .i-show { opacity: 0; transform: scale(.4); }
.help { margin-top: -.35rem; padding-inline: .25rem; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.caps-hint { display: flex; align-items: center; gap: .45rem; margin-top: -.4rem; color: var(--warn); font-size: var(--fs-xs); }
.caps-hint .i { width: 1.05em; height: 1.05em; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: -.4rem; }
.meter i { height: .3rem; border-radius: 99px; background: var(--line-2); transition: background-color .3s, transform .4s var(--spring); transform-origin: 0 50%; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--accent); }
.meter[data-level="4"] i { background: var(--ok); }
.alert { display: flex; gap: .7rem; align-items: flex-start; margin-top: 1.1rem; padding: .85rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line-2); font-size: var(--fs-sm); line-height: 1.55; animation: alert-in .5s var(--spring); }
.alert .i { margin-top: .12em; }
.alert-danger { color: var(--danger); background: rgba(255, 131, 146, .09); border-color: rgba(255, 131, 146, .38); }
@keyframes alert-in { from { opacity: 0; transform: translateY(-.5rem) scale(.98); } to { opacity: 1; transform: none; } }

/* Touch browsers zoom the page when a field is smaller than 16px. */
@media (pointer: coarse) { .field input, .fld input, .search input { font-size: 1rem; } }

/* ---------- Dialog and toast ---------- */
.modal { width: min(30rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.modal::backdrop { background: rgba(3, 6, 12, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[open] { animation: modal-in .45s var(--spring); }
.modal[open]::backdrop { animation: fade-in .3s ease-out; }
.modal-card { padding: 1.6rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; max-height: calc(100dvh - 2rem); overflow: auto; }
.modal-card::before, .modal-card::after { inset: 0; }
.modal-card h3 { font-size: var(--fs-xl); }
.modal-list { display: grid; gap: .1rem; }
.modal-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.modal-list dt { color: var(--ink-2); font-size: var(--fs-sm); }
.modal-list dd { font-weight: 600; text-align: right; }
.modal-total { border-bottom: 0 !important; padding-top: .9rem !important; }
.modal-total dd { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.modal-note { color: var(--ink-2); font-size: var(--fs-sm); }
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; }
@keyframes modal-in { from { opacity: 0; transform: translateY(1.2rem) scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Drawer: a side panel for one object, a bottom sheet on narrow screens ---------- */
.drawer { --dw: 40rem; position: fixed; inset: 0 0 0 auto; margin: 0; width: min(var(--dw), 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.drawer[data-size="sm"] { --dw: 28rem; }
.drawer[data-size="lg"] { --dw: 60rem; }
.drawer::backdrop { background: rgba(3, 6, 12, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.drawer[open] { animation: drawer-in .32s var(--ease); }
.drawer[open]::backdrop { animation: fade-in .25s ease-out; }
.drawer.is-closing { animation: drawer-out .22s var(--ease) forwards; }
.drawer.is-closing::backdrop { animation: fade-out .22s ease-in forwards; }
.drawer-card { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--sh-3); }
.drawer-h { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .8rem .8rem .8rem 1.4rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.drawer-title { flex: 1 1 8rem; min-width: 0; }
.drawer-title h2 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.drawer-sub { margin-top: .1rem; color: var(--ink-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-full { flex: none; margin-left: auto; }
.drawer-x { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line-2); border-radius: 50%; background: var(--field); color: var(--ink-2); transition: color .2s, border-color .2s, background-color .2s; }
.drawer-x:hover { color: var(--ink); border-color: var(--ring); background: var(--hover); }
.drawer-body { overflow: auto; overscroll-behavior: contain; padding: 1.2rem 1.4rem 0; display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; outline: 0; }
.drawer-body > * { flex: none; min-width: 0; }
.drawer-body > :last-child:not(.drawer-foot) { margin-bottom: 1.4rem; }
.drawer-body .ph, .drawer-body .back { display: none; }
.drawer-body .card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.drawer-body .card::before, .drawer-body .card::after { display: none; }
.drawer-body .panel-h { justify-content: flex-start; }
.drawer-body .drawer-dupe { display: none; }
.drawer-foot { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin: auto -1.4rem 0; padding: .9rem 1.4rem calc(.9rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.drawer-note { display: grid; justify-items: start; gap: .8rem; padding: 1.2rem; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--ink-2); }
.drawer-note[role="alert"] { color: var(--danger); border-color: rgba(255, 131, 146, .45); }
html.drawer-open { overflow: hidden; }
@media (max-width: 47.99rem) {
  .drawer { inset: auto 0 0 0; width: 100vw; height: auto; max-height: 92dvh; }
  .drawer[open] { animation-name: drawer-up; }
  .drawer.is-closing { animation-name: drawer-down; }
  .drawer-card { max-height: 92dvh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 1.4rem 1.4rem 0 0; overflow: hidden; }
  .drawer-h { position: relative; padding-top: 1.35rem; padding-left: 1.1rem; }
  .drawer-h::before { content: ""; position: absolute; top: .5rem; left: 50%; width: 2.4rem; height: .26rem; margin-left: -1.2rem; border-radius: 99px; background: var(--line-2); }
  .drawer-full span { display: none; }
  .drawer-full { padding-inline: .7rem; }
  .drawer-body { padding-inline: 1.1rem; }
  .drawer-foot { margin-inline: -1.1rem; padding-inline: 1.1rem; }
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(2.2rem); } to { opacity: 1; transform: none; } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(2.2rem); } }
@keyframes drawer-up { from { opacity: 0; transform: translateY(2rem); } to { opacity: 1; transform: none; } }
@keyframes drawer-down { to { opacity: 0; transform: translateY(2rem); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* The popup form of the same panel: centred on wide screens, the bottom sheet above on narrow ones. */
@media (min-width: 48rem) {
  .drawer[data-size="modal"] { inset: 0; margin: auto; width: min(56rem, calc(100% - 3rem)); height: -webkit-fit-content; height: fit-content; max-height: calc(100dvh - 3rem); }
  .drawer[data-size="modal"] .drawer-card { height: auto; max-height: calc(100dvh - 3rem); overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-xl); }
  .drawer[data-size="modal"][open] { animation-name: modal-in; }
  .drawer[data-size="modal"].is-closing { animation-name: drawer-down; }
}

.toasts { position: fixed; inset: auto 0 max(1.2rem, env(safe-area-inset-bottom)) 0; display: grid; justify-items: center; gap: .55rem; padding-inline: 1rem; z-index: 90; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: .6rem; max-width: min(26rem, 100%); padding: .75rem 1.1rem; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line-2); box-shadow: var(--sh-3); color: var(--ink); font-size: var(--fs-sm);
  animation: toast-in .5s var(--spring), toast-out .35s ease-in 2.6s forwards;
}
.toast .i { color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(1rem) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(.6rem) scale(.96); } }

/* ---------- Footer ---------- */
.foot { margin-top: 4rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, var(--hover)); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding-block: 2.6rem 3rem; }
.foot-brand { max-width: 26rem; display: grid; gap: .9rem; }
.foot-brand p { color: var(--ink-2); font-size: var(--fs-sm); }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-content: start; }
.foot-links a { display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; justify-content: center; color: var(--ink-2); font-size: var(--fs-sm); }
.foot-links a:hover { color: var(--ink); }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s ease-in both vt-out; }
::view-transition-new(root) { animation: .38s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-.4rem); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(.6rem); } }
.vt-theme::view-transition-old(root), .vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Accessibility modes ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; translate: none; }
  .tilt { transform: none !important; }
}
@media (forced-colors: active) {
  .btn-primary, .btn-ghost { border-color: ButtonText; }
  .card { border-color: CanvasText; }
}
@media print {
  body::before, body::after, .top, .scrollbar, .foot, .toasts, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #999; background: #fff; }
}

/* A part of the page that opens as a drawer stays in place without script and is hidden until it is lifted in. */
.drawers-ready [data-drawer-inline]:not(.is-open):not(:target) { display: none; }
.drawer-body [data-drawer-inline] > .panel-h:first-child { display: none; }
.drawer-body [data-drawer-inline] { display: grid; gap: 1.1rem; }

/* ---------- Order confirmation: the last page before money, so every figure has its own line ---------- */
.checkout { padding-block: clamp(1.4rem, 5vw, 3.5rem) 0; }
.checkout-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding: clamp(1.25rem, 4vw, 2.2rem); }
.checkout-h { display: grid; justify-items: start; gap: .6rem; }
.checkout-h h1 { font-size: var(--fs-2xl); }
.checkout-list { display: grid; border-top: 1px solid var(--line); }
.checkout-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.checkout-list dt { color: var(--ink-2); font-size: var(--fs-sm); }
.checkout-list dd { margin-left: auto; min-width: 0; text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; }
.checkout-list dd small { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 400; }
.checkout-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; padding: 1rem 1.2rem; border: 1px solid var(--ring); border-radius: var(--r-md); background: var(--hover); }
.checkout-total dt { color: var(--ink-2); font-weight: 620; }
.checkout-total dd { margin-left: auto; font-size: var(--fs-hero); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.checkout-actions { display: grid; gap: .6rem; }
@media (min-width: 62rem) {
  /* Full shoulder width: what is being bought on the left, the total and the one action on the right. */
  .checkout-card { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 2.5rem; align-items: start; }
  .checkout-card > * { grid-column: 1 / -1; }
  .checkout-card > .checkout-list { grid-column: 1; grid-row: span 3; }
  .checkout-card > .checkout-list ~ * { grid-column: 2; }
  .checkout-card > form[data-service-terms] { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem 2.5rem; align-items: start; }
  .checkout-card > form[data-service-terms] > fieldset { grid-row: span 2; }
}
