/* RallyRoute — rustige, herkenbare bediening */
:root {
  --blue: #1a5fd6;
  --blue-dark: #134aab;
  --blue-soft: #e8f0fd;
  --blue-softer: #f2f6fe;
  --navy: #0e1b33;
  --text: #1f2a3d;
  --muted: #5d6b82;
  --border: #dde4ee;
  --border-strong: #c7d2e1;
  --bg: #f3f6fa;
  --card: #ffffff;
  --green: #148a3d;
  --green-soft: #e6f6ec;
  --orange: #b85c00;
  --orange-soft: #fff3e3;
  --red: #c8281f;
  --red-soft: #fdecea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 2px 8px rgba(16, 32, 64, .04);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --c1: #16a34a; --c2: #2563eb; --c3: #f59e0b; --c4: #dc2626; --c5: #7c3aed; --c6: #0891b2; --c7: #db2777; --c8: #65a30d;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0; }
h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- topbalk ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 24px; margin: 12px 16px 0;
  padding: 10px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.45rem; color: var(--blue-dark); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; gap: 6px; margin: 0 auto; }
.mainnav a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; color: var(--text); font-weight: 500; }
.mainnav a:hover { background: var(--bg); text-decoration: none; }
.mainnav a.active { background: var(--blue-soft); color: var(--blue-dark); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; }
.username { font-weight: 550; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; }
.usermenu-panel a, .usermenu-panel button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; background: none; font: inherit; color: var(--text); border-radius: 6px; cursor: pointer; text-align: left; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--bg); text-decoration: none; }

