/* AEGIS MESH panel. Neutral greys everywhere; colour is used only for priority. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --line: #dfe3e8; --text: #1d2026; --muted: #5f6672;
  --focus: #1d2026; --radius: 10px;
  --p5: #c62828; --p4: #e8590c; --p3: #b7791f; --p2: #5c7080; --p1: #8a929c;
  --p5-bg: #fdecec; --p4-bg: #fff0e6; --p3-bg: #fdf5e3; --p2-bg: #eef1f4; --p1-bg: #f2f3f5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --surface: #1c1f24; --surface-2: #23272e; --line: #333840; --text: #e8eaed; --muted: #a0a7b1;
    --focus: #e8eaed;
    --p5: #ff6b6b; --p4: #ff922b; --p3: #f2c14e; --p2: #9fb3c3; --p1: #7d8590;
    --p5-bg: #3a1d1f; --p4-bg: #3a2717; --p3-bg: #352d18; --p2-bg: #232a31; --p1-bg: #24272c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
a { color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 0 24px;
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.mark { width: 18px; height: 18px; border: 2px solid var(--text); border-radius: 4px 4px 9px 9px; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.who a { text-decoration: none; color: var(--muted); }
.role { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 99px; margin-left: 6px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* cards and tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; display: block; }
.tile:hover { border-color: var(--muted); }
.tile .n { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); }
.tile .s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile.hot .n { color: var(--p5); }

/* priority: the only colour in the panel */
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prio.p5 { color: var(--p5); background: var(--p5-bg); } .prio.p4 { color: var(--p4); background: var(--p4-bg); }
.prio.p3 { color: var(--p3); background: var(--p3-bg); } .prio.p2 { color: var(--p2); background: var(--p2-bg); }
.prio.p1, .prio.p0 { color: var(--p1); background: var(--p1-bg); }

.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--line); margin: 0 4px 4px 0; color: var(--text); text-decoration: none; }
button.tag { cursor: pointer; font: inherit; font-size: 12px; }
.tag[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.chips { margin: 12px 0 4px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; border: 1px dashed var(--muted);
  color: var(--muted); margin-left: 6px; text-transform: lowercase; vertical-align: 1px; }

/* lists */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; }
.news a { text-decoration: none; }
.news a:hover { text-decoration: underline; }
.news .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-top: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
input[type="checkbox"] { width: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.field { margin-bottom: 12px; }
button, .button { font: inherit; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .button:hover { border-color: var(--muted); }
button.primary { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 600; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; }
button:disabled { opacity: .5; cursor: progress; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; transition: border-color .15s; }
.drop.over { border-color: var(--text); }
details > summary { cursor: pointer; color: var(--muted); margin: 6px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions.tight { margin-top: 0; justify-content: flex-end; }
h1.mono { font-size: 22px; }

.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > span { display: block; height: 100%; background: var(--text); width: 0; transition: width .4s; }
.chart svg { width: 100%; height: 160px; display: block; }
.chart .b { fill: var(--muted); } .chart .b.last { fill: var(--text); }
.chart text { fill: var(--muted); font-size: 11px; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.dot.up { background: var(--text); border-color: var(--text); }
.svc { border-top: 1px solid var(--line); padding: 14px 0; }
.svc:first-child { border-top: 0; padding-top: 0; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.error { color: var(--p5); }

/* login */
.login { max-width: 360px; margin: 12vh auto; }
.login h1 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface);
  padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }

@media (max-width: 820px) {
  .top { gap: 12px; padding: 0 16px; height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  nav { order: 3; flex-basis: 100%; }
  main { padding: 16px; }
  .tiles, .two { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
