/* SHO MODEL Journal — wspólny wygląd (szablon 11 „Połączony”). Kolory i fonty jak shoelite.club. */
:root {
  --bg: #06060e;
  --bg-up: #0a0c1b;
  --bg-up2: #0e1124;
  --panel-bg: #090b19;
  --line: rgba(170, 200, 240, .09);
  --line-2: rgba(170, 200, 240, .17);
  --ink: #e9eef8;
  --ink-2: #b7c1d6;
  --fog: #8892a8;
  --dim: #5d6579;
  --ice: #d8ecf8;
  --ice-2: #98c0ef;
  --sky: linear-gradient(180deg, #d8ecf8 0%, #98c0ef 100%);
  --sky-h: linear-gradient(90deg, #98c0ef 0%, #d8ecf8 100%);
  --vio: #674cf0;
  --vio-2: #8d6bff;
  --vio-wash: rgba(103, 76, 240, .14);
  --up: #4fd1a5;
  --down: #f2687d;
  --up-wash: rgba(79, 209, 165, .12);
  --down-wash: rgba(242, 104, 125, .1);
  --up-txt: #6fe0b9;
  --down-txt: #ff8b9c;
  --warn: #f2c46d;
  --band: rgba(103, 76, 240, .075);
  --band-strong: rgba(141, 107, 255, .14);
  /* szkło: karty i ekran wykresu */
  --glass: linear-gradient(180deg, rgba(24, 26, 54, .62) 0%, rgba(12, 13, 30, .62) 100%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 70px -38px rgba(0, 0, 0, .9);
  --f-disp: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --gut: 32px;
  --max: 1400px;
  --panel-w: 460px;
  --top-h: 64px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  /* nazwy z pierwszej wersji (widoki z nich korzystają) */
  --canvas: var(--bg);
  --raise: var(--bg-up);
  --text: var(--ink);
  --violet: var(--vio);
  --violet-hi: var(--vio-2);
  --violet-wash: var(--vio-wash);
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --tabbar: 64px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--vio-2); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--vio); color: #fff; }
[hidden] { display: none !important; }
.num { font-family: var(--f-disp); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.pos { color: var(--up); } .neg { color: var(--down); } .flat { color: var(--fog); }
.muted { color: var(--fog); } .dim { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 500; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.02; letter-spacing: -.035em; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
.lead { color: var(--fog); max-width: 66ch; }

/* ---------- tło: światło jak od ekranu z wykresem + drobne ziarno ---------- */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  background:
    radial-gradient(1100px 640px at 74% -12%, rgba(103, 76, 240, .30), transparent 64%),
    radial-gradient(760px 520px at -8% 6%, rgba(152, 192, 239, .10), transparent 62%),
    radial-gradient(1300px 760px at 46% 122%, rgba(76, 46, 210, .18), transparent 62%);
}
.glow::before {
  /* cienka linia horyzontu pod paskiem: światło rozlewa się z góry */
  content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(141, 107, 255, .55) 30%, rgba(216, 236, 248, .5) 62%, transparent);
}
.glow::after {
  content: ""; position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- szkielet ---------- */
.shell { position: relative; z-index: 1; min-height: 100vh; transition: margin-right .28s var(--ease); }
/* Pasek u góry: szkło przyklejone do krawędzi, pod nim przewija się strona. */
.top {
  position: sticky; top: 0; z-index: 50;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gut);
  height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.top::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw);
  background: linear-gradient(180deg, rgba(6, 6, 14, .86), rgba(6, 6, 14, .62));
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(170, 200, 240, .07); opacity: 0; transition: opacity .25s;
}
body.is-scrolled .top::before { opacity: 1; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none !important; flex: none; }
/* znak: krzywa kapitału w fioletowym kafelku */
.mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; position: relative;
  background: linear-gradient(145deg, #9a7bff 0%, #674cf0 55%, #3d2bb4 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -6px 12px rgba(20, 10, 80, .35), 0 8px 22px -6px rgba(103, 76, 240, .75);
}
.mark svg { width: 22px; height: 22px; overflow: visible; }
.wordmark {
  font: 600 20px/1 var(--f-disp); letter-spacing: -.045em;
  background: var(--sky); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-txt { display: grid; gap: 2px; }
.brand small { font-size: 11.5px; line-height: 1; color: var(--fog); letter-spacing: .01em; }
/* Menu: kapsuła z fioletową „lampką”, która przejeżdża pod aktywną zakładkę. */
.nav {
  position: relative; display: flex; gap: 2px; margin-left: auto; padding: 4px; border-radius: 14px;
  background: rgba(12, 14, 32, .55); border: 1px solid rgba(170, 200, 240, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.nav a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; height: 36px; padding: 0 15px; border-radius: 10px;
  color: var(--fog); text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; transition: color .2s;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; }
.nav-ind {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(141, 107, 255, .34), rgba(103, 76, 240, .18));
  box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 24px -6px rgba(103, 76, 240, .6);
  transition: transform .4s var(--ease), width .4s var(--ease), opacity .2s;
}
.nav-ind::after {
  content: ""; position: absolute; left: 26%; right: 26%; bottom: -5px; height: 2px; border-radius: 2px;
  background: #b9a6ff; box-shadow: 0 0 10px 2px rgba(141, 107, 255, .85), 0 0 24px 6px rgba(103, 76, 240, .45);
}
.nav-ind.on { opacity: 1; }
.nav-ind.still { transition: none; }
.who { position: relative; flex: none; }
.who-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 4px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(10, 12, 27, .6); color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.who-btn:hover { border-color: var(--line-2); color: var(--ink); }
.who-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #8d6bff, #674cf0); color: #fff; font: 600 13px/1 var(--f-disp);
}
.who-av img { width: 100%; height: 100%; object-fit: cover; }
.who-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 240px; padding: 6px;
  background: #0d1022; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  display: grid; gap: 2px;
}
.who-menu p { padding: 8px 10px 6px; font-size: 12.5px; color: var(--fog); line-height: 1.4; }
.who-menu p b { display: block; color: var(--ink); font: 500 14px/1.3 var(--f-disp); }
.who-menu button, .who-menu a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font-size: 14px; text-align: left; text-decoration: none !important;
}
.who-menu button:hover, .who-menu a:hover { background: rgba(170, 200, 240, .06); color: var(--ink); }
.who-menu svg { width: 18px; height: 18px; color: var(--fog); }
.who-menu hr { border: 0; height: 1px; background: var(--line); margin: 4px 6px; }

