/* Reserve the system-bar insets supplied by Capacitor, or browser safe areas. */
:root {
  --relay-safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --relay-safe-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --relay-safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --relay-safe-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
html { height: 100%; overflow: hidden; }
body { height: var(--app-height, 100dvh); min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: var(--relay-safe-top) var(--relay-safe-right) var(--relay-safe-bottom) var(--relay-safe-left); }
[hidden] { display: none !important; }
.header, .demo-bar { flex: 0 0 auto; }
.header { height: auto; min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.workspace { flex: 1 1 0; min-height: 0; height: auto; overflow: hidden; }
.panel { display: flex; flex-direction: column; overflow: hidden; min-height: 0; max-height: calc(100% - 48px); }
.panel #panel-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #465d4e transparent; scroll-padding: 16px; padding-top: 22px; }
.panel-actions { flex: 0 0 auto; padding: 12px 20px; border-top: 1px solid #2c3d31; background: #101812; }
.panel-actions .primary { margin: 0; }
.panel-toolbar { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 14px; background: #141c17; border-bottom: 1px solid #2c3d31; }
.sheet-summary { text-align: left; min-width: 0; min-height: 44px; padding: 2px; }
.sheet-summary strong { display: block; font-size: .8125rem; font-weight: 650; }
.sheet-summary span { display: block; font-size: .6875rem; color: #a3b1a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.sheet-controls { display: flex; gap: 5px; }
.sheet-control { display: inline-flex; gap: 5px; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px; border: 1px solid #354c3d; border-radius: 10px; font-size: .75rem; color: #cdded3; }
.sheet-control:hover { background: #23382a; border-color: #668371; }
.sheet-control:focus-visible { outline-offset: -3px; }
.sheet-control .icon { width: 15px; height: 15px; }
.workspace[data-panel-size="collapsed"] .panel { max-height: none; height: auto; }
.workspace[data-panel-size="collapsed"] .panel-toolbar { border-bottom: 0; }
.workspace[data-panel-size="collapsed"] #sheet-toggle { background: #39e779; border-color: #39e779; color: #071b0e; }
.workspace[data-panel-size="full"] .panel { top: 12px; bottom: 12px; height: auto; max-height: none; }
.grow { min-width: 0; }
.field input, .field select, .field textarea { min-width: 0; max-width: 100%; font-size: 1rem; }
.two-cols { min-width: 0; }
.location-field strong, .provider-heading h3, .vehicle-summary strong { overflow-wrap: anywhere; }
.fold-section { padding: 0; border: 1px solid #304638; border-radius: 12px; margin: 16px 0; background: #152019; }
.fold-section > summary, .job-request > summary { list-style: none; cursor: pointer; min-height: 48px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .875rem; font-weight: 550; }
.fold-section > summary::-webkit-details-marker, .job-request > summary::-webkit-details-marker { display: none; }
.fold-section > summary::after, .job-request > summary::after { content: '+'; font-size: 1.2rem; font-weight: 400; color: #70e598; flex: 0 0 18px; text-align: center; }
.fold-section[open] > summary::after, .job-request[open] > summary::after { content: '−'; }
.fold-section > summary:focus-visible, .job-request > summary:focus-visible { outline-offset: -3px; border-radius: 11px; }
.fold-body { padding: 0 14px 16px; }
.fold-body .journey { margin: 0; border: 0; padding: 8px 0 0; background: transparent; }
.fold-body .timeline { margin-bottom: 0; }
.fold-body .join-card { margin: 0; padding: 0; border: 0; }
.job-request { padding: 0; }
.job-request > summary { padding: 16px; align-items: flex-start; }
.job-request > summary .job-price { font-size: 1.125rem; }
.job-request h3 { margin: 12px 0 6px; }
.job-request-body { padding: 0 16px 16px; }
.job-request-body .job-specs { margin-top: 0; }
.job-request .caption { display: block; }
dialog { max-width: calc(100vw - var(--relay-safe-left) - var(--relay-safe-right) - 24px); max-height: calc(var(--app-height, 100dvh) - var(--relay-safe-top) - var(--relay-safe-bottom) - 24px); inset: var(--relay-safe-top) var(--relay-safe-right) var(--relay-safe-bottom) var(--relay-safe-left); overscroll-behavior: contain; }
.toast { bottom: calc(var(--relay-safe-bottom) + 58px); max-width: calc(100vw - 24px); }
@media (max-width: 700px) {
  .header { min-height: 62px; gap: 8px; padding: 7px 12px; }
  .header .brand { font-size: 1.4rem; gap: 3px; flex: 0 0 auto; }
  .header .brand-image { height: 32px; width: 32px; }
  .header .main-nav { gap: 0; min-width: 0; }
  .header .nav { font-size: .75rem; padding: 8px; }
  .help-button { display: flex; min-width: 32px; padding: 4px; }
  .workspace { min-height: 0; height: auto; }
  .workspace #map, .workspace .map-shade { height: 100%; }
  .map-shade { pointer-events: none; }
  .workspace .panel { top: 34%; bottom: 0; width: 100%; left: 0; max-height: none; border-radius: 22px 22px 0 0; }
  .workspace.detail-mode .panel { top: 22%; max-height: none; }
  .workspace[data-panel-size="full"] .panel { top: 0; bottom: 0; border-radius: 16px 16px 0 0; }
  .workspace[data-panel-size="collapsed"] .panel { top: auto; bottom: 0; }
  .panel-toolbar { padding: 8px 12px; }
  .panel #panel-content { padding: 18px 20px 24px; }
  .workspace .leaflet-bottom { bottom: calc(var(--sheet-height, 66%) + 6px) !important; }
  .workspace[data-panel-size="full"] .leaflet-bottom { display: none; }
  .map-tools { top: 55px; right: 12px; }
  .map-tools button { min-height: 44px; height: 44px; min-width: 44px; width: 44px; }
  .map-tools button[data-action="zoom-in"], .map-tools button[data-action="zoom-out"] { display: none; }
  .map-label { top: 12px; left: 12px; max-width: calc(100% - 24px); }
  .map-message { top: 62px; left: 12px; right: 68px; max-width: none; font-size: .75rem; }
  .demo-bar { min-height: 38px; padding: 6px 12px; flex-wrap: wrap; gap: 2px 8px; }
  .demo-bar button { padding: 4px 0; }
  .demo-bar > span { flex: 1 1 auto; }
  h1 { font-size: 2rem; }
  .service { min-height: 52px; }
  .primary, .secondary, .text-button { min-height: 44px; }
  .sheet-summary strong { font-size: .75rem; }
  .sheet-control { font-size: .6875rem; padding: 8px 7px; }
  .sheet-control .icon { width: 14px; height: 14px; }
  .operator-mode h2 { font-size: 1.5rem; }
  .operator-mode .subheading { margin: 10px 0 14px; }
  .operator-tabs { margin-top: 14px; }
}
/* Short windows and keyboards shrink the scroll area, never the controls. */
@media (max-height: 560px) {
  .header { min-height: 54px; padding-top: 3px; padding-bottom: 3px; }
  .workspace .panel, .workspace.detail-mode .panel { top: 8px; bottom: 0; max-height: none; }
  .workspace[data-panel-size="collapsed"] .panel { top: auto; bottom: 0; }
  .panel-toolbar { padding-top: 4px; padding-bottom: 4px; }
  .panel-actions { padding-top: 6px; padding-bottom: 6px; }
  .demo-bar { min-height: 28px; padding-top: 2px; padding-bottom: 2px; }
  .map-label { display: none; }
}
@media (max-width: 370px) {
  .header { gap: 5px; padding-left: 10px; padding-right: 10px; }
  .header .brand { font-size: 1.3rem; }
  .header .nav { padding: 8px 6px; font-size: .6875rem; }
  .panel #panel-content { padding-left: 16px; padding-right: 16px; }
  .panel-toolbar { padding-left: 10px; padding-right: 10px; gap: 5px; }
  .sheet-controls { gap: 4px; }
  .sheet-control .icon { display: none; }
}
