/* styles.css — GPS Kørebog (test). Mobil først, store trykflader, læsbart i en bil. */
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #15202b;
  --muted: #5b6673;
  --line: #d9dee5;
  --brand: #0f2a4a;
  --accent: #1f6feb;
  --ok: #1a7f37;
  --warn: #bf8700;
  --danger: #cf222e;
  --danger-bg: #fde8ea;
  --info-bg: #e6f0ff;
  --tab-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #9aa5b1;
    --line: #30363d;
    --brand: #0b1c33;
    --accent: #4493f8;
    --ok: #3fb950;
    --warn: #d29922;
    --danger: #f85149;
    --danger-bg: #3a1216;
    --info-bg: #122a4a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
h2 { font-size: 20px; margin: 16px 0 8px; }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { font-weight: 700; font-size: 17px; }
.tag { font-size: 11px; background: rgba(255,255,255,.18); padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.hdr-state { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.15); }
.hdr-state.is-active { background: var(--ok); }
.hdr-state.is-paused { background: var(--warn); }
.hdr-state.is-privacy { background: var(--danger); }

main { padding: 12px 16px 24px; max-width: 640px; margin: 0 auto; }
.view > .card, .view > form.card { margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }

.banner { padding: 10px 16px; font-size: 14px; }
.banner-privacy { background: var(--danger); color: #fff; font-weight: 600; }
.banner-info { background: var(--info-bg); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
  background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 10px; z-index: 50; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
@media (prefers-color-scheme: dark) { .toast { background: #e6edf3; color: #0d1117; } }

.status { text-align: center; margin-bottom: 12px; }
.big-state { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.tracking .big-state { color: var(--ok); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metrics.grid4 { grid-template-columns: repeat(2, 1fr); text-align: center; }
.metrics > div { display: flex; flex-direction: column; align-items: center; }
.metrics span { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metrics.grid4 span { font-size: 22px; }
.metrics label { font-size: 12px; color: var(--muted); }
.fix { margin-top: 8px; font-size: 13px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 13px; color: var(--muted); }
.field small { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 60px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; }

.actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.btn {
  font: inherit; font-weight: 600; font-size: 17px; border: 0; border-radius: 12px;
  padding: 16px; min-height: 56px; width: 100%; cursor: pointer; color: #fff; background: var(--accent);
}
.btn.small { min-height: 44px; padding: 10px; font-size: 15px; }
.btn-start { background: var(--ok); }
.btn-stop { background: var(--danger); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-outline-danger { background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
button.link { font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); padding: 6px 0; cursor: pointer; text-align: left; }
button.link.danger { color: var(--danger); }
label.btn { display: block; text-align: center; margin-top: 10px; }
.row-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }

.map { height: 220px; border-radius: 12px; border: 1px solid var(--line); margin: 12px 0; background: #dfe6ee; }
.map-tall { height: 280px; }
.map.no-tiles { background: #e9eef3; }
.stop-icon { background: var(--warn); color: #fff; border-radius: 50%; border: 2px solid #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }

.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

.filters { display: flex; gap: 8px; margin-bottom: 8px; }
.sum { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.list li.trip { cursor: pointer; }
.row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row1 .date { font-weight: 600; }
.row1 .km { font-weight: 700; font-variant-numeric: tabular-nums; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; align-items: center; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text); }
.badge.type-erhverv { background: var(--ok); color: #fff; }
.badge.type-pendling { background: var(--accent); color: #fff; }
.badge.type-privat { background: var(--muted); color: #fff; }
.badge.type-none { background: var(--danger-bg); color: var(--danger); }
.warn { color: var(--danger); font-size: 13px; margin-top: 6px; font-weight: 600; }
#tur-warn { background: var(--danger-bg); padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; }

.subhead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.subhead h2 { margin: 0; font-size: 18px; }
.about p { margin: 6px 0; font-size: 14px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.fatal { padding: 24px; color: var(--danger); font-size: 16px; }
