:root {
  color-scheme: dark;
  --bg: #20272d;
  --surface: #2a343c;
  --surface-raised: #35414a;
  --field: #222c33;
  --ink: #e9eff2;
  --muted: #afbec6;
  --faint: #82959f;
  --line: #3c4a54;
  --line-bright: #566b77;
  --teal: #74e0d0;
  --gold: #c5a45d;
  --gold-bright: #e0c987;
  --red: #ff9e9e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, sans-serif;
}
a { color: var(--teal); }
a:hover { color: var(--gold-bright); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid #d8bd7d;
  border-radius: 7px;
  padding: 9px 13px;
  background: var(--gold);
  color: #182333;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--gold-bright); color: #182333; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  padding: 9px 11px;
  background: var(--field);
  color: var(--ink);
}
.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(100%, 450px);
  min-width: 0;
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 36px #0005;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--surface);
  font-weight: 800;
}
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.login-card h1 { margin: 0; font-size: clamp(24px, 5vw, 29px); line-height: 1.2; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.login-card .muted { margin: 10px 0 0; }
.login-card form { display: grid; gap: 16px; margin-top: 25px; min-width: 0; }
.login-card label, .kb-filters label, .kb-form label, .kb-review label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-weight: 650;
}
.login-card input { display: block; width: 100%; }
.login-card button { width: 100%; margin-top: 4px; }
.shell { max-width: 1500px; margin: auto; padding: 22px 4% 48px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.topbar h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; }
.header-meta { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.user-chip { color: var(--muted); font-weight: 650; }
.logout { font-weight: 700; text-decoration: none; }
.kb-actions, .kb-filters, .kb-more-wrap, .kb-meta, .kb-review {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.kb-filters input { width: min(340px, 80vw); }
.kb-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kb-table { width: 100%; min-width: 1100px; table-layout: fixed; border-collapse: collapse; }
.kb-table th, .kb-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; font-weight: 300; }
.kb-table th { position: sticky; top: 0; background: var(--surface-raised); color: var(--muted); font-size: 12px; }
.kb-table th:nth-child(1) { width: 27%; }
.kb-table th:nth-child(2) { width: 20%; }
.kb-table th:nth-child(3) { width: 10%; }
.kb-table th:nth-child(4) { width: 9%; }
.kb-table th:nth-child(5) { width: 9%; }
.kb-table th:nth-child(6) { width: 9%; }
.kb-table th:nth-child(7) { width: 10%; }
.kb-table th:nth-child(8) { width: 6%; }
.kb-table th:last-child, .kb-table td:last-child { text-align: center; }
.kb-table tr:last-child td { border-bottom: 0; }
.kb-edit { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--line-bright); border-radius: 6px; background: var(--surface-raised); color: var(--teal); text-decoration: none; }
.kb-edit:hover { border-color: var(--gold); background: var(--surface-raised); color: var(--gold-bright); }
.kb-edit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kb-more-wrap { justify-content: center; }
.kb-count { color: var(--muted); }
.kb-form { display: grid; gap: 14px; max-width: 1000px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kb-form textarea { min-height: 115px; resize: vertical; }
.kb-form textarea[name=solution] { min-height: 210px; }
.kb-form .kb-check { display: flex; align-items: center; color: var(--ink); }
.kb-meta { color: var(--muted); }
.kb-meta code { font-size: 11px; overflow-wrap: anywhere; }
.kb-warning, .kb-notice { color: var(--gold-bright); }
.kb-review { padding: 16px 0; }
.kb-danger { border-color: #bf6060; background: #593438; color: #ffcbc7; }
.kb-danger:hover { background: #704248; color: white; }
.alert { padding: 11px 13px; border: 1px solid #a95758; border-radius: 8px; background: #552d31; color: #ffcbc7; }
.kb-shell h1, .kb-shell .eyebrow, .kb-shell .user-chip, .kb-shell .logout,
.kb-shell label, .kb-shell button, .kb-shell .button, .kb-shell strong {
  font-weight: 400;
}
@media (max-width: 700px) {
  .shell { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .header-meta { justify-content: flex-start; }
  .kb-filters input { width: min(100%, 340px); }
}
