/* Design system zgodny z TakeCar: czerwony brand, Roboto, ciemny sidebar z czerwonym akcentem,
   ciemne naglowki tabel/dialogow. Dwa motywy: CIEMNY (domyslny) + JASNY (data-theme="light").
   JetBrains Mono tylko dla hex viewera. */
:root {
  /* ---- MOTORSPORT HEAT (ciemny, domyslny): grafit + sygnaturowy gradient czerwien->pomarancz ---- */
  --bg: #0E1116; --panel: #161A21; --panel2: #1C212B; --panel3: #2A313E;
  --border: rgba(255,255,255,.11); --border-soft: rgba(255,255,255,.06);
  --text: #F1F4F9; --text2: #C4CCD8; --muted: #8C97A7;
  --accent: #F5443B; --accent-light: #FF7A5A; --accent-dark: #C21A12;
  --accent2: #FF8A1E; /* pomaranczowy hot-end */
  --grad-heat: linear-gradient(118deg, #F5443B 0%, #FF5A2C 52%, #FF9A1E 100%);
  --grad-heat-soft: linear-gradient(118deg, rgba(245,68,59,.20), rgba(255,138,30,.12));
  --glow-accent: 0 8px 26px rgba(245,68,59,.30);
  --header-dark: #12151C;
  --code-bg: #0A0D12; --code-border: #1C212B;
  --input-bg: #10141A; --input-border: rgba(255,255,255,.16);
  /* statusy: tlo (alpha) + tekst */
  --ok-text: #6DD68A; --warn-text: #FFB74D; --err-text: #FF8A80; --info-text: #64B5F6;
  --ok-bg: rgba(76,175,80,.16); --warn-bg: rgba(255,152,0,.16);
  --err-bg: rgba(244,67,54,.16); --info-bg: rgba(33,150,243,.16);
  --accent-bg: rgba(245,68,59,.15);
  /* kafelki ikon */
  --tile-accent: rgba(245,68,59,.18); --tile-emis: rgba(255,152,0,.18);
  --tile-dtc: rgba(244,67,54,.18); --tile-other: rgba(255,255,255,.08);
  --shadow-card: 0 2px 10px rgba(0,0,0,.40); --shadow-pop: 0 18px 50px rgba(0,0,0,.60);
  /* sidebar (staly, ciemny w obu motywach) */
  --sidebar-bg: #12161C; --sidebar-text: #E2E8F0; --sidebar-muted: rgba(255,255,255,.48);
  --sidebar-divider: rgba(255,255,255,.07); --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(245,68,59,.20);
  --radius: 9px; --radius-card: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", "Roboto", "Helvetica", Arial, system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", "Roboto", system-ui, sans-serif;
}
:root[data-theme="light"] {
  /* ---- MOTYW JASNY, paleta TakeCar light ---- */
  --bg: #FAFAFA; --panel: #FFFFFF; --panel2: #F4F6F8; --panel3: #ECEFF1;
  --border: rgba(0,0,0,.10); --border-soft: rgba(0,0,0,.06);
  --text: #263238; --text2: #37474F; --muted: #607D8B;
  --accent: #D32F2F; --accent-light: #EF5350; --accent-dark: #9A0007;
  --accent2: #F57C00;
  --grad-heat: linear-gradient(118deg, #D32F2F 0%, #F4511E 55%, #F57C00 100%);
  --grad-heat-soft: linear-gradient(118deg, rgba(211,47,47,.10), rgba(245,124,0,.08));
  --glow-accent: 0 8px 22px rgba(211,47,47,.22);
  --header-dark: #263238;
  --code-bg: #0F172A; --code-border: #1E293B;
  --input-bg: #FFFFFF; --input-border: rgba(0,0,0,.18);
  --ok-text: #2E7D32; --warn-text: #E65100; --err-text: #C62828; --info-text: #1565C0;
  --ok-bg: #e8f5e9; --warn-bg: #fff3e0; --err-bg: #ffebee; --info-bg: #e3f2fd;
  --accent-bg: #fff5f5;
  --tile-accent: #ffebee; --tile-emis: #fff3e0; --tile-dtc: #ffebee; --tile-other: #ECEFF1;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06); --shadow-pop: 0 20px 60px rgba(38,50,56,.16);
  --sidebar-active: rgba(198,40,40,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere; word-break: normal;
}
/* subtelna "gorąca" poświata tła — energia bez rozpraszania */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(680px 340px at 82% -6%, rgba(255,138,30,.10), transparent 70%),
    radial-gradient(720px 380px at 10% 108%, rgba(245,68,59,.10), transparent 70%); }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { filter: brightness(1.12); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* --- GLOBALNY fix: nic nie wyjezdza poza boxy --- */
.row > *, .grid > *, .card, .stat, .plan, .sol-tile, .ts-sol, .meta-list dd,
.badge, .pill, .banner, td, th, .toast, .modal { min-width: 0; }
.badge, .pill, .cat-pill { overflow-wrap: anywhere; }
.muted { color: var(--muted); } .amber { color: var(--warn-text); }
.green { color: var(--ok-text); } .red { color: var(--err-text); }

/* layout - czerwony pasek brandu na gorze */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; position: relative; }
.app::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent2), var(--accent), var(--accent-dark));
  background-size: 220% 100%; animation: gradShift 3.4s linear infinite;
  box-shadow: 0 0 14px rgba(245,68,59,.5); }
