/* portstatus. Aufbau angelehnt an FreshPorts (Commit-Liste links,
   Seitenleiste rechts, Kaesten mit roter Titelleiste), Gestaltung zeitgemaess
   und responsiv. Farben als Variablen, dunkles Schema per prefers-color-scheme. */

:root {
  --red: #8c0707;
  --red-dark: #6d0505;
  --red-tint: #fbeeee;
  --bg: #f5f5f3;
  --card: #ffffff;
  --fg: #1c1c1a;
  --muted: #5f5f5a;
  --line: #e2e1dc;
  --link: #0b55a8;
  --code-bg: #f7f7f5;
  --open: #b3261e;     --open-bg: #fde8e6;
  --vuxml: #8a5300;    --vuxml-bg: #fdf1dc;
  --fixed: #236b2e;    --fixed-bg: #e3f3e5;
  --update: #1e4f91;   --update-bg: #e4edfa;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red: #a51d1d; --red-dark: #7f1212; --red-tint: #3a1a1a;
    --bg: #161615; --card: #1f1f1e; --fg: #e9e8e3; --muted: #a3a29b; --line: #34332f;
    --link: #8ab8f0; --code-bg: #262624;
    --open: #ff9e94; --open-bg: #4a1f1b; --vuxml: #f3c56f; --vuxml-bg: #44330f;
    --fixed: #9fd8a6; --fixed-bg: #1f3a23; --update: #a9c6f2; --update-bg: #1e2f49;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
h1, h2, h3 { line-height: 1.25; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--card); padding: 6px 10px; }

/* Kopf */
.site-header { background: var(--red); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 16px; }
.logo { color: #fff; font: 700 22px/1 Georgia, "Times New Roman", serif; letter-spacing: .3px; white-space: nowrap; }
.logo span { font-weight: 400; opacity: .85; }
.logo:hover { text-decoration: none; }
.mainnav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.mainnav a { color: #fff; opacity: .9; font-size: 14px; }
.mainnav a[aria-current="page"] { opacity: 1; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.search { display: flex; gap: 6px; flex: 1 1 320px; max-width: 560px; margin-left: auto; }
.search input { flex: 1; min-width: 0; }
.search input, .search select { border: 0; border-radius: var(--radius); padding: 7px 10px; font: inherit; font-size: 14px; background: #fff; color: #1c1c1a; }
.search button { border: 1px solid rgba(255, 255, 255, .5); background: var(--red-dark); color: #fff; border-radius: var(--radius); padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.subbar { background: var(--card); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.subbar .wrap { padding: 6px 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Raster */
.wrap { margin: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; padding: 18px 16px; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* Kaesten */
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.box > h2 { margin: 0; background: var(--red); color: #fff; font-size: 15px; font-weight: 600; padding: 8px 14px; }
.box > h2 a { color: #fff; }
.box > h2 .count { font-weight: 400; opacity: .85; }
.inner { padding: 12px 14px; }
.inner > :first-child { margin-top: 0; }
.inner > :last-child { margin-bottom: 0; }
.note { color: var(--muted); font-size: 13.5px; }
.daybar { background: var(--red-tint); color: var(--red); font-weight: 600; font-size: 13.5px; padding: 6px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Commit- und Portlisten */
.entry { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .meta { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.entry .meta time { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; margin-right: 6px; }
.element { margin: 2px 0; }
.element .name { font-weight: 700; font-size: 15.5px; }
.element .ver { font-family: var(--mono); font-size: 13.5px; font-weight: 700; margin-left: 5px; }
.element .descr { color: var(--muted); margin-left: 6px; }
/* Statusmarken am Ende der Portzeile, die Portliste bleibt ein Block */
.marks { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: 1px; }
.marks .pill { font-size: 11.5px; padding: 0 7px; }
.msg { background: var(--code-bg); border-left: 3px solid var(--line); margin: 8px 0 4px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0 var(--radius) var(--radius) 0; }
.hash { font-size: 12.5px; }
.more { color: var(--muted); font-size: 13px; }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pill-open { color: var(--open); background: var(--open-bg); }
.pill-vuxml { color: var(--vuxml); background: var(--vuxml-bg); }
.pill-fixed, .pill-clean { color: var(--fixed); background: var(--fixed-bg); }
.pill-outdated { color: var(--update); background: var(--update-bg); }
.pill-uncertain { color: var(--muted); background: var(--fixed-bg); border: 1px dashed var(--line); }
.pill-repology { color: var(--muted); background: transparent; border: 1px dashed var(--line); font-weight: 500; }
.cvss { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cvss-crit, .cvss-high { color: var(--open); }
.cvss-med { color: var(--vuxml); }
.cvss-low, .cvss-none { color: var(--muted); }

/* Portkopf */
.porthead { padding: 14px; }
.porthead h1 { margin: 0 0 2px; font-size: 24px; overflow-wrap: anywhere; }
.porthead h1 .ver { font: 600 16px var(--mono); color: var(--muted); margin-left: 6px; }
.porthead .descr { color: var(--muted); margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.tile { border-radius: var(--radius); padding: 10px 12px; display: block; color: inherit; }
.tile:hover { text-decoration: none; filter: brightness(.97); }
.tile .n { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; }
.tile-open { background: var(--open-bg); color: var(--open); }
.tile-vuxml { background: var(--vuxml-bg); color: var(--vuxml); }
.tile-fixed { background: var(--fixed-bg); color: var(--fixed); }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.kv dd { margin-bottom: 6px; } }

/* CVE-Eintraege */
.cve .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cve .id { font-weight: 700; font-family: var(--mono); font-size: 14px; }
.cve .date { color: var(--muted); font-size: 13px; }
.cve p { margin: 4px 0 0; color: var(--fg); font-size: 14px; }

/* Tabellen, auf schmalen Bildschirmen als Karten */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: var(--code-bg); }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.list td { border: 0; padding: 2px 4px; display: flex; gap: 10px; }
  table.list td::before { content: attr(data-label); flex: 0 0 96px; color: var(--muted); font-size: 12.5px; }
  table.list td.num { text-align: left; }
}

/* Seitenleiste */
.side .box > h2 { font-size: 14px; }
.side ul { list-style: none; margin: 0; padding: 6px 14px 10px; }
.side li { padding: 3px 0; }
.side table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.side td { padding: 5px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.side tr:last-child td { border-bottom: 0; }
.side td.r { text-align: right; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.stats div { background: var(--card); padding: 10px 12px; }
.stats .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats .l { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.stats .open .n { color: var(--open); }
.stats .vuxml .n { color: var(--vuxml); }
.stats .update .n { color: var(--update); }

/* Formulare */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); gap: 3px; }
.filters input, .filters select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg); }
.btn { background: var(--red); color: #fff; border: 0; border-radius: var(--radius); padding: 8px 16px; font: inherit; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--red-dark); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg a, .seg strong { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; }
.seg strong { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.pager { display: flex; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }

pre.tpl { background: var(--code-bg); padding: 12px; border-radius: var(--radius); overflow-x: auto; margin: 8px 0 0; }

/* Fuss */
.site-footer { color: var(--muted); font-size: 13px; padding: 4px 16px 28px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .site-header { position: static; }
  .search { flex-basis: 100%; max-width: none; margin-left: 0; }
  .search select { flex: 0 0 auto; max-width: 96px; }
  .search button { padding: 7px 10px; }
  .layout { padding: 12px 10px; gap: 12px; }
  .entry, .inner { padding: 10px 12px; }
}
.site-footer .legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.element .pkgver { font-size: 12.5px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
