/* BotHost — biały motyw z fioletowym akcentem (#9000ff, jak Goxy) i kafelkami w stylu Nebuli */

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: 'Poppins', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 10px;
  --r-sm: 8px;

  --bg: #fafafc;
  --side: #ffffff;
  --surface: #ffffff;
  --tile: #f3f2f8;
  --tile-hover: #ecebf3;
  --tile-active: #efe5ff;
  --inner: #e9e8f0;
  --border: #ebeaf1;
  --border-2: #dedce8;
  --grid: rgba(20, 16, 40, .07);

  --text: #15131c;
  --text-2: #5e5b6e;
  --text-3: #9b98aa;

  --accent: #9000ff;
  --accent-hover: #7a00d9;
  --accent-text: #7b00db;
  --accent-soft: rgba(144, 0, 255, .08);
  --accent-ring: rgba(144, 0, 255, .22);
  --on-accent: #ffffff;

  /* statusy: działa — zielony, zatrzymany — czerwony, w trakcie — żółty */
  --st-on: #16c25a;
  --st-off: #ef4444;
  --st-mid: #f2b705;
  --st-text-on: #0f8a3f;
  --st-text-off: #c62828;
  --st-text-mid: #9a6b00;

  --blue: #2563eb;
  --pink: #db2777;
  --orange: #f59e0b;

  --ghost-icon: rgba(144, 0, 255, .07);
  --ghost-icon-hover: rgba(144, 0, 255, .12);
  --sel: rgba(144, 0, 255, .16);
  --overlay: rgba(20, 16, 40, .3);
  --shadow: 0 1px 2px rgba(20, 16, 40, .04);
  --shadow-lg: 0 24px 60px -18px rgba(30, 10, 70, .28), 0 0 0 1px rgba(20, 16, 40, .05);

  --term-bg: #ffffff;
  --term-fg: #1d1b26;
  --term-dim: #a3a1b2;
  --term-sys: #5e5b6e;
  --term-line: #ebeaf1;
  --term-err: #d32f2f;
  --term-hover: rgba(20, 16, 40, .03);

  --a0: #1f1f1f; --a1: #c62828; --a2: #15803d; --a3: #a16207; --a4: #1d4ed8; --a5: #a21caf; --a6: #0e7490; --a7: #6b6b6b;
  --a8: #737373; --a9: #dc2626; --a10: #16a34a; --a11: #b7791f; --a12: #2563eb; --a13: #c026d3; --a14: #0891b2; --a15: #404040;

  --ed-bg: #ffffff;
  --t-kw: #9000ff; --t-str: #047857; --t-num: #c2410c; --t-com: #9ca3af; --t-lit: #db2777; --t-fn: #2563eb; --t-glob: #0e7490; --t-key: #1d4ed8; --t-prop: #374151;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0a12;
  --side: #0b0a12;
  --surface: #15131f;
  --tile: #1c1928;
  --tile-hover: #24203a;
  --tile-active: #2a1b47;
  --inner: #262236;
  --border: #23202f;
  --border-2: #322d44;
  --grid: rgba(255, 255, 255, .07);
  --text: #eeecf5;
  --text-2: #aaa6bd;
  --text-3: #6f6b84;
  --accent: #a43dff;
  --accent-hover: #b35cff;
  --accent-text: #c38bff;
  --accent-soft: rgba(164, 61, 255, .14);
  --accent-ring: rgba(164, 61, 255, .32);
  --st-text-on: #4ade80;
  --st-text-off: #ff7b7b;
  --st-text-mid: #f5c84a;
  --ghost-icon: rgba(255, 255, 255, .06);
  --ghost-icon-hover: rgba(255, 255, 255, .1);
  --sel: rgba(164, 61, 255, .3);
  --overlay: rgba(0, 0, 0, .5);
  --shadow: none;
  --shadow-lg: 0 24px 70px -18px rgba(0, 0, 0, .85);
  --term-bg: #110f19;
  --term-fg: #e9e7f2;
  --term-dim: #6f6b84;
  --term-sys: #b6b2c8;
  --term-line: #262236;
  --term-err: #ff8a80;
  --term-hover: rgba(255, 255, 255, .03);
  --a0: #4f4f63; --a1: #ff6b6b; --a2: #4ade80; --a3: #fbbf24; --a4: #8aa6ff; --a5: #e879f9; --a6: #22d3ee; --a7: #d4d4de;
  --a8: #75758c; --a9: #ff9a9a; --a10: #86efac; --a11: #fde047; --a12: #a5b8ff; --a13: #f0abfc; --a14: #67e8f9; --a15: #fafafa;
  --ed-bg: #110f19;
  --t-kw: #c38bff; --t-str: #6ee7b7; --t-num: #fdba74; --t-com: #6f6b84; --t-lit: #f9a8d4; --t-fn: #93c5fd; --t-glob: #67e8f9; --t-key: #a5b4fc; --t-prop: #d4d4de;
  color-scheme: dark;
}