/* ---------- pagina ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head .lead { color: var(--muted); font-size: 1.1rem; margin: 6px 0 0; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.backlink { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1.05rem; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head .spacer { flex: 1; }
.card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-dark); display: grid; place-items: center; flex: none; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-side { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 280px minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }

/* ---------- knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--blue-dark); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--blue-softer); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(26, 95, 214, .35); outline-offset: 1px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: #f0b8b4; }
.btn-danger:hover { background: var(--red-soft); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #a8211a; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; border-radius: 8px; }
.btn-icon { min-height: 36px; width: 36px; padding: 0; border-radius: 8px; color: var(--muted); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- formulieren ---------- */
label, .label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: .95rem; }
.req { color: var(--red); margin-left: 3px; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  font: inherit; color: var(--text); }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6b82' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.hint { color: var(--muted); font-size: .85rem; margin: 5px 0 0; }
.field-error { color: var(--red); font-size: .875rem; margin: 5px 0 0; font-weight: 550; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); background: #fffafa; }
.input-addon { display: flex; }
.input-addon .addon { display: grid; place-items: center; width: 48px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); background: var(--bg); }
.input-addon input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-addon .suffix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); background: var(--bg); }
.input-addon .suffix + input, .input-addon input:has(+ .suffix) { border-radius: 0; }
.input-addon input:not(:last-child) { border-radius: 0; }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 0; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--blue); }
.counter { text-align: right; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.help { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: .72rem; font-weight: 700; position: relative; cursor: help; margin-left: 4px; vertical-align: 1px; }
.help-tip { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 240px; background: var(--navy); color: #fff; padding: 9px 11px; border-radius: 8px; font-weight: 400; font-size: .82rem; line-height: 1.4; z-index: 50; }
.help:hover .help-tip, .help:focus .help-tip { display: block; }

/* ---------- meldingen ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash span { flex: 1; }
.flash-success { background: var(--green-soft); border-color: #b9e3c6; color: #0d5c2a; }
.flash-error { background: var(--red-soft); border-color: #f3c3bf; color: #8c1d16; }
.flash-info { background: var(--blue-soft); border-color: #c5d8f7; color: var(--blue-dark); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: grid; gap: 8px; width: min(420px, calc(100% - 40px)); }
.toasts .flash { box-shadow: 0 8px 24px rgba(14, 27, 51, .18); }
.flash-close { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--blue-softer); color: var(--text); }
.note .icon { color: var(--blue); margin-top: 2px; }
.note strong { color: var(--blue-dark); display: block; margin-bottom: 2px; }
.note p:last-child { margin: 0; }
.note-warn { background: var(--orange-soft); }
.note-warn .icon, .note-warn strong { color: var(--orange); }
.note-error { background: var(--red-soft); }
.note-error .icon, .note-error strong { color: var(--red); }
.note-ok { background: var(--green-soft); }
.note-ok .icon, .note-ok strong { color: var(--green); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- labels ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-grey { background: #eef1f5; color: var(--muted); }
.badge-blue { background: var(--blue-soft); color: var(--blue-dark); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--blue-soft); color: var(--blue-dark); font-size: .75rem; font-weight: 600; }
.tag-grey { background: #eef1f5; color: var(--muted); }

/* ---------- tabellen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 12px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.list th a.sorted { color: var(--blue-dark); }
table.list td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fafcff; }
table.list .code { font-weight: 700; font-size: 1.05rem; color: var(--navy); }
table.list .actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.row-archived td { color: var(--muted); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { color: var(--border-strong); margin-bottom: 10px; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 6px; }
.pager-links a, .pager-links span { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff; padding: 0 8px; }
.pager-links .current { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pager-links .disabled { color: var(--border-strong); }

/* ---------- bestanden ---------- */
.filerow { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filerow:first-of-type { padding-top: 0; }
.filerow-info { flex: 1; min-width: 200px; }
.filerow-info strong { color: var(--navy); display: block; }
.filerow-info .name { display: block; }
.filerow-info .meta { color: var(--muted); font-size: .82rem; }
.filerow-missing .filerow-info .name { color: var(--orange); font-weight: 550; }
.filetype { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; flex: none; border: 1px solid var(--border); }
.filetype-word { color: #fff; background: #1d5bbf; font-size: 1.2rem; border-color: #1d5bbf; }
.filetype-gpx { color: var(--green); background: var(--green-soft); font-size: .78rem; }
.dropzone { position: relative; border: 2px dashed var(--border-strong); border-radius: 10px; padding: 16px; text-align: center; background: var(--blue-softer); color: var(--muted); font-size: .9rem; transition: border-color .15s, background .15s; }
.dropzone strong { color: var(--blue-dark); display: block; font-size: 1rem; }
.dropzone.dragover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .chosen { color: var(--navy); font-weight: 600; margin-top: 6px; }
.upload-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.versions { margin-top: 14px; }
.versions summary { cursor: pointer; color: var(--blue-dark); font-weight: 550; }
.versions ul { list-style: none; padding: 0; margin: 10px 0 0; }
.versions li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.versions li span { flex: 1; }

/* ---------- kaart ---------- */
.map { height: 460px; border-radius: 10px; border: 1px solid var(--border); background: #e9efe6; position: relative; z-index: 0; }
.map-tall { height: 560px; }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 20px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: .9rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.map-tools { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.map-tools .search { flex: 1; min-width: 200px; position: relative; }
.map-tools .search input { padding-left: 38px; }
.map-tools .search .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.geo-results { position: absolute; z-index: 1200; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.geo-results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.geo-results button:hover { background: var(--blue-softer); }
.pin-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--red-soft); color: #8c1d16; font-size: .9rem; margin-bottom: 10px; }
.pin-bar span { flex: 1; }
.leaflet-container { font-family: var(--font); }
.map-label { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-weight: 600; font-size: .8rem; color: var(--navy); box-shadow: var(--shadow); white-space: nowrap; }
.pin-marker { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--red); transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* ---------- etappelijst / filters ---------- */
.filter-card .field:last-child { margin-bottom: 0; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.search-input input { padding-left: 38px; }

/* ---------- rallybouwer ---------- */
.builder-title { display: flex; align-items: center; gap: 10px; }
.builder-title input { field-sizing: content; min-width: 220px; font-size: 1.9rem; font-weight: 700; color: var(--navy); border: 1px solid transparent; padding: 4px 8px; margin-left: -8px; min-height: 0; background: transparent; }
.builder-title input:hover { border-color: var(--border); }
.builder-title input:focus { border-color: var(--border-strong); background: #fff; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); margin: 6px 0 4px; }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.blocks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.block { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.block.dragging { opacity: .45; }
.block.drop-before { box-shadow: 0 -3px 0 var(--blue); }
.block.drop-after { box-shadow: 0 3px 0 var(--blue); }
.block.disabled-block { background: #f8fafc; }
.block.disabled-block .block-name { color: var(--muted); }
.block.has-issue { border-color: #f0b8b4; background: #fffafa; }
.block.is-focused { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 95, 214, .15); }
.block-grip { cursor: grab; color: var(--muted); padding: 6px 2px; display: grid; place-items: center; }
.block-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-soft); color: var(--blue-dark); display: grid; place-items: center; flex: none; }
.block-dot { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #f3f6fa; }
.block-dot i { width: 16px; height: 16px; border-radius: 50%; display: block; }
.block-main { flex: 1; min-width: 0; }
.block-name { font-weight: 650; color: var(--navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 34px; margin-bottom: 4px; }
.block-name .grow { flex: 1; }
.block-name .btn-sm { min-height: 30px; padding: 0 8px; }
.block-sub { font-size: .82rem; color: var(--muted); }
.block-issue { font-size: .82rem; color: var(--red); font-weight: 550; margin-top: 2px; }
.block select { min-height: 40px; padding-top: 6px; padding-bottom: 6px; width: 100%; }
.block-controls { display: flex; flex-direction: column; gap: 0; align-items: center; }
.block-controls .btn-icon { min-height: 30px; height: 30px; }
.block-toggle { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 500; margin: 0; cursor: pointer; white-space: nowrap; }
.block-toggle input { width: 18px; height: 18px; accent-color: var(--blue); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.totals { display: flex; gap: 24px; flex-wrap: wrap; padding: 12px 16px; border-radius: 10px; background: var(--bg); margin-top: 16px; }
.totals div { display: flex; flex-direction: column; }
.totals b { font-size: 1.2rem; color: var(--navy); }
.totals small { color: var(--muted); }
.savebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.savestate { font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.savestate.dirty { color: var(--orange); font-weight: 600; }
.standard-list { display: grid; gap: 10px; }
.standard-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.standard-item .grow { flex: 1; font-weight: 550; }
.variant-list { display: grid; gap: 8px; margin-top: 10px; }
.variant { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.variant.chosen { border-color: var(--blue); background: var(--blue-softer); }
.variant .swatch { width: 14px; height: 14px; border-radius: 50%; }
.variant-code { font-weight: 700; color: var(--navy); }
.variant-meta { color: var(--muted); font-size: .85rem; }
.variant .btn-sm { min-height: 32px; }
.panel-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-tabs button { border: 1px solid var(--border); background: #fff; padding: 7px 12px; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text); }
.panel-tabs button.active { background: var(--blue-soft); border-color: #c5d8f7; color: var(--blue-dark); font-weight: 600; }
.sticky { position: sticky; top: 96px; }

dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(14, 27, 51, .45); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin-bottom: 14px; }

/* ---------- inloggen ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #eaf1fd 0%, var(--bg) 60%); }
.login-card { width: 100%; max-width: 420px; }
.login-card .brand { justify-content: center; margin-bottom: 20px; font-size: 1.8rem; }
.page.page-login { padding: 0; max-width: none; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .grid-2, .grid-side, .grid-3 { grid-template-columns: 1fr; }
  .mainnav span { display: none; }
  .username { display: none; }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 8px 10px; margin: 8px 8px 0; }
  .brand span { display: none; }
  .mainnav a { padding: 9px 10px; }
  .page { padding: 18px 12px 40px; }
  .page-head { flex-direction: column; }
  h1 { font-size: 1.7rem; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .map { height: 360px; }
}
@media print {
  .topbar, .page-actions, .btn { display: none !important; }
}