.sidebar {
  background:
    radial-gradient(320px 240px at 26% -2%, rgba(245,68,59,.14), transparent 70%),
    linear-gradient(180deg, var(--sidebar-bg), #0d1014);
  color: var(--sidebar-text); border-right: 1px solid var(--sidebar-divider);
  padding: 14px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 6px 6px 14px;
  border-bottom: 1px solid var(--sidebar-divider); }
.brand .logo {
  width: 44px; height: 44px; border-radius: 12px; position: relative;
  padding: 3px; border: 1.5px solid transparent;
  background:
    radial-gradient(circle at 50% 35%, #1b2130, #0d1016) padding-box,
    var(--grad-heat) border-box;
  display: grid; place-items: center;
  box-shadow: var(--glow-accent);
}
.brand .logo::before { display: none; }
.brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand b { font-family: var(--display); font-size: 17px; letter-spacing: .3px; color: #fff; }
.brand small { display: block; color: var(--sidebar-muted); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .09em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); font-weight: 500; cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent; transition: background .14s, color .14s;
}
.nav a .ic-wrap { display: inline-flex; color: var(--ic-color, var(--sidebar-muted)); transition: color .14s; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: linear-gradient(90deg, var(--sidebar-active), transparent); color: #fff;
  border-left-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(245,68,59,.14), -3px 0 14px rgba(245,68,59,.28); }
.nav a.active .ic-wrap { color: var(--accent-light); filter: drop-shadow(0 0 6px rgba(245,68,59,.55)); }
.nav .sep { height: 1px; background: var(--sidebar-divider); margin: 12px 4px; }
.nav .grp { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted);
  padding: 6px 12px; margin-top: 12px; }

.main { padding: 28px 36px; max-width: 1500px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 27px; margin: 0; font-weight: 700; color: var(--text); line-height: 1.15; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

/* cards & panels */
.card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  padding: 20px; box-shadow: var(--shadow-card); transition: transform .16s, box-shadow .16s, border-color .16s; }
.card.hoverable:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: var(--shadow-pop); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text); padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-size: 14px; font-family: var(--sans);
  transition: background .14s, border-color .14s, transform .1s, box-shadow .14s;
}
.btn:hover { background: var(--panel3); border-color: var(--input-border); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-heat); border: none; color: #fff; font-weight: 700;
  box-shadow: var(--glow-accent); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px rgba(245,68,59,.42); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }

input, select, textarea {
  background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text);
  padding: 11px 13px; border-radius: var(--radius); font-family: var(--sans); font-size: 15px; width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input::placeholder, textarea::placeholder { color: var(--muted); }
option { background: var(--panel); color: var(--text); }
label { font-size: 12.5px; color: var(--text2); display: block; margin-bottom: 6px; font-weight: 600; }
.field { margin-bottom: 14px; }

/* badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 16px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: var(--panel2); color: var(--text2);
  letter-spacing: .01em; }
.badge.EMISSIONS { color: var(--warn-text); border-color: rgba(255,152,0,.4); background: var(--warn-bg); }
.badge.PERFORMANCE { color: var(--accent); border-color: rgba(239,83,80,.4); background: var(--accent-bg); }
.badge.DTC { color: var(--err-text); border-color: rgba(244,67,54,.4); background: var(--err-bg); }
.badge.LIMITER, .badge.GEARBOX, .badge.OTHER { color: var(--muted); }
.badge.ok { color: var(--ok-text); border-color: rgba(76,175,80,.4); background: var(--ok-bg); }
.badge.warn { color: var(--warn-text); border-color: rgba(255,152,0,.4); background: var(--warn-bg); }

/* dropzone */
.dropzone {
  border: 2px dashed var(--input-border); border-radius: var(--radius-card); padding: 48px;
  text-align: center; cursor: pointer; transition: .15s; background: var(--panel);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.dropzone .big { font-size: 16px; font-weight: 600; margin: 12px 0 4px; color: var(--text); }

/* table - ciemny naglowek */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; background: var(--header-dark); color: #fff; font-weight: 600; font-size: 12.5px;
  padding: 12px 13px; text-transform: uppercase; letter-spacing: .04em; }
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
td { padding: 11px 13px; border-bottom: 1px solid var(--border-soft); }
tbody tr:nth-child(even) td { background: rgba(127,127,127,.035); }
tbody tr:hover td { background: var(--accent-bg); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.clickable { cursor: pointer; }

/* meta list */
.meta-list { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }

/* editor layout */
.editor { display: grid; grid-template-columns: 300px 1fr 280px; gap: 16px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { background: none; border: none; color: var(--muted); padding: 9px 14px; cursor: pointer;
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; font-family: var(--sans); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* hex viewer - zawsze ciemny (code/hex) */
.hex {
  font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--code-bg);
  border: 1px solid var(--code-border); border-radius: var(--radius); padding: 10px; overflow-x: auto;
  white-space: pre; max-height: 560px; overflow-y: auto; color: #CBD5E1;
}
.hex .off { color: #64748B; } .hex .chg { color: #FFB74D; font-weight: 700; } .hex .asc { color: #64748B; }
.hex .hit { background: rgba(239,83,80,.4); border-radius: 2px; }

/* solution tile */
.sol-tile { border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 14px; background: var(--panel);
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-card); }
.sol-tile h4 { margin: 0; font-size: 14px; color: var(--text); }
.sol-tile .price { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.sol-tile .desc { color: var(--muted); font-size: 12px; flex: 1; }

/* region list */
.regions { max-height: 480px; overflow-y: auto; }
.region { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-family: var(--mono); font-size: 12px; }
.region:hover { background: var(--panel2); }
.region .sz { color: var(--muted); }

/* toast */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  padding: 12px 16px; border-radius: var(--radius); min-width: 260px; box-shadow: var(--shadow-pop);
  animation: slidein .2s; font-size: 13px; color: var(--text); }
.toast.ok { border-left-color: var(--ok-text); } .toast.err { border-left-color: var(--err-text); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* modal - ciemny naglowek */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 90; }
.modal { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 0 24px 24px;
  width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-pop); }
.modal h3 { margin: 0 -24px 18px; padding: 16px 24px; background: var(--header-dark); color: #fff; font-weight: 600;
  border-radius: var(--radius-card) var(--radius-card) 0 0; position: sticky; top: 0; z-index: 1; }
.modal h3 .ic { color: #fff; }

.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(245,68,59,.18);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
  box-shadow: 0 0 8px rgba(245,68,59,.32); }
@keyframes spin { to { transform: rotate(360deg); } }
/* duzy loader widoku - futurystyczny podwojny pierscien + rdzen */
.loader { display: grid; place-items: center; padding: 60px 20px; }
.loader .ring { width: 52px; height: 52px; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, transparent, var(--accent), var(--accent2), transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spinSlow 1s linear infinite; filter: drop-shadow(0 0 8px rgba(245,68,59,.5)); }
.loader .ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.08); border-bottom-color: var(--accent2);
  animation: spin 1.4s linear infinite reverse; }
