:root { color-scheme: dark; --bg: #15171b; --card: #1f2227; --line: #31353c; --muted: #9aa0a6; --accent: #ff5a1f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: #e8e8e8; }
html.i18n-wait body { visibility: hidden; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
input, select { background: #262a30; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
input[type=color] { padding: 2px; width: 44px; height: 36px; }
button { background: #2b3036; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: #ff8080; }
button.link { background: none; border: 0; padding: 2px 4px; color: var(--muted); text-decoration: underline; }
.hint { color: var(--muted); font-size: .85rem; }
.err { color: #ff7070; }

#top { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px;
  background: var(--bg); border-bottom: 1px solid var(--line); }
#top h1 { font-size: 17px; margin: 0; white-space: nowrap; }
#nav { display: flex; gap: 6px; align-items: center; margin-left: auto; }
#nav a, #nav button { background: none; border: 0; color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 6px; font-size: .9rem; }
#nav a.on { color: #fff; background: #2b3036; }
.lang { font-size: .85rem; opacity: .7; white-space: nowrap; }
.lang button { font: inherit; color: inherit; background: none; border: 0; padding: .1rem .2rem; cursor: pointer; }
.lang button[aria-pressed="true"] { font-weight: 700; }
#nav[hidden] + .lang { margin-left: auto; }

.card { background: var(--card); border-radius: 10px; padding: 16px 18px; margin: 16px auto; max-width: 960px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.narrow { max-width: 340px; margin-top: 12vh; }
#login-form { display: flex; flex-direction: column; gap: 10px; }

/* Karte */
#v-map { position: absolute; inset: 48px 0 0 0; }
#map { position: absolute; inset: 0; }
#panel { position: absolute; top: 12px; left: 12px; width: 270px; max-height: calc(100% - 24px); overflow: auto;
  background: rgba(21, 23, 27, .88); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 14px; margin: 0; color: var(--muted); font-weight: 600; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: #777; }
.conn.ok { background: #3ccf6e; }
.conn.bad { background: #e5484d; }
#vlist { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#vlist li { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px;
  border-radius: 8px; background: #23272d; cursor: pointer; border: 1px solid transparent; }
#vlist li.follow { border-color: var(--accent); }
#vlist li.stale { opacity: .55; }
#vlist .dot { width: 12px; height: 12px; border-radius: 50%; grid-row: span 2; }
#vlist .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vlist .speed { grid-row: span 2; text-align: right; font-variant-numeric: tabular-nums; }
#vlist .speed b { font-size: 26px; line-height: 1; display: block; }
#vlist .speed span { font-size: 11px; color: var(--muted); }
#vlist .sub { font-size: 12px; color: var(--muted); }
.chk { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* Verwaltung */
.admin { padding: 0 12px 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.actions { text-align: right; white-space: nowrap; }
td .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-form input[name=name], .row-form input[name=password] { flex: 1 1 160px; }
.keybox { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 8px; }
.keybox p { margin: 0 0 8px; }
.keybox code { display: block; font-size: 14px; word-break: break-all; margin-bottom: 8px; user-select: all; }
.scroll { max-height: 40vh; overflow: auto; }
#audit-table td { font-size: 13px; }
#audit-table td:first-child { color: var(--muted); white-space: nowrap; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9; background: #2b3036;
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; }

.ir-foot { text-align: center; font-size: .7rem; opacity: .45; margin: 2rem 0 1rem; }
.ir-foot a { color: inherit; }
#panel .ir-foot { margin: 10px 0 0; }

#nav a, #nav button { white-space: nowrap; }
@media (max-width: 600px) {
  #panel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 42%; }
  #top { gap: 8px; padding: 0 8px; }
  #top h1 { font-size: 15px; }
  #nav { gap: 0; }
  #nav a, #nav button { padding: 6px 5px; font-size: .82rem; }
}
@media (max-width: 480px) {
  #top h1 { display: none; }
  #nav { margin-left: 0; }
  #top .lang { margin-left: auto; }
}
