/* ==========================================================================
   VolID — cabinet design system (from volid-cabinet.html).
   Dark is default; light via [data-theme='light'].
   Scope: .cab-page (cabinet + public profile) and legacy luxe wrappers
   .auth-screen.volid / .public-page.volid / .volid-page.volid (compat shims
   below) so every non-admin page renders cabinet palette without per-page
   rewrites. Admin shell (layouts/shell.html, no .volid) is NOT affected.
   Fonts: example sizes * 1.2 rounded to whole px. Body 15 -> 18.
   Accent text uses --c-acc-ink (AA contrast), decorative fills use --c-acc.
   ========================================================================== */

/* ---------- Tokens: dark (default) ---------- */
:root,
:root[data-theme='dark'],
.cab-page,
.auth-screen.volid,
.public-page.volid,
.volid-page.volid {
  --c-ink: #0b0a09;
  --c-pan: #141110;
  --c-pan2: #1c1817;
  --c-line: #2b2624;
  --c-line2: #3a322d;
  --c-txt: #f3eee8;
  --c-mut: #b8aea4;
  --c-dim: #9c938a;
  --c-faint: #6e645c;
  --c-acc: #ffae6c;
  --c-acc-ink: #ff9a2e;
  --c-accs: rgba(255, 174, 108, .13);
  --c-ok: #54b87c;
  --c-red: #e4574c;
  --c-warn: #e0b341;
  --c-pagebg: #050505;
  --c-d: 'Archivo', system-ui, sans-serif;
  --c-b: 'IBM Plex Sans', system-ui, sans-serif;
  --c-m: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- Tokens: light (simplified, AA) ---------- */
:root[data-theme='light'],
.cab-page[data-theme='light'],
.auth-screen.volid[data-theme='light'],
.public-page.volid[data-theme='light'],
.volid-page.volid[data-theme='light'],
:root[data-theme='light'] .auth-screen.volid,
:root[data-theme='light'] .public-page.volid,
:root[data-theme='light'] .volid-page.volid {
  --c-ink: #faf7f1;
  --c-pan: #ffffff;
  --c-pan2: #f3efe8;
  --c-line: #e4dccc;
  --c-line2: #d5c9b6;
  --c-txt: #1d1917;
  --c-mut: #5d554d;
  --c-dim: #8a8178;
  --c-faint: #a39a8e;
  --c-acc: #ffae6c;
  --c-acc-ink: #8f4a05;
  --c-accs: rgba(255, 174, 108, .10);
  --c-ok: #2e7d4f;
  --c-red: #b3372c;
  --c-warn: #8a6d1b;
  --c-pagebg: #efe9de;
}

/* Native widgets (scrollbars, dialogs) follow the active scheme. */
:root,
:root[data-theme='dark'] { color-scheme: dark; }
:root[data-theme='light'] { color-scheme: light; }

/* ---------- Logo: two variants — dark for dark theme, light for light theme ----------
   `display` toggle uses !important so it wins over layout rules like
   `.cab-bar .cab-logo img {display:block}` (higher specificity) that would
   otherwise keep both logos visible in the dark theme. */
.logo--light { display: none !important; }
[data-theme='light'] .logo--dark { display: none !important; }
[data-theme='light'] .logo--light { display: block !important; }

/* Centered brand logos (auth) were centered via flex parent; with two <img>
   the visible one is `display:block` — keep wrapper centered and image sized. */
.auth-brand .volid-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-brand .volid-logo img {
  height: 39px;
  width: auto;
  display: block;
  max-width: 100%;
}
.herologo,
.volid-hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- Page frame ---------- */
.cab-page {
  margin: 0;
  background: var(--c-pagebg);
  color: var(--c-txt);
  font-family: var(--c-b);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
.cab-page :focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.cab-page button { font: inherit; }

/* Centered phone-like column (vault, auth, profile) */
.cab-stage { min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: 0; }
.cab-phone {
  width: 100%; max-width: 100%; min-width: 0; background: var(--c-ink); position: relative;
  display: flex; flex-direction: column; min-height: 100dvh; overflow-x: clip;
}
/* Wide landing mode (homepage, business page): desktop-first, comfy on phones */
.cab-wide {
  width: 100%; max-width: 1020px; margin: 0 auto; background: var(--c-ink);
  position: relative; display: flex; flex-direction: column; min-height: 100dvh;
  padding: 0 24px;
}
@media (min-width: 560px) {
  .cab-stage { padding: 26px 16px 40px; }
  .cab-phone {
    max-width: 430px; min-height: 0; height: auto;
    border: 1px solid var(--c-line); border-radius: 30px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .7);
    /* clip (not hidden): keeps the rounded crop without becoming a scroll
       container, so the sticky .cab-bar keeps working against the viewport. */
    overflow: clip;
  }
  .cab-wide {
    border: 1px solid var(--c-line); border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .7);
    overflow: hidden; min-height: 0;
  }
}
@media (max-width: 559px) {
  .cab-wide { padding: 0 16px; }
}

/* ---------- Top bar: logo + lang + theme + auth (PL-safe) ---------- */
.cab-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 14px 15px 10px; border-bottom: 1px solid var(--c-line);
  background: var(--c-ink); min-width: 0; max-width: 100%; flex-wrap: nowrap;
  position: sticky; top: 0; z-index: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  overflow: visible;
}
.cab-bar .lang-switch,
.cab-bar details[open] { position: relative; z-index: 600; }
.cab-bar .cab-logo { flex: none; }
.cab-bar .cab-logo img { height: 39px; width: auto; display: block; }
.cab-bar .cab-sp { flex: 1 1 auto; min-width: 4px; }
/* Auth buttons live in a shrinkable group so PL labels never break the bar */
.cab-bar .cab-auths {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 8px;
  justify-content: flex-end; align-items: center;
}
.cab-auth {
  flex: 0 1 auto; min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--c-m); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 8px; text-decoration: none;
}
.cab-auth.ghost { border: 1px solid var(--c-line2); color: var(--c-mut); }
/* Guest header + anon promo sign-in read as accent actions (theme-toggle tint),
   scoped so Vault ghost buttons (pager, Make Primary, VCF preview) stay muted. */