.loader .txt { margin-top: 16px; color: var(--muted); font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; animation: livePulse 1.6s ease-in-out infinite; }
.skeleton { background: linear-gradient(90deg, var(--panel2) 25%, rgba(245,68,59,.10) 50%, var(--panel2) 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
/* przejscie miedzy widokami - naglowek wjezdza za kazdym renderem */
.page-head { animation: riseIn .42s cubic-bezier(.2,.8,.2,1) both; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
code { font-family: var(--mono); background: var(--panel3); padding: 1px 5px; border-radius: 4px; font-size: 12px; color: var(--text2); }

/* ---- ikony / kafelki */
.ic { vertical-align: -2px; flex-shrink: 0; }
.sol-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--tile-accent); color: var(--accent); flex-shrink: 0; }
.sol-ic.EMISSIONS { background: var(--tile-emis); color: var(--warn-text); }
.sol-ic.DTC { background: var(--tile-dtc); color: var(--err-text); }
.sol-ic.PERFORMANCE { background: var(--tile-accent); color: var(--accent); }
.sol-ic.OTHER, .sol-ic.LIMITER, .sol-ic.GEARBOX { background: var(--tile-other); color: var(--muted); }

/* ---- user card (sidebar, waskie 240px: avatar+nazwa w rzedzie, akcje osobno) */
.usercard { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.usercard .u { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--sidebar-divider);
  border-radius: 10px; background: rgba(255,255,255,.04); min-width: 0; }
.usercard .av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg,var(--accent-light),var(--accent-dark));
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.usercard .u-id { flex: 1; min-width: 0; }
.usercard .u-id b { font-size: 13px; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .u-id small { color: var(--sidebar-muted); font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .credits { font-family: var(--mono); color: var(--ok-text); font-size: 12.5px;
  display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--sidebar-divider); border-radius: 8px; }
.usercard .credits b { margin-left: auto; color: #fff; font-size: 13.5px; }
.usercard .u-actions { display: flex; gap: 8px; }
.usercard .u-actions .btn { flex: 1; justify-content: center; color: var(--sidebar-text);
  border-color: var(--sidebar-divider); background: rgba(255,255,255,.03); padding: 8px; }
.usercard .u-actions .btn:hover { background: var(--sidebar-hover); color: #fff; }

/* ---- login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  position: relative; overflow: hidden; border-top: 3px solid var(--accent);
  background:
    radial-gradient(1200px 680px at 82% -16%, rgba(255,138,30,.30), transparent 60%),
    radial-gradient(1080px 660px at 4% 118%, rgba(245,68,59,.28), transparent 60%),
    radial-gradient(760px 760px at 50% 42%, rgba(255,90,44,.10), transparent 70%),
    linear-gradient(162deg, #0B0E13 0%, #12161F 46%, #090C11 100%); }
/* perspektywiczna siatka (futuristic floor) */
.login-screen::before { content: ""; position: absolute; left: 50%; bottom: -12%; width: 220%; height: 78%;
  transform: translateX(-50%) perspective(560px) rotateX(67deg); transform-origin: bottom center;
  z-index: 0; pointer-events: none; opacity: .55;
  background-image:
    linear-gradient(rgba(245,68,59,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,138,30,.13) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 72%);
  mask-image: linear-gradient(to top, #000 0%, transparent 72%); }
/* winieta dla premium-owej głębi */
.login-screen::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(125% 95% at 50% 34%, transparent 52%, rgba(0,0,0,.60) 100%); }
.login-stage { position: relative; display: grid; place-items: center; }
/* rotująca aureola heat za kartą */
.login-aura { position: absolute; z-index: 0; width: 560px; height: 560px; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; opacity: .5;
  background: conic-gradient(from 0deg, rgba(245,68,59,0), rgba(245,68,59,.42), rgba(255,138,30,.42), rgba(245,68,59,0));
  filter: blur(62px); animation: spinSlow 20s linear infinite; }
/* szklana karta */
.login-card { width: 408px; max-width: 92vw; position: relative; z-index: 2; padding: 34px 32px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.10); overflow: hidden;
  background: linear-gradient(168deg, rgba(28,33,43,.80), rgba(15,18,25,.86));
  -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 34px 90px rgba(0,0,0,.62), 0 0 60px rgba(245,68,59,.10),
    inset 0 1px 0 rgba(255,255,255,.10), inset 0 0 0 1px rgba(255,255,255,.02); }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: var(--grad-heat); box-shadow: 0 0 18px rgba(245,68,59,.6); }
:root[data-theme="light"] .login-card { background: linear-gradient(168deg, rgba(255,255,255,.9), rgba(244,246,248,.92)); border-color: rgba(0,0,0,.08); }
/* emblem z aureolą (zamiast chipu) */
.login-logo-wrap { position: relative; display: grid; place-items: center; width: 108px; height: 108px; margin: 2px auto 12px; }
.login-logo-wrap .halo { position: absolute; width: 108px; height: 108px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(245,68,59,.65), rgba(255,138,30,.65), transparent);
  filter: blur(9px); opacity: .8; animation: spinSlow 6s linear infinite; }
.login-logo-wrap .ring { position: absolute; width: 92px; height: 92px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 0 22px rgba(245,68,59,.28); }
.login-logo-wrap .emblem { position: relative; z-index: 1; width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; background: radial-gradient(circle at 34% 28%, #1c212b, #0a0d12);
  box-shadow: 0 10px 26px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.07); }
.login-logo-wrap .emblem img { width: 44px; height: 44px; display: block; }
.login-brandname { display: block; text-align: center; font-family: var(--display); font-weight: 700;
  font-size: 24px; letter-spacing: .3px; }
.login-tag { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; margin-top: 2px; }
.login-card h2 { text-align: center; margin: 6px 0 2px; font-size: 21px; font-family: var(--display); }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 10px; }
.login-theme { position: absolute; top: 16px; right: 16px; width: auto; margin: 0; z-index: 3; }
.devbadge { text-align: center; font-size: 11px; color: var(--warn-text); margin-top: 16px;
  border: 1px solid rgba(255,152,0,.3); border-radius: 8px; padding: 8px; background: var(--warn-bg); }

