/* JustLodged dashboard, phone first (0.56.0). Loaded after app.css, and only adds to it.
   Built for a tradie on a driveway: one thumb, a 48px target with room between, 16px reading text,
   ink on cream for the sun, and nothing that needs a second hand or a steady tap. Colours are DESIGN.md tokens. */

/* ---------------------------------------------------------------- every screen size */
.tab-more { display:none }
.acts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px }
.acts .btn { min-height:48px; padding:8px 6px; font-size:13px; letter-spacing:.03em; text-decoration:none; text-align:center }
.acts2 { display:flex; flex-wrap:wrap; gap:0 18px }
.acts2 .linkbtn { min-height:44px; padding:6px 2px; font:600 14px/1.2 var(--body); color:var(--ink) }
.acts2 .linkbtn.on { color:var(--muted) }

/* Today */
.today { display:grid; gap:10px }
.today h3 { margin:14px 0 0; display:flex; align-items:center; gap:8px }
.today h3:first-child { margin-top:0 }
.today .cnt { font:600 13px/1.3 var(--mono); background:var(--ink); color:var(--paper); border-radius:10px; padding:1px 8px }
.tcard { background:var(--sheet); border:1px solid var(--line); border-left:5px solid var(--ink); padding:12px; display:grid; gap:10px }
.tcard.late { border-left-color:var(--bad) }
.tmain { display:grid; gap:3px; background:none; border:0; padding:0; text-align:left; color:var(--ink); cursor:pointer; width:100%; font:inherit }
div.tmain { cursor:auto }
.tmain b { font:700 17px/1.25 var(--body) }
.tmain span { font-size:16px; line-height:1.4 }
.tmain small { font:13px/1.4 var(--mono); color:var(--muted) }
.tcard.late .tmain small { color:var(--bad); font-weight:600 }
.tacts { display:flex; flex-wrap:wrap; gap:8px }
.tacts .btn { flex:1 1 30%; min-height:48px; text-decoration:none }
.tacts.wide .btn { flex:1 1 45% }

/* the map: clusters, Near me, the sheet */
.clus { display:grid; place-items:center; border-radius:50%; background:var(--fixed-ink); color:var(--mark); border:3px solid #fff;
  font:700 15px/1 var(--mono); box-shadow:0 1px 4px rgba(0,0,0,.35); cursor:pointer }
.clus.run { border-color:var(--mark) }
.nearme { position:absolute; top:10px; right:10px; z-index:800; min-height:48px; background:var(--sheet); box-shadow:0 1px 4px rgba(0,0,0,.3) }
.mapsheet { position:absolute; left:0; right:0; bottom:0; z-index:1000; max-height:72%; overflow:auto; background:var(--sheet);
  border-top:2px solid var(--ink); border-radius:12px 12px 0 0; padding:6px 10px 12px; box-shadow:0 -4px 16px rgba(0,0,0,.25) }
.mapsheet .job { border:0; border-left:5px solid var(--s-new); padding:6px 8px }
.sheet-x { display:block; margin:0 0 0 auto; min-height:44px; min-width:64px; background:none; border:0; font:600 14px var(--body); color:var(--ink); text-decoration:underline; cursor:pointer }

/* run mode: one house at a time, big type, the main button where the thumb rests */
body.in-run { overflow:hidden }
.runmode { position:fixed; inset:0; z-index:3000; background:var(--paper); color:var(--ink); display:flex; flex-direction:column; gap:14px;
  padding:calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); overflow:auto }
.rm-top { display:flex; justify-content:space-between; align-items:center; gap:10px }
.rm-n { font:700 14px/1.2 var(--mono); text-transform:uppercase; letter-spacing:.06em }
.rm-stop { display:grid; gap:8px; margin-top:8px }
.rm-addr { font:400 clamp(40px,11vw,64px)/1.05 var(--display); text-transform:uppercase; letter-spacing:.01em; overflow-wrap:anywhere }
.rm-place { margin:0; font:600 20px/1.3 var(--body) }
.rm-work { margin:0; font-size:18px; line-height:1.45 }
.rm-meta { margin:0; font:14px/1.4 var(--mono); color:var(--muted) }
.rm-acts { display:grid; gap:10px; margin-top:auto }
.rm-acts .btn { min-height:60px; font-size:16px; text-decoration:none }
.rm-acts .btn.primary { background:var(--mark); border-color:var(--fixed-ink); color:var(--fixed-ink); font-size:18px; min-height:68px }
.rm-next { margin:0; font-size:16px }
.rm-rule { margin:0; font-size:14px; color:var(--muted) }

/* phone alerts (0.63.0) */
.pushask { border-left-color:var(--mark); margin-bottom:10px }
.pushask .tmain b { font-size:18px }
#push-card .pstate { margin:0; font:600 15px/1.4 var(--body) }
#push-card .pstate.on::before { content:""; display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--s-won); margin-right:8px }

/* the More sheet and the no signal line */
.moresheet { border:0; padding:16px 16px calc(16px + env(safe-area-inset-bottom)); width:100%; max-width:480px; margin:auto auto 0;
  background:var(--sheet); color:var(--ink); border-radius:14px 14px 0 0 }