.cab-guest-auths .cab-auth.ghost,
.cab-anon-auths .cab-auth.ghost { color: var(--c-acc-ink); }
.cab-auth.ghost:hover { color: var(--c-acc-ink); border-color: var(--c-acc); }
.cab-auth.solid { background: var(--c-acc); color: #12100e; border: 1px solid var(--c-acc); }
.cab-auth.solid:hover { filter: brightness(1.1); }
.cab-page[data-theme='light'] .cab-auth.solid { color: #1d1917; }
/* Icon-only auth buttons (mobile): the SVG is hidden on desktop, the text
   label is hidden on narrow screens. Square size matches the theme toggle. */
.cab-auth .cab-ico { display: none; width: 17px; height: 17px; }
.cab-auth.cab-account-ico { display: none; }
/* Theme toggle: same pill language as lang switch */
.cab-theme-toggle {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  background: var(--c-pan); border: 1px solid var(--c-line2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-acc-ink); cursor: pointer; font-size: 17px; line-height: 1;
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-variant-emoji: text;
}
.cab-theme-toggle:hover { border-color: var(--c-acc); }
@media (max-width: 400px) {
  .cab-bar { flex-wrap: wrap; }
  .cab-bar .cab-auths { flex: 1 1 100%; justify-content: stretch; }
  .cab-bar .cab-auth { flex: 1 1 45%; text-align: center; }
  /* Icon buttons keep the theme-toggle square size instead of stretching. */
  .cab-bar .cab-auth.cab-logout-ico,
  .cab-bar .cab-auth.cab-account-ico {
    flex: none; width: 30px; height: 30px; padding: 0; border-radius: 9px;
    background: var(--c-pan); display: inline-flex; align-items: center; justify-content: center;
    color: var(--c-acc-ink);
  }
  .cab-auth.cab-logout-ico .cab-txt { display: none; }
  .cab-auth.cab-logout-ico .cab-ico,
  .cab-auth.cab-account-ico .cab-ico { display: block; }
  /* Guest pair on public profiles collapses to the single account icon. */
  .cab-bar .cab-guest-auths { flex: none; }
  .cab-bar .cab-guest-auths .cab-auth:not(.cab-account-ico) { display: none; }
}

/* ---------- Scroll body ---------- */
.cab-body { flex: 1; padding: 0 15px 22px; min-width: 0; }
.cab-wide .cab-body { padding: 0 0 28px; }
/* Server flash (?flash=) renders above every panel: panels toggle with
   display:none, so a flash nested inside one panel would stay invisible on
   any other tab. .alert already carries margin-bottom from main.css. */
.cab-body > .alert { margin-top: 12px; }

/* ---------- Bottom tab nav (vault app) ----------
   One implicit column per tab button: `grid-auto-flow: column` sizes the
   track list to the number of rendered tabs, so the bar never orphans the
   last item on a second row and no column count has to be kept in sync
   with dashboard.html. A hardcoded `repeat(6, 1fr)` silently broke once a
   7th tab (Settings) was added. */
.cab-nav {
  flex: none; display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid var(--c-line); background: var(--c-ink);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.cab-nb {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px; color: var(--c-faint); border-radius: 10px;
  background: none; border: 0; cursor: pointer; min-width: 0;
}
/* 7 tabs in a 430px frame leave ~56px of text per label, so the type is
   sized for that: 10px/0.02em fits 9 characters, which covers every
   EN/PL/RU label except the two longest (PL Settings, RU Referrals) —
   those ellipsize, and the button's `title` carries the full word. */
.cab-nb span {
  font-family: var(--c-m); font-size: 10px; letter-spacing: .02em;
  text-transform: uppercase; display: block; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.cab-nb.on { color: var(--c-acc-ink); }
.cab-nb svg { width: 19px; height: 19px; }
.cab-nbw { position: relative; display: flex; justify-content: center; }
.cab-badge {
  position: absolute; top: -4px; left: calc(50% + 3px);
  background: var(--c-acc); color: #12100e; font-family: var(--c-m);
  font-size: 10px; border-radius: 999px; padding: 0 4px; line-height: 13px; height: 13px;
}

/* ---------- Subscreen header ---------- */
.cab-sub { flex: none; display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--c-line); }
.cab-bk {
  width: 28px; height: 28px; border-radius: 8px; background: var(--c-pan2);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; color: var(--c-txt); font-size: 19px; line-height: 1;
  border: 0; cursor: pointer;
}
.cab-subt { font-family: var(--c-d); font-weight: 600; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Generic pieces (example +20%) ---------- */
.cab-h2 { font-family: var(--c-d); font-weight: 600; font-size: 23px; margin: 16px 0 2px; letter-spacing: -.01em; }
.cab-cap {
  font-family: var(--c-m); font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--c-dim); margin: 20px 0 8px; display: flex; align-items: center; gap: 8px;
}
.cab-cap i { flex: 1; height: 1px; background: var(--c-line); font-style: normal; }
.cab-card { background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 14px; padding: 13px; margin-bottom: 9px; }
.cab-pill {
  font-family: var(--c-m); font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; flex: none; white-space: nowrap;
}
.cab-p-open { background: rgba(84, 184, 124, .14); color: var(--c-ok); }
.cab-p-part { background: var(--c-accs); color: var(--c-acc-ink); }
.cab-p-hide { background: var(--c-pan2); color: var(--c-dim); }
/* Referral list statuses: confirmed email vs. never activated. Both reuse
   the palette of cab-p-open / cab-p-hide, but with their own names so the
   referred-user rows read differently from CRM visibility pills. */
.cab-p-verified { background: rgba(84, 184, 124, .14); color: var(--c-ok); }
.cab-p-notact { background: var(--c-pan2); color: var(--c-dim); }
.cab-p-unver { background: rgba(228, 87, 76, .12); color: var(--c-red); }
.cab-mono { font-family: var(--c-m); }
.cab-mut { color: var(--c-mut); }
.cab-dim { color: var(--c-dim); }
.cab-soon {
  background: var(--c-pan); border: 1px dashed var(--c-line2); border-radius: 14px;
  padding: 22px 16px; margin-bottom: 9px; text-align: center; color: var(--c-mut);
}
.cab-soon b { display: block; font-family: var(--c-d); font-size: 19px; color: var(--c-txt); margin-bottom: 6px; }
.cab-soon span { font-size: 16px; }

/* ---------- CRM pager ---------- */
.cab-pager-form { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 4px 0 10px; }
.cab-pager-form select {
  font-family: var(--c-m); font-size: 12px; color: var(--c-acc-ink);
  background: var(--c-ink); border: 1px solid var(--c-line2); border-radius: 8px;
  padding: 3px 5px; outline: none; cursor: pointer;
}
.cab-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cab-pager .cab-auth { min-width: 30px; text-align: center; }

/* ---------- Expandable blocks (CRM messages) ---------- */
.cab-details { margin-top: 6px; }
.cab-details summary {
  cursor: pointer; font-family: var(--c-m); font-size: 13px;
  color: var(--c-acc-ink); list-style: revert;
}
.cab-details summary:hover { text-decoration: underline; }

/* Contact groups (phones/emails): always expanded, never collapse. */
.cab-subblock { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--c-line); }
.cab-subblock-head { margin-bottom: 8px; font-family: var(--c-b); font-size: 16px; }
/* Contact slots breathe a bit more than generic fields. */
.cab-subblock .cab-field { margin-bottom: 16px; }
/* "Make Primary" buttons: compact orange ghost, scoped so the generic
   pill and pager buttons are untouched. */
.cab-field-head .cab-make-primary { font-size: 11px; padding: 3px 8px; color: var(--c-acc-ink); border-color: var(--c-acc); }
.cab-field-head .cab-make-primary:hover { color: var(--c-acc-ink); border-color: var(--c-acc-ink); background: var(--c-accs); filter: none; }
.cab-field-head .cab-make-primary:disabled { opacity: .45; cursor: not-allowed; background: none; }
/* Disclosure toggles (Settings email/password, OAuth unlink): closed the
   summary sits inline next to its badge or label; open it takes the full
   row so the form drops below. Native <details>, no JS. */
.cab-disclose summary { list-style: none; cursor: pointer; }
.cab-disclose summary::-webkit-details-marker { display: none; }
.cab-disclose[open] { flex-basis: 100%; border: 1px solid var(--c-line2); padding: 0 5px; }
/* Destructive action blocks (email/password change, provider disconnect):
   an open block gets a red frame so the expanded form reads as a danger
   zone. Scoped to .cab-disclose-danger — the consent disclosures stay
   neutral. */
.cab-disclose-danger[open] {
  border: 1px solid var(--c-red); border-radius: 12px;
  padding: 12px; background: rgba(228, 87, 76, .07);
}

/* ---------- Per-field privacy: eye-segment radios (no reload via htmx) ---------- */
.cab-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.cab-field-head > label { margin-bottom: 0; flex: 1 1 auto; min-width: 0; align-self: center; line-height: 32px; }
.cab-vis { flex: none; display: flex; align-items: center; align-self: center; gap: 6px; margin: 0; padding: 0; border: 0; background: none; }
.cab-eyes { display: inline-flex; border: 1px solid var(--c-line2); border-radius: 9px; overflow: hidden; flex: none; background: var(--c-ink); }
.cab-eyes label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 32px; color: var(--c-dim); cursor: pointer; position: relative;
}
.cab-eyes label + label { border-left: 1px solid var(--c-line); }
.cab-eyes input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cab-eyes svg { width: 18px; height: 18px; display: flex; }
.cab-eyes label:has(input:checked) { background: var(--c-accs); color: var(--c-acc-ink); }
.cab-eyes label:has(input:focus-visible) { outline: 2px solid var(--c-acc); outline-offset: -2px; }
/* No-JS fallback: explicit save button, hidden once htmx takes over. */
.cab-vis-save {
  font-family: var(--c-m); font-size: 11px; color: var(--c-acc-ink);
  border: 1px solid var(--c-line2); border-radius: 8px; padding: 4px 8px;
  background: var(--c-pan2); cursor: pointer;
}
.has-htmx .cab-vis-save { display: none; }
.cab-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cab-card-head .cab-h2 { margin: 0; flex: 1 1 auto; min-width: 0; }

/* ---------- Foldable cards (cab-fold): chevron state indicator ----------
   CSS-drawn chevron (borders, not a font glyph) so it renders identically
   on every smartphone font stack. Strict child selectors: nested details
   (e.g. consent history) must not inherit the card header treatment.
   Native <summary> stays keyboard-accessible (Enter/Space) and announces
   expanded/collapsed itself; the chevron is pure decoration. */
details.cab-fold > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
details.cab-fold > summary::-webkit-details-marker { display: none; }
details.cab-fold > summary::marker { content: ""; }
details.cab-fold > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-left: auto;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .18s;
  color: var(--c-dim);
}
details.cab-fold[open] > summary::after {
  transform: rotate(45deg);
  color: var(--c-acc-ink);
}
details.cab-fold > summary:hover::after { color: var(--c-acc-ink); }
/* A <summary> that is styled as a button (the OAuth "Disconnect" toggle)
   must not carry the card chevron — it is not a card header. */
details.cab-fold > summary.cab-auth::after { content: none; }
details.cab-fold > summary:focus-visible {
  outline: 2px solid var(--c-acc);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  details.cab-fold > summary::after { transition: none; }
}