/* ---- auth: system logowanie / rejestracja / reset (futuristic) */
#loginbody { animation: authIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes authIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.f-social { width: 100%; justify-content: center; gap: 9px; font-weight: 600; font-size: 13.5px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); }
.f-social:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.24); transform: translateY(-1px); }
.f-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; color: var(--muted); font-size: 11px; }
.f-divider::before, .f-divider::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 50%, transparent); }
/* pole z ikona z przodu + ewentualny toggle */
.f-pass { position: relative; display: flex; align-items: center; }
.f-pass input { padding-left: 38px; }
.f-pass-ic { position: absolute; left: 12px; display: inline-flex; color: var(--muted); pointer-events: none; }
.f-pass input:focus ~ .f-pass-ic, .f-pass:focus-within .f-pass-ic { color: var(--accent); }
.f-eye { position: absolute; right: 6px; background: none; border: none; width: auto; padding: 6px;
  color: var(--muted); cursor: pointer; display: inline-flex; border-radius: 7px; }
.f-eye:hover { color: var(--text); background: var(--panel2); }
.f-eye.on { color: var(--accent); }
/* CTA - gradient heat z glow i przesuwem swiatla */
.f-cta { width: 100%; justify-content: center; margin-top: 12px; font-size: 14px; font-weight: 600;
  padding: 12px 16px; border: none; position: relative; overflow: hidden;
  background: var(--grad-heat); color: #fff; box-shadow: var(--glow-accent); }
.f-cta:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 12px 34px rgba(245,68,59,.42); }
.f-cta:active { transform: translateY(0); }
.f-cta::after { content: ""; position: absolute; top: 0; left: 0; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-160%) skewX(-18deg); }
.f-cta:hover::after { animation: shine 0.9s ease; }
.f-cta.ghostline { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.f-cta.ghostline:hover { background: var(--panel2); filter: none; box-shadow: none; }
/* linki i wiersze pomocnicze */
.f-link { color: var(--accent); font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.f-link:hover { filter: brightness(1.12); text-decoration: underline; }
.f-link.strong { font-weight: 700; }
.f-link.muted { color: var(--muted); font-size: 12px; }
.f-link.muted:hover { color: var(--text2); }
.f-row-end { display: flex; justify-content: flex-end; margin: -4px 0 2px; }
.f-alt { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.f-admin { text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.f-pwbox { margin-top: 12px; animation: authIn .28s ease; }
.f-hr { height: 1px; background: var(--border-soft); margin: 2px 0 12px; }
.f-hint { font-size: 12.5px; color: var(--text2); line-height: 1.55; margin: 0 0 16px;
  display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-bg); border: 1px solid rgba(245,68,59,.22); }
.f-hint svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
/* miernik sily hasla */
.f-strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 5px;
  margin: -6px 0 12px; height: 14px; }
.f-strength i { height: 4px; border-radius: 3px; background: var(--panel3); transition: background .25s; }
.f-strength em { grid-column: 5; font-style: normal; font-size: 11px; font-weight: 600; padding-left: 4px;
  white-space: nowrap; color: var(--muted); }
.f-strength.s1 i:nth-child(-n+1), .f-strength.s2 i:nth-child(-n+2),
.f-strength.s3 i:nth-child(-n+3), .f-strength.s4 i:nth-child(-n+4) { background: currentColor; }
.f-strength.s1 { color: #FF7043; } .f-strength.s2 { color: #FFB74D; }
.f-strength.s3 { color: #9CCC65; } .f-strength.s4 { color: #6DD68A; }
.f-strength.s1 em { color: #FF7043; } .f-strength.s2 em { color: #FFB74D; }
.f-strength.s3 em { color: #9CCC65; } .f-strength.s4 em { color: #6DD68A; }

/* ---- stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-card);
  transition: transform .16s, box-shadow .16s, border-color .16s; }
.stat:hover { transform: translateY(-2px); border-color: rgba(245,68,59,.35); box-shadow: var(--shadow-pop), 0 0 24px rgba(245,68,59,.10); }
.stat:hover .si { box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 16px rgba(245,68,59,.35); }
.stat .si { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-heat-soft); color: var(--accent); }
.stat .sv { font-size: 28px; font-weight: 700; font-family: var(--display); color: var(--text); line-height: 1.1; }
.stat .sl { font-size: 12.5px; color: var(--muted); }

/* ---- plan cards */
.plan { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; position: relative; box-shadow: var(--shadow-card); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--glow-accent); }
.plan.featured::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: var(--grad-heat); border-radius: 14px 14px 0 0; }
.plan-ribbon { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
  margin: -2px 0 -2px; padding: 4px 11px; border-radius: 16px; background: var(--grad-heat); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(245,68,59,.35); }
.plan-ribbon svg { color: #fff; }
.plan h3 { margin: 0; font-size: 17px; color: var(--text); }
.plan .price { font-size: 30px; font-weight: 700; font-family: var(--display); color: var(--text); }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px;
  flex: 1 0 auto; }
.plan li { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.plan li .ic { color: var(--ok-text); }
/* przyciski w kartach: rowna szerokosc, wyrownane do dolu */
.plan > .btn:last-child { margin-top: auto; width: 100%; justify-content: center; }
.plan .muted { flex: 1 0 auto; }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); background: var(--panel); }
.cat-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
/* plan aktywny (posiadany) */
.plan.owned { border-color: rgba(109,214,138,.4); }
.f-owned { width: 100%; justify-content: center; background: var(--ok-bg); border-color: rgba(109,214,138,.4);
  color: var(--ok-text); cursor: default; opacity: 1; }
.f-owned:disabled { opacity: 1; }

/* karta aktywnej subskrypcji */
.sub-card { display: flex; flex-direction: column; gap: 12px; border-color: rgba(109,214,138,.28);
  box-shadow: var(--shadow-card), 0 0 24px rgba(109,214,138,.06); }
.sub-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sub-name { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--text);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-top .badge { flex-shrink: 0; }
.sub-valid { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.sub-valid b { color: var(--text2); font-family: var(--mono); font-weight: 600; }
.sub-usage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sub-usage > div { background: var(--panel2); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: center; align-items: center; }
.sub-usage span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.sub-usage b { font-family: var(--display); font-size: 18px; color: var(--text); line-height: 1; }
.sub-usage b.dtc-yes { color: var(--ok-text); }
.sub-usage b svg { vertical-align: middle; }
.sub-btn { width: 100%; justify-content: center; margin-top: 2px; }

/* checkout modal */
.co-plan { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  background: var(--grad-heat-soft); border: 1px solid rgba(245,68,59,.20); border-radius: var(--radius-card);
  padding: 16px 18px; margin-bottom: 14px; }
.co-name { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--text); }
.co-price { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--text); white-space: nowrap; }
.co-price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.co-lines { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.co-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px;
  border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.co-line:last-child { border-bottom: none; }
.co-line span { color: var(--text2); } .co-line b { color: var(--text); font-family: var(--display); }
.co-pay { border: 1px dashed var(--input-border); border-radius: var(--radius-card); padding: 13px 15px;
  background: var(--panel2); }
.co-pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.co-pay-row span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.co-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.co-note svg { flex-shrink: 0; margin-top: 1px; color: var(--accent2); }

/* przyciski danger */
.btn.danger { color: var(--err-text); }
.btn.danger:hover { background: var(--err-bg); border-color: rgba(244,67,54,.4); }
.btn.danger-solid { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }

/* ---- status banners */
.banner { border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; margin-bottom: 16px; border: 1px solid var(--border-soft); }
.banner .ic { flex-shrink: 0; }
.banner.ok { border-color: rgba(76,175,80,.4); background: var(--ok-bg); color: var(--ok-text); }
.banner.warn { border-color: rgba(255,152,0,.4); background: var(--warn-bg); color: var(--warn-text); }
.banner.err { border-color: rgba(244,67,54,.4); background: var(--err-bg); color: var(--err-text); }
.banner.info { border-color: rgba(33,150,243,.4); background: var(--info-bg); color: var(--info-text); }
.banner b { color: inherit; font-weight: 700; } .banner a { color: inherit; text-decoration: underline; }

/* ---- misc */
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px;
  background: var(--panel2); border: 1px solid var(--border-soft); font-size: 11px; color: var(--text2); }
.info-note { font-size: 12px; color: var(--warn-text); display: flex; gap: 6px; align-items: start;
  background: var(--warn-bg); border: 1px solid rgba(255,152,0,.3); padding: 8px 10px; border-radius: 8px; }
.gain { font-family: var(--mono); color: var(--ok-text); font-size: 12px; font-weight: 600; }
.md { font-size: 13px; line-height: 1.7; } .md h1 { font-size: 18px; } .md h2 { font-size: 15px; margin-top: 18px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .app { grid-template-columns: 64px 1fr; }
  .brand b, .brand small, .nav a span, .usercard, .nav .grp, .langbar { display: none; } }
@media (max-width: 760px) {
  .main { padding: 18px 16px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; } .hero h1 { font-size: 26px; }
  .page-head h1 { font-size: 23px; }
  .bubble, .msg .b-wrap { max-width: 86%; }
  .modal { width: 96vw; padding: 0 16px 16px; } .modal h3 { margin: 0 -16px 16px; padding: 14px 16px; }
}

/* ---- TuningSuite: selektor solucji (klikane karty) ---- */
.ts-group { margin: 14px 0 4px; }
.ts-group-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 0 0 9px; display: flex; align-items: center; gap: 6px; }
.ts-sols { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; margin-bottom: 6px; }
.ts-sol { position: relative; display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border: 1.5px solid var(--border-soft); border-radius: var(--radius-card); background: var(--panel2);
  cursor: pointer; transition: border-color .14s, background .14s, transform .14s, box-shadow .14s; }
.ts-sol:hover { border-color: var(--accent-light); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.ts-sol.sel { border-color: var(--accent); background: var(--accent-bg); }
.ts-sol .ts-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.ts-sol .ts-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.ts-sol .ts-check { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ts-sol.sel .ts-check { display: grid; }
.ts-sol .radio-hint { font-size: 9px; color: var(--muted); position: absolute; bottom: 6px; right: 9px; opacity: .7; }
.ts-job { margin-bottom: 16px; }
.ts-job .ts-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ts-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.ts-actions .ts-summary { margin-right: auto; font-size: 12px; color: var(--muted); }
.ts-loading { text-align: center; padding: 28px 14px 22px; }
.ts-loading .spinner { width: 44px; height: 44px; border-width: 4px; margin: 0 auto 18px; display: block; }
.ts-loading .tl-title { font-weight: 600; font-size: 15px; color: var(--text); }
.ts-loading .tl-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---- Animowany bot TakeTune ---- */
.bot-svg { overflow: visible; }
.bot-float { animation: botFloat 3.2s ease-in-out infinite; transform-origin: center; }
@keyframes botFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.bot-eye { transform-box: fill-box; transform-origin: center; animation: botBlink 3.6s infinite; }
.bot-eye.d2 { animation-delay: .07s; }
@keyframes botBlink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
.bot-antenna { transform-box: fill-box; transform-origin: center; animation: botPulse 1.5s ease-in-out infinite; }
@keyframes botPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.3); } }
.bot-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bot-hero > .bot-wrap { flex-shrink: 0; }
.bot-hero > .bot-body { flex: 1; min-width: 240px; }

