/* ============ George Prague — Portfolio tracker ============ */

:root {
  --bg: #0c0c12;
  --bg2: #101019;
  --card: #14141d;
  --card2: #1a1a26;
  --border: #22222f;
  --border2: #2d2d3d;
  --text: #f1f1f7;
  --muted: #9090a5;
  --muted2: #62627a;
  --accent: #7c5cfc;
  --accent2: #9d7dff;
  --accent-dim: rgba(124, 92, 252, 0.13);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --radius: 16px;
  --font: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}

button { font-family: inherit; color: inherit; }
svg { display: block; }
::selection { background: rgba(124, 92, 252, 0.4); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26263500; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
:hover::-webkit-scrollbar-thumb { background: #303045; border: 2px solid transparent; background-clip: content-box; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ============ Layout ============ */

.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: 242px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100%;
  overflow-y: auto;
}

.logo { display: flex; gap: 11px; align-items: center; padding: 0 8px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, #8b6bff, #5b38e8);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px rgba(124, 92, 252, 0.35);
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-name { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; }
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 11px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 13.5px;
  position: relative; text-align: left;
  transition: color .15s, background .15s;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-item.active { background: var(--accent-dim); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.nav-item.active svg { color: var(--accent2); }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.side-profile {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 12px; cursor: pointer;
  transition: border-color .15s;
}
.side-profile:hover { border-color: var(--border2); }
.side-note { font-size: 10.5px; color: var(--muted2); line-height: 1.5; padding: 0 6px; }

.avatar {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #8b6bff, #5b38e8);
  display: grid; place-items: center;
  font-weight: 800; font-size: 12px; color: #fff;
}
.sp-name { font-weight: 700; font-size: 13px; }
.sp-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.tickerbar, .topbar { position: sticky; top: 0; background: var(--bg); z-index: 20; }
.topbar { top: 46px; }

/* ============ Ticker ============ */

.tickerbar {
  display: flex; align-items: center; gap: 18px;
  height: 46px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 22px; overflow: hidden;
}
.market-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.market-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.market-status .dot.closed { background: var(--muted2); box-shadow: none; }
.ticker-wrap {
  flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker {
  display: inline-flex; gap: 30px; white-space: nowrap;
  animation: tickmove 45s linear infinite; will-change: transform;
  padding-right: 30px;
}
.ticker:hover { animation-play-state: paused; }
@keyframes tickmove { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { animation: none; } }
.tick-item { display: inline-flex; gap: 8px; align-items: baseline; font-size: 12px; font-weight: 700; }
.tick-item .t-price { color: var(--muted); font-weight: 600; }

/* ============ Topbar ============ */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-logo {
  display: none;
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, #8b6bff, #5b38e8);
  color: #fff; place-items: center; flex-shrink: 0;
}
.mobile-logo svg { width: 20px; height: 20px; }
.balance { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.balance-label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.balance-value { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }

/* ============ Tlačítka ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 11px; padding: 9px 15px;
  font-weight: 650; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent; background: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 22px rgba(124, 92, 252, 0.28);
}
.btn-primary:hover { background: #8d70fd; }
.btn-ghost { background: var(--card); border-color: var(--border2); color: var(--text); }
.btn-ghost:hover { border-color: #3d3d52; background: var(--card2); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(248, 113, 113, 0.25); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-block { width: 100%; }
.btn:focus-visible, .nav-item:focus-visible, .icon-btn:focus-visible, .bn-item:focus-visible, .bn-add:focus-visible {
  outline: 2px solid var(--accent2); outline-offset: 2px;
}

.profile-btn { padding: 6px 12px 6px 6px; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border2); }
.icon-btn svg { width: 15px; height: 15px; }

/* ============ Obsah ============ */

.content {
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
  width: 100%; max-width: 1380px; margin: 0 auto;
}
.view { display: flex; flex-direction: column; gap: 18px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
h1 { font-family: var(--font-display); font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.last-update { color: var(--muted2); font-size: 11.5px; white-space: nowrap; text-align: right; }

.grid { display: grid; gap: 15px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); }
.main-grid { grid-template-columns: 1.75fr 1fr; align-items: stretch; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h3 { font-size: 14.5px; font-weight: 700; }

.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 800; margin-top: 9px; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-delta { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2.5px 8px; border-radius: 999px;
  font-weight: 700; font-size: 11.5px;
}
.chip.pos { background: var(--green-dim); color: var(--green); }
.chip.neg { background: var(--red-dim); color: var(--red); }
.chip.flat { background: rgba(255,255,255,.06); color: var(--muted); }

.pos { color: var(--green); }
.neg { color: var(--red); }

/* ============ Grafy ============ */

.pills {
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pills button {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--bg2); color: var(--muted); cursor: pointer;
  padding: 6px 13px; border-radius: 9px; font-size: 12px; font-weight: 650; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.pills button:hover { color: var(--text); border-color: var(--border2); }
.pills button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill-sep { width: 1px; flex-shrink: 0; align-self: stretch; background: var(--border); margin: 2px 2px; }

.chart-card { display: flex; flex-direction: column; }
.chart-box { position: relative; height: 272px; flex: 1; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted2); font-size: 13px;
}

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.donut-box { position: relative; width: 176px; height: 176px; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; pointer-events: none;
}
.donut-center .dc-num { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.donut-center .dc-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.alloc-legend { width: 100%; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.alloc-legend li {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; padding: 5px 6px; border-radius: 8px;
}
.alloc-legend li:hover { background: rgba(255,255,255,.03); }
.lg-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.lg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-val { margin-left: auto; color: var(--muted); font-weight: 650; flex-shrink: 0; }

/* ============ Tabulky ============ */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted2); font-weight: 700; padding: 9px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td {
  padding: 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; vertical-align: middle;
}
.table .right { text-align: right; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.table tbody tr:last-child td { border-bottom: 0; }

.sym-cell { display: flex; gap: 11px; align-items: center; min-width: 0; }
.sym-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 11.5px; color: #fff;
}
.sym-name { font-weight: 650; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.sym-tick { color: var(--muted); font-size: 11px; margin-top: 2px; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.row-actions { text-align: right; }
.row-actions .icon-btn { opacity: 0; }
.table tbody tr:hover .row-actions .icon-btn { opacity: 1; }

@keyframes flashUp { 0% { background: rgba(52, 211, 153, 0.16); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(248, 113, 113, 0.16); } 100% { background: transparent; } }
.flash-up { animation: flashUp 1.1s ease-out; }
.flash-down { animation: flashDown 1.1s ease-out; }

/* ============ Mobilní karty pozic ============ */

.h-cards { display: flex; flex-direction: column; }
.h-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px 2px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.h-card:last-child { border-bottom: 0; }
.h-card-top { display: flex; align-items: center; gap: 11px; }
.h-card-top .h-price { margin-left: auto; text-align: right; }
.h-price .hp-val { font-weight: 700; font-size: 13.5px; }
.h-price .hp-day { font-size: 11.5px; font-weight: 650; margin-top: 2px; }
.h-card-bottom {
  display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px;
  flex-wrap: wrap;
  font-size: 12px; color: var(--muted); padding-left: 45px;
}
.h-card-bottom > span:first-child { white-space: nowrap; }
.h-card-bottom .h-gain { text-align: right; font-weight: 650; margin-left: auto; }
.h-card-bottom .h-gain b, .h-card-bottom .h-gain .pos, .h-card-bottom .h-gain .neg { white-space: nowrap; }

.desktop-only { display: block; }
.mobile-only { display: none; }

/* ============ Prázdné stavy ============ */

.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--accent-dim); color: var(--accent2);
  display: grid; place-items: center;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 13px; max-width: 320px; margin: 0 auto 16px; }

/* ============ Výplaty ============ */

.payout-list { list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: 296px; overflow-y: auto; }
.payout-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px; border-radius: 11px;
}
.payout-list li:hover { background: rgba(255,255,255,.025); }
.date-badge {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.db-day { font-weight: 800; font-size: 14px; line-height: 1.1; }
.db-mon { font-size: 9.5px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.po-info { min-width: 0; flex: 1; }
.po-sym { font-weight: 700; font-size: 13px; }
.po-sub { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-amt { font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
.po-amt .po-est { display: block; font-size: 10.5px; color: var(--muted2); font-weight: 600; margin-top: 1px; }

/* ============ Dropdown ============ */

.dropdown {
  position: fixed; z-index: 60;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 6px; min-width: 236px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
  animation: ddIn .14s ease-out;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 11px; border-radius: 9px; border: 0; background: none;
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.dd-item:hover { background: var(--accent-dim); }
.dd-item .dd-check { margin-left: auto; color: var(--accent2); }
.dd-item .dd-sub { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.dd-sep { height: 1px; background: var(--border); margin: 6px 6px; }

/* ============ Modály ============ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 6, 12, 0.72);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 22px;
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 20px; width: 100%; max-width: 500px;
  max-height: 88vh; overflow-y: auto; padding: 22px;
  animation: modalIn .18s cubic-bezier(.2,.9,.3,1.1);
}
.modal.wide { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; }
.modal-head h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 800; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 650; }
input, select {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 11px;
  padding: 11px 13px; color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; width: 100%; transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus { border-color: var(--accent); }
input[type="date"] { color-scheme: dark; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 46px; }
.input-suffix .suffix {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none;
}

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.search-box input { padding-left: 40px; }
.search-results { display: flex; flex-direction: column; gap: 2px; max-height: 296px; overflow-y: auto; margin-top: 10px; }
.sr-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border-radius: 11px; cursor: pointer; border: 0; background: none; text-align: left;
}
.sr-item:hover { background: var(--accent-dim); }
.sr-main { min-width: 0; flex: 1; }
.sr-sym { font-weight: 750; font-size: 13.5px; }
.sr-name { color: var(--muted); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-tag {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px;
}
.search-hint { color: var(--muted2); font-size: 12.5px; text-align: center; padding: 22px 10px; }

.picked-stock {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 13px; margin-bottom: 16px;
}
.picked-stock .change-btn {
  margin-left: auto; background: none; border: 0; color: var(--accent2);
  font-size: 12px; font-weight: 650; cursor: pointer; padding: 4px;
}

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* Detail akcie */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-price { margin-left: auto; text-align: right; }
.detail-price .dp-val { font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.detail-price .dp-day { font-size: 12px; font-weight: 650; margin-top: 2px; }
.detail-chart-box { position: relative; height: 190px; margin-bottom: 16px; }
.detail-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.ds-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.ds-lbl { font-size: 10.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.ds-val { font-weight: 750; font-size: 14px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.div-history h4 { font-size: 13px; margin-bottom: 8px; color: var(--muted); font-weight: 700; }
.dh-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.dh-row:last-child { border-bottom: 0; }
.dh-row .dh-mine { font-weight: 650; }

/* Správa profilů */
.pm-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0;
}
.pm-row input { flex: 1; }
.pm-row .pm-tag {
  flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--accent2);
  background: var(--accent-dim); border-radius: 6px; padding: 3px 7px;
}
.pm-note { font-size: 11.5px; color: var(--muted2); margin: 10px 0 4px; }

/* ============ Toasty ============ */

.toasts {
  position: fixed; bottom: 22px; right: 22px; z-index: 95;
  display: flex; flex-direction: column; gap: 10px; max-width: min(340px, calc(100vw - 44px));
}
.toast {
  background: var(--card2); border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  padding: 12px 15px; border-radius: 13px; font-size: 13px; font-weight: 550;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  animation: toastIn .22s ease-out;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ============ Skeleton ============ */

.skel {
  display: inline-block; width: 92px; height: 20px; border-radius: 7px;
  background: linear-gradient(90deg, #1b1b27 25%, #242433 50%, #1b1b27 75%);
  background-size: 200% 100%; animation: skmove 1.3s infinite linear;
  vertical-align: middle;
}
@keyframes skmove { to { background-position: -200% 0; } }

/* ============ Spodní navigace (mobil) ============ */

.bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(16, 16, 25, 0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around; align-items: center;
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 10.5px; font-weight: 650;
  padding: 7px 20px; border-radius: 12px; min-width: 86px;
}
.bn-item svg { width: 21px; height: 21px; }
.bn-item.active { color: var(--accent2); }
.bn-add {
  width: 52px; height: 52px; border-radius: 17px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #8b6bff, #5b38e8); color: #fff;
  display: grid; place-items: center; margin-top: -22px;
  box-shadow: 0 10px 26px rgba(124, 92, 252, 0.45);
}
.bn-add svg { width: 23px; height: 23px; }

/* ============ Responzivita ============ */

.hide-m { display: inline-flex; }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .mobile-logo { display: grid; }
  .hide-m { display: none !important; }

  .content { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); gap: 14px; }
  .topbar { padding: 11px 14px; }
  .balance { flex-direction: column; gap: 1px; }
  .balance-label { font-size: 10.5px; }
  .balance-value { font-size: 17px; }
  .btn-icon-m { padding: 9px 11px; }
  .profile-btn .avatar { width: 28px; height: 28px; }
  .profile-btn { padding: 5px; border-radius: 11px; }

  .tickerbar { padding: 0 14px; height: 42px; gap: 12px; }
  .topbar { top: 42px; }
  .market-status span:not(.dot) { display: none; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .last-update { text-align: left; }
  h1 { font-size: 20px; }

  .card { padding: 15px 16px; border-radius: 15px; }
  .stat-value { font-size: 19px; }
  .stats-grid { gap: 10px; grid-template-columns: repeat(2, 1fr); }
  .grid { gap: 12px; }
  .chart-box { height: 220px; }

  .desktop-only { display: none; }
  .mobile-only { display: flex; }

  /* modály jako spodní sheet */
  .modal-overlay { place-items: end center; padding: 0; }
  .modal, .modal.wide {
    max-width: 100%; border-radius: 22px 22px 0 0;
    max-height: 92vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    animation: sheetIn .22s cubic-bezier(.2,.9,.3,1);
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  @keyframes sheetIn { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; }
  .dropdown { min-width: 250px; }
}

@media (max-width: 380px) {
  .stat-value { font-size: 17.5px; }
}
