@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap");

:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0b0b0b;
  --panel-2: #111111;
  --line: #3a3a3a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #ffffff;
  --warn: #d4d4d4;
  --danger: #ffffff;
  --blue: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.capture-page,
.operator-page {
  height: 100dvh;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #101010;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

button.primary {
  background: #f5f5f5;
  border-color: #f5f5f5;
  color: #050505;
}

button.danger {
  background: #050505;
  border-color: #f5f5f5;
  color: #f5f5f5;
}

button.install-button {
  background: #111111;
  border-color: #f5f5f5;
}

button.install-button.ready {
  background: #f5f5f5;
  border-color: #f5f5f5;
  color: #050505;
}

button.install-button.installed {
  background: #050505;
  border-color: #555555;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #050505;
  color: var(--text);
  padding: 7px 9px;
}

textarea {
  min-height: 54px;
  resize: none;
}

.gdc-map-context-menu {
  position: absolute;
  z-index: 20;
  min-width: 184px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: rgba(8, 8, 8, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  padding: 8px;
  backdrop-filter: blur(10px);
}

.gdc-map-context-menu a {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.gdc-map-context-menu a:hover {
  color: #facc15;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gdc-map-context-menu span {
  color: var(--muted);
  font-size: 11px;
}

.shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #050505;
  min-height: 50px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #111923;
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
}

.brand span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
}

.capture-content,
.operator-content {
  height: 100%;
}

.dashboard-content {
  width: min(1600px, 100%);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  min-height: 0;
}

.capture-grid,
.operator-grid {
  height: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.grid > * {
  min-width: 0;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-9 {
  grid-column: span 9;
}

.span-12 {
  grid-column: span 12;
}

.stack {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.capture-preview-panel,
.map-panel {
  grid-template-rows: minmax(0, 1fr) auto;
}

.capture-settings {
  align-content: start;
}

.dashboard-main {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.dashboard-main > * {
  grid-column: 1 / -1;
}

.dashboard-split {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.capture-page .topbar .row {
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.capture-page .topbar button {
  min-height: 34px;
  padding: 0 9px;
}

.row.wrap {
  flex-wrap: wrap;
}

.device-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.device-status.good {
  color: var(--text);
}

.device-status.warn,
.device-status.bad {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: var(--danger);
}

.status-dot.online {
  background: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.metric {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 8px;
  min-height: 48px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Operator brand: full company name in white Instrument Serif. */
.operator-page .brand-logo {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* Operator: two square panels side by side (map left, image right). */
.operator-page .operator-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.operator-squares {
  display: flex;
  gap: 10px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.operator-square {
  aspect-ratio: 1 / 1;
  height: 100%;
  max-height: 100%;
  max-width: calc(50% - 5px);
  padding: 0;
  display: flex;
  overflow: hidden;
}

.operator-square .map,
.image-square .frame-viewport {
  width: 100%;
  height: 100%;
  border: 0;
}

.image-square {
  position: relative;
}

.frame-viewport {
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
}

.frame-viewport.dragging {
  cursor: grabbing;
}

.operator-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.frame-zoom-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.frame-zoom-controls button {
  min-height: 34px;
  min-width: 34px;
  padding: 0 8px;
  background: rgba(5, 5, 5, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

/* Satellite must render in color on the operator map. */
.operator-page .map canvas,
.operator-page .map .maplibregl-canvas,
.operator-page .map .maplibregl-canvas-container {
  filter: none;
}

/* Live operator (self) position marker. */
.operator-self-marker {
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.operator-self-marker svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
}

/* Compass (top-right of map): bearing + distance to the device. */
.map-square {
  position: relative;
}

.device-compass {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 76px;
  display: grid;
  justify-items: center;
  gap: 2px;
  pointer-events: none;
}

.device-compass svg {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55));
}

.compass-ring {
  fill: rgba(5, 5, 5, 0.72);
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
}

.compass-n {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.compass-needle {
  fill: #facc15;
  stroke: #ffffff;
  stroke-width: 1;
  stroke-linejoin: round;
}

#compassNeedle {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.3s ease;
}

.compass-distance {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(5, 5, 5, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 1px 6px;
  white-space: nowrap;
}

/* Recenter / follow-me button. */
.map-recenter-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
}

.map-recenter-btn svg {
  width: 22px;
  height: 22px;
}

.map-recenter-btn.active {
  color: #2f7bff;
  border-color: #2f7bff;
}

@media (max-width: 720px) {
  .operator-squares {
    flex-direction: column;
    justify-content: flex-start;
  }

  .operator-square {
    height: auto;
    width: 100%;
    max-width: 100%;
    max-height: calc(50% - 5px);
  }
}

.operator-page .map-panel {
  grid-template-rows: minmax(0, 1fr) auto;
}

.operator-page .map-panel .metric-grid {
  min-height: 78px;
}

.operator-page .map-panel .metric {
  min-height: 72px;
}

.map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ededed;
  overflow: hidden;
}

.map canvas,
.map .maplibregl-canvas,
.map .maplibregl-canvas-container {
  filter: grayscale(1) contrast(1.14) brightness(0.96);
}

.map-status {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  max-width: min(360px, calc(100% - 16px));
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.88);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 11px;
  pointer-events: none;
}

.map .maplibregl-ctrl-group {
  background: #f5f5f5;
  border: 1px solid var(--line);
  border-radius: 0;
}

.map .maplibregl-ctrl button {
  min-height: 30px;
  width: 30px;
  padding: 0;
}

.map .maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.82);
  color: #111111;
}

.preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 0;
  object-fit: cover;
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 0;
  object-fit: cover;
  background: #000;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.gallery > .empty-state {
  grid-column: 1 / -1;
}

.item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
}

.list {
  display: grid;
  gap: 6px;
  max-height: 100%;
  overflow: hidden;
}

.list-row {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 12px;
}

.list-row.active {
  border-color: var(--blue);
}

.empty-state {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 0;
  background: #0d1117;
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
}

.empty-state strong {
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 0;
  border: 1px solid var(--line);
  padding: 0 7px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill.good {
  color: #050505;
  border-color: #f5f5f5;
  background: #f5f5f5;
}

.pill.warn {
  color: var(--warn);
  border-color: #777777;
}

.pill.bad {
  color: var(--danger);
  border-color: #f5f5f5;
}

.form-grid {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.map-provider {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  border: 0;
  background: rgba(255, 255, 255, 0.86);
  color: #050505;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.dashcam-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #181818;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.dashcam-screen strong {
  font-size: clamp(28px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: 0;
}

.coordinate-fields {
  display: grid;
  gap: 8px;
}

.link-button {
  min-height: auto;
  width: max-content;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.install-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.68);
  padding: 14px;
}

.install-panel-inner {
  width: min(460px, 100%);
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #050505;
  color: var(--text);
  padding: 14px;
}

.install-panel-inner p,
.install-panel-inner ol {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.install-panel-inner ol {
  padding-left: 18px;
}

.control-bar,
.vehicle-picker {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.compact-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.direction-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.icon-button,
.vehicle-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.icon-button svg,
.vehicle-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button span,
.vehicle-option span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-option {
  min-height: 48px;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.vehicle-option.active {
  background: #f5f5f5;
  border-color: #f5f5f5;
  color: #050505;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  color: #d7e1ea;
  font-size: 12px;
}

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .capture-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .capture-page .shell {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .capture-page .content {
    width: 100%;
    max-width: 100vw;
    height: auto;
    overflow: visible;
  }

  .content {
    width: 100%;
    max-width: 100vw;
    padding: 8px;
  }

  .grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
  }

  .panel {
    width: 100%;
    max-width: 100%;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-7,
  .span-8,
  .span-9,
  .span-12 {
    grid-column: span 1;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capture-page .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    width: 100%;
    max-width: 100vw;
    gap: 6px;
  }

  .capture-page .brand {
    min-width: 0;
  }

  .capture-page .topbar .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .capture-page .topbar .row > * {
    min-width: 0;
  }

  .capture-page .topbar button {
    width: 100%;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .capture-page .topbar #onlineDot {
    justify-self: start;
    align-self: center;
  }

  .capture-page .topbar #uploadStatus {
    align-self: center;
    justify-self: start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar {
    align-items: center;
  }

  .operator-page .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .operator-page .topbar .row {
    flex-wrap: nowrap;
  }

  .operator-page #deviceStatus {
    display: none;
  }

  button,
  input,
  select {
    min-height: 34px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .capture-grid,
  .operator-grid {
    height: auto;
    grid-template-rows: auto;
  }

  .capture-preview-panel {
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .capture-preview-panel .control-bar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .capture-preview-panel .control-bar > button {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 0 8px;
    font-size: 15px;
  }

  .capture-preview-panel .control-bar > button span {
    white-space: nowrap;
  }

  .capture-preview-panel .control-bar .icon-button svg {
    width: 19px;
    height: 19px;
  }

  .capture-preview-panel .preview {
    width: 100%;
    height: min(36dvh, 320px);
    min-height: 180px;
  }

  .vehicle-picker {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    gap: 6px;
  }

  .vehicle-option {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
  }

  .metric-grid,
  .form-grid,
  .capture-settings > .stack {
    width: 100%;
    max-width: 100%;
  }

  .pill {
    width: 100%;
    max-width: 100%;
  }

  .capture-settings,
  .operator-grid > aside {
    max-height: none;
    overflow-y: auto;
  }
}

@media (max-height: 520px) {
  .topbar {
    min-height: 40px;
    padding: 5px 8px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand span,
  .muted {
    font-size: 10px;
  }

  .content {
    padding: 6px;
  }

  .grid,
  .operator-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 6px;
  }

  .capture-page .grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .capture-page .span-3,
  .capture-page .span-4,
  .capture-page .span-5,
  .capture-page .span-7,
  .capture-page .span-8,
  .capture-page .span-9,
  .capture-page .span-12 {
    grid-column: 1 / -1;
  }

  .operator-grid > .span-8 {
    grid-column: span 7;
  }

  .operator-grid > .span-4 {
    grid-column: span 5;
  }

  .panel {
    padding: 6px;
  }

  .stack,
  .form-grid {
    gap: 5px;
  }

  button,
  input,
  select {
    min-height: 30px;
    padding: 0 7px;
    font-size: 12px;
  }

  textarea {
    min-height: 34px;
    font-size: 12px;
  }

  .control-bar,
  .vehicle-picker {
    gap: 5px;
  }

  .vehicle-option {
    min-height: 36px;
    font-size: 10px;
  }

  .vehicle-option svg,
  .icon-button svg {
    width: 14px;
    height: 14px;
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .capture-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capture-page .capture-preview-panel .preview {
    height: min(38dvh, 220px);
    min-height: 150px;
  }

  .metric {
    min-height: 42px;
    padding: 5px;
  }

  .metric strong {
    margin-top: 2px;
    font-size: 14px;
  }

  .metric span,
  .field label,
  .pill {
    font-size: 10px;
  }

  .thumb {
    aspect-ratio: 2.2 / 1;
  }

  .list-row:nth-child(n + 3) {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  html,
  body,
  .capture-page {
    width: 100%;
    height: 100dvh;
    max-width: 100%;
    overflow: hidden;
  }

  .capture-page .shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .capture-page .topbar {
    display: grid;
    grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1.45fr);
    align-items: center;
    min-height: 38px;
    padding: 4px 7px;
    gap: 8px;
  }

  .capture-page .brand {
    gap: 0;
  }

  .capture-page .brand strong {
    font-size: 13px;
  }

  .capture-page .brand span,
  .capture-page .topbar #onlineDot {
    display: none;
  }

  .capture-page .topbar .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(52px, 0.45fr);
    gap: 5px;
    align-items: center;
  }

  .capture-page .topbar button {
    min-height: 30px;
    width: 100%;
    padding: 0 6px;
    font-size: 12px;
  }

  .capture-page .topbar #uploadStatus {
    min-width: 0;
    justify-self: stretch;
    text-align: center;
    font-size: 11px;
  }

  .capture-page .content {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 5px;
    overflow: hidden;
  }

  .capture-page .capture-grid {
    height: 100%;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
  }

  .capture-page .capture-preview-panel,
  .capture-page .capture-settings {
    min-height: 0;
    overflow: hidden;
  }

  .capture-page .capture-preview-panel {
    grid-column: 1;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 6px;
  }

  .capture-page .capture-settings {
    grid-column: 2;
    align-content: stretch;
    padding: 6px;
    gap: 5px;
  }

  .capture-page .capture-preview-panel .control-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .capture-page .capture-preview-panel .control-bar > button {
    min-height: 50px;
    padding: 0 8px;
    font-size: 15px;
  }

  .capture-page .capture-preview-panel .preview {
    height: 100%;
    min-height: 0;
  }

  .capture-page .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .capture-page .field label {
    font-size: 9px;
  }

  .capture-page input,
  .capture-page select {
    min-height: 30px;
    padding: 0 6px;
    font-size: 12px;
  }

  .capture-page .vehicle-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .capture-page .vehicle-option {
    min-height: 38px;
    padding: 0 3px;
    font-size: 10px;
  }

  .capture-page .vehicle-option svg,
  .capture-page .icon-button svg {
    width: 14px;
    height: 14px;
  }

  .capture-page .capture-preview-panel .icon-button svg {
    width: 19px;
    height: 19px;
  }

  .capture-page .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .capture-page .metric-grid .metric:nth-child(5) {
    display: none;
  }

  .capture-page .metric {
    min-height: 40px;
    padding: 5px;
  }

  .capture-page .metric span {
    font-size: 9px;
  }

  .capture-page .metric strong {
    margin-top: 1px;
    font-size: 13px;
  }

  .capture-page .capture-settings > .stack {
    display: none;
  }
}
