/* mirror.stadtwerke-soest.de – Startseite und Verzeichnislisten */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #15171c;
  --muted: #5d6470;
  --faint: #8b929d;
  --accent: #0a7c76;
  --accent-soft: rgba(10, 124, 118, .10);
  --accent-2: #2e6bd9;
  --warn: #b26b00;
  --ok: #1f9d55;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --i-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6.5A1.5 1.5 0 0 1 4.5 5h4.7l2 2.2h8.3A1.5 1.5 0 0 1 21 8.7v9.8a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18.5z'/%3E%3C/svg%3E");
  --i-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E");
  --i-disc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
  --i-pkg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
  --i-archive: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9M10 13h4'/%3E%3C/svg%3E");
  --i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #161920;
    --surface-2: #1c2028;
    --border: #2a2f39;
    --text: #e7e9ec;
    --muted: #a0a7b2;
    --faint: #727a86;
    --accent: #3cc3b9;
    --accent-soft: rgba(60, 195, 185, .13);
    --accent-2: #6b9dff;
    --warn: #e8a33a;
    --ok: #35c46f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 24px; height: 24px; }
.brand-dim { color: var(--muted); font-weight: 500; }
.topnav { display: flex; gap: 20px; }
.topnav a { color: var(--muted); font-size: 14px; }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* Verzeichnisliste */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 28px 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumb-sep { color: var(--faint); font-weight: 400; }
.crumb-current { color: var(--text); }
.listing-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.filter { flex: 1 1 240px; max-width: 360px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.filter:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.listing-count { color: var(--muted); font-size: 13px; }

.listing { width: 100%; border-collapse: collapse; table-layout: fixed; }
.listing th { padding: 0; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }
.listing th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 16px; cursor: pointer; }
.listing th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.listing th.num button { text-align: right; }
.listing th[aria-sort="ascending"] button::after { content: " ↑"; }
.listing th[aria-sort="descending"] button::after { content: " ↓"; }
.listing td { padding: 8px 16px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing tbody tr:last-child td { border-bottom: 0; }
.listing tbody tr:hover { background: var(--surface-2); }
.listing .col-size { width: 120px; }
.listing .col-date { width: 170px; color: var(--muted); font-variant-numeric: tabular-nums; }

.entry { position: relative; display: block; padding-left: 28px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry::before { content: ""; position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--faint); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.entry-file::before { --icon: var(--i-file); }
.entry-dir::before { --icon: var(--i-folder); background: var(--accent); }
.entry-up { color: var(--muted); }
.entry-up::before { --icon: var(--i-up); }
.entry.t-iso::before { --icon: var(--i-disc); background: var(--accent-2); }
.entry.t-pkg::before { --icon: var(--i-pkg); }
.entry.t-sum::before { --icon: var(--i-check); }
.entry.t-arc::before { --icon: var(--i-archive); }
.listing tr[hidden] { display: none; }

/* Startseite */
.hero { padding: 40px 0 4px; }
.hero h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.hero p { margin: 0; max-width: 640px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 24px 0 8px; }
.tile { padding: 16px; min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile-value { margin-top: 4px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value small { margin-left: 2px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.tile-sub { margin-top: 2px; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.live-dot.is-off { background: var(--faint); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.spark { display: block; width: 100%; height: 34px; margin-top: 8px; overflow: visible; }
.spark-area { fill: var(--accent-soft); }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.spark-rx { fill: none; stroke: var(--accent-2); stroke-width: 1.5; stroke-linejoin: round; }
.tile-wide { grid-column: span 2; }
.live-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.key { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 0; }
.key-tx { background: var(--accent); }
.key-rx { background: var(--accent-2); }
.meter { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }

.section { margin: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }

.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.seg button { all: unset; padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chart { position: relative; padding: 16px 16px 8px; }
.chart svg { display: block; width: 100%; height: 220px; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar.is-now { opacity: .5; }
.chart .bar.is-hover { opacity: 1; fill: var(--accent-2); }
.chart-empty { fill: var(--faint); font-size: 13px; font-family: var(--sans); }
.chart-tip { position: absolute; top: 8px; z-index: 2; min-width: 170px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); font-size: 13px; pointer-events: none; }
.chart-tip strong { display: block; margin-bottom: 2px; }

.projects .col-size { width: 110px; }
.projects .col-sync { width: 150px; }
.projects .col-traffic { width: 210px; }
.projects .col-req { width: 110px; }
.projects th { padding: 10px 16px; }
.projects td { vertical-align: middle; }
.proj-desc { padding-left: 28px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.traffic-cell { display: flex; align-items: center; gap: 10px; }
.traffic-cell .num { min-width: 72px; }
.share { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.share > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.is-stale { color: var(--warn); }
.empty { padding: 28px 16px !important; text-align: center; color: var(--muted); white-space: normal !important; }

.access { padding: 4px 16px; }
.access dl { margin: 0; }
.access dl > div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.access dl > div:last-child { border-bottom: 0; }
.access dt { width: 110px; color: var(--muted); font-size: 13px; }
.access dd { margin: 0; min-width: 0; }

.foot { margin-top: 40px; padding: 20px 0 40px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

@media (max-width: 720px) {
  .listing .col-date, .projects .col-sync, .projects .col-req { display: none; }
  .projects .col-traffic { width: 130px; }
  .share { display: none; }
}
@media (max-width: 560px) {
  .tile-wide { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .brand-dim { display: none; }
  .topnav { gap: 14px; }
  .hero h1 { font-size: 25px; }
  .listing .col-size { width: 92px; }
  .listing td, .listing th button { padding-left: 12px; padding-right: 12px; }
}