/* ---------- Icon buttons (vcf preview) ---------- */
.cab-ico-btn {
  min-width: 44px; height: 40px; padding: 0 10px; border-radius: 11px;
  background: #fff; color: #1d1917; border: 1px solid #d5c9b6;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.cab-ico-btn:hover { border-color: var(--c-acc); color: #8f4a05; }
.cab-ico-btn svg { width: 22px; height: 22px; }

/* ---------- Cover remove: explicit red button with two-tap confirm ---------- */
.cab-cover-remove {
  width: 100%; margin-top: 8px; padding: 11px; border-radius: 11px; cursor: pointer;
  font-family: var(--c-b); font-size: 16px; font-weight: 600;
  color: var(--c-red); background: transparent; border: 1px solid var(--c-red);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cab-cover-remove:hover { background: rgba(228, 87, 76, .1); }
.cab-cover-remove.armed { background: rgba(228, 87, 76, .18); animation: cab-x-pulse 1s infinite; }
.cab-cover-remove.armed span { font-weight: 700; }
/* Overlay variant: the button sits on top of the cover preview image itself. */
.cab-cover-edit { position: relative; margin: 0 0 8px; }
.cab-cover-edit > img { width: 100%; aspect-ratio: 440 / 214; object-fit: cover; border-radius: 12px; display: block; }
.cab-cover-edit .cab-cover-remove {
  position: absolute; top: 8px; right: 8px; width: auto; margin: 0;
  padding: 7px 12px; font-size: 14px;
  background: rgba(8, 6, 5, .62); border-color: rgba(8, 6, 5, .62); color: #ff9d8f;
}
.cab-cover-edit .cab-cover-remove:hover { background: rgba(8, 6, 5, .8); }
.cab-cover-edit .cab-cover-remove.armed { background: rgba(228, 87, 76, .9); border-color: rgba(228, 87, 76, .9); color: #fff; }
@keyframes cab-x-pulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .cab-cover-x.armed { animation: none; } }

/* ---------- Anchored toasts (near the interacted element) ---------- */
.cab-toast-near {
  position: fixed; z-index: 99; max-width: min(280px, calc(100vw - 24px));
  background: var(--c-pan2); border: 1px solid var(--c-line2); color: var(--c-txt);
  border-radius: 11px; padding: 10px 13px; font-size: 15px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.cab-toast-near.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cab-toast-near { transition: none; } }

/* ---------- Profile cover (user-uploaded banner behind the avatar) ---------- */
.cab-cover {
  width: 100%; max-width: 440px; aspect-ratio: 440 / 214; margin: 14px auto 0;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(120deg, var(--c-accs), var(--c-pan2));
  border: 1px solid var(--c-line);
}
.cab-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cab-cover-full { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; margin-top: 0; }
/* Full-bleed cover inside the padded cabinet body (dashboard): same look as
   the public profile cover. */
.cab-body > section > .cab-cover:first-child {
  width: auto; max-width: none; display: block;
  margin: 0 -15px;
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}

/* ---------- Permanent VolID link (label above, link + glyph below) ---------- */
.cab-volid {
  margin-top: 10px;
  background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 12px;
  padding: 8px 10px; min-width: 0;
}
.cab-volid-l {
  display: block; font-family: var(--c-m); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-dim); margin-bottom: 4px;
}
.cab-volid-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cab-volid-u {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--c-m); font-size: 12px; color: var(--c-dim);
}
/* Mini copy glyph next to short-link/QR links */
.cab-copy-mini {
  flex: none; width: 24px; height: 24px; border-radius: 7px; padding: 0;
  background: var(--c-pan2); border: 1px solid var(--c-line);
  color: var(--c-acc-ink); cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -6px;
  position: relative;
}
/* 24px is a small tap target: extend the hit area without changing the
   visual size. */
.cab-copy-mini svg { width: 14px; height: 14px; display: block; }
/* Share-link toast (public profile): centered above the bottom area. */
.cab-share-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 99;
  max-width: min(280px, calc(100vw - 24px));
  background: var(--c-pan2); border: 1px solid var(--c-line2); color: var(--c-txt);
  border-radius: 11px; padding: 10px 13px; font-size: 15px; text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .18s; pointer-events: none;
}
.cab-share-toast.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cab-share-toast { transition: none; } }
.cab-copy-mini::after {
  content: ""; position: absolute; inset: -6px;
}
.cab-copy-mini:hover { border-color: var(--c-acc); }
/* QR mini trigger (public Contacts cap): icon-only ghost square. */
.cab-qr-mini {
  flex: none; width: 48px; height: 48px; border-radius: 12px; padding: 0;
  background: var(--c-pan); border: 1px solid var(--c-line2);
  color: var(--c-acc-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cab-qr-mini:hover { border-color: var(--c-acc); }
.cab-qr-mini:focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.cab-qr-mini svg { width: 27px; height: 27px; display: block; }
/* Required-field marker in the connect-me form (CSS only: profile.js rewrites
   label text on language switch, which would wipe a markup asterisk). */
.cab-connect-box .cab-field label:has(+ input[required])::after,
.cab-connect-box .cab-field label:has(+ textarea[required])::after {
  content: " *"; color: var(--c-red);
}
.cab-copy-mini:focus-visible { outline: 2px solid var(--c-acc-ink); outline-offset: 2px; }
.cab-copy-mini:disabled {
  color: var(--c-faint); border-color: var(--c-line); background: var(--c-pan2);
  cursor: not-allowed;
}
.cab-copy-mini:disabled:hover { border-color: var(--c-line); }
/* Post-copy success state (set by cabinet.js for 5 s): green check. */
.cab-copy-mini.is-copied { color: var(--c-ok); border-color: var(--c-ok); }

/* ---------- Profile header ---------- */
.cab-hh { display: flex; gap: 12px; align-items: flex-end; padding: 16px 0 4px; }
/* Avatar partially overlaps the cover; name + link sit at avatar bottom.
   The negative offset lives on the avatar itself (not the whole header),
   so a two-line name grows downward and never climbs onto the cover. */
.cab-hh-overlap { margin-top: 0; }
.cab-hh-overlap .cab-av { box-shadow: 0 0 0 4px var(--c-ink); margin-top: -45px; }
.cab-hh-overlap .cab-hw { padding-bottom: 6px; }
.cab-av {
  width: 90px; height: 90px; border-radius: 22px; background: var(--c-pan2); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--c-d); font-weight: 700; font-size: 38px; color: var(--c-acc-ink);
  overflow: hidden;
}
.cab-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cab-hn { font-family: var(--c-d); font-weight: 600; font-size: 23px; display: -webkit-box; line-height: 1.2; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; max-height: 2.4em; }
.cab-hu { font-family: var(--c-m); font-size: 14px; color: var(--c-acc-ink); display: block; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.cab-hu a { color: inherit; text-decoration: none; }
.cab-hu a:hover { text-decoration: underline; }
.cab-hw { flex: 1; min-width: 0; overflow: hidden; }
.cab-bio { font-size: 16px; color: var(--c-mut); margin: 10px 0 0; }

/* ---------- Rows ---------- */
.cab-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--c-line); width: 100%;
  color: inherit; text-decoration: none; background: none;
  border-left: 0; border-right: 0; border-top: 0;
  font: inherit; text-align: left; cursor: default;
}
.cab-row:last-child { border-bottom: 0; }
a.cab-row, button.cab-row { cursor: pointer; }
.cab-row .rw { flex: 1; min-width: 0; }
.cab-row .rt { display: block; font-size: 17px; }
.cab-row .rs {
  display: block; font-size: 14px; color: var(--c-dim); font-family: var(--c-m);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis;
}
/* Field caption above the value (public profile): label-first rows read
   like the cabinet form labels. */
.cab-row .rs:first-child {
  margin-top: 0; margin-bottom: 2px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.cab-row .rv { flex: none; font-family: var(--c-m); font-size: 16px; color: var(--c-acc-ink); }
.cab-row .chev { flex: none; color: var(--c-dim); font-size: 18px; }
.cab-ic {
  width: 32px; height: 32px; border-radius: 10px; background: var(--c-pan2); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--c-d); font-weight: 700; font-size: 14px; color: var(--c-acc-ink);
}
.cab-ic svg { width: 16px; height: 16px; }

