/* no double-tap zoom anywhere (tapping the same key twice fast must not zoom the screen); pinch zoom still works */
:where(html, body, *) { touch-action: manipulation; }
: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); }
/* a fast sideways drag (selecting text right to left on a touchpad) must never count as the browser's swipe-back (Corey, Nov 3) */
html, body { overscroll-behavior-x: none; }
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; overflow-x: clip; max-width: 100%; } /* clip keeps sticky panels working */
.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; flex-wrap: wrap; 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 minmax(0, 1fr); gap: 6px 10px; margin: 8px 0 0; }
.facts dt { color: var(--muted); font-size: .85rem; } .facts dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
.prop-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prop-h > :first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; } /* a long address wraps instead of squeezing the buttons */
.prop-actions { display: flex; gap: 6px; flex: none; align-items: flex-start; }
.prop-actions .btn { white-space: nowrap; min-width: var(--tap); }
.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; }
.k-event { --k: #9A5B00; --kbg: #FDF1DC; } /* meetings, errands - anything that isn't a job */
.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); }

.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 auto; gap: 8px; margin-bottom: 6px; }
@media (max-width: 640px) { .board-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .board-tools input[type=search] { grid-column: 1 / -1; } }
.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; min-width: 0; }
.mtop > .muted { flex: none; white-space: nowrap; } /* the time never squeezes */
.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: break-word; }
.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; }

