/* Drop v4 — „kapky ve tmavé vodě“. Jen tmavý režim. Viz docs/DESIGN.md. */

/* Geist (Vercel, SIL OFL 1.1 — fonts/OFL.txt), variabilní 100–900, hostovaný u nás: latin + latin-ext (čeština). */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --canvas: #0a0b0e;
  --surface-solid: #15171c;
  --raised: #1d2027;
  --text: #f3f1ec;
  --text-muted: #a3a6ad;
  --text-faint: #7f838b;
  --line: rgb(255 255 255 / .12);
  --ink: #f3f1ec;
  --on-ink: #0a0b0e;
  --danger: #ff6b5e;
  --on-danger: #0a0b0e;
  --ok: #4fd18b;
  --focus: #8ab4ff;

  /* v4.6 „Klid“: plochy se liší světlostí + vlasovou linkou, ne září */
  --surface-1: #121418;                      /* panely (chat, dialogy) — plné */
  --surface-2: #1a1d23;                      /* karty, menu */
  --surface-3: #23262e;                      /* zvednuté ovládací prvky, toast */
  --hair: rgb(255 255 255 / .08);
  --hair-strong: rgb(255 255 255 / .16);
  --chrome: rgb(18 20 24 / .72);             /* plovoucí prvky nad hladinou (+ blur 16px) */
  --chrome-hover: rgb(34 37 45 / .78);       /* o stupeň světlejší (hover) */
  --chrome-press: rgb(44 48 57 / .82);       /* stisk */
  --shadow-float: 0 1px 2px rgb(0 0 0 / .35), 0 8px 24px rgb(0 0 0 / .28);

  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sheet: 28px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --dur-feedback: 120ms;
  --dur-state: 180ms;
  --dur-spatial: 260ms;
  --ease-response: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --font-ui: "Geist", "Segoe UI Variable Text", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Geist", "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Patková kurzíva zrušena (uživatel ji nechce) — token zůstává jen kvůli starým odkazům. */
  --font-serif: var(--font-ui);

  --orb-lg: 112px;
  --orb-md: 76px;
  --orb-sm: 36px;
  --orb-xs: 22px;

  --shift: 0px;
  --inset: 0px;
}

@media (max-width: 600px) {
  :root { --orb-lg: 96px; --orb-md: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  background: var(--canvas);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
  color: var(--text);
  font: 400 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }

/* nativní pocit na dotyku (DESIGN v4.2): bez zpoždění dvojklepu, bez označování ovládacích prvků */
button, a, [role="button"], [role="tab"], [role="radio"], label, summary { touch-action: manipulation; }
button, [role="button"], [role="tab"], [role="radio"], .orb, .peer-label, .me-caption, .brand, .status, .seg, .switch-row,
.hint, .badge, .wordmark, .toast, .dlg-head, .dlg-grab {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
input, textarea, .code-big { -webkit-user-select: text; user-select: text; }
.peer-btn, .peer-btn * { -webkit-touch-callout: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

[hidden] { display: none !important; }

.icon { width: 22px; height: 22px; flex: none; display: block; }
.icon-sm { width: 16px; height: 16px; }

/* Skrytá stránka: zastavit i CSS animace (JS dělá totéž s canvasem). */
html.is-hidden *, html.is-hidden *::before, html.is-hidden *::after { animation-play-state: paused !important; }

/* ================================================================== vrstvy */

.water { position: fixed; inset: 0; z-index: 0; display: block; background: var(--canvas); }

.bridges {
  position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%;
  pointer-events: none; translate: var(--shift) 0;
}
.bridge-body { opacity: 1; }
.bridge-line {
  fill: none; stroke: rgb(255 255 255 / .55); stroke-width: 1; stroke-linecap: round;
  stroke-dasharray: 1.5 8; animation: bridge-flow 1.6s linear infinite;
}
@keyframes bridge-flow { to { stroke-dashoffset: -9.5; } }
.drop { fill: rgb(255 255 255 / .16); stroke: rgb(255 255 255 / .9); stroke-width: 1.4; }
.drop-hl { fill: #fff; opacity: .9; }
/* tekuté animace příchodu/odchodu: goo vrstva (sliz) + vystřelené kapičky */
.goo { pointer-events: none; opacity: .88; }
.fx-drop { pointer-events: none; stroke: rgb(255 255 255 / .38); stroke-width: 1; }

.stage {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; translate: var(--shift) 0;
  --lw: 140px;
}

/* ================================================================== sklo */

.glass {
  position: relative;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-float);
}
/* refrakce na hraně (Chromium, jen malé prvky; filtr dodá glass.js) */
.glass--refract {
  -webkit-backdrop-filter: var(--glass-filter) blur(1.5px);
  backdrop-filter: var(--glass-filter) blur(1.5px);
}
html.no-backdrop .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-2); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass--refract { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-2); }
}

