/* Wachposten — status wall dashboard */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e3e8ef;
  --border-strong: #cfd7e3;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #7c8799;
  --accent: #2a63d9;
  --accent-soft: #e8effd;
  --accent-text: #1d4fbf;

  --good: #0ca30c;
  --good-soft: #e7f6e7;
  --good-text: #0a7a0a;
  --warn: #fab219;
  --warn-soft: #fff5dc;
  --warn-text: #8a5a00;
  --bad: #d03b3b;
  --bad-soft: #fdeaea;
  --bad-text: #b02a2a;
  --idle: #a0aab8;
  --idle-soft: #eef1f5;
  --idle-text: #5f6b7c;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;

  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1015;
    --surface: #151a21;
    --surface-2: #1a2029;
    --surface-3: #212833;
    --border: #262e3a;
    --border-strong: #354050;
    --text: #e8ecf2;
    --text-2: #a9b3c2;
    --text-3: #7a8596;
    --accent: #5b8dff;
    --accent-soft: #1b2a47;
    --accent-text: #8fb0ff;
    --good-soft: #10291a;
    --good-text: #4fd24f;
    --warn-soft: #2e2510;
    --warn-text: #fbc54d;
    --bad-soft: #341719;
    --bad-text: #f08080;
    --idle: #5d6878;
    --idle-soft: #1e242d;
    --idle-text: #9aa4b3;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1015;
  --surface: #151a21;
  --surface-2: #1a2029;
  --surface-3: #212833;
  --border: #262e3a;
  --border-strong: #354050;
  --text: #e8ecf2;
  --text-2: #a9b3c2;
  --text-3: #7a8596;
  --accent: #5b8dff;
  --accent-soft: #1b2a47;
  --accent-text: #8fb0ff;
  --good-soft: #10291a;
  --good-text: #4fd24f;
  --warn-soft: #2e2510;
  --warn-text: #fbc54d;
  --bad-soft: #341719;
  --bad-text: #f08080;
  --idle: #5d6878;
  --idle-soft: #1e242d;
  --idle-text: #9aa4b3;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.xs { width: 13px; height: 13px; }