/* ───────────── podstawy ───────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
code { font: .86em var(--mono); background: var(--tile); padding: 2px 6px; border-radius: 6px; }
kbd { display: inline-flex; align-items: center; font: 500 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 6px; background: var(--tile); color: var(--text-2); box-shadow: inset 0 -1px 0 var(--border-2); }
::selection { background: var(--sel); }
.i { display: inline-grid; place-items: center; flex: none; width: 1em; height: 1em; line-height: 1; }
.i::before { display: block; line-height: 1; vertical-align: 0 !important; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); }
.mt { margin-top: 18px; }
.mt-s { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.accent { color: var(--accent); }
[hidden] { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@keyframes fadeup { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes spin { to { transform: rotate(360deg); } }
.anim > * { animation: fadeup .5s var(--ease) both; }
.anim > *:nth-child(2) { animation-delay: .05s; }
.anim > *:nth-child(3) { animation-delay: .1s; }
.anim > *:nth-child(4) { animation-delay: .15s; }
.anim > *:nth-child(n+5) { animation-delay: .2s; }

/* ───────────── szkielet: menu z kafelków (Nebula, szeroki pasek) ───────────── */

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 14px;
  background: var(--side); border-right: 1px solid var(--border);
  scrollbar-width: none; z-index: 25;
}
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 4px 10px; font: 600 17px var(--head); letter-spacing: -.01em; }
.brand svg { width: 36px; height: 36px; flex: none; border-radius: 10px; }
.brand small { display: block; font: 500 11px var(--font); color: var(--text-3); letter-spacing: 0; }
.side-sep { height: 1px; background: var(--border); margin: 6px 4px; flex: none; }
.side-label { padding: 8px 6px 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; }
.side-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* kafelek menu: wypełniony, z ikoną; aktywny ma pasek akcentu z lewej */
.nav-tile {
  --bar: transparent;
  position: relative; flex: none;
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 46px; padding: 0 14px 0 16px;
  border-radius: var(--r); overflow: hidden;
  background: var(--tile); color: var(--text);
  font-size: 14.5px; font-weight: 500;
  transition: background-color .25s, color .25s;
}
.nav-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bar); transition: background-color .25s; }
.nav-tile > .i { font-size: 18px; color: var(--text-2); transition: color .25s; }
.nav-tile:hover { background: var(--tile-hover); }
.nav-tile.on { --bar: var(--accent); background: var(--tile-active); color: var(--accent-text); }
.nav-tile.on > .i { color: var(--accent); }
.nav-tile .meta { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.nav-tile kbd { margin-left: auto; background: var(--surface); }
/* kafelek bota w menu: pasek w kolorze statusu */
.nav-tile.bot { --bar: var(--st-off); }
.nav-tile.bot[data-status="running"] { --bar: var(--st-on); }
.nav-tile.bot[data-status="starting"], .nav-tile.bot[data-status="stopping"], .nav-tile.bot[data-status="installing"], .nav-tile.bot[data-status="restarting"] { --bar: var(--st-mid); }
.nav-tile.bot.on { background: var(--tile-active); color: var(--text); }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 8px; }
.conn { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 12px; color: var(--text-3); }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--st-on); animation: glow 2.4s infinite; }
.conn.off::before { background: var(--st-off); }

.main { min-width: 0; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 34px 90px; }
.page.wide { max-width: 1440px; }
.topbar { display: none; }
.scrim { display: none; }