/* ---------- Home blocks (balance, actions, metrics) ---------- */
.cab-bal {
  background: var(--c-pan); border: 1px solid var(--c-line2); border-radius: 16px;
  padding: 14px; margin-top: 14px; position: relative; overflow: hidden;
}
.cab-bal-l { font-family: var(--c-m); font-size: 12px; letter-spacing: .11em; text-transform: uppercase; color: var(--c-mut); }
.cab-bal-n { font-family: var(--c-d); font-weight: 700; font-size: 46px; letter-spacing: -.02em; display: block; margin-top: 2px; line-height: 1; }
.cab-bal-s { font-family: var(--c-m); font-size: 13px; color: var(--c-warn); margin-top: 6px; display: block; }
.cab-qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cab-qa.two { grid-template-columns: repeat(2, 1fr); }
.cab-q {
  background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 13px;
  padding: 11px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--c-txt); text-decoration: none; cursor: pointer; font: inherit;
}
.cab-q:hover { border-color: var(--c-acc); }
.cab-q svg { width: 19px; height: 19px; color: var(--c-acc-ink); }
.cab-q span { font-size: 14px; text-align: center; display: block; line-height: 1.25; }
/* Public profile actions: solid accent so they stand out from the page. */
.cab-qa-act .cab-q { background: var(--c-acc); border-color: var(--c-acc); color: #12100e; font-weight: 600; }
/* ...as two side-by-side rows (glyph left, label right) with large glyphs. */
.cab-qa-act { grid-template-columns: repeat(2, 1fr); }
.cab-qa-act .cab-q { flex-direction: row; justify-content: flex-start; padding: 8px 10px; gap: 10px; }
.cab-qa-act .cab-q svg { width: 44px; height: 44px; flex: none; }
.cab-qa-act .cab-q span { text-align: left; font-size: 14px; }
.cab-qa-act .cab-q:hover { filter: brightness(1.1); border-color: var(--c-acc); }
/* Icons take the button text color: acc-ink on the accent fill is unreadable. */
.cab-qa-act .cab-q svg { color: #12100e; }
.cab-page[data-theme='light'] .cab-qa-act .cab-q { color: #1d1917; }
.cab-page[data-theme='light'] .cab-qa-act .cab-q svg { color: #1d1917; }
.cab-mets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cab-met { background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 12px; padding: 11px; }
.cab-met-n { font-family: var(--c-d); font-weight: 700; font-size: 26px; display: block; }
.cab-met-l { font-family: var(--c-m); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-dim); display: block; margin-top: 2px; }

/* ---------- Forms ---------- */
.cab-form { background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 14px; padding: 13px; margin-top: 12px; }
.cab-field { margin-bottom: 10px; }
.cab-field label { display: block; font-family: var(--c-m); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-dim); margin-bottom: 5px; }
.cab-field input, .cab-field textarea, .cab-field select {
  width: 100%; background: var(--c-ink); border: 1px solid var(--c-line2); border-radius: 11px;
  padding: 9px 11px; color: var(--c-txt); font-family: var(--c-b); font-size: 16px; outline: none;
}
.cab-field input:focus, .cab-field textarea:focus, .cab-field select:focus { border-color: var(--c-acc); }
.cab-field textarea { min-height: 128px; resize: vertical; }
.cab-send {
  width: auto; background: var(--c-acc); color: #12100e; font-weight: 600; font-size: 15px;
  border: 0; border-radius: 11px; padding: 8px 18px; cursor: pointer; font-family: var(--c-b);
}
.cab-send:hover { filter: brightness(1.1); }
.cab-send:disabled { opacity: 0.5; cursor: not-allowed; }
.cab-send:disabled:hover { filter: none; }
/* Action row: primary + secondary side by side (Settings email/password,
   consent confirmation). One shared class instead of inline flex styles. */
.cab-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; align-items:center; }
.cab-actions .cab-send { width:auto; flex:1 1 200px; }
.cab-actions .cab-auth { flex:0 1 auto; align-self:center; padding:11px 16px; font-size:15px; }
.cab-actions .cab-auth:focus-visible,
.cab-actions .cab-send:focus-visible { outline:2px solid var(--c-acc); outline-offset:-2px; }
@media (max-width:360px) {
  .cab-actions .cab-send, .cab-actions .cab-auth { flex:1 1 100%; text-align:center; }
}

/* ---------- Referral link block ---------- */
.cab-ref-row { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.cab-ref-input {
  flex: 1 1 auto; min-width: 0; padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--c-line2); background: var(--c-ink); color: var(--c-txt);
  font-family: var(--c-m); font-size: 14px; outline: none;
}
.cab-ref-input:focus { border-color: var(--c-acc); }
.cab-ref-input.is-paused,
.cab-ref-input:disabled {
  background: var(--c-pan2); color: var(--c-faint); border-color: var(--c-line);
  cursor: not-allowed;
}
/* Mini copy glyph next to the link field: same treatment as the VolID
   glyph, with an accent tint while its link is active so the primary share
   action still reads as one. */
.cab-ref-row.is-active .cab-copy-mini {
  background: var(--c-accs); border-color: var(--c-acc);
}
.cab-ref-row.is-active .cab-copy-mini:hover { border-color: var(--c-acc-ink); }
/* QR of the referral link: thumbnail in a white plate (same as the personal
   QR card) + caption/button column; wraps on narrow screens. */
.cab-ref-qr { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.cab-ref-qr .cab-ref-qr-thumb-btn {
  background: #fff; padding: 8px; border-radius: 12px; border: 0; cursor: pointer;
  flex: 0 0 auto; display: inline-block;
}
.cab-ref-qr .cab-qr-thumb { display: block; width: 104px; }
.cab-ref-qr .cab-ref-qr-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cab-ref-qr .cab-auth { padding: 9px 14px; font-size: 14px; }
.cab-ref-qr.is-paused .cab-ref-qr-thumb-btn,
.cab-ref-qr.is-paused .cab-auth { opacity: 0.45; cursor: not-allowed; }
/* Toggle switch replacing the Deactivate/Activate buttons. Native checkbox
   stays focusable; the track/thumb are pure decoration. */
.cab-ref-toggle { margin-top: 16px; }
.cab-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.cab-switch input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.cab-switch input:focus-visible + .cab-switch-track {
  outline: 2px solid var(--c-acc); outline-offset: 2px;
}
/* Disabled mid-flight (htmx): visibly honest that the toggle is busy. */
.cab-switch input:disabled + .cab-switch-track { opacity: .55; }
.cab-switch input:disabled ~ .cab-switch-label { color: var(--c-faint); }
.cab-switch-track {
  flex: none; width: 46px; height: 26px; border-radius: 999px;
  background: var(--c-pan2); border: 1px solid var(--c-line2);
  display: inline-flex; align-items: center; padding: 2px;
  transition: background .18s, border-color .18s;
}
.cab-switch-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--c-dim); transition: transform .18s, background .18s;
}
.cab-switch input:checked + .cab-switch-track {
  background: var(--c-acc); border-color: var(--c-acc);
}
.cab-switch input:checked + .cab-switch-track .cab-switch-thumb {
  transform: translateX(20px); background: #12100e;
}
.cab-page[data-theme='light'] .cab-switch input:checked + .cab-switch-track .cab-switch-thumb,
:root[data-theme='light'] .cab-switch input:checked + .cab-switch-track .cab-switch-thumb {
  background: #1d1917;
}
.cab-switch-label {
  font-family: var(--c-m); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-dim);
}
.cab-switch input:checked ~ .cab-switch-label { color: var(--c-acc-ink); }
/* Off state: the label doubles as a status line ("Link is not active"), so
   it drops to the faint tone instead of looking like an action to take. */
.cab-switch-label.is-off,
.cab-switch input:not(:checked) ~ .cab-switch-label.is-off { color: var(--c-faint); }
@media (prefers-reduced-motion: reduce) {
  .cab-switch-track, .cab-switch-thumb { transition: none; }
}
.cab-alert { border-radius: 11px; padding: 10px 13px; font-size: 16px; margin-bottom: 10px; }
.cab-alert.err { background: rgba(228, 87, 76, .12); border: 1px solid rgba(228, 87, 76, .4); color: var(--c-red); }
.cab-alert.ok { background: rgba(84, 184, 124, .12); border: 1px solid rgba(84, 184, 124, .4); color: var(--c-ok); }
.cab-alert.info { background: var(--c-accs); border: 1px solid var(--c-line2); color: var(--c-txt); }

/* ---------- Toast / footer ---------- */
.cab-toast {
  position: absolute; left: 15px; right: 15px; bottom: 74px; background: var(--c-pan2);
  border: 1px solid var(--c-line2); border-radius: 11px; padding: 10px 13px; font-size: 16px;
  opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
  pointer-events: none; z-index: 9;
}
.cab-toast.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cab-toast { transition: none; } }
.cab-foot {
  margin-top: 22px; text-align: center; font-family: var(--c-m); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--c-faint);
}
.cab-foot a { color: var(--c-dim); text-decoration: none; }
.cab-foot a:hover { color: var(--c-acc-ink); text-decoration: underline; }
.cab-foot a:focus-visible { color: var(--c-acc-ink); text-decoration: underline; }

/* Public profile contact groups (phones/emails): subheader under Contacts,
   indented compact rows with icons, accent links like the homepage gold. */
.cab-subcap { margin: 12px 0 2px; font-family: var(--c-m); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-dim); }
.cab-contacts-group { margin-left: 20px; }
.cab-row.cab-contact-line { padding: 6px 0; gap: 12px; align-items: center; }
.cab-row.cab-contact-line .rt { overflow-wrap: anywhere; }
.cab-contact-line a, .cab-contact-line .contact-protected,
.cab-links-group a.cab-row .rt { color: var(--c-acc-ink); text-decoration: none; }
.cab-contact-line a:hover, .cab-links-group a.cab-row:hover .rt { color: var(--c-acc); text-decoration: underline; }
.cab-contact-line a:focus-visible, .cab-links-group a.cab-row:focus-visible .rt { color: var(--c-acc); text-decoration: underline; }

