/* =====================================================================
 * XRPIN v2 · HLUBINA – app.css
 * Mobile-first. Moderní CSS: dvh, env(safe-area), backdrop-filter,
 * color-mix(), @starting-style + transition-behavior pro <dialog>,
 * container queries, :has(). Bez externích fontů (systémové písmo).
 * ===================================================================== */
:root {
  --ink: #e8f6ff;
  --ink-2: rgba(214, 236, 255, 0.72);
  --ink-3: rgba(190, 220, 255, 0.46);
  --glass: rgba(6, 18, 38, 0.58);
  --glass-2: rgba(10, 28, 56, 0.72);
  --line: rgba(160, 220, 255, 0.16);
  --accent: #6ff3e4;
  --accent-2: #9d8bff;
  --gold: #ffd479;
  --danger: #ff7a8a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail: 42px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #02060f; color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
canvas#ocean, canvas#world { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; }
canvas#ocean { image-rendering: auto; }
canvas#world { touch-action: none; cursor: grab; }
canvas#world:active { cursor: grabbing; }

/* ---------------- HUD ---------------- */
.hud {
  position: fixed; left: 0; right: 0; top: 0;
  padding: calc(var(--safe-t) + 10px) 12px 0;
  display: flex; align-items: flex-start; gap: 10px;
  pointer-events: none; z-index: 5;
}
.hud > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  cursor: pointer;
}
.brand svg { width: 26px; height: 26px; }
.brand-name { font-weight: 700; letter-spacing: .14em; font-size: 13px; }
.brand-sub { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 14px; }
.readout {
  margin: 0 auto; min-width: 0; text-align: center;
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-family: var(--mono); font-size: 11px; line-height: 1.35;
}
.r-main { display: flex; gap: 7px; align-items: center; justify-content: center; white-space: nowrap; }
.r-main b { letter-spacing: .16em; font-weight: 700; }
.r-main .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: beat 1.6s infinite; }
body.diving .r-main .dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: none; }
.r-sub { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--ink-3); white-space: nowrap; }
#dna { width: 60px; height: 5px; border-radius: 3px; }
@keyframes beat { 50% { opacity: .35; transform: scale(.7); } }
.hud-actions { display: flex; gap: 6px; }
.ic {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--glass); cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background .2s, transform .15s;
}
.ic:hover { background: var(--glass-2); }
.ic:active { transform: scale(.94); }
.ic.sm { width: 30px; height: 30px; font-size: 15px; }
.ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#btnSound svg path:first-child { fill: currentColor; stroke: none; }
#btnSound[aria-pressed="false"] .wave { opacity: .25; }
#btnSound[aria-pressed="true"] { color: var(--accent); }

/* ---------------- Sonar (rail) ---------------- */
.rail {
  position: fixed; right: 0; top: calc(var(--safe-t) + 64px); bottom: calc(var(--safe-b) + 96px);
  width: var(--rail); z-index: 4; touch-action: none; cursor: ns-resize;
}
.rail canvas { width: 100%; height: 100%; display: block; }
.rail.active::before { content: ""; position: absolute; inset: 0 0 0 -20px; background: linear-gradient(90deg, transparent, rgba(80,200,255,.08)); }

.zoom {
  position: fixed; right: calc(var(--rail) + 6px); bottom: calc(var(--safe-b) + 104px); z-index: 4;
  display: none; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}

