:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel-hover: #18202b;
  --border: #1f2935;
  --text: #e3e8ef;
  --muted: #7d8a9b;
  --accent: #34d399;
  --danger: #f87171;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

.top, main { max-width: 1600px; margin: 0 auto; padding: 0 16px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 8px;
}

.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.logo {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--bg);
  font-family: ui-monospace, monospace; font-size: 15px;
}

.clock { text-align: right; }
#time { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
#date { font-size: 13px; }

.search { margin: 28px 0; }
.search input {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}
.search input:focus { border-color: var(--accent); }

.top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 1100px) {
  .top-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
}

.links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.group h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.group ul { list-style: none; margin: 0; padding: 0; }
.group a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
}
.group a:hover { background: var(--panel-hover); }
.initial {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; flex: none;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--accent);
}

.news-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px;
  margin: 40px 0 14px;
}
.news-head h2 { margin: 0; font-size: 20px; }
.news-head span { font-size: 13px; }

.news {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 48px;
}
@media (min-width: 800px) {
  .news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* ulige antal bokse: den sidste fylder hele bredden */
  .news > .panel:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1400px) {
  .news { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .news > .panel:last-child:nth-child(odd) { grid-column: auto; }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 8px;
  min-width: 0;
}
.panel h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-kev h3 { color: var(--danger); }
.tag {
  font-size: 11px; font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

.list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.list li { border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list li.muted { padding: 10px 0; }
.list a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-radius: 6px; }
.list .text { min-width: 0; }
.thumb {
  flex: none;
  width: 72px; height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel-hover);
  margin-top: 3px;
}
.list a:hover { background: var(--panel-hover); }
.list .title { display: block; overflow-wrap: anywhere; }
.list .meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cve { font-family: ui-monospace, monospace; color: var(--danger); font-weight: 600; }
.ransom {
  font-size: 11px; color: var(--bg); background: var(--danger);
  border-radius: 4px; padding: 0 5px; margin-left: 6px;
}

.credit { color: var(--accent); }
.credit:hover { text-decoration: underline; }

.ai { padding: 14px 16px; }
.ai-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.ai-head h2 { margin: 0; font-size: 16px; }
.ai-head > span { font-size: 12px; }
.ai-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.ai-chart { list-style: none; margin: 0; padding: 0; }
.ai-row {
  display: grid;
  grid-template-columns: 18px minmax(110px, 150px) minmax(0, 1fr) 52px 56px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid var(--border);
}
.ai-row:first-child { border-top: 0; }
.ai-header { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ai-header > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-name > span:first-child { font-size: 14px; }
.ai-bar { height: 12px; }
.ai-score { font-size: 13px; }
.ai-stat { font-size: 12px; }
.ai-rank { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.ai-name { display: flex; flex-direction: column; min-width: 0; }
.ai-name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-name .meta { font-size: 12px; color: var(--muted); }
.ai-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ai-bar { height: 14px; border-radius: 4px; background: var(--c); min-width: 2px; }
.ai-score { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.ai-stat { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
/* sammenfoldet: header + top 5 (række 1 er header) */
.ai-chart.collapsed .ai-row:nth-child(n+7) { display: none; }
.ai-toggle {
  display: block;
  margin: 10px auto 0;
  padding: 6px 16px;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.ai-toggle:hover { background: var(--panel-hover); }
.ai-toggle[hidden] { display: none; }

@media (max-width: 700px) {
  .ai-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); }
  .ai-stat { display: none; }
}

@media (max-width: 600px) {
  #time { font-size: 22px; }
}