/* Content-page footer links (Terms/Privacy): same treatment as cab-foot. */
.cab-page .footer-nav { margin-top: 14px; text-align: center; font-family: var(--c-m); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.cab-page .footer-nav a { color: var(--c-dim); text-decoration: none; }
.cab-page .footer-nav a:hover { color: var(--c-acc-ink); text-decoration: underline; }
.cab-page .footer-nav a:focus-visible { color: var(--c-acc-ink); text-decoration: underline; }

/* ==========================================================================
   Compat: legacy luxe wrappers render cabinet palette.
   Covers auth/*, pool/*, errors, carrier/unverified, business_page until and
   unless each template is individually rewritten.
   ========================================================================== */
.auth-screen.volid,
.public-page.volid,
.volid-page.volid {
  background: var(--c-pagebg); color: var(--c-txt);
  font-family: var(--c-b); font-size: 18px;
  -webkit-font-smoothing: antialiased;
}
.auth-screen.volid { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; }
/* Corner lang + theme controls for header-less volid pages (forgot, message,
   pools, errors): same orange language as everywhere else. */
.volid-corner { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 1000; }
.volid-page.volid { min-height: 100dvh; display: flex; flex-direction: column; }
.volid-page .auth-screen.volid { background: none; min-height: 0; flex: 1; }
.public-page.volid { min-height: 100dvh; padding: 40px 16px; }
.auth-screen.volid .auth-card,
.public-page.volid .public-card {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--c-pan); border: 1px solid var(--c-line);
  border-radius: 18px; padding: 24px 20px; color: var(--c-txt);
}
.auth-screen.volid .auth-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; margin-bottom: 18px; color: var(--c-txt); font-family: var(--c-d); }
.auth-screen.volid .auth-brand span { font-size: 20px; }
.auth-screen.volid .auth-title { font-family: var(--c-d); font-size: 23px; font-weight: 700; margin-bottom: 4px; color: var(--c-txt); }
.auth-screen.volid .auth-subtitle { color: var(--c-mut); font-size: 16px; margin-bottom: 18px; }
.auth-screen.volid .form-label, .public-page.volid .form-label { color: var(--c-txt); font-size: 17px; font-weight: 600; }
.auth-screen.volid .form-hint, .public-page.volid .form-hint { color: var(--c-mut); font-size: 14px; }
.auth-screen.volid .form-input, .auth-screen.volid .form-textarea, .auth-screen.volid .form-select,
.public-page.volid .form-input, .public-page.volid .form-textarea {
  background: var(--c-ink); border: 1px solid var(--c-line2); border-radius: 11px;
  color: var(--c-txt); font-size: 16px; padding: 9px 11px; width: 100%;
}
.auth-screen.volid .form-input:focus, .auth-screen.volid .form-textarea:focus,
.public-page.volid .form-input:focus, .public-page.volid .form-textarea:focus {
  border-color: var(--c-acc); outline: none;
}
.auth-screen.volid .btn-primary, .public-page.volid .btn-primary {
  background: var(--c-acc); color: #12100e; font-weight: 700; font-size: 17px;
  border: 0; border-radius: 12px; padding: 14px 22px; font-family: var(--c-b);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer;
}
.auth-screen.volid .btn-primary:hover, .public-page.volid .btn-primary:hover { filter: brightness(1.1); }
.auth-screen.volid .btn-secondary, .public-page.volid .btn-secondary {
  background: transparent; color: var(--c-acc-ink); border: 1px solid var(--c-line2);
  border-radius: 11px; font-size: 16px; padding: 12px 18px; font-family: var(--c-b);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer;
}
.auth-screen.volid .btn-secondary:hover, .public-page.volid .btn-secondary:hover { border-color: var(--c-acc); }
.auth-screen.volid .btn-block, .public-page.volid .btn-block { width: 100%; }
.auth-screen.volid a, .public-page.volid a { color: var(--c-acc-ink); }
.auth-screen.volid .text-muted, .public-page.volid .text-muted { color: var(--c-mut); }
.auth-screen.volid .mono, .public-page.volid .mono { font-family: var(--c-m); color: var(--c-acc-ink); }
.auth-screen.volid .alert-error, .public-page.volid .alert-error {
  background: rgba(228, 87, 76, .12); border: 1px solid rgba(228, 87, 76, .4);
  color: var(--c-red); border-radius: 11px; padding: 10px 13px; font-size: 16px; margin-bottom: 10px;
}
.auth-screen.volid .alert-info, .auth-screen.volid .alert-success,
.public-page.volid .alert-success {
  background: var(--c-accs); border: 1px solid var(--c-line2); color: var(--c-txt);
  border-radius: 11px; padding: 10px 13px; font-size: 16px; margin-bottom: 10px;
}
.auth-screen.volid .auth-footer { margin-top: 18px; text-align: center; font-size: 16px; color: var(--c-mut); }
.auth-screen.volid .oauth-divider { color: var(--c-mut); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.auth-screen.volid .oauth-divider::before, .auth-screen.volid .oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.auth-screen.volid .oauth-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
/* Legacy volid-page nav frame (auth/login, register) */
.volid-page .volid-nav { border-bottom: 1px solid var(--c-line); background: var(--c-ink); }
.volid-page .volid-nav-in { max-width: 480px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; }
/* Whatever follows the logo is pushed right, so short EN and long PL labels
   share one line without wrapping the bar. */
.volid-page .volid-nav-in > :nth-child(2) { margin-left: auto; }
.volid-page .volid-nav-logo { flex: none; }
.volid-page .volid-nav-logo img { height: 39px; width: auto; display: block; }
.volid-page .volid-nav-home { margin-left: auto; font-size: 16px; color: var(--c-mut); text-decoration: none; }
.volid-page .volid-nav-home:hover { color: var(--c-acc-ink); }
.volid-page .volid-nav-cta {
  font-size: 14px; border-radius: 8px; height: 30px; padding: 0 13px; background: var(--c-acc);
  color: #12100e; font-weight: 700; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .volid-page .volid-nav-in { gap: 8px; padding: 10px 12px; }
  .volid-page .volid-nav-cta { padding: 0 10px; }
}
/* Icon variant of the auth CTA (vault/login, register): desktop shows the
   text label, narrow screens show a 30px icon button like the site header. */
.volid-page .volid-nav-cta .volid-nav-ico { display: none; width: 19px; height: 19px; }
@media (max-width: 480px) {
  .volid-page .volid-nav-cta.volid-nav-ico-btn {
    flex: none; width: 30px; height: 30px; padding: 0; border-radius: 9px;
    background: var(--c-pan); border: 1px solid var(--c-line2); color: var(--c-acc-ink);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .volid-page .volid-nav-cta.volid-nav-ico-btn:hover { border-color: var(--c-acc); }
  .volid-page .volid-nav-cta.volid-nav-ico-btn .volid-nav-txt { display: none; }
  .volid-page .volid-nav-cta.volid-nav-ico-btn .volid-nav-ico { display: block; }
}
.volid-page .volid-home-link { text-align: center; padding: 0 16px 28px; }
.volid-page .volid-home-link a { font-size: 14px; color: var(--c-mut); text-decoration: none; }
.volid-page .volid-home-link a:hover { color: var(--c-acc-ink); }
/* Legacy public/business blocks */
.public-page.volid .volid-wrap { max-width: 1020px; margin: 0 auto; padding: 0 24px; }
.public-page.volid .volid-label { font-family: var(--c-m); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--c-acc-ink); margin-bottom: 14px; }
.public-page.volid .business-headline { font-family: var(--c-d); font-weight: 700; letter-spacing: -.01em; color: var(--c-txt); }
.public-page.volid .business-description { color: var(--c-mut); }
.public-page.volid .business-logo { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; margin: 0 auto 16px; background: var(--c-pan2); border: 1px solid var(--c-line); }
.public-page.volid .volid-layers, .public-page.volid .volid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.public-page.volid .volid-lay, .public-page.volid .volid-cardx { background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 16px; padding: 22px 20px; }
.public-page.volid .volid-lay b, .public-page.volid .volid-cardx b { display: block; font-size: 18px; margin-bottom: 7px; color: var(--c-txt); }
.public-page.volid .volid-lay span, .public-page.volid .volid-cardx span { font-size: 16px; color: var(--c-mut); line-height: 1.55; }
.public-page.volid .volid-decl { margin: 30px 0 4px; padding: 24px 28px; border-radius: 16px; background: var(--c-accs); border: 1px solid var(--c-line2); border-left: 3px solid var(--c-acc); }
.public-page.volid .volid-decl p { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 600; color: var(--c-txt); }
.public-page.volid .volid-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.public-page.volid .volid-foot { margin-top: 34px; color: var(--c-mut); font-size: 14px; font-family: var(--c-m); text-align: center; }
.public-page.volid .public-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--c-pan2); color: var(--c-acc-ink); display: flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 700; margin: 0 auto 16px; border: 1px solid var(--c-line); }
.public-page.volid .public-name { font-size: 23px; font-weight: 700; font-family: var(--c-d); }
.public-page.volid .public-handler { color: var(--c-acc-ink); font-size: 14px; margin-bottom: 16px; font-family: var(--c-m); }
.public-page.volid .public-bio { color: var(--c-mut); margin-bottom: 24px; font-size: 16px; }
.public-page.volid .public-link { display: block; padding: 16px; background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 14px; font-weight: 600; text-align: center; color: var(--c-txt); text-decoration: none; }
.public-page.volid .public-link:hover { border-color: var(--c-acc); }
/* ---------- Language switch (dropdown): same tokens as the landing header ---------- */
.cab-page .lang-switch,
.auth-screen.volid .lang-switch,
.public-page.volid .lang-switch,
.volid-page .lang-switch {
  position: relative;
  display: inline-block;
  flex: none;
  z-index: 1000;
}
.cab-page .lang-switch[open],
.auth-screen.volid .lang-switch[open],
.public-page.volid .lang-switch[open],
.volid-page .lang-switch[open] {
  z-index: 1000;
}
.cab-page .lang-switch__btn,
.auth-screen.volid .lang-switch__btn,
.public-page.volid .lang-switch__btn,
.volid-page .lang-switch__btn {
  display: inline-block;
  border: 1px solid var(--c-line2);
  border-radius: 999px;
  background: var(--c-pan);
  color: var(--c-acc-ink);
  font-family: var(--c-m);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  cursor: pointer;
  list-style: none;
}
.cab-page .lang-switch__btn::-webkit-details-marker,
.auth-screen.volid .lang-switch__btn::-webkit-details-marker,
.public-page.volid .lang-switch__btn::-webkit-details-marker,
.volid-page .lang-switch__btn::-webkit-details-marker {
  display: none;
}
.cab-page .lang-switch__btn::after,
.auth-screen.volid .lang-switch__btn::after,
.public-page.volid .lang-switch__btn::after,
.volid-page .lang-switch__btn::after {
  content: ' ▾';
}
.cab-page .lang-switch__menu,
.auth-screen.volid .lang-switch__menu,
.public-page.volid .lang-switch__menu,
.volid-page .lang-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  border: 1px solid var(--c-line2);
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-pan);
}
.cab-page .lang-switch__menu a,
.auth-screen.volid .lang-switch__menu a,
.public-page.volid .lang-switch__menu a,
.volid-page .lang-switch__menu a {
  color: var(--c-acc-ink);
  font-family: var(--c-m);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  text-decoration: none;
  white-space: nowrap;
}
.cab-page .lang-switch__menu a:hover,
.auth-screen.volid .lang-switch__menu a:hover,
.public-page.volid .lang-switch__menu a:hover,
.volid-page .lang-switch__menu a:hover {
  background: var(--c-acc);
  color: #0b0910;
}
:root[data-theme='light'] .cab-page .lang-switch__menu a:hover,
:root[data-theme='light'] .auth-screen.volid .lang-switch__menu a:hover,
:root[data-theme='light'] .public-page.volid .lang-switch__menu a:hover,
:root[data-theme='light'] .volid-page .lang-switch__menu a:hover {
  color: #1d1917;
}