/* ───────────── nagłówki ───────────── */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font: 600 26px/1.25 var(--head); letter-spacing: -.02em; }
.page-sub { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-head h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ───────────── kafelki statystyk (Nebula: duża, obrócona ikona w tle) ───────────── */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile, .stat {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100px; padding: 16px 18px;
  border-radius: var(--r); background: var(--tile);
}
.tile-bg { position: absolute; z-index: -1; right: 4px; top: 50%; font-size: 88px; color: var(--ghost-icon); transform: translateY(-50%) rotate(-20deg); transition: color .3s, transform .4s var(--ease); }
.tile:hover .tile-bg, .stat:hover .tile-bg { color: var(--ghost-icon-hover); transform: translateY(-50%) rotate(-20deg) scale(1.07); }
.tile-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.tile-val { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; font: 600 23px/1.25 var(--head); letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-val small { font: 600 12.5px var(--font); color: var(--text-3); letter-spacing: 0; }
.tile-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; margin-top: 10px; border-radius: 99px; background: var(--inner); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.bar.warn > i { background: var(--st-mid); }
.bar.bad > i { background: var(--st-off); }

.seg { display: inline-flex; gap: 4px; }
.seg button { padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--tile); transition: background-color .25s, color .25s; }
.seg button:hover { background: var(--tile-hover); color: var(--text); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

/* ───────────── kafelki botów (lista jak serwery w Nebuli) ───────────── */

.srv-list { display: grid; gap: 10px; }
.srv {
  --st: var(--st-off);
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 96px 110px 120px auto;
  align-items: center; gap: 16px;
  min-height: 84px; padding: 14px 16px 14px 18px;
  border-radius: var(--r); background: var(--tile);
  cursor: pointer;
  transition: background-color .3s, transform .3s var(--ease);
}
.srv::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); transition: background-color .3s; }
.srv::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--st) 16%, transparent) 0, transparent 70%); transition: opacity .3s; }
.srv:hover { background: var(--tile-hover); transform: translateX(3px); }
.srv[data-status="running"] { --st: var(--st-on); }
.srv[data-status="starting"], .srv[data-status="stopping"], .srv[data-status="installing"], .srv[data-status="restarting"] { --st: var(--st-mid); }
.srv-ic { width: 52px; height: 52px; border-radius: var(--r); display: grid; place-items: center; font-size: 22px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); }
.srv-name { min-width: 0; }
.srv-name b { display: block; font: 600 16px var(--head); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-name small { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-m { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.srv-m .i { font-size: 15px; color: var(--text-3); }
.srv-act { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.srv-empty { padding: 26px 20px; border-radius: var(--r); background: var(--tile); color: var(--text-2); font-size: 14px; text-align: center; }
.list-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ───────────── karty ───────────── */

.card { border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-title { font: 600 15px var(--head); }
.card-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.card-body { padding: 14px 18px 18px; }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.card-foot .muted { margin-right: auto; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stack { display: grid; gap: 10px; }
.loading { padding: 24px 18px; color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.loading::before { content: ''; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--inner); border-top-color: var(--accent); animation: spin .7s linear infinite; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 42px 20px 46px; text-align: center; }
.empty-ic { width: 54px; height: 54px; border-radius: var(--r); display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.empty b { font: 600 16px var(--head); }
.empty p { color: var(--text-2); font-size: 13.5px; max-width: 420px; }
.empty .btn, .empty .row { margin-top: 8px; }

/* ───────────── przyciski i pola ───────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--r);
  background: var(--tile); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background-color .25s, color .25s, opacity .2s, transform .12s;
}
.btn .i { font-size: 15px; }
.btn:hover { background: var(--tile-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-start { background: var(--st-on); color: #fff; box-shadow: 0 8px 20px -10px var(--st-on); }
.btn-start:hover { background: #12a84d; }
.btn-danger { background: color-mix(in srgb, var(--st-off) 12%, transparent); color: var(--st-text-off); }
.btn-danger:hover { background: color-mix(in srgb, var(--st-off) 20%, transparent); }
.btn-danger-solid { background: var(--st-off); color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--tile); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn-sm .i { font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn kbd { background: rgba(255, 255, 255, .2); color: inherit; box-shadow: none; padding: 3px 5px; }

.input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--tile); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.input::placeholder { color: var(--text-3); text-transform: none; }
.input:hover { background: var(--tile-hover); }
.input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
textarea.input { height: auto; min-height: 120px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.field { display: grid; gap: 7px; align-content: start; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--text-3); }
.fields { display: grid; gap: 18px; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-error { padding: 10px 13px; border-radius: var(--r); background: color-mix(in srgb, var(--st-off) 10%, transparent); color: var(--st-text-off); font-size: 13px; font-weight: 500; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .btn { position: absolute; right: 4px; top: 4px; height: 34px; width: 34px; background: transparent; }
.input-wrap .btn:hover { background: var(--inner); }

.switch { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--border-2); transition: background-color .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px; margin-top: 8px; border-radius: var(--r); background: var(--tile); }
.toggle-row b { display: block; font-size: 14px; font-weight: 600; }
.toggle-row small { display: block; font-size: 12.5px; color: var(--text-2); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }

/* ───────────── statusy ───────────── */

.status { --st: var(--st-off); --stt: var(--st-text-off); display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--stt); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.status.running { --st: var(--st-on); --stt: var(--st-text-on); }
.status.running::before { animation: glow 2.4s infinite; }
.status.starting, .status.stopping, .status.installing { --st: var(--st-mid); --stt: var(--st-text-mid); }
.status.starting::before, .status.stopping::before, .status.installing::before { animation: pulse 1s infinite; }
.dot { --st: var(--st-off); flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--st); }
.dot.running { --st: var(--st-on); }
.dot.starting, .dot.stopping, .dot.installing { --st: var(--st-mid); animation: pulse 1s infinite; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; background: var(--tile); font: 500 11.5px/1.75 var(--mono); color: var(--text-2); transition: background-color .2s; }
button.chip:hover { background: var(--tile-hover); color: var(--text); }
.tag { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 20px; background: var(--accent-soft); color: var(--accent-text); }
.tag.ok { background: color-mix(in srgb, var(--st-on) 14%, transparent); color: var(--st-text-on); }
.tag.warn { background: color-mix(in srgb, var(--st-mid) 18%, transparent); color: var(--st-text-mid); }
.tag.gray { background: var(--tile); color: var(--text-2); }

.av { flex: none; display: grid; place-items: center; border-radius: var(--r-sm); color: #fff; font-weight: 700; background: var(--c, var(--accent)); }
.av-xs { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; }
.av-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.av-md { width: 40px; height: 40px; font-size: 15px; }
.av-lg { width: 54px; height: 54px; border-radius: 12px; font-size: 20px; }

/* ───────────── banery ───────────── */

.banners { display: grid; gap: 8px; margin-bottom: 14px; }
.banners:empty { display: none; }
.banner { --st: var(--accent); position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 11px 11px 11px 18px; border-radius: var(--r); background: var(--tile); font-size: 13.5px; animation: fadeup .4s var(--ease) both; }
.banner::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); }
.banner > .i { font-size: 18px; color: var(--st); }
.banner .grow { white-space: normal; }
.banner.warn { --st: var(--st-mid); }
.banner.err { --st: var(--st-off); }

/* ───────────── kafelek bota w prawej kolumnie (podświetlony kolorem statusu) ───────────── */

.bot-card {
  --st: var(--st-off);
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 10px;
  padding: 16px 16px 16px 20px;
  border-radius: var(--r); background: var(--tile);
}
.bot-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); transition: background-color .3s; }
.bot-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, color-mix(in srgb, var(--st) 16%, transparent), transparent 70%); }
.bot-card[data-status="running"] { --st: var(--st-on); }
.bot-card[data-status="starting"], .bot-card[data-status="stopping"], .bot-card[data-status="installing"], .bot-card[data-status="restarting"] { --st: var(--st-mid); }
.bot-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-card .srv-ic { width: 46px; height: 46px; font-size: 20px; flex: none; }
.bot-id { min-width: 0; flex: 1; display: grid; justify-items: start; gap: 4px; }
.bot-name { max-width: 100%; font: 600 19px/1.3 var(--head); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-desc { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }

/* zasilanie: start zielony, restart żółty, stop czerwony */
.power { display: flex; gap: 8px; flex-wrap: wrap; }
.power .btn { min-width: 108px; background: var(--surface); box-shadow: var(--shadow); }
.power .btn[data-action="start"] { color: var(--st-text-on); }
.power .btn[data-action="start"]:hover { background: color-mix(in srgb, var(--st-on) 14%, var(--surface)); }
.power .btn[data-action="restart"] { color: var(--st-text-mid); }
.power .btn[data-action="restart"]:hover { background: color-mix(in srgb, var(--st-mid) 16%, var(--surface)); }
.power .btn[data-action="stop"] { color: var(--st-text-off); }
.power .btn[data-action="stop"]:hover { background: color-mix(in srgb, var(--st-off) 12%, var(--surface)); }
.power .btn[data-action="kill"] { background: var(--st-off); color: #fff; }
.mtabs { display: none; }

/* ───────────── konsola ───────────── */

.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: stretch; }
/* Konsola ma wysokość kolumny po prawej — jej dół wypada równo z przyciskami zasilania. */
.console-layout .term-card .term { flex: 1; }
.console-layout .term-card .console { flex: 1 1 0; height: 0; min-height: 320px; }
.term-card { display: flex; flex-direction: column; border-radius: var(--r); background: var(--term-bg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.term-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--term-line); }
.term-head .card-title { margin-right: auto; }
.term { display: flex; flex-direction: column; min-height: 0; background: var(--term-bg); color: var(--term-fg); }
.term-flush { flex: 1; }
.console { height: 480px; overflow: auto; padding: 12px 16px; color: var(--term-fg); font: 12.5px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.console:empty::before { content: 'Brak logów — uruchom bota, żeby zobaczyć jego wyjście.'; color: var(--term-dim); }
.console-sm { height: 260px; }
.term-flush .console { flex: 1; height: auto; }
.ln { display: flex; gap: 14px; border-radius: 4px; }
.ln-more { display: block; margin: 0 auto 10px; padding: 4px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font: 600 12px var(--font); transition: background-color .2s; }
.ln-more:hover { background: var(--accent-ring); }
.ln-cut { margin-left: 6px; padding: 0 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font: 600 11px/17px var(--font); white-space: nowrap; }
.ln-cut:hover { background: var(--accent-ring); }
.ln:hover { background: var(--term-hover); }
.ln-t { flex: none; color: var(--term-dim); user-select: none; }
.ln-m { flex: 1; min-width: 0; }
.ln-err .ln-m { color: var(--term-err); }
.ln-sys .ln-m { color: var(--term-sys); }
.ln-syserr .ln-m { color: var(--term-err); }
.ln-tag { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; line-height: 17px; vertical-align: 1px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.ln-syserr .ln-tag { background: color-mix(in srgb, var(--st-off) 12%, transparent); color: var(--term-err); }
.ln-cmd .ln-m { color: var(--accent-text); }
.console-input { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 16px; border-top: 1px solid var(--term-line); }
.console-input .prompt { color: var(--accent); font: 700 15px var(--mono); }
.console-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 13px var(--mono); color: var(--term-fg); }
.console-input input::placeholder { color: var(--term-dim); }
.console-input input:disabled { cursor: not-allowed; }

.console-side { display: grid; gap: 10px; align-self: start; position: sticky; top: 20px; }
.stats { display: grid; gap: 10px; }
.stat { min-height: 88px; }
.power-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.power-side .btn { min-width: 0; padding: 0 8px; height: 44px; }

.a-b { font-weight: 700; } .a-d { opacity: .6; } .a-i { font-style: italic; } .a-u { text-decoration: underline; }
.a-s { text-decoration: line-through; } .a-u.a-s { text-decoration: underline line-through; }
.a-f0 { color: var(--a0); } .a-f1 { color: var(--a1); } .a-f2 { color: var(--a2); } .a-f3 { color: var(--a3); }
.a-f4 { color: var(--a4); } .a-f5 { color: var(--a5); } .a-f6 { color: var(--a6); } .a-f7 { color: var(--a7); }
.a-f8 { color: var(--a8); } .a-f9 { color: var(--a9); } .a-f10 { color: var(--a10); } .a-f11 { color: var(--a11); }
.a-f12 { color: var(--a12); } .a-f13 { color: var(--a13); } .a-f14 { color: var(--a14); } .a-f15 { color: var(--a15); }
.a-g0 { background: var(--a0); } .a-g1 { background: var(--a1); } .a-g2 { background: var(--a2); } .a-g3 { background: var(--a3); }
.a-g4 { background: var(--a4); } .a-g5 { background: var(--a5); } .a-g6 { background: var(--a6); } .a-g7 { background: var(--a7); }
.a-g8 { background: var(--a8); } .a-g9 { background: var(--a9); } .a-g10 { background: var(--a10); } .a-g11 { background: var(--a11); }
.a-g12 { background: var(--a12); } .a-g13 { background: var(--a13); } .a-g14 { background: var(--a14); } .a-g15 { background: var(--a15); }

/* ───────────── wykresy ───────────── */

.chart-card .card-head { padding-bottom: 4px; }
.chart { position: relative; height: 180px; margin: 10px 18px 16px 6px; }
.chart svg { display: block; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-dasharray: 3 5; shape-rendering: crispEdges; }
.chart .lbl { fill: var(--text-3); font: 500 11px var(--font); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .hx { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hd { stroke: var(--surface); stroke-width: 3; }
.chart .tip { position: absolute; top: 0; z-index: 2; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 12px; white-space: nowrap; pointer-events: none; transform: translate(-50%, -100%); }
.chart .tip b { display: block; font-size: 13px; }
.chart .tip span { color: var(--text-3); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }

/* ───────────── menedżer plików: wiersze jako kafelki ───────────── */

.fm { position: relative; background: transparent; border: 0; box-shadow: none; }
.fm-bar { display: flex; align-items: center; gap: 10px; padding: 0 0 12px; flex-wrap: wrap; }
.fm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; font-size: 14px; overflow: hidden; white-space: nowrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: background-color .2s, color .2s; }
.crumbs a:hover { background: var(--tile); color: var(--text); }
.crumbs a:last-child { color: var(--text); font-weight: 600; }
.crumbs .slash { color: var(--text-3); }
/* pasek zaznaczenia przypięty do dołu ekranu (nad wszystkim, widoczny przy przewijaniu), wąski i wyśrodkowany na stronie */
.fm-sel {
  position: fixed; z-index: 40; bottom: 20px; left: 252px; right: 0; margin: 0 auto;
  width: max-content; max-width: calc(100vw - 252px - 40px);
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  border-radius: var(--r); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-ring); font-size: 13px;
  animation: fadeup .3s var(--ease) both;
}
body.has-uploads .fm-sel { bottom: 104px; }
.fm-sel .grow { display: none; }
.fm-sel > b { margin-right: 6px; white-space: nowrap; }
/* miejsce pod listą, żeby pasek nie zasłaniał ostatnich plików */
.fm:has(#fm-sel:not([hidden])) { padding-bottom: 76px; }
/* animacja wejścia strony zostawia transform, który przypiąłby pasek do karty zamiast do ekranu */
.anim > *:has(#fm-sel:not([hidden])) { animation: none; }
.frow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px 132px 40px; align-items: center; gap: 4px; height: 48px; padding: 0 8px 0 6px; margin-bottom: 7px; border-radius: var(--r); background: var(--tile); font-size: 14px; cursor: pointer; transition: background-color .25s; }
.frow:hover { background: var(--tile-hover); }
.frow.sel { background: var(--tile-active); }
.frow.head { height: 28px; margin-bottom: 4px; background: transparent; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); cursor: default; }
.frow.head:hover { background: transparent; }
.frow .c-check { display: grid; place-items: center; height: 100%; }
.frow .name { display: flex; align-items: center; gap: 11px; min-width: 0; font-weight: 500; }
.frow .name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .c-size, .frow .c-date { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fi { font-size: 17px; color: var(--text-3); }
.fi.dir { color: var(--accent); }
.fi.js { color: #d4a106; }
.fi.json { color: #16a34a; }
.fi.zip { color: #ea580c; }
.fi.env { color: var(--pink); }
.fi.md { color: var(--blue); }
.fm-foot { padding: 8px 4px; font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
/* upuszczanie plików — podświetlenie całego ekranu, bez ramek */
.drop-full { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, var(--accent) 22%); backdrop-filter: blur(5px); pointer-events: none; animation: fade .15s; }
.drop-card { display: grid; justify-items: center; gap: 6px; padding: 30px 46px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); text-align: center; animation: pop .25s var(--ease); }
.drop-card .i { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 6px; border-radius: 16px; font-size: 26px; background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 26px -10px var(--accent); }
.drop-card b { font: 600 18px var(--head); }
.drop-card span { font-size: 13.5px; color: var(--text-2); }
#ftable .empty { border-radius: var(--r); background: var(--tile); }

/* ───────────── edytor ───────────── */

.editor-card { display: flex; flex-direction: column; overflow: hidden; }
.editor-card .fm-bar { padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.ed-host { height: calc(100vh - 300px); min-height: 360px; position: relative; }
.ed-status { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font: 11.5px var(--mono); color: var(--text-3); }
.ed-status .grow { text-align: right; }
.dirty { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--st-text-mid); }
.dirty::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.ed { position: absolute; inset: 0; display: flex; font: 13px/20px var(--mono); background: var(--ed-bg); }
.ed-gutter { flex: none; width: 54px; overflow: hidden; position: relative; background: var(--tile); color: var(--text-3); text-align: right; user-select: none; }
.ed-nums { padding: 14px 12px 14px 0; white-space: pre; will-change: transform; }
.ed-body { position: relative; flex: 1; min-width: 0; }
.ed-hl, .ed-ta { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; padding: 14px 18px; border: 0; font: inherit; line-height: inherit; letter-spacing: 0; word-spacing: 0; white-space: pre; tab-size: 2; -moz-tab-size: 2; overflow-wrap: normal; word-break: normal; font-variant-ligatures: none; }
.ed-hl { overflow: hidden; pointer-events: none; color: var(--text); }
.ed-ta { overflow: auto; resize: none; outline: none; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--accent); }
.ed-ta::selection { background: var(--sel); -webkit-text-fill-color: transparent; }
.t-kw { color: var(--t-kw); } .t-str { color: var(--t-str); } .t-num { color: var(--t-num); }
.t-com { color: var(--t-com); font-style: italic; } .t-lit { color: var(--t-lit); } .t-fn { color: var(--t-fn); }
.t-glob { color: var(--t-glob); } .t-key { color: var(--t-key); } .t-prop { color: var(--t-prop); }

/* ───────────── pakiety / zmienne / ustawienia ───────────── */

.pkg-add { display: flex; gap: 8px; align-items: center; padding: 14px 18px 12px; flex-wrap: wrap; }
.pkg-add .input { flex: 1; min-width: 200px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 18px 14px; font-size: 12px; color: var(--text-3); }
.chips button.chip { cursor: pointer; }
#pkg-list { padding: 0 10px 10px; }
.pkg-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 130px 40px; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; margin-bottom: 6px; border-radius: var(--r); background: var(--tile); font-size: 13.5px; }
.pkg-row .nm { display: flex; align-items: center; gap: 11px; min-width: 0; font-weight: 600; }
.pkg-row .nm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-row .nm .i { color: var(--accent); font-size: 16px; }
.pkg-row .ver { font: 12.5px var(--mono); color: var(--text-2); }
.pkg-row.head { padding-top: 4px; padding-bottom: 4px; background: transparent; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

.env-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 1.6fr) 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.env-head { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 1.6fr) 40px; gap: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }

.info-list { display: grid; gap: 6px; }
.info-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--tile); font-size: 13px; }
.info-list > div > span:first-child { color: var(--text-2); flex: none; }
.info-list > div > span:last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; font-weight: 500; }
.danger-card { border-color: color-mix(in srgb, var(--st-off) 35%, var(--border)); }
.danger-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 18px; }
.danger-row > div { flex: 1; min-width: 220px; }
.danger-row b { display: block; font-weight: 600; }
.danger-row small { color: var(--text-2); font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; align-items: start; }

