:root {
  --green-900: #2E3F34; --green-500: #789883; --green-100: #CEE3D2; --gold: #CEC460; --gold-text: #8A7F1E;
  --cream: #FFF4DD; --paper: #FBF8F0; --ink: #1F2A23; --muted: #5C6B61; --line: #D9DED3; --danger: #A33B2E; --white: #fff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 Figtree, system-ui, sans-serif; }
h1, h2, h3 { font-family: Gelasio, Georgia, serif; font-weight: 700; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.2rem, 1.7vw, 1.8rem); }
a { color: var(--green-900); }
button, select, input { font: inherit; }
button { background: var(--green-900); color: var(--white); border: 0; border-radius: 6px; padding: .5em 1em; cursor: pointer; min-height: 40px; }
button.ghost { background: transparent; color: var(--green-900); border: 1px solid var(--green-500); }
button.danger { background: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--gold-text); outline-offset: 2px; }
select, input[type=text], input[type=number], input[type=password] { padding: .45em .6em; border: 1px solid var(--line); border-radius: 6px; background: var(--white); min-height: 40px; max-width: 100%; min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--green-900); color: var(--white); padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-family: Gelasio, serif; font-size: 1.2rem; }
.brand img { height: 34px; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
#nav a { color: var(--green-100); text-decoration: none; padding: 6px 12px; border-radius: 6px; }
#nav a.active { background: var(--cream); color: var(--green-900); font-weight: 600; }
.mode { font-weight: 700; letter-spacing: .04em; padding: 4px 12px; border-radius: 999px; background: var(--gold); color: var(--green-900); }
.mode.live { background: var(--green-100); }
.mode.rec { background: var(--danger); color: var(--white); }
#banner > div { padding: 8px 16px; font-weight: 600; }
.banner-sim { background: var(--gold); color: var(--green-900); }
.banner-warn { background: #F3D9D2; color: #6E241A; }
main { padding: 16px; max-width: 1800px; margin: 0 auto; }
.grid-2 > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.note { color: var(--muted); font-size: .92rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.map-wrap svg { width: 100%; height: auto; display: block; background: var(--cream); border-radius: 8px; }
.map-zone { fill: rgba(120,152,131,.16); stroke: var(--green-500); stroke-width: 2; }
.map-zone-label { font: 600 16px Figtree, sans-serif; fill: var(--green-900); }
.map-door { stroke: var(--gold-text); stroke-width: 8; stroke-linecap: round; }
.map-reader { fill: var(--green-900); }
.map-obj { transition: transform .8s ease; }
.map-obj circle { fill: var(--green-900); stroke: var(--white); stroke-width: 3; }
.map-obj.lost circle { fill: var(--white); stroke: var(--muted); stroke-dasharray: 5 4; }
.map-obj.unknown circle { fill: var(--gold-text); }
.map-obj text { font: 600 14px Figtree, sans-serif; fill: var(--ink); paint-order: stroke; stroke: var(--cream); stroke-width: 4px; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.counter { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.counter b { display: block; font: 700 clamp(2rem, 4vw, 4rem)/1 Gelasio, serif; }
.event-hero { border-radius: 12px; padding: clamp(16px, 2.5vw, 36px); margin-bottom: 16px; background: var(--green-900); color: var(--white); }
.event-hero.ut { background: #5B4A1B; }
.event-hero.uavklart { background: var(--muted); }
.event-hero h1 { font-size: clamp(2.2rem, 6vw, 6rem); margin: 0; }
.event-hero p { margin: .3em 0 0; font-size: clamp(1rem, 2vw, 2rem); }
.event-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tag-inn { color: var(--green-900); font-weight: 700; }
.tag-ut { color: var(--gold-text); font-weight: 700; }
.tag-uavklart { color: var(--muted); font-weight: 700; }
.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
pre { background: #F2EFE6; padding: 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: .85rem; }
input[type=range] { width: 100%; }
@media (max-width: 640px) {
  .top { gap: 8px 12px; padding: 8px 12px; }
  .brand { order: 1; }
  .mode { order: 2; margin-left: auto; }
  #nav { order: 3; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { white-space: nowrap; flex: none; }
  main { padding: 12px; }
  .card { padding: 12px; }
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
