body {
  font-family: system-ui, sans-serif;
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #1a1a1a;
}

a { color: #0a5; }

/* Landing intro (index.html) — the portfolio-facing hero above the try-it form. */
.intro { margin-bottom: 1.5rem; }

.intro .lead {
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0.5rem 0 1.25rem;
}

.steps {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.steps li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: #333;
  line-height: 1.45;
}
.step-num {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #0a5;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.6rem;
  text-align: center;
}

/* "A portfolio project demonstrating…" — the hiring-facing skills callout. */
.showcase {
  border-left: 3px solid #0a5;
  padding: 0.1rem 0 0.1rem 0.85rem;
  margin: 1.25rem 0;
}
.showcase-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #6b7280;
  margin: 0 0 0.5rem;
}
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.skills li { color: #333; line-height: 1.45; }
.skills strong { color: #0a5; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.cta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 14rem;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s;
}
.cta-sub { font-size: 0.78rem; font-weight: 400; opacity: 0.9; }
.cta--primary { background: #0a5; color: #fff; }
.cta--primary:hover { background: #087a41; box-shadow: 0 3px 10px rgba(0, 128, 85, 0.25); }
.cta--ghost { border-color: #0a5; color: #0a5; }
.cta--ghost:hover { background: #f0faf5; }

.try-heading {
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 1.25rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}

label.checkbox {
  flex-direction: row;
  align-items: center;
  font-weight: normal;
}

input, textarea, button {
  font: inherit;
  padding: 0.5rem;
}

button {
  align-self: flex-start;
  background: #0a5;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

/* Polished try-it form (index.html) — a card that visually matches the hero. */
.run-form {
  background: #fff;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  gap: 1.25rem;
}

/* Muted, normal-weight sub-label for the parenthetical field hints. */
.field-hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: #6b7280;
}

.run-form input,
.run-form textarea {
  border: 1px solid #cdd3d8;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.run-form input:hover,
.run-form textarea:hover { border-color: #9aa4ac; }
.run-form input:focus,
.run-form textarea:focus {
  outline: none;
  border-color: #0a5;
  box-shadow: 0 0 0 3px rgba(0, 170, 85, 0.18);
}
.run-form textarea { resize: vertical; }

/* Green checkboxes + a touch more breathing room around the toggles. */
.run-form label.checkbox { gap: 0.5rem; color: #333; }
.run-form input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #0a5;
  padding: 0;
  cursor: pointer;
}

/* Submit button lifted to match the hero's primary CTA. */
.btn-submit {
  margin-top: 0.25rem;
  border-radius: 8px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-submit:hover {
  background: #087a41;
  box-shadow: 0 3px 10px rgba(0, 128, 85, 0.25);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
  font-size: 0.9rem;
}

.error { color: #c00; }
.muted { color: #666; font-size: 0.9rem; }

/* Non-error advisory — e.g. "closest-match address was used". Amber, not red:
   the run succeeded, this just flags a substitution the user should know about. */
.notice {
  background: #fff8e6;
  border: 1px solid #f0d98c;
  border-left: 4px solid #e0a800;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  color: #5c4813;
  font-size: 0.92rem;
}

/* Live job-progress window (job_status.html) */
.status-log {
  margin-top: 1rem;
  height: 16rem;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #0d1117;
  color: #d6e2f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.status-line { white-space: pre-wrap; word-break: break-word; }
.status-line::before { content: "› "; color: #57ab5a; }

/* Activity-log popup (finished job) — non-modal & draggable, like the map popup:
   position set by JS on open so it can float over the page while the page stays
   readable/interactive behind it. */
dialog#activity-dialog {
  position: fixed;
  margin: 0;
  top: 3rem;
  left: 50%;
  width: min(90vw, 640px);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}
dialog#activity-dialog .dialog-head { cursor: move; user-select: none; }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}
.dialog-head button {
  background: none;
  color: #444;
  border: none;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

/* In the popup the log grows taller and is the only scroller. */
.status-log--dialog {
  height: auto;
  max-height: 60vh;
  margin: 0;
  border: none;
  border-radius: 0 0 8px 8px;
}

/* Drive-time map (finished job) */

/* Top action row: a column of action buttons + the map thumbnail, side by side. */
.job-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}
/* Stacked buttons (activity log, then the admin reasoning button under it). */
.job-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.job-actions-col button { align-self: stretch; }

/* Admin-only detailed-reasoning button — visually distinct from the green
   actions, and clearly inactive (greyed, not-allowed) when disabled. */
.admin-btn { background: #334155; }
.admin-btn:hover:not(:disabled) { background: #1e293b; }
.admin-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Clickable static-map thumbnail that opens the interactive popup. */
.map-thumb-figure { margin: 0; text-align: center; }
.map-thumb-btn {
  padding: 0;
  margin: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  line-height: 0;         /* no descender gap under the image */
  overflow: hidden;
  display: block;
}
.map-thumb-btn:hover { border-color: #0a5; }
.map-thumb { display: block; width: 168px; height: 116px; object-fit: cover; }
.map-thumb-figure figcaption { font-size: 0.8rem; color: #666; margin-top: 0.25rem; }

.map-legend { margin: 0.5rem 0.75rem; }
.map-box {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #eef1f4;
}

/* Numbered map pins (Leaflet divIcons) */
.map-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.map-pin--store { background: #3b82f6; }
.map-pin--center { background: #ef4444; font-size: 14px; }

/* Inline legend swatches */
.map-key {
  display: inline-block;
  width: 1.3em;
  text-align: center;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
}
.map-key--center { background: #ef4444; }
.map-key--store { background: #3b82f6; }

/* Interactive map in a draggable, non-modal popup (position set by JS on open,
   so it can float over the page while the page stays readable). */
.map-dialog {
  position: fixed;
  margin: 0;
  top: 3rem;
  left: 50%;
  width: min(92vw, 720px);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}
.map-dialog .dialog-head {
  cursor: move;             /* the header is the drag handle */
  user-select: none;
}
.map-box--modal {
  height: min(70vh, 560px);
  border: none;
  border-radius: 0 0 8px 8px;
}
