/* SchweissReg – farver inspireret af Schweiss.dk. Store knapper og tekst til brug i felten. */
:root {
  --green-dark: #2B4A2B;
  --green: #3F6B2F;
  --green-light: #E6EEDF;
  --ground: #F4F6F1;
  --card: #FFFFFF;
  --ink: #161A16;
  --muted: #4A524A;
  --line: #D3DCCB;
  --orange: #C2410C;
  --orange-light: #FDE7DC;
  --danger: #A11D1D;
  --radius: 14px;
  --nav-h: 72px;
}
* { box-sizing: border-box; }
/* Elementer med hidden skal altid være skjult, også når de har en display-regel (fx .stack). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
h1 { margin: 0; font-size: 28px; line-height: 1.15; }
h2 { margin: 0 0 8px; font-size: 20px; }
p { margin: 0; }
a { color: var(--green-dark); }
.muted { color: var(--muted); font-size: 16px; }
.center { text-align: center; padding: 24px 0; }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 10px; padding-bottom: 8px; }
.sr { position: absolute; left: -9999px; }
.pre { white-space: pre-line; margin-top: 10px; font-size: 16px; }
.warn { background: var(--orange-light); color: #7A2906; padding: 12px; border-radius: 10px; font-weight: 700; }

/* Topbjælker */
.top { background: var(--green-dark); color: #fff; padding: calc(20px + env(safe-area-inset-top)) 16px 16px; }
.top h1 { font-size: 32px; }
.sub { font-size: 16px; color: var(--muted); }
.top .sub { color: #D3DCCB; }
.bar { background: var(--green-dark); color: #fff; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 12px; position: sticky; top: 0; z-index: 1000; }
.bar .sub { color: #D3DCCB; }
.bar h1 { font-size: 24px; }
.back { color: #fff; text-decoration: none; font-size: 40px; line-height: 1; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; flex: none; }

/* Knapper */
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 10px 16px; border-radius: 12px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.dark { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.big { min-height: 64px; font-size: 22px; }
.btn.small { min-height: 44px; font-size: 16px; }
.btn.tall { min-height: 88px; font-size: 19px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.pad > .btn.big:first-child { margin-bottom: 14px; }

/* Segmentkontrol */
.seg { display: flex; gap: 8px; margin-bottom: 4px; }
.seg > * {
  flex: 1; min-height: 48px; border-radius: 10px; border: 2px solid #A8ADA3; background: #fff;
  font: inherit; font-size: 18px; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.seg > .on { border-color: var(--green-dark); background: var(--green-dark); color: #fff; font-weight: 700; }
.seg input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Kort (sager) */
.cards { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 2px solid #E2E1DA; color: var(--ink); text-decoration: none; }
.card-title { font-size: 20px; font-weight: 700; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: 15px; font-weight: 700; }
.tag.trafik { background: var(--orange-light); color: #8A2E08; }
.tag.jagt { background: var(--green-light); color: var(--green-dark); }
.tag.acute { background: var(--ink); color: #fff; }
.tag.live { background: var(--green); color: #fff; }
.notice { display: block; margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--green-light); color: var(--green-dark); font-weight: 700; text-decoration: none; }

/* Bokse og formularer */
.box { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.box.stack, section.box[data-for] { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, label[for] { font-size: 16px; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  font: inherit; font-size: 18px; color: var(--ink); background: #fff;
  min-height: 48px; padding: 8px 12px; border-radius: 10px; border: 2px solid #C6CFBF; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--ink); min-height: 44px; }
.check input { width: 26px; height: 26px; }
.req { color: var(--danger); }
.autotag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--green-light); color: var(--green-dark); font-size: 13px; font-weight: 700; vertical-align: middle; }

/* Spørgsmål med valg (afslut sag) */
fieldset.q { border: 0; margin: 0; padding: 0; }
fieldset.q legend { font-size: 18px; font-weight: 700; margin-bottom: 6px; padding: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label {
  min-height: 48px; padding: 8px 16px; border-radius: 10px; border: 2px solid #C6CFBF; background: #fff;
  display: flex; align-items: center; font-size: 18px; color: var(--ink); cursor: pointer;
}
.opts label.on { border-color: var(--green-dark); background: var(--green-dark); color: #fff; font-weight: 700; }
.opts input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.opts label:focus-within, .seg > :focus-within { outline: 3px solid #1D4ED8; outline-offset: 2px; }

/* Nøgle/værdi */
.kv { display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 17px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; word-break: break-word; }

/* Kort (Leaflet) */
.map { width: 100%; background: #DCE5D6; border-radius: var(--radius); border: 2px solid #C6CFBF; z-index: 0; }
.map.small { height: 220px; }
.field-map { height: 38vh; border-radius: 0; border-width: 0 0 2px; }
.big-map { height: calc(100vh - 330px); min-height: 320px; border-radius: 0; border-width: 2px 0; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 15px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: -8px; border: 2px solid #fff; box-shadow: 0 0 0 1px #999; }
.dot.ring { background: #fff; border: 3px solid #1D4ED8; box-shadow: none; }

/* Felt */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats span { display: block; font-size: 15px; color: var(--muted); }
.stats strong { font-size: 28px; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.thumbs img, .thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* Dialog (observation) */
dialog { border: 0; border-radius: var(--radius); padding: 18px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices label { min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid #C6CFBF; border-radius: 10px; font-size: 17px; color: var(--ink); }
.choices input { width: 22px; height: 22px; }

/* Bundmenu */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff; border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#nav a { height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 16px; }
#nav a.active { color: var(--green); font-weight: 700; }
#nav svg { width: 26px; height: 26px; }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 3000;
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 12px; font-weight: 700; text-align: center;
}

@media (min-width: 700px) {
  main { max-width: 640px; margin: 0 auto; }
  #nav { max-width: 640px; margin: 0 auto; }
}

/* Kortknapper: store nok til brug i felten */
.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
.map-fit {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  background: #fff; color: var(--ink); border: 2px solid rgba(0, 0, 0, .25); border-radius: 8px;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.map-fit svg { width: 20px; height: 20px; }
