/* ==========================================================================
   AnySync v2 — the shared component kit (src/client/orbit-v2-kit.ts).
   Semantic tokens only. Tone colours come from [data-tone] → --tone/--tone-soft.
   ========================================================================== */

/* icon(name, size): beats the global 20px svg rule; component rules can still resize. */
.orbit-icon { width: var(--icon-size, 20px); height: var(--icon-size, 20px); }

[data-tone="green"] { --tone: var(--green); --tone-soft: var(--green-soft); }
/* Kit tokens: the ring around stacked avatars (the opaque card colour, so an
   overlap never shows through) and the top-edge highlight of glass. */
:root { --avatar-ring: #ffffff; --glass-hi: rgba(255, 255, 255, .9); }
:root[data-theme="dark"] { --avatar-ring: #0f2238; --glass-hi: rgba(255, 255, 255, .06); }
:root[data-theme="universe"] { --avatar-ring: #161c55; --glass-hi: rgba(170, 235, 255, .14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]):not([data-theme="universe"]) { --avatar-ring: #161c55; --glass-hi: rgba(170, 235, 255, .14); }
}
/* Vivid tile gradients per tone, the same in every theme, like app icons. */
.v2-icon-tile, [data-tone] { --tile-a: #4fe6f7; --tile-b: #0a8fb0; }
[data-tone="violet"] { --tile-a: #ab88ff; --tile-b: #6236e8; }
[data-tone="coral"]  { --tile-a: #ff9c70; --tile-b: #e4472e; }
[data-tone="sky"]    { --tile-a: #6cb0ff; --tile-b: #2458e0; }
[data-tone="amber"]  { --tile-a: #ffd04f; --tile-b: #e08300; }
[data-tone="live"]   { --tile-a: #ff7d8c; --tile-b: #dd1f4a; }
[data-tone="green"]  { --tile-a: #52e28d; --tile-b: #12944a; }
[data-tone="pink"]   { --tile-a: #ff7fc2; --tile-b: #d72a82; }
[data-tone="pink"]  { --tone: var(--pink);  --tone-soft: var(--pink-soft); }
/* Tone text that stays readable on its soft background in every theme. */
[data-tone] { --tone-ink: color-mix(in srgb, var(--tone) 72%, var(--foreground)); }

/* -------------------------------------------------------------- page --- */

.v2-screen { padding-top: 2px; }
.v2-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
}
.v2-page-head.is-title-hidden .v2-page-titles {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.v2-page-head.is-title-hidden { margin: 0; }
.v2-page-titles { min-width: 0; flex: 1; }
.v2-title {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: var(--foreground);
}
.v2-subtitle { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.v2-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.v2-body { display: flex; flex-direction: column; gap: 20px; }

/* ----------------------------------------------------------- sections --- */

.v2-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v2-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}
.v2-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.2;
  color: var(--foreground);
}
h3.v2-section-title { font-size: 1.0625rem; letter-spacing: -.01em; }
@media (max-width: 599px) { .v2-section-title { font-size: 1.125rem; } }
.v2-section-title > svg { color: var(--primary); }
.v2-section-tools { display: flex; align-items: center; gap: 8px; }
/* The ringed dot of the Dark mockups, kept in every theme so titles never shift. */
.v2-dot {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: inset 0 0 0 3px var(--surface-glass-strong), inset 0 0 0 8px var(--primary), 0 0 calc(10px * var(--glow-scale, 1)) var(--glow);
}
.v2-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.v2-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.v2-link:focus-visible { outline: none; box-shadow: var(--ring); }

/* --------------------------------------------------------------- cards --- */

.v2-card {
  position: relative;
  display: block;
  min-width: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--surface-glass);
  color: var(--foreground);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow), var(--card-glow);
  text-align: left;
  font: inherit;
}
.v2-card.is-strong { background: var(--surface-glass-strong); }
.v2-card.pad-none { padding: 0; overflow: hidden; }
.v2-card.pad-sm { padding: 12px; }
.v2-card.pad-md { padding: 16px; }
.v2-card.pad-lg { padding: 22px; }
.v2-card[data-tone] { border-color: color-mix(in srgb, var(--tone) 38%, var(--glass-border)); }
.v2-card.is-interactive { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s; width: 100%; }
.v2-card.is-interactive:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--glass-border)); box-shadow: var(--shadow), 0 0 calc(18px * var(--glow-scale, 1)) var(--glow); }
.v2-card.is-interactive:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-card.is-interactive:active { transform: scale(.99); }
@media (min-width: 600px) {
  .v2-card.pad-md { padding: 18px; }
  .v2-card.pad-lg { padding: 26px; }
}

/* ------------------------------------------------------------- buttons --- */

.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.v2-btn svg { width: 18px; height: 18px; flex: none; }
.v2-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-btn:active { transform: scale(.98); }
.v2-btn[disabled] { opacity: .55; cursor: not-allowed; }
.v2-btn.size-sm { min-height: 40px; padding: 0 14px; font-size: .875rem; }
.v2-btn.size-lg { min-height: 52px; padding: 0 24px; font-size: 1.0625rem; }
.v2-btn.is-block { width: 100%; }
.v2-btn.is-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 18px -6px var(--glow), 0 0 calc(22px * var(--glow-scale, 1)) var(--glow);
}
.v2-btn.is-primary:hover { background: var(--primary-strong); }
.v2-btn.is-outline { background: color-mix(in srgb, var(--primary) 6%, transparent); border-color: color-mix(in srgb, var(--primary) 70%, transparent); color: var(--primary); }
.v2-btn.is-outline:hover { background: var(--primary-soft); }
.v2-btn.is-soft { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.v2-btn.is-ghost { background: transparent; color: var(--foreground); }
.v2-btn.is-ghost:hover { background: color-mix(in srgb, var(--foreground) 8%, transparent); }
.v2-btn.is-glass { background: var(--surface-glass); color: var(--foreground); border-color: var(--glass-border); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.v2-btn.is-glass:hover { border-color: var(--primary); }
.v2-btn.is-danger { background: var(--live-solid); color: var(--on-live); }
.v2-btn.is-danger:hover { filter: brightness(1.08); }
.v2-btn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.v2-btn[data-tone].is-soft { background: var(--tone-soft); color: var(--tone-ink); border-color: color-mix(in srgb, var(--tone) 30%, transparent); }

.v2-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--surface-glass);
  color: var(--foreground);
  cursor: pointer;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  transition: border-color .15s, background .15s, transform .1s;
}
.v2-icon-btn:hover { border-color: color-mix(in srgb, var(--primary) 60%, var(--glass-border)); }
.v2-icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-icon-btn:active { transform: scale(.95); }
.v2-icon-btn.size-sm { width: 40px; height: 40px; }
.v2-icon-btn.size-lg { width: 56px; height: 56px; }
.v2-icon-btn.size-xl { width: 72px; height: 72px; }
.v2-icon-btn.is-plain { background: none; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.v2-icon-btn.is-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 calc(16px * var(--glow-scale, 1)) var(--glow); }
.v2-icon-btn.is-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.v2-icon-btn[data-tone].is-soft { background: var(--tone-soft); color: var(--tone-ink); }
.v2-icon-btn.is-danger { background: var(--live-solid); border-color: var(--live-solid); color: var(--on-live); }
.v2-icon-btn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* --------------------------------------------------------------- chips --- */

.v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--surface-glass);
  color: var(--foreground);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}
span.v2-chip { cursor: default; }
.v2-chip svg { width: 16px; height: 16px; }
.v2-chip:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--glass-border)); }
.v2-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.v2-chip[data-tone]:not(.is-active) { background: var(--tone-soft); color: var(--tone-ink); border-color: color-mix(in srgb, var(--tone) 28%, transparent); }
.v2-chip-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: .75rem;
  text-align: center;
}
.v2-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 599px) {
  .v2-chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--v2-gutter));
    padding: 2px var(--v2-gutter);
    scroll-padding: var(--v2-gutter);
  }
  .v2-chip-group::-webkit-scrollbar { display: none; }
}