.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-opt { display: grid; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--tile); font-size: 13px; font-weight: 600; text-align: left; transition: box-shadow .25s, background-color .25s; }
.theme-opt:hover { background: var(--tile-hover); }
.theme-opt.on { box-shadow: 0 0 0 2px var(--accent); }
.theme-prev { display: block; height: 70px; border-radius: var(--r-sm); }
.theme-prev.light { background: linear-gradient(#9000ff, #9000ff) 8px 9px / 4px 14px no-repeat, linear-gradient(#efe5ff, #efe5ff) 8px 9px / 22% 14px no-repeat, linear-gradient(#f3f2f8, #f3f2f8) 8px 28px / 22% 14px no-repeat, linear-gradient(#16c25a, #16c25a) 32% 9px / 3px 22px no-repeat, linear-gradient(#f3f2f8, #f3f2f8) 32% 9px / 62% 22px no-repeat, linear-gradient(#ef4444, #ef4444) 32% 38px / 3px 22px no-repeat, linear-gradient(#f3f2f8, #f3f2f8) 32% 38px / 62% 22px no-repeat, #ffffff; box-shadow: inset 0 0 0 1px #ebeaf1; }
.theme-prev.dark { background: linear-gradient(#a43dff, #a43dff) 8px 9px / 4px 14px no-repeat, linear-gradient(#2a1b47, #2a1b47) 8px 9px / 22% 14px no-repeat, linear-gradient(#1c1928, #1c1928) 8px 28px / 22% 14px no-repeat, linear-gradient(#16c25a, #16c25a) 32% 9px / 3px 22px no-repeat, linear-gradient(#1c1928, #1c1928) 32% 9px / 62% 22px no-repeat, linear-gradient(#ef4444, #ef4444) 32% 38px / 3px 22px no-repeat, linear-gradient(#1c1928, #1c1928) 32% 38px / 62% 22px no-repeat, #0b0a12; }

/* ───────────── warstwy ───────────── */

.overlay { position: fixed; inset: 0; z-index: 60; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; overflow-y: auto; background: var(--overlay); backdrop-filter: blur(2px); animation: fade .2s; }
.modal { width: min(470px, 100%); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .3s var(--ease); }
.modal.wide { width: min(580px, 100%); }
.modal-head { padding: 22px 22px 2px; }
.modal-title { font: 600 18px var(--head); letter-spacing: -.01em; }
.modal-text { margin-top: 5px; color: var(--text-2); font-size: 13.5px; }
.modal-body { display: grid; gap: 16px; padding: 18px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 22px; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--r); background: var(--tile); cursor: pointer; transition: background-color .25s, box-shadow .25s; }
.tpl:hover { background: var(--tile-hover); }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl:has(input:checked) { background: var(--tile-active); box-shadow: inset 0 0 0 2px var(--accent); }
.tpl-ic { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 18px; background: var(--surface); color: var(--text-2); margin-bottom: 8px; }
.tpl:has(input:checked) .tpl-ic { background: var(--accent); color: #fff; }
.tpl b { font-size: 14px; font-weight: 600; }
.tpl small { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

.menu { position: fixed; z-index: 80; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; text-align: left; transition: background-color .15s; }
.menu button .i, .menu a .i { color: var(--text-2); font-size: 15px; }
.menu button:hover, .menu a:hover { background: var(--tile); }
.menu .danger, .menu .danger .i { color: var(--st-text-off); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

.palette { width: min(620px, 100%); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: 17px; }
.palette-input input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 500; color: var(--text); }
.palette-list { max-height: min(420px, 56vh); overflow-y: auto; padding: 8px; }
.palette-sec { padding: 10px 10px 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; text-align: left; }
.palette-item > .i { color: var(--text-2); font-size: 16px; }
.palette-item small { color: var(--text-3); margin-left: 6px; font-weight: 400; }
.palette-item.on { background: var(--tile-active); }
.palette-item.on > .i { color: var(--accent); }
.palette-item kbd { margin-left: auto; }
.palette-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

.keys-list { display: grid; gap: 4px; }
.keys-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--tile); font-size: 13.5px; font-weight: 500; }
.keys-list .k { display: flex; gap: 4px; }
.keys-list kbd { background: var(--surface); }
.keys-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 6px; }
.keys-sec:first-child { margin-top: 0; }

#windows { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.fw { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 360px; min-height: 220px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; resize: both; animation: pop .3s var(--ease); }
.fw.focus { box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent); }
.fw-head { flex: none; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; cursor: grab; user-select: none; touch-action: none; }
.fw-head:active { cursor: grabbing; }
.fw-head > .i { color: var(--accent); font-size: 15px; }
.fw-btn { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-2); }
.fw-btn:hover { background: var(--tile); color: var(--text); }
.fw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.fw-body .ed-host { flex: 1; height: auto; min-height: 0; }
.fw.min { height: 40px !important; min-height: 0; resize: none; }
.fw.min .fw-body { display: none; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
body.has-uploads #toasts { bottom: 104px; }

/* kopie zapasowe — wiersze jak w Pterodactylu: ikona/kłódka, nazwa z rozmiarem, suma, „x temu / UTWORZONA”, menu */
#bk-list { display: grid; gap: 8px; }
.bk-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 36px; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-radius: var(--r); background: var(--tile); transition: background-color .25s; }
.bk-row:hover { background: var(--tile-hover); }
.bk-ic { font-size: 20px; color: var(--text-3); justify-self: center; }
.bk-ic.locked { color: var(--st-mid); }
.bk-ic.failed { color: var(--st-off); }
.bk-row .spin { width: 18px; height: 18px; justify-self: center; border-radius: 50%; border: 2px solid var(--inner); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.bk-name { min-width: 0; }
.bk-name b { font-size: 14.5px; font-weight: 600; }
.bk-name small { margin-left: 8px; font-size: 12px; color: var(--text-3); }
.bk-meta { margin-top: 3px; font: 12px var(--mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-err { color: var(--st-text-off); font-family: var(--font); }
.bk-time { display: grid; justify-items: end; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.bk-time small { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--text-3); }
.bk-foot { padding: 6px 4px 0; font-size: 12.5px; color: var(--text-3); text-align: right; }

/* kafelek przesyłania plików (prawy dolny róg) i okno ze szczegółami */
.up-tile {
  --st: var(--accent);
  position: fixed; right: 20px; bottom: 20px; z-index: 55;
  display: flex; align-items: center; gap: 14px; width: min(360px, calc(100vw - 40px));
  padding: 14px 16px 14px 20px; border-radius: var(--r); overflow: hidden; isolation: isolate;
  background: var(--surface); box-shadow: var(--shadow-lg); text-align: left; cursor: pointer;
  animation: fadeup .35s var(--ease) both; transition: transform .25s var(--ease);
}
.up-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); }
.up-tile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--st) 12%, transparent), transparent 70%); }
.up-tile:hover { transform: translateY(-2px); }
.up-tile.ok { --st: var(--st-on); }
.up-tile.err { --st: var(--st-off); }
.up-tile.idle { --st: var(--text-3); }
.up-tile > .i { font-size: 20px; color: var(--st); }
.up-tile b { display: block; font-size: 13.5px; font-weight: 600; }
.up-tile small { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tile .grow { min-width: 0; }
.up-tile .bar { display: block; margin-top: 8px; height: 5px; }
.up-tile .bar > i { background: var(--st); }
.up-pct { font: 600 15px var(--head); font-variant-numeric: tabular-nums; }
.uploads-modal { width: min(640px, 100%); }
.up-list { display: grid; gap: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.up-row { display: grid; gap: 7px; padding: 12px 14px; border-radius: var(--r); background: var(--tile); }
.up-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; font-weight: 600; }
.up-name > span:not(.tag) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .bar { margin-top: 0; }
.up-row.done .bar > i { background: var(--st-on); }
.up-row.error .bar > i, .up-row.canceled .bar > i { background: var(--st-off); }
.up-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.up-row.error .up-info { color: var(--st-text-off); }
.toast { --st: var(--accent); position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px; max-width: min(400px, calc(100vw - 40px)); padding: 12px 16px 12px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; pointer-events: auto; animation: pop .3s var(--ease); }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st); }
.toast > .i { font-size: 16px; color: var(--st); margin-top: 1px; }
.toast.ok { --st: var(--st-on); }
.toast.err { --st: var(--st-off); }
.toast.out { opacity: 0; transform: translateX(16px); transition: opacity .25s, transform .25s; }
.toast .bar { margin-top: 8px; width: 230px; }