/* ---------- Nested legacy fragments inside cabinet (link/card rows, handle check) ---------- */
.cab-page .card-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--c-line); font-size: 16px;
}
.cab-page .card-row:last-child { border-bottom: 0; }
/* Long link/card text must not push the Remove button out: the text column
   needs min-width: 0 (flex default is min-content) plus wrapping, and the
   button must never shrink. Covers Links and Wallet card rows alike. */
.cab-page .card-row > :first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cab-page .card-row > :last-child { flex: none; }
.cab-page .text-muted { color: var(--c-mut); }
.cab-page .text-xs { font-size: 14px; }
.cab-page .mono { font-family: var(--c-m); }
.cab-page .btn-danger {
  background: transparent; color: var(--c-red); border: 1px solid var(--c-line2);
  border-radius: 9px; padding: 4px 10px; font-size: 14px; cursor: pointer;
}
.cab-page .btn-danger:hover { border-color: var(--c-red); }
.cab-page .stack-sm > * + * { margin-top: 8px; }
.cab-page .stack-md > * + * { margin-top: 12px; }

@media (max-width: 860px) {
  .public-page.volid .volid-layers, .public-page.volid .volid-grid { grid-template-columns: 1fr; }
}

/* ---------- Personal QR modal (public profile + Vault) ----------
   z-index sits above the sticky .cab-bar (500) so the backdrop dims the
   header too, still below the lang dropdown (1000). ---------- */
.cab-qr-modal {
  position: fixed; inset: 0; z-index: 700;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.74); padding: 20px;
}
/* Hidden state must beat the flex layout above regardless of source order. */
.cab-qr-modal.cab-hidden { display: none; }
.cab-qr-box {
  position: relative; width: 100%; max-width: 400px;
  background: var(--c-pan); color: var(--c-txt);
  border: 1px solid var(--c-line);
  border-radius: 18px; padding: 46px 22px 18px; text-align: center;
}
.cab-qr-close {
  position: absolute; top: 4px; right: 8px;
  background: none; border: 0; cursor: pointer;
  font-size: 42px; font-weight: 900; line-height: 1; color: var(--c-txt); padding: 8px;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; z-index: 1;
}
.cab-qr-close:hover { color: var(--c-acc-ink); background: var(--c-accs); }
.cab-qr-close:focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.cab-qr-code svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.cab-qr-cap { font-size: 12px; color: var(--c-mut); margin-top: 10px; word-break: break-all; }
.cab-qr-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.cab-qr-actions .cab-auth { font-size: 14px; padding: 8px 14px; }
.cab-qr-transparent {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--c-mut); cursor: pointer; user-select: none;
}
.cab-qr-transparent input { margin: 0; accent-color: var(--c-acc); cursor: pointer; }
.cab-qr-transparent input:focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.cab-qr-toast {
  margin-top: 12px; font-size: 14px; color: var(--c-txt);
  background: var(--c-pan2); border-radius: 10px; padding: 8px 12px;
}
.cab-qr-box .cab-auth.ghost { color: var(--c-mut); border-color: var(--c-line2); }
.cab-qr-box .cab-auth.ghost:hover { color: var(--c-acc-ink); border-color: var(--c-acc); }
/* Connect-me modal: same box, but left-aligned and vertically scrollable so
   all six fields stay reachable on short viewports. The inner form drops its
   card frame (the box already provides one). */
.cab-connect-box { text-align: left; max-height: calc(100dvh - 40px); overflow-y: auto; }
.cab-connect-box .cab-form { background: none; border: 0; padding: 0; margin-top: 12px; }
.cab-connect-title { font-family: var(--c-d); font-weight: 600; font-size: 20px; margin: 0 44px 4px 0; }
.cab-qr-thumb svg { width: 100%; height: auto; display: block; }

/* ---------- vCard preview (cabinet): text preview in a QR-style overlay ---------- */
.cab-vcf-open { display: inline-flex; align-items: center; gap: 6px; }
.cab-vcf-open svg { width: 16px; height: 16px; }
.cab-vcf-pre {
  font-size: 13px; white-space: pre-wrap; word-break: break-all; text-align: left;
  margin: 0; max-height: 60vh; overflow: auto;
}

/* ---------- CRM tasks ("My tasks" Feed block) ---------- */
.task-done .rt {
  text-decoration: line-through;
  text-decoration-color: var(--c-ok);
  text-decoration-thickness: 2px;
  color: var(--c-dim);
}
.task-overdue { border-left: 3px solid var(--c-red); padding-left: 8px; }

/* ---------- Unsaved-changes badge (dirty profile/contacts forms) ---------- */
.cab-dirty {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--c-acc-ink); background: var(--c-accs);
  border-radius: 8px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}
.cab-dirty[hidden] { display: none; }

/* ---------- Unsaved-changes: per-field highlight + save block ----------
   dirtyRefresh() (cabinet.js) toggles .is-dirty on each edited .cab-field
   and on the tracked form itself. The frame wraps only the save button +
   badge (tracked inputs live outside the <form> via the form= attribute). */
.cab-field.is-dirty input,
.cab-field.is-dirty textarea,
.cab-field.is-dirty select {
  border-color: var(--c-red);
}
.cab-field.is-dirty input:focus,
.cab-field.is-dirty textarea:focus,
.cab-field.is-dirty select:focus {
  border-color: var(--c-red);
  outline: 2px solid var(--c-red);
  outline-offset: -2px;
}
.cab-field-dirty {
  display: block;
  color: var(--c-red);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
form[data-dirty-form].is-dirty {
  border: 1px solid var(--c-red);
  background: rgba(228, 87, 76, .07);
  border-radius: 12px;
  padding: 10px 12px;
}
form[data-dirty-form].is-dirty [data-dirty-badge] {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 10px;
  text-align: center;
}

/* ---------- Generic hide utility ---------- */
/* Must win over any layout display rule: keep last in this file and keep
   !important (same pattern as Bootstrap d-none / Tailwind hidden). */
.cab-hidden { display: none !important; }

/* ---------- Microlanding modal + blocks ---------- */
/* Public microlanding opener: 16px and wrapping so a 30-char custom label
   is never ellipsized by the .cab-auth header rule. */
.cab-auth.cab-micro-open {
  width: 100%;
  font-size: 16px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.3;
  padding: 8px 12px;
}
#micro-modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  max-width: min(640px, 94vw);
  max-height: 88vh;
  width: 100%;
  margin: auto;
}
#micro-modal::backdrop { background: rgba(0, 0, 0, 0.55); }
.micro-close {
  position: absolute; top: 12px; right: 16px; z-index: 2;
  width: 48px; height: 48px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c-acc); color: #12100e;
  font-size: 28px; font-weight: 900; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.micro-close:hover { filter: brightness(1.07); }