/* ------------------------------------------------------- segmented ------ */

.v2-seg {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.v2-seg.is-block { display: flex; width: 100%; }
.v2-seg.is-block .v2-seg-item { flex: 1; }
.v2-seg-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .9375rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}
.v2-seg.size-sm .v2-seg-item { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.v2-seg-item svg { width: 16px; height: 16px; }
.v2-seg-item:hover { color: var(--foreground); }
.v2-seg-item:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-seg-item.is-active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 0 calc(12px * var(--glow-scale, 1)) var(--glow);
}
.v2-seg.is-underline { padding: 0; gap: 18px; border: 0; border-bottom: 1px solid var(--glass-border); border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.v2-seg.is-underline .v2-seg-item { border-radius: 0; padding: 0 2px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.v2-seg.is-underline .v2-seg-item.is-active { background: none; color: var(--primary); border-bottom-color: var(--primary); box-shadow: none; }

/* --------------------------------------------------------------- switch -- */

.v2-switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  cursor: pointer;
  transition: background .18s;
}
.v2-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: transform .18s;
}
.v2-switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 calc(10px * var(--glow-scale, 1)) var(--glow); }
.v2-switch[aria-checked="true"] .v2-switch-knob { transform: translateX(22px); background: var(--on-primary); }
:root[data-theme="light"] .v2-switch[aria-checked="true"] .v2-switch-knob { background: var(--surface); }
.v2-switch:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) {
  .v2-switch, .v2-switch-knob { transition: none; }
}

