* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1d1d1f; }
body { display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 14px; background: #e9e9ee; }
button.primary { background: #c8102e; color: #fff; font-weight: 600; }
button.green { background: #1a7f37; color: #fff; font-weight: 600; }
button:disabled { opacity: .5; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid #ccc; border-radius: 8px; width: 100%; }
label { font-size: 14px; font-weight: 600; display: block; margin: 12px 0 4px; }
.demo-banner { background: #fff3b0; color: #5c4a00; font-size: 13px; padding: 6px 10px; text-align: center; }
.emoji-pin { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 3px solid #c8102e; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; }
.card { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; }
.card h2 { margin: 0 0 4px; }
.muted { color: #666; font-size: 14px; }
.err { color: #c8102e; font-size: 14px; min-height: 1em; }
.hidden { display: none !important; }

/* ---------- public map ---------- */
.pub-header { background: #c8102e; color: #fff; padding: 12px 16px; }
.pub-header h1 { margin: 0; font-size: 20px; }
.pub-status { font-size: 15px; margin-top: 4px; opacity: .95; }
#map { flex: 1; }
.fab { position: absolute; right: 12px; bottom: 24px; z-index: 1000; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ---------- driver ---------- */
.banner { background: #14532d; color: #fff; padding: 12px 14px; display: flex; gap: 14px; align-items: center; min-height: 110px; }
.banner.off { background: #b91c1c; }
.banner .arrow { font-size: 64px; line-height: 1; width: 72px; text-align: center; }
.banner .dist { font-size: 34px; font-weight: 800; }
.banner .text { font-size: 22px; font-weight: 600; line-height: 1.2; }
.then { background: #0f3d21; color: #d1fae5; font-size: 16px; padding: 6px 14px; }
.drive-bar { display: flex; gap: 8px; padding: 8px; background: #f4f4f6; align-items: center; flex-wrap: wrap; }
.drive-bar .stat { font-size: 14px; flex: 1; min-width: 140px; }
.progress { height: 6px; background: #ddd; }
.progress > div { height: 100%; width: 0; background: #c8102e; transition: width .5s; }
.icons { display: flex; gap: 8px; }
.icons button { font-size: 28px; padding: 6px 10px; background: #f2f2f5; border: 2px solid transparent; }
.icons button.sel { border-color: #c8102e; background: #fff; }

/* ---------- planner ---------- */
.plan { display: flex; flex: 1; min-height: 0; }
.side { width: 380px; max-width: 45vw; overflow: auto; padding: 14px; border-right: 1px solid #ddd; }
.side h1 { font-size: 20px; margin: 0 0 4px; }
.wp { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; }
.wp .num { background: #c8102e; color: #fff; border-radius: 50%; width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.wp input[type=text] { padding: 5px 7px; font-size: 14px; }
.wp button { padding: 4px 8px; font-size: 13px; }
.wp .stopchk { font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 3px; margin: 0; font-weight: 400; }
.wp .stopchk input { width: auto; }
.steps { font-size: 14px; }
.steps div { padding: 5px 0; border-bottom: 1px solid #f0f0f0; display: flex; gap: 8px; }
.steps .a { width: 22px; text-align: center; }
.num-pin { background: #c8102e; color: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.num-pin.stop { background: #1a7f37; }
.dir-arrow { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.dir-arrow::before { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #fff; filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.mid-pin { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: grab; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; }
@media (max-width: 700px) { .plan { flex-direction: column-reverse; } .side { width: 100%; max-width: none; height: 50vh; border-right: 0; } }

/* ---------- accounts: login, my account, manage ---------- */
a { color: #b00d27; }
a.btn { display: inline-block; text-decoration: none; color: inherit; border-radius: 10px; padding: 10px 14px; background: #e9e9ee; text-align: center; }
a.btn.primary { background: #c8102e; color: #fff; font-weight: 600; }
a.btn.green { background: #1a7f37; color: #fff; font-weight: 600; }
button.small, a.btn.small { padding: 5px 10px; font-size: 13px; }
button.wide { width: 100%; margin-top: 14px; }
button.linkish { background: none; padding: 4px 0; color: #b00d27; font-size: 14px; text-decoration: underline; }
.linkrow { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ok { color: #1a7f37; font-size: 14px; min-height: 1em; margin-top: 8px; }
.note { background: #f4f4f6; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.tag { background: #e9e9ee; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.nowrap { white-space: nowrap; }

.auth-page { background: #c8102e; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.auth-wrap .card { box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.tabs { display: flex; gap: 4px; background: #f0f0f3; border-radius: 12px; padding: 4px; margin-bottom: 4px; }
.tabs button { flex: 1; background: none; padding: 8px; }
.tabs button.sel { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #c8102e; color: #fff; padding: 10px 16px; }
.topbar a { color: #fff; }
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .who { font-size: 14px; }
.topbar button { background: rgba(255,255,255,.2); color: #fff; }
.page { flex: 1; overflow: auto; padding: 16px; width: 100%; max-width: 880px; margin: 0 auto;
  position: relative; }   /* keeps hidden inputs (style pickers, icon pickers) inside the scrolling page, so the window itself never scrolls */
.page h2 { font-size: 19px; margin: 18px 0 10px; }
.page h3 { font-size: 16px; margin: 16px 0 6px; }
.panel { background: #fff; border: 1px solid #e3e3e8; border-radius: 14px; padding: 4px 16px 16px; margin-bottom: 16px; }
.dept { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #e3e3e8; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.dept-name { font-weight: 700; font-size: 17px; }
.dept-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.slugrow { display: flex; align-items: center; gap: 4px; }
.slugrow span { white-space: nowrap; }
table.people { width: 100%; border-collapse: collapse; font-size: 14px; }
table.people th { text-align: left; font-size: 13px; color: #666; font-weight: 600; padding: 6px 4px; border-bottom: 1px solid #e3e3e8; }
table.people td { padding: 8px 4px; border-bottom: 1px solid #f0f0f3; vertical-align: middle; }
table.people select { width: auto; padding: 5px 8px; }
.linkline { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #f0f0f3; }
.copybox { display: flex; gap: 6px; flex: 1; min-width: 260px; max-width: 460px; }
.copybox input { font-size: 13px; padding: 6px 8px; background: #fafafa; }
#miniMap { height: 260px; border-radius: 10px; margin-top: 8px; border: 1px solid #ddd; }
.signedin { font-size: 13px; color: #666; margin-top: 12px; line-height: 1.5; }
.staff-link { position: absolute; left: 12px; bottom: 30px; z-index: 1000; font-size: 12px; color: #666; background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 8px; text-decoration: none; }

/* ---------- multiple routes ---------- */
.pub-sub { font-size: 14px; margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-sub button { background: rgba(255,255,255,.22); color: #fff; }
.sched-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.sched-list button { text-align: left; background: #f4f4f6; border: 2px solid transparent; line-height: 1.35; }
.sched-list button.sel { border-color: #c8102e; background: #fff; }
.sched-list button.past { opacity: .55; }
.plan-cards { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.plan-card { flex: 1; min-width: 200px; border: 2px solid #e3e3e8; border-radius: 12px; padding: 10px 12px; }
.plan-card.cur { border-color: #1a7f37; }
.plan-card .price { font-size: 22px; font-weight: 800; }

/* ---------- paper-map reader ---------- */
details.mapread { border: 2px dashed #c8102e; border-radius: 12px; padding: 8px 12px; margin: 12px 0 4px; background: #fff7f8; }
details.mapread summary { cursor: pointer; font-weight: 700; }
details.mapread input[type=file] { margin: 10px 0 6px; }
.mr-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.mr-page { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; cursor: pointer; }
.mr-page img { width: 84px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.mr-pages.text { flex-direction: column; gap: 4px; }
.mr-troute { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 6px 8px; background: #fff; border: 1px solid #f0d4d9; border-radius: 8px; }
.mr-troute input { width: auto; margin: 0; }
.mr-troute small { color: #6b7785; margin-left: auto; white-space: nowrap; }
.mr-paste { margin: 4px 0 8px; font-size: 14px; }
.mr-paste summary { cursor: pointer; color: #c8102e; font-weight: 600; }
.mr-paste textarea { width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-size: 14px; }
.mr-result { border-top: 1px solid #f0d4d9; padding: 8px 0; margin-top: 6px; font-size: 14px; }
.mr-route { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
#mrReport ul { margin: 4px 0; padding-left: 20px; }
.mr-combine { background: #fff; border: 1px solid #f0d4d9; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.mr-combine button { display: block; width: 100%; margin-top: 8px; }
.mr-route { border-top: 1px solid #f0d4d9; align-items: flex-start; }
.mr-route.off { opacity: .55; }
.mr-route input[type=checkbox] { width: auto; margin-top: 4px; }
.mr-route-main { flex: 1; font-size: 14px; }
.mr-route-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- planner: recommended viewing areas ---------- */
.view-pin { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid #f2a33a; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.viewing-box .row { margin-top: 8px; }
.vrow { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid #e3e3e8; font-size: 14px; }
.vrow > span { flex: 1; min-width: 0; }
.vrow button.small { padding: 5px 9px; font-size: 13px; }

/* =====================================================================
   ParadeLine theme for the staff pages (sign-in, My account, Manage,
   route planner, driver setup). Matches the landing page: navy, blue,
   Montserrat headings, Inter text, rounded cards. Overrides the basics above.
   ===================================================================== */
:root {
  --pl-navy: #0b1520; --pl-blue: #087bff; --pl-sky: #00baff; --pl-link: #0a6fd1;
  --pl-bg: #f3f5f9; --pl-line: #e2e7ee; --pl-text: #0b1520; --pl-muted: #5b6b7d;
}
html, body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--pl-text); }
body { background: var(--pl-bg); }
h1, h2, h3, .dept-name, .plan-card .price { font-family: Montserrat, Inter, sans-serif; letter-spacing: -.2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--pl-link); }
a:hover { color: #0a4f99; }
.muted { color: var(--pl-muted); }
.err { color: #c62828; }

/* buttons */
:where(body:not(.pl):not(.nav)) button, a.btn { background: #e8edf3; color: var(--pl-text); border-radius: 12px; padding: 10px 16px; font-weight: 600; transition: background .15s, filter .15s; }
:where(body:not(.pl):not(.nav)) button:hover:not(:disabled), a.btn:hover { background: #dce3ec; }
button.primary, a.btn.primary { background: linear-gradient(90deg, var(--pl-blue), var(--pl-sky)); color: #fff; }
:where(body:not(.pl):not(.nav)) button.primary:hover:not(:disabled), a.btn.primary:hover { background: linear-gradient(90deg, var(--pl-blue), var(--pl-sky)); filter: brightness(1.07); color: #fff; }
button.green, a.btn.green { background: #1a7f37; color: #fff; }
:where(body:not(.pl):not(.nav)) button.green:hover:not(:disabled), a.btn.green:hover { background: #166c2f; color: #fff; }
button.small, a.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
button.linkish, button.linkish:hover:not(:disabled) { background: none; color: var(--pl-link); text-decoration: none; font-weight: 500; }
button.linkish:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(8,123,255,.35); outline-offset: 1px; }

/* form fields */
input, select, textarea { border: 1px solid #cfd7e1; border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--pl-text); }
input:focus, select:focus, textarea:focus { border-color: var(--pl-blue); outline: none; box-shadow: 0 0 0 3px rgba(8,123,255,.18); }
label { color: #1c2b3a; }

/* header bar */
.topbar { background: var(--pl-navy); color: #fff; padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top)); }
.topbar .brand { display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 15px; min-width: 0; }
.topbar .logo { display: flex; flex: none; }
.topbar .logo img { height: 28px; width: auto; display: block; }
.topbar .crumb { color: #b4bcc6; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.15); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb a { color: #b4bcc6; text-decoration: none; }
.topbar .crumb a:hover { color: #fff; }
.topbar .crumb #deptName { color: #fff; }
.topbar .who { color: #b4bcc6; display: flex; align-items: center; gap: 10px; }
.topbar .who a { color: #fff; }
.topbar button { background: rgba(255,255,255,.12); color: #fff; }
.topbar button:hover:not(:disabled) { background: rgba(255,255,255,.2); }
@media (max-width: 560px) { .topbar .crumb { display: none; } }

/* page + cards */
.page { max-width: 920px; padding: 24px 16px 40px; }
.page h2 { font-size: 20px; font-weight: 800; margin: 20px 0 10px; }
.panel { border: 1px solid var(--pl-line); border-radius: 18px; padding: 6px 22px 22px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(11,21,32,.04), 0 8px 24px rgba(11,21,32,.04); }
.dept { border: 1px solid var(--pl-line); border-radius: 18px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(11,21,32,.04), 0 8px 24px rgba(11,21,32,.04); }
.note { background: #eef5fd; border: 1px solid #d6e6f8; border-radius: 12px; color: #17324d; }
.tag { background: #e6f0fb; color: #0a4f99; border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.ok { color: #1a7f37; }
table.people th { color: var(--pl-muted); border-bottom-color: var(--pl-line); }
table.people td { border-bottom-color: #eef1f5; }
.linkline { border-bottom-color: #eef1f5; }
.copybox input { background: #f6f8fb; }
#miniMap { border-color: var(--pl-line); border-radius: 14px; }
.plan-card { border-color: var(--pl-line); border-radius: 14px; background: #fff; }
.plan-card.cur { border-color: #1a7f37; background: #f3fbf5; }
.overlay .card, .card { border-radius: 20px; }

/* sign-in page */
.auth-page { background: radial-gradient(900px 520px at 15% -10%, rgba(0,186,255,.28), transparent 60%), radial-gradient(700px 500px at 110% 110%, rgba(8,123,255,.22), transparent 60%), var(--pl-navy); }
.auth-wrap .card { max-width: 440px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-logo { display: block; height: 40px; width: auto; margin: 0 0 18px; }
.auth-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.tabs { background: #eef1f5; border-radius: 12px; }
.tabs button { background: none; color: var(--pl-muted); }
.tabs button:hover:not(:disabled) { background: rgba(255,255,255,.6); }
.tabs button.sel { background: #fff; color: var(--pl-text); }

/* route planner */
.side { background: #fff; border-right: 1px solid var(--pl-line); padding: 16px 18px; }
.side h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.wp { border-bottom-color: #eef1f5; }
.wp .num, .num-pin { background: var(--pl-blue); }
.num-pin.stop { background: #1a7f37; }
.steps div { border-bottom-color: #eef1f5; }
details.mapread { border: 2px dashed #8cc4ff; background: #f3f8ff; border-radius: 14px; }
.mr-result, .mr-route { border-top-color: #d6e6f8; }
.mr-combine { border-color: #d6e6f8; border-radius: 12px; }
.mr-page img { border-color: var(--pl-line); border-radius: 8px; }

/* driver setup, schedule lists and pins shared by several pages */
.icons button { background: #eef1f5; border-radius: 12px; }
.icons button.sel { border-color: var(--pl-blue); background: #fff; }
.sched-list button { background: #f3f5f9; border-radius: 12px; }
.sched-list button.sel { border-color: var(--pl-blue); }
.progress > div { background: var(--pl-blue); }
.emoji-pin { border-color: var(--pl-blue); }
.signedin { color: var(--pl-muted); }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; box-shadow: none; }
label.stopchk { display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.stopchk input { width: 20px; height: 20px; margin: 0; flex: none; }

/* Inside the iPhone app: hide things that only make sense on the web (buying plans, sign-up). */
.in-app .web-only { display: none !important; }
html:not(.in-app) .app-only { display: none !important; }
button.danger { background: #c62828; color: #fff; border-color: #c62828; }
button.danger:hover { background: #a91f1f; }
.danger-zone summary { cursor: pointer; }
details.mapread.suggest { border-color: #7c3aed; background: #faf7ff; }
details.mapread.suggest .sg-step { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
details.mapread.suggest .sg-step button { padding: 8px 12px; }
details.mapread.suggest .sg-warn { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fff7e6; border: 1px solid #f5c26b; color: #6b4500; font-size: 13px; line-height: 1.4; }
.demo-banner.sandbox { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; background: #fff4d6; border-bottom: 1px solid #f1d58a; font-size: 14px; padding: 8px 12px; position: relative; z-index: 2000; }
.demo-banner.sandbox a { color: #8a4b00; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* TownLine icons (public/brand/townline/icons) */
.tli { display: inline-block; vertical-align: middle; flex: none; }
