:root {
  --green: #18a34a;
  --green-dark: #0f7a3c;
  --green-soft: #e8f7ee;
  --red: #e23b3b;
  --red-deep: #c81e1e;
  --ink: #1c1f24;
  --muted: #6b7280;
  --line: #e6e8ee;
  --bg: #f3f4f6;
  --card: #ffffff;
  --shadow: 0 8px 22px rgba(22, 28, 38, 0.06);
  --tab: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #dfe3e8;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app {
  position: relative;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 20px 50px rgba(0,0,0,.12);
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 10px;
  background: #fff;
}
.top-date { line-height: 1.15; }
.top-day { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.top-sub { margin-top: 2px; color: #4b5563; font-size: 15px; }
.top-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  padding: 4px 0;
}

.logo { text-align: right; line-height: 1; position: relative; padding-top: 2px; }
.logo-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.01em;
  color: #6b7280;
  margin-bottom: 1px;
}
.logo-name {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: #d0121c;
  letter-spacing: -0.03em;
}
.logo-tools {
  position: absolute;
  right: 2px;
  top: -2px;
  width: 54px;
  height: 18px;
  opacity: 0.9;
}

.main { flex: 1; overflow: auto; padding: 14px 14px 12px; }
.main.nav-mode { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff; }

.time-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-soft);
  color: #0d6b34;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 650;
}
.time-pill strong { font-variant-numeric: tabular-nums; font-size: 16px; }
.time-pill span { font-size: 13px; font-weight: 600; color: #157a3e; }
.time-pill small { display: block; font-weight: 500; color: #3f7d56; font-size: 12px; }
.time-pill.work { background: #e7f6ee; }
.time-pill .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 5px rgba(24,163,74,.18);
  flex: none;
}

.pause-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fdecec;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pause-badge {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: grid; place-items: center; flex: none;
}
.pause-banner b { display: block; font-size: 15px; }
.pause-banner em {
  font-style: normal;
  color: var(--red-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}
.eyebrow {
  color: #6b7280;
  font-size: 13px;
  margin: 2px 2px 8px;
}
.job-head { display: flex; gap: 12px; align-items: flex-start; }
.job-copy { flex: 1; min-width: 0; }
.job-title { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.addr { display: flex; gap: 6px; color: #374151; font-size: 14px; line-height: 1.35; }
.addr svg { flex: none; margin-top: 2px; }
.photo {
  width: 92px; height: 74px; border-radius: 12px; flex: none;
  background-size: cover; background-position: center;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 14px 0 12px;
}
.stat { display: flex; gap: 8px; align-items: center; color: #374151; font-size: 14px; }
.stat b { display: block; font-size: 15px; color: var(--ink); }
.stat small { color: #6b7280; font-size: 12px; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
}
.btn-green { background: var(--green); color: #fff; }
.btn-green:active { background: #128a3e; }
.btn-ghost {
  background: #fff;
  color: #374151;
  border: 1px solid #d7dbe2;
  margin-top: 8px;
}
.btn-red {
  background: #fff5f5;
  color: var(--red-deep);
  border: 1px solid #ffd0d0;
}
.hint {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  margin: 8px 0 0;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-2 .btn { font-size: 15px; min-height: 50px; }

.section-title { margin: 6px 4px 10px; font-size: 18px; }

.mini {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
}
.num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef0f3; color: #4b5563;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex: none; margin-top: 2px;
}
.mini h3 { margin: 0 0 2px; font-size: 16px; }
.mini p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.35; }
.mini .meta { margin-top: 6px; color: #6b7280; font-size: 13px; display: flex; gap: 12px; }
.done-tag {
  display: inline-block;
  margin-top: 6px;
  background: var(--green-soft);
  color: #0f7a3c;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}

.nav-job {
  padding: 12px 16px 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.nav-job h2 { margin: 0 0 2px; font-size: 18px; }
.nav-job .sub { color: #4b5563; font-size: 14px; }
.nav-meta {
  display: flex; gap: 16px; margin-top: 8px; color: #374151; font-size: 14px;
}
.nav-meta b { font-weight: 700; }

.map-wrap { position: relative; flex: 1; min-height: 220px; }
#map { height: 100%; width: 100%; background: #d7e7c9; }
.instruction {
  position: absolute;
  z-index: 500;
  left: 12px; right: 64px; top: 12px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 8px 18px rgba(8, 60, 28, .25);
}
.instruction .turn {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.14);
  display: grid; place-items: center; flex: none;
}
.instruction b { display: block; font-size: 16px; }
.instruction span { font-size: 14px; opacity: .95; }
.map-tools {
  position: absolute; z-index: 500; right: 10px; top: 70px;
  display: flex; flex-direction: column; gap: 8px;
}
.map-tools button, .locate {
  width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15);
  font-size: 20px; color: #111;
}
.locate { position: absolute; z-index: 500; right: 10px; bottom: 108px; }
.nav-end {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px;
}
.user-dot {
  width: 18px; height: 18px; margin-left: -9px; margin-top: -9px;
}
.user-dot i {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(26,115,232,.25);
}

.modal[hidden] { display: none; }
.modal {
  position: absolute;
  inset: 0 0 calc(var(--tab) + var(--safe-b)) 0;
  background: rgba(55, 60, 68, .55);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.dialog {
  background: #fff;
  border-radius: 22px;
  padding: 26px 20px 18px;
  width: min(100%, 340px);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.dialog h2 { margin: 12px 0 8px; font-size: 24px; letter-spacing: -0.03em; }
.dialog p { margin: 0 0 18px; color: #4b5563; line-height: 1.4; }
.pause-hero {
  width: 74px; height: 74px; border-radius: 50%;
  margin: 0 auto;
  background: #ff9f1a;
  color: #fff;
  display: grid; place-items: center;
}
.dialog .btn + .btn { margin-top: 10px; }

.tabs {
  height: calc(var(--tab) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #fff;
  border-top: 1px solid #eceff3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
}
.tabs button {
  border: 0;
  background: transparent;
  color: #8b919a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.tabs button.active { color: var(--green); }
.tabs button.stop { color: var(--red); }
.tabs svg { width: 24px; height: 24px; }

.day-row { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; margin-bottom: 8px; }
.day {
  border: 0;
  background: #fff;
  border-radius: 14px;
  min-width: 64px;
  padding: 8px 6px;
  box-shadow: var(--shadow);
  color: #374151;
}
.day b { display: block; font-size: 16px; }
.day.active { background: var(--green); color: #fff; }
.cal-empty { color: #6b7280; padding: 12px; }

.menu-hero { padding: 6px 4px 12px; }
.menu-hero h2 { margin: 0; font-size: 22px; }
.menu-hero p { margin: 4px 0 0; color: #6b7280; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.total {
  background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center;
  box-shadow: var(--shadow);
}
.total b { display: block; font-variant-numeric: tabular-nums; font-size: 16px; }
.total span { color: #6b7280; font-size: 12px; }
.steps { margin: 0; padding: 0 0 0 18px; color: #374151; }
.steps li { margin: 8px 0; line-height: 1.35; }
.linkish {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 0;
  color: #6b7280;
  text-decoration: underline;
  padding: 8px;
}

.pin {
  background: var(--red);
  width: 16px; height: 16px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.leaflet-control-attribution { font-size: 10px !important; }
