/* FUTURE OS — warstwa wizualna
   Paleta: glebia kosmosu + holograficzny cyjan i fiolet. Akcent sterowany
   zmienna --accent (ustawienia). Wszystko na fontach systemowych, bez CDN. */

:root {
  --accent: #5ef2ff;
  --accent-2: #a86bff;
  --bg: #05070d;
  --ink: #e6f1ff;
  --ink-dim: #8ea3bf;
  --ink-mute: #5b6d87;
  --glass: rgba(10, 16, 30, 0.62);
  --glass-strong: rgba(8, 12, 24, 0.86);
  --line: rgba(120, 170, 255, 0.16);
  --line-strong: rgba(94, 242, 255, 0.45);
  --ok: #4ff0a3;
  --warn: #ffc857;
  --err: #ff5d7a;
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
  --topbar-h: 40px;
  --dock-h: 66px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-dim); }
.mono { font-family: var(--mono); }

#wallpaper { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

.screen { position: fixed; inset: 0; z-index: 1; }

/* Szklo ------------------------------------------------------------------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Przyciski / pola ---------------------------------------------------------- */
.btn {
  background: rgba(120, 170, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: rgba(94, 242, 255, 0.10); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 70%, #fff 0%), var(--accent-2));
  color: #04101a; font-weight: 600; border: 0;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn.danger { border-color: rgba(255, 93, 122, .4); color: var(--err); }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
.btn.icon { padding: 5px 8px; line-height: 1; }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=password], input[type=search], input:not([type]), textarea, select {
  background: rgba(3, 6, 14, 0.6);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  outline: none;
  color: var(--ink);
  user-select: text;
}
input:focus, textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }

/* Rozruch ------------------------------------------------------------------- */
#boot { display: grid; place-items: center; background: radial-gradient(ellipse at center, #0a1020 0%, var(--bg) 70%); }
.boot-core { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(520px, 90vw); }
.boot-logo { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.boot-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent); border-right-color: var(--accent-2);
  animation: spin 1.6s linear infinite;
  filter: drop-shadow(0 0 12px var(--accent));
}
.boot-ring::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%;
  border: 1px dashed rgba(94, 242, 255, .35); animation: spin 6s linear infinite reverse;
}
.boot-glyph { font: 700 54px var(--mono); color: var(--accent); text-shadow: 0 0 30px var(--accent); }
.boot-title { margin: 0; font: 300 42px/1 var(--font); letter-spacing: .5em; padding-left: .5em; }
.boot-title span { font-weight: 700; color: var(--accent); }
.boot-bar { width: 100%; height: 3px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; box-shadow: 0 0 12px var(--accent); }
.boot-log { margin: 0; width: 100%; height: 150px; overflow: hidden; font: 12px/1.5 var(--mono); color: var(--ink-mute); white-space: pre-wrap; }
.boot-log .ok { color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Logowanie ----------------------------------------------------------------- */
#login { display: grid; place-items: center; }
.login-card {
  width: min(400px, 92vw); padding: 36px 34px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center;
  animation: rise .5s cubic-bezier(.2, .8, .2, 1);
}
.login-avatar {
  width: 78px; height: 78px; margin: 0 auto 4px; border-radius: 50%;
  display: grid; place-items: center; font: 700 34px var(--mono); color: #04101a;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent);
}
.login-card h2 { margin: 0; font-weight: 500; letter-spacing: .04em; }
.login-card .field { text-align: left; }
.login-card input { font-family: var(--mono); letter-spacing: .2em; }
.login-error { min-height: 1.2em; margin: 0; color: var(--err); font-size: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* Pulpit -------------------------------------------------------------------- */
#desktop { display: block; }
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 12px; border-width: 0 0 1px; z-index: 5000; box-shadow: none;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; }
.tb-right { justify-content: flex-end; }
.tb-logo {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer;
  font-weight: 600; letter-spacing: .25em; font-size: 12px; padding: 4px 8px; border-radius: 8px;
}
.tb-logo:hover { background: rgba(94, 242, 255, .1); }
.tb-logo span {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font: 700 12px var(--mono); color: #04101a; letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.tb-host { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.tb-center { display: flex; align-items: baseline; gap: 10px; }
.tb-clock { font: 500 15px var(--mono); letter-spacing: .08em; }
.tb-date { font-size: 12px; color: var(--ink-dim); }
.tb-meter { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-dim); }
.tb-meter i { width: 56px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); position: relative; overflow: hidden; }
.tb-meter i::after { content: ""; position: absolute; inset: 0; width: var(--v, 0%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.tb-meter b { font: 500 11px var(--mono); width: 38px; text-align: right; color: var(--ink); }
.tb-net { display: flex; flex-direction: column; font: 10px/1.15 var(--mono); color: var(--ink-dim); min-width: 78px; }
.tb-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 3px 8px; cursor: pointer; font-size: 15px; position: relative; }
.tb-btn:hover { border-color: var(--line); background: rgba(94, 242, 255, .08); }
.tb-btn .dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--err); display: none; }
.tb-btn .dot.on { display: block; }