/* ================= MOTORSPORT HEAT: pompa / branding ================= */
.grad-text { background: var(--grad-heat); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; }

/* HERO — "definicja tuningu ECU" */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 34px 32px;
  background:
    radial-gradient(560px 260px at 88% -20%, rgba(255,138,30,.22), transparent 70%),
    radial-gradient(520px 260px at -8% 130%, rgba(245,68,59,.20), transparent 70%),
    linear-gradient(120deg, #14171E 0%, #191D26 100%);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-card); margin-bottom: 24px; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 2px, transparent 2px 26px); }
/* przesuwajacy sie blysk swiatla - "pompa" */
.hero::before { content: ""; position: absolute; top: 0; left: 0; width: 45%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,138,30,.10), transparent);
  transform: skewX(-16deg); animation: heroSweep 6.5s ease-in-out infinite; }
@keyframes heroSweep { 0% { transform: translateX(-140%) skewX(-16deg); } 55%, 100% { transform: translateX(320%) skewX(-16deg); } }
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font-family: var(--display); text-transform: uppercase; letter-spacing: .16em;
  font-size: 12px; font-weight: 600; color: var(--accent-light); margin: 0 0 10px; }
.hero h1 { font-family: var(--display); font-size: 34px; line-height: 1.08; margin: 0 0 10px; font-weight: 700;
  max-width: 22ch; }