/* ================================================================== koule */

.orb {
  --s: var(--orb-md);
  --c-hi: oklch(calc(var(--l) + .08) calc(var(--c) * .9) var(--h));
  --c-mid: oklch(var(--l) var(--c) var(--h));
  --c-lo: oklch(calc(var(--l) - .14) calc(var(--c) * 1.05) var(--h));
  --c-liquid: oklch(calc(var(--l) + .2) calc(var(--c) * .8) var(--h) / .88);
  position: relative; display: inline-block; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  transition: transform var(--dur-spatial) var(--ease-response), filter .5s;
}
.orb--lg { --s: var(--orb-lg); }
.orb--md { --s: var(--peer-s, var(--orb-md)); }
.orb--sm { --s: var(--orb-sm); }
.orb--xs { --s: var(--orb-xs); }

.orb-body {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  /* tělo osvětlené shora, bez barevné záře: jen neutrální kontaktní stín */
  background: linear-gradient(180deg, var(--c-hi), var(--c-mid) 52%, var(--c-lo));
  box-shadow: 0 calc(var(--s) * .08) calc(var(--s) * .2) rgb(0 0 0 / .45);
  isolation: isolate;
}
.orb--sm .orb-body, .orb--xs .orb-body { box-shadow: 0 2px 6px rgb(0 0 0 / .45); }

.orb-shine {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), inset 0 -6px 12px rgb(0 0 0 / .18);
}
/* malý ostrý odlesk nahoře (kapka, ne svítící koule) */
.orb-shine::before {
  content: ""; position: absolute; left: 22%; top: 9%; width: 34%; height: 20%; border-radius: 50%;
  background: radial-gradient(ellipse at 40% 40%, rgb(255 255 255 / .7), rgb(255 255 255 / 0) 100%);
  transform: rotate(-26deg); opacity: .6; transition: opacity var(--dur-state);
}

