/* Yossi's Construction Express — dispatch app. Brand: the flyer's yellow on black.
   Written for old phones too: no grid gap, no aspect-ratio / inset / clamp. */
:root {
  --bg: #f3f2ee; --card: #ffffff; --ink: #151515; --muted: #6b6a64; --line: #e2e0d8; --soft: #f7f6f2;
  --yellow: #ffd60a; --yellow-deep: #f2c200; --black: #151515;
  --green: #15803d; --green-bg: #e8f6ed; --red: #c62828; --red-bg: #fdeceb; --amber: #8a5300; --amber-bg: #fff4d6;
  --blue: #1d4ed8; --blue-bg: #eaf0fe; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 10px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110; --card: #1c1c1a; --ink: #f1f0ea; --muted: #a8a69d; --line: #31302c; --soft: #232320;
    --green: #4ade80; --green-bg: #12301d; --red: #ff6b6b; --red-bg: #3a1716; --amber: #fbbf24; --amber-bg: #33270b;
    --blue: #7aa2ff; --blue-bg: #17213d; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: inherit; }
h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 12px; }
h1 small, h2 small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 2px; }
h2 { font-size: 18px; margin: 22px 0 8px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.bad { color: var(--red); }
.good { color: var(--green); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ic { width: 20px; height: 20px; vertical-align: -4px; flex: none; }
.nojs .js-only { display: none; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-top: 1px solid var(--line); }

/* header + navigation */
.top { background: var(--black); color: #fff; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand .b1 { color: var(--yellow); font-weight: 900; font-style: italic; font-size: 24px; letter-spacing: -.5px; }
.brand .b2 { color: #e7e7e7; font-size: 9.5px; letter-spacing: 2.6px; text-transform: uppercase; margin-top: 3px; border-top: 2px solid var(--yellow); padding-top: 3px; }
.topnav { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px 2px 6px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; min-height: 56px; }
.tab .ic { width: 24px; height: 24px; margin-bottom: 2px; }
.tab.on { color: var(--ink); }
.tab.on .ic { color: var(--ink); background: var(--yellow); border-radius: 9px; padding: 2px; width: 30px; height: 26px; margin: -1px 0 1px; }
.tab-rush .ic { color: var(--red); }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .topnav { display: flex; }
  .topnav .tab { flex-direction: row; color: #cfcfcf; font-size: 14.5px; min-height: 0; padding: 8px 12px; border-radius: 10px; margin-left: 4px; }
  .topnav .tab .ic { width: 19px; height: 19px; margin: 0 6px 0 0; }
  .topnav .tab.on { background: var(--yellow); color: var(--black); }
  .topnav .tab.on .ic { background: none; padding: 0; width: 19px; height: 19px; margin: 0 6px 0 0; }
  .topnav .tab-rush .ic { color: #ff8a80; }
}
.wrap { max-width: 860px; margin: 0 auto; padding: 14px 14px 110px; }
@media (min-width: 900px) { .wrap { padding-bottom: 50px; } }

/* cards, flashes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.narrow { max-width: 420px; margin: 30px auto; }
.card.narrowish { max-width: 520px; }
.card.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.flash { border-radius: 12px; padding: 11px 14px; margin: 10px 0; border: 1px solid transparent; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-ok { background: var(--green-bg); color: var(--green); border-color: rgba(21,128,61,.25); }
.flash-err { background: var(--red-bg); color: var(--ink); border-color: rgba(198,40,40,.3); }
.flash-err b { color: var(--red); }
.flash-warn { background: var(--amber-bg); color: var(--ink); border-color: rgba(138,83,0,.25); }
.flash-info { background: var(--blue-bg); color: var(--ink); border-color: rgba(29,78,216,.2); }
.flash a { font-weight: 700; }
.better { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.better span { margin: 4px 10px 4px 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; margin: 0 6px 8px 0; line-height: 1.15; text-align: center; }
.btn .ic { margin-right: 6px; }
.btn-main { background: var(--yellow); border-color: var(--yellow-deep); color: var(--black); }
.btn-rush { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-quiet { color: var(--red); }
.btn.big { min-height: 54px; font-size: 17.5px; padding: 12px 20px; }
.btn.wide { display: flex; width: 100%; margin-right: 0; }
.btn-nav { border-color: var(--ink); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 26px; cursor: pointer; padding: 0; }
.btn-icon.off { opacity: .3; }
.btn-icon .ic { width: 22px; height: 22px; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; margin: 10px 0 2px; }
.big-actions .btn { flex: 1 1 220px; }
.footer-actions { display: flex; flex-wrap: wrap; margin: 18px 0; }
.submitbar { margin: 16px 0; display: flex; flex-wrap: wrap; align-items: center; }
.submitbar .btn-main { flex: 1 1 240px; }

/* day header + summary */
.daynav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.daynav h1 { text-align: center; margin: 0; flex: 1; }
.summary { display: flex; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.summary div { margin: 3px 18px 3px 0; }
.startline { margin: 10px 2px; font-size: 14.5px; }
.startline .ic { color: var(--muted); }
.loadbar { margin: 10px 0; }
.lb-track { position: relative; height: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.lb-max { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,214,10,.45); }
.lb-now { position: absolute; left: 0; top: 0; bottom: 0; background: var(--yellow-deep); }
.loadbar.over .lb-max { background: rgba(198,40,40,.45); }
.lb-text { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.loadbar.over .lb-text b { color: var(--red); }

/* stops */
.stops { list-style: none; margin: 12px 0; padding: 0; }
.stop { display: flex; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--blue); border-radius: 14px; padding: 12px 10px 10px 10px; margin: 0 0 10px; box-shadow: var(--shadow); }
.stop-d { border-left-color: var(--green); }
.stop.is-late { background: var(--red-bg); border-color: rgba(198,40,40,.4); border-left-color: var(--red); }
.stop.is-new { border-style: dashed; border-left-style: solid; border-left-color: var(--yellow-deep); }
.stop-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--black); color: var(--yellow); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-right: 10px; font-size: 15px; }
.stop-main { flex: 1 1 auto; min-width: 0; }
.stop-top { display: flex; flex-wrap: wrap; align-items: center; font-size: 15px; }
.stop-top > * { margin-right: 6px; }
.stop-top a { font-weight: 700; text-decoration: none; }
.eta { margin-left: auto !important; margin-right: 0 !important; font-weight: 800; font-size: 17px; white-space: nowrap; }
.addr { font-size: 16.5px; font-weight: 600; margin: 4px 0 2px; }
.meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.meta .bad { font-weight: 700; }
.notes { white-space: pre-wrap; color: var(--ink); background: var(--soft); border-radius: 8px; padding: 4px 8px; margin-top: 4px; font-size: 14px; }
.stop .actions { margin-top: 8px; flex-wrap: nowrap; }
.stop .act-main > .btn, .stop .act-main > form.inline { flex: 1 1 0; display: flex; min-width: 0; }
.stop .act-main .btn { min-height: 48px; width: 100%; padding-left: 8px; padding-right: 8px; }
.stop .act-small { margin-top: 0; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 14.5px; }
.btn-sm .ic { width: 17px; height: 17px; }
.stops.arranging .stop { padding-top: 8px; padding-bottom: 8px; }
.move { display: flex; flex-direction: column; margin-left: 6px; }
.move .btn-icon { width: 38px; height: 38px; margin-bottom: 6px; }
.stops.compact .stop { padding: 9px 9px 7px; margin-bottom: 7px; }
.stops.compact .addr { font-size: 15px; }
.kind { display: inline-block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 6px; }
.kind-p { background: var(--blue-bg); color: var(--blue); }
.kind-d { background: var(--green-bg); color: var(--green); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.tag-onboard { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.tag-done { background: var(--green-bg); color: var(--green); border-color: transparent; }
.tag-cx { background: var(--red-bg); color: var(--red); border-color: transparent; }
.tag-rush { background: var(--red); color: #fff; border-color: var(--red); }
.tag-booked { background: var(--blue-bg); color: var(--blue); border-color: transparent; }

/* map */
.mapbox { margin: 16px 0; }
.map { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 10px; background: var(--soft); }
details.done, details.planview { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 12px 0; }
details > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }

/* the answer */
.answer { border-radius: 16px; padding: 16px 18px; margin: 10px 0 12px; border: 2px solid; }
.answer .big { font-size: 30px; font-weight: 900; line-height: 1.1; margin-bottom: 6px; }
.answer.yes { background: var(--green-bg); border-color: var(--green); }
.answer.yes .big { color: var(--green); }
.answer.no { background: var(--red-bg); border-color: var(--red); }
.answer.no .big { color: var(--red); }
.answer.maybe { background: var(--amber-bg); border-color: var(--amber); }
.answer.maybe .big { color: var(--amber); }
.answer ul { margin: 6px 0; padding-left: 20px; }
.earliest { margin-top: 8px; padding: 10px 12px; background: var(--card); border-radius: 10px; font-size: 16.5px; }
.options { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.option { flex: 1 1 300px; margin: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px; }
.option.opt-ok { border-color: var(--green); }
.option.opt-cost { border-color: var(--red); }
.option ul { margin: 4px 0 8px; padding-left: 20px; }
.option form { display: block; margin-top: 10px; }
.option .btn { width: 100%; }
table.cmp { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14.5px; }
table.cmp th, table.cmp td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.cmp tr.is-late td { background: var(--red-bg); }

/* forms */
.jobform fieldset.group { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin: 0 0 12px; padding: 6px 14px 10px; box-shadow: var(--shadow); min-width: 0; }
.jobform legend { font-weight: 800; padding: 0 6px; margin-left: -6px; font-size: 15px; }
.jobform legend small { font-weight: 500; color: var(--muted); }
.field { margin: 10px 0; position: relative; }
.field label, .lbl { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid #c9c6bc; border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; -webkit-appearance: none; appearance: none; }
textarea { min-height: 70px; resize: vertical; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(255,214,10,.65); border-color: var(--black); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0 8px 0 0; -webkit-appearance: auto; appearance: auto; vertical-align: -5px; accent-color: var(--black); }
.check, .radio { display: inline-flex; align-items: center; margin: 6px 18px 6px 0; font-weight: 600; cursor: pointer; }
.radios { margin: 8px 0 2px; }
.radio { background: var(--soft); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; margin: 4px 8px 4px 0; }
.row2, .row3 { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.row2 > .field, .row3 > .field { flex: 1 1 200px; margin-left: 6px; margin-right: 6px; }
.row3 > .field { flex-basis: 160px; }
details.more { margin: 8px 0 4px; }
details.more summary { color: var(--blue); font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; margin: -2px 0 6px; }
.chip { display: inline-block; font: inherit; font-size: 13.5px; background: var(--soft); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; margin: 0 6px 6px 0; cursor: pointer; color: var(--ink); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on { background: var(--yellow); border-color: var(--yellow-deep); font-weight: 700; }
.checks { margin: 4px 0; }
.confirmbox p { margin: 8px 0; }
.tpl { border-top: 1px solid var(--line); padding-top: 4px; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; list-style: none; margin: 2px 0 0; padding: 4px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 300px; overflow-y: auto; }
.ac-list li { padding: 11px 14px; cursor: pointer; font-size: 15px; border-bottom: 1px solid var(--line); }
.ac-list li:last-child { border-bottom: 0; }
.ac-list li.on, .ac-list li:hover { background: var(--soft); }
.ac-list li small { display: block; color: var(--muted); font-size: 12px; }
.ac-list .ac-foot { font-size: 11px; color: var(--muted); padding: 4px 14px; cursor: default; }

/* lists */
.dayhead { display: flex; flex-direction: column; }
.dayhead a { text-decoration: none; }
.joblist { list-style: none; margin: 0 0 10px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.joblist li + li { border-top: 1px solid var(--line); }
.joblist a { display: block; padding: 11px 14px; text-decoration: none; }
.jl-top { display: block; font-weight: 600; }
.jl-sub { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.jobhead { display: flex; flex-wrap: wrap; align-items: center; }
.jobhead h1 { margin-right: 10px; }
.details .kv { display: flex; padding: 8px 0; border-bottom: 1px solid var(--line); }
.details .kv:last-child { border-bottom: 0; }
.details .kv > span:first-child { flex: none; width: 110px; color: var(--muted); font-size: 14px; padding-top: 1px; }
.details .kv > div { flex: 1; min-width: 0; }
.muted-actions { margin-top: 16px; }
.menu { margin: 6px 0 18px; }
.menuitem { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; text-decoration: none; box-shadow: var(--shadow); }
.menuitem .ic { width: 28px; height: 28px; margin-right: 14px; }
.menuitem small { display: block; color: var(--muted); font-weight: 400; }
.login h1 { margin-top: 0; }
.is-login .wrap { padding-top: 30px; }