/* ---------------- Dock ---------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 0 12px calc(var(--safe-b) + 16px);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.dock > * { pointer-events: auto; }
.fab {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 15px 26px 15px 20px; border-radius: 999px; border: 1px solid rgba(160, 255, 240, .45);
  background: linear-gradient(135deg, rgba(40, 190, 200, .55), rgba(110, 90, 255, .55));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-weight: 650; font-size: 16px; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 10px 40px rgba(40, 200, 255, .25), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .15s;
}
.fab:active { transform: scale(.97); }
.fab svg { width: 20px; height: 20px; fill: rgba(220, 255, 250, .9); }
.fab-glow { position: absolute; inset: -6px; border-radius: inherit; background: radial-gradient(closest-side, rgba(110, 255, 230, .35), transparent); filter: blur(8px); z-index: -1; animation: fabglow 3.2s ease-in-out infinite; }
@keyframes fabglow { 50% { opacity: .3; transform: scale(1.08); } }
.pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 215, 140, .5); background: rgba(40, 30, 10, .55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: pointer; font-size: 14px;
}
.pill svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.pill em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--gold); }
.pill[hidden] { display: none; }

/* ---------------- Nápověda a toasty ---------------- */
.hint {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 92px); transform: translateX(-50%);
  width: min(360px, calc(100vw - 80px)); z-index: 4; text-align: center;
  font-family: var(--serif); font-size: 15px; line-height: 1.4; color: var(--ink-2);
  padding: 10px 14px; border-radius: 14px; background: rgba(4, 12, 28, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity 1s, transform 1s; pointer-events: none;
}
.hint b { color: var(--ink); font-weight: 600; }
.hint.gone { opacity: 0; transform: translate(-50%, 10px); }
.toasts {
  position: fixed; left: 12px; right: calc(var(--rail) + 8px); top: calc(var(--safe-t) + 70px); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer; max-width: 420px; width: 100%;
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center;
  padding: 9px 14px 9px 9px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--glass-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  animation: toastIn .5s cubic-bezier(.2, .9, .3, 1.2);
}
.toast canvas { width: 34px; height: 34px; border-radius: 50%; background: #030a18; }
.toast .tt { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.toast .tx { font-family: var(--serif); font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .4s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* ---------------- Ambientní mód ---------------- */
body.ambient .hud, body.ambient .rail, body.ambient .dock, body.ambient .zoom, body.ambient .hint, body.ambient .toasts { opacity: 0; pointer-events: none; transition: opacity 1.2s; }
.ambient-exit { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 18px); transform: translateX(-50%); font-size: 12px; color: var(--ink-3); opacity: 0; pointer-events: none; transition: opacity 1s; font-family: var(--mono); z-index: 6; }
body.ambient .ambient-exit { animation: ambHint 6s forwards; }
@keyframes ambHint { 10%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- Sheets (<dialog>) ---------------- */
dialog.sheet {
  position: fixed; margin: 0; inset: auto 0 0 0; width: 100%; max-width: 100%;
  max-height: 88dvh; padding: 0; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; color: var(--ink);
  background: linear-gradient(180deg, rgba(10, 26, 52, .86), rgba(4, 12, 28, .94));
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  opacity: 1; transform: translateY(0);
  transition: opacity .35s, transform .45s cubic-bezier(.2, .9, .25, 1), overlay .45s allow-discrete, display .45s allow-discrete;
  overflow: hidden; z-index: 20;
}
dialog.sheet:not([open]) { opacity: 0; transform: translateY(40px); }
@starting-style { dialog.sheet[open] { opacity: 0; transform: translateY(60px); } }
dialog.sheet::backdrop { background: rgba(0, 4, 12, .35); transition: background .4s, overlay .4s allow-discrete, display .4s allow-discrete; }
@starting-style { dialog.sheet[open]::backdrop { background: rgba(0, 4, 12, 0); } }
.sheet-body { overflow-y: auto; max-height: calc(88dvh - 18px); padding: 6px 18px calc(var(--safe-b) + 22px); overscroll-behavior: contain; container-type: inline-size; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: rgba(200, 230, 255, .25); margin: 9px auto 4px; }
dialog .close { position: absolute; top: 10px; right: 12px; z-index: 2; }
dialog h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 8px 0 4px; letter-spacing: .005em; }
dialog h3 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 8px; font-weight: 650; }
dialog p { line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 13px; }

/* ---------------- Detail ---------------- */
.portrait { position: relative; margin: 4px -18px 0; height: 230px; background: radial-gradient(ellipse at 50% 40%, rgba(40, 120, 180, .25), transparent 70%); }
.portrait canvas { width: 100%; height: 100%; display: block; }
.portrait .rar { position: absolute; left: 18px; bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-family: var(--mono); letter-spacing: .04em; }
.chip.legendary { color: var(--gold); border-color: rgba(255, 212, 121, .6); box-shadow: 0 0 20px rgba(255, 200, 90, .25); }
.chip.rare { color: #c7b6ff; border-color: rgba(180, 160, 255, .5); }
.chip.uncommon { color: #9fe8ff; }
.species { font-family: var(--serif); font-style: italic; font-size: 22px; margin: 10px 0 0; }
.species-cz { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.msg-text { font-family: var(--serif); font-size: 21px; line-height: 1.42; margin: 16px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text.plain { color: var(--ink-2); }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.who b { color: var(--ink); }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin: 16px 0 4px; }
.meta > div { background: rgba(6, 16, 34, .92); padding: 10px 12px; min-width: 0; }
.meta dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.meta dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.meta dd small { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.mono { font-family: var(--mono); font-size: 12px; }
.dna-grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin: 6px 0 10px; }
.dna-grid i { aspect-ratio: 1; border-radius: 3px; }
.dna-grid i.gene { outline: 1px solid rgba(255, 255, 255, .7); outline-offset: -1px; }
.genes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 14px; font-size: 12px; }
.genes span { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.genes div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed rgba(160, 220, 255, .1); padding: 3px 0; }
@container (min-width: 520px) { .genes { grid-template-columns: repeat(3, 1fr); } }
.thread { display: flex; flex-direction: column; gap: 6px; }
.trow { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; }
.trow:hover { border-color: var(--line); }
.trow i { width: 10px; height: 10px; border-radius: 50%; }
.trow .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 15px; }
.trow .tt b { font-family: var(--sans); font-size: 11px; color: var(--ink-3); margin-right: 6px; font-weight: 600; letter-spacing: .06em; }
.trow small { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.trow.cur { border-color: rgba(111, 243, 228, .5); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); cursor: pointer; font-size: 14px; transition: background .2s; text-decoration: none; }
.btn:hover { background: rgba(255, 255, 255, .1); }
.btn.primary { background: linear-gradient(135deg, rgba(40, 190, 200, .6), rgba(110, 90, 255, .6)); border-color: rgba(160, 255, 240, .5); font-weight: 650; }
.btn.danger { color: var(--danger); }
.btn.big { width: 100%; padding: 15px; font-size: 16px; border-radius: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
details.raw summary { cursor: pointer; color: var(--ink-3); font-size: 12px; margin-top: 16px; }
details.raw pre { font-family: var(--mono); font-size: 11px; background: rgba(0, 0, 0, .35); border-radius: 12px; padding: 12px; overflow: auto; max-height: 260px; color: #a9d8ff; }

/* ---------------- Composer ---------------- */
.cmp-top { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.cmp-top canvas { width: 120px; height: 120px; border-radius: 22px; background: radial-gradient(circle at 50% 45%, rgba(30, 90, 150, .5), rgba(2, 8, 20, .9)); }
.cmp-top p { margin: 0; font-size: 13px; }
.reply-to { margin: 10px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent); background: rgba(255, 255, 255, .04); border-radius: 0 10px 10px 0; font-family: var(--serif); font-size: 14px; color: var(--ink-2); }
textarea, input[type=text], input[type=search], input[type=datetime-local] {
  width: 100%; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 8, 20, .55);
  color: var(--ink); padding: 12px 14px; font: inherit; font-size: 16px; outline: none;
}
textarea { font-family: var(--serif); font-size: 18px; min-height: 110px; resize: vertical; line-height: 1.4; }
textarea:focus, input:focus { border-color: rgba(111, 243, 228, .6); box-shadow: 0 0 0 3px rgba(111, 243, 228, .12); }
.counter { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin: 5px 2px 0; }
.counter .bad { color: var(--danger); }
.opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opt { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); cursor: pointer; font-size: 13px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 70px; }
.opt small { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.opt[aria-pressed="true"] { border-color: rgba(111, 243, 228, .75); background: rgba(111, 243, 228, .12); }
.opt:disabled { opacity: .35; cursor: not-allowed; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 12px currentColor; }
.sw.dna { background: conic-gradient(from 0deg, #4ff, #86f, #f6c, #fd6, #6f9, #4ff); }
.sw-custom { position: relative; overflow: hidden; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 16px; }
.sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.budget { margin-top: 18px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .06); display: flex; overflow: hidden; }
.bar i { display: block; height: 100%; transition: width .3s; }
.bar i:nth-child(1) { background: #5bd6ff; } .bar i:nth-child(2) { background: #57f0c8; } .bar i:nth-child(3) { background: #a58bff; }
.bar i:nth-child(4) { background: #ff8fd0; } .bar i:nth-child(5) { background: #ffd26b; }
.bsum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.bsum b { font-size: 22px; font-family: var(--serif); font-weight: 500; }
.bsum span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.errors { color: var(--danger); font-size: 13px; margin: 10px 0 0; }

/* ---------------- Wallet ---------------- */
.wallet .sheet-body { text-align: center; }
.wallet canvas.qr { width: 200px; height: 200px; background: #fff; border-radius: 14px; padding: 10px; margin: 10px auto; display: block; }
.wallet .wl { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.wallet .sum { text-align: left; margin: 12px 0; }
.wallet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------------- Menu, panely, karty ---------------- */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.menu-grid button { text-align: left; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); cursor: pointer; }
.menu-grid button:hover { background: rgba(255, 255, 255, .08); }
.menu-grid b { display: block; font-size: 15px; margin: 6px 0 2px; }
.menu-grid span { font-size: 12px; color: var(--ink-3); line-height: 1.35; display: block; }
.menu-grid .em { font-size: 22px; }
.search-q { display: flex; gap: 8px; margin: 8px 0 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.results { display: flex; flex-direction: column; gap: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .035); padding: 8px; cursor: pointer; text-align: left; }
.card canvas { width: 100%; aspect-ratio: 1; border-radius: 12px; background: radial-gradient(circle at 50% 45%, rgba(30, 90, 150, .35), rgba(2, 8, 20, .9)); display: block; }
.card b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 14px; margin: 8px 2px 2px; }
.card span { display: block; font-size: 12px; color: var(--ink-3); margin: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.census { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.census div { text-align: center; padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.census b { display: block; font-size: 18px; font-family: var(--serif); font-weight: 500; }
.census span { font-size: 10px; color: var(--ink-3); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl td, table.tbl th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl td:last-child, table.tbl th:last-child { text-align: right; font-family: var(--mono); font-size: 12px; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, .12); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #cfe6ff; transition: transform .2s; }
.toggle input:checked { background: rgba(111, 243, 228, .55); }
.toggle input:checked::after { transform: translateX(18px); }
select { background: rgba(0, 8, 20, .6); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font: inherit; }

/* ---------------- Větší displeje ---------------- */
@media (min-width: 900px) {
  :root { --rail: 58px; }
  .zoom { display: flex; }
  .readout { font-size: 12px; padding: 7px 18px; }
  #dna { width: 90px; }
  dialog.sheet.side {
    inset: calc(var(--safe-t) + 70px) 16px 16px auto; width: 420px; max-height: none; height: auto;
    border-radius: 24px; border-bottom: 1px solid var(--line);
    right: calc(var(--rail) + 12px);
  }
  dialog.sheet.side:not([open]) { transform: translateX(40px); }
  @starting-style { dialog.sheet.side[open] { transform: translateX(60px); } }
  dialog.sheet.side .sheet-body { max-height: calc(100dvh - 110px); }
  dialog.sheet.side .grab { display: none; }
  dialog.sheet.center { inset: 0; margin: auto; width: 580px; max-height: 88dvh; height: fit-content; border-radius: 26px; border-bottom: 1px solid var(--line); }
  dialog.sheet.center.wide { width: 820px; }
  dialog.sheet.center.wallet { width: 400px; }
  dialog.sheet.center .grab { display: none; }
  dialog.sheet.center:not([open]) { transform: scale(.96); }
  @starting-style { dialog.sheet.center[open] { transform: scale(.94); } }
  .hint { bottom: 110px; }
  .dock { flex-direction: row; justify-content: center; }
  .portrait { height: 260px; }
}
@media (min-width: 1600px) {
  .brand-name { font-size: 14px; }
  .fab { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ---------------- Malé telefony ---------------- */
@media (max-width: 560px) {
  .hud { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .brand { padding: 5px; }
  .brand-name, .brand-sub { display: none; }
  .readout { padding: 5px 10px; font-size: 10.5px; flex: 1; }
  .r-sub { gap: 6px; }
  #dna { width: 44px; }
  .ic { width: 36px; height: 36px; }
  .hud-actions { gap: 5px; }
}