.orb-icon {
  position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; translate: -50% -50%;
  color: #fff; z-index: 2; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .3));
}
.orb[data-ink="dark"] .orb-icon { color: #111; filter: none; }
.orb--xs .orb-icon { display: none; }
.orb--sm .orb-icon { width: 44%; height: 44%; }
.orb.is-done .orb-icon { stroke-width: 2.4; }

.orb-fill {
  position: absolute; inset: 0; opacity: 0; background: var(--c-liquid);
  transform: translateY(calc((1 - var(--fill, 0)) * 100%));
  transition: transform .5s var(--ease-response), opacity .3s;
}
.orb-fill.is-on { opacity: 1; }
.orb--xs .orb-fill { display: none; }
.orb-wave { position: absolute; left: 0; top: -9px; width: 200%; height: 10px; animation: orb-wave 2.6s linear infinite; }
.orb-wave-fill { fill: var(--c-liquid); }
.orb-wave-line { fill: none; stroke: rgb(255 255 255 / .8); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@keyframes orb-wave { to { transform: translateX(-50%); } }

.orb.is-muted { filter: saturate(.12) brightness(.65); }

/* ================================================================== moje kapka + hledání */

.me {
  position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform;
}
.me-bob {
  position: absolute; left: calc(var(--orb-lg) / -2); top: calc(var(--orb-lg) / -2); width: var(--orb-lg);
  animation: me-bob 7s ease-in-out infinite;
}
.me-bob .orb { display: block; }
/* obal pro želé: vlastní transform, neprát se s pohupováním (.me-bob/.peer-bob), stiskem ani hoverem (.orb) */
.jelly { display: block; transform-origin: 50% 50%; }
/* během příchodu je moje kapka nad novou, ta z ní vylézá zpod */
.me.is-over { z-index: 1; }
@keyframes me-bob { 0%, 100% { transform: translateY(-2px) scale(1); } 50% { transform: translateY(3px) scale(1.012); } }
.me-caption {
  position: absolute; top: 100%; left: 50%; translate: -50% 0; margin-top: 12px;
  white-space: nowrap;
  font: 600 15px/1 var(--font-display); letter-spacing: .01em; color: var(--text-muted);
}

.hint {
  position: absolute; left: 0; top: 0; width: min(86vw, 360px); margin-left: calc(min(86vw, 360px) / -2);
  margin-top: var(--hint-top, 108px); will-change: transform;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
}
.hint.is-on { opacity: 1; visibility: visible; transition: opacity .5s .3s, visibility 0s .3s; }
.hint-title { font: 650 20px/1.3 var(--font-display); letter-spacing: -.015em; color: var(--text); text-wrap: balance; }
.hint-sub { font-size: 13px; line-height: 1.4; color: var(--text-muted); text-wrap: balance; }
.hint-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.hint-btn { pointer-events: auto; }

.btn-glass {
  position: relative; min-height: 44px; padding: 0 22px; border: 0; border-radius: var(--radius-pill);
  color: var(--text); font: 600 15px var(--font-ui); cursor: pointer;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-float);
  transition: transform var(--dur-feedback) var(--ease-response), background var(--dur-state);
}
.btn-glass:active { transform: scale(.96); background: var(--chrome-press); }
@media (hover: hover) and (pointer: fine) { .btn-glass:hover { background: var(--chrome-hover); } }
html.no-backdrop .btn-glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-2); }

/* ================================================================== zařízení kolem */

.peer {
  --s: var(--peer-s, var(--orb-md));
  position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform;
}
.peer--compact { --peer-s: 52px; }
.peer-bob {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  animation: peer-bob var(--bob-d, 6s) ease-in-out var(--bob-delay, 0s) infinite;
}
@keyframes peer-bob { 0%, 100% { transform: translateY(-3px) scale(1); } 50% { transform: translateY(3px) scale(1.015); } }

.peer-btn {
  position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s);
  margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit;
  cursor: pointer; pointer-events: auto; touch-action: manipulation;
}
.peer-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.peer-btn .orb { display: block; transition: transform var(--dur-spatial) var(--ease-response); }
@media (hover: hover) and (pointer: fine) {
  .peer-btn:hover .orb { transform: translateY(-3px) scale(1.04); }
  .peer-btn:hover .orb-shine::before { opacity: .8; }
}
.peer-btn:active .orb { transform: scale(.94); transition-duration: var(--dur-feedback); }
/* dlouhé podržení (stage.js): koule se zaboří a zesvětlí, až dozní 450 ms, drobně cukne */
.peer-btn.is-holding .orb { transform: scale(.9); filter: brightness(1.12); transition: transform 450ms cubic-bezier(.3, .7, .3, 1), filter 450ms ease-out; }
.peer-btn.is-armed .orb { transform: scale(.86); filter: brightness(1.25); transition-duration: 120ms; }
.peer-btn.is-armed::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgb(255 255 255 / .8); animation: arm-ring 380ms var(--ease-response) both;
}
@keyframes arm-ring { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }

/* tažení souborů / textu nad oknem: kuličky povyrostou, cíl má plný bílý kroužek (v4.6: bez záře) */
html.is-dragging .peer-btn .orb { transform: scale(1.12); }
html.is-dragging .peer-btn.is-drop .orb { transform: scale(1.24); }
html.is-dragging .peer-btn::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgb(255 255 255 / .28); animation: drop-pulse 1.6s ease-out infinite;
}
@keyframes drop-pulse { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

.drop-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; visibility: hidden;
  background: radial-gradient(ellipse at 50% 46%, rgb(4 5 7 / .18), rgb(4 5 7 / .5) 75%);
  transition: opacity var(--dur-spatial) var(--ease-response), visibility 0s var(--dur-spatial);
}
.drop-veil.is-on { opacity: 1; visibility: visible; transition: opacity var(--dur-spatial) var(--ease-response); }
.drop-hint {
  position: fixed; z-index: 11; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 72px); translate: -50% 0;
  max-width: min(92vw, 520px); display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-radius: var(--radius-pill); font: 600 15px/1.3 var(--font-ui); color: var(--text); pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96);
  transition: opacity var(--dur-state), transform var(--dur-spatial) var(--ease-response), visibility 0s var(--dur-state);
}
.drop-hint.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur-state), transform var(--dur-spatial) var(--ease-response); }
@media (min-width: 700px) { .drop-hint { top: calc(env(safe-area-inset-top, 0px) + 10px); height: 40px; padding: 0 20px; } } /* v řadě s horní lištou, ať nekryje kuličky */
.drop-hint > * { position: relative; }
.drop-hint .icon { width: 18px; height: 18px; flex: none; }
.drop-hint.is-empty .icon { opacity: .5; }
.drop-hint-text { min-width: 0; text-wrap: balance; }
@media (prefers-reduced-motion: reduce) {
  .drop-veil, .drop-veil.is-on, .drop-hint, .drop-hint.is-on { transition: opacity .01s; transform: none; }
  html.is-dragging .peer-btn::before { animation: none; opacity: .5; }
}
html.lite .drop-veil { background: rgb(4 5 7 / .45); }
html.lite.is-dragging .peer-btn::before { animation: none; opacity: .5; }

/* výběr zařízení (send-picker.js): navazuje na .dlg */
dialog.dlg--pick { width: min(400px, calc(100vw - 32px)); }
@media (max-width: 600px) { dialog.dlg--pick { width: 100%; } }
.dlg--pick .dlg-body { gap: 12px; padding-bottom: 14px; }
.dlg--pick .dlg-head h2 { font-size: 20px; }
.dlg--pick .dlg-lead { margin-top: -6px; overflow-wrap: anywhere; }
.pick-list { display: flex; flex-direction: column; gap: 4px; margin: 0 -8px; padding: 0; list-style: none; }
.pick-item {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 0; border-radius: 18px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
  transition: background var(--dur-feedback), transform var(--dur-feedback) var(--ease-response);
}
.pick-item .orb { flex: none; }
.pick-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pick-name { font: 600 16px/1.25 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-dev { font-size: 13px; line-height: 1.3; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; background: rgb(255 255 255 / .08); }
.pick-item:active { transform: scale(.98); background: rgb(255 255 255 / .12); }
@media (hover: hover) and (pointer: fine) { .pick-item:hover { background: rgb(255 255 255 / .08); } }
.peer-btn.is-drop::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .9); pointer-events: none;
}

