/* Návrh 6 „Kalendář v centru": fialová = výběr a akce, zelená a červená jen pro výsledky.
   Rádius 14 px karty, 9–10 px buňky a tlačítka. Mezery 8 / 12 / 16 / 20 / 28 px. */
/* Inter (SIL Open Font License 1.1) uložený v appce: CSP cizí zdroje nepouští. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-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 {
  --bg: #0e1220;
  --top: #0b0f1b;
  --panel: #151a2b;
  --panel2: #1a1f33;
  --line: #232a3e;
  --line2: #2e3655;
  --text: #eceef6;
  --muted: #8e97b3;
  --accent: #a99bff;
  --on-accent: #16122e;
  --pos: #2fbf91;
  --day-pos: #1f6b5a;
  --neg: #f06a80;
  --day-neg: #6b2a3a;
  --gold: #f5a524;
  --flat: #6b768c;
  --discord: #5865f2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
h2 { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
h2 a { color: inherit; }
h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.gold { color: var(--gold); }
.ok .icon { color: var(--pos); }
.bad .icon { color: var(--neg); }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.wide-gap { gap: 22px; }
.scroll { overflow-x: auto; }
.with-icon { display: inline-flex; gap: 8px; align-items: center; }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.solid { fill: currentColor; stroke: none; }

/* ---------- logo ---------- */
.logo { display: inline-flex; gap: 10px; align-items: center; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.logo em { font-style: normal; color: var(--accent); }
.mark-bg { fill: var(--panel2); }
.mark-line { fill: none; stroke: var(--accent); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-dot { fill: var(--pos); }

/* ---------- tlačítka ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 15px; border: 1px solid var(--line2); border-radius: 9px; background: transparent; color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #454f78; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--panel2); border-color: transparent; }
.btn.danger { color: var(--neg); }
.btn.danger.solid { background: var(--neg); border-color: var(--neg); color: #2a0b12; }
.btn.wide { width: 100%; }
.btn.square { width: 42px; padding: 0; height: 33px; min-height: 33px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.plain { border-color: transparent; }
.icon-btn.btn { color: var(--text); border-radius: 9px; }
.icon-btn + .icon-btn { margin-left: 4px; }
.row .icon-btn + .icon-btn { margin-left: 0; }
.icon-slot { display: inline-block; width: 30px; }
.text-btn { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link { display: inline-flex; align-items: center; gap: 7px; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line2); border-radius: 10px; }
.segmented button { min-height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.segmented button.active { background: var(--panel2); color: var(--text); font-weight: 600; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { min-height: 34px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 9px; background: none; font-size: 13.5px; cursor: pointer; }
.chips button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; white-space: normal; }
.tag { padding: 2px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); font-size: 12px; font-weight: 500; line-height: 1.55; }
.tag.bad { color: var(--neg); }
.tag.warn { color: var(--gold); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--panel2); font-size: 12.5px; font-weight: 500; line-height: 1.5; letter-spacing: 0; vertical-align: middle; white-space: nowrap; }
.badge.active { background: #272a4e; color: var(--accent); }
.badge.passed { background: #16322f; color: var(--pos); }
.badge.blown { background: #36202e; color: var(--neg); }
.badge.payout { background: #35291f; color: var(--gold); }

/* ---------- horní lišta ---------- */
.top { display: flex; align-items: center; gap: 36px; min-height: 72px; padding: 0 33px; background: var(--top); border-bottom: 1px solid var(--line); }
.brand { flex: none; }
.top nav { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; }
.top nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 15px; border-radius: 9px; color: var(--muted); white-space: nowrap; }
.top nav a:hover { color: var(--text); }
.top nav a.active { background: var(--panel2); color: var(--text); font-weight: 600; }
.top nav a.active .icon { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 11px; }

.select { position: relative; display: flex; align-items: center; min-width: 0; }
.select > .icon:last-child { position: absolute; right: 11px; pointer-events: none; color: var(--muted); }
.select select { appearance: none; width: 100%; padding-right: 32px; cursor: pointer; text-overflow: ellipsis; }
.picker > .icon:first-child { position: absolute; left: 13px; pointer-events: none; color: var(--muted); }
.picker select { height: 36px; max-width: 220px; padding: 0 34px 0 37px; border: 1px solid var(--line2); border-radius: 9px; background: transparent; font-size: 13.5px; }
.panel-head .select select { height: 34px; padding: 0 34px 0 14px; border: 1px solid var(--line2); border-radius: 9px; background: transparent; font-size: 13px; }
select option, select optgroup { background: var(--panel); color: var(--text); }

.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: var(--muted); }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 600; }
.menu { position: absolute; z-index: 20; right: 0; top: calc(100% + 10px); min-width: 190px; display: flex; flex-direction: column; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px rgb(0 0 0 / .45); }
.menu a, .menu button { padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--panel2); }
.menu-name { padding: 6px 10px 8px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- stránka ---------- */
.page { max-width: 1500px; margin: 0 auto; padding: 28px 62px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { min-width: 0; }
.over { margin-bottom: 2px; color: var(--muted); font-size: 13.5px; }
.over a { color: inherit; }
.over a:hover { color: var(--accent); }
.actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.divider { align-self: stretch; width: 1px; background: var(--line2); }
.panel { min-width: 0; padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }
.gap { margin-top: 22px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; align-items: stretch; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 17px; }
.breach { border-color: var(--neg); color: var(--neg); font-weight: 600; }
.onboarding { max-width: 620px; }
.error { color: var(--neg); }
.error:empty { display: none; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.hint.tight { margin: -8px 0 14px; }

.headline { display: flex; align-items: flex-end; gap: 11px 14px; flex-wrap: wrap; text-align: right; }
.headline > div { display: flex; flex-direction: column; }
.headline span { color: var(--muted); font-size: 13px; }
.headline strong { font-size: 22px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.headline.left { text-align: left; gap: 12px 30px; margin-bottom: 12px; }

.kpis { display: grid; gap: 13px; }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { min-width: 0; padding: 15px 19px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.kpi .label, .kpi .hint { color: var(--muted); font-size: 13px; margin: 0; }
.kpi .value { margin: 5px 0 2px; font-size: 26px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }

/* ---------- kalendář ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 396px; gap: 20px; align-items: start; }
.cal-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-hint { margin-left: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 9px; }
.cal-wrap { container-type: inline-size; }
.cal-grid .short { display: none; }
.cal-grid .cell .long, .week-total .long, .week-total .short { color: inherit; font: inherit; }
@container (max-width: 820px) {
  .cal-grid { gap: 5px; }
  .cal-grid .cell { padding: 6px 5px; }
  .cal-grid .cell strong { font-size: 13px; }
  .cal-grid .cell .small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .cal-grid .cell.selected { padding: 5px 4px; }
  .cal-grid .long { display: none; }
  .cal-grid .short { display: inline; }
  .cal-grid .week-total { padding: 6px 4px; font-size: 11px; }
  .cal-grid .week-total strong { font-size: 12.5px; }
}
@container (max-width: 620px) {
  .cal-grid .cell { padding: 6px 3px; }
  .cal-grid .cell strong { font-size: 11.5px; letter-spacing: -.02em; }
}
.cal-day-name { padding: 0 4px; color: var(--muted); font-size: 13px; }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; min-height: 108px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: transparent; text-align: left; overflow: hidden; cursor: pointer; }
.cell:hover { border-color: var(--line2); }
.cell.blank { border-color: transparent; cursor: default; }
.cell .num { color: var(--muted); font-size: 12.5px; }
.cell strong { max-width: 100%; font-size: 15px; font-weight: 600; white-space: nowrap; }
.cell .small { color: rgb(236 238 246 / .78); white-space: nowrap; }
.cell .small.gold { color: var(--gold); }
.cell.win { background: var(--day-pos); border-color: var(--day-pos); }
.cell.loss { background: var(--day-neg); border-color: var(--day-neg); }
.cell.flat { background: var(--line2); border-color: var(--line2); }
.cell.win .num, .cell.loss .num, .cell.flat .num { color: var(--text); }
.cell.today .num { font-weight: 700; color: var(--text); }
.cell.selected { border: 2px solid var(--accent); padding: 7px 8px; }
.week-total { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px 10px; border: 1px dashed var(--line2); border-radius: 10px; font-size: 12.5px; }
.week-total span { color: var(--muted); }
.week-total strong { font-size: 15px; white-space: nowrap; }
.week-list { display: none; }

.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.day-date { font-size: 24px; font-weight: 600; line-height: 1.3; }
.close-day { display: none; }
.day-panel { display: flex; flex-direction: column; gap: 14px; }
.day-panel .day-head { margin: 0; }
.day-panel .field { margin: 0; }
.minis { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.mini { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 11px 10px; border-radius: 10px; background: var(--panel2); }
.mini span { color: var(--muted); font-size: 12.5px; }
.mini strong { font-size: 16px; white-space: nowrap; }
.empty-day { margin: 0; }
.trade { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-left: 3px solid var(--flat); border-radius: 10px; background: var(--panel2); }
.trade.pos { border-left-color: var(--pos); color: var(--text); }
.trade.neg { border-left-color: var(--neg); color: var(--text); }
.trade.payout { border-left-color: var(--gold); }
.trade-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.trade-flags { display: flex; gap: 12px; flex-wrap: wrap; }
.trade-flags span { display: inline-flex; align-items: center; gap: 5px; }
.trade-note { margin: 0; color: var(--muted); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-label { display: flex; justify-content: space-between; gap: 8px; }
.note-status { color: var(--muted); }

.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.month-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.month-tile:hover { border-color: var(--accent); }
.month-name { font-weight: 600; }
.month-tile strong { font-size: 20px; }
.month-dots { display: grid; grid-template-columns: repeat(7, 11px); gap: 3px; margin-top: 8px; }
.month-dots i { width: 11px; height: 11px; border-radius: 3px; background: var(--panel2); }
.month-dots i.win { background: var(--pos); }
.month-dots i.loss { background: var(--neg); }
.month-dots i.flat { background: var(--flat); }
.month-dots i.out { background: transparent; }

/* ---------- karty účtů ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.account-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--text); }
a.account-card:hover { border-color: var(--accent); }
.account-head { display: flex; align-items: flex-start; gap: 8px; }
.account-head .drag { margin-left: -9px; }
.account-name { display: block; color: var(--text); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.account-balance { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }
.account-balance strong { font-size: 30px; font-weight: 600; letter-spacing: -.01em; }
.account-card p { margin: 0; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.meter-list { display: flex; flex-direction: column; gap: 13px; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; padding: 20px; border: 1px dashed var(--line2); border-radius: 14px; background: transparent; color: var(--muted); cursor: pointer; }
.add-card .icon { color: var(--accent); }
.add-card:hover { border-color: var(--accent); color: var(--text); }

.drag { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; user-select: none; }
[data-sort].dragging { opacity: .45; filter: grayscale(1); outline: 1px dashed var(--accent); }
body.grabbing, body.grabbing * { cursor: grabbing !important; }
.drag-ghost { position: fixed; z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; pointer-events: none; background: var(--panel); border: 1px solid var(--accent); border-radius: 9px; color: var(--text); font-weight: 600; white-space: pre; }

/* ---------- list strategie ---------- */
.sheet-tabs { display: flex; gap: 4px; flex: none; margin-top: -6px; overflow-x: auto; scrollbar-width: thin; box-shadow: inset 0 -1px var(--line); }
.sheet-tabs a, .sheet-tabs button { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); white-space: nowrap; cursor: pointer; }
.sheet-tabs a:hover { color: var(--text); }
.sheet-tabs a.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.sheet-tabs button { color: var(--accent); }
.sheet-tabs :focus-visible { outline-offset: -3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dot.passed { background: var(--pos); }
.dot.blown { background: var(--neg); }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-bar h2 { margin: 0; }
.sheet-bar .actions { margin-left: auto; }

/* ---------- varování, zprávy, screenshoty, žebříček ---------- */
.warning { border-color: var(--gold); color: var(--gold); }
.warning strong { color: var(--text); }
.hint.gold { color: var(--gold); }
.form-info:empty { display: none; }
.form-info { margin: -6px 0 14px; }
.tag.strong { font-weight: 700; }
.plain-btn { padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; }

.cell-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; align-self: stretch; }
.news-mark { padding: 0 5px; border-radius: 5px; background: #3a2f1c; color: var(--gold); font-size: 10.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.news-mark.holiday { background: #272a4e; color: var(--accent); }
.day-news { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.news-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
.news-time { color: var(--gold); font-variant-numeric: tabular-nums; }
.news-row.holiday .news-time { color: var(--accent); }
@container (max-width: 820px) {
  .cal-grid .news-mark { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--gold); font-size: 0; }
  .cal-grid .news-mark.holiday { background: var(--accent); }
}

.tag-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag-toggle { min-height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: none; font-size: 12.5px; cursor: pointer; }
.tag-toggle[aria-pressed=true] { background: #36202e; border-color: var(--neg); color: var(--neg); font-weight: 600; }

.drop { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; margin-bottom: 12px; padding: 10px 14px; border: 1px dashed var(--line2); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer; }
.drop:hover { border-color: var(--accent); color: var(--text); }
.shot-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.shot-preview img { max-width: 100%; max-height: 220px; border: 1px solid var(--line); border-radius: 8px; }
dialog.viewer { width: min(1200px, 96vw); }
.shot { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto 12px; }

.ranks { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rank { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--panel2); }
.rank.me { border-color: var(--accent); }
.rank .place { width: 22px; color: var(--muted); font-weight: 700; }
.rank.place-1 .place { color: var(--gold); }
.rank .avatar { flex: none; background: var(--line2); }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank > strong { white-space: nowrap; font-size: 16px; }

/* ---------- účet ---------- */
.account-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 21px; align-items: stretch; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 14px 24px; margin-top: 14px; }
.mini-cal h3::first-letter { text-transform: none; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.mini-grid .cell { min-height: 60px; padding: 6px 7px; }
.mini-grid .cell strong { font-size: 12.5px; }
.mini-grid .cell.selected { padding: 5px 6px; }
.chart-empty { min-height: 120px; display: flex; align-items: center; }

.diary { display: flex; flex-direction: column; gap: 20px; }
.diary-day { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; }
.diary-date { display: flex; flex-direction: column; padding-top: 12px; }
.diary-rows { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.diary-row { display: grid; grid-template-columns: 74px 84px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 61px; padding: 10px 16px; border-left: 3px solid var(--flat); border-radius: 10px; background: var(--panel2); }
.diary-row.pos { border-left-color: var(--pos); color: var(--text); }
.diary-row.neg { border-left-color: var(--neg); color: var(--text); }
.diary-row.payout { border-left-color: var(--gold); }
.row-time { color: var(--muted); }
.row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-note { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 12.5px; }
.row-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-amount { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; }
.row-actions .icon-btn + .icon-btn { margin-left: 0; }

/* ---------- grafy ---------- */
.chart { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); }
.chart .cross { stroke: var(--muted); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.accent { stroke: var(--accent); }
.chart .line.pos { stroke: var(--pos); }
.chart .line.neg { stroke: var(--neg); stroke-width: 1.6; }
.chart .line.dashed { stroke-dasharray: 5 5; stroke-width: 1.6; }
.chart .area { opacity: .15; }
.chart .area.accent { fill: var(--accent); }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .dot.accent { fill: var(--accent); }
.chart .bar.pos { fill: var(--pos); }
.chart .bar.neg { fill: var(--neg); }
.chart .hit { fill: transparent; }
.chart .mark-event { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart .mark-event-dot { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.chart .mark-event-text { fill: var(--gold); font-weight: 600; }
.chart rect.hit:hover { fill: rgb(255 255 255 / .03); }
.plot { width: 100%; min-width: 0; }
.tip { position: fixed; z-index: 40; padding: 7px 11px; pointer-events: none; background: var(--top); border: 1px solid var(--line2); border-radius: 9px; font-size: 12.5px; white-space: nowrap; box-shadow: 0 8px 24px rgb(0 0 0 / .45); }
.tip strong { display: block; }

.legend { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 11px; color: var(--muted); font-size: 13px; }
.legend.lines { margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.swatch.pos, .stack .pos { background: var(--pos); }
.swatch.neg, .stack .neg { background: var(--neg); }
.swatch.flat, .stack .flat { background: var(--flat); }
.swatch.none { background: var(--panel2); }
.key { display: inline-block; width: 15px; border-top: 2px solid var(--accent); }
.key.neg { border-color: var(--neg); }
.key.pos { border-color: var(--pos); }
.key.gold { border-color: var(--gold); }
.key.dashed { border-top-style: dashed; }

.stack { display: flex; gap: 2px; height: 12px; overflow: hidden; border-radius: 6px; }
.stack i { flex-basis: 0; min-width: 4px; }

.breakdown { display: flex; flex-direction: column; gap: 10px; }
.bline { border-radius: 5px; }
.bhead { display: flex; align-items: baseline; gap: 10px; }
.bhead .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bhead strong { white-space: nowrap; }
.bhead .meta { min-width: 74px; color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; }
.btrack { height: 6px; margin-top: 5px; border-radius: 3px; background: var(--panel2); }
.btrack i { display: block; height: 100%; min-width: 4px; border-radius: 3px; }
.btrack i.pos { background: var(--pos); }
.btrack i.neg { background: var(--neg); }
.combos { display: flex; flex-direction: column; gap: 14px; }
.combo .bhead { margin-top: 6px; }

.meter { --fill: var(--accent); min-width: 0; font-size: 13px; }
.meter.pos { --fill: var(--pos); }
.meter.neg { --fill: var(--neg); }
.meter-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.meter-value { color: var(--fill); white-space: nowrap; }
.meter-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--panel2); }
.meter-track i { display: block; height: 100%; border-radius: 4px; background: var(--fill); }

.payout-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 22px 32px; }
.payout-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.payout-item .meter-head { margin-bottom: 6px; }

.share { width: 230px; font-size: 12.5px; }
.share > div:first-child { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 3px; }
.share-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--panel2); }
.share-track i { display: block; height: 100%; background: var(--accent); }

.heat-wrap { min-width: 620px; }
.heat, .heat-months { display: grid; gap: 2px; }
.heat { grid-auto-flow: column; grid-template-rows: repeat(7, auto); }
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--panel2); }
.heat i.pos { background: var(--pos); cursor: pointer; }
.heat i.neg { background: var(--neg); cursor: pointer; }
.heat i.flat { background: var(--flat); cursor: pointer; }
.heat-months { margin-bottom: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.heat-months span { grid-row: 1; }
.heat-months span.end { justify-self: end; }

/* ---------- tabulky ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12.5px; font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
td .tags { max-width: 260px; }

/* ---------- okna a formuláře ---------- */
dialog { width: min(420px, 94vw); max-height: 92vh; padding: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 30px 80px rgb(0 0 0 / .5); }
dialog::backdrop { background: rgb(4 6 12 / .65); }
dialog[open] { display: flex; flex-direction: column; }
dialog form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 16px 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-body { min-height: 0; overflow-y: auto; padding: 20px 22px 6px; }
.dialog-foot { display: flex; align-items: center; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); }
dialog.drawer { width: min(522px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 14px 0 0 14px; border-width: 0 0 0 1px; }
.drawer .dialog-body { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; margin-bottom: 14px; }
.field > span:first-child { color: var(--muted); font-size: 13px; }
.cols { display: flex; gap: 13px; align-items: flex-start; }
.date-row > :nth-child(3) { flex: 0 0 150px; }
input:not([type=checkbox], [type=radio]), textarea, .field select, .sub select { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 9px; background: var(--bg); color: var(--text); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #5f6884; }
.field select { padding-right: 34px; }
fieldset { min-width: 0; margin: 0 0 16px; padding: 8px 15px 13px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
.sub { margin-top: 12px; }
.sub .field { margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; cursor: pointer; }
.thirds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 12px; }
input[type=checkbox], input[type=radio] { appearance: none; display: inline-grid; place-content: center; flex: none; width: 17px; height: 17px; margin: 0; border: 1px solid var(--line2); background: var(--bg); cursor: pointer; }
input[type=checkbox] { border-radius: 5px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type=radio]:checked { border-color: var(--accent); }
input[type=radio]:checked::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.toggles { display: flex; gap: 6px; }
.toggle { flex: 1; min-height: 40px; border: 1px solid var(--line2); border-radius: 9px; background: none; cursor: pointer; }
.toggle.long[aria-pressed=true] { background: #16322f; border-color: var(--pos); color: var(--pos); font-weight: 600; }
.toggle.short[aria-pressed=true] { background: #36202e; border-color: var(--neg); color: var(--neg); font-weight: 600; }
.checklist-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 2px; }
.checklist-row { display: flex; align-items: center; gap: 6px; border-radius: 9px; }
.checklist-row .icon-btn { width: 34px; height: 34px; flex: none; }

/* ---------- přihlášení ---------- */
.login { display: grid; grid-template-columns: minmax(0, 801fr) minmax(0, 699fr); min-height: 100vh; }
.login-side { display: flex; align-items: center; padding: 48px 66px; background: var(--top); border-right: 1px solid var(--line); }
.login-inner { width: min(542px, 100%); }
.login-inner h1 { max-width: 540px; margin: 40px 0 40px; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.1; letter-spacing: -.025em; }
.login-inner .logo { font-size: 23px; }
.login-inner .logo .mark { width: 38px; height: 38px; }
.login-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 42px; }
.login-grid i { aspect-ratio: 70 / 56; border-radius: 10px; background: var(--panel2); }
.login-grid i.g { background: var(--day-pos); }
.login-grid i.r { background: var(--day-neg); }
.login-inner p { max-width: 470px; margin: 0; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-box { width: min(396px, 100%); }
.login-box h2 { margin: 0 0 10px; font-size: 28px; }
.login-box p { margin-bottom: 18px; }
.btn.discord { width: 100%; min-height: 48px; margin-bottom: 18px; background: var(--discord); border-color: var(--discord); color: #fff; font-size: 15px; font-weight: 600; }

/* ---------- menší obrazovky ---------- */
@media (max-width: 1240px) {
  .page { padding: 24px 24px 48px; }
  .kpis.six { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-layout { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 1100px) {
  .top { flex-wrap: wrap; gap: 10px 20px; padding: 12px 24px; min-height: 0; }
  .top-actions { margin-left: auto; }
  .top nav { order: 3; flex-basis: 100%; }
  .account-layout, .split { grid-template-columns: minmax(0, 1fr); }
  .three, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .cal-layout, .two { grid-template-columns: minmax(0, 1fr); }
  .cal-grid, .cal-hint { display: none; }
  .week-list { display: flex; flex-direction: column; gap: 14px; }
  .week { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
  .week-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
  .week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .chip-day { display: flex; flex-direction: column; align-items: center; padding: 5px 0; border: 1px solid var(--line); border-radius: 9px; background: none; cursor: pointer; }
  .chip-day span { color: var(--muted); font-size: 11px; }
  .chip-day.win { background: var(--day-pos); border-color: var(--day-pos); }
  .chip-day.loss { background: var(--day-neg); border-color: var(--day-neg); }
  .chip-day.flat { background: var(--line2); }
  .chip-day.win span, .chip-day.loss span { color: var(--text); }
  .chip-day.selected { border: 2px solid var(--accent); }
  .chip-day.has-news strong::after { content: ""; display: block; width: 6px; height: 6px; margin: 2px auto 0; border-radius: 50%; background: var(--gold); }
  .week-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 9px 12px; border: 0; border-radius: 9px; background: var(--panel2); text-align: left; cursor: pointer; }
  .day-panel { display: none; }
  .day-panel.open { display: flex; position: fixed; inset: 0; z-index: 15; overflow-y: auto; border: 0; border-radius: 0; padding: 20px 16px 32px; }
  .day-panel.open > * { flex: none; }
  .close-day { display: inline-flex; }
  .diary-day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .diary-date { flex-direction: row; justify-content: space-between; padding: 0; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 32px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .page { padding: 18px 14px 40px; gap: 14px; }
  /* Lišta na mobilu: logo + pozice a avatar, pod tím oba filtry a navigace. */
  .top { gap: 10px 8px; padding: 10px 14px; }
  .brand { margin-right: auto; }
  .top-actions { display: contents; }
  .add-trade { order: 1; }
  .user-menu { order: 1; }
  .top .picker { order: 2; flex: 1 1 calc(50% - 4px); }
  .picker select { max-width: none; width: 100%; }
  .top nav { gap: 4px; }
  .top nav a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 12px; }
  .add-trade span { display: none; }
  h1 { font-size: 26px; }
  .panel, .account-card { padding: 16px 14px; }
  .kpis.five, .kpis.six, .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three, .card-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 12px 13px; }
  .kpi .value { font-size: 20px; }
  .headline { width: 100%; justify-content: space-between; text-align: left; }
  .headline strong { font-size: 18px; }
  .divider { display: none; }
  .mini-grid { gap: 3px; }
  .mini-grid .cell { min-height: 50px; padding: 4px; }
  .mini-grid .cell strong { font-size: 10px; }
  .diary-row { grid-template-columns: auto 1fr auto; gap: 6px 10px; padding: 10px 12px; }
  .row-main { grid-column: 1 / -1; grid-row: 2; }
  .row-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }
  .cols { flex-direction: column; align-items: stretch; gap: 0; }
  .cols > .field { flex: none; }
  dialog.drawer { border-radius: 0; }
  .date-row > :nth-child(3) { flex: none; }
  .thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
