:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f5f7fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button { font: inherit; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.site-header { display: flex; align-items: center; gap: 14px; padding: 30px 0 24px; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #0d9488; color: #fff; font-size: 38px; line-height: 1; }
.site-header h1 { margin: 2px 0 0; font-size: 1.35rem; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: #0d9488; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 30px 34px; border-radius: 24px; background: #111827; color: #fff; }
.intro h2 { margin: 10px 0 12px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; letter-spacing: -.045em; }
.intro-copy { max-width: 580px; margin: 0; color: #cbd5e1; line-height: 1.65; }
.intro .eyebrow { color: #5eead4; }
.status-card { flex: 0 0 242px; padding: 20px; border: 1px solid #334155; border-radius: 18px; background: #1f2937; }
.status-label { color: #cbd5e1; font-size: .8rem; }
.status-value { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 700; }
.status-value::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px #f59e0b22; }
.status-value[data-state="success"]::before { background: #2dd4bf; box-shadow: 0 0 0 4px #2dd4bf22; }
.status-value[data-state="error"]::before { background: #f87171; box-shadow: 0 0 0 4px #f8717122; }

.content-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 22px; margin-top: 22px; }
.panel { min-width: 0; padding: 28px; border: 1px solid #e5e7eb; border-radius: 22px; background: #fff; box-shadow: 0 8px 35px #11182708; }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.section-heading h2 { margin: 5px 0 0; font-size: 1.5rem; letter-spacing: -.025em; }
.section-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #ccfbf1; color: #0d9488; font-size: 2rem; }
.button { min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; cursor: pointer; transition: background .15s, transform .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid #0d9488; outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: #0d9488; color: #fff; }
.button-primary:hover:not(:disabled) { background: #0f766e; }
.button-secondary { border-color: #cbd5e1; background: #fff; color: #111827; }
.button-secondary:hover:not(:disabled) { background: #f1f5f9; }
.button-warning { background: #ea580c; color: #fff; }
.button-warning:hover:not(:disabled) { background: #c2410c; }
.location-panel > .button { width: 100%; }
.helper-text, .map-help { color: #64748b; font-size: .85rem; line-height: 1.55; }
.helper-text { margin: 10px 0 25px; }
.tracking-controls, .destination-actions { display: flex; gap: 9px; }
.tracking-controls { margin-bottom: 22px; }
.tracking-controls .button { flex: 1; font-size: .84rem; }
.coordinates { display: grid; gap: 10px; margin: 0; }
.coordinates > div { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.coordinates dt { color: #475569; font-size: .86rem; }
.coordinates dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.destination-panel { margin-top: 25px; padding-top: 22px; border-top: 1px solid #e2e8f0; }
.destination-panel h3 { margin: 0; font-size: 1.12rem; }
.destination-panel .helper-text { margin: 7px 0 18px; }
.distance-value { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; background: #f0fdfa; color: #115e59; font-size: .87rem; }
.distance-value output { font-weight: 800; font-variant-numeric: tabular-nums; }
.radius-label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 700; }
.radius-label span { color: #64748b; font-weight: 400; }
#arrival-radius { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 10px; color: #111827; font: inherit; }
#arrival-radius:focus-visible { outline: 3px solid #0d9488; outline-offset: 2px; }
.arrival-message { min-height: 42px; margin: 14px 0; color: #475569; font-size: .88rem; line-height: 1.5; }
.arrival-message[data-arrived="true"] { color: #0f766e; font-weight: 700; }
.destination-actions .button { flex: 1; font-size: .82rem; }
.destination-pin { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid #fff; border-radius: 50%; background: #ea580c; box-shadow: 0 2px 8px #11182755; }
.destination-pin::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.message { margin: 18px 0 0; padding: 13px 15px; border-radius: 10px; font-size: .9rem; line-height: 1.5; }
.message[hidden], .map-fallback[hidden] { display: none; }
.message-error { border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; }
.message-info { border: 1px solid #99f6e4; background: #f0fdfa; color: #115e59; }
.map-heading { justify-content: space-between; }
.map-caption { color: #64748b; font-size: .75rem; }
.map-frame { position: relative; overflow: hidden; border-radius: 14px; background: #e2e8f0; }
#map { height: 400px; z-index: 0; }
.map-fallback { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; margin: 0; padding: 25px; color: #475569; text-align: center; }
.map-help { margin: 15px 0 0; }
.site-footer { padding: 27px 0 35px; color: #64748b; font-size: .82rem; text-align: center; }

@media (max-width: 800px) {
  .intro { align-items: stretch; flex-direction: column; }
  .status-card { flex-basis: auto; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .site-header { padding: 20px 0; }
  .intro { padding: 26px 22px; border-radius: 18px; }
  .panel { padding: 22px; border-radius: 18px; }
  #map { height: 320px; }
  .tracking-controls, .destination-actions { flex-direction: column; }
}