/* ----------------------------------------------------------------- rows -- */

.v2-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  color: var(--foreground);
}
.v2-row.is-interactive:hover { background: color-mix(in srgb, var(--foreground) 5%, transparent); }
.v2-row-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}
.v2-row-hit:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-row > :not(.v2-row-hit) { position: relative; z-index: 1; }
.v2-row > .v2-row-text { pointer-events: none; }
.v2-row-text { flex: 1; min-width: 0; }
.v2-row-title { font-weight: 550; font-size: .9375rem; line-height: 1.3; overflow-wrap: anywhere; }
.v2-row-sub { color: var(--muted); font-size: .875rem; line-height: 1.35; margin-top: 2px; }
.v2-row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.v2-row-chevron { color: var(--muted); display: inline-grid; place-items: center; }
.v2-row-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.v2-row-icon[data-tone] { background: var(--tone-soft); color: var(--tone-ink); }
.v2-toggle-row { padding-left: 4px; padding-right: 4px; }
.v2-list { display: flex; flex-direction: column; }
.v2-list > .v2-row + .v2-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ---------------------------------------------------------------- bits --- */

.v2-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tone-soft, var(--primary-soft));
  color: var(--tone-ink, var(--primary));
  border: 1px solid color-mix(in srgb, var(--tone, var(--primary)) 28%, transparent);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.v2-tag svg { width: 14px; height: 14px; }

.v2-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px 2px 8px;
  border-radius: 8px;
  background: var(--live-solid);
  color: var(--on-live);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 14px -4px color-mix(in srgb, var(--live-solid) 70%, transparent);
  white-space: nowrap;
}
.v2-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
  animation: v2-blink 1.6s ease-in-out infinite;
}
.app-header-live .v2-live-dot { color: var(--live); }
@keyframes v2-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .v2-live-dot { animation: none; } }

.v2-stat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v2-stat > svg { flex: none; color: var(--tone, var(--primary)); }
.v2-stat-value { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.v2-stat-label { font-size: .8125rem; color: var(--muted); white-space: nowrap; }

.v2-progress {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 14%, transparent);
  overflow: hidden;
}
.v2-progress.is-thin { height: 5px; }
.v2-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, var(--primary)) 70%, transparent), var(--tone, var(--primary)));
  box-shadow: 0 0 calc(10px * var(--glow-scale, 1)) var(--glow);
}

/* A vivid squircle: tone gradient, a soft top-left sheen, an inner rim of
   light and a coloured glow: the app-icon look of the mockups. */
.v2-icon-tile {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(120% 85% at 22% 0%, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 58%),
    linear-gradient(150deg, var(--tile-a), var(--tile-b));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -3px 8px rgba(0, 0, 0, .14),
    0 6px 16px -6px color-mix(in srgb, var(--tile-b) 80%, transparent),
    0 0 calc(20px * var(--glow-scale, 1)) color-mix(in srgb, var(--tile-a) 28%, transparent);
}
.v2-icon-tile > svg { stroke-width: 2.15; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.v2-icon-tile.size-sm { width: 32px; height: 32px; border-radius: 10px; }
.v2-icon-tile.size-lg { width: 56px; height: 56px; border-radius: 18px; }
.v2-icon-tile.size-xl { width: 72px; height: 72px; border-radius: 23px; }

.v2-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.3;
  min-width: 0;
}
.v2-meta svg { flex: none; width: 15px; height: 15px; }