.moresheet::backdrop { background:rgba(10,20,17,.5) }
.moresheet form { display:grid; gap:10px }
.more-list { display:grid; gap:8px }
.more-list .btn, .moresheet form > .btn { width:100%; min-height:52px; justify-content:flex-start; font-size:15px; text-transform:none; letter-spacing:0 }
.moresheet form > .btn { justify-content:center }
.offline { position:fixed; top:0; left:0; right:0; z-index:2500; margin:0; padding:8px 16px calc(8px); background:var(--fixed-ink); color:#fff;
  font:600 14px/1.4 var(--body); text-align:center }
.seg3 { gap:8px 18px }
.seg3 .tick { display:inline-flex; align-items:center; gap:8px; min-height:48px }

/* a wider screen: Today reads as a column, and its buttons do not stretch across the whole page */
@media (min-width:760px) {
  .today { max-width:880px }
  .tacts .btn { flex:0 1 220px }
}

/* ---------------------------------------------------------------- a phone */
@media (max-width:759px) {
  .btn { min-height:48px }
  .linkbtn { min-height:44px }
  /* four tabs and More along the bottom, in sentence case at a readable size */
  .tabs button[data-more] { display:none }
  .tabs .tab-more { display:block }
  .tabs button, .tabs button[data-view="crm"], .tabs button[data-view="biz"] { flex:1 1 0; min-height:52px; font:600 13px/1.1 var(--body) }
  .tabs .tab-more[aria-current=true] { color:var(--mark); background:var(--fixed-ink) }
  .tabs .badge { font-size:12px; min-width:18px }   /* 0.64.0: was 11px, under the 12px floor */
  main { padding-bottom:104px }
  body.in-run .tabs, body.in-run .toast { display:none }
  /* reading sizes: nothing a tradie needs to read sits under 14px, and inputs are 16px so the phone does not zoom */
  .note { font-size:14px }
  .job .work { font-size:16px }
  .meta { font-size:13px }
  .tag { font-size:13px }
  input, select, textarea { font-size:16px }
  .chip { min-height:44px }
  .seg button { min-height:48px; padding:8px 24px }
  .statusbtns button, .due .item button { min-height:48px }
  .legend { font-size:13px }
  /* the map nearly fills the screen, and the job sheet slides up over its foot */
  #map { height:calc(100dvh - 200px) }
  /* on the map, only the search stays above it, so the map takes the screen */
  #v-jobs:has(.split[data-pane=map]) .filters { padding:6px }
  #v-jobs:has(.split[data-pane=map]) .filters > :not(.row:first-child), #v-jobs:has(.split[data-pane=map]) #more-filters { display:none }
  .split[data-pane=map] #map { height:max(320px, calc(100dvh - 300px)) }  /* app.js fitMapHeight sets the exact height */
  /* the customer board: one stage at a time, swipe sideways to the next */
  .board { grid-auto-columns:86% }
  .ccard { min-height:56px; font-size:15px }
  .ccard b { font-size:16px } .ccard span { font-size:14px }
  .drawer form { padding-bottom:calc(40px + env(safe-area-inset-bottom)) }
  /* the last few small targets the 390px check found */
  .btn.small { min-height:48px; font-size:13px }
  .demo-banner a { display:inline-flex; align-items:center; min-height:44px }
  .top .logo { min-height:44px; display:inline-flex; align-items:center }
  .job .addr { min-height:44px; padding:2px 0 }
  .acts2 .linkbtn { min-width:48px }
  .acts .btn { text-transform:none; letter-spacing:0; font-size:15px; padding:8px 4px }
  .mapsheet { max-height:62% }
  .mapsheet .tags { display:none }
  /* the sheet sits on the map itself: the legend steps aside while it is open */
  .mapwrap:has(.mapsheet:not([hidden])) .legend { display:none }
  .toast button { min-height:44px; min-width:56px; padding:0 8px }
  .due .item button { display:flex; align-items:center; width:100%; text-align:left }
  .chip b { font-size:13px }
  .leaflet-touch .leaflet-bar a { width:44px; height:44px; line-height:44px; font-size:22px }
}
@media (max-width:380px) {
  .tabs button, .tabs button[data-view="crm"], .tabs button[data-view="biz"] { font-size:12px }
}
@media (max-width:359px) {
  .acts { grid-template-columns:1fr 1fr }
  .acts .btn:last-child { grid-column:1 / -1 }
}
@media print { .runmode, .mapsheet, .nearme, .offline, .moresheet { display:none !important } }
/* 0.92.0: Install the app card (Account, Business and the Today ask). Numbered steps big enough to follow one handed. */
.install-slot .pstate { margin:0; font:600 15px/1.4 var(--body) }
.install-slot .pstate.on::before { content:""; display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--s-won); margin-right:8px }
.isteps { margin:8px 0 4px; padding-left:24px; display:grid; gap:8px; font:400 16px/1.45 var(--body) }
.isteps li::marker { font-weight:700 }
.installask .linkbtn { min-height:0; padding:0 }
.installask { border-left-color:var(--mark); margin-bottom:10px }