.hero p { margin: 0; color: var(--text2); font-size: 15.5px; max-width: 62ch; line-height: 1.6; }
.hero .hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero .hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.hero .hs { display: flex; flex-direction: column; }
.hero .hs b { font-family: var(--display); font-size: 22px; color: #fff; line-height: 1.1; }
.hero .hs span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* DYNO GAUGE — wizualizacja przyrostu mocy */
.gauge { display: flex; align-items: center; gap: 16px; }
.gauge .dial { --p: 0; position: relative; width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(from 220deg, var(--accent) 0turn, var(--accent2) calc(var(--p) * .72turn), var(--panel3) calc(var(--p) * .72turn) .72turn, transparent .72turn);
  display: grid; place-items: center; }
.gauge .dial::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--panel); }
.gauge .dial .val { position: relative; font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff; line-height: 1; }
.gauge .dial .val small { display: block; font-size: 9px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.gauge .g-rows { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.gbar { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.gbar .g-lab { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.gbar .g-track { height: 8px; border-radius: 6px; background: var(--panel3); overflow: hidden; }
.gbar .g-fill { height: 100%; border-radius: 6px; background: var(--grad-heat); box-shadow: var(--glow-accent);
  transition: width .8s cubic-bezier(.2,.8,.2,1); }
.gbar .g-val { font-family: var(--mono); font-weight: 700; color: var(--ok-text); font-size: 13px; white-space: nowrap; }

/* ================= CZAT — bąbelki, które nie wyjeżdżają poza box ================= */
.chat { display: flex; flex-direction: column; gap: 12px; padding: 12px; max-height: 52vh; overflow-y: auto;
  position: relative; border-radius: var(--radius-card);
  background:
    linear-gradient(rgba(245,68,59,.05) 1px, transparent 1px) 0 0 / 100% 26px,
    radial-gradient(600px 200px at 50% 0%, rgba(245,68,59,.06), transparent 70%),
    var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--border-soft), inset 0 12px 24px rgba(0,0,0,.35); }
.chat-empty { text-align: center; color: var(--muted); padding: 30px 12px; font-size: 13.5px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 100%; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; font-family: var(--display); background: var(--panel3); }
.msg.them .av { background: linear-gradient(135deg, #37414F, #232A34); color: var(--text2); }
.msg.me .av { background: var(--grad-heat); }
.bubble { position: relative; max-width: 74%; min-width: 0; padding: 10px 13px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; word-break: normal; white-space: pre-wrap; }
.msg .b-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 74%; }
.msg .b-wrap .bubble { max-width: 100%; }
.msg.them { align-self: flex-start; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.them .bubble { background: var(--panel2); border: 1px solid var(--border-soft); border-bottom-left-radius: 5px; color: var(--text); }
.msg.me .bubble { background: var(--grad-heat); color: #fff; border-bottom-right-radius: 5px;
  box-shadow: 0 6px 18px rgba(245,68,59,.28); }
.msg.me .av { box-shadow: 0 0 12px rgba(245,68,59,.45); }
.msg .meta { font-size: 11px; color: var(--muted); display: flex; gap: 7px; align-items: baseline; }
.msg.me .meta { justify-content: flex-end; }
.msg .meta b { color: var(--text2); font-weight: 600; }
.chat-compose { display: flex; gap: 8px; margin-top: 14px; align-items: flex-end; }
.chat-compose textarea { resize: vertical; min-height: 44px; max-height: 160px; }
.chat-compose .btn { flex-shrink: 0; }

/* ==================================================================
   PREMIUM LAYER — ruch, głębia, grafika. Nadpisuje bazowe klasy (kaskada).
   ================================================================== */

/* ---- Motion keyframes ---- */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(245,68,59,.45); } 70% { box-shadow: 0 0 0 12px rgba(245,68,59,0); } }
@keyframes gradShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes shine { 0% { transform: translateX(-120%) skewX(-18deg); } 60%,100% { transform: translateX(320%) skewX(-18deg); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes orbDrift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18px,-14px) scale(1.08); } }

/* ---- Wejście widoku: subtelny, kaskadowy rise-in ---- */
@media (prefers-reduced-motion: no-preference) {
  .stat, .card, .plan, .sol-tile, .banner, .hero, .empty, .ts-job,
  .stat-grid > *, .grid > * { animation: riseIn .5s cubic-bezier(.2,.75,.25,1) both; }
  .stat-grid > *:nth-child(2), .grid > *:nth-child(2) { animation-delay: .05s; }
  .stat-grid > *:nth-child(3), .grid > *:nth-child(3) { animation-delay: .1s; }
  .stat-grid > *:nth-child(4), .grid > *:nth-child(4) { animation-delay: .15s; }
  .stat-grid > *:nth-child(5), .grid > *:nth-child(5) { animation-delay: .2s; }
  .stat-grid > *:nth-child(n+6), .grid > *:nth-child(n+6) { animation-delay: .25s; }
  tbody tr { animation: fadeIn .4s both; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; } }

/* ---- Scrollbary premium ---- */
* { scrollbar-width: thin; scrollbar-color: var(--panel3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--panel3), var(--panel2)); border-radius: 20px;
  border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--accent-dark), var(--panel3)); background-clip: padding-box; }