.v2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
}
.v2-empty-title { font-weight: 600; font-size: 1.0625rem; }
.v2-empty-body { margin: 0; color: var(--muted); max-width: 36ch; }

/* --------------------------------------------------- rails and grids ---- */

.v2-grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.v2-rail { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 899px) {
  .v2-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .v2-grid { gap: 10px; }
  .v2-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--v2-gutter));
    padding: 2px var(--v2-gutter) 6px;
    scroll-padding: var(--v2-gutter);
  }
  .v2-rail::-webkit-scrollbar { display: none; }
  .v2-rail > * { flex: 0 0 min(78%, 300px); scroll-snap-align: start; }
}

/* ------------------------------------------------------------- art ----- */

.v2-art { position: relative; overflow: hidden; background: var(--avatar-base); }
/* Scenes paint with their own fills; never inherit the icon sprite's stroke. */
.v2-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; stroke: none; fill: none; stroke-width: 1; }

/* ---------------------------------------------------------- avatars ---- */

.v2-avatar {
  --size: 40px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--avatar-base);
  color: var(--avatar-ink);
  user-select: none;
}
/* The illustrated face (orbit-scenes.ts faceSvg), clipped to the circle. */
.v2-avatar > svg { display: block; width: 100%; height: 100%; border-radius: 50%; stroke: none; fill: none; }
.v2-avatar.has-ring { box-shadow: 0 0 0 2px var(--surface-glass-strong), 0 0 0 4px var(--primary); }
.v2-avatar-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: max(10px, calc(var(--size) * .26));
  height: max(10px, calc(var(--size) * .26));
  border-radius: 50%;
  background: var(--callable);
  box-shadow: 0 0 0 2px var(--surface-glass-strong);
}
.v2-avatar-stack { display: inline-flex; align-items: center; }
.v2-avatar-stack > * { box-shadow: 0 0 0 2px var(--avatar-ring); }
.v2-avatar-stack > * + * { margin-left: calc(var(--size, 28px) * -.28); }
.v2-avatar-more {
  --size: 28px;
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: var(--size);
  height: var(--size);
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 12%, var(--avatar-ring));
  color: var(--foreground);
  font-size: max(.6875rem, calc(var(--size) * .36));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* -------------------------------------------------------- overlays ----- */

.v2-popover {
  position: fixed;
  z-index: 70;
  width: min(var(--w, 400px), calc(100vw - 24px));
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--surface-glass-strong);
  color: var(--foreground);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 8px)) saturate(150%);
  backdrop-filter: blur(calc(var(--blur) + 8px)) saturate(150%);
  box-shadow: var(--shadow-lg);
  animation: v2-pop .16s ease-out;
}
.v2-popover:focus { outline: none; }
@keyframes v2-pop { from { opacity: 0; transform: translateY(-6px); } }

.v2-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.v2-sheet {
  width: min(520px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass-strong);
  color: var(--foreground);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 10px));
  backdrop-filter: blur(calc(var(--blur) + 10px));
  box-shadow: var(--shadow-lg);
  animation: v2-pop .18s ease-out;
}
.v2-sheet.is-wide { width: min(760px, 100%); }
.v2-sheet:focus { outline: none; }
.v2-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 22px; }
.v2-sheet-title { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; }
.v2-sheet-body { padding: 8px 22px 18px; overflow: auto; }
.v2-sheet-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 20px; border-top: 1px solid var(--glass-border); }
@media (max-width: 599px) {
  .v2-scrim { place-items: end stretch; padding: 0; }
  .v2-sheet, .v2-sheet.is-wide { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); max-height: 92vh; }
  .v2-sheet-actions > * { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .v2-popover, .v2-sheet { animation: none; }
}

/* ------------------------------------------------------ permission ----- */

.v2-permission { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.v2-permission-title { font-size: 1.125rem; font-weight: 650; }
.v2-permission-body { margin: 0; color: var(--muted); max-width: 40ch; }
.v2-permission-note { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: .8125rem; }
.v2-permission-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }

/* ----------------------------------------------------------- utility ---- */

.v2-muted { color: var(--muted); }
.v2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v2-hstack { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v2-vstack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v2-spacer { flex: 1; }
