:root {
  --bg: #0a0a0b;
  --side: #0d0d0f;
  --card: #141416;
  --card-2: #1a1a1d;
  --card-3: #222226;
  --line: #222225;
  --line-2: #2c2c31;
  --text: #f2f2f3;
  --muted: #8f8f96;
  --faint: #5f5f66;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, .12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, .12);
  --amber: #f5b13d;
  --amber-bg: rgba(245, 177, 61, .12);
  --blue: #3b82f6;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--green); }
.down { color: var(--red); }
::selection { background: rgba(255, 255, 255, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26262a; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #1a1a1f 0%, transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 28px 28px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.login-card .logo { margin: 0 auto 18px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input {
  width: 56px; height: 64px; text-align: center; font-size: 26px; font-weight: 600;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 14px; outline: none;
  transition: border-color .15s, background .15s;
}
.pin input:focus { border-color: #55555c; background: #1f1f23; }
.pin.err input { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.login-err { color: var(--red); min-height: 20px; margin-top: 14px; font-size: 13px; }

.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(180deg, #232327, #161618); border: 1px solid var(--line-2);
}
.logo svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side);
  border-right: 1px solid var(--line); padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 18px 32px 0; background: linear-gradient(var(--bg) 75%, rgba(10, 10, 11, 0));
}
.topbar h1 { font-size: 19px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; }
.topbar h1 .ic { color: var(--muted); }
.topbar .grow { flex: 1; }
.btn.menu-btn { display: none; }
.content { padding: 18px 32px 120px; display: flex; flex-direction: column; gap: 18px; max-width: 1480px; width: 100%; }

/* switcher */
.switcher { position: relative; }
.switch-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); text-align: left;
}
.switch-btn:hover { background: var(--card-2); }
.switch-btn .avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #1f1f23; border: 1px solid var(--line-2); }
.switch-btn .name { flex: 1; min-width: 0; }
.switch-btn .name b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-btn .name span { display: block; font-size: 12px; color: var(--muted); }
.dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #151518;
  border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  max-height: 70vh; overflow-y: auto;
}
.dropdown .dd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.dd-item:hover, .dd-item.on { background: var(--card-3); }
.dd-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }

.search {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-top: 8px; border-radius: 12px;
  color: var(--muted); border: 1px solid transparent; background: transparent; width: 100%; text-align: left;
}
.search:hover { background: var(--card); border-color: var(--line); }
.search span { flex: 1; }
kbd {
  font: 500 11px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--card-2);
  border: 1px solid var(--line-2); color: var(--muted);
}
.nav-label { font-size: 12px; color: var(--faint); padding: 14px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: #c9c9ce;
  border: 1px solid transparent; cursor: pointer; width: 100%; background: none; text-align: left;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.on { background: var(--card-2); border-color: var(--line); color: var(--text); }
.nav-item .ic { color: var(--muted); }
.nav-item.on .ic { color: var(--text); }
.nav-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .cnt { font-size: 11px; color: var(--faint); }
.divider { height: 1px; background: var(--line); margin: 10px 4px; }
.folder { width: 16px; height: 13px; border-radius: 3px; position: relative; flex: none; }
.folder::before { content: ""; position: absolute; left: 0; top: -2px; width: 7px; height: 4px; border-radius: 2px 2px 0 0; background: inherit; }
.spacer { flex: 1; min-height: 12px; }

.vps-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.vps-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vps-card .head .logo { width: 34px; height: 34px; border-radius: 10px; }
.vps-card .head b { display: block; font-weight: 600; }
.vps-card .head span { font-size: 12px; color: var(--muted); }
.meter { margin-top: 9px; }
.meter .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.meter .row b { color: var(--text); font-weight: 500; }
.bar { height: 5px; border-radius: 5px; background: #232327; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: #e6e6e8; transition: width .6s; }
.bar i.hot { background: var(--amber); }
.bar i.crit { background: var(--red); }

/* ------------------------------------------------------------------ elementy */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 14px; color: #d6d6da; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--muted); }
.big { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.kpi { padding: 22px 24px 20px; }
.kpi .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #cfcfd4; font-size: 13.5px; }
.kpi .val { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi .val small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.kpi .val.text { font-size: 20px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge .bi { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; }
.badge.up .bi { background: var(--green); color: #052e14; }
.badge.down .bi { background: var(--red); color: #3b0909; }
.badge .bi svg { width: 11px; height: 11px; stroke-width: 3; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; background: var(--card-3); color: #d0d0d5; white-space: nowrap;
}
.pill.ok { background: var(--green-bg); color: #6ee79a; }
.pill.bad { background: var(--red-bg); color: #ff8a8a; }
.pill.warn { background: var(--amber-bg); color: #ffc66d; }
.pill .dot { box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px;
  border-radius: 11px; border: 1px solid var(--line-2); background: var(--card-2); font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--card-3); border-color: #3a3a40; }
.btn.primary { background: #f2f2f3; color: #0b0b0c; border-color: #f2f2f3; }
.btn.primary:hover { background: #fff; }
.btn.danger { color: #ff8a8a; }
.btn.danger:hover { background: var(--red-bg); border-color: rgba(239, 68, 68, .35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* segmented / zakładki */
.seg { display: inline-flex; padding: 3px; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--card-3); color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; color: var(--muted); padding: 10px 14px 12px; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.tabs .cnt { font-size: 11px; background: var(--card-3); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.proj-tabs { padding: 0 32px; margin-top: 14px; }

/* tabele */
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 24px; border-bottom: 1px solid #1c1c1f; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #17171a; }
.empty { color: var(--faint); padding: 18px 0 6px; text-align: center; font-size: 13px; }

/* karty skryptów */
.projects { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 14px; padding: 18px; cursor: pointer; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: #34343a; }
.pcard .ph { display: flex; gap: 12px; align-items: flex-start; }
.pcard .pic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); flex: none; }
.pcard .pt { flex: 1; min-width: 0; }
.pcard .pt b { display: block; font-size: 15px; font-weight: 600; }
.pcard .pt span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcard .stats div { background: var(--card-2); border-radius: 10px; padding: 8px 10px; }
.pcard .stats small { display: block; font-size: 11px; color: var(--faint); }
.pcard .stats b { font-weight: 500; font-size: 13px; }
.pcard .actions { display: flex; gap: 8px; }
.pcard .actions .btn { flex: 1; }

/* wykres */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tip {
  position: absolute; pointer-events: none; background: #1d1d21; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; white-space: nowrap; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); z-index: 5;
  transform: translate(-50%, -100%); margin-top: -12px;
}
.chart .tip .d { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.chart .tip .s { display: flex; align-items: center; gap: 8px; }
.chart .tip .s i { width: 8px; height: 8px; border-radius: 50%; }
.chart .tip .s b { margin-left: 10px; font-weight: 600; }
.chart .xpill {
  position: absolute; bottom: 0; transform: translateX(-50%); background: #f2f2f3; color: #0b0b0c; font-size: 12px;
  font-weight: 600; padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; }

/* logi i konsola */
.logbox, .term {
  background: #08080a; border: 1px solid var(--line); border-radius: 12px; font: 12.5px/1.6 var(--mono);
  padding: 12px 14px; overflow: auto; height: calc(100vh - 290px); min-height: 340px; white-space: pre; color: #cfcfd4;
}
.logbox.wrap, .term.wrap { white-space: pre-wrap; word-break: break-word; }
.logbox .l { display: block; }
.logbox .ts { color: var(--faint); margin-right: 12px; user-select: none; }
.logbox .e { color: #ff8a8a; }
.logbox .w { color: #ffc66d; }
.logbox mark { background: rgba(245, 177, 61, .3); color: inherit; border-radius: 3px; }
.term { color: #e4e4e7; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.inp {
  width: 100%; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px;
  outline: none; transition: border-color .15s, background .15s;
}
.inp:focus { border-color: #4a4a51; background: #1d1d21; }
textarea.inp { resize: vertical; min-height: 42px; line-height: 1.5; }
textarea.inp.mono, .inp.mono { font: 12.5px/1.55 var(--mono); }
.inp.small { width: auto; padding: 6px 10px; font-size: 13px; }
.keys { display: flex; gap: 6px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.check input { accent-color: #f2f2f3; }

/* formularz ustawień */
.settings-layout { display: grid; gap: 18px; }
.fields { display: flex; flex-direction: column; }
.field { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid #1d1d20; position: relative; }
.field:last-child { border-bottom: 0; }
.field .fk { font: 500 13px var(--mono); color: var(--text); word-break: break-all; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field .fd { font-size: 12.5px; color: var(--muted); margin-top: 6px; white-space: pre-line; }
.field .fi { min-width: 0; display: flex; gap: 8px; align-items: flex-start; }
.field .fi > :first-child { flex: 1; }
.field.dirty::before { content: ""; position: absolute; left: -24px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--amber); }
.tag { font: 500 10.5px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--card-3); color: var(--muted); }
.tag.mod { background: var(--amber-bg); color: #ffc66d; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none !important; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #2a2a2f; border-radius: 24px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #8f8f96; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: #f2f2f3; }
.switch input:checked + span::before { transform: translateX(18px); background: #0b0b0c; }
.group { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 6px 0; background: #121214; }
.group-title { font: 500 12px var(--mono); color: var(--muted); padding: 12px 0 4px; display: flex; justify-content: space-between; align-items: center; }
.arr-item { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 10px 0; background: #121214; }
.arr-item .field { grid-template-columns: minmax(120px, 220px) 1fr; padding: 12px 0; }
.savebar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(calc(-50% + 136px)); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; background: #18181b; border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: rise .2s ease-out;
}
.savebar .t { color: #ffc66d; font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
@keyframes rise { from { transform: translate(calc(-50% + 136px), 20px); opacity: 0; } }
.editor { display: grid; grid-template-columns: auto 1fr; background: #08080a; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: calc(100vh - 300px); min-height: 380px; }
.editor .gutter { font: 12.5px/1.6 var(--mono); color: #46464c; text-align: right; padding: 12px 10px 12px 14px; user-select: none; overflow: hidden; white-space: pre; background: #0b0b0d; border-right: 1px solid #18181b; }
.editor textarea { border: 0; outline: none; resize: none; background: transparent; font: 12.5px/1.6 var(--mono); color: #e4e4e7; padding: 12px 14px; white-space: pre; overflow: auto; tab-size: 4; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); color: #cfcfd4; font-size: 13px; }
.notice.warn { background: var(--amber-bg); border-color: rgba(245, 177, 61, .25); color: #ffd28a; }
.notice.err { background: var(--red-bg); border-color: rgba(239, 68, 68, .25); color: #ffb0b0; }
.notice .ic { margin-top: 1px; }

/* przegląd skryptu */
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero .pic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); }
.hero .ht { flex: 1; min-width: 220px; }
.hero .ht b { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero .ht > span { color: var(--muted); display: block; margin-top: 3px; }
.hero .ht > .path { font: 12px var(--mono); color: var(--faint); margin-top: 6px; display: block; }
.mini-log { font: 12px/1.65 var(--mono); color: #bdbdc3; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; }

/* modal, toast, paleta */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 90; display: grid; place-items: start center; padding: 12vh 16px 16px; backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 440px; background: #151518; border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.modal p { margin: 0 0 20px; color: var(--muted); white-space: pre-line; }
.modal .row { justify-content: flex-end; }
.modal.wide { max-width: 900px; }
.modal pre { max-height: 55vh; overflow: auto; background: #08080a; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12px/1.55 var(--mono); margin: 0 0 16px; }
.palette { max-width: 560px; padding: 8px; }
.palette input { border: 0; background: transparent; font-size: 16px; padding: 12px 12px 14px; outline: none; width: 100%; border-bottom: 1px solid var(--line); }
.palette .list { max-height: 50vh; overflow-y: auto; padding: 6px 0 0; }
.palette .dd-item small { color: var(--faint); font-size: 12px; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #1b1b1f; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; max-width: 420px;
  display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: rise2 .2s ease-out;
  white-space: pre-line; font-size: 13.5px;
}
.toast.ok .ic { color: var(--green); }
.toast.err .ic { color: var(--red); }
@keyframes rise2 { from { transform: translateY(10px); opacity: 0; } }
.skeleton { background: linear-gradient(90deg, #151517 0%, #1c1c1f 50%, #151517 100%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ mobile */
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-100%); transition: transform .22s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, .6); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 14px 16px 0; }
  .content { padding: 14px 16px 120px; }
  .proj-tabs { padding: 0 16px; }
  .cols-2 { grid-template-columns: 1fr; }
  .field { grid-template-columns: 1fr; gap: 10px; }
  .field.dirty::before { left: -12px; }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px -18px; }
  th, td { padding: 9px 16px; }
  .savebar { transform: translateX(-50%); width: calc(100% - 24px); bottom: 12px; flex-wrap: wrap; }
  @keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
  .logbox, .term { height: calc(100vh - 330px); }
  .kpi .val { font-size: 26px; }
}