.peer-label, .badge, .pair-mark { transition: opacity .2s ease-out; }
.peer.is-joining .peer-label, .peer.is-joining .badge, .peer.is-joining .pair-mark { opacity: 0; }
.peer.is-leaving .peer-label, .peer.is-leaving .badge, .peer.is-leaving .pair-mark { opacity: 0; transition-duration: .12s; }
.peer.is-leaving .peer-btn { pointer-events: none; }
.peer-label {
  position: absolute; top: calc(100% + 9px); left: 50%; translate: -50% 0; width: var(--lw, 140px);
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; pointer-events: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / .7);
}
.peer-name {
  font: 600 14px/1.2 var(--font-ui); color: var(--text); max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.peer-device { font: 400 12px/1.3 var(--font-ui); color: var(--text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-status { font: 400 12px/1.3 var(--font-ui); color: var(--text-muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.peer[data-busy="send"] .peer-status, .peer[data-busy="receive"] .peer-status { color: var(--text); }
.peer--compact .peer-name { font-size: 12px; -webkit-line-clamp: 1; line-clamp: 1; }
.peer--compact .peer-device, .peer--compact .peer-status { display: none; }
@media (max-width: 600px) {
  .peer-name { font-size: 13px; }
  .me-caption { font-size: 17px; }
}

.badge {
  position: absolute; top: -5px; right: -5px; z-index: 3; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--ink); color: var(--on-ink);
  font: 700 12px/22px var(--font-ui); text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgb(0 0 0 / .5);
}
.badge[hidden], .pair-mark[hidden] { display: none; }
.pair-mark {
  position: absolute; bottom: -3px; right: -3px; z-index: 3; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  background: var(--surface-3); box-shadow: 0 0 0 1px var(--hair-strong), 0 1px 3px rgb(0 0 0 / .5);
}
.pair-mark .icon { width: 12px; height: 12px; }

.peer-bubble {
  position: absolute; left: calc(var(--s) / 2 + 12px); top: 0; translate: 0 -50%; z-index: 4;
  display: flex; align-items: center; gap: 0;
  width: max-content; max-width: min(260px, 72vw); padding: 3px; border-radius: 20px; pointer-events: auto;
}
.peer-bubble[data-side="left"] { left: auto; right: calc(var(--s) / 2 + 12px); flex-direction: row-reverse; }
.peer-bubble[data-side="above"] { left: 0; top: auto; bottom: calc(var(--s) / 2 + 12px); translate: -50% 0; }
.peer-bubble > * { position: relative; }
.peer-bubble-text:active { background: rgb(255 255 255 / .1); }
.peer-bubble-copy:active { background: rgb(255 255 255 / .16); transform: scale(.94); }
.peer-bubble-text {
  flex: 1; min-width: 0; margin: 0; padding: 7px 6px 7px 13px; border: 0; border-radius: 17px; background: none;
  color: var(--text); font: 400 14px/1.35 var(--font-ui); text-align: left; cursor: pointer; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.peer-bubble[data-side="left"] .peer-bubble-text { padding: 7px 13px 7px 6px; }
.peer-bubble-copy {
  flex: none; width: 34px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
}
.peer-bubble-copy .icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .peer-bubble-text:hover { background: rgb(255 255 255 / .06); }
  .peer-bubble-copy:hover { background: rgb(255 255 255 / .1); color: var(--text); }
}
@media (hover: none) { .peer-bubble-copy { width: 44px; height: 44px; } }

/* ================================================================== lišty */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; pointer-events: none;
  height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) calc(16px + var(--inset) + env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-radius: 12px; }
.logo { width: 28px; height: 28px; display: block; }
.wordmark { font: 700 22px/1 var(--font-display); letter-spacing: -.02em; }

.status {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
  font: 600 14px/1 var(--font-ui); color: var(--text); white-space: nowrap;
}
.status > :not(.status-hit) { position: relative; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.status[data-state="searching"] .status-dot, .status[data-state="online"] .status-dot { background: var(--ok); animation: dot-pulse 2.4s ease-out infinite; }
.status[data-state="connecting"] .status-dot { animation: dot-blink 1.2s ease-in-out infinite; }
.status[data-state="offline"] .status-dot { background: var(--danger); }
@keyframes dot-pulse { 0% { box-shadow: 0 0 0 0 rgb(79 209 139 / .55); } 70%, 100% { box-shadow: 0 0 0 8px rgb(79 209 139 / 0); } }
@keyframes dot-blink { 50% { opacity: .3; } }
.status-ring { width: 18px; height: 18px; display: none; flex: none; }
.status[data-state="transfer"] .status-ring { display: block; }
.status[data-state="transfer"] .status-dot { display: none; }
.status-ring circle { fill: none; stroke-width: 2.2; }
.status-ring-bg { stroke: rgb(255 255 255 / .22); }
.status-ring-fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.status-hit {
  position: absolute; inset: 0; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; z-index: 2;
}
.status-hit[hidden] { display: none; }
.status-hit:active { background: rgb(255 255 255 / .12); }
.brand:active { opacity: .7; transition: opacity var(--dur-feedback); }
@media (hover: hover) and (pointer: fine) { .status-hit:hover { background: rgb(255 255 255 / .08); } }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; pointer-events: none;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(100% - var(--inset), 540px); margin: 0 auto; translate: var(--shift) 0;
}
.bottombar > * { pointer-events: auto; }

.round {
  width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%; padding: 0; color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  transition: transform var(--dur-feedback) var(--ease-response);
}
.round--sm { width: 44px; height: 44px; }
.round:active, .name-pill:active { transform: scale(.94); background: var(--chrome-press); }
@media (hover: hover) and (pointer: fine) { .round:hover, .name-pill:hover { background: var(--chrome-hover); } }
.round > *, .name-pill > * { position: relative; }
.name-pill {
  height: 52px; min-width: 0; max-width: min(64vw, 320px); padding: 0 18px 0 15px; border: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 15px/1 var(--font-ui); cursor: pointer;
  transition: transform var(--dur-feedback) var(--ease-response);
}
.name-orb { display: grid; flex: none; }
.name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-pill .icon { color: var(--text-muted); }
@media (max-width: 419px) { .name-pill { padding: 0 16px 0 13px; gap: 8px; } .name-pill .icon { display: none; } }

/* toasty (popover = top-layer, vidět i nad dialogy) */
.toasts {
  position: fixed; inset: auto; top: calc(env(safe-area-inset-top) + 64px); left: calc(50% + var(--shift)); translate: -50% 0;
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; width: min(92vw, 480px); height: auto;
  pointer-events: none; color: var(--text);
}
.toasts:popover-open { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 16px;
  border-radius: var(--radius-pill); font: 500 14px/1.3 var(--font-ui); color: var(--text);
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--hair), var(--shadow-float);
}
.toast-icon { width: 18px; height: 18px; }
.toast--ok .toast-icon { color: var(--ok); }
.toast--error .toast-icon { color: var(--danger); }
.toast-text { min-width: 0; overflow-wrap: anywhere; }
.toast-action {
  margin-left: 4px; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: rgb(255 255 255 / .16); color: var(--text); font: 600 13px var(--font-ui);
}
.toast > * { position: relative; }
.toast-action { transition: transform var(--dur-feedback) var(--ease-response), background var(--dur-feedback); }
.toast-action:active { transform: scale(.95); background: rgb(255 255 255 / .26); }

/* ================================================================== tlačítka a pole */

.btn {
  height: 48px; padding: 0 24px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  font: 600 15px/1 var(--font-ui); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform var(--dur-feedback) var(--ease-response), opacity var(--dur-state), background var(--dur-state);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-ink:active:not(:disabled) { background: #fff; }
.btn-ghost:active:not(:disabled) { background: rgb(255 255 255 / .1); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) { .btn-ink:hover:not(:disabled) { background: #fff; } }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { background: rgb(255 255 255 / .06); } }
.btn-text {
  min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer; border-radius: 10px;
  color: var(--text); font: 600 14px var(--font-ui); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-faint);
}
.btn-text { transition: opacity var(--dur-feedback), transform var(--dur-feedback) var(--ease-response); }
.btn-text:active { opacity: .6; transform: scale(.97); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* pole ≥ 16 px (.field 17, .digit 23–26, chat-input 16 na dotyku), jinak iOS při zaměření přiblíží stránku */
.field {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px; border-radius: 16px;
  background: rgb(255 255 255 / .07); border: 1px solid var(--line); color: var(--text); font: 600 17px var(--font-ui);
}
.field:focus-visible { outline-offset: 1px; border-color: var(--focus); }

/* ================================================================== dialogy */

dialog.dlg {
  padding: 0; border: 0; color: var(--text); margin: auto;
  width: min(440px, calc(100vw - 32px)); max-height: min(88dvh, 760px); overflow: hidden;
  border-radius: var(--radius-sheet);
  background: rgb(18 20 24 / .98); /* = --surface-1, plné */
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--hair), 0 24px 64px rgb(0 0 0 / .5);
}
dialog.dlg[open] { display: flex; flex-direction: column; }
.dlg::backdrop { background: rgb(4 5 7 / .6); }
@media (prefers-reduced-transparency: reduce) {
  .dlg::backdrop { background: rgb(4 5 7 / .8); }
}
.dlg-body { position: relative; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; }
.btn-close {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; color: var(--text); cursor: pointer;
  background: rgb(255 255 255 / .06); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.btn-close:active { background: rgb(255 255 255 / .14); }
@media (hover: hover) and (pointer: fine) { .btn-close:hover { background: rgb(255 255 255 / .1); } }
.btn-close > * { position: relative; }
.btn-close::after { content: ""; position: absolute; inset: -2px; }
.btn-close { transition: transform var(--dur-feedback) var(--ease-response); }
.btn-close:active { transform: scale(.92); }
.dlg-lead, .dlg-note { color: var(--text-muted); font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.dlg-note { text-align: center; }

.dlg-grab { display: none; }
@media (max-width: 600px) {
  dialog.dlg {
    margin: auto 0 0; width: 100%; max-width: none; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
    translate: 0 var(--drag, 0px); transition: translate 220ms var(--ease-response);
  }
  dialog.dlg[data-dragging] { transition: none; }
  .dlg-body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  /* úchyt a hlavička táhnou list dolů (sheet.js); obsah pod nimi se scrolluje normálně */
  .dlg-grab { display: block; flex: none; padding: 8px 0 0; touch-action: none; }
  .dlg-handle { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: rgb(255 255 255 / .28); }
  .dlg-head { touch-action: none; }
  .dlg-body { padding-top: 14px; }
}

/* přepínač záložek */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--radius-pill); background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px var(--line); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--radius-pill); background: rgb(255 255 255 / .16); box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform var(--dur-spatial) var(--ease-response); }
.seg[data-pos="1"] .seg-ind { transform: translateX(100%); }
.seg button { position: relative; height: 40px; border: 0; background: none; border-radius: var(--radius-pill); cursor: pointer; color: var(--text-muted); font: 600 14px var(--font-ui); transition: color var(--dur-state); }
.seg button[aria-selected="true"] { color: var(--text); }
.seg button:focus-visible { outline-offset: -2px; }
.seg button:active { transform: scale(.97); }
.seg button { transition: color var(--dur-state), transform var(--dur-feedback) var(--ease-response); }
/* tři možnosti (Výkon v nastavení) */
.seg--3 { grid-template-columns: repeat(3, 1fr); }
.seg--3 .seg-ind { width: calc((100% - 8px) / 3); }
.seg--3[data-pos="1"] .seg-ind { transform: translateX(100%); }
.seg--3[data-pos="2"] .seg-ind { transform: translateX(200%); }
.seg--3 button { padding: 0 6px; font-size: 13.5px; white-space: nowrap; }

/* párování */
.pair-show { display: grid; grid-template-columns: 152px 1fr; gap: 20px; align-items: center; }
.qr { width: 152px; height: 152px; padding: 7px; border-radius: 18px; background: rgb(255 255 255 / .06); display: grid; place-items: center; }
.qr.is-ready { background: var(--ink); }
.qr-svg { width: 100%; height: 100%; display: block; color: var(--canvas); }
.pair-meta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; min-width: 0; }
.code-big { font: 700 34px/1 var(--font-display); letter-spacing: .05em; white-space: nowrap; }
.countdown { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; }
.countdown svg { width: 28px; height: 28px; }
.countdown circle { fill: none; stroke-width: 3; }
.cd-bg { stroke: rgb(255 255 255 / .14); }
.cd-fg { stroke: var(--text); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
@media (max-width: 420px) {
  .pair-show { grid-template-columns: 1fr; justify-items: center; }
  .pair-meta { align-items: center; }
}
#code-renew { align-self: center; }

.code-inputs { display: flex; justify-content: center; gap: 8px; padding-top: 4px; }
.code-gap { width: 10px; flex: none; }
.digit {
  width: 46px; height: 58px; padding: 0; border-radius: 14px; text-align: center; caret-color: var(--focus);
  background: rgb(255 255 255 / .07); border: 1px solid var(--line); color: var(--text); font: 700 26px var(--font-display);
}
.digit:focus { border-color: var(--focus); }
.digit:focus-visible { outline-offset: 1px; }
.digit[aria-invalid="true"] { border-color: var(--danger); }
@media (max-width: 420px) { .digit { width: 40px; height: 52px; font-size: 23px; } .code-inputs { gap: 6px; } }
.form-error { min-height: 20px; color: var(--danger); font-size: 14px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.form-error .icon { width: 16px; height: 16px; }
#pair-submit { align-self: stretch; }

/* přejmenování */
.rename-orb { display: grid; place-items: center; padding: 8px 0 4px; }
.rename-row { display: flex; gap: 10px; align-items: center; }

/* nastavení */
.dlg--list { width: min(480px, calc(100vw - 32px)); }
.set-sec { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-sec h3 { font: 600 12px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-me { flex: 1; min-width: 0; }
.set-note { color: var(--text-muted); font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.dev-list { display: flex; flex-direction: column; }
.dev-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.dev-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px var(--font-ui); }
.empty-line { font: 400 15px/1.4 var(--font-ui); color: var(--text-muted); padding: 4px 0; }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; min-height: 48px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text b { font-weight: 600; }
.switch-text small { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.switch-row input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; background: rgb(255 255 255 / .16); transition: background var(--dur-state); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--text);
  box-shadow: 0 2px 6px rgb(0 0 0 / .4); transition: transform var(--dur-spatial) var(--ease-spring), background var(--dur-state);
}
.switch-row:active .switch { transform: scale(.96); }
.switch { transition: background var(--dur-state), transform var(--dur-feedback) var(--ease-response); }
.switch-row input:checked ~ .switch { background: rgb(255 255 255 / .86); }
.switch-row input:checked ~ .switch::after { transform: translateX(20px); background: var(--on-ink); }
.switch-row input:focus-visible ~ .switch { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ================================================================== omezený pohyb */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .peer-bob, .me-bob { animation: none; }
}

/* ================================================================== lite (slabý hardware; třídu `lite` na <html> řídí perf.js) */
/* Bez backdrop-filteru (plné neprůhledné plochy), bez nekonečných animací na dekoraci. Interakce (transition) zůstávají. */

html.lite .glass, html.lite .glass--refract, html.lite .btn-glass, html.lite dialog.dlg, html.lite .chat {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.lite .glass, html.lite .btn-glass, html.lite .round, html.lite .name-pill {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair), 0 2px 8px rgb(0 0 0 / .4);
}
html.lite .btn-glass:active, html.lite .round:active, html.lite .name-pill:active { background: var(--surface-3); }
@media (hover: hover) and (pointer: fine) { html.lite .btn-glass:hover, html.lite .round:hover, html.lite .name-pill:hover { background: var(--surface-3); } }
html.lite .btn-close { background: rgb(255 255 255 / .06); box-shadow: none; }
html.lite dialog.dlg { background: var(--surface-1); }
html.lite .chat { background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hair), 0 8px 24px rgb(0 0 0 / .5); }
html.lite .dlg::backdrop { background: rgb(4 5 7 / .8); }

/* koule: bez nekonečných animací */
html.lite .orb-wave { animation: none; }
html.lite .orb-icon { filter: none; }
html.lite .orb-body { box-shadow: 0 2px 6px rgb(0 0 0 / .45); }
html.lite .peer-bob, html.lite .me-bob { animation: none; }
html.lite .bridge-line { animation: none; }
html.lite .status[data-state] .status-dot { animation: none; }
html.lite .hint, html.lite .me, html.lite .peer { will-change: auto; }
html.lite .peer-btn.is-armed::after { animation: none; }
html.lite .peer-btn.is-holding .orb { filter: none; }
html.lite .toast { box-shadow: inset 0 0 0 1px var(--hair), 0 2px 8px rgb(0 0 0 / .4); }
html.lite .status-dot { box-shadow: none !important; }
