:root {
  --ink: #07111f;
  --muted: #64748b;
  --line: #dbe3ea;
  --paper: #f4f7f8;
  --white: #fff;
  --mint: #0f766e;
  --mint-soft: #e7f5f1;
  --coral: #e25f45;
  --blue: #0369a1;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(7, 17, 31, .11);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.admin-brand > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; background: var(--mint); color: white; font-family: var(--serif); font-size: 20px; }
.admin-brand strong { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.admin-brand small { color: var(--muted); font-size: 11px; }
.icon-button, .primary-icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); }
.primary-icon-button { border-color: var(--mint); background: var(--mint); color: white; }
.icon-button svg, .primary-icon-button svg { width: 18px; height: 18px; }
.primary-button, .secondary-button, .danger-button, .text-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 7px; font-size: 12px; font-weight: 750; text-decoration: none; }
.primary-button { border: 1px solid var(--mint); background: var(--mint); color: white; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.danger-button { border: 1px solid #fecaca; background: #fff5f5; color: var(--danger); }
.text-button { min-height: 34px; padding: 0; border: 0; background: transparent; color: var(--blue); }
.primary-button svg, .secondary-button svg, .danger-button svg, .text-button svg { width: 16px; height: 16px; }
button:disabled { cursor: wait; opacity: .6; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #07111f; }
.login-panel { width: min(430px, 100%); padding: 42px; border-radius: 8px; background: white; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.login-panel .admin-brand { margin-bottom: 48px; }
.login-panel h1 { margin: 0 0 28px; font-family: var(--serif); font-size: 38px; font-weight: 500; }
.login-panel > label, .password-panel label { display: block; margin: 15px 0 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.password-field { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.password-field input, .password-panel input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; outline: none; }
.password-field input:focus, .password-panel input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.login-panel .primary-button { width: 100%; margin-top: 18px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 24px; color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link svg { width: 15px; }

.admin-view { min-height: 100vh; }
.admin-header { position: sticky; z-index: 20; top: 0; height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.admin-layout { display: grid; min-height: calc(100vh - 66px); grid-template-columns: 330px minmax(0, 1fr); }
.trip-sidebar { position: sticky; top: 66px; height: calc(100vh - 66px); overflow: hidden; border-right: 1px solid var(--line); background: white; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 14px; }
.sidebar-head h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.search-box { display: flex; align-items: center; gap: 9px; margin: 0 16px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.search-box svg { width: 16px; color: var(--muted); }
.search-box input { width: 100%; height: 40px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.list-summary { display: flex; justify-content: space-between; padding: 13px 18px 9px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.system-check-button { display: flex; width: calc(100% - 32px); min-height: 52px; align-items: center; gap: 10px; margin: 3px 16px 10px; padding: 9px 11px; border: 1px solid #99d5cc; border-radius: 7px; background: var(--mint-soft); color: var(--mint); text-align: left; }
.system-check-button:hover, .system-check-button.active { border-color: var(--mint); background: var(--mint); color: white; }
.system-check-button svg { width: 18px; flex: 0 0 auto; }
.system-check-button span, .system-check-button strong, .system-check-button small { display: block; }
.system-check-button span { min-width: 0; }
.system-check-button strong { font-size: 11px; }
.system-check-button small { margin-top: 2px; font-size: 9px; opacity: .76; }
.trip-list { height: calc(100% - 207px); overflow: auto; padding: 0 8px 18px; }
.trip-list-item { display: grid; width: 100%; grid-template-columns: 62px 1fr auto; gap: 11px; align-items: center; padding: 9px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; }
.trip-list-item:hover { background: #f3f7f8; }
.trip-list-item.active { background: var(--mint-soft); box-shadow: inset 3px 0 var(--mint); }
.trip-list-item img { width: 62px; height: 46px; object-fit: cover; border-radius: 5px; background: #e2e8f0; }
.trip-list-item span { min-width: 0; }
.trip-list-item strong, .trip-list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-list-item strong { font-size: 12px; }
.trip-list-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.visibility-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.visibility-dot.visible { background: #10b981; }

.editor-shell { min-width: 0; }
.empty-state { min-height: calc(100vh - 66px); display: grid; align-content: center; justify-items: center; color: var(--muted); }
.empty-state svg { width: 42px; height: 42px; }
.empty-state h2 { margin: 15px 0; font-family: var(--serif); font-weight: 500; }
.trip-editor { max-width: 1180px; margin: 0 auto; padding: 30px 36px 80px; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.editor-header h1 { margin: 0; font-family: var(--serif); font-size: 40px; font-weight: 500; }
.editor-actions { display: flex; gap: 9px; }
.save-state { margin-left: 8px; color: var(--muted); font-weight: 650; }
.save-state.dirty { color: #b45309; }
.save-state.saving { color: var(--blue); }
.editor-tabs { position: sticky; z-index: 10; top: 66px; display: flex; gap: 3px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.editor-tab { min-height: 38px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.editor-tab.active { background: var(--ink); color: white; }
.editor-tab span { margin-left: 5px; opacity: .65; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.form-section { margin-bottom: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 6px 24px rgba(7,17,31,.035); }
.section-title { display: flex; gap: 13px; margin-bottom: 24px; }
.section-title > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; background: var(--mint-soft); color: var(--mint); font-size: 10px; font-weight: 800; }
.section-title h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; gap: 17px; }
.form-grid.two, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .form-section > label, .settings-grid > label { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.form-grid input, .form-grid textarea, .form-section > label input, .settings-grid input, .settings-grid select { display: block; width: 100%; margin-top: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fbfcfd; color: var(--ink); font-size: 13px; font-weight: 450; text-transform: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--mint) !important; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.wide { grid-column: 1 / -1; }
.subsection-head, .image-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 11px; }
.subsection-head h3 { margin: 0; font-size: 14px; }
.record-rows { display: grid; gap: 9px; }
.record-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 36px; gap: 8px; align-items: end; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.station-rows .record-row { grid-template-columns: 1.55fr .7fr .72fr .72fr 1.35fr 36px; }
.record-row label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.record-row input { width: 100%; min-width: 0; margin-top: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 11px; }
.station-place-field, .main-place-field { position: relative; min-width: 0; }
.main-place-field { z-index: 2; }
.station-field-label { display: block; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.station-search-control { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 5px; }
.station-search-control input { min-width: 0; }
.station-search-button { display: grid; width: 34px; height: 34px; align-self: end; margin-top: 5px; place-items: center; border: 1px solid #99d5cc; border-radius: 5px; background: var(--mint-soft); color: var(--mint); }
.station-search-button:hover, .station-search-button:focus-visible { border-color: var(--mint); background: var(--mint); color: white; }
.station-search-button:disabled { cursor: wait; opacity: .55; }
.station-search-button svg { width: 15px; height: 15px; }
.geocoder-status { display: block; min-height: 14px; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.geocoder-results { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; display: grid; width: min(430px, 85vw); gap: 3px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: var(--shadow); }
.geocoder-result { display: grid; gap: 2px; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: white; color: var(--ink); text-align: left; }
.geocoder-result:hover, .geocoder-result:focus-visible { background: var(--mint-soft); outline: none; }
.geocoder-result strong { font-size: 11px; }
.geocoder-result span { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.geocoder-result small { color: var(--blue); font-size: 9px; }
.geocoder-attribution { margin: -5px 0 11px; color: var(--muted); font-size: 9px; }
.geocoder-attribution a { color: var(--blue); }
.record-delete { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 6px; background: #fff1f2; color: var(--danger); }
.record-delete svg { width: 15px; }

.settings-grid { display: grid; gap: 17px; }
.toggle-row { display: flex !important; min-height: 60px; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; text-transform: none !important; }
.toggle-row span strong, .toggle-row span small { display: block; }
.toggle-row span strong { color: var(--ink); font-size: 12px; }
.toggle-row span small { margin-top: 3px; font-weight: 450; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 40px; height: 22px; border-radius: 20px; background: #cbd5e1; transition: .2s; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; content: ""; transition: .2s; }
.toggle-row input:checked + i { background: var(--mint); }
.toggle-row input:checked + i::after { transform: translateX(18px); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border: 1px solid #fecaca; border-radius: 8px; background: #fffafa; }
.danger-zone h2 { margin: 0; font-size: 15px; }
.danger-zone p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.upload-zone { position: relative; display: flex; min-height: 108px; align-items: center; justify-content: center; gap: 14px; border: 1px dashed #89aaa4; border-radius: 7px; background: #f4fbf9; color: var(--mint); }
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.upload-zone.is-uploading { opacity: .65; }
.upload-zone.is-uploading input { pointer-events: none; }
.upload-zone.is-uploading > svg { animation: spin .8s linear infinite; }
.upload-zone > svg { width: 27px; }
.upload-zone strong, .upload-zone span { display: block; }
.upload-zone strong { font-size: 13px; }
.upload-zone span { margin-top: 4px; color: var(--muted); font-size: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.image-toolbar { color: var(--muted); font-size: 11px; }
.image-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.image-admin-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.image-admin-card.is-cover { border-color: #eab308; box-shadow: 0 0 0 2px rgba(234,179,8,.15); }
.image-admin-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e2e8f0; }
.image-card-body { padding: 11px; }
.image-id-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.image-id-line code { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.cover-control { display: inline-flex; align-items: center; gap: 5px; color: #854d0e; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.cover-control input { accent-color: #ca8a04; }
.image-admin-card textarea, .image-admin-card select, .image-admin-card input[type=number] { width: 100%; margin: 5px 0 9px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 11px; }
.image-admin-card label { display: block; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.coordinate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.image-card-actions { display: flex; align-items: center; justify-content: space-between; }
.image-card-actions span { color: var(--muted); font-size: 9px; }
.image-remove { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 6px; background: #fff1f2; color: var(--danger); }
.image-remove svg { width: 15px; }

.system-view { max-width: 1180px; margin: 0 auto; padding: 30px 36px 80px; }
.system-header { margin-bottom: 24px; }
.system-content { min-width: 0; }
.system-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.system-summary > div { padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.system-summary strong, .system-summary span { display: block; }
.system-summary strong { font-family: var(--serif); font-size: 25px; font-weight: 500; }
.system-summary span { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.system-safety { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #a7d9ce; border-radius: 7px; background: #f2fbf8; color: #155e58; font-size: 11px; line-height: 1.5; }
.system-safety svg { width: 18px; flex: 0 0 auto; }
.system-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 15px 0; }
.system-select-all { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.system-select-all input, .system-media-check input { width: 17px; height: 17px; accent-color: var(--mint); }
.system-media-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.system-media-card { display: grid; min-width: 0; grid-template-columns: 112px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.system-media-card.selected { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(15,118,110,.12); }
.system-media-card img { width: 112px; height: 100%; min-height: 105px; object-fit: cover; background: #e2e8f0; }
.system-media-body { min-width: 0; padding: 11px; }
.system-media-check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 11px; font-weight: 750; }
.system-media-body code { display: block; overflow: hidden; margin: 9px 0 5px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.system-media-body small { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; }
.system-content .form-message { color: var(--muted); }
.system-empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed #a7d9ce; border-radius: 7px; background: #f5fbf9; color: #155e58; text-align: center; }
.system-empty strong, .system-empty span { display: block; }
.system-empty strong { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.system-empty span { margin-top: 7px; font-size: 11px; }

.cockpit-button { background:#173c68; }
.cockpit-button:hover,.cockpit-button.active { background:#0b5f8a; }
.cockpit-view { padding:0 38px 70px; }
.cockpit-header { margin-bottom:24px; }
.cockpit-header p:not(.eyebrow) { margin:8px 0 0; color:var(--muted); font-size:11px; }
.cockpit-content { min-width:0; }
.cockpit-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.cockpit-metric { min-height:126px; padding:18px; display:flex; flex-direction:column; justify-content:space-between; border:1px solid var(--line); border-top:4px solid #38bdf8; border-radius:8px; background:#fff; }
.cockpit-metric:nth-child(2) { border-top-color:#f97316; }
.cockpit-metric:nth-child(3) { border-top-color:#10b981; }
.cockpit-metric:nth-child(4) { border-top-color:#8b5cf6; }
.cockpit-metric strong,.cockpit-metric span,.cockpit-metric small { display:block; }
.cockpit-metric strong { font-family:var(--serif); font-size:34px; font-weight:500; }
.cockpit-metric span { font-size:10px; font-weight:800; text-transform:uppercase; }
.cockpit-metric small { color:var(--muted); font-size:9px; line-height:1.4; }
.cockpit-columns { margin-top:14px; display:grid; grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr); gap:14px; align-items:start; }
.cockpit-panel { min-width:0; padding:22px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.cockpit-panel-heading { display:flex; align-items:start; justify-content:space-between; gap:14px; margin-bottom:16px; }
.cockpit-panel-heading h2 { margin:0; font-family:var(--serif); font-size:28px; font-weight:500; }
.cockpit-panel-heading > span { padding:6px 8px; border-radius:6px; color:#9a3412; background:#ffedd5; font-size:9px; font-weight:850; }
.cockpit-issues { display:grid; gap:8px; }
.cockpit-issue { min-width:0; padding:11px; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:11px; border:1px solid var(--line); border-radius:7px; background:#fbfcfd; }
.cockpit-issue > span:first-child { width:42px; height:42px; display:grid; place-items:center; border-radius:6px; color:#9a3412; background:#fff1e9; }
.cockpit-issue svg { width:18px; }
.cockpit-issue strong,.cockpit-issue small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cockpit-issue strong { font-size:11px; }
.cockpit-issue small { margin-top:4px; color:var(--muted); font-size:9px; }
.cockpit-issue button,.cockpit-issue-action { min-height:34px; padding:0 10px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:#fff; font-size:9px; font-weight:800; text-decoration:none; }
.cockpit-empty { padding:34px; border:1px dashed #a7d9ce; border-radius:7px; color:#155e58; background:#f2fbf8; text-align:center; font-size:11px; }
.cockpit-portals { display:grid; gap:8px; }
.cockpit-portals .cockpit-panel-heading { margin-bottom:6px; }
.cockpit-portals > a,.cockpit-portals > button { min-width:0; min-height:62px; padding:10px; display:grid; grid-template-columns:34px minmax(0,1fr) 18px; align-items:center; gap:10px; border:1px solid var(--line); border-radius:7px; color:var(--ink); background:#fbfcfd; text-align:left; text-decoration:none; }
.cockpit-portals > a:hover,.cockpit-portals > button:hover { border-color:#38bdf8; background:#eff6ff; }
.cockpit-portals > a > svg:first-child,.cockpit-portals > button > svg:first-child { width:34px; height:34px; padding:8px; border-radius:6px; color:#0369a1; background:#e0f2fe; }
.cockpit-portals strong,.cockpit-portals small { display:block; }
.cockpit-portals strong { font-size:11px; }
.cockpit-portals small { margin-top:3px; color:var(--muted); font-size:9px; }

.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,17,31,.72); }
.password-panel { position: relative; width: min(440px, 100%); padding: 34px; border-radius: 8px; background: white; box-shadow: var(--shadow); }
.password-panel h2 { margin: 0 0 24px; font-family: var(--serif); font-size: 32px; font-weight: 500; }
.password-panel .primary-button { width: 100%; margin-top: 20px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.toast { position: fixed; z-index: 80; right: 20px; bottom: 20px; max-width: 420px; padding: 12px 16px; border-radius: 7px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1000px) {
  .admin-layout { grid-template-columns: 275px minmax(0, 1fr); }
  .trip-editor { padding-inline: 22px; }
  .image-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-view { padding-inline: 22px; }
  .cockpit-view { padding-inline:22px; }
  .cockpit-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cockpit-columns { grid-template-columns:1fr; }
  .system-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-media-list { grid-template-columns: 1fr; }
  .record-row, .station-rows .record-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-delete { grid-column: -2 / -1; justify-self: end; }
}

@media (max-width: 720px) {
  .admin-header { height: 58px; padding: 0 12px; }
  .admin-brand small, .header-actions .secondary-button { display: none; }
  .admin-layout { display: block; }
  .trip-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .trip-list { height: 270px; }
  .system-mode .trip-list { display: none; }
  .trip-editor { padding: 20px 12px 60px; }
  .system-view { padding: 20px 12px 60px; }
  .cockpit-view { padding:20px 12px 60px; }
  .editor-header { align-items: flex-start; }
  .editor-header h1 { font-size: 29px; }
  .editor-actions .secondary-button { display: none; }
  .editor-tabs { top: 58px; overflow-x: auto; }
  .editor-tab { flex: 0 0 auto; }
  .form-section { padding: 18px 14px; }
  .form-grid.two, .settings-grid { grid-template-columns: 1fr; }
  .geocoder-results { position: static; width: 100%; margin-top: 5px; box-shadow: 0 8px 22px rgba(7,17,31,.1); }
  .wide { grid-column: auto; }
  .image-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .image-card-body { padding: 8px; }
  .coordinate-row { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .system-toolbar { align-items: stretch; flex-direction: column; }
  .system-toolbar .danger-button { width: 100%; }
}

@media (max-width: 420px) {
  .login-panel { padding: 30px 22px; }
  .image-admin-grid { grid-template-columns: 1fr; }
  .system-summary { grid-template-columns: 1fr 1fr; }
  .system-media-card { grid-template-columns: 88px minmax(0, 1fr); }
  .system-media-card img { width: 88px; }
  .cockpit-metrics { grid-template-columns:1fr 1fr; }
  .cockpit-issue { grid-template-columns:36px minmax(0,1fr); }
  .cockpit-issue button { grid-column:2; justify-self:start; }
}