.micro-close:focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.micro-scroll { overflow-y: auto; max-height: 88vh; padding: 16px; }
.micro-block { margin: 16px 0; }
.micro-block img, .micro-block video { max-width: 100%; border-radius: 12px; }
.micro-block video { width: 100%; }
.micro-carousel { position: relative; overflow: hidden; border-radius: 12px; }
.micro-track { display: flex; transition: transform 0.3s ease; }
.micro-slide { min-width: 100%; margin: 0; }
.micro-slide img { width: 100%; display: block; }
.micro-prev, .micro-next {
  position: absolute; top: 40%; border: 0; border-radius: 50%;
  width: 36px; height: 36px; font-size: 20px; cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
}
.micro-prev { left: 8px; } .micro-next { right: 8px; }
.micro-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.micro-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--c-line); cursor: pointer; }
.micro-dots button.on { background: var(--c-acc); }
.micro-yt button { position: relative; border: 0; padding: 0; width: 100%; cursor: pointer; background: none; }
.micro-yt img { width: 100%; display: block; }
.micro-yt span {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff;
  font-size: 24px; display: flex; align-items: center; justify-content: center;
}
.micro-files { list-style: none; padding: 0; }
.micro-files li { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
/* Long unbroken strings (URLs, file names) must not push the modal wider. */
.micro-scroll, .micro-block h3, .micro-block h4, .micro-files, .micro-fname {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.micro-scroll { overflow-x: clip; }
.micro-toolbar { display: flex; gap: 6px; margin: 6px 0; }
.micro-toolbar button {
  border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-pan);
  color: var(--c-txt); min-width: 36px; min-height: 32px; font-size: 15px; cursor: pointer;
}
.micro-toolbar button:hover { background: var(--c-accs); }
.micro-items { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.micro-item { display: inline-flex; gap: 4px; align-items: center; }
.micro-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.micro-item form { display: inline; margin: 0; }
.micro-fname { font-size: 12px; max-width: 180px; }
/* Text blocks render CommonMark (paragraphs, bold/italic, lists) with hard
   line breaks, so the block needs real spacing — it had no rules at all. */
.micro-text { line-height: 1.5; overflow-wrap: anywhere; }
.micro-text p { margin: 0 0 8px; }
.micro-text p:last-child { margin-bottom: 0; }
.micro-text ul, .micro-text ol { margin: 0 0 8px; padding-left: 22px; }
.micro-text li { margin: 2px 0; }
/* PDF block heading + coloured document glyph in front of every file name. */
.micro-files-title { margin: 0 0 6px; }
.micro-pdf-ico { flex: none; width: 14px; height: 14px; color: #d2453c; }
.cab-page[data-theme='light'] .micro-pdf-ico { color: #c0362d; }
/* Drag-to-reorder: only the grip is draggable, the block keeps its buttons,
   file input and text selection. touch-action:none on the grip stops the
   page from scrolling while a long press turns into a drag. */
.micro-block summary { display: flex; align-items: center; gap: 8px; background-color: var(--c-accs); }
.micro-grip {
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  color: var(--c-acc-ink); padding: 4px 6px; font-size: 20px; line-height: 1;
  min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(238, 117, 20, 0.14);
  box-shadow: inset 0 0 0 1px rgba(238, 117, 20, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.micro-grip:hover { background: rgba(238, 117, 20, 0.2); box-shadow: inset 0 0 0 1px rgba(238, 117, 20, 0.5); }
.micro-grip:active { cursor: grabbing; background: rgba(238, 117, 20, 0.26); box-shadow: inset 0 0 0 1px rgba(238, 117, 20, 0.6); }
/* Live region for drag/reorder announcements (main.css .sr-only is not
   loaded in the cabinet shell). */
.micro-live {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
/* Add-block buttons (.micro-add) and the per-block append buttons: one
   full-width button per row so the stack reads as a tidy column. Without
   this they were auto-width and lined up like a staircase. */
.micro-add { margin: 8px 0; }
.micro-add > .micro-add-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; text-transform: none; letter-spacing: 0;
}
.micro-add-chevron {
  display: block; flex: none; width: 16px; height: 16px;
  transition: transform .18s ease;
}
.micro-add-toggle[aria-expanded="true"] .micro-add-chevron { transform: rotate(180deg); }
.micro-append { margin: 6px 0; }
.micro-append > button { display: block; width: 100%; }
/* Text block: Delete sits next to Save, not under it. */
.micro-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* The primary label must never be squeezed below its text width; the row
   wraps as a whole on narrow screens instead. */
.micro-actions .cab-send { flex: none; white-space: nowrap; }
/* Keep "× Delete" on one line — as a flex child it would otherwise wrap. */
.micro-actions .cab-copy-mini {
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}
/* Microlanding Delete: a real destructive pill, not the 24px icon square
   .cab-copy-mini forces — the glyph+label stay on one line next to Save. */
.micro-delete {
  flex: none; display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
  white-space: nowrap; font-size: 13px; line-height: 1;
  background: var(--c-pan2); border: 1px solid var(--c-line);
  color: var(--c-acc-ink);
}
.micro-delete:hover { border-color: #e4574c; color: #e4574c; }
.micro-delete.armed {
  border-color: #e4574c; color: #e4574c;
  background: rgba(228, 87, 76, .12);
  animation: cab-x-pulse 1s infinite;
}
.micro-delete:focus-visible { outline: 2px solid #e4574c; outline-offset: 2px; }
/* Cancel stays in the row even when not active: ghost, muted, inert. */
.micro-actions .micro-cancel[disabled] { opacity: .45; cursor: default; }
.micro-actions .micro-cancel[disabled]:hover { color: var(--c-mut); border-color: var(--c-line2); }
/* ---------- Microlanding editor <dialog> (Vault) ---------- */
/* One dialog for every block type. The forms inside are the same plain
   POSTs the panels used to hold; the modal only swaps which pane is shown. */
.micro-edit-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  background: var(--c-pan);
  color: var(--c-acc-ink);
  overflow: hidden;
}
.micro-edit-modal::backdrop { background: rgba(0, 0, 0, 0.55); }
/* Several children (Remove, the discard bar, panes) set display themselves,
   which beats the UA sheet's [hidden] rule — keep the attribute authoritative. */
.micro-edit-modal [hidden] { display: none !important; }
/* A native dialog is modal, but iOS still scrolls the page behind it. */
body:has(.micro-edit-modal[open]) { overflow: hidden; }
.micro-edit-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--c-line);
}
.micro-edit-head h3 { margin: 0; font-size: 16px; text-transform: capitalize; }
.micro-edit-close {
  flex: none; width: 36px; height: 36px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c-pan2); color: var(--c-acc-ink);
  font-size: 22px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
}
.micro-edit-close:hover { filter: brightness(1.1); }
.micro-edit-close:focus-visible { outline: 2px solid var(--c-acc); outline-offset: 2px; }
.micro-edit-flash { padding: 10px 16px 0; }
.micro-edit-flash:empty { display: none; }
.micro-edit-flash .cab-alert { margin: 0; }
.micro-edit-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  max-height: calc(min(88vh, 820px) - 112px);
}
/* The dialog heading already names the type (set from this label), so the
   in-pane copy stays for screen readers only. */
.micro-pane-title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.micro-pane .cab-field { margin: 10px 0; }
.micro-pane input:not([type="file"]), .micro-pane textarea { width: 100%; }
.micro-modal-items { margin: 10px 0; }
.micro-modal-items .micro-items { margin: 0; }
.micro-discard {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  border-top: 1px solid var(--c-line); background: var(--c-pan2);
}
.micro-discard p { margin: 0; font-size: 14px; }

/* Row actions: ↑ ↓ ✎ sit on one line, same height, same gap. */
.micro-row-btns { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.micro-row-btns form { display: inline-flex; align-items: center; margin: 0; }
/* Same box for arrows and the pencil: their content heights differ (font
   glyph vs 14px svg), so without a fixed box the pencil sits 3px high. */
.micro-row-btns .cab-copy-mini,
.micro-row-btns .micro-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; line-height: 1;
}
/* Pencil points down-right in the path; mirroring turns it down-left, the
   direction the glyph itself (✎) leans in the rest of the UI. */
.micro-edit-glyph { width: 14px; height: 14px; display: block; transform: scaleX(-1); }

/* Items (carousel photos / PDF files): thumbnail, name, inline tools. */
.micro-items { display: flex; flex-direction: column; gap: 8px; }
.micro-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px; border: 1px solid var(--c-line); border-radius: 10px;
}
.micro-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.micro-item-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.micro-item-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.micro-item-tools { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.micro-item-tools form { display: inline-flex; margin: 0; gap: 2px; }
/* Item Delete is not the 24px icon square .cab-copy-mini forces: the
   glyph+label ("× Delete" -> "Delete?" while armed) need real width. */
.micro-item-del {
  width: auto; min-width: 72px; height: 24px; padding: 0 8px;
  white-space: nowrap; font-size: 13px; line-height: 1;
}
.micro-item-del.armed {
  border-color: #e4574c; color: #e4574c;
  background: rgba(228, 87, 76, .12);
  animation: cab-x-pulse 1s infinite;
}
.micro-item-file { align-items: center; }
.micro-item-editor { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 0; }
.micro-item-editor input {
  flex: 1 1 120px; min-width: 0;
  background: var(--c-ink); border: 1px solid var(--c-line2); border-radius: 8px;
  padding: 6px 9px; color: var(--c-txt); font-size: 14px; outline: none;
}
.micro-item-editor input:focus { border-color: var(--c-acc); }
/* Per-item Save is not a 24px copy square: the localised label must fit. */
.micro-item-editor .micro-item-save {
  width: auto; height: auto; min-height: 32px; padding: 6px 12px;
  border-radius: 8px; font-size: 13px; line-height: 1; white-space: nowrap;
  vertical-align: baseline;
}

/* Read-only previews in the block list. The editable rows live in a
   <template> and are cloned into the modal, so no buttons appear here. */
.micro-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.micro-preview-card { margin: 0; width: 80px; min-width: 0; }
.micro-preview-card img {
  display: block; width: 80px; height: 64px; object-fit: cover;
  border: 1px solid var(--c-line); border-radius: 8px;
}
.micro-preview-caption {
  margin-top: 3px; font-size: 12px; line-height: 1.25; color: var(--c-mut);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.micro-preview-files { flex-direction: column; gap: 6px; }
.micro-preview-file {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 9px; border: 1px solid var(--c-line); border-radius: 10px;
}
.micro-preview-file .micro-fname {
  flex: 1 1 auto; min-width: 0; max-width: none; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* "+ Add" accordion: one list of block types with live counters. */
.micro-add-form { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 4px; }
/* The class rule above overrides the UA [hidden] rule; keep the closed
   state truly invisible. */
.micro-add-form[hidden] { display: none; }
.micro-add-hint { margin: 0 0 2px; font-size: 13px; }
.micro-type-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 9px 12px;
  border-radius: 10px; border: 1px solid var(--c-line);
  background: var(--c-pan2); color: var(--c-acc-ink);
  cursor: pointer; font-size: 14px;
}
.micro-type-pick:hover:not(:disabled) { border-color: var(--c-acc); }
.micro-type-pick:disabled { opacity: .45; cursor: default; }
.micro-type-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.micro-type-note { font-size: 12px; color: var(--c-mut); }
.micro-type-count { font-size: 12px; color: var(--c-mut); flex: none; }
.micro-type-video {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--c-line); border-radius: 10px; padding: 8px 10px;
}
.micro-type-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.micro-type-variants { display: flex; gap: 6px; }
.micro-type-variants .micro-type-pick { justify-content: center; }

@media (max-width: 480px) {
  .micro-edit-modal {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    margin: 0; border: 0; border-radius: 0;
  }
  .micro-edit-body {
    max-height: calc(100dvh - 112px);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Links rows reuse the shared sortable grip/position styles. */
.link-row { display: flex; flex-direction: column; gap: 4px; overflow: hidden; max-width: 100%; min-width: 0; }
.link-row .link-body { flex: 1 1 0; min-width: 0; overflow: hidden; }
.link-row .link-title { display: flex; align-items: center; gap: 8px; width: 100%; }
.link-row .link-title .micro-grip { flex: none; cursor: grab; }
.link-row .link-side { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.link-row .link-side .cab-vis { overflow: hidden; }
.link-row .link-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.micro-dragging { opacity: 0.55; }
/* Drop indicator: sortable.js live-moves the dragged node, so its landing
   slot is wherever it currently sits — mark the insertion boundary on the
   next card (full opacity; the dragged item itself is dimmed), or below the
   item when it lands at the end of the list. */
.micro-dragging + .micro-block,
.micro-dragging + .link-row { box-shadow: 0 -3px 0 0 var(--c-acc-ink); }
.micro-dragging:last-of-type { box-shadow: 0 3px 0 0 var(--c-acc-ink); }
.micro-dragging .micro-grip { cursor: grabbing; background: rgba(238, 117, 20, 0.26); }
.micro-reordering .micro-block { transition: opacity 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
  .micro-reordering .micro-block { transition: none; }
}
@media (max-width: 560px) {
  #micro-modal { max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .micro-scroll { max-height: 100vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .micro-track { transition: none; }
}

/* ============================ CRM contacts ============================ */
/* Search + multi-select checkbox dropdowns; the date period and the sort
   select share one line. */
.crm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.crm-filters input[type="search"] {
  flex: 1 1 100%; background: var(--c-pan); border: 1px solid var(--c-line);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; color: inherit; min-width: 0;
}
.crm-filters-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }

/* Checkbox dropdown ("Sources ▾" / "Statuses ▾"): none checked = no filter. */
.crm-filter-dd { position: relative; flex: 1 1 calc(49% - 4px); min-width: 0; }
.crm-filter-dd summary {
  list-style: none; cursor: pointer; background: var(--c-pan);
  border: 1px solid var(--c-line); border-radius: 8px; padding: 6px 10px;
  font-size: 14px; color: inherit; white-space: nowrap;
}
.crm-filter-dd summary::-webkit-details-marker { display: none; }
.crm-filter-dd summary::after { content: " ▾"; color: var(--c-dim); }
.crm-filter-dd[open] summary { border-color: var(--c-acc); }
.crm-dd-count { color: var(--c-acc-ink); }
.crm-filter-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 200px;
  max-height: 240px; overflow: auto; background: var(--c-pan);
  border: 1px solid var(--c-line); border-radius: 10px; padding: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.crm-filter-opt { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.crm-filter-opt:hover { background: var(--c-line); }
.crm-filter-opt input { accent-color: var(--c-acc); width: 16px; height: 16px; }

/* Date period + sort: one line, no wrap (inputs shrink on narrow screens). */
.crm-date-row { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 10px; align-items: center; width: 100%; }
.crm-date-row label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; white-space: nowrap; }
.crm-date-row input[type="date"] {
  position: relative; min-width: 0; flex: 1 1 auto;
  background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 8px;
  padding: 6px 8px; font-size: 14px; color: inherit;
}
.crm-date-row input[type="date"] { padding-left: 30px; }
.crm-date-row input[type="date"]::-webkit-calendar-picker-indicator,
[data-task-due-local]::-webkit-calendar-picker-indicator {
  position: absolute; left: 6px; width: 18px; height: 18px; cursor: pointer; opacity: 0.75;
}
.crm-date-row input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* Last filter line: the sort select shares the row with Apply/Reset. */
.crm-filter-actions { display: flex; gap: 8px; width: 100%; align-items: center; }
.crm-filter-actions select[name="crm_sort"] {
  flex: 1 1 auto; min-width: 0; max-width: 170px; background: var(--c-pan);
  border: 1px solid var(--c-line); border-radius: 8px;
  padding: 6px 8px; font-size: 14px; color: inherit;
}
.crm-filter-actions .cab-auth { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; }
.crm-filter-actions svg { width: 13px; height: 13px; flex: none; }
.crm-apply { background: var(--c-acc); border-color: var(--c-acc); color: #fff; }
.crm-apply:hover { color: #fff; filter: brightness(1.08); }
.crm-reset { border-color: var(--c-acc-ink); color: var(--c-txt); }
.crm-reset:hover { border-color: var(--c-acc); }

/* Found-count line shown while filters are active. */
.crm-found { margin: 2px 0 6px; font-size: 13px; color: var(--c-dim); }

/* Contact list card: tighter padding, scoped to the CRM panel only
   (global .cab-card/.cab-row also serve public pages and microlanding). */
.crm-contacts-card { padding: 6px; }
/* One collapsible disclosure per contact: the collapsed card shows the name
   line and the status/note line; the chevron reuses the cab-fold pattern. */
.crm-card { border-bottom: 1px solid var(--c-line); font-size: 14px; }
.crm-card summary .rt { font-size: 14px; }
.crm-card:last-of-type { border-bottom: 0; }
.crm-card > summary { padding: 11px 6px; align-items: flex-start; }
.crm-card > summary .rw { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.crm-card > summary .cab-copy-mini { flex: none; }
.crm-card-body { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 11px; }
.crm-row-pinned { background: rgba(238, 117, 20, 0.08); border-radius: 10px; }
.crm-pin-btn { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 0 2px; }
.crm-pin-btn.armed { color: var(--c-acc-ink); font-size: 13px; }

/* Status pill line with the inline owner-note preview (≤50 chars whole,
   longer ones truncate with an expand toggle handled by crm.js). */
.crm-status-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.crm-note-inline { display: inline-flex; gap: 6px; align-items: baseline; min-width: 0; }
.crm-note-inline .cab-mut { font-size: 14px; white-space: pre-line; }
.crm-note-toggle { background: none; border: 0; cursor: pointer; color: var(--c-acc-ink); font-size: 13px; padding: 0 2px; }

/* Expanded contact row internals. */
.crm-details { margin: 2px 0 4px; }
.crm-msg { border-top: 1px dashed var(--c-line); padding: 4px 0; }
.crm-msg:first-of-type { border-top: 0; }
.crm-msg-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--c-dim); }
.crm-tasks { margin-top: 8px; border-top: 1px dashed var(--c-line); padding-top: 6px; }
.crm-task-line { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.crm-task-main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.crm-history-details { margin: 2px 0 8px; }

/* Sources management block. */
.crm-sources { margin-top: 12px; margin-bottom: 14px; font-size: 15px; }
.crm-source-add { display: flex; gap: 8px; margin: 10px 0; }
.crm-source-add input[type="text"] {
  flex: 1; background: var(--c-pan); border: 1px solid var(--c-line);
  border-radius: 8px; padding: 8px 10px; font-size: 15px; color: inherit;
}
.crm-source-item { border-top: 1px dashed var(--c-line); }
.crm-source-item > summary {
  list-style: none; cursor: pointer; display: flex; gap: 8px;
  align-items: center; justify-content: space-between; padding: 8px 0;
}
.crm-source-item > summary::-webkit-details-marker { display: none; }
.crm-source-item > summary .rt { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.crm-source-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding: 2px 0 10px; }
.crm-source-count { font-size: 13px; }
.crm-source-hint { font-size: 14px; }
.crm-source-actions { display: flex; gap: 8px; align-items: center; }
.crm-source-rename { display: flex; gap: 6px; align-items: center; flex: 1 1 auto; }
.crm-source-rename input[type="text"] {
  background: var(--c-pan); border: 1px solid var(--c-line); border-radius: 8px;
  padding: 5px 8px; font-size: 14px; color: inherit; flex: 1; min-width: 0; width: auto;
}
.crm-source-save { font-size: 11px !important; padding: 3px 8px !important; }

/* The source select inside the action dialog. */
[data-crm-source-select] {
  width: 100%; background: var(--c-pan); border: 1px solid var(--c-line);
  border-radius: 8px; padding: 8px 10px; font-size: 14px; color: inherit;
}

/* Uniform CRM buttons: one height and one font size everywhere (text
   buttons 30px/11px, icon buttons 30x30) — Apply/Clear, Save, Delete,
   Cancel, menu items and the icon minis alike. */
[data-cab-panel="crm"] .cab-auth,
[data-crm-modal] .cab-auth {
  height: 30px; box-sizing: border-box; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
[data-cab-panel="crm"] .cab-copy-mini,
[data-crm-modal] .cab-copy-mini { width: 30px; height: 30px; }
[data-crm-modal] .cab-send { height: 30px; font-size: 11px; }
[data-cab-panel="crm"] .crm-menu-item { min-height: 30px; }

/* "⋯" action dialog menu. */
.crm-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.crm-menu-item {
  text-align: left; padding: 6px 12px; border-radius: 10px; font-size: 11px;
  border: 1px solid var(--c-line); background: var(--c-pan); color: inherit;
  cursor: pointer; text-decoration: none; display: block;
}
.crm-menu-item:hover:not([disabled]) { border-color: var(--c-acc); }
.crm-menu-item[disabled] { opacity: 0.55; cursor: not-allowed; }