.muted { color: var(--text-3); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--bad); color: #fff; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 20px 10px 8px; }
.side-projects a { padding: 7px 10px; font-weight: 450; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.live.on .pulse { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
.foot-row { display: flex; gap: 6px; }

.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.main.with-panel { grid-template-columns: minmax(0, 1fr) 420px; }
.content { padding: 22px 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.topbar .spacer { flex: 1; }
.page-sub { color: var(--text-3); margin: -12px 0 18px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; min-width: 220px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--text-3);
}
.search input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; width: 100%; }
.search:focus-within { border-color: var(--accent); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- summary ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sum {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  cursor: pointer; text-align: left;
}
.sum:hover { border-color: var(--border-strong); }
.sum.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.sum .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.sum .l { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.sum .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sum.up .ico { background: var(--good-soft); color: var(--good-text); }
.sum.degraded .ico { background: var(--warn-soft); color: var(--warn-text); }
.sum.down .ico { background: var(--bad-soft); color: var(--bad-text); }
.sum.paused .ico { background: var(--idle-soft); color: var(--idle-text); }
.sum.down.active { background: var(--bad-soft); border-color: transparent; }
.sum.degraded.active { background: var(--warn-soft); border-color: transparent; }

/* ---------- problem banner ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%;
}
.alert.down { background: var(--bad-soft); color: var(--bad-text); }
.alert.degraded { background: var(--warn-soft); color: var(--warn-text); }
.alert b { color: var(--text); font-weight: 600; }
.alert .msg { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.alert .since { margin-left: auto; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.alert:hover { border-color: currentColor; }
.allgood {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--good-soft); color: var(--good-text); font-weight: 500;
}

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h .more { margin-left: auto; font-size: 13px; }
.card-b { padding: 14px 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

/* ---------- matrix ---------- */
.matrix-wrap { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.matrix th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.matrix th:first-child { border-top-left-radius: var(--radius); padding-left: 18px; }
.matrix th:last-child { border-top-right-radius: var(--radius); }
.matrix td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix td.proj { padding-left: 18px; min-width: 190px; position: relative; }
.matrix tr.sel td { background: var(--surface-2); }
.matrix tr.sel td.proj::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.proj-name { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; }
.proj-sub { color: var(--text-3); font-size: 12.5px; margin: 2px 0 0 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.proj-sub a { color: inherit; }
.cell { display: flex; flex-wrap: wrap; gap: 6px; }
.empty-cell { color: var(--border-strong); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--idle); }
.dot.up { background: var(--good); }
.dot.degraded { background: var(--warn); }
.dot.down { background: var(--bad); }
.dot.pending { background: transparent; border: 2px solid var(--idle); }

.pill {
  display: inline-flex; flex-direction: column; gap: 4px; padding: 6px 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
.pill:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pill.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pill .row1 { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 13px; }
.pill .lbl { font-weight: 500; color: var(--text-3); font-size: 12px; }
.pill .val { color: var(--text); }
.pill.down { background: var(--bad-soft); border-color: transparent; }
.pill.down .val { color: var(--bad-text); }
.pill.degraded { background: var(--warn-soft); border-color: transparent; }
.pill.degraded .val { color: var(--warn-text); }
.pill.paused, .pill.pending { background: var(--idle-soft); border-color: transparent; }
.pill.paused .val, .pill.pending .val { color: var(--idle-text); }
.pill .sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.pill.compact { flex-direction: row; align-items: center; gap: 6px; padding: 5px 9px; white-space: nowrap; }
.st-ico { display: inline-grid; place-items: center; }
.st-ico.up { color: var(--good); }
.st-ico.degraded { color: var(--warn-text); }
.st-ico.down { color: var(--bad); }
.st-ico.paused, .st-ico.pending { color: var(--idle); }

.spark { display: flex; gap: 1px; height: 10px; align-items: stretch; }
.spark i { width: 3px; border-radius: 1px; background: var(--good); opacity: .85; }
.spark i.degraded { background: var(--warn); }
.spark i.down { background: var(--bad); }
.spark i.none { background: var(--surface-3); }

.mini-bars { display: grid; grid-template-columns: auto 46px auto; gap: 2px 6px; align-items: center; font-size: 11.5px; color: var(--text-3); }
.mini-bars .b { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.mini-bars .b i { display: block; height: 100%; background: var(--text-3); border-radius: 2px; }
.mini-bars .b i.hot { background: var(--warn); }
.mini-bars .v { color: var(--text-2); text-align: right; min-width: 30px; }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow { flex: 1; min-width: 0; }
.li .r { color: var(--text-3); font-size: 12.5px; white-space: nowrap; text-align: right; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag.good { background: var(--good-soft); color: var(--good-text); }
.tag.bad { background: var(--bad-soft); color: var(--bad-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn-text); }

/* server cards */
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.srv { padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.srv:hover { border-color: var(--border-strong); }
.srv-h { display: flex; align-items: flex-start; gap: 10px; }
.srv-h .name { font-weight: 650; font-size: 15px; }
.srv-h .meta { color: var(--text-3); font-size: 12.5px; }
.srv-h .right { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--text-3); }
.res { display: grid; grid-template-columns: 44px 1fr 110px; gap: 7px 10px; align-items: center; font-size: 13px; }
.res .b { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.res .b i { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.res .b i.hot { background: var(--warn); }
.res .b i.crit { background: var(--bad); }
.res .v { color: var(--text-2); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.chip .dot { width: 7px; height: 7px; }

/* ---------- detail panel ---------- */
.panel {
  border-left: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.panel-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 14px; }
.panel-h .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--text-2); }
.panel-h h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; line-height: 1.25; }
.panel-h .sub { color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.panel-h .close { margin-left: auto; }
.panel-sec { padding: 14px 20px; border-top: 1px solid var(--border); }
.panel-sec h3 { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.panel-sec h3 .seg { margin-left: auto; }
.stbanner { margin: 0 20px 14px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); }
.stbanner .big { font-size: 17px; font-weight: 700; }
.stbanner .why { font-size: 13px; color: var(--text-2); }
.stbanner.up { background: var(--good-soft); color: var(--good-text); }
.stbanner.degraded { background: var(--warn-soft); color: var(--warn-text); }
.stbanner.down { background: var(--bad-soft); color: var(--bad-text); }
.stbanner.paused, .stbanner.pending { background: var(--idle-soft); color: var(--idle-text); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 20px 16px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.tile .k { font-size: 11.5px; color: var(--text-3); }
.tile .v { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }

.log { display: flex; flex-direction: column; position: relative; }
.log-i { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 7px 0; position: relative; }
.log-i::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: -8px; width: 2px; background: var(--border); }
.log-i:last-child::before { display: none; }
.log-i .dot { margin-top: 5px; width: 10px; height: 10px; border: 2px solid var(--surface); box-sizing: content-box; position: relative; left: -1px; z-index: 1; }
.log-i .t { font-size: 13px; font-weight: 600; }
.log-i .s { font-size: 12.5px; color: var(--text-3); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .xh { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .downband { fill: var(--bad); opacity: .12; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.tip .tt { color: var(--text-3); margin-bottom: 3px; }
.tip .tr { display: flex; align-items: center; gap: 7px; }
.tip .sw { width: 10px; height: 3px; border-radius: 2px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.ubars { display: flex; gap: 2px; height: 30px; align-items: stretch; }
.ubars i { flex: 1; border-radius: 2px; background: var(--good); min-width: 2px; }
.ubars i.warn { background: var(--warn); }
.ubars i.bad { background: var(--bad); }
.ubars i.none { background: var(--surface-3); }
.ubars-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* code / embed */
.codebox { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 44px 10px 12px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; color: var(--text); }
.codebox .copy { position: absolute; top: 6px; right: 6px; }
.section { margin-bottom: 22px; }
.section > h2 { font-size: 16px; margin: 0 0 4px; }
.section > p { color: var(--text-2); margin: 0 0 12px; max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl code { word-break: break-all; }

/* empty / login */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty h3 { color: var(--text); margin: 10px 0 4px; font-size: 16px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login h1 { margin: 14px 0 4px; font-size: 22px; }
.login p { color: var(--text-3); margin: 0 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input { height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; background: var(--surface); color: var(--text); font: inherit; }
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--bad-text); font-size: 13px; margin-bottom: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; z-index: 50; box-shadow: var(--shadow-lg); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
.mob-bar { display: none; }
@media (max-width: 1280px) {
  .main.with-panel { grid-template-columns: minmax(0, 1fr); }
  .panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); z-index: 30; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; background: rgba(10, 14, 20, .35); z-index: 29; }
}
@media (max-width: 1100px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .mob-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; font-weight: 700; }
  .content { padding: 16px 16px 40px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { min-width: 0; flex: 1; }
  .topbar h1 { font-size: 20px; }
  .alert .since { display: none; }
  .kv { grid-template-columns: 100px 1fr; }
  .search { order: 10; flex: 1 1 100%; }
  table.matrix, .matrix tbody, .matrix tr, .matrix td { display: block; }
  table.matrix { min-width: 0; }
  .matrix thead { display: none; }
  .matrix tr { border-bottom: 1px solid var(--border); padding: 6px 0 10px; }
  .matrix tr:last-child { border-bottom: 0; }
  .matrix td { border: 0; padding: 5px 16px; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: center; }
  .matrix td::before { content: attr(data-label); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
  .matrix td.proj { display: block; padding: 8px 16px 6px; }
  .matrix td.proj::before { content: none; }
  .matrix td:has(.empty-cell) { display: none; }
}