#workspace { position: absolute; top: var(--topbar-h); left: 0; right: 0; bottom: 0; }

/* Dok ----------------------------------------------------------------------- */
#dock {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  height: var(--dock-h); padding: 8px 12px; border-radius: 20px;
  display: flex; align-items: center; gap: 6px; z-index: 5000;
}
.dock-item {
  position: relative; width: 50px; height: 50px; border-radius: 14px; border: 0; cursor: pointer;
  background: transparent; display: grid; place-items: center; color: var(--ink);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s;
}
.dock-item svg { width: 26px; height: 26px; }
.dock-item:hover { transform: translateY(-6px) scale(1.12); background: rgba(94, 242, 255, .1); }
.dock-item::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .2s;
  box-shadow: 0 0 8px var(--accent);
}
.dock-item.running::after { opacity: 1; }
.dock-item .tip {
  position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%) translateY(6px);
  padding: 4px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  background: var(--glass-strong); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: .15s;
}
.dock-item:hover .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.dock-sep { width: 1px; height: 34px; background: var(--line); margin: 0 4px; }

/* Okna ---------------------------------------------------------------------- */
.win {
  position: absolute; min-width: 320px; min-height: 200px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: winIn .22s cubic-bezier(.2, .8, .2, 1);
  transition: opacity .18s, transform .18s;
}
.win.focused { border-color: rgba(94, 242, 255, .35); box-shadow: 0 40px 100px rgba(0,0,0,.65), 0 0 0 1px rgba(94,242,255,.25), 0 0 40px color-mix(in srgb, var(--accent) 12%, transparent); }
.win.minimized { opacity: 0; transform: scale(.85) translateY(40vh); pointer-events: none; }
.win.maximized { border-radius: 0; }
.win.closing { opacity: 0; transform: scale(.94); }
@keyframes winIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.win-title {
  height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line); cursor: default; flex: none;
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.win-title svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.win-title .name { flex: 1; font-size: 13px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-ctl { display: flex; gap: 6px; }
.win-ctl button {
  width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  cursor: pointer; display: grid; place-items: center; font-size: 11px; color: var(--ink-dim); padding: 0;
}
.win-ctl button:hover { color: var(--ink); border-color: var(--line-strong); }
.win-ctl button.close:hover { background: rgba(255, 93, 122, .2); border-color: var(--err); color: var(--err); }
.win-body { flex: 1; min-height: 0; position: relative; overflow: auto; user-select: text; }
.win-body.noscroll { overflow: hidden; }
.win-resize { position: absolute; z-index: 3; }
.win-resize.e { top: 0; right: -3px; width: 7px; height: 100%; cursor: ew-resize; }
.win-resize.s { bottom: -3px; left: 0; height: 7px; width: 100%; cursor: ns-resize; }
.win-resize.w { top: 0; left: -3px; width: 7px; height: 100%; cursor: ew-resize; }
.win-resize.se { right: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nwse-resize; }
.win-resize.sw { left: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nesw-resize; }

/* Uruchamiacz / paleta ------------------------------------------------------- */
.overlay { position: absolute; inset: 0; z-index: 6000; background: rgba(2, 4, 10, .45); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: 12vh; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.launcher-panel { width: min(760px, 92vw); padding: 18px; border-radius: 22px; display: flex; flex-direction: column; gap: 16px; }
.launcher-panel input, .palette-panel input { width: 100%; font-size: 16px; padding: 12px 16px; border-radius: 12px; }
.launcher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.launch-item {
  background: transparent; border: 1px solid transparent; border-radius: 14px; padding: 16px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink); transition: .15s;
}
.launch-item:hover, .launch-item.active { background: rgba(94, 242, 255, .08); border-color: var(--line); }
.launch-item svg { width: 34px; height: 34px; color: var(--accent); }
.launch-item span { font-size: 12px; }
.palette-panel { width: min(640px, 92vw); padding: 12px; border-radius: 18px; }
#palette-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
#palette-list li { padding: 9px 14px; border-radius: 10px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
#palette-list li.active, #palette-list li:hover { background: rgba(94, 242, 255, .1); }
#palette-list li svg { width: 16px; height: 16px; color: var(--accent); }
#palette-list li .k { margin-left: auto; font: 11px var(--mono); color: var(--ink-mute); }

/* Powiadomienia ------------------------------------------------------------- */
#notif-center { position: absolute; top: calc(var(--topbar-h) + 8px); right: 10px; width: 340px; max-height: 70vh; border-radius: 16px; z-index: 5500; display: flex; flex-direction: column; overflow: hidden; }
#notif-center header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
#notif-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
#notif-list:empty::after { content: "Brak powiadomień"; color: var(--ink-mute); text-align: center; padding: 30px 0; display: block; font-size: 13px; }
.notif { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); border-left: 3px solid var(--accent); font-size: 13px; }
.notif.warn { border-color: var(--warn); } .notif.err { border-color: var(--err); } .notif.ok { border-color: var(--ok); }
.notif time { display: block; font: 10px var(--mono); color: var(--ink-mute); margin-top: 2px; }
#toasts { position: absolute; top: calc(var(--topbar-h) + 10px); right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 7000; pointer-events: none; }
.toast {
  min-width: 260px; max-width: 360px; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: var(--glass-strong); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  box-shadow: var(--shadow); animation: toastIn .25s cubic-bezier(.2,.8,.2,1); pointer-events: auto;
}
.toast.warn { border-left-color: var(--warn); } .toast.err { border-left-color: var(--err); } .toast.ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* Wspolne elementy aplikacji ------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100%; }
.app-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.app-toolbar .grow { flex: 1; }
.app-toolbar input { padding: 5px 10px; }
.app-content { flex: 1; min-height: 0; overflow: auto; }
.app-status { padding: 4px 10px; border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--ink-dim); flex: none; display: flex; gap: 14px; }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; cursor: pointer; color: var(--ink-dim); font-size: 13px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); padding: 8px 10px; position: sticky; top: 0; background: rgba(8,12,24,.95); border-bottom: 1px solid var(--line); z-index: 1; }
table.grid td { padding: 6px 10px; border-bottom: 1px solid rgba(120,170,255,.06); white-space: nowrap; }
table.grid tr:hover td { background: rgba(94,242,255,.05); }
table.grid td.mono, table.grid .mono { font-family: var(--mono); font-size: 12px; }
table.grid td.num { text-align: right; font-family: var(--mono); }
table.grid tr.sel td { background: rgba(94,242,255,.12); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font: 11px var(--mono); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: rgba(79,240,163,.4); background: rgba(79,240,163,.08); }
.pill.err { color: var(--err); border-color: rgba(255,93,122,.4); background: rgba(255,93,122,.08); }
.pill.warn { color: var(--warn); border-color: rgba(255,200,87,.4); background: rgba(255,200,87,.08); }
.pill.mute { color: var(--ink-mute); }
.dotst { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--ink-mute); vertical-align: middle; }
.dotst.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dotst.err { background: var(--err); box-shadow: 0 0 8px var(--err); }
.dotst.warn { background: var(--warn); }
.empty { padding: 40px; text-align: center; color: var(--ink-mute); }
pre.log { margin: 0; padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; color: #c9d7ea; user-select: text; }
pre.log .l-err { color: var(--err); } pre.log .l-warn { color: var(--warn); } pre.log .l-ok { color: var(--ok); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; padding: 14px 16px; font-size: 13px; }
.kv dt { color: var(--ink-dim); } .kv dd { margin: 0; font-family: var(--mono); font-size: 12px; user-select: text; }
.section-title { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); padding: 14px 16px 4px; }