#tooltip { position: fixed; z-index: 95; pointer-events: none; padding: 5px 9px; border-radius: 7px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; transition: opacity .15s; }
#tooltip.show { opacity: 1; }

/* ───────────── serwery Minecraft ───────────── */

select.input {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239b98aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select.input:disabled { cursor: progress; opacity: .7; }
.tpl-grid.four .tpl { padding: 13px 15px; }
.kind-pick .tpl { padding: 14px 16px; }
.check-label.eula { white-space: normal; align-items: flex-start; line-height: 1.45; padding: 12px 14px; border-radius: var(--r); background: var(--tile); color: var(--text); }
.check-label.eula input { margin-top: 2px; flex: none; }
.check-label a, .toggle-row small a, .banner a, .modal-text a { color: var(--accent-text); font-weight: 600; }
.check-label a:hover, .toggle-row small a:hover, .banner a:hover { text-decoration: underline; }
.span-2 { grid-column: 1 / -1; }
.mc-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.engine { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r); background: var(--tile); }
.engine-ic { width: 46px; height: 46px; flex: none; border-radius: var(--r); display: grid; place-items: center; font-size: 20px; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -10px var(--accent); }
.engine b { display: block; font: 600 16px var(--head); letter-spacing: -.01em; }
.engine small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }

.player { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 8px; margin-bottom: 6px; border-radius: var(--r); background: var(--tile); font-size: 13.5px; font-weight: 500; }
.player .mono { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.empty.sm { padding: 16px 10px 18px; }
.empty.sm .empty-ic { width: 44px; height: 44px; font-size: 20px; }

.link-copy { font-weight: 600; color: var(--accent-text); white-space: nowrap; cursor: pointer; }
.link-copy:hover { text-decoration: underline; }
.srv-players { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; font-weight: 600; color: var(--st-text-on); }
.srv-players:empty { display: none; }
.srv-players .i { font-size: 13px; }
/* polecenie uruchamiania i wersja Javy (jak „Startup” w Pterodactylu) */
.card-title.caps { font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.startup-row { align-items: stretch; }
.startup-row .card-head .check-label { font-size: 12.5px; }
.startup-cmd { display: block; width: 100%; padding: 14px 16px; border-radius: var(--r); background: var(--term-bg); border: 1px solid var(--border); color: var(--term-fg); font: 13px/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.startup-cmd { min-height: 120px; resize: vertical; }
.switch.sm { width: 34px; height: 20px; }
.switch.sm::after { top: 3px; left: 3px; width: 14px; height: 14px; }
.switch.sm[aria-checked="true"]::after { transform: translateX(14px); }
#java-box .btn { justify-self: start; }

.srv-addr { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; font: 500 12.5px var(--mono); color: var(--text-2); }
.srv-addr .i { font-size: 12px; color: var(--text-3); }
.stat-addr .tile-val { font-size: 18px; }
.addr-copy { max-width: 100%; letter-spacing: -.01em; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.addr-copy:hover { color: var(--accent-text); }

/* ───────────── logowanie ───────────── */

.auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; background: var(--bg); overflow: hidden; isolation: isolate; }
.auth::before { content: ''; position: absolute; inset: -20%; z-index: -1; background: radial-gradient(40% 35% at 20% 15%, rgba(144, 0, 255, .14), transparent 70%), radial-gradient(35% 30% at 85% 85%, rgba(144, 0, 255, .09), transparent 70%); }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; padding: 36px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .5s var(--ease); }
.auth-card .brand { justify-content: center; padding: 0 0 4px; }
.auth-card h2 { font: 600 22px var(--head); letter-spacing: -.02em; text-align: center; }
.auth-card .muted { font-size: 13.5px; color: var(--text-2); margin-top: -10px; text-align: center; }
.auth-card .btn { height: 46px; font-size: 14px; }

/* ───────────── responsywność ───────────── */

@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .srv { grid-template-columns: 52px minmax(0, 1fr) 90px 104px auto; }
  .srv .c-up { display: none; }
}
@media (max-width: 1080px) {
  .console-layout { grid-template-columns: minmax(0, 1fr); }
  .console-side { order: -1; position: static; }
  .console-layout .term-card .console { flex: none; height: 460px; min-height: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: auto; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); z-index: 46; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: var(--overlay); }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .topbar .brand { flex: 1; min-width: 0; padding: 0; font-size: 16px; }
  .topbar .brand svg { width: 30px; height: 30px; }
  .page { padding: 16px 14px 70px; }
  .grid-2, .fields-2 { grid-template-columns: minmax(0, 1fr); }
  .mtabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 14px; padding: 0 14px 2px; scrollbar-width: none; }
  .mtabs a { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 9px 13px; border-radius: var(--r); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--tile); }
  .mtabs a.on { background: var(--accent); color: #fff; }
  .srv { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }
  .srv .srv-ic { width: 44px; height: 44px; font-size: 19px; }
  .srv .srv-m { display: none; }  .frow { grid-template-columns: 32px minmax(0, 1fr) 40px; }
  .frow .c-size, .frow .c-date { display: none; }
  .fm-sel { left: 0; bottom: 14px; max-width: calc(100vw - 28px); flex-wrap: wrap; justify-content: center; }
  body.has-uploads .fm-sel { bottom: 98px; }
  .pkg-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .pkg-row .c-wanted { display: none; }
  .console, .console-layout .term-card .console { height: 380px; }
  .ed-host { height: calc(100vh - 260px); }
  .fw { left: 8px !important; right: 8px; width: auto !important; }
  #toasts { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .up-tile { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
  body.has-uploads #toasts { bottom: 98px; }
}
@media (max-width: 560px) {
  .tiles, .stats { gap: 8px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile, .stat { min-height: 0; padding: 13px 14px; }
  .tile-val { font-size: 19px; }
  .tile-bg { font-size: 66px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .page-head .btn { width: 100%; }
  .env-row, .env-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 40px; }
  .ln-t { display: none; }
  .auth-card { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* Użytkownicy i dziennik */
.u-card.u-off { opacity: .65; }
.u-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.u-checks { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; padding: 10px 12px; border-radius: var(--r); background: var(--tile); }
.u-pass { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 14px; border-radius: var(--r); background: var(--tile); }
.u-pass code { font: 600 17px var(--mono); letter-spacing: .5px; user-select: all; }
.u-scroll { overflow: auto; max-height: 520px; }
.u-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.u-tbl th { position: sticky; top: 0; background: var(--surface); text-align: left; padding: 10px 14px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.u-tbl td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.u-tbl .nw { white-space: nowrap; }
.u-tbl .u-det { word-break: break-word; color: var(--text-2); max-width: 420px; }
body[data-role="user"] [data-act="new-bot"] { display: none; }
.u-files { align-items: flex-start; white-space: normal; line-height: 1.45; padding: 10px 12px; border-radius: var(--r); background: var(--tile); margin-top: 12px; }
.u-files input { margin-top: 3px; flex: none; }

/* Użytkownicy — nowy wygląd */
.auth-card p.muted:empty { display: none; }
.u-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.u-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.u-card:hover { transform: translateY(-1px); }
.u-av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font: 700 19px var(--head); color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 40%, transparent); }
.u-dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: var(--text-3); }
.u-dot.on { background: #22c55e; } .u-dot.off { background: #ef4444; }
.u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.u-name { font: 600 15.5px var(--head); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.u-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font: 600 11px var(--head); background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.u-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.u-srvs { display: flex; flex-wrap: wrap; gap: 6px; }
.u-srv { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 500; background: var(--tile); color: var(--text); }
.u-none { font-size: 12px; color: var(--text-3); }
.u-act { display: flex; gap: 4px; flex: none; }
.u-ib { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.u-ib:hover { background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--tile)); color: var(--c, var(--accent-text)); }
.u-ib:active { transform: scale(.92); }
.u-ib.danger:hover { background: rgba(239, 68, 68, .14); color: #ef4444; }
.u-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.u-sw { cursor: pointer; }
.u-sw input { position: absolute; opacity: 0; pointer-events: none; }
.u-sw span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px transparent; transition: box-shadow .15s, transform .1s; }
.u-sw:hover span { transform: scale(1.1); }
.u-sw input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
@media (max-width: 640px) { .u-card { flex-wrap: wrap; } .u-act { width: 100%; justify-content: flex-end; } }
.u-act { gap: 8px; }
.u-ib { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); }
.u-ib .i { font-size: 21px !important; }
.u-ib:hover { border-color: var(--c, var(--accent)); }
.u-ib.danger { color: #ef4444; border-color: rgba(239, 68, 68, .35); }
.u-ib.danger:hover { border-color: #ef4444; }
.fm-power { display: inline-flex; padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--border); }
/* YAML: klucze wg poziomu wcięcia, wartości wg typu, kody kolorów MC */
.t-k0 { color: var(--t-kw); font-weight: 600; } .t-k1 { color: var(--t-fn); } .t-k2 { color: var(--t-glob); } .t-k3 { color: var(--t-lit); } .t-k4 { color: var(--t-num); }
.t-punc, .t-dash { color: var(--t-com); }
.t-yv { color: var(--t-prop); }
.t-mc, .t-mcf { color: var(--t-com); } /* kody kolorów MC (&a, &#hex) wyciszone, żeby nie odciągały wzroku od tekstu */
:root:not([data-theme="dark"]) .t-yv { color: #5b5470; }
