:root {
  --navy: #0F2A4A; --blue: #2B7DB3; --bg: #EEF3F8; --soft: #E1EEF8; --card: #fff; --text: #1F2A37; --muted: #5B6778; --line: #D5DEE8;
  --danger: #B42318; --ok: #1E7F4F; --radius: 14px; --tap: 44px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
h1, h2, .btn, .nav-item, b { font-family: 'Montserrat', system-ui, sans-serif; }
h1 { font-size: 1.25rem; margin: 0; } h2 { font-size: 1.05rem; margin: 0 0 .6rem; color: var(--navy); }
a { color: var(--blue); }
.muted { color: var(--muted); } .small { font-size: .85rem; }

/* Layout: bottom tabs on phones, left sidebar on PCs */
#shell { min-height: 100vh; }
main#app { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; }
body.signed-in main#app { padding-bottom: calc(88px + var(--safe-b)); }
.nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr); background: #fff;
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -2px 10px rgba(15,42,74,.06); }
.nav-brand { display: none; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 700; }
.nav-item .ni { font-size: 1.3rem; line-height: 1; }
.nav-item[aria-current="page"] { color: var(--navy); box-shadow: inset 0 3px 0 var(--blue); }
@media (min-width: 900px) {
  body.signed-in #shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: stretch; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px; gap: 4px; box-shadow: none; }
  .nav-brand { display: block; padding: 4px 8px 18px; } .nav-brand img { width: 160px; height: auto; display: block; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .95rem; min-height: 44px; }
  .nav-item[aria-current="page"] { background: var(--soft); box-shadow: none; }
  body.signed-in main#app { padding: 0 28px 32px; width: 100%; }
}

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; margin: 0 -16px 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--navy); color: #fff; min-height: 60px; }
@media (min-width: 900px) { .topbar { margin: 0 -28px 18px; padding: 14px 28px; } }
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; }
.topbar .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); border-radius: 10px; border: 0;
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.5rem; text-decoration: none; cursor: pointer; }
.icon-btn.plain { background: var(--bg); color: var(--navy); font-size: 1rem; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 2px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; width: 100%; }
.btn.small { min-height: var(--tap); padding: 6px 12px; width: auto; font-size: .88rem; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.secondary { background: var(--blue); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: #f1c3bf; margin-top: 4px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0 0 0 8px; font: inherit; color: var(--blue); cursor: pointer; min-height: 0; }
.danger-link { color: var(--danger); }
.field { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
/* 16px text in every box: smaller makes iPhone Safari zoom in and leave the page wider than the screen */
input, select, textarea { display: block; width: 100%; max-width: 100%; min-width: 0; margin-top: 5px; min-height: var(--tap); padding: 10px 12px; font: inherit; font-size: 16px; font-weight: 400; color: var(--text);
  border: 2px solid var(--line); border-radius: 10px; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.form-grid > * { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; text-align: left; } /* iPhone date boxes otherwise ignore the width */
html, body { overflow-x: hidden; max-width: 100%; }
.form-grid .field { grid-column: 1 / -1; } .form-grid .field.half { grid-column: span 1; } .form-grid .full { grid-column: 1 / -1; }
.error-text { color: var(--danger); font-weight: 600; font-size: .9rem; margin: 4px 0 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Cards & lists */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(15,42,74,.08); margin-bottom: 14px; }
.section-h { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.section-h h2 { margin: 0; }
.list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.row-card { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; min-height: 60px; background: #fff; border-radius: 12px;
  border: 1px solid var(--line); text-decoration: none; color: inherit; }
.row-card:hover { border-color: var(--blue); }
.rc-main { min-width: 0; } .rc-main .muted { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.pill { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--navy); color: #fff; white-space: nowrap; }
.pill.soft { background: var(--soft); color: var(--blue); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.empty.small { padding: 12px; }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.searchbar { margin-bottom: 10px; } .searchbar input { margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: 600 .85rem 'Open Sans', sans-serif; color: var(--navy); cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Status colors */
.status { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--navy); white-space: nowrap; }
.st-lead { background: #E8EEF6; color: #334E6E; }
.st-inspection-scheduled { background: #FFF3D6; color: #8A5A00; }
.st-estimate-sent { background: #E3ECFF; color: #2347A8; }
.st-sold { background: #DDF3E7; color: var(--ok); }
.st-scheduled { background: #E6F4F1; color: #0F6B5C; }
.st-in-progress { background: #F3E8FF; color: #6B2FA8; }
.st-complete { background: #DFF5DF; color: #24702A; }
.st-lost { background: #F6E1DF; color: var(--danger); }
.status-select { font-weight: 700; }

/* Contact / job pages */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; }
.col-main, .col-side { min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.qbtn { flex: 1 1 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 8px; border-radius: 12px; background: var(--bg);
  text-decoration: none; color: var(--navy); font-size: 1.2rem; }
.qbtn span { font: 700 .75rem 'Montserrat', sans-serif; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 8px 0 0; }
.facts dt { color: var(--muted); font-size: .85rem; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.prop-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prop-actions { display: flex; gap: 6px; }
.card.soon { border: 2px dashed var(--line); box-shadow: none; background: transparent; }
.note-add textarea { margin: 0 0 8px; }
.note-add { margin-bottom: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li.sys .tl-body { color: var(--muted); font-style: italic; font-size: .9rem; }

/* Sheets & dialogs */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15,42,74,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-b)); }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; }
.dialog { background: #fff; border-radius: 16px; padding: 20px; margin: 16px; max-width: 420px; width: 100%; align-self: center; }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Sign in */
.auth { max-width: 420px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top, 0px)) 4px 40px; }
.auth-logo { width: 220px; display: block; margin: 0 auto 18px; }
.auth h1 { text-align: center; margin-bottom: 10px; color: var(--navy); }

/* Appointment colors (by type) */
.k-inspection { --k: #2B7DB3; --kbg: #E3F0FA; }
.k-estimate { --k: #D9730D; --kbg: #FDEEDC; }
.k-install { --k: #1E7F4F; --kbg: #DDF3E7; }
.k-followup { --k: #7A3FB8; --kbg: #F1E6FB; }
.k-other { --k: #5B6778; --kbg: #EDF0F4; }
.kind-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k, #5B6778); flex: 0 0 auto; }
.danger-text { color: var(--danger) !important; }

/* Appointments on a job */
.appts { display: flex; flex-direction: column; gap: 10px; }
.appt { border-left: 5px solid var(--k); background: var(--kbg); border-radius: 10px; padding: 10px 12px; }
.appt.done, .appt.canceled { opacity: .6; }
.appt.canceled b { text-decoration: line-through; }
.appt-main { display: flex; gap: 10px; align-items: flex-start; } .appt-main .kind-dot { margin-top: 6px; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.appt-actions .btn { background: #fff; }

/* Calendar */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-nav { display: flex; gap: 6px; } .cal-nav .btn { min-width: 44px; }
.cal-title { flex: 1; margin: 0; min-width: 160px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg-b { min-height: 40px; min-width: 64px; display: flex; align-items: center; justify-content: center; padding: 0 12px; text-decoration: none; color: var(--navy); font: 700 .85rem 'Montserrat', sans-serif; }
.seg-b.on { background: var(--navy); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: .82rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }

.ev { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--k); background: var(--kbg); color: var(--text);
  border-radius: 6px; padding: 4px 6px; font: 600 .8rem 'Open Sans', sans-serif; cursor: pointer; min-height: 26px; }
.ev:hover { filter: brightness(.97); outline: 2px solid var(--k); }
.ev .ev-time { color: var(--k); font-weight: 700; }
.ev .ev-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ev .ev-sub { flex-basis: 100%; color: var(--muted); font-weight: 400; font-size: .78rem; }
.ev.done { opacity: .55; } .ev.done .ev-text { text-decoration: line-through; }

.month { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15,42,74,.08); overflow: hidden; }
.dow, .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow div { padding: 8px 6px; font: 700 .75rem 'Montserrat', sans-serif; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.mday { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mday:nth-child(7n) { border-right: 0; }
.mday.out { background: #F8FAFC; } .mday.out .mnum { color: #A3AEBC; }
.mnum { align-self: flex-end; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; border-radius: 50%; text-decoration: none; color: var(--navy); font: 700 .85rem 'Montserrat', sans-serif; }
.mday.today .mnum { background: var(--navy); color: #fff; }
.mevents { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.more { font-size: .75rem; font-weight: 700; color: var(--blue); text-decoration: none; padding-left: 4px; }
.mdots { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 699px) {
  /* phones: month shows colored dots; tap the date to see the day */
  .mday { min-height: 58px; padding: 2px; }
  .mevents { display: none; } .mdots { display: flex; }
  .mnum { align-self: center; min-width: 40px; min-height: 40px; }
}
.week { display: grid; gap: 10px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15,42,74,.08); overflow: hidden; }
  .wday { border-right: 1px solid var(--line); min-height: 360px; } .wday:last-child { border-right: 0; } }
.wday { background: #fff; border-radius: 12px; padding: 8px; }
@media (min-width: 900px) { .wday { border-radius: 0; } }
.wday.today { background: #F4F9FE; }
.wh { display: flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; color: var(--navy); }
.wday.today .wh b { color: var(--blue); }
.wevents { display: flex; flex-direction: column; gap: 6px; }
.dayview { display: flex; flex-direction: column; gap: 10px; }
.dayview h3 { margin: 4px 0; font-size: 1rem; }
.dayview .ev, .wevents .ev { font-size: .9rem; padding: 8px 10px; min-height: 44px; }

/* Event preview */
.dialog.preview { position: relative; overflow: hidden; padding-top: 26px; }
.pv-band { position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--k); }
.pv-actions { display: grid; gap: 8px; margin-top: 14px; }

/* Board: all columns side by side; scroll sideways */
.board-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 6px; }
.board-tools input, .board-tools select { margin: 0; }
.board-tools select { width: auto; max-width: 46vw; }
.board-hint { margin: 2px 0 8px; }
.board { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  height: calc(100dvh - 60px - 150px - 64px - var(--safe-b)); min-height: 380px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; cursor: grab; }
.board::-webkit-scrollbar { height: 12px; } .board::-webkit-scrollbar-thumb { background: #B9C6D6; border-radius: 6px; } .board::-webkit-scrollbar-track { background: #E2E9F1; border-radius: 6px; }
@media (min-width: 900px) { .board { margin: 0 -28px; padding-left: 28px; padding-right: 28px; height: calc(100vh - 68px - 150px); } }
.bcol { flex: 0 0 76vw; max-width: 320px; display: flex; flex-direction: column; background: #E4EBF3; border-radius: 14px; scroll-snap-align: start; min-height: 0; transition: background .15s, box-shadow .15s; }
@media (min-width: 700px) { .bcol { flex-basis: 262px; } }
.bcol.drop { background: #D3E3F4; box-shadow: inset 0 0 0 3px var(--blue); }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.bcount { font: 700 .8rem 'Montserrat', sans-serif; color: var(--muted); }
.bsum { margin-left: auto; font-weight: 700; }
.bcards { flex: 1; overflow-y: auto; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.bempty { color: #8A97A8; font-size: .85rem; text-align: center; padding: 18px 0; border: 2px dashed #C9D4E1; border-radius: 10px; }
.bcard { display: block; background: #fff; border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(15,42,74,.12);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; border: 1px solid transparent; }
.bcard:hover { border-color: var(--blue); }
.bcard.dragging { opacity: .35; }
.bcard.ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: 0 12px 28px rgba(15,42,74,.3); cursor: grabbing; }
.bc-top { display: flex; justify-content: space-between; gap: 8px; color: var(--navy); }
.bc-val { font-weight: 700; color: var(--ok); font-size: .9rem; }
.bc-name { font-weight: 700; font-family: 'Montserrat', sans-serif; margin: 2px 0; }
.bc-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-appt { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 8px; border-radius: 8px; background: var(--kbg); color: var(--k); font-size: .8rem; font-weight: 700; }

body.wide main#app { max-width: none; }

/* Photos & documents */
.files-card { transition: box-shadow .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -6px; }
.files-card.drop-on { outline-color: var(--blue); background: var(--soft); }
.files-card h2 .count { font-size: .8rem; color: var(--muted); font-weight: 700; margin-left: 4px; }
.files-note { margin: -4px 0 8px; }
.file-btn { cursor: pointer; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; } }
.pthumb { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; min-width: 0; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .noprev { display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 700; color: var(--muted); font-size: .8rem; }
.pthumb .ptag { position: absolute; top: 4px; left: 4px; background: rgba(15,42,74,.85); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.pthumb .pcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: .72rem; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pthumb:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dlist { display: flex; flex-direction: column; gap: 4px; }
.drow { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 4px 0; min-width: 0; }
.drow:last-child { border-bottom: 0; }
.dmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 6px 0; }
.dicon { font-size: 1.5rem; flex: none; }
.dtext { min-width: 0; display: flex; flex-direction: column; }
.dtext b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.dact { display: flex; gap: 4px; flex: none; }
.dact .icon-btn { text-decoration: none; }
.upl { margin-top: 10px; }
.upl-row { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
.upl .bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.upl .bar i { display: block; height: 100%; background: var(--blue); transition: width .15s; }
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #060E19; display: flex; flex-direction: column; color: #fff; touch-action: pan-y; }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; }
.v-count { font-weight: 700; font-family: 'Montserrat', sans-serif; padding-left: 6px; }
.v-act { display: flex; gap: 6px; }
.v-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12);
  color: #fff; font-size: 1.1rem; text-decoration: none; cursor: pointer; }
.v-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14);
  color: #fff; font-size: 2rem; cursor: pointer; }
.v-nav.prev { left: 8px; } .v-nav.next { right: 8px; }
.v-cap { padding: 10px 16px calc(14px + var(--safe-b)); text-align: center; font-size: .9rem; color: #D6E2EE; }

/* Measurements card on a job */
.m-rows { display: flex; flex-direction: column; margin-bottom: 6px; }
.m-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.m-row.m-total { border-bottom: 0; font-size: 1.05rem; color: var(--navy); }
.m-row b { white-space: nowrap; }

/* Call notes */
.note-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline li.call .tl-body { border-left: 3px solid var(--blue); padding-left: 10px; }
.timeline li.call .tl-body::first-line { font-weight: 700; color: var(--navy); }
.call-hint { margin: 0 0 4px; }
.timeline .danger-link { display: inline-flex; align-items: center; min-height: 40px; min-width: 44px; padding: 0 8px; margin-left: 4px; }

/* Email */
.nav-item .ni { position: relative; }
.nbadge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #D92D20; color: #fff;
  font: 700 .68rem/18px 'Open Sans', sans-serif; text-align: center; }
.mlist { display: flex; flex-direction: column; }
.mlist.card { padding: 4px 8px; }
.mrow { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
  font: inherit; color: var(--text); cursor: pointer; min-width: 0; border-radius: 8px; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--bg); }
.mdir { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; }
.mdir.in { background: #E8F3FF; color: var(--blue); } .mdir.out { background: #EAF7EF; color: var(--ok); }
.mrow.failed .mdir { background: #FEECEB; color: var(--danger); }
.mmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mtop { display: flex; justify-content: space-between; gap: 8px; }
.mtop b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow.unread .mtop b, .mrow.unread .msub { font-weight: 800; color: var(--navy); }
.mrow.unread .mdir.in { background: var(--blue); color: #fff; }
.msub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msnip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.ok { background: #EAF7EF; color: var(--ok); } .pill.bad { background: #FEECEB; color: var(--danger); }
.ok-text { color: var(--ok); }
.inbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.mail-sheet .mail-meta { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-wrap: anywhere; }
.mail-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.mail-quote { margin-top: 12px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.mail-quote summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--blue); }
.mail-actions { margin-top: 16px; }
.file-pick { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0; }
.file-pick legend { padding: 0 4px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.check input { width: 22px; height: 22px; flex: none; }
.sig-preview { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
button.qbtn { border: 0; font: inherit; color: var(--navy); cursor: pointer; }