.main { min-width: 0; }
.page { max-width: var(--max); margin: 0 auto; padding: 18px var(--gut) 120px; }

/* Nagłówek ekranu: duży tytuł z lodowym gradientem, opis, po prawej sterowanie. */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap;
  margin-bottom: 28px; padding-bottom: 20px;
  background: linear-gradient(90deg, rgba(141, 107, 255, .55), rgba(170, 200, 240, .1) 38%, rgba(170, 200, 240, .05) 100%) left bottom / 100% 1px no-repeat;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 {
  font-size: clamp(34px, 4vw, 54px); font-weight: 600; letter-spacing: -.045em;
  background: linear-gradient(180deg, #fff 10%, #d8ecf8 52%, #a796ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: .06em; filter: drop-shadow(0 8px 30px rgba(103, 76, 240, .35));
}
.page-head .lead { margin-top: 8px; font-size: 14.5px; }
.page-head > :last-child:not(:first-child) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-kick { font-size: 13px; color: var(--vio-2); font-weight: 500; margin-bottom: 4px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { font-size: 20px; }
.sec-head p { color: var(--fog); font-size: 13.5px; }

/* ---------- przycisk dodawania (wszędzie) ---------- */
.fab {
  position: fixed; right: 32px; bottom: 32px; z-index: 60; height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 10px; color: #fff; font: 500 15px/1 var(--f-disp); letter-spacing: -.01em;
  background: linear-gradient(135deg, #9a7bff, #674cf0 60%, #5338d8);
  box-shadow: 0 16px 40px -8px rgba(103, 76, 240, .75), 0 0 0 1px rgba(170, 150, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: opacity .2s, transform .2s var(--ease), filter .15s;
}
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: scale(.97); }
.fab svg { width: 22px; height: 22px; }
body.lp-on .fab { opacity: 0; pointer-events: none; }

/* ---------- dolny pasek (telefon) ---------- */
.tabbar { display: none; }

/* ---------- kontrolki ---------- */
.chip-btn {
  min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02);
  color: var(--ink-2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; text-decoration: none !important;
}
.chip-btn:hover { border-color: rgba(141, 107, 255, .5); color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: linear-gradient(180deg, rgba(141, 107, 255, .3), rgba(103, 76, 240, .13)); box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 22px -10px rgba(103, 76, 240, .85); border-color: transparent; color: #fff; }
.chip-btn.is-warn[aria-pressed="true"] { background: var(--down-wash); border-color: rgba(242, 104, 125, .5); }
.chip-btn:disabled { opacity: .45; cursor: default; }
.chip-btn svg { width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .025); color: var(--ink-2);
  font: 500 14.5px/1 var(--f-disp); letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, filter .15s, transform .1s; text-decoration: none !important;
}
.btn:hover { background: rgba(170, 200, 240, .05); color: var(--ink); border-color: rgba(170, 200, 240, .28); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, #9a7bff, #674cf0 60%, #5338d8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 26px -10px rgba(103, 76, 240, .95); }
.btn-primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, #9a7bff, #674cf0 60%, #5338d8); color: #fff; }
.btn-ice { background: var(--sky); border: 0; color: #0a1020; }
.btn-ice:hover { filter: brightness(1.05); background: var(--sky); color: #0a1020; }
.btn-danger { color: var(--down); border-color: rgba(242, 104, 125, .35); }
.btn-danger:hover { background: var(--down-wash); color: var(--down-txt); border-color: rgba(242, 104, 125, .55); }
.btn-ghost { border-color: transparent; color: var(--fog); }
.btn-ghost:hover { color: var(--ink); background: rgba(170, 200, 240, .05); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 10px; border: 0; background: transparent; color: var(--fog);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:hover { background: rgba(170, 200, 240, .06); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 13px; color: var(--fog); font-weight: 500; }
.field small { font-size: 12px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--bg-up); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input.num { font: 500 16px/1 var(--f-disp); font-variant-numeric: tabular-nums; }
.textarea { min-height: 88px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--vio-2); box-shadow: 0 0 0 3px rgba(141, 107, 255, .25); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input[aria-invalid="true"] { border-color: rgba(242, 104, 125, .7); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; color: var(--ink-2); font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238892a8' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.select option { background: #0a0c1b; }
input[type="datetime-local"].input { font: 400 15px/1 var(--f-body); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* segment (Long / Short, zakresy dat) */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(12, 14, 32, .6); border: 1px solid rgba(170, 200, 240, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--fog);
  font-weight: 500; font-size: 14px; cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, rgba(141, 107, 255, .3), rgba(103, 76, 240, .13)); box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 22px -10px rgba(103, 76, 240, .85); color: #fff; }
.seg button:disabled { opacity: .4; cursor: default; }
.seg.big { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg.big button { min-height: 44px; font: 500 15.5px/1.1 var(--f-disp); }
.seg button.is-long[aria-pressed="true"] { background: var(--up-wash); color: var(--up); box-shadow: inset 0 0 0 1px rgba(79, 209, 165, .55); }
.seg button.is-short[aria-pressed="true"] { background: var(--down-wash); color: var(--down); box-shadow: inset 0 0 0 1px rgba(242, 104, 125, .55); }

/* duże zakładki z podpisem (jak nad krzywą) */
.tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid rgba(170, 200, 240, .08); border-radius: 16px; background: rgba(12, 14, 32, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.tab {
  min-height: 52px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; text-align: left;
  display: grid; gap: 1px; min-width: 120px; color: var(--fog);
}
.tab b { font: 500 14.5px/1.2 var(--f-disp); color: var(--ink-2); letter-spacing: -.01em; }
.tab span { font-size: 12.5px; line-height: 1.25; }
.tab span.danger { color: var(--down); font-weight: 500; }
.tab:hover b { color: var(--ink); }
.tab { transition: background .2s, box-shadow .2s; }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { background: linear-gradient(180deg, rgba(141, 107, 255, .3), rgba(103, 76, 240, .13)); box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 22px -10px rgba(103, 76, 240, .85); }
.tab[aria-selected="true"] b, .tab[aria-pressed="true"] b { color: var(--ink); }

/* chip (checklista, błędy, filtry) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--bg-up); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--ink); border-color: rgba(170, 200, 240, .28); }
.chip[aria-pressed="true"] { background: linear-gradient(180deg, rgba(141, 107, 255, .26), rgba(103, 76, 240, .12)); box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.chip.must::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--vio-2); }
.chip.bad[aria-pressed="true"] { background: var(--down-wash); border-color: rgba(242, 104, 125, .6); }

/* pigułka statusu */
.tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 2px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 500; line-height: 1.2; background: rgba(170, 200, 240, .07); color: var(--fog); white-space: nowrap;
}
.tag.model { background: transparent; color: var(--vio-2); box-shadow: inset 0 0 0 1px rgba(141, 107, 255, .5); }
.tag.off { background: transparent; color: var(--down); box-shadow: inset 0 0 0 1px rgba(242, 104, 125, .45); }
.tag.open { background: rgba(242, 196, 109, .1); color: var(--warn); }
.tag.long { color: var(--up); background: var(--up-wash); }
.tag.short { color: var(--down); background: var(--down-wash); }
.side { font-weight: 600; font-family: var(--f-disp); letter-spacing: 0; }
.side.long { color: var(--up); } .side.short { color: var(--down); }

/* panel: tylko tam, gdzie grupowanie pomaga */
.panel {
  position: relative; border-radius: 18px; padding: 20px; min-width: 0;
  background: var(--glass); border: 1px solid rgba(170, 200, 240, .08);
  box-shadow: var(--glass-shadow);
}
/* Szkło: jaśniejsza górna krawędź i światło, które idzie za kursorem po obwódce (app.js ustawia --mx/--my). */
.panel::after, .spot::after, .page-trady .ty-list::after, .page-statystyki .st-six::after, .page-statystyki .st-sec::after,
.page-konta .ko-acc::after, .page-plan .pn-seq::after, .page-plan .pn-start::after, .page-trade .td-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(170, 150, 255, .75), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.spot { position: relative; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { font-size: 16px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* lista wierszy */
.rows { display: grid; }
.row { display: grid; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: linear-gradient(90deg, rgba(141, 107, 255, .1), transparent 80%); }

/* wiersz trade'u (pulpit, kalendarz, listy) */
.tr {
  width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  min-height: 60px; padding: 10px 10px 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  text-align: left; border-radius: 0; color: inherit; text-decoration: none !important;
}
.tr:hover, .tr.is-active { background: linear-gradient(90deg, rgba(141, 107, 255, .1), transparent 80%); }
.tr-t { display: block; color: var(--ink); font-weight: 500; }
.tr-t .z { color: var(--fog); font-weight: 400; }
.tr-s { display: block; color: var(--fog); font-size: 13px; margin-top: 1px; }
.tr-s .in { color: var(--vio-2); } .tr-s .out { color: var(--down); }
.tr-t > span, .tr-s > span { white-space: nowrap; }
.tr-r { text-align: right; font: 500 18px/1.15 var(--f-disp); font-variant-numeric: tabular-nums; }
.tr-r small { display: block; font-size: 13px; color: var(--fog); font-weight: 400; }
.tr-r.open { font-size: 14px; color: var(--ice-2); }

/* pusty stan */
.empty { display: grid; justify-items: start; gap: 10px; padding: 28px; border: 1px dashed var(--line-2); border-radius: 16px; color: var(--fog); }
.empty h3 { color: var(--ink); }
.empty-note { padding: 24px 0; color: var(--fog); }

/* ---------- panel boczny (dodawanie, szczegóły) — jak panel z szablonu ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(3, 4, 10, .62); opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100vw); display: flex; flex-direction: column;
  background: var(--panel-bg); border-left: 1px solid rgba(141, 107, 255, .26); box-shadow: -30px 0 60px rgba(0, 0, 0, .4), -1px 0 24px -8px rgba(103, 76, 240, .5);
  transform: translateX(100%); transition: transform .3s var(--ease);
}
.sheet.on { transform: none; }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 20px; }
.sheet-head p { color: var(--fog); font-size: 12.5px; margin-top: 1px; }
.sheet-head .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 28px; display: grid; gap: 22px; align-content: start; }
.sheet-foot { display: flex; align-items: center; gap: 10px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel-bg); }
/* Na szerokim ekranie panel trade'u staje obok strony: krzywa zostaje widoczna i pokazuje nowy punkt. */
@media (min-width: 1180px) {
  body.lp-on .shell { margin-right: var(--panel-w); }
  .sheet.is-dock { box-shadow: -40px 0 90px -50px rgba(103, 76, 240, .6), -1px 0 24px -8px rgba(103, 76, 240, .45); }
  .scrim.is-dock { display: none; }
}
@media (max-width: 860px) {
  .sheet { top: auto; left: 0; width: 100%; max-height: 94vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .sheet-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .sheet-head { padding-left: 16px; }
  .sheet-body { padding: 16px 16px 28px; }
  .sheet-foot { padding-left: 16px; padding-right: 16px; }
}

/* modal (potwierdzenia) */
.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%; width: min(420px, calc(100vw - 32px)); transform: translate(-50%, -48%); opacity: 0;
  background: #0d1022; border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; display: grid; gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); transition: opacity .18s, transform .18s var(--ease);
}
.modal.on { opacity: 1; transform: translate(-50%, -50%); }
.modal h3 { font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* toast */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: 100px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; padding: 12px 18px; border-radius: 12px; background: #151933; border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink);
  animation: toast-in .22s var(--ease);
}
.toast.err { border-color: rgba(242, 104, 125, .55); }
.toast button { border: 0; background: none; color: var(--vio-2); font-weight: 600; cursor: pointer; padding: 6px 0; min-height: 32px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* wykresy SVG z charts.js */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 500 11.5px var(--f-disp); fill: #737c93; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: rgba(170, 200, 240, .07); }
.chart-tip {
  position: fixed; z-index: 90; pointer-events: none; padding: 9px 12px; border-radius: 12px;
  background: rgba(11, 13, 28, .96); border: 1px solid rgba(141, 107, 255, .32); font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}

.skeleton { border-radius: 12px; background: linear-gradient(90deg, rgba(170, 200, 240, .04), rgba(170, 200, 240, .08), rgba(170, 200, 240, .04)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.boot { max-width: var(--max); margin: 80px auto; padding: 0 var(--gut); color: var(--fog); }

/* ---------- wejście: logowanie, brak dostępu ---------- */
.gate { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 48px; max-width: 1240px; margin: 0 auto; padding: 48px var(--gut); }
.gate-copy { display: grid; gap: 22px; justify-items: start; max-width: 480px; }
.gate-brand { display: grid; justify-items: start; }
.gate-brand .mark { width: 46px; height: 46px; border-radius: 13px; margin-bottom: 22px; }
.gate-brand .mark svg { width: 28px; height: 28px; }
.gate .wordmark {
  font-size: clamp(48px, 6vw, 76px); letter-spacing: -.05em; line-height: .95; padding-bottom: .06em;
  background: linear-gradient(180deg, #fff 10%, #d8ecf8 52%, #a796ff 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 10px 34px rgba(103, 76, 240, .4));
}
.gate-sub { font: 500 22px/1 var(--f-disp); color: var(--fog); letter-spacing: -.02em; margin-top: 6px; }
.gate h1 { font-size: 26px; background: none; color: var(--ink); }
.gate .lead { font-size: 15.5px; color: var(--ink-2); }
.gate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--fog); font-size: 14.5px; }
.gate-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.gate-list li::before { content: ""; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; border: 1.6px solid var(--vio-2); box-shadow: inset 0 0 0 2.5px var(--bg), inset 0 0 0 6px var(--up); }
.gate-actions { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.btn-discord { min-height: 52px; padding: 0 22px; border: 0; background: #5865f2; color: #fff; font-size: 15.5px; box-shadow: 0 14px 34px rgba(88, 101, 242, .35); }
.btn-discord:hover { background: #6a76f5; color: #fff; filter: none; }
.btn-discord svg { width: 22px; height: 22px; }
.gate-small { font-size: 12.5px; color: var(--dim); max-width: 46ch; }
.gate-reason { padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(242, 104, 125, .4); background: var(--down-wash); color: var(--ink); font-size: 14.5px; line-height: 1.45; width: 100%; }
/* Ekran z krzywą: to samo szkło, siatka kropek i światło co wykres na pulpicie. */
.gate-art {
  position: relative; min-width: 0; padding: 24px 26px 20px; border-radius: 24px;
  border: 1px solid rgba(170, 200, 240, .08);
  background:
    radial-gradient(55% 75% at 78% 30%, rgba(103, 76, 240, .22), transparent 70%),
    radial-gradient(40% 60% at 12% 90%, rgba(152, 192, 239, .06), transparent 70%),
    linear-gradient(180deg, rgba(18, 20, 44, .74), rgba(8, 9, 22, .68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 50px 90px -50px rgba(0, 0, 0, .95), 0 0 90px -40px rgba(103, 76, 240, .5);
}
.gate-art::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(rgba(190, 205, 255, .16) 1px, transparent 1.3px); background-size: 24px 24px; background-position: 12px 12px;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 60% 50%, #000 25%, transparent 88%);
  mask-image: radial-gradient(ellipse 80% 75% at 60% 50%, #000 25%, transparent 88%);
}
.gate-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.gate-k { font: 600 15px/1.2 var(--f-disp); color: var(--ink); letter-spacing: -.01em; }
.gate-n { margin-top: 5px; font-size: 12.5px; color: var(--fog); }
.gate-total {
  font: 600 clamp(38px, 3.8vw, 54px)/1 var(--f-disp); letter-spacing: -.05em; font-variant-numeric: tabular-nums; padding-bottom: .05em;
  background: linear-gradient(180deg, #fff 0%, #e3f1fb 45%, #a593ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(103, 76, 240, .5));
}
.gate-plot { position: relative; aspect-ratio: 600 / 360; margin-top: 12px; }
.gate-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gate-legend { position: relative; display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--fog); }
.gate-legend span { display: inline-flex; align-items: center; gap: 8px; }
.gate-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vio-2); box-shadow: 0 0 10px rgba(141, 107, 255, .8); }
.gate-legend .out::before { width: 6px; height: 6px; background: var(--bg); border: 1.8px solid var(--down); box-shadow: none; }
.gate-legend b { color: var(--down-txt); font: 600 12.5px var(--f-disp); }
.gate-t { font: 500 12px var(--f-body); fill: #8892a8; }
.gate-t-down { fill: #f2687d; }
/* Jedno wejście: krzywa się rysuje, kropki wskakują, na końcu zapala się światło przy ostatnim punkcie. */
.gate-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: gate-draw 1.8s var(--ease) .2s forwards; }
.gate-area { opacity: 0; animation: gate-fade .8s ease 1.4s forwards; }
.gate-dots circle { opacity: 0; transform-box: fill-box; transform-origin: center; animation: gate-pop .35s var(--ease) forwards; }
.gate-pulse { transform-box: fill-box; transform-origin: center; opacity: 0; animation: gate-pulse 2.4s ease-out 2.2s infinite; }
.gate-light { opacity: 0; animation: gate-fade .6s ease 1.8s forwards; }
@keyframes gate-draw { to { stroke-dashoffset: 0; } }
@keyframes gate-fade { to { opacity: 1; } }
@keyframes gate-pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes gate-pulse { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }

/* ---------- mniejsze ekrany ---------- */
@media (max-width: 1180px) {
  .nav a { padding: 0 11px; }
  .who-name { display: none; }
  .who-btn { padding: 0 4px; }
}
@media (max-width: 900px) {
  :root { --gut: 16px; }
  .nav { display: none; }
  .top { height: 60px; }
  .page { padding-top: 6px; padding-bottom: 110px; }
  .page-head { margin-bottom: 20px; padding-bottom: 16px; align-items: flex-start; }
  .page-head > :last-child:not(:first-child) { width: 100%; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 78px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(7, 8, 18, .92); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; padding: 6px 0; min-height: 48px; color: var(--dim); text-decoration: none !important; font-size: 11px; font-weight: 500; border-radius: 10px; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { color: var(--vio-2); }
  /* Na telefonie „+” siedzi w pasku na dole. */
  .fab { z-index: 66; right: 12px; bottom: calc(9px + env(safe-area-inset-bottom)); width: 58px; height: 58px; padding: 0; justify-content: center; }
  .fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fab svg { width: 26px; height: 26px; }
  .toasts { bottom: 96px; }
  .tabs { gap: 4px; }
  .tab { flex: 1 1 auto; min-width: 0; padding: 8px 9px; }
  .tab b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tab span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gate { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; align-content: start; }
  .gate-copy { max-width: none; }
  .gate-art { padding: 18px 16px 14px; border-radius: 20px; }
  .gate-brand .mark { width: 40px; height: 40px; margin-bottom: 18px; }
}
@media (max-width: 420px) {
  .tabs { gap: 2px; padding: 3px; }
  .tab { padding: 8px 7px; }
  .tab b { font-size: 12.5px; }
  .tab span { font-size: 11px; text-overflow: clip; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