/* Import */
.map-rows { display: flex; flex-direction: column; gap: 4px; }
.map-row > span { display: block; margin-bottom: 4px; }
.import-done { margin-top: 12px; }
.import-done ul { padding-left: 18px; margin: 6px 0; overflow-wrap: anywhere; }
.mrow { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mrow.pressing { background: var(--soft); }
.mlist.selecting .mrow { padding-left: 40px; position: relative; }
.mlist.selecting .mrow::before { content: ''; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.mlist.selecting .mrow.picked { background: #E8F3FF; }
.mlist.selecting .mrow.picked::before { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 3px #fff; }
.sel-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
.sel-bar > span { flex: 1; min-width: 90px; }
.sel-bar .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.inbox-btns { display: flex; gap: 8px; }
.inbox-tip { margin-top: 10px; }

/* ---------- Proposal editor ---------- */
.grow { flex: 1; min-width: 0; }
.pe-head .pe-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.pe-head-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pe-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) { .pe-grid { grid-template-columns: 330px minmax(0, 1fr); align-items: start; } }
.pe-grid.one-page .pe-left { display: none; }
.pe-pages { display: flex; flex-direction: column; gap: 6px; }
.pe-pg { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 12px; padding: 4px 6px 4px 4px; box-shadow: 0 1px 3px rgba(15,42,74,.08); border: 2px solid transparent; min-width: 0; }
.pe-pg.sel { border-color: var(--blue); }
.pe-pg.off { opacity: .55; }
.pe-pg-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; font: inherit; color: var(--text); padding: 8px 4px; cursor: pointer; min-height: 48px; }
.pe-pg-t { display: flex; flex-direction: column; min-width: 0; }
.pe-pg-t b, .pe-pg-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-ico { font-size: 1.25rem; width: 28px; text-align: center; flex: none; }
.pe-pg-act { display: flex; align-items: center; gap: 2px; flex: none; }
.pe-pg-act .icon-btn { min-width: 40px; }
.icon-btn:disabled { opacity: .3; }
.switch { position: relative; display: inline-flex; width: 52px; height: 44px; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { width: 44px; height: 26px; border-radius: 99px; background: #CBD5E1; position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.pe-add { margin-top: 6px; }
.pe-back { margin-bottom: 8px; }
.pe-ed-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pe-ed-head .pe-ico { margin-bottom: 14px; }
.pe-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.pe-cover-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.pe-cover-pick img { width: 160px; height: 100px; object-fit: cover; border-radius: 10px; background: var(--soft); }
.pe-nophoto { width: 160px; height: 100px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pe-insp { display: flex; flex-direction: column; gap: 14px; margin: 10px 0; }
.pe-insp-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
@media (min-width: 700px) { .pe-insp-item { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.pe-insp-photo { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; display: block; width: 100%; }
.pe-insp-photo img { width: 100%; display: block; }
.pe-insp-photo .pp-mark { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-mk-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(15,42,74,.85); color: #fff; font: 700 .8rem 'Montserrat', sans-serif; padding: 6px 10px; border-radius: 99px; }
.pe-insp-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pe-row-act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pe-items { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; }
.pe-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pe-item.optional { border-style: dashed; background: #FFFBEB; }
.pe-item-top { display: flex; align-items: center; gap: 10px; }
.pe-item-title { flex: 1; min-width: 0; font-weight: 700; }
.pe-line-total { white-space: nowrap; color: var(--navy); }
.pe-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pe-nums label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); font-weight: 600; gap: 2px; }
.small-check { min-height: 44px; font-size: .9rem; }
.pe-totals { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 12px; background: var(--navy); color: #fff; margin-top: 12px; font-family: 'Montserrat', sans-serif; }
.pe-totals b { font-size: 1.2rem; }
.pe-addlist { display: flex; flex-direction: column; gap: 6px; }
.pe-addopt { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; text-align: left; font: inherit; cursor: pointer; min-height: 56px; }
.pe-addopt span:last-child { display: flex; flex-direction: column; }
.pe-addopt:hover { background: var(--bg); }
.pe-picker .pthumb.picked { outline: 4px solid var(--blue); outline-offset: -4px; }
.pthumb .pick-mark { display: none; position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; align-items: center; justify-content: center; }
.pthumb.picked .pick-mark { display: flex; }
.pe-itemlist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.pe-itemopt { flex: none; align-items: flex-start; border-bottom: 1px solid var(--line); padding: 8px 0; } /* flex:none: in a long scrolling list the rows must not squash into each other */
.pe-itemopt input { margin-top: 4px; }
.pe-itemopt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pe-itemdesc { display: block; }
.pe-tpl-pages { display: flex; flex-direction: column; gap: 8px; }
.pe-tpl-page { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.pe-tpl-page summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; flex-wrap: wrap; }
.pe-tpl-page[open] { padding-bottom: 12px; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .85em; }

/* ---------- Proposal pages (preview + customer page) ---------- */
.pp-preview { position: fixed; inset: 0; z-index: 50; background: #5B6778; overflow: auto; }
.pp-preview-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; background: var(--navy); color: #fff; }
.pp-preview-bar .btn { background: rgba(255,255,255,.15); color: #fff; }
.pp-doc { max-width: 860px; margin: 0 auto; padding: 16px 12px 60px; display: flex; flex-direction: column; gap: 16px; }
.pp-doc { container-type: inline-size; }
.pp-page { min-height: calc(100cqw * 11 / 8.5); } /* always a full letter-size sheet, however little is on it */
.pp-page { position: relative; background: #fff; color: #1F2A37; border-radius: 6px; padding: 34px 28px 40px; box-shadow: 0 4px 18px rgba(0,0,0,.18); overflow: hidden; font-size: .95rem; line-height: 1.5; }
.pp-page::before { content: ''; position: absolute; left: 0; top: 0; border-style: solid; border-width: 64px 64px 0 0; border-color: var(--navy) transparent transparent transparent; }
.pp-page::after { content: ''; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 70px 70px; border-color: transparent transparent var(--blue) transparent; }
.pp-page h2 { font: 800 1.6rem 'Montserrat', sans-serif; color: var(--blue); text-transform: uppercase; margin: 6px 0 16px; letter-spacing: .02em; }
.pp-page h3 { font: 800 1.05rem 'Montserrat', sans-serif; color: var(--navy); margin: 16px 0 6px; }
.pp-page h4 { margin: 0 0 4px; font-size: .98rem; }
.pp-sub { font: 700 1rem 'Montserrat', sans-serif; margin: 18px 0 8px; }
.pp-text p { margin: 0 0 10px; } .pp-text ul, .pp-text ol { margin: 0 0 10px; padding-left: 22px; }
.pp-muted, .pp-empty { color: #5B6778; }
.pp-cover { padding: 0; }
.pp-cover::before { display: none; }
.pp-cover-logos { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; }
.pp-cover-logos img { max-height: 70px; max-width: 42%; object-fit: contain; }
.pp-cover-logos .pp-logo-l { object-position: left center; }
.pp-cover-logos .pp-logo-r { object-position: right center; max-height: 66px; }
.pp-photo { position: relative; background: #EEF3F8; }
.pp-photo img { display: block; width: 100%; height: auto; }
.pp-photo .pp-mark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pp-photo.hero { overflow: hidden; }
.pp-photo.missing { padding: 30px; text-align: center; color: #5B6778; }
.pp-cover-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 24px 28px 70px; background: #F2F5F9; }
@media (min-width: 640px) { .pp-cover-info { grid-template-columns: 1.1fr 1fr; } }
.pp-cover-left h1 { font: 500 1.6rem 'Montserrat', sans-serif; color: var(--navy); text-transform: uppercase; margin: 0; line-height: 1.15; }
.pp-date { color: #5B6778; font-size: .82rem; margin: 6px 0 12px; text-transform: uppercase; }
.pp-services, .pp-contact { font-size: .85rem; margin: 0 0 10px; }
.pp-cover-right { border-left: 3px solid var(--navy); padding-left: 14px; }
.pp-cover-right h2 { color: var(--navy); font-size: 1.25rem; margin: 0 0 4px; }
.pp-insp { display: flex; flex-direction: column; gap: 22px; }
.pp-insp-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* PC: photo on the left, text beside it - and once the text passes the bottom of the photo it uses the full width
   underneath (no tall skinny column pushing the next photo down) */
@media (min-width: 640px) {
  .pp-insp-item { display: flow-root; }
  .pp-insp .pp-insp-item > .pp-photo { float: left; width: 64%; margin: 0 18px 10px 0; }
  .pp-insp-item > .pp-insp-text { display: block; }
  .pp-insp-item .pp-insp-text h4 { margin-top: 0; }
}
.pp-insp-item .pp-photo { border-radius: 4px; overflow: hidden; }
.pp-tier { font-size: .75rem; vertical-align: middle; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--blue); }
.pp-items { display: flex; flex-direction: column; }
.pp-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 10px; border-bottom: 1px solid #E2E8F0; }
.pp-item:nth-child(odd) { background: #F6F8FB; }
@media (min-width: 640px) { .pp-item { grid-template-columns: minmax(0, 1fr) 330px; } }
.pp-item.optional { background: #FFFBEB; }
.pp-desc { color: #4B5563; font-size: .88rem; margin-top: 4px; }
.pp-item-nums { display: grid; grid-template-columns: 50px 60px 90px 100px; gap: 6px; justify-content: end; text-align: right; font-size: .9rem; align-self: start; }
.pp-opt-tag { font-size: .72rem; background: #FDE68A; color: #92400E; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.pp-opt-pick { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; color: var(--navy); cursor: pointer; }
.pp-opt-pick input { width: 22px; height: 22px; }
.pp-totals { margin: 16px 0 0 auto; max-width: 320px; display: flex; flex-direction: column; gap: 4px; }
.pp-totals div { display: flex; justify-content: space-between; gap: 16px; }
.pp-totals .grand { border-top: 2px solid var(--navy); padding-top: 6px; font-size: 1.1rem; }
.pp-sign-opts { display: flex; flex-direction: column; gap: 8px; }
.pp-sign-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid #E2E8F0; border-radius: 12px; min-height: 52px; cursor: pointer; }
.pp-sign-opt.on { border-color: var(--blue); background: #EFF6FF; }
.pp-sign-opt > span:not(.pp-box) { flex: 1; font-weight: 700; }
.pp-sign-opt .pp-box, .pp-upgrade .pp-box { flex: none; }
.pp-sign-opt input { width: 22px; height: 22px; }
.pp-box { width: 18px; height: 18px; border: 2px solid #1F2A37; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.pp-sign-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 14px 0; }
.pp-sign-who span { display: block; font-size: .8rem; color: #5B6778; }
.pp-deposit { display: flex; gap: 16px; justify-content: space-between; background: #F2F5F9; padding: 12px 14px; border-radius: 8px; font-size: .9rem; }
.pp-deposit p { margin: 0; flex: 1 1 auto; min-width: 0; }
.pp-deposit b { flex: none; align-self: center; white-space: nowrap; font-size: 1.1rem; }
.pp-deposit-amt { margin: 8px 0 16px; color: var(--navy); }
.pp-comments { width: 100%; }
.pp-comments-box { min-height: 70px; border: 1px solid #1F2A37; padding: 8px; max-width: 420px; white-space: pre-wrap; }
.pp-sigline { margin-top: 30px; }
.pp-sig { max-height: 80px; max-width: 280px; display: block; }
.pp-sig-blank { height: 50px; }
.pp-sig-row > :first-child { min-width: 0; } .pp-sig-row > :last-child { flex: none; white-space: nowrap; }
.pp-sig-row { display: flex; gap: 12px; justify-content: space-between; border-top: 1px solid #1F2A37; padding-top: 6px; font-weight: 700; font-size: .9rem; }

/* ---------- Photo markup editor ---------- */
.mk { position: fixed; inset: 0; z-index: 70; background: #0B1220; display: flex; flex-direction: column; color: #fff; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; }
.mk-top .btn.ghost { background: rgba(255,255,255,.12); color: #fff; }
.mk-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.mk-wrap { position: relative; touch-action: none; }
.mk-wrap img, .mk-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.mk-wrap canvas { cursor: crosshair; }
.mk-tools { padding: 8px 8px calc(10px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; background: #111A2E; }
.mk-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mk-tool { min-width: 52px; min-height: 52px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.15rem; cursor: pointer; }
.mk-tool small { font-size: .65rem; }
.mk-tool.on { background: var(--blue); }
.mk-color { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); cursor: pointer; }
.mk-color.on { border-color: #fff; box-shadow: 0 0 0 3px var(--blue); }
.mk-textbox { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); display: flex; gap: 8px; background: #fff; padding: 10px; border-radius: 12px; width: min(92vw, 420px); }
.mk-textbox input { flex: 1; color: #1F2A37; }
.pe-h3 { font: 700 1rem 'Montserrat', sans-serif; color: var(--navy); margin: 18px 0 2px; }
.pp-upgrades { display: flex; flex-direction: column; gap: 8px; }
.pp-upgrade { display: flex; gap: 12px; align-items: flex-start; border: 2px dashed #E2E8F0; border-radius: 12px; padding: 12px; cursor: pointer; }
.pp-upgrade.on { border-style: solid; border-color: var(--ok); background: #F0FDF4; }
.pp-upgrade input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.pp-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-upgrade > b { white-space: nowrap; }
.pp-sign-opt.static { cursor: default; }
.pp-sum { margin: 16px 0 0 auto; max-width: 340px; display: flex; flex-direction: column; gap: 4px; }
.pp-sum div { display: flex; justify-content: space-between; gap: 16px; }
.pp-sum .grand { border-top: 2px solid var(--navy); padding-top: 6px; font-size: 1.15rem; }
.pp-choose { display: block; width: 100%; margin-top: 14px; min-height: 52px; border-radius: 12px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font: 800 1rem 'Montserrat', sans-serif; cursor: pointer; }
.pp-choose.on { background: var(--blue); color: #fff; }
.small { font-size: .85rem; }

/* straight quote vs multiple options */
.pe-quote-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pe-head-total { display: flex; flex-direction: column; }
.pe-head-total b { font-size: 1.35rem; color: var(--navy); }
.pe-multi { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.pe-multi > span:first-child { display: flex; flex-direction: column; text-align: right; }
@media (max-width: 520px) { .pe-multi > span:first-child { text-align: left; } .pe-multi { width: 100%; justify-content: space-between; } }
/* live preview + View page: real PDF sheets */
@media (min-width: 1250px) {
  .pe-grid.with-live { grid-template-columns: 270px minmax(0, 1fr) minmax(0, 1fr); }
  .pe-live { position: sticky; top: 84px; max-height: calc(100vh - 96px); overflow: auto; background: #5B6778; border-radius: 14px; padding: 10px; }
}
.pe-live-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #fff; padding: 2px 4px 8px; }
.pe-live-h .muted { color: #E2E8F0; }
.pv-doc { display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.pv-sheet { display: block; width: 100%; height: auto; background: #fff; border-radius: 3px; box-shadow: 0 3px 14px rgba(0,0,0,.25); }
.pv-big { background: #5B6778; border-radius: 14px; padding: 12px; }
.pv-big .pv-doc { max-width: 860px; margin: 0 auto; }
.pv-cap { color: #E2E8F0; max-width: 860px; margin: 0 auto 10px; }
.pe-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.sheet.drop-on { outline: 3px dashed var(--blue); outline-offset: -6px; }
.btn.nowrap { white-space: nowrap; }
/* signature on the warranty page */
.pp-owner-sig { display: block; height: 58px; width: auto; max-width: 240px; margin: 4px 0 -6px; }
/* included PDFs: every page shown full size */
.pp-page.pp-pdf { background: none; box-shadow: none; padding: 0; min-height: 0; border-radius: 0; overflow: visible; }
.pp-page.pp-pdf::before, .pp-page.pp-pdf::after { display: none; }
.pp-pdf-sheets { display: flex; flex-direction: column; gap: 16px; }
.pp-pdf-loading { background: #fff; border-radius: 6px; padding: 40px 24px; margin: 0; text-align: center; color: #475569; }
.pe-pdf-show { margin-top: 12px; background: #5B6778; border-radius: 12px; padding: 10px; }
/* ---------- customer's proposal page (/p/) ---------- */
body.cust { background: #5B6778; min-height: 100vh; }
.cust-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.cust-logo { height: 34px; width: auto; }
.cust-top-t { margin-left: auto; font-weight: 700; color: var(--navy); }
#cust { padding: 0 0 calc(110px + var(--safe-b)); }
#cust .loading { color: #fff; }
.cust-banner { max-width: 836px; margin: 16px auto 0; background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 4px 18px rgba(0,0,0,.18); }
@media (max-width: 860px) { .cust-banner { margin: 12px 12px 0; } }
.cust-banner h1 { font: 800 1.35rem 'Montserrat', sans-serif; color: var(--navy); margin: 0 0 6px; }
.cust-banner p { margin: 6px 0; }
.cust-banner.done { border-top: 6px solid var(--ok); }
.cust-banner .btn { margin-top: 8px; }
.cust-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.cust-preview { background: #FEF3C7; border-radius: 8px; padding: 8px 10px; font-size: .9rem; margin: 0 0 10px !important; }
.cust-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + var(--safe-b)); background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.18); }
.cust-bar > div { display: flex; flex-direction: column; min-width: 0; }
.cust-bar b { font-size: 1.3rem; color: var(--navy); }
body.cust .toast { bottom: calc(90px + var(--safe-b)); }
.cust-sign { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cust-pad-wrap { position: relative; border: 2px dashed #94A3B8; border-radius: 12px; background: #F8FAFC; }
.cust-pad { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.cust-pad-hint { position: absolute; left: 16px; bottom: 14px; color: #94A3B8; font: 700 1.1rem 'Montserrat', sans-serif; pointer-events: none; }
.cust-pad-clear { position: absolute; right: 6px; top: 6px; }
.cust-accept { min-height: 56px; font-size: 1.1rem; }
/* proposal sending / signed details in the editor */
.pe-send-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.pe-track { font-size: .9rem; color: var(--muted); }
.pe-signed { margin-top: 12px; padding: 12px; border-radius: 12px; background: #ECFDF5; border: 1px solid #A7F3D0; }
.pe-signed img { max-height: 54px; max-width: 220px; display: block; margin: 6px 0; background: #fff; border-radius: 6px; }
html.cust-html { background: #5B6778; }
.cust-bar > div { flex: 1; }
.cust-bar b { white-space: nowrap; }
.cust-bar .btn { flex: none; width: auto; padding-left: 18px; padding-right: 18px; }
.update-btn { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 70; background: var(--blue); color: #fff; border: 0; border-radius: 99px; padding: 12px 18px; font-weight: 700; min-height: 44px; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.pp-opt-pick.on { color: var(--ok); }
.pp-opt-tag.added { background: #D1FAE5; color: var(--ok); }
.pp-preview-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* customer signature: draw or type */
.cust-sig-how { display: flex; flex-direction: column; gap: 6px; }
.cust-sig-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cust-sig-tabs button { border: 2px solid var(--line); border-radius: 12px; background: #fff; min-height: 56px; padding: 8px 10px; font: 700 .98rem 'Open Sans', sans-serif; color: var(--navy); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.cust-sig-tabs button small { font-weight: 400; font-size: .8rem; color: var(--muted); }
.cust-sig-tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cust-sig-tabs button.on small { color: #CBD5E1; }
.cust-typed { display: flex; flex-direction: column; gap: 8px; }
.cust-typed-show { min-height: 110px; display: flex; align-items: center; padding: 8px 16px; border: 2px dashed #94A3B8; border-radius: 12px; background: #F8FAFC; font: 3.4rem 'Great Vibes', cursive; color: #14203A; overflow: hidden; white-space: nowrap; }
.cust-sig-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.cust-sig-styles button { flex: 1 1 150px; min-height: 52px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: #14203A; font-size: 1.7rem; cursor: pointer; padding: 2px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sig-styles button.on { border-color: var(--blue); background: #EFF6FF; }
@media (max-width: 520px) { .cust-sig-styles button { flex-basis: 100%; } }

/* money badges on board cards + job rows */
.mbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.row-card .mbs { flex-basis: 100%; margin-top: 2px; }
.mb { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.mb.ok { background: #DCFCE7; color: #166534; }
.mb.warn { background: #FEF3C7; color: #92400E; }
.mb.info { background: #DBEAFE; color: #1E40AF; }
.mb.soft { background: #EEF2F7; color: #475569; }
.pill.warn { background: #FEF3C7; color: #92400E; }
@media (max-width: 520px) { .hide-sm { display: none; } }
/* payments */
.pay-list { display: flex; flex-direction: column; gap: 6px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pay-main { min-width: 0; }
.pe-dep { margin-top: 10px; padding-top: 10px; border-top: 1px solid #A7F3D0; display: flex; flex-direction: column; gap: 8px; }
.pe-dep-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* invoice editor */
.iv-grid { max-width: 900px; }
.iv-totals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.iv-tot { flex: 1 1 140px; display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.iv-tot span { font-size: .85rem; color: var(--muted); }
.iv-tot b { font-size: 1.25rem; color: var(--navy); }
.iv-tot.grand { background: var(--navy); }
.iv-tot.grand span, .iv-tot.grand b { color: #fff; }
.iv-tot.grand.paid { background: var(--ok); }
.iv-send-sum { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
/* invoice page */
.inv-page { font-size: .95rem; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 10px 0 20px; }
.inv-logo { height: 56px; width: auto; max-width: 55%; object-fit: contain; }
.inv-title { text-align: right; }
.inv-title h2 { margin: 0 !important; }
.inv-title div { font-weight: 800; color: var(--navy); }
.inv-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.inv-meta span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: #64748B; margin-top: 4px; }
.inv-meta b { display: block; color: #1F2A37; }
.inv-items { border-top: 2px solid var(--navy); }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(90px, auto) minmax(100px, auto); gap: 8px; padding: 9px 4px; border-bottom: 1px solid #E2E8F0; }
.inv-row > span:not(:first-child) { text-align: right; white-space: nowrap; }
.inv-row small { display: block; color: #64748B; margin-top: 2px; }
.inv-th { font-weight: 800; font-size: .8rem; text-transform: uppercase; color: #475569; background: #F1F5F9; }
@media (max-width: 560px) { .inv-row { grid-template-columns: minmax(0, 1fr) minmax(90px, auto); } .inv-row > span:nth-child(2), .inv-row > span:nth-child(3) { display: none; } }
.inv-totals { margin: 16px 0 0 auto; max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 10px; }
.inv-paid { color: #166534; font-size: .9rem; }
.inv-totals .grand { background: var(--navy); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 1.1rem; }
.inv-paid-stamp { margin: 16px 0 0; color: #166534; font: 800 1.4rem 'Montserrat', sans-serif; letter-spacing: .08em; }
.inv-notes { margin-top: 18px; padding: 10px 12px; background: #F8FAFC; border-radius: 8px; color: #475569; }
.inv-thanks { margin-top: 18px; font-weight: 700; color: var(--navy); }

/* framed photos (fixed shape, zoom/pan picks what shows) */
.pp-photo.pp-framed { position: relative; overflow: hidden; width: 100%; }
.pp-crop { position: absolute; }
.pp-crop img { display: block; width: 100% !important; height: 100% !important; max-width: none; }
.pp-crop .pp-mark { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-insp-pic { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pe-cover-frame { width: 240px; border-radius: 10px; overflow: hidden; }
.ce-stage { display: flex; align-items: center; justify-content: center; }
.ce-frame { position: relative; overflow: hidden; touch-action: none; cursor: grab; box-shadow: 0 0 0 2px #fff, 0 0 0 9999px rgba(0,0,0,.55); background: #222; }
.ce-frame:active { cursor: grabbing; }
.ce-in { position: absolute; }
.ce-in img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ce-in .pp-mark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ce-tools { background: #0F172A; color: #fff; padding: 10px 14px calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ce-zoom { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; }
.ce-zoom input[type=range] { flex: 1; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; }
.ce-help { margin: 0; font-size: .85rem; color: #CBD5E1; text-align: center; max-width: 520px; }
.ce-stage { overflow: hidden; }
/* team & logins */
.team-row { align-items: center; }
.team-row.off { opacity: .6; }
.team-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.team-act select { width: auto; margin: 0; }
.team-roles { margin-top: 12px; }
.team-roles summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.role-pick, .crew-pick { border: 0; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.role-pick legend, .crew-pick legend { font-weight: 700; margin-bottom: 4px; padding: 0; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--blue); background: #EFF6FF; }
.role-opt input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.role-opt > span { display: flex; flex-direction: column; }

/* Google review requests */
.rv-stars { color: #F5B301; letter-spacing: 1px; font-size: .95em; margin-right: 4px; }
.rv-card { border-left: 4px solid #F5B301; }
.rv-card p { margin: 6px 0; }
.rv-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.rv-btns .btn { width: auto; }
.rv-banner { display: flex; gap: 10px; align-items: flex-start; background: #FFF8E1; border: 1px solid #F3D98B; border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.rv-banner .rv-stars { font-size: 1.4rem; line-height: 1; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rv-chip { background: #fff; border: 1px solid #F0D27A; border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 700; text-decoration: none; color: var(--navy); }
.rv-sheet { max-width: 1100px; }
.rv-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .rv-grid { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; } .rv-prev { position: sticky; top: 0; } }
.rv-warn { background: #FFF4E5; border: 1px solid #F5C77E; color: #7A4B00; border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.rv-when { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 6px 0 4px; }
.rv-when legend { font-weight: 700; padding: 0 4px; }
.rv-radio { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; }
.rv-radio input { width: 20px; height: 20px; }
.rv-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.rv-quick .btn { width: auto; }
.rv-quick .btn.on { background: var(--navy); color: #fff; }
.rv-frame-wrap { background: #EEF2F7; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rv-inbox { padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.rv-frame { display: block; width: 100%; height: 760px; border: 0; background: #EEF2F7; }
.rv-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.rv-toggle input { width: 22px; height: 22px; }
.rv-help { margin: -4px 0 12px; } .rv-help summary { cursor: pointer; color: var(--blue); min-height: 36px; display: flex; align-items: center; }
.rv-help ol { padding-left: 20px; margin: 4px 0; } .rv-help li { margin: 4px 0; }
.rv-badge-row { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.rv-badge-row p { margin: 4px 0; }
.rv-badge-img { display: block; max-width: 200px; max-height: 90px; margin: 8px 0; }

/* calendar: add from a day, reschedule, drag */
.mday .mtop { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.madd { min-width: 30px; min-height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--blue); font-size: 1.1rem; font-weight: 700; cursor: pointer; opacity: 0; }
.mday:hover .madd, .madd:focus-visible { opacity: 1; background: var(--soft); }
.mday { cursor: pointer; }
.mday.drop, .wday.drop { background: #D3E3F4 !important; box-shadow: inset 0 0 0 2px var(--blue); }
.ev.dragging { opacity: .45; }
.ev[draggable="true"] { cursor: grab; }
.wtop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.madd-w { width: auto; }
@media (max-width: 899px) { .madd { display: none; } }
.ca-dayadd { display: flex; flex-wrap: wrap; gap: 8px; }
.ca-dayadd .btn { width: auto; flex: 1 1 220px; }
.ca-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.ca-row { display: flex; gap: 8px; align-items: center; } .ca-row .ev { flex: 1; min-height: 44px; } .ca-row .btn { width: auto; flex: none; }
.ca-h { margin: 14px 0 8px; font-size: 1rem; }
.ca-actions { display: flex; flex-direction: column; gap: 10px; }
.ca-big { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; min-height: 64px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.ca-big:hover { border-color: var(--blue); background: #F7FAFD; }
.ca-big > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.ca-ico { font-size: 1.6rem; }
.ca-results { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 50vh; overflow: auto; }
.ca-pick { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--text); cursor: pointer; }
.ca-pick:hover { border-color: var(--blue); }
.ca-jobs { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 10px; margin: 0 0 10px; min-width: 0; }
.ca-jobs legend { font-weight: 700; padding: 0 4px; }
.ca-jobs .status { margin-left: 4px; }
.ca-scroll { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.ca-job { flex: none; display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; min-height: 48px; }
.ca-job input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.ca-job > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ca-job:has(input:checked) { border-color: var(--navy); background: #F4F7FB; }
.form-grid.tight { margin: 0; }

/* calendar: "Show on calendar" checklist (sidebar on a PC, fold-out on a phone) */
.cal-wrap { display: flex; flex-direction: column; gap: 12px; }
.cal-main { min-width: 0; flex: 1; }
@media (min-width: 900px) { .cal-wrap { flex-direction: row; align-items: flex-start; } .cal-filter { flex: 0 0 250px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; } }
.cf { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 10px; }
.cf > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; }
.cf > summary::-webkit-details-marker { display: none; }
.cf > summary::after { content: '▾'; color: var(--muted); } .cf[open] > summary::after { content: '▴'; }
.cf > summary .muted { margin-left: auto; flex: none; white-space: nowrap; }
.cf-reset { width: 100%; margin: 2px 0 6px; }
.cf-group { border-top: 1px solid var(--line); padding: 6px 0 4px; }
.cf-h { display: flex; align-items: center; gap: 4px; min-height: 40px; font-size: .85rem; }
.cf-h b { flex: 1; }
.cf-h .link { padding: 0 6px; min-height: 40px; min-width: 44px; font-size: .82rem; }
.cf-row { display: flex; align-items: center; gap: 4px; }
.cf-check { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: .9rem; min-width: 0; }
.cf-check input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--navy); }
.cf-label { flex: 1; min-width: 0; line-height: 1.25; }
.cf-n { color: var(--muted); font-size: .78rem; min-width: 18px; text-align: right; }
.cf-sw.status { padding: 0; width: 12px; height: 12px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.12); }
.cf-only { border: 0; background: transparent; color: var(--blue); font: 600 .78rem inherit; min-height: 40px; min-width: 40px; padding: 0 4px; cursor: pointer; opacity: .0; }
.cf-row:hover .cf-only, .cf-only:focus-visible { opacity: 1; }
@media (pointer: coarse) { .cf-only { opacity: 1; } }
.cf-done { border-top: 1px solid var(--line); padding-top: 4px; }
@media (pointer: fine) { .cf-check { min-height: 34px; } .cf-only { min-height: 34px; } .cf-h, .cf-h .link { min-height: 34px; } }
.madd-w { min-height: 34px; min-width: 34px; padding: 0 8px; font-size: .8rem; }
@media (min-width: 900px) and (max-width: 1400px) { .madd-w .madd-t { display: none; } }

/* nav: any number of items; short label on the phone bar */
.nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.nl-short { display: inline; } .nl-long { display: none; }
@media (min-width: 900px) { .nav { grid-auto-flow: row; } .nl-short { display: none; } .nl-long { display: inline; } }
@media (max-width: 420px) { .nav-item { font-size: .7rem; } }

/* completed jobs */
.done-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.done-sum > div { flex: 1 1 140px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.done-sum b { font: 800 1.35rem 'Montserrat', sans-serif; color: var(--navy); }
.done-month { margin: 18px 0 8px; font-size: .95rem; color: var(--muted); }
.done-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.done-card:hover { border-color: var(--blue); }
.dc-main { flex: 1; min-width: 0; }
.dc-top { display: flex; justify-content: space-between; gap: 8px; }
.dc-badges { display: flex; flex-wrap: wrap; gap: 0 6px; }
.dc-badges .mbs { margin-top: 6px; }
.dc-when { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; min-width: 70px; }
.board-tools .seg { flex-wrap: wrap; } .board-tools .seg-b { border: 0; background: #fff; cursor: pointer; }
.board-tools .seg-b.on { background: var(--navy); color: #fff; }

/* settings: storage bars */
.st-row { margin: 10px 0 14px; }
.st-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.st-bar { height: 14px; border-radius: 999px; background: #E6ECF3; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }
.st-bar i.warm { background: #E3A008; } .st-bar i.hot { background: var(--danger); }
@media (max-width: 699px) { .board-tools .seg { width: 100%; flex-wrap: nowrap; } .board-tools .seg-b { flex: 1 1 auto; min-width: 48px; padding: 0 8px; font-size: .78rem; text-align: center; } }
.team-default { margin-top: 14px; } .team-default .muted { display: block; margin-top: 4px; font-weight: 400; }

/* long words, links and numbers wrap inside their box instead of running out of it */
body { overflow-wrap: break-word; }
.card, .sheet, .dialog, .bcard, .row-card, .done-card, .appt, .timeline li, .tl-body, .pp-page, .pe-head, .pay-row, .cf, .ev, .mrow, .done-sum, .pp-item-main, .pp-up-main, .inv-row > span:first-child { overflow-wrap: break-word; } /* (a long link or code still wraps; normal words never get squeezed in half) */
.appt-main > div, .rc-main, .pay-main, .dc-main, .pp-item-main, .pp-up-main, .tl-body { min-width: 0; }
.row-card > .rc-main { flex: 1 1 200px; }
.pay-main { flex: 1; }
/* items in scrolling lists keep their full height (never squashed on top of each other) */
.bcards > *, .pe-itemlist > *, .ca-results > *, .ca-scroll > *, .list > *, .pay-list > *, .appts > *, .ca-list > * { flex-shrink: 0; }

/* money page */
.mo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-auto-rows: 1fr; gap: 10px; margin-bottom: 14px; } /* every tile as tall as the tallest */
.mo-tile { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.mo-tile:hover { border-color: var(--blue); }
.mo-tile b { font: 800 1.6rem 'Montserrat', sans-serif; color: var(--navy); }
.mo-tile.warn b { color: #9A5B00; }
.mo-k { font-size: .78rem; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.mo-ytd-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.mo-ytd-nums > div { display: flex; flex-direction: column; gap: 2px; }
.mo-ytd-nums b { font: 800 1.3rem 'Montserrat', sans-serif; color: var(--navy); }
.mo-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.mo-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mo-chart { position: relative; display: flex; gap: 8px; }
.mo-axis { display: flex; flex-direction: column; justify-content: space-between; height: 160px; font-size: .72rem; color: var(--muted); text-align: right; min-width: 52px; }
.mo-plot { flex: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent calc(50% - .5px), #EEF2F6 calc(50% - .5px), #EEF2F6 calc(50% + .5px), transparent calc(50% + .5px)); }
.mo-col { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: default; outline: none; padding-top: 0; }
.mo-col:focus-visible .mo-bars { outline: 2px solid var(--blue); outline-offset: 2px; }
.mo-bars { height: 160px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; }
.mo-bars i { display: block; width: min(14px, 40%); border-radius: 4px 4px 0 0; min-height: 0; }
.mo-col span { font-size: .7rem; color: var(--muted); transform: translateY(18px); }
.mo-col:hover .mo-bars i { filter: brightness(.92); }
.s1 { background: #2a78d6; } .s2 { background: #eb6834; }
.mo-chart { margin-bottom: 28px; }
.mo-tip { position: absolute; top: -6px; width: 220px; background: var(--navy); color: #fff; font-size: .8rem; border-radius: 8px; padding: 6px 10px; pointer-events: none; z-index: 2; }
.mo-table { margin-top: 4px; } .mo-table summary { cursor: pointer; color: var(--blue); min-height: 40px; display: flex; align-items: center; }
.mo-table table { width: 100%; border-collapse: collapse; font-size: .9rem; } .mo-table th, .mo-table td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); } .mo-table th:first-child, .mo-table td:first-child { text-align: left; }
.mo-list { display: flex; flex-direction: column; gap: 6px; }
.mo-row { flex-shrink: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: #fff; overflow-wrap: anywhere; }
.mo-row:hover { border-color: var(--blue); }
.mo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mo-amt { white-space: nowrap; color: var(--navy); }
.section-h .seg-b { border: 0; background: #fff; cursor: pointer; font: 700 .82rem inherit; } .section-h .seg-b.on { background: var(--navy); color: #fff; }
@media (max-width: 420px) { .nav-item { font-size: .64rem; } .nav-item .ni { font-size: 1.15rem; } }
.mo-col span b { font-weight: 400; } .mo-col .ms { display: none; }
@media (max-width: 600px) { .mo-col .ml { display: none; } .mo-col .ms { display: inline; } .mo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mo-tile b { font-size: 1.25rem; } .mo-axis { min-width: 44px; } }
.cust-back { font-weight: 700; color: var(--navy); text-decoration: none; padding: 8px 12px 8px 4px; margin-right: -4px; min-height: 44px; display: inline-flex; align-items: center; font-size: 1.05rem; }
.pe-isearch { margin: 0 0 8px; }
.pe-isearch input { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line, #d5dbe3); border-radius: 10px; }
.pe-itemopt[hidden], .pe-items > details[hidden] { display: none !important; }
.pe-logo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-top: 6px; }
.pe-logo-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 112px; min-height: 76px; padding: 8px; border: 2px solid var(--line, #d5dbe3); border-radius: 10px; background: #fff; cursor: pointer; font-size: .8rem; color: var(--muted, #5b6675); text-align: center; }
.pe-logo-opt img { max-width: 92px; max-height: 44px; object-fit: contain; }
.pe-logo-opt.on { border-color: var(--blue, #2a78d6); box-shadow: 0 0 0 2px rgba(42,120,214,.18); color: var(--navy); font-weight: 700; }
.pe-logo-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pe-logo-lib { display: flex; flex-direction: column; gap: 8px; }
.pe-logo-lib > div { display: flex; align-items: center; gap: 10px; }
.pe-logo-lib img { width: 96px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line, #d5dbe3); border-radius: 8px; flex-shrink: 0; }
.pe-logo-lib input { flex: 1; min-width: 0; }
.bc-val { white-space: nowrap; }
.bc-val.range { font-size: .84rem; }
.bc-dash { margin: 0 2px; font-weight: 600; }
.mo-high { display: block; font-size: .78rem; font-weight: 600; color: var(--muted, #5b6675); text-align: right; }
.pe-cover-details { margin-top: 14px; border: 1px solid var(--line, #d5dbe3); border-radius: 12px; padding: 10px 12px; background: #fff; }
.pe-cover-details > summary { cursor: pointer; padding: 4px 0; min-height: 32px; }
.pe-cover-details[open] > summary { margin-bottom: 8px; }
.pe-cv-ed { font-size: .72rem; font-weight: 700; color: #92400e; background: #FEF3C7; border-radius: 6px; padding: 1px 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue, #2a78d6); font-weight: 600; cursor: pointer; text-decoration: underline; }
.linkish.small { font-size: .78rem; }
.bk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0; }
.bk-row .btn { flex-shrink: 0; }
.bk-row span { flex: 1 1 220px; }
.bk-due { background: #FEF3C7; border-radius: 8px; padding: 6px 10px; color: #92400e; font-weight: 600; }
.bk-progress { margin: 8px 0; font-size: .9rem; }
.bk-bar { height: 8px; background: #E5EAF0; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.bk-bar i { display: block; height: 100%; width: 0; background: var(--blue, #2a78d6); transition: width .2s; }
.bk-restore { margin-top: 10px; }
.bk-restore > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.bk-setup { margin-top: 18px; text-align: center; }
/* ---------- phone home screen ---------- */
@media (min-width: 900px) { .nav-item.phone-only { display: none; } }
.hm { padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 24px; max-width: 640px; margin: 0 auto; }
.hm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 6px; }
.hm-logo { height: 34px; width: auto; display: block; }
.hm-plus { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(15,42,74,.25); }
.hm-hi { font-size: 1.35rem; color: var(--navy); margin: 6px 0 12px; }
.hm-quick { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px 6px; padding: 2px 16px 8px; scroll-snap-type: x proximity; scroll-padding-inline: 8px; scrollbar-width: none; }
.hm-quick::-webkit-scrollbar { display: none; }
.hm-ql { flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 84px; min-height: 76px; padding: 10px 12px; border-radius: 18px; background: var(--card); color: var(--navy); text-decoration: none; font-family: 'Montserrat', system-ui, sans-serif; font-weight: 700; font-size: .82rem; box-shadow: 0 1px 3px rgba(15,42,74,.08); }
.hm-ql span { font-size: 1.5rem; line-height: 1; }
.hm-sec { margin-top: 18px; }
.hm-h { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; text-decoration: none; color: inherit; min-height: 32px; }
.hm-h h2 { margin: 0; font-size: 1.15rem; }
.hm-h .hm-chev { color: var(--blue); font-size: 1.5rem; }
.hm-date { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }
.hm-count { background: #FDE2E1; color: var(--danger); font-weight: 800; font-size: .78rem; border-radius: 99px; padding: 1px 9px; }
.hm-card { background: var(--card); border-radius: 18px; box-shadow: 0 1px 3px rgba(15,42,74,.08); overflow: hidden; }
.hm-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-decoration: none; color: inherit; min-height: 60px; }
.hm-row + .hm-row { border-top: 1px solid var(--line); }
.hm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hm-main b { color: var(--text); font-size: .98rem; overflow-wrap: break-word; }
.hm-sub { color: var(--muted); font-size: .84rem; overflow-wrap: break-word; }
.hm-chev { color: #9AA6B4; font-size: 1.4rem; flex-shrink: 0; }
.hm-time { flex: 0 0 64px; font-weight: 800; color: var(--blue); font-family: 'Montserrat', system-ui, sans-serif; font-size: .9rem; }
.hm-appt.done { opacity: .6; }
.hm-clear { padding: 16px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(135deg, #fff 60%, var(--soft)); }
.hm-clear b { color: var(--navy); font-size: 1.05rem; }
.hm-ico { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--soft); }
.hm-ico.rv { background: #FEF3C7; } .hm-ico.inv, .hm-ico.col { background: #FDE2E1; } .hm-ico.dep { background: #DCFCE7; } .hm-ico.fol { background: var(--soft); }
.hm-more { margin-top: 6px; width: 100%; }
.hm-recent { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hm-recent::-webkit-scrollbar { display: none; }
.hm-job { position: relative; flex: 0 0 82%; max-width: 330px; scroll-snap-align: start; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,42,74,.08); }
.hm-job-a { display: block; text-decoration: none; color: inherit; }
.hm-job-img { display: block; height: 130px; background: linear-gradient(135deg, var(--soft), #C9DDEE); }
.hm-job-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-job-ph { display: grid; place-items: center; height: 100%; font-size: 2.6rem; opacity: .55; }
.hm-job-t { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 14px; }
.hm-job-t b { color: var(--navy); font-size: 1.02rem; }
.hm-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(15,42,74,.75); color: #fff; font-size: .95rem; cursor: pointer; }
.hm-doc-t { overflow: hidden; text-overflow: ellipsis; }
.hm-cust-img { position: relative; display: grid; place-items: center; background: linear-gradient(135deg, #1E4E7E, var(--navy)); }
.hm-initials { color: #fff; font-family: 'Montserrat', system-ui, sans-serif; font-weight: 800; font-size: 2.2rem; letter-spacing: 1px; }
.hm-tag { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.92); color: var(--navy); font-size: .72rem; font-weight: 800; border-radius: 99px; padding: 2px 9px; }
/* pull to refresh (phones) */
.ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 0px); left: 50%; z-index: 60; transform: translate(-50%, -56px); opacity: 0; display: flex; align-items: center; gap: 8px;
  background: #fff; color: var(--navy); border-radius: 99px; padding: 8px 14px 8px 10px; box-shadow: 0 4px 14px rgba(15,42,74,.22); font: 700 .85rem 'Montserrat', system-ui, sans-serif; pointer-events: none; }
.ptr.on, .ptr.spinning { transition: none; }
.ptr:not(.on):not(.spinning) { transition: transform .2s, opacity .2s; }
.ptr-spin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); font-size: 1.05rem; }
.ptr.ready .ptr-spin { background: var(--navy); color: #fff; }
.ptr.spinning .ptr-spin { background: var(--navy); color: #fff; animation: ptr-rot .8s linear infinite; }
@keyframes ptr-rot { to { transform: rotate(360deg); } }
/* security */
.sec-2fa { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between; padding: 12px; border-radius: 12px; background: var(--soft); }
.sec-2fa.on { background: #E7F6EE; }
.sec-2fa > div:first-child { flex: 1 1 260px; }
.sec-2fa p { margin: 4px 0 0; }
.sec-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.ok { background: #DCFCE7; color: var(--ok); }
.sec-h { font-size: .98rem; color: var(--navy); margin: 16px 0 6px; }
.sec-devs, .sec-evs { display: flex; flex-direction: column; }
.sec-dev, .sec-ev { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); }
.sec-dev:first-child, .sec-ev:first-child { border-top: 0; }
.sec-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; }
.sec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow-wrap: break-word; }
.sec-ev.warn .sec-ico { background: #FDE2E1; }
.sec-alert { background: #FDE2E1; color: var(--danger); border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.sec-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.sec-qr { display: flex; justify-content: center; margin: 10px 0; }
.sec-qr svg { border: 1px solid var(--line); border-radius: 8px; }
.sec-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--soft); border-radius: 8px; padding: 6px 10px; }
.sec-key code { font-size: .92rem; letter-spacing: .5px; overflow-wrap: anywhere; flex: 1; }
.sec-code { width: 100%; font-size: 1.5rem !important; letter-spacing: 6px; text-align: center; padding: 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; font-family: 'Montserrat', system-ui, sans-serif; }
.sec-codes { columns: 2; padding-left: 22px; font-size: 1.05rem; }
.sec-codes code { letter-spacing: 1px; }
.sec-done { font-weight: 700; color: var(--ok); }
.bk-setup-pw { max-width: 360px; margin: 8px auto 0; text-align: left; }
.sec-main > .pill { align-self: flex-start; margin: 2px 0; }
/* ---------- phone bottom bar: bigger buttons, swipe sideways for the rest ---------- */
@media (max-width: 899px) {
  .nav { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 8px; scrollbar-width: none;
    padding: 6px 8px calc(6px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; width: 78px; min-height: 64px; gap: 4px; padding: 6px 2px; border-radius: 14px; font-size: .78rem; scroll-snap-align: start; color: var(--muted); }
  .nav-item .ni { font-size: 0; line-height: 0; display: grid; place-items: center; }
  .nav-item .ni svg { width: 26px; height: 26px; display: block; }
  .nav-item[aria-current="page"] { color: var(--navy); background: var(--soft); box-shadow: none; }
  .nav-item[aria-current="page"] .ni svg { stroke-width: 2.4; }
  .nav-item:active { background: var(--bg); }
  /* a soft fade on the side that has more buttons, so it's clear the bar swipes */
  .nav.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .nav.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
  .nav.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
  .nbadge { top: -5px; right: -10px; }
  body.signed-in main#app { padding-bottom: calc(96px + var(--safe-b)); }
}
@media (max-width: 420px) { .nav-item { font-size: .76rem; } }
@media (min-width: 900px) { .nav-item .ni svg { width: 22px; height: 22px; display: block; } .nav-item .ni { display: inline-grid; place-items: center; } }
.hm-ql span { display: grid; place-items: center; color: var(--blue); }
.hm-ql span svg { width: 28px; height: 28px; }
/* in-app PDF viewer (phones) */
.pdfv { position: fixed; inset: 0; z-index: 70; background: #5B6778; display: flex; flex-direction: column; }
.pdfv-bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; background: var(--navy); color: #fff; }
.pdfv-t { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.pdfv-btn { min-height: 44px; min-width: 44px; padding: 8px 12px; border-radius: 10px; border: 0; background: rgba(255,255,255,.14); color: #fff; font: 700 .95rem 'Montserrat', system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.pdfv-btn.primary { background: #fff; color: var(--navy); }
.pdfv-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0px)); }
.pdfv-doc { display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin: 0 auto; }
.pdfv-doc .pv-sheet { width: 100%; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.pdfv-doc .pp-pdf-loading { color: #fff; text-align: center; }
.pr-row { display: flex; align-items: center; gap: 8px; padding-right: 10px; flex-wrap: wrap; }
/* the title keeps a readable width; on a phone the PDF / Follow up buttons drop under it instead of squeezing it */
.pr-row .pr-row-main { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.pr-row .pr-pdf { flex-shrink: 0; }
.bk-auto { margin: 12px 0 4px; padding: 12px; border-radius: 12px; background: var(--soft); }
.bk-auto-h { display: flex; align-items: center; gap: 8px; }
.bk-auto p { margin: 6px 0; }

/* no signal bar + waiting-to-upload badge */
.off-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b, 0px)); z-index: 65; display: flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; background: #1f2937; color: #fff; border-radius: 99px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.off-bar:not(:has(button)) { padding-right: 12px; }
body.has-off-bar .toast { bottom: calc(146px + var(--safe-b, 0px)); }
@media (min-width: 900px) { .off-bar { bottom: 16px; left: calc(50% + 110px); } body.has-off-bar .toast { bottom: 70px; } }
.off-bar.off { background: #7c2d12; }
.off-bar.bad { outline: 2px solid #fca5a5; }
.off-bar button { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 99px; padding: 6px 10px; font: inherit; min-height: 32px; cursor: pointer; }
.wt-list { display: grid; gap: 6px; margin: 10px 0; }
.wt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.wt-row > span { display: grid; gap: 2px; }
.wt-row.bad { border-color: #fca5a5; background: #fef2f2; }
/* problems list (Settings) */
.prob-list { display: grid; gap: 6px; margin: 8px 0; color: var(--text); }
.prob { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; }
.prob summary { cursor: pointer; display: grid; gap: 2px; list-style: none; }
.prob summary b { word-break: break-word; }
.prob-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #b45309; }
.prob-pre { white-space: pre-wrap; word-break: break-word; font-size: 11px; background: #f3f4f6; padding: 8px; border-radius: 8px; max-height: 220px; overflow: auto; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-on { color: var(--ok); margin: 0 0 8px; }

/* expenses & profit */
.exp-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.exp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.exp-sum > div { background: #F2F5F9; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.exp-sum b { font-size: 1.15rem; color: var(--navy); white-space: nowrap; }
.exp-sum .mo-k { white-space: nowrap; }
.exp-profit b { color: var(--ok) !important; } .exp-profit.neg b { color: var(--danger) !important; }
.exp-profit .small { color: var(--muted, #5B6778); }
.neg-text { color: var(--danger); }
.exp-list { display: grid; gap: 6px; }
.exp-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid #E3E8EF; border-radius: 12px; padding: 8px 12px; min-height: 56px; cursor: pointer; font: inherit; color: inherit; }
.exp-row:hover { border-color: #b9c6d6; }
.exp-ic { width: 44px; height: 44px; border-radius: 8px; background: #F2F5F9; display: grid; place-items: center; font-size: 1.4rem; flex: none; overflow: hidden; }
.exp-ic img { width: 100%; height: 100%; object-fit: cover; }
.exp-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.exp-main b, .exp-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-amt { white-space: nowrap; color: var(--navy); }
.exp-photo { display: block; width: 100%; padding: 0; border: 0; background: #F2F5F9; border-radius: 12px; overflow: hidden; margin-bottom: 10px; cursor: zoom-in; }
.exp-photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.exp-status { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #EEF5FB; color: var(--navy); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.exp-status.ok { background: #E9F7EF; color: #17663d; } .exp-status.warn { background: #FFF6E5; color: #8a5300; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.exp-view { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 16px; }
.exp-view img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.exp-view button { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: #fff; }
.exp-h3 { margin: 18px 0 8px; font-size: 1rem; }
.exp-cats { display: grid; gap: 8px; }
.exp-cat { display: grid; grid-template-columns: minmax(120px, 210px) 1fr auto; align-items: center; gap: 10px; font-size: .92rem; }
.exp-cat i { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 60%, #fff)); display: block; }
.exp-cat b { white-space: nowrap; }
@media (max-width: 700px) {
  .exp-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .exp-sum .mo-k { white-space: normal; }
  .exp-cat { grid-template-columns: 1fr auto; } .exp-cat i { grid-column: 1 / -1; grid-row: 2; }
}
.exp-card .section-h, #mo-overhead .section-h { flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .exp-btns { width: 100%; } .exp-btns > * { flex: 1 1 0; justify-content: center; text-align: center; }
}
/* monthly bills */
.exp-switch { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #E3E8EF; border-radius: 12px; margin: 4px 0 12px; cursor: pointer; min-height: 56px; }
.exp-switch > span:last-child { display: grid; gap: 2px; }
.exp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.exp-switch .sw { flex: none; width: 50px; height: 30px; border-radius: 99px; background: #CBD5E1; position: relative; transition: background .2s; }
.exp-switch .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.exp-switch input:checked + .sw { background: var(--ok); } .exp-switch input:checked + .sw::after { transform: translateX(20px); }
.exp-switch input:focus-visible + .sw { outline: 3px solid var(--blue); outline-offset: 2px; }
.exp-hint { margin: -4px 0 10px; }
.exp-bills { margin-bottom: 14px; padding: 12px; background: #F7F9FC; border-radius: 12px; border: 1px solid #E3E8EF; }
.exp-bills-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .exp-bills-h .btn { margin-left: auto; }
.exp-row.off { opacity: .55; }
.warn-text { color: #8a5300; font-weight: 700; }
.exp-amt .small { font-weight: 600; }
.theme-seg { display: flex; width: 100%; max-width: 480px; } .theme-seg .seg-b { flex: 1; min-height: 44px; border: 0; background: var(--card); color: var(--navy); font: 700 .9rem 'Montserrat', sans-serif; cursor: pointer; }
.theme-seg .seg-b.on { background: var(--navy); color: #fff; }

/* ---------- Settings: home page of tiles + sub-pages ---------- */
.set-hub { display: grid; gap: 18px; }
.set-gh { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 2px; }
.set-tiles { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .set-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .set-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.set-tile { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; min-height: 72px; background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15,42,74,.08); text-decoration: none; color: var(--text); border: 2px solid transparent; }
.set-tile:hover, .set-tile:focus-visible { border-color: var(--blue); }
.set-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.45rem; border-radius: 12px; background: var(--soft); }
.set-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-tx b { font-size: 1rem; color: var(--navy); }
.set-chev { flex: none; font-size: 1.6rem; color: var(--muted); }
.set-intro { margin: 0 0 14px; max-width: 70ch; }
.set-save { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.set-save .btn.pulse, .btn.pulse { box-shadow: 0 0 0 4px rgba(43,125,179,.25); }

/* list editor: rename, move up/down, symbol, show */
.ed-list { display: grid; gap: 6px; }
.ed-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ed-row.off .ed-name input, .ed-row.off .ed-name b { opacity: .5; }
.ed-move { display: flex; gap: 2px; }
.ed-move .icon-btn { width: 40px; height: 40px; min-height: 40px; font-size: .75rem; padding: 0; border-radius: 8px; background: var(--soft); }
.ed-move .icon-btn:disabled { opacity: .25; }
.ed-sym { width: 44px; height: 44px; border-radius: 10px; border: 1px dashed var(--line); background: var(--soft); font-size: 1.35rem; cursor: pointer; display: grid; place-items: center; }
.ed-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-name input { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
.switch-sm { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); min-height: 40px; }
.switch-sm input { width: 20px; height: 20px; }
.ed-row > .icon-btn.danger-text { font-size: 1rem; }
.ed-h3 { font-size: .9rem; margin: 14px 0 6px; color: var(--muted); }
.ed-labels { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .ed-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin: 4px 0 12px; max-height: 46vh; overflow: auto; }
.sym { height: 46px; font-size: 1.5rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.sym.on { border: 2px solid var(--blue); background: var(--soft); }
.ni-emoji { font-size: 1.3rem; line-height: 1; display: inline-block; }

/* job page sections in your order */
.col-main.ordered { display: flex; flex-direction: column; }
.col-main.ordered > * { flex: none; }

/* tokens */
.tok-list { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .tok-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tok { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "code what" "code eg"; column-gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.tok:hover, .tok:focus-visible { border-color: var(--blue); }
.tok code { grid-area: code; font-size: .9rem; color: var(--navy); background: var(--soft); padding: 4px 8px; border-radius: 6px; }
.tok-what { grid-area: what; font-weight: 600; font-size: .92rem; }
.tok-eg { grid-area: eg; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-own { display: grid; gap: 10px; }
.tok-row { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr); padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
@media (min-width: 760px) { .tok-row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } .tok-acts { grid-column: 1 / -1; } }
.tok-key { display: flex; align-items: center; gap: 2px; font-family: ui-monospace, Menlo, monospace; }
.tok-key input { flex: 1; min-width: 0; font-family: inherit; }
.tok-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tok-insert { display: flex; justify-content: flex-end; margin: 4px 0 0; }
.tok-insert select { max-width: 100%; min-height: 40px; font-size: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); color: var(--navy); padding: 4px 8px; }
@media (max-width: 600px) {
  .ed-move { flex-direction: column; }
  .switch-sm { min-width: 40px; justify-content: center; }
  .switch-sm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .switch-sm input { width: 24px; height: 24px; }
}

/* ---------- job costing: estimate panel, settings, job card, accuracy ---------- */
.pe-mat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 10px; background: var(--soft); }
.pe-mat label:first-child { grid-column: 1 / -1; }
.pe-mat label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); font-weight: 600; gap: 2px; min-width: 0; }
.pe-jc { margin-top: 16px; border: 2px dashed var(--line); border-radius: 14px; padding: 12px; }
.pe-jc-h, .pe-jc-sh, .jc-sh, .jcs-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pe-jc-h h3, .jc-sh h3 { margin: 0; flex: 1 1 auto; }
.pe-jc-sh { justify-content: space-between; margin: 4px 0; }
.pe-jc-set { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.pe-jc-set label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); font-weight: 600; gap: 2px; min-width: 0; }
.pe-jc-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.pe-jc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 44px; }
.pe-jc-row > span:first-child, .pe-jc-row .check > span { display: flex; flex-direction: column; min-width: 0; }
.pe-jc-row.off { opacity: .6; }
.pe-jc-row.small { font-size: .9rem; }
.pe-jc-qty { font-weight: 700; color: var(--navy); white-space: nowrap; }
.pe-jc-amt { white-space: nowrap; text-align: right; min-width: 80px; }
.pe-jc-num { width: 90px; margin-top: 0; }
.pe-jc-other { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 6px; align-items: center; margin: 6px 0; }
.pe-jc-other input, .pe-jc-other select { margin-top: 0; }
.pe-jc-other input:first-child { grid-column: 1 / -1; }
.pe-jc-other + .pe-jc-other { border-top: 1px solid var(--line); padding-top: 6px; }
.pe-jc-refrow { grid-template-columns: minmax(0, 1fr) 90px auto; }
.pe-jc-refrow .pe-jc-amt { white-space: nowrap; text-align: right; }
.pe-jc-lines summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--blue); font-weight: 600; }
.pe-jc-tot { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.pe-jc-tot > div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pe-jc-tot .pos b, .jc-cmp .pos, .jc-acc-p.pos { color: var(--ok); }
.pe-jc-tot .neg b, .jc-cmp .neg, .jc-acc-p.neg, .jc-row .neg { color: var(--danger); }
.jcs-card .jcs-h h2 { margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.jcs-h { margin-bottom: 8px; }
.jcs-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.jcs-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; }
.jcs-money { display: flex; align-items: center; gap: 6px; }
.jcs-money > span { margin-top: 5px; color: var(--muted); }
.jcs-chart { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.jcs-ch-h, .jcs-ch-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) 44px; gap: 6px; align-items: center; }
.jcs-ch-h { font-size: .8rem; color: var(--muted); }
.jcs-ch-r input { margin-top: 0; }
.jc-areas summary, .jc-est summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--blue); }
.jcs-prep, .jcs-kit { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.jcs-del { display: flex; align-items: flex-end; }
.jcs-checks { display: flex; flex-wrap: wrap; gap: 0 16px; font-weight: 400; }
.jcs-addkit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.jcs-addkit .field { flex: 1 1 200px; margin-bottom: 0; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jc-card h3 { font-size: 1rem; }
.jc-sh { justify-content: space-between; margin: 14px 0 6px; }
.jc-load { display: flex; flex-direction: column; gap: 6px; }
.jc-ck { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.jc-ck input { width: 24px; height: 24px; min-height: 0; margin: 0; }
.jc-ck-q { color: var(--navy); white-space: nowrap; font-size: 1.05rem; }
.jc-ck.done { background: var(--soft); }
.jc-ck.done .jc-ck-n, .jc-ck.done .jc-ck-q { text-decoration: line-through; color: var(--muted); }
.jc-area, .jc-row, .jc-used > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 36px; padding: 2px 0; }
.jc-area > span, .jc-row > span { display: flex; flex-direction: column; min-width: 0; }
.jc-used-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.jc-tot { font-weight: 700; border-top: 1px solid var(--line); }
.jc-cmp { display: flex; flex-direction: column; }
.jc-cmp-h, .jc-cmp-r { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px 0; align-items: center; }
.jc-cmp-h { font-size: .8rem; color: var(--muted); font-weight: 600; }
.jc-cmp-r > span:not(:first-child), .jc-cmp-h > span:not(:first-child) { text-align: right; }
.jc-cmp-r { border-top: 1px solid var(--line); }
.jc-mc { margin-top: 8px; }
.jc-h3 { font-size: 1rem; margin: 12px 0 6px; }
.jc-acc { display: flex; flex-direction: column; gap: 8px; }
.jc-acc-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.jc-acc-r .btn { grid-column: 1 / -1; justify-self: start; }
.jc-acc-p { font-weight: 700; font-size: 1.1rem; }
@media (max-width: 600px) {
  .jcs-three, .jcs-four { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .jcs-three > :first-child { grid-column: 1 / -1; }
  .row-3 { grid-template-columns: 1fr; }
  .pe-jc-num { width: 72px; }
  .pe-jc-amt { min-width: 70px; }
  .jc-used-form { grid-template-columns: 1fr; }
}

/* ---------- roles & access; crew collects payment ---------- */
.acc-tabs { margin: 0 0 12px; }
.acc-g { font-size: .95rem; margin: 16px 0 4px; color: var(--muted); }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.acc-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-changed { align-self: flex-start; margin-top: 2px; }
.acc-owner { margin-top: 14px; }
.acc-prow { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.acc-prow select { margin-top: 2px; }
.acc-prow.changed select { border-color: var(--blue); font-weight: 600; }
.collect-flag { margin-top: 8px; padding: 6px 10px; border-radius: 12px; background: var(--soft); }
.collect-flag > span { display: flex; flex-direction: column; }
.collect-card { border: 2px solid #E3A008; }
.collect-due { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #FFF7E0; color: #7A4F00; }
.collect-due b { font-size: 1.6rem; font-family: 'Montserrat', sans-serif; }
.collect-due.paid { background: #EAF7EF; color: var(--ok); }
.collect-paid { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.collect-paid > div { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); }
.collect-form { margin-top: 12px; }
.collect-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.collect-photo { position: relative; display: flex; margin-top: 6px; }
.collect-go { width: 100%; }
.hm-collect { color: #7A4F00; font-weight: 700; }

/* ---------- address suggestions ---------- */
.addr-wrap { position: relative; }
.addr-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 42, 74, .18); overflow: hidden; font-weight: 400; }
.addr-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.addr-opt:hover, .addr-opt.on { background: var(--soft); }
.addr-by { padding: 4px 12px 6px; text-align: right; font-size: .75rem; }

/* ---------- estimate builder: undo / redo on phones ---------- */
.pe-undo-float { position: fixed; right: 12px; bottom: calc(150px + var(--safe-b)); z-index: 55; display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(15, 42, 74, .22); }
.pe-undo-float[hidden] { display: none; }
.pe-undo-float .btn { border-radius: 99px; min-height: 44px; }
.forgot-btn { width: 100%; margin-top: 8px; }
.forgot-sent { padding: 12px 14px; border-radius: 12px; background: var(--soft); margin-bottom: 10px; }
.forgot-sent p { margin: 6px 0 0; }

/* ---------- password eye ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(calc(-50% + 2.5px)); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 10px; padding: 0; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--blue); }
.pe-mat-why { grid-column: 1 / -1; font-size: .82rem; font-weight: 600; color: var(--muted); }
.pe-mat-why.ok { color: var(--ok); }
.pe-mat-why.warn { color: #9A5B00; }
.pe-jc-unread { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: #FFF7E0; color: #5C4300; font-size: .9rem; }
.pe-jc-unread > div { margin-top: 4px; }

/* ---------- job cover photo; calendar materials; estimate preview on the job ---------- */
.job-cover { position: relative; margin: -4px -4px 12px; border-radius: 12px; overflow: hidden; background: var(--soft); aspect-ratio: 16 / 9; max-height: 260px; }
.job-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-cover-btn { position: absolute; right: 8px; bottom: 8px; background: rgba(15, 42, 74, .78); color: #fff; border: 0; }
.job-cover-add { margin-bottom: 10px; }
.cover-up { position: relative; display: flex; width: 100%; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cover-opt { padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--soft); cursor: pointer; min-height: 44px; }
.cover-opt.on { border-color: var(--blue); }
.cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-needs { margin-bottom: 12px; }
.cal-needs-d summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-needs-m { margin: 6px 0; }
.cal-needs-j { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.cal-needs-j a { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.jc-prev { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.jc-prev h3 { font-size: 1rem; margin: 0 0 4px; }
.jc-prev-unread { font-size: .88rem; color: #5C4300; background: #FFF7E0; border-radius: 10px; padding: 6px 10px; }
.jc-prev-tot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--soft); }
.jc-prev-tot > div { display: flex; flex-direction: column; }
.jc-prev-tot span { font-size: .8rem; color: var(--muted); }
.jc-prev-tot .pos b { color: var(--ok); } .jc-prev-tot .neg b { color: var(--danger); }

/* ---------- estimate: line item material/task line, page tabs, labor rows ---------- */
.pe-mat-d { border-radius: 10px; background: var(--soft); }
.pe-mat-d > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: .88rem; font-weight: 600; color: var(--navy); flex-wrap: wrap; }
.pe-mat-d.warn > summary { color: #9A5B00; }
.pe-mat-d[open] > summary { border-bottom: 1px solid var(--line); }
.pe-lab { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.pe-lab-h { font-size: .88rem; color: var(--navy); overflow-wrap: break-word; }
.pe-lab-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: end; }
.pe-mat .pe-lab-row label:first-child { grid-column: auto; }
.pe-lab > .btn { align-self: flex-start; }
@media (min-width: 700px) { .pe-lab-row { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) auto; } }
.pe-mat-d .pe-mat { background: transparent; }
.pe-tabs { margin: 4px 0 12px; }
.pe-jc-crew { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.pe-jc-crew:first-of-type { border-top: 0; }
.pe-jc-crew.off { opacity: .6; }
.pe-jc-crew > .check { flex: 1 1 260px; min-width: 0; }
.pe-jc-crew > .check > span { display: flex; flex-direction: column; min-width: 0; }
.pe-jc-crew-r { display: flex; align-items: flex-end; gap: 6px; margin-left: auto; }
.pe-jc-mini { display: flex; flex-direction: column; font-size: .75rem; color: var(--muted); font-weight: 600; }
.pe-jc-mini input { margin-top: 2px; }
.pe-jc-num.manual { border-color: var(--blue); font-weight: 700; }
.jcs-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; margin-top: 6px; font-weight: 400; }

/* ---------- pay by person, footage on the day, payroll ---------- */
.jc-paybox, .jc-foot { margin-top: 10px; }
.jc-paybox > summary, .jc-foot > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); }
.jc-pay { display: flex; flex-direction: column; }
.jc-pay-r { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.jc-pay-r > span:first-child { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.jc-pay-amt { margin-left: auto; white-space: nowrap; }
.jc-pay-in { display: flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); }
.jc-pay-in input { width: 110px; margin-top: 0; }
.jc-foot-r { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.jc-foot-r > span { display: flex; flex-direction: column; min-width: 0; }
.jc-foot-r input { margin-top: 0; }
.pill.warn { background: #FFF1D6; color: #8A5300; }
.pe-jc-set { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { .pe-jc-set { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pe-jc-days { margin-top: -4px; }
.hm-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: #FFF7E0; color: #5C4300; text-decoration: none; border: 1px solid #F2D58A; }
.hm-pay > span:not(.hm-chev) { flex: 1 1 100%; font-weight: 600; }
.hm-pay.paid { background: #EAF7EF; color: var(--ok); border-color: #BFE3CC; }
.mo-payroll { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-decoration: none; color: var(--text); min-height: 56px; }
.mo-payroll > .muted { flex: 1 1 260px; }
.pr-week { display: flex; align-items: center; gap: 10px; }
.pr-week > div { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pr-paid { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #EAF7EF; color: var(--ok); font-weight: 600; }
.pr-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pr-check { display: flex; flex-direction: column; padding: 12px; border-radius: 12px; background: var(--soft); }
.pr-check b { font-size: 1.4rem; font-family: 'Montserrat', sans-serif; }
.pr-total { display: flex; justify-content: space-between; margin: 12px 0; font-weight: 700; }
.pr-pay { width: 100%; }
.pr-job { border-top: 1px solid var(--line); padding: 10px 0; }
.pr-job > a { display: block; min-height: 32px; text-decoration: none; color: var(--navy); }
.pr-person { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.pr-person > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pr-in { display: flex; align-items: center; gap: 4px; }
.pr-in input { width: 120px; margin-top: 0; }
.pr-week > .btn { min-width: 44px; justify-content: center; }
.jc-days { padding: 10px 12px; border-radius: 12px; background: var(--soft); margin-bottom: 6px; }

/* board: profit on the card (owner) */
.bc-profit { font-size: .8rem; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-profit.est { color: var(--muted); }
.bc-profit.act { color: var(--ok); }
.bc-profit.neg { color: var(--danger, #c0392b); }
.jc-days { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.jc-days .jc-days-why { flex-basis: 100%; }
.jc-pd { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 6px; }
.jc-pd label { display: flex; flex-direction: column; font-size: .85rem; gap: 2px; }
.jc-pd input { width: 7rem; }
/* installs that take more than a day: pick every day */
.idays { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; display: grid; gap: 8px; }
.idays-h { margin: 0; }
.idays-r { display: flex; align-items: flex-end; gap: 8px; }
.idays-r label { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; font-weight: 600; flex: 1; max-width: 16rem; }
.idays [data-iday-add] { justify-self: start; }
/* crew: their own pay */
.jc-mypay { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; background: #E8F5EE; color: inherit; text-decoration: none; margin: 8px 0; }
.jc-mypay .muted { grid-column: 1 / -1; }
.jc-mypay-amt { color: var(--ok); font-size: 1.05rem; }
.mp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mp-h h2 { margin: 0; }
.mp-tot { font-size: 1.2rem; color: var(--ok); }
.mp-now { border: 2px solid var(--blue); }
a.mp-job { color: inherit; text-decoration: none; }
.mp-note { margin: 8px 4px 24px; }
.team-paid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; margin-top: 6px; }
.team-paid select { min-height: 36px; max-width: 12rem; }
.mp-tot { white-space: nowrap; }
.mp-h h2 { min-width: 0; }
/* estimate builder: the lowest price per unit that still makes the line profit (Settings) */
.pe-sug { display: block; color: var(--danger); font-size: .78rem; font-weight: 600; margin-top: 3px; line-height: 1.2; }
.pe-sug .pe-sug-why { color: var(--muted); font-weight: 500; overflow-wrap: break-word; }
.pe-sug.low { font-weight: 800; }
.pe-sug.low::before { content: '⚠ '; }
/* sign-in: locked out; Security: ways back in */
.locked-ways { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 12px; font-size: .92rem; }
.sec-ways { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.sec-ways ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; font-size: .9rem; }
.sec-ways li.warn { color: var(--danger); }
/* crew work order (no prices) */
.wo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wo-head h2 { margin: 0 0 4px; }
.wo h3 { margin: 16px 0 6px; font-size: 1rem; }
.wo-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wo-line p { margin: 4px 0 0; }
.wo-qty, .wo-line > b { white-space: nowrap; }
.wo-days { margin-top: 12px; }
.wo-opt + .wo-opt { border-top: 2px solid var(--line); margin-top: 14px; }
@media print { #nav, .topbar, .wo-print { display: none !important; } .wo { box-shadow: none; border: 0; } body { background: #fff; } }
/* deleted jobs / customers */
.src-col { display: block; font-weight: 400; }
.src-total { border-top: 2px solid var(--line); }
.co-row { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.mo-amt.neg, .co-total .neg, .co-amt.neg { color: #B42318; }
.co-total { font-size: 1.05rem; margin: 10px 0; }
.co-erow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.co-erow-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.co-erow-top .field { flex: 1; margin: 0; }
.co-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.co-sig { display: block; max-width: 260px; max-height: 90px; margin: 8px 0; }
.co-h { font-size: 1.3rem; margin: 0 0 4px; }
.co-lines { margin: 14px 0; }
.co-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.co-line.rm b:first-child { color: #B42318; }
.co-amt { white-space: nowrap; }
.co-note { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.co-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 14px 0 0; }
.co-sum dd { margin: 0; text-align: right; white-space: nowrap; }
.co-sum .co-new { font-weight: 700; font-size: 1.1rem; }
.dm-wrap { display: grid; gap: 14px; }
.dm-map { height: 58vh; min-height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); z-index: 0; }
@media (min-width: 900px) { .dm-wrap { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; } .dm-map { height: calc(100vh - 210px); } }
.dm-list { display: grid; gap: 8px; }
.dm-stop { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dm-body { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: break-word; }
.dm-body a { color: inherit; text-decoration: none; }
.dm-n { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.dm-n.off { background: var(--muted); }
.dm-go { flex: none; }
.dm-pin span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.cal-map { white-space: nowrap; }
.qb-presets { margin: 0 0 14px; }
.test-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: 12px; background: #FFF7E0; border: 1px solid #F0D28A; margin: 0 0 12px; }
.test-switch { margin-top: 10px; }
.bc-test { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: #FFF1C2; color: #7A5600; }
.del-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: 12px; background: #FEF3F2; border: 1px solid #F1C3BF; margin: 0 0 12px; }
.trash-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trash-row > span:first-child { display: grid; }
.trash-act { display: flex; gap: 6px; flex-wrap: wrap; }
/* labor marked paid on the job page */
.jc-lp-btn { width: 100%; margin-top: 8px; }
.jc-lp { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #E8F5EE; }
.jc-lp ul { margin: 6px 0; padding-left: 18px; }
.lp-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lp-row > div { display: flex; justify-content: space-between; gap: 10px; }
.lp-row select { width: 100%; }
.mb-tap { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.jc-used-note { display: grid !important; gap: 2px; }
.jc-note-f { grid-column: 1 / -1; }
.stock-row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.stock-row > span:first-child { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* "View as" preview (owner): purple frame + a pill with Exit (above the phone's menu bar; bottom-center on PC) */
body.previewing::after { content: ''; position: fixed; inset: 0; border: 4px solid #7c3aed; pointer-events: none; z-index: 64; }
.pv-bar { position: fixed; left: 12px; right: 12px; bottom: calc(92px + var(--safe-b, 0px)); z-index: 66; display: flex; gap: 10px; align-items: center; background: #6d28d9; color: #fff; padding: 8px 8px 8px 14px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; line-height: 1.3; }
.pv-bar > span { flex: 1; min-width: 0; }
.pv-bar b { font-weight: 700; } .pv-bar .btn { flex: none; background: #fff; color: #4c1d95; border: 0; white-space: nowrap; }
.pv-bar[hidden] { display: none; }
@media (max-width: 420px) { .pv-bar .pv-note { display: none; } }
@media (min-width: 900px) { .pv-bar { left: calc(50% + 110px); right: auto; transform: translateX(-50%); bottom: 16px; width: max-content; max-width: min(900px, calc(100vw - 280px)); border-radius: 99px; } }
body.previewing .toast { bottom: calc(160px + var(--safe-b, 0px)); }
@media (min-width: 900px) { body.previewing .toast { bottom: 76px; } }
body.previewing .off-bar { bottom: calc(146px + var(--safe-b, 0px)); }
@media (min-width: 900px) { body.previewing .off-bar { bottom: 70px; } }
.pv-card h2 { margin-top: 0; } .pv-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .pv-row .field { flex: 1; min-width: 200px; margin: 0; } .pv-people { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; } .check-row input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.tc-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line, #e5e7eb); } .tc-row > b { min-width: 150px; }
.tc-chips { display: flex; gap: 8px; flex-wrap: wrap; } .tc-chip { border: 1.5px solid var(--line, #d0d7e2); background: #fff; color: inherit; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; }
.tc-chip.on { background: #e8f3ec; border-color: #1E7F4F; color: #14532d; } .tc-warn { font-size: 11px; font-weight: 700; color: #B42318; margin-left: 4px; }
.jc-crew { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; } .jc-crew h3 { margin: 0 0 4px; font-size: 16px; } .jc-crew .tc-row > b { min-width: 130px; } .jc-crew .tc-row:first-of-type { border-top: 0; }
.pe-jc-tc { margin: 4px 0 10px; } .pe-jc-tc .tc-row > b { min-width: 120px; font-size: 14px; }
/* ---------- Employees (Settings) ---------- */
.emp-av { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; background: var(--soft); color: var(--blue); font-weight: 800; width: 44px; height: 44px; font-size: 15px; }
.emp-av.lg { width: 60px; height: 60px; font-size: 20px; } .emp-av.xl { width: 96px; height: 96px; font-size: 32px; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.emp-card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px rgba(15, 42, 74, .08); display: flex; flex-direction: column; gap: 10px; }
.emp-card.off { opacity: .65; }
.emp-top { display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.emp-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .emp-who b { font-size: 17px; }
.emp-pos { display: flex; gap: 5px; flex-wrap: wrap; }
.emp-facts { display: flex; flex-direction: column; gap: 4px; overflow-wrap: break-word; } .emp-facts a { color: var(--blue); text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.emp-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.emp-act .nbadge.in, .msg-thread .nbadge.in { position: static; display: inline-flex; align-items: center; justify-content: center; }
.emp-gone { margin-top: 16px; } .emp-gone summary { cursor: pointer; font-weight: 700; padding: 10px 0; min-height: 44px; }
.emp-photo { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; } .emp-photo > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.emp-photo-btn { cursor: pointer; }
.emp-pos-pick, .emp-links { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; margin: 10px 0; } .emp-pos-pick legend, .emp-links legend { font-weight: 700; padding: 0 4px; }
.emp-pos-pick .check span { display: flex; flex-direction: column; }
.emp-pl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.emp-del { margin-top: 14px; }
/* ---------- Messages ---------- */
.msg-list { padding: 4px 0; }
.msg-thread { display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 64px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.msg-thread:first-child { border-top: 0; } .msg-thread.new b { color: var(--navy); } .msg-thread.new .msg-last { color: var(--text); font-weight: 600; }
.msg-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .msg-tn { display: flex; justify-content: space-between; gap: 8px; }
.msg-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-wrap { display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
.msg-who { display: flex; gap: 12px; align-items: center; padding: 8px 4px 12px; } .msg-who > span:not(.emp-av) { flex: 1; display: flex; flex-direction: column; }
.msg-scroll { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 16px; min-height: 40vh; }
.msg-empty { text-align: center; padding: 30px 10px; } .msg-more { align-self: center; }
.msg { display: flex; flex-direction: column; max-width: 82%; } .msg.me { align-self: flex-end; align-items: flex-end; } .msg.them { align-self: flex-start; }
.msg-b { padding: 10px 13px; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(15, 42, 74, .08); overflow-wrap: anywhere; }
.msg.me .msg-b { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; } .msg.them .msg-b { border-bottom-left-radius: 6px; }
.msg.me .msg-b a { color: #fff; } .msg-b p { margin: 0; line-height: 1.4; } .msg-b p + .msg-atts { margin-top: 8px; }
.msg-meta { margin: 3px 6px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; } .msg-x { font-size: 12px; margin-left: 4px; min-height: 40px; min-width: 40px; padding: 0 4px; }
.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-ph img { display: block; width: 140px; height: 140px; object-fit: cover; border-radius: 12px; }
.msg-doc, .msg-job { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(15, 42, 74, .06); color: inherit; text-decoration: none; min-height: 44px; justify-content: center; }
.msg.me .msg-doc, .msg.me .msg-job { background: rgba(255, 255, 255, .18); } .msg.me .msg-job .muted { color: rgba(255, 255, 255, .85); }
.msg-compose { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 calc(8px + var(--safe-b)); z-index: 5; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; } .msg-row textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; border-radius: 22px; padding: 11px 16px; font: inherit; border: 1.5px solid var(--line); background: #fff; color: inherit; }
.msg-att { flex: none; width: 44px; height: 44px; font-size: 20px; } .msg-send { flex: none; width: auto; min-height: 44px; border-radius: 22px; }
.msg-row textarea { margin-top: 0; min-width: 0; width: auto; }
.msg-pend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; } .msg-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 4px 4px 12px; font-size: 14px; }
.msg-pop-m { padding: 10px 12px; background: var(--soft); border-radius: 12px; margin-bottom: 10px; } .msg-pop-m p { margin: 4px 0 0; }
.att-big { width: 100%; min-height: 52px; margin-bottom: 12px; }
.att-job { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); } .att-job > div:first-child { display: flex; flex-direction: column; }
.att-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 10px 0; }
.att-f { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px; border: 2px solid transparent; border-radius: 12px; background: #fff; font: inherit; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.att-f img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; } .att-f.on { border-color: var(--blue); background: var(--soft); } .att-doc { font-size: 40px; line-height: 1.6; }
@media (max-width: 899px) { body.signed-in .msg-compose { bottom: calc(68px + var(--safe-b)); padding-bottom: 8px; } }
/* ---------- Company (Settings) + your logo in words when there's no logo ---------- */
.brand-word { display: inline-block; font-weight: 800; font-size: 1.35rem; line-height: 1.15; color: var(--navy); letter-spacing: -.01em; overflow-wrap: anywhere; }
.nav-brand .brand-word { font-size: 1.1rem; padding: 4px 0; } .hm-logo.brand-word { font-size: 1.3rem; height: auto; } .auth-logo.brand-word { font-size: 1.8rem; margin: 0 auto 10px; text-align: center; display: block; }
.cust-logo.brand-word { color: #fff; font-size: 1.1rem; } .inv-logo.brand-word, .pp-logo-l.brand-word { font-size: 1.6rem; height: auto; }
.row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.co-logo { min-height: 70px; display: flex; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; } .co-logo img { max-width: 260px; max-height: 90px; }
.co-color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .co-color input[type=color] { width: 64px; height: 44px; padding: 2px; margin: 0; }
.co-inline { display: flex; align-items: center; gap: 8px; } .co-inline input { width: 110px; margin: 0; }
.sr-list { display: flex; flex-direction: column; } .sr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sr-row > span { font-weight: 700; } .sr-row select { width: auto; min-width: 190px; margin: 0; }
.jcs-kind { padding: 10px 0; border-top: 1px solid var(--line); }
/* first-time setup: pick your trade */
.auth.auth-setup { max-width: 640px; }
.trade-pick { border: 0; padding: 0; margin: 12px 0; } .trade-pick legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr)); grid-auto-rows: 1fr; gap: 10px 8px; margin-top: 10px; } /* all the same size; wide enough for 2 lines */
@media (max-width: 600px) { .trade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trade-opt > span { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 10px 8px; font-size: .88rem; } .trade-name { flex: none; } }
.trade-opt { display: block; cursor: pointer; position: relative; height: 100%; } .trade-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.trade-opt > span { display: flex; align-items: center; gap: 8px; height: 100%; min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; font-size: .95rem; }
.trade-opt input:checked + span { border-color: var(--blue); background: var(--soft); color: var(--navy); } .trade-opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.trade-ic { font-size: 1.3rem; flex: none; }
.trade-name { flex: 1 1 auto; min-width: 0; overflow-wrap: normal; } /* whole words only - a name never breaks mid-word */
.trade-yours { position: absolute; top: -9px; right: 10px; padding: 1px 8px; border-radius: 99px; background: var(--blue); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.5; }
.req { color: var(--danger); font-weight: 800; }
.card-cf { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0; color: var(--muted); }
.set-row { padding: 10px 0; border-top: 1px solid var(--line); } .set-row:first-of-type { border-top: 0; }
.cf-flags { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.job-chk { margin: 10px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; } .job-chk summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.cust-exp { color: var(--muted); font-size: .9em; }

/* Settings → Company: color scheme picker */
.sc-pick { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.sc-pick legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 1fr; gap: 8px; margin: 8px 0; } /* all the same size */
.sc-opt { position: relative; display: block; height: 100%; }
.sc-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sc-opt > span { display: flex; align-items: center; gap: 8px; height: 100%; min-height: var(--tap); padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: .9rem; }
.sc-opt input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 2px var(--soft); font-weight: 600; }
.sc-opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.sc-opt input:disabled + span { opacity: .7; }
.sc-opt input:disabled { cursor: default; }
@media (max-width: 600px) { .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-opt > span { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 10px 6px; } } /* phones: colors on top, the name under them on one line */
.sc-sw { display: inline-flex; flex: none; border-radius: 7px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.sc-sw i { width: 14px; height: 24px; display: block; }

/* calendar events that aren't jobs */
.ev-sheet .ev-people { border: 0; padding: 0; margin: 4px 0 10px; min-width: 0; }
.ev-sheet .ev-people legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.ev-sheet .ev-people [data-plist] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 0 12px; }
.ev-scope { display: grid; gap: 8px; margin-top: 12px; }
.ev-scope-wrap .dialog { max-width: 420px; }

/* card money from Stripe (Money page, owner) and where a card payment's money is (job payments) */
.mo-stripe .sm-tiles { margin: 8px 0 10px; }
.mo-stripe .sm-tiles .mo-tile { background: var(--bg); }
.sm-sched { margin: 0 0 6px; } .sm-sched .link { margin-left: 4px; white-space: nowrap; }
.sm-h { font-size: 1rem; margin: 16px 0 6px; color: var(--navy); }
.sm-list { display: flex; flex-direction: column; gap: 6px; }
.sm-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer; min-height: var(--tap); }
.sm-row > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sm-row:hover { border-color: var(--blue); }
.sm-amt { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.sm-where { color: var(--muted); } .sm-where.paid_out { color: var(--ok); } .sm-where.payout_failed { color: var(--danger); }
.pay-card { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; } .pay-card.paid_out { color: var(--ok); } .pay-card.payout_failed { color: var(--danger); }
.sm-list > .sm-row { margin: 0; }
@media (max-width: 600px) {
  .mo-stripe .sm-tiles { grid-template-columns: minmax(0, 1fr); }
  .sm-row { flex-wrap: wrap; }
  .sm-row .sm-amt { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 10px; text-align: left; }
}

/* job page: the customer's name + "＋ Property / job" (a new property and its job, or another job, in a couple of taps) */
.job-cust { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.job-cust .btn { min-height: 40px; }
.more-for { display: grid; gap: 10px; padding-top: 4px; }
.more-for .btn { width: 100%; justify-content: center; min-height: 48px; }

/* a new password's strength bar (sign-up, invite, reset): weak / OK / strong + what to fix */
.pw-meter { margin: -4px 0 10px; }
.pw-bar { height: 6px; border-radius: 99px; background: rgba(127, 127, 127, 0.25); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.2s, background 0.2s; }
.pw-meter[data-level='0'] .pw-bar span { width: 25%; background: #c0392b; }
.pw-meter[data-level='1'] .pw-bar span { width: 65%; background: #d68910; }
.pw-meter[data-level='2'] .pw-bar span { width: 100%; background: #1e8449; }
.pw-hint { margin: 4px 0 0; color: var(--muted, #666); }
.pw-meter[data-level='0'] .pw-hint { color: #c0392b; }

/* the invoice header line: pill, job, and "✓ Saved" spaced like the estimate header */
.iv-head .pe-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.set-version { text-align: center; margin: 24px 0 8px; }

/* estimate editor: the profit margin the suggested prices use (owner / office) + each line's cost and profit */
.pe-margin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft, #f4f8f9); }
.pe-margin-l { font-weight: 700; }
.pe-margin-set { display: inline-flex; align-items: center; gap: 6px; }
.pe-margin-set input { width: 70px; text-align: center; min-height: 40px; }
.pe-margin-set .btn { min-width: 40px; min-height: 40px; font-size: 1.1rem; }
.pe-margin-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-margin-total { margin-left: auto; color: var(--navy-text, var(--navy)); }
.pe-sug-use { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.pe-sug-use:disabled { text-decoration: none; cursor: default; }
.pe-sug-more { display: block; color: var(--muted, #5b6b70); font-weight: 600; }
/* Settings → Line items (web/js/items-settings.js) */
.lis-tools input[type=search] { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line, #d5dbe3); border-radius: 10px; margin-bottom: 8px; }
.lis-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lis-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.lis-row { display: flex; align-items: flex-start; gap: 8px; }
.lis-row.on .lis-item { border-color: var(--danger); }
.lis-pick { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 52px; cursor: pointer; flex: none; }
.lis-pick input { width: 22px; height: 22px; }
.lis-item { flex: 1; min-width: 0; background: var(--card, #fff); }
.lis-sum { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; min-width: 0; overflow-wrap: break-word; }
.lis-cost { display: block; color: var(--navy-text, var(--navy)); }
.lis-warn { color: var(--danger); }
.lis-low { color: #a35a00; }
.lis-acts { margin-top: 8px; }
.lis-bar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 8px; border-radius: 12px; background: var(--card, #fff); border: 1px solid var(--danger); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.lis-bar[hidden] { display: none; }
.lis-bar > span { font-weight: 700; margin-right: auto; }
/* Settings → Pricing setup */
.prs-steps { display: flex; flex-direction: column; gap: 8px; }
.prs-step { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.prs-n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-weight: 700; background: var(--navy); color: #fff; }
.prs-step.done .prs-n { background: var(--ok); }
.prs-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; overflow-wrap: break-word; }
.prs-go { flex: none; font-weight: 600; color: var(--navy-text, var(--navy)); white-space: nowrap; }
@media (max-width: 600px) { .prs-step { flex-wrap: wrap; } .prs-tx { flex: 1 1 calc(100% - 52px); } .prs-go { margin-left: 44px; } }
.lis-tools [data-lis-save-top] { margin-top: 8px; } .lis-tools [data-lis-save-top][hidden] { display: none; }
.lis-costs { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.lis-ch { margin-bottom: 6px; overflow-wrap: break-word; }
.lis-cost-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lis-cost-row:last-of-type { border-bottom: 0; }
/* job photos: Select → delete several (web/js/files.js) */
.pf-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pf-acts [hidden] { display: none; }
.pf-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--danger); border-radius: 12px; }
.pf-selbar[hidden] { display: none; }
.pf-selbar > span { font-weight: 700; margin-right: auto; }
.pgrid .pthumb.picked { outline: 3px solid var(--blue); outline-offset: -3px; }
/* referral fee on the job page (owner only) */
.ref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.ref-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: break-word; }
.ref-amt { white-space: nowrap; }
/* a call under way (calls.js): the note opens when you come back after the call */
.call-bar { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 60; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--navy, #12294A); color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: .88rem; }
.call-bar > span { flex: 1; min-width: 0; overflow-wrap: break-word; }
.call-bar .icon-btn { color: #fff; }
.call-bar .btn { background: #fff; color: var(--navy, #12294A); border-color: #fff; white-space: nowrap; }
.call-bar .icon-btn { background: transparent; border-color: transparent; }
/* ✨ Make it professional (polish.js) */
.polish { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.polish-pick { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: var(--soft); }
.polish-new { white-space: pre-wrap; overflow-wrap: break-word; font-size: .92rem; }
/* writing a photo note: the photo moves above and the note gets the whole width (Corey, Nov 3) */
.pe-insp-item.writing { grid-template-columns: minmax(0, 1fr); }
.pe-insp-item.writing .pe-insp-pic { max-width: 320px; }
.pe-insp textarea[data-k="notes"] { min-height: 6.5em; font-size: 1rem; }
.pe-refresh { margin-top: 6px; }
/* a line's cost, part by part (Corey, Nov 3: see what's counted at a glance - team only) */
.pe-bd { display: block; margin-top: 3px; color: var(--ok, #15803d); font-weight: 600; font-size: .78rem; line-height: 1.35; overflow-wrap: break-word; }
.pe-bd-plus { color: var(--muted); font-weight: 500; }
.pe-bd-tot { color: var(--navy); }
.pe-bd-miss { display: block; color: #9A5B00; }
/* job page: an option's costs, part by part (jobcost-card.js costBreakdown) */
.jc-bd { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.jc-bd > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; color: var(--navy); }
.jc-bd-warn { color: #9A5B00; font-size: .8rem; font-weight: 700; }
.jc-bd-line { padding: 6px 0; border-top: 1px dashed var(--line); overflow-wrap: break-word; }
.jc-bd-parts { color: var(--ok, #15803d); font-size: .82rem; font-weight: 600; }
.jc-bd-miss { color: #9A5B00; font-size: .82rem; font-weight: 600; }
.demo-login { display: flex; flex-direction: column; gap: 4px; padding: 12px; margin: 8px 0 14px; border-radius: 12px; background: #FFF7E0; color: #5C4300; font-size: .92rem; overflow-wrap: break-word; }
/* the demo CRM's banner (tools/build-demo.mjs puts it in the demo's page) */
.demo-banner { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); transform: translateX(-50%); z-index: 70; padding: 6px 12px; border-radius: 999px; background: #B45309; color: #fff; font-size: .8rem; font-weight: 700; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); white-space: nowrap; }