/* ---- Karty: glassy krawędź + hover-lift + gradientowa obwódka ---- */
.card { position: relative; background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 rgba(255,255,255,.07); }
.card.flat, .card.flat:hover { transform: none; box-shadow: var(--shadow-card); }
/* karta "premium" z gorącą obwódką gradientową */
.card.glow { border-color: transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad-heat) border-box; }
.card.glow:hover { box-shadow: var(--glow-accent), var(--shadow-pop); }

/* ---- Nagłówki sekcji z gorącym akcentem ---- */
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px;
  font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text); }
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 3px;
  background: var(--grad-heat); box-shadow: var(--glow-accent); flex-shrink: 0; }
.section-title .st-action { margin-left: auto; font-size: 13px; }
/* nagłówki H3 wewnątrz .main dostają akcent automatycznie */
.main h3:not(.plain) { position: relative; padding-left: 13px; font-family: var(--display); }
.main h3:not(.plain)::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .15em;
  width: 4px; border-radius: 3px; background: var(--grad-heat); }

/* ---- Kreska akcentu pod nagłówkiem strony ---- */
.page-head { position: relative; padding-bottom: 18px; }
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 60%); opacity: .5; }

/* ---- Przyciski primary: przesuwający się połysk ---- */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-120%) skewX(-18deg); }
.btn.primary:hover::after { animation: shine .9s ease; }
.btn .ic, .btn svg { flex-shrink: 0; }

/* ---- Statystyki: wartość gradientem, ikona pływa ---- */
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  background: radial-gradient(circle, var(--accent-bg), transparent 70%); pointer-events: none; }
.stat .si { position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.stat.hot .sv { background: var(--grad-heat); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---- Bannery: ikona w kafelku + świecąca krawędź ---- */
.banner { position: relative; overflow: hidden; padding: 14px 16px; font-size: 14px; border-radius: var(--radius-card); }
.banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: currentColor; opacity: .55; }
.banner > .ic, .banner > svg:first-child { padding: 7px; border-radius: 9px; background: rgba(255,255,255,.06);
  box-sizing: content-box; }

/* ---- Toast premium ---- */
.toast { padding: 13px 16px 15px; border-radius: var(--radius-card); animation: popIn .22s ease;
  backdrop-filter: blur(6px); overflow: hidden; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--accent); opacity: .8; animation: barGrow 4s linear forwards; transform-origin: left; }
.toast.ok::after { background: var(--ok-text); } .toast.err::after { background: var(--err-text); }

/* ---- Modal: backdrop blur + wejście ---- */
.modal-bg { background: rgba(6,8,12,.62); backdrop-filter: blur(5px); animation: fadeIn .18s ease; }
.modal { animation: popIn .24s cubic-bezier(.2,.8,.2,1); }
.modal h3 { background: linear-gradient(100deg, var(--header-dark), #1b2130); font-family: var(--display);
  letter-spacing: .2px; border-bottom: 1px solid rgba(255,255,255,.06); }

/* ---- Inputy: miękki focus glow ---- */
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--accent-bg), var(--glow-accent); }

/* ---- Checkboxy / radio: markowe, ciemna powierzchnia + gradient + ptaszek ---- */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
  width: 20px !important; height: 20px !important; min-width: 20px; max-width: 20px;
  flex-shrink: 0; padding: 0 !important; margin: 0; border: 1.5px solid var(--input-border);
  background: var(--panel3); border-radius: 6px; cursor: pointer; vertical-align: -5px;
  display: inline-grid; place-content: center; position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--accent); background: var(--panel2); }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(.9); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
input[type="checkbox"]:checked {
  border-color: transparent; box-shadow: var(--glow-accent);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 13px 13px no-repeat,
    var(--grad-heat) !important;
}
input[type="radio"]:checked {
  border-color: transparent; box-shadow: var(--glow-accent);
  background: radial-gradient(circle, #fff 0 3.5px, transparent 4.5px) center no-repeat, var(--grad-heat) !important;
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
label.row, label.info-note { cursor: pointer; }

/* ---- Select: własna strzałka, koniec systemowego wyglądu ---- */
select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 38px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C97A7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px 16px;
}
select:hover { border-color: var(--accent); }
select::-ms-expand { display: none; }

/* ---- File input: przycisk w stylu brandu zamiast systemowego białego ---- */
input[type="file"] { padding: 7px 10px !important; cursor: pointer; }
input[type="file"]::file-selector-button {
  font-family: var(--sans); font-weight: 700; font-size: 13px; margin-right: 12px;
  padding: 8px 15px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--grad-heat); color: #fff; box-shadow: var(--glow-accent); transition: filter .14s;
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.08); }
input[type="file"]::-webkit-file-upload-button {
  font-family: var(--sans); font-weight: 700; font-size: 13px; margin-right: 12px;
  padding: 8px 15px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: var(--glow-accent);
}

/* ---- Range slider markowy ---- */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; padding: 0; border: none;
  border-radius: 6px; background: var(--panel3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad-heat); box-shadow: var(--glow-accent); cursor: pointer; border: 2px solid var(--panel); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 2px solid var(--panel); border-radius: 50%;
  background: var(--accent); cursor: pointer; }

