:root {
  --bg: #f1f4ee; --surface: #fbfcf9; --ink: #1d2a23; --muted: #58675e; --line: #d3dacf;
  --accent: #0d6b63; --accent-ink: #fff; --accent-soft: #dcefe9; --warn: #9a5b00;
  --font-body: "Public Sans", system-ui, sans-serif;
  --font-head: "Newsreader", Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body);
  padding: 24px 16px 64px;
}
.wrap { max-width: 1060px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; margin-top: 18px; }
p { margin: 0; }
.badge {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px;
}
header { margin-bottom: 20px; }
header h1 { margin-top: 8px; }
.sub { color: var(--muted); max-width: 66ch; margin-top: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 16px;
}
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input, select {
  width: 100%; padding: 8px 10px; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.fine { font-size: .82rem; color: var(--muted); margin-top: 6px; }

/* crop table ------------------------------------------------------------- */
.table { margin-top: 8px; }
.thead, .row {
  display: grid; grid-template-columns: 1.7fr .75fr .7fr .8fr 1.5fr .6fr 30px;
  gap: 8px; align-items: center;
}
.thead {
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.row { margin-bottom: 7px; }
.row input, .row select { padding: 6px 8px; font-size: .88rem; }
.kill {
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  border-radius: 6px; cursor: pointer; padding: 4px 0; font-size: 1rem; line-height: 1;
}
.kill:hover { color: #b91c1c; border-color: #b91c1c; }
@media (max-width: 760px) {
  .thead { display: none; }
  .row { grid-template-columns: 1fr 1fr; }
}

.btn {
  margin-top: 14px; padding: 9px 16px; border-radius: 7px; cursor: pointer;
  font: inherit; font-weight: 600; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 6px 12px; font-size: .86rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.btnrow .btn { margin-top: 0; }

details.terms { margin-top: 16px; }
details.terms summary { cursor: pointer; font-weight: 600; font-size: .9rem; }

/* results ---------------------------------------------------------------- */
.total { font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; }
.trip {
  border-left: 3px solid var(--accent); padding: 10px 14px; margin-top: 12px;
  background: var(--surface);
}
.trip h3 { margin-top: 0; }
.trip .meta { color: var(--muted); font-size: .86rem; }
.items { margin-top: 6px; font-size: .88rem; }
.items div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.splitline {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); border-left: 3px solid var(--accent); font-size: .9rem;
}
table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: .88rem;
  font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.subpanel { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.out { margin-top: 14px; }
.limits { margin: 10px 0 0; padding-left: 1.1rem; display: grid; gap: 8px; }
.limits li { max-width: 84ch; }
.rline { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rline .rk { flex: 1 1 40%; font-weight: 600; }
.rline .rh { flex: 2 1 50%; color: var(--muted); }
.rline .rv { font-variant-numeric: tabular-nums; font-weight: 600; }
.err { color: #b91c1c; font-weight: 600; }
.caution {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: #fdf4e4; border-left: 3px solid var(--warn);
  color: var(--warn); font-size: .9rem; line-height: 1.5;
}
.caution b { display: block; margin-bottom: 4px; letter-spacing: .01em; }
.overday { color: var(--warn); font-weight: 700; }

.money { margin-top: 16px; }
.money h3 { margin: 0 0 8px; font-size: .95rem; }
.moneybar { display: flex; height: 26px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.moneybar .seg { display: block; height: 100%; min-width: 3px; box-shadow: inset -1px 0 0 rgba(255,255,255,.55); }
.moneybar .diesel { background: #5f4520; }
.moneybar .time { background: #c08a3e; }
.moneybar .wait { background: #e2c79a; }
.moneybar .commission { background: #b0442f; }
.moneybar .profit { background: var(--accent); }
.moneykey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.moneykey span { display: inline-flex; align-items: center; gap: 6px; }
.moneykey i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.moneykey i.diesel { background: #5f4520; }
.moneykey i.time { background: #c08a3e; }
.moneykey i.wait { background: #e2c79a; }
.moneykey i.commission { background: #b0442f; }
.moneykey i.profit { background: var(--accent); }
.moneykey b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.moneykey em { font-style: normal; color: var(--muted); font-size: .76rem; }
@media print { .btn, .btnrow, details, header .sub { display: none; } .card { break-inside: avoid; } }

.intake { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.intake input { flex: 1; }
.intake .btn { margin-top: 0; white-space: nowrap; }
.narration {
  margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: var(--accent-soft);
  border-left: 3px solid var(--accent); white-space: pre-wrap; font-size: .93rem; line-height: 1.6;
}
.narration .who { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; margin-bottom: 6px; }

#map { height: 420px; border-radius: 8px; margin-top: 10px; border: 1px solid var(--line); background: var(--bg); }
#directions { margin-top: 12px; }
.dirtrip { border-left: 3px solid var(--accent); padding: 8px 0 8px 12px; margin-top: 12px; }
.dirtrip h4 { margin: 0 0 6px; font-size: .95rem; }
.dirleg { margin-top: 8px; }
.dirleg .legname { font-weight: 600; font-size: .86rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .03em; }
.dirleg ol { margin: 4px 0 0; padding-left: 1.2rem; font-size: .9rem; }
.dirleg li { padding: 2px 0; }
.dirleg li span.d { color: var(--muted); font-variant-numeric: tabular-nums; }
.pin { background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: grid; place-items: center; font: 700 12px var(--font-body); border: 2px solid #fff; }
.pinhome { background: var(--warn); }

.packline {
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline;
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
}
.packbig { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; }
.splitnote { max-width: 52ch; }
.triphead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.triphead .net { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; }
.loadbar {
  position: relative; height: 22px; margin: 8px 0 6px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--line); overflow: hidden;
}
.loadbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .22; }
.loadbar span {
  position: relative; display: block; line-height: 20px; padding-left: 8px;
  font-size: .76rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}

.runsheet { list-style: none; margin: 10px 0 4px; padding: 0; border-top: 1px solid var(--line); }
.runsheet li {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--line);
}
.runsheet .step {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); padding-top: 2px;
}
.runsheet .does { font-size: .92rem; }
.runsheet .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.runsheet li.load { background: var(--accent-soft); }
.runsheet li.back .does, .runsheet li.back .step { color: var(--muted); font-weight: 600; }
@media (max-width: 720px) {
  .runsheet li { grid-template-columns: 52px 1fr; }
  .runsheet .amt { grid-column: 2; }
}

.bars { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 8px; }
.barrow { display: grid; grid-template-columns: minmax(120px, 210px) 1fr auto; gap: 12px; align-items: center; }
.barlab { font-size: .86rem; font-weight: 600; line-height: 1.25; }
.barlab em { display: block; font-style: normal; font-weight: 400; color: var(--muted); font-size: .74rem; }
.bartrack { height: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.barfill { display: block; height: 100%; background: var(--accent); opacity: .85; }
.barfill.dull { background: var(--muted); opacity: .45; }
.barval { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cmpnote { font-size: .9rem; margin-top: 2px; }
@media (max-width: 720px) {
  .barrow { grid-template-columns: 1fr auto; }
  .bartrack { grid-column: 1 / -1; order: 3; }
}

.tag {
  font-style: normal; font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; padding: 2px 5px; border-radius: 3px; vertical-align: 2px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.tag.bold { background: var(--est-soft); color: var(--est); border-color: var(--est); }

.engine { font-size: .74rem; color: var(--muted); margin: 0 0 6px; }
.engine b { color: var(--muted); font-weight: 600; }

h3.tier { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 2px; font-size: 1.02rem; }
h3.tier .tiern {
  font-family: var(--font-body); font-size: .7rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 1px 7px;
}
h3.tier-week { color: var(--accent); }
h3.tier-plan { color: var(--ink); }
h3.tier-call { color: var(--ink); }
h3.tier-trivial { color: var(--muted); }
h3.tier-trivial ~ .rline .rv { color: var(--muted); font-weight: 500; }
.tiernote { font-size: .78rem; color: var(--muted); margin: 0 0 6px; }
