:root {
  --bg: #0b1622; --panel: #112233; --panel2: #16293d; --line: #22384f;
  --fg: #e6edf3; --muted: #8fa3b8; --accent: #2bb3a8; --accent2: #3a7bd5;
  --bad: #ef6b6b; --ok: #3ecf8e; --warn: #f2b84b;
  --radius: 10px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
h1, h2, h3 { margin: 0 0 8px; font-weight: 600; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(11,22,34,.96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.tabs a.on { color: var(--fg); background: var(--panel2); }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.logout button, .btn { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.btn:hover, .logout button:hover { border-color: var(--accent); }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.foot { max-width: 1200px; margin: 0 auto; padding: 0 16px 30px; font-size: 12px; }
section { margin-bottom: 28px; }
section h2 { margin-top: 18px; }
section > h2:first-child { margin-top: 0; }
.lede { font-size: 17px; max-width: 75ch; margin: 0 0 6px; }
.note { font-size: 13px; color: var(--muted); max-width: 85ch; margin: 0 0 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .lab { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.tile .big { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .sub { font-size: 13px; color: var(--muted); }
a.card:hover { border-color: var(--accent); text-decoration: none; }

.wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--panel); position: sticky; top: 0; cursor: default; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--fg); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel); }
.num { text-align: right; }
.tk { font-weight: 600; white-space: nowrap; }
.why { min-width: 260px; max-width: 460px; }

.bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar b { min-width: 2.2em; text-align: right; font-weight: 600; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.accent { color: var(--accent); border-color: var(--accent); }

.weights { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 20px; margin: 10px 0 12px; }
.weights label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.weights label span { color: var(--fg); }
input[type=range] { width: 100%; accent-color: var(--accent); }
select, input[type=search] { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .lbl { fill: var(--fg); font-size: 12px; }
.chart .grid { stroke: var(--line); }
.tip { position: absolute; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; max-width: 250px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.tip b { display: block; margin-bottom: 2px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.feed .when { min-width: 92px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.feed .what { flex: 1; }
.feed .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.feed .new { color: var(--accent); font-weight: 600; font-size: 11px; margin-left: 6px; }

.flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.flags ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.flags p { font-size: 13.5px; margin: 6px 0 0; }
.huginn { font-size: 12px; color: var(--accent); margin-top: 4px; }

.company-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.scores { margin-bottom: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } .feed .when { min-width: 70px; } }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details ul { font-size: 13px; color: var(--muted); }

/* sign in page */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.login img { margin: 0 auto; }
.login label { text-align: left; font-size: 13px; color: var(--muted); margin-top: 8px; }
.login input { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; }
.login button { margin-top: 8px; background: var(--accent); color: #04221f; border: 0; border-radius: 8px; padding: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.login .msg { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