/* ---- Premium empty state (ikona w gradiencie + tekst + opcjonalne CTA) ---- */
.premium-empty { text-align: center; padding: 48px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.premium-empty .pe-ic { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: var(--grad-heat-soft); color: var(--accent); margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(245,68,59,.25); animation: floatY 3.4s ease-in-out infinite; }
.premium-empty h3 { margin: 0; font-family: var(--display); font-size: 18px; padding-left: 0 !important; }
.premium-empty h3::before { display: none !important; }
.premium-empty p { margin: 2px 0 0; color: var(--muted); font-size: 14px; max-width: 42ch; }
.premium-empty .btn { margin-top: 14px; }

/* ---- Skeleton loader — mocniejszy shimmer ---- */
.skeleton { background: linear-gradient(100deg, var(--panel2) 30%, var(--panel3) 50%, var(--panel2) 70%);
  background-size: 220% 100%; animation: gradShift 1.3s linear infinite; }
.loading-block { display: grid; gap: 12px; }

/* ---- Live dot (pulsujący status) ---- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block;
  position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: livePulse 1.6s ease-in-out infinite; }
.badge.live { padding-left: 8px; } .badge.live .live-dot { margin-right: 5px; }

/* ---- Panel godzin pracy supportu: dziś duże, reszta tygodnia w dymku po najechaniu ---- */
.hours-panel { position: relative; display: inline-flex; align-items: center; gap: 18px; margin-top: 22px;
  padding: 14px 20px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--border-soft);
  cursor: default; }
.hours-today { display: flex; flex-direction: column; gap: 5px; }
.hours-today .ht-lab { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  display: flex; align-items: center; gap: 7px; }
.hours-today .ht-big { font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1;
  background: var(--grad-heat); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hours-today .ht-big.closed { background: none; -webkit-text-fill-color: var(--muted); color: var(--muted); }
.hours-panel .hp-hint { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
  border-left: 1px solid var(--border-soft); padding-left: 18px; cursor: help; }
.hours-panel .hp-hint .ic { transition: transform .16s; }
.hours-panel:hover .hp-hint .ic, .hours-panel:focus-within .hp-hint .ic { transform: rotate(180deg); }
.hours-week { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 40; min-width: 230px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop);
  padding: 12px 14px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s, transform .16s, visibility .16s; pointer-events: none; }
.hours-panel:hover .hours-week, .hours-panel:focus-within .hours-week { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.hours-week .hw-title { font-family: var(--display); font-size: 13px; font-weight: 600; margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.hours-week .hw-grid { display: grid; grid-template-columns: auto auto; gap: 5px 18px; font-size: 13.5px; }
.hours-week .hw-day { color: var(--muted); }
.hours-week .hw-day.today { color: var(--text); font-weight: 700; }
.hours-week .hw-val { font-family: var(--mono); color: var(--text2); text-align: right; }
.hours-week .hw-val.today { color: var(--accent-light); font-weight: 700; }
.hours-week .hw-val.off { color: var(--muted); opacity: .55; }

/* ---- Metric (duża liczba z etykietą) ---- */
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric .m-val { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }
.metric .m-val.grad { background: var(--grad-heat); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.metric .m-lab { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Gradientowy pierścień avatara ---- */
.gr-ring { padding: 2px; border-radius: 50%; background: var(--grad-heat); display: inline-grid; }
.gr-ring > * { border: 2px solid var(--panel); border-radius: 50%; }

/* ---- Dekoracyjne poświaty (orby) do heroów/sekcji ---- */
.glow-orb { position: absolute; border-radius: 50%; filter: blur(46px); pointer-events: none; z-index: 0;
  animation: orbDrift 9s ease-in-out infinite; }
.glow-orb.a { background: rgba(245,68,59,.28); } .glow-orb.b { background: rgba(255,138,30,.22); animation-delay: -4s; }

/* ---- Stepper (postęp przetwarzania pliku) ---- */
.stepper { display: flex; align-items: center; gap: 0; margin: 6px 0; }
.stepper .step { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 12.5px; color: var(--muted); }
.stepper .step .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel3); color: var(--muted); font-weight: 700; font-size: 12px; flex-shrink: 0; transition: .2s; }
.stepper .step.done .dot { background: var(--ok-bg); color: var(--ok-text); }
.stepper .step.active .dot { background: var(--grad-heat); color: #fff; animation: pulseGlow 1.8s infinite; }
.stepper .step.active { color: var(--text); font-weight: 600; }
.stepper .line { height: 2px; flex: 1; background: var(--panel3); margin: 0 6px; border-radius: 2px; }
.stepper .line.done { background: var(--grad-heat); }

/* ---- Feature tile (kafelek akcji na pulpicie/rozdrożach) ---- */
.feature { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 20px;
  border-radius: var(--radius-card); background: var(--panel); border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card); cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.feature:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--glow-accent), var(--shadow-pop); }
.feature .f-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-heat-soft); color: var(--accent); }
.feature:hover .f-ic { background: var(--grad-heat); color: #fff; }
.feature h4 { margin: 4px 0 0; font-size: 15.5px; font-family: var(--display); }
.feature p { margin: 0; font-size: 13px; color: var(--muted); }
.feature .f-go { margin-top: auto; font-size: 13px; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* ---- Divider z akcentem ---- */
.hr-grad { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 20px 0; }

/* ---- Znacznik ON/OFF supportu w nawigacji ---- */
.nav-sup { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px;
  font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 20px; border: 1px solid transparent;
  font-family: var(--display); flex-shrink: 0; }
.nav-sup .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.nav-sup.on { color: var(--ok-text); background: var(--ok-bg); border-color: rgba(76,175,80,.5);
  animation: supOn 1.8s ease-in-out infinite; }
.nav-sup.on .d { box-shadow: 0 0 6px 1px currentColor; }
.nav-sup.off { color: var(--err-text); background: var(--err-bg); border-color: rgba(244,67,54,.4);
  animation: supOff 2.6s ease-in-out infinite; }
@keyframes supOn { 0%,100% { box-shadow: 0 0 0 0 rgba(76,175,80,.5); } 65% { box-shadow: 0 0 0 6px rgba(76,175,80,0); } }
@keyframes supOff { 0%,100% { opacity: .42; } 50% { opacity: .92; } }

/* ---- Logo (pełny emblemat) na ciemnym kafelku ---- */
.brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- Kbd / mono chip ---- */
kbd { font-family: var(--mono); font-size: 12px; background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 6px; padding: 2px 6px; color: var(--text2); }