/* Monitor ------------------------------------------------------------------- */
.mon { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 12px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,.02); }
.card h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); font-weight: 500; display: flex; justify-content: space-between; }
.card h4 b { color: var(--ink); font-family: var(--mono); font-weight: 500; letter-spacing: 0; text-transform: none; }
.card canvas { width: 100%; height: 70px; display: block; }
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge canvas { width: 84px; height: 84px; flex: none; }
.gauge .big { font: 500 26px var(--mono); }
.gauge .sub { font-size: 12px; color: var(--ink-dim); }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 40px; margin-top: 8px; }
.bars i { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .4s; opacity: .85; }
.hbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; margin: 6px 0; }
.hbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.hbar.warn i { background: linear-gradient(90deg, var(--warn), var(--err)); }
.card.wide { grid-column: 1 / -1; }

/* Terminal ------------------------------------------------------------------ */
.term-wrap { position: absolute; inset: 0; padding: 6px 0 6px 8px; background: #030509; }
.term-wrap .xterm { height: 100%; }
.term-wrap .xterm .xterm-viewport { background: transparent !important; }

/* Pliki --------------------------------------------------------------------- */
.crumbs { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 12px; flex: 1; overflow: hidden; }
.crumbs button { background: none; border: 0; color: var(--ink-dim); cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.crumbs button:hover { color: var(--accent); background: rgba(94,242,255,.08); }
.crumbs button:last-child { color: var(--ink); }
.files-split { display: flex; height: 100%; }
.files-list { flex: 1; min-width: 0; overflow: auto; }
.files-editor { flex: 1.2; min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.files-editor textarea { flex: 1; resize: none; border: 0; border-radius: 0; font: 13px/1.5 var(--mono); padding: 12px; background: rgba(0,0,0,.35); }
.files-editor .ed-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.files-editor .ed-head .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.fe td:first-child svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 8px; color: var(--accent); }
tr.fe.dir td:first-child { color: var(--ink); } tr.fe td:first-child { color: var(--ink-dim); cursor: default; }
.dropzone { outline: 2px dashed var(--accent); outline-offset: -8px; }

/* Notatki ------------------------------------------------------------------- */
.notes-split { display: flex; height: 100%; }
.notes-list { width: 220px; flex: none; border-right: 1px solid var(--line); overflow: auto; }
.note-item { padding: 10px 12px; border-bottom: 1px solid rgba(120,170,255,.06); cursor: pointer; }
.note-item:hover, .note-item.active { background: rgba(94,242,255,.08); }
.note-item b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item small { color: var(--ink-mute); font-family: var(--mono); font-size: 10px; }
.notes-edit { flex: 1; display: flex; flex-direction: column; }
.notes-edit input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 16px; padding: 10px 14px; background: transparent; }
.notes-edit textarea { flex: 1; border: 0; border-radius: 0; resize: none; background: transparent; padding: 12px 14px; font: 13px/1.6 var(--mono); }

/* Ustawienia ---------------------------------------------------------------- */
.settings { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.settings .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #fff; box-shadow: 0 0 10px currentColor; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; cursor: pointer; color: var(--ink-dim); font-size: 13px; }
.seg button.active { background: rgba(94,242,255,.12); color: var(--accent); }

/* Tryb mobilny / PWA ----------------------------------------------------------
   Klase body.mobile ustawia menedzer okien (max-width: 768px). Okna zajmuja
   caly obszar miedzy paskiem a dokiem, dok staje sie dolnym paskiem kart,
   a #home to ekran startowy z siatka aplikacji. env(safe-area-inset-*)
   omija notch i pasek gestow w trybie standalone. */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
#home { position: absolute; inset: 0; overflow: auto; padding: 24px 16px 16px; -webkit-overflow-scrolling: touch; }
.home-head { text-align: center; margin-bottom: 22px; }
.home-title { font: 300 30px/1 var(--font); letter-spacing: .45em; padding-left: .45em; }
.home-title b { font-weight: 700; color: var(--accent); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.home-grid .launch-item { padding: 18px 6px 14px; }

body.mobile {
  --topbar-h: calc(44px + var(--sat));
  --dock-h: calc(60px + var(--sab));
}
body.mobile #topbar { padding-top: var(--sat); grid-template-columns: auto 1fr auto; gap: 8px; }
body.mobile .tb-net, body.mobile .tb-host, body.mobile .tb-date, body.mobile #tb-palette { display: none; }
body.mobile .tb-logo { letter-spacing: .15em; padding: 4px; }
body.mobile .tb-center { justify-content: center; }
body.mobile .tb-clock { font-size: 14px; }
body.mobile .tb-meter i { width: 30px; }
body.mobile .tb-meter b { width: 32px; }
body.mobile .tb-meter span { display: none; }
body.mobile #workspace { bottom: var(--dock-h); }
body.mobile #dock {
  left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; border-width: 1px 0 0;
  height: var(--dock-h); padding: 4px 6px var(--sab); gap: 0; justify-content: space-around;
  overflow-x: auto; scrollbar-width: none; box-shadow: none;
}
body.mobile #dock::-webkit-scrollbar { display: none; }
body.mobile .dock-item { width: 46px; height: 46px; flex: none; }
body.mobile .dock-item:hover { transform: none; }
body.mobile .dock-item .tip, body.mobile .dock-sep { display: none; }
body.mobile .win.mobile-full {
  left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
  min-width: 0; min-height: 0; border-radius: 0; border-width: 0; box-shadow: none; animation: winInMobile .2s ease-out;
  /* Okna leza jedno na drugim na calym ekranie - szklo przepuszczaloby tekst spodniego. */
  background: #070b16; backdrop-filter: none; -webkit-backdrop-filter: none;
}
@keyframes winInMobile { from { opacity: 0; transform: translateY(14px); } }
body.mobile .win.minimized { transform: translateY(40vh); }
body.mobile .win-resize { display: none; }
body.mobile .win-title { height: 44px; }
body.mobile .win-ctl button { width: 30px; height: 30px; font-size: 13px; }
body.mobile .win-ctl button:not(.close) { display: none; }
body.mobile .overlay { padding-top: calc(var(--sat) + 8px); }
body.mobile .launcher-panel, body.mobile .palette-panel { width: 96vw; }
body.mobile #notif-center { left: 8px; right: 8px; width: auto; }
body.mobile #toasts { left: 12px; right: 12px; }
body.mobile .toast { max-width: none; min-width: 0; }
body.mobile .login-card { padding: 28px 22px; }
body.mobile input, body.mobile textarea, body.mobile select { font-size: 16px; } /* iOS: bez auto-zoomu */
body.mobile .app-toolbar { gap: 6px; padding: 6px 8px; }
body.mobile .app-toolbar input { min-width: 0; flex: 1 1 120px; width: auto !important; }
body.mobile .files-split, body.mobile .notes-split { flex-direction: column; }
body.mobile .files-editor { border-left: 0; border-top: 1px solid var(--line); min-height: 45%; }
body.mobile .notes-list { width: auto; max-height: 34%; border-right: 0; border-bottom: 1px solid var(--line); }
body.mobile .mon { grid-template-columns: 1fr; }
body.mobile table.grid td { white-space: normal; word-break: break-word; }
body.mobile .btn.tiny { padding: 6px 10px; }
body.mobile .term-wrap { padding: 4px 0 4px 4px; }
body.mobile .settings { padding: 8px 12px 20px; }
body.mobile .settings .row { flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120,170,255,.18); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(94,242,255,.4); }
