@font-face { font-family: Manrope; src: url(/fonts/manrope-latin-ext.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0; }
@font-face { font-family: Manrope; src: url(/fonts/manrope-latin.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }

:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eaeeec;
  --line: #d8dedb;
  --text: #121816;
  --muted: #55615c;
  --accent: #0f766e;
  --accent-soft: #d8f0ec;
  --accent-ink: #ffffff;
  --chart: #0d9488;
  --grid: #e3e8e5;
  --ok: #11734b;
  --warn: #8a5a00;
  --bad: #b3261e;
  --shadow: 0 1px 2px rgba(18, 24, 22, .05), 0 8px 24px rgba(18, 24, 22, .05);
  --radius: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1110;
  --surface: #141b19;
  --surface-2: #1c2523;
  --line: #2a3532;
  --text: #edf2f0;
  --muted: #9aa8a3;
  --accent: #2dd4bf;
  --accent-soft: #123a35;
  --accent-ink: #06201c;
  --chart: #0d9488;
  --grid: #232d2a;
  --ok: #5fd39c;
  --warn: #e3b55a;
  --bad: #f4928a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(30px, 6vw, 46px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; overflow-wrap: anywhere; }
.eyebrow { color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.lead { color: var(--muted); font-size: 17px; margin-top: 12px; max-width: 58ch; }
.hint, .help { color: var(--muted); font-size: 13px; }
.msg { min-height: 1.5em; font-size: 14px; color: var(--muted); }
.msg.is-error { color: var(--bad); }
.success { color: var(--ok); font-weight: 600; margin-bottom: 16px; }
.stack { display: grid; gap: 14px; margin-top: 24px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { opacity: .9; }
.btn--ghost { background: transparent; }
.btn--lg { min-height: 48px; padding: 10px 22px; font-size: 15px; }
.btn--small { min-height: 30px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border-radius: 8px; }
.btn--danger { color: var(--bad); }
.btn--danger:hover { border-color: var(--bad); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; }
.theme-btn:hover { color: var(--text); border-color: var(--accent); }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; min-width: 0; }
input, select, textarea { font: inherit; font-weight: 500; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); min-width: 0; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
.input-suffix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.input-suffix input { border: 0; border-radius: 0; background: transparent; flex: 1; }
.input-suffix span { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); white-space: nowrap; font-size: 13px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.logo__mark { display: grid; place-items: center; height: 30px; padding: 0 8px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; }

/* Strona z instrukcją */
.public { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.site-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.intro { padding: 28px 0 24px; }
.account-note { display: flex; gap: 14px; padding: 18px; background: var(--accent-soft); border-radius: var(--radius); }
.account-note h2 { font-size: 16px; margin-bottom: 2px; }
.account-note p { font-size: 14px; overflow-wrap: anywhere; }
.account-note__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface); border-radius: 10px; color: var(--accent); }
.device-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 28px; padding: 5px; background: var(--surface-2); border-radius: 14px; }
.device-tabs button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.device-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.device-panel { margin-top: 14px; padding: clamp(18px, 4vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.device-panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.device-panel__head p { color: var(--muted); font-size: 14px; }
.steps { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: step; display: grid; gap: 22px; }
.steps li { position: relative; padding-left: 46px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; }
.steps h3 { margin-bottom: 3px; }
.steps p { color: var(--muted); font-size: 14.5px; }
.steps .btn { margin-top: 10px; margin-right: 6px; }
.after, .faq { margin-top: 44px; }
.after__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.after__grid article { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.after__grid h3 { margin-bottom: 6px; }
.after__grid p { color: var(--muted); font-size: 14px; }
.faq details { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.faq summary { padding: 14px 18px; font-weight: 700; cursor: pointer; }
.faq details > :not(summary) { margin: 0 18px 14px; color: var(--muted); font-size: 14.5px; }
.server-data { display: grid; gap: 8px; padding: 12px 14px; background: var(--bg); border-radius: 10px; }
.server-data div { display: flex; justify-content: space-between; gap: 12px; }
.server-data dt { color: var(--muted); }
.server-data dd { margin: 0; color: var(--text); font-weight: 700; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 56px; padding: 22px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.admin-login { text-align: right; }
.admin-login summary { cursor: pointer; list-style: none; }
.admin-login summary::-webkit-details-marker { display: none; }
.admin-login__body { display: grid; gap: 10px; justify-items: end; margin-top: 12px; }
.card-page { max-width: 520px; padding: 40px 0; }

/* Panel */
.panel { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.side__top { padding: 0 8px 6px; }
.side__nav { display: grid; gap: 2px; align-content: start; flex: 1; }
.side__group { margin: 14px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side__nav button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.side__nav button:hover { background: var(--surface-2); color: var(--text); }
.side__nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.side__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side__foot .btn { flex: 1; min-height: 36px; }
.conn { display: flex; align-items: center; gap: 7px; width: 100%; font-size: 12.5px; color: var(--muted); }
.conn b { font-weight: 600; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.is-live i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.conn.is-down i { background: var(--bad); }
.view { padding: 28px clamp(16px, 3vw, 36px) 60px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; max-width: 1240px; width: 100%; }
.view__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.view__head h1 { font-size: 26px; }
.view__head p { color: var(--muted); font-size: 14px; margin-top: 3px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tile { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tile__label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile__value { margin-top: 2px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile__note { color: var(--muted); font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.card h2 { font-size: 16px; }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; }
th, td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 120px; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; }
.empty { color: var(--muted); padding: 10px 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 20px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.tag--ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.tag--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tag--bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form .field { flex: 1 1 180px; }
.settings { display: grid; gap: 16px; max-width: 560px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; }
.switch-row > div { min-width: 0; }
.switch-row h3 { font-size: 14.5px; }
.switch { position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px; border: 0; padding: 0; border-radius: 20px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: default; }
.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.ext { display: flex; justify-content: space-between; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ext h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14.5px; margin-bottom: 4px; }
.ext p { color: var(--muted); font-size: 13.5px; }
.ext .mono { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.ext--error { border-color: var(--bad); }
.ext > div { min-width: 0; flex: 1; }
.ext__options { margin-top: 10px; font-size: 13.5px; }
.ext__options summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.ext__form { display: grid; gap: 10px; margin-top: 10px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.section-title { margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.lib-list { display: grid; gap: 0; }
.lib-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lib-row:last-child { border-bottom: 0; }
.lib-row { align-items: flex-start; padding: 13px 0; }
.lib-row__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lib-row__main h3 { font-size: 14.5px; }
.lib-note { font-size: 13px; color: var(--warn); }
.lib-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px; color: var(--muted); }
.option-key { font: 11px ui-monospace, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
.lib-row__main .ext__options { margin-top: 2px; }
.lib-row .actions { flex: none; align-self: flex-start; }
.lib-row a { overflow-wrap: anywhere; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row b { display: block; font-size: 14px; }
.check-row small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.check-row svg { margin-top: 2px; }
.is-ok { color: var(--ok); }
.is-fail { color: var(--bad); }
.log { margin: 0; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; }
.log .lvl-error { color: var(--bad); }
.log .lvl-warn { color: var(--warn); }

.chat { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.bubble { justify-self: start; max-width: min(78%, 640px); padding: 9px 13px; border-radius: 14px; background: var(--surface-2); overflow-wrap: anywhere; }
.bubble p { white-space: pre-wrap; }
.bubble small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.bubble--own { justify-self: end; background: var(--accent-soft); }
.bubble--locked p { color: var(--muted); font-style: italic; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart__grid { stroke: var(--grid); stroke-width: 1; }
.chart__axis { fill: var(--muted); font: 11px Manrope, system-ui, sans-serif; }
.chart__line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__bar { fill: var(--chart); }
.chart__bar.is-hover { opacity: .75; }
.chart__cross { stroke: var(--muted); stroke-width: 1; }
.chart__dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart__tip { position: absolute; top: 0; padding: 5px 9px; background: var(--text); color: var(--bg); border-radius: 8px; font-size: 12px; font-weight: 600; pointer-events: none; white-space: nowrap; transform: translateX(-50%); }
.chart-table summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }

.dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 22px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(5, 10, 9, .6); }
.dialog h2 { margin-bottom: 10px; font-size: 18px; overflow-wrap: anywhere; }
.dialog > .inline-form, .dialog > .help { margin-top: 12px; }
.member-list { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.member-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row .mono { min-width: 0; }
.dialog p { color: var(--muted); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.secret { display: block; padding: 12px; margin: 10px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: 14px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; color: var(--text); }

@media (max-width: 820px) {
  .panel { display: block; }
  .side { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side__nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side__nav button { flex: none; }
  .side__group { display: none; }
  .side__foot { padding-top: 10px; }
  .conn { width: auto; flex: 1; }
  .side__foot .btn { flex: none; }
}
@media (max-width: 480px) {
  .device-tabs button { flex-direction: column; gap: 2px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
