/* Roofer dashboard (/pro). Mobile-first: top bar + bottom tabs on phones, a full-height sidebar from 900px. Manrope, off-white + orange, like the homeowner page. */
:root { --ink: #1b1719; --sub: #6b6572; --line: #e7e5ec; --bg: #f4f4f8; --card: #fff; --brand: #f05423; --brand-d: #d4441a; --brand-soft: #fff1ea; --ok: #127a3e; --ok-soft: #e4f6ea; --bad: #c62828; --bad-soft: #fdeaea; --blue: #2f6fe4; --blue-soft: #ecf2ff; --purple: #7b4ddb; --purple-soft: #f2ecff; --shadow: 0 1px 2px rgba(27,23,25,.04), 0 6px 20px -8px rgba(27,23,25,.12); --r: 16px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
body.in { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
body.noscroll { overflow: hidden; }
a { color: var(--brand-d); }
h1, h2, h3 { letter-spacing: -0.01em; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.ic-xs { width: 1em; height: 1em; vertical-align: -0.15em; }

/* top bar */
.pbar { position: sticky; top: 0; z-index: 6; padding: 0; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); min-height: 60px; }
.pbrand { display: flex; flex: none; }
.pbrand img { width: 150px; height: auto; display: block; }
.pco { display: none; }
.pbar-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 60px; }
body.out .pbar-in { justify-content: center; }
.pbal { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; padding: 8px 12px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 15px; text-decoration: none; }
.pbuy { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 8px 13px; border-radius: 99px; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 4px 12px -4px rgba(240,84,35,.6); transition: transform .15s, background .15s; }
.pbuy:hover { background: var(--brand-d); transform: translateY(-1px); }
.pbuy span { display: none; }
.asadmin { background: #fff4d6; color: #6b4e00; font-size: 14px; padding: 8px 16px; text-align: center; }

/* layout */
.pwrap { max-width: 1120px; margin: 0 auto; }
.pmain { padding: 16px; min-width: 0; }
.pside { display: none; }

/* bottom tabs (phones) */
.ptabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.ptabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; font-size: 11.5px; font-weight: 700; color: var(--sub); text-decoration: none; }
.ptabs a.on { color: var(--brand-d); }
.ptab-ic { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 10px; }
.ptabs a.on .ptab-ic { background: var(--brand-soft); }
.ptabs .ic { width: 22px; height: 22px; }
.ndot { position: absolute; top: -4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* headings and notes */
.phead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 2px 0 14px; }
.ptitle { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 800; }
.phead .ptitle { margin: 0; }
.plive { margin: 0; font-size: 14px; color: var(--sub); display: inline-flex; align-items: center; gap: 6px; }
.plive b { color: var(--ink); }
.plive i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(18,122,62,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,122,62,.45); } 70% { box-shadow: 0 0 0 8px rgba(18,122,62,0); } 100% { box-shadow: 0 0 0 0 rgba(18,122,62,0); } }
.psub { font-size: 18px; margin: 20px 0 8px; font-weight: 800; }
.pnote { color: var(--sub); font-size: 14px; margin: 10px 0; }
.pwarn { color: #8a4b00; background: #fff4e0; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.pback { margin: 0 0 10px; font-size: 15px; }
.pback a { text-decoration: none; font-weight: 700; }
.pflash { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; font-size: 15px; animation: rise .35s ease-out; }
.pflash-success { background: var(--ok-soft); color: var(--ok); }
.pflash-error { background: var(--bad-soft); color: var(--bad); }
.pflash-info { background: var(--blue-soft); color: #1f4fb0; }
.pflash-soft { background: #fff; color: var(--sub); border: 1px dashed var(--line); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 1px; min-width: 0; box-shadow: var(--shadow); }
.tile:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.tile:first-child .tic { grid-row: 1 / 3; margin: 0; width: 44px; height: 44px; }
.tile:first-child strong { font-size: 30px; }
.tile:first-child em { grid-column: 2; }
.tile small { color: var(--sub); font-size: 13px; font-weight: 600; }
.tile strong { font-size: 22px; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile em { font-style: normal; color: var(--sub); font-size: 12px; }
.tic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 4px; }
.tic-blue { background: var(--blue-soft); color: var(--blue); }
.tic-purple { background: var(--purple-soft); color: var(--purple); }
.tic-orange { background: var(--brand-soft); color: var(--brand); }

/* tabs */
.ptabsel { display: flex; gap: 4px; background: #e9e8ef; padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.ptabsel a { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 9px 4px; border-radius: 9px; font-weight: 800; font-size: 14px; color: var(--sub); text-decoration: none; white-space: nowrap; transition: background .15s; }
.ptabsel a b { font-size: 12px; background: rgba(0,0,0,.07); border-radius: 99px; padding: 1px 7px; }
.ptabsel a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ptabsel a.on b { background: var(--brand-soft); color: var(--brand-d); }

/* cards */
.lcard, .pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.lcard:not(.ldetail):hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(27,23,25,.05), 0 14px 28px -12px rgba(27,23,25,.2); }
.lcard.taken { opacity: .55; box-shadow: none; }
.lcard.fresh { border-color: #f7c2ad; }
.lhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lhead h3, .lhead h1 { font-size: 18px; margin: 0 4px 0 0; line-height: 1.25; font-weight: 800; }
.lhead h3 a { color: inherit; text-decoration: none; }
.ldetail .lhead h1 { font-size: 22px; }
.lprice { margin-left: auto; font-weight: 800; font-size: 17px; color: var(--brand-d); background: var(--brand-soft); border-radius: 99px; padding: 3px 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 8px; background: #f0eff4; color: var(--sub); white-space: nowrap; }
.tag-hot { background: var(--bad-soft); color: var(--bad); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-win { background: var(--ok); color: #fff; }
.tag-new { background: var(--brand-soft); color: var(--brand-d); }
.tag-new i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.8s infinite; }
.lmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; color: var(--sub); font-size: 14px; margin: 6px 0; }
.lmeta span { display: inline-flex; align-items: center; gap: 4px; }
.lmeta time { font-variant-numeric: tabular-nums; }
.lsum { margin: 6px 0 10px; font-size: 15px; }
.ltaken { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-weight: 700; color: var(--sub); }
.lcontact { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; font-weight: 700; margin: 6px 0 10px; }
.lcontact a { color: var(--ink); }
.lact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.lact .pbtn { flex: 1 1 130px; font-size: 15px; white-space: nowrap; padding: 10px 12px; }
.lact3 .pbtn { flex-basis: 80px; padding: 10px 8px; }

/* buttons */
.pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; text-align: center; transition: transform .12s, background .15s, box-shadow .15s; }
.pbtn:active { transform: scale(.98); }
.pbtn-main { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(240,84,35,.6); }
.pbtn-main:hover { background: var(--brand-d); border-color: var(--brand-d); }
.pbtn-ghost { background: transparent; }
.pbtn-big { width: 100%; min-height: 54px; font-size: 17px; margin-top: 8px; }
.pbtn-on { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.pbtn:disabled, .pbtn.busy { opacity: .7; cursor: default; transform: none; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pempty { background: var(--card); border: 1px dashed #d6d3df; border-radius: var(--r); padding: 24px 16px; display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--sub); }
.pempty strong { color: var(--ink); font-size: 17px; }

/* lead detail */
.pkv { display: grid; grid-template-columns: 112px 1fr; gap: 9px 10px; margin: 12px 0; font-size: 15px; }
.pkv dt { color: var(--sub); }
.pkv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.blur { display: inline-block; width: 70%; max-width: 180px; height: 1.05em; vertical-align: middle; border-radius: 5px; background: linear-gradient(90deg, #e3e1e9 0%, #efeef3 40%, #e3e1e9 80%); background-size: 200% 100%; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.unlock { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.unlock-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.unlock-top .psub { margin: 10px 0 2px; }
.unlock-top .pnote { margin: 0 0 8px; }
.uprice { flex: none; font-size: 26px; font-weight: 800; color: var(--brand-d); margin-top: 8px; }
.balmove { margin: 8px 0 0; font-size: 14px; color: var(--sub); text-align: center; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.outcomes .pbtn { flex: 1 1 140px; font-size: 15px; min-height: 42px; }
.report { margin-top: 14px; }
.report summary { cursor: pointer; font-weight: 700; color: var(--sub); }
.pradio { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 15px; }

/* pay sheet */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(27,23,25,.45); opacity: 0; transition: opacity .2s; }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.sheet.show .sheet-bg { opacity: 1; }
.sheet.show .sheet-box { transform: none; }
.sheet-box h2 { font-size: 19px; margin: 0 36px 2px 0; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f0eff4; color: var(--sub); display: grid; place-items: center; cursor: pointer; }
.payopt { display: grid; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 10px; }
.payopt-t { display: grid; gap: 2px; }
.payopt-t strong { font-size: 16px; }
.payopt-t span { color: var(--sub); font-size: 13.5px; }
.payopt .pbtn { width: 100%; }
.payopt-credits { border-color: #f7c2ad; background: #fffaf7; }
.payor { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 13px; margin: 12px 0 2px; }
.payor::before, .payor::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* credits */
.plabel { color: var(--sub); font-size: 13px; font-weight: 700; }
.pbig { display: block; font-size: 36px; line-height: 1.15; margin: 2px 0 10px; font-weight: 800; }
.amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.amt { position: relative; }
.amt input { position: absolute; opacity: 0; pointer-events: none; }
.amt span { display: block; text-align: center; padding: 11px 4px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 800; font-size: 18px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.amt span small { display: block; font-size: 11.5px; font-weight: 600; color: var(--sub); margin-top: 2px; }
.amt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-d); box-shadow: inset 0 0 0 1px var(--brand); }
.amt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pfield { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; font-weight: 700; color: var(--sub); }
.pfield input, .pfield select, .pfield textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.pfield input:focus, .pfield select:focus, .pfield textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240,84,35,.15); }
.pfield small { font-weight: 400; }
.pfield.bad input { border-color: var(--bad); }
.perr { color: var(--bad); font-weight: 600; }
.pcheck { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--sub); margin: 10px 0 6px; }
.pcheck input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.pswitch { display: flex; gap: 10px; align-items: center; font-weight: 700; margin: 6px 0 8px; }
.pswitch input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .pfield { margin: 6px 0; }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.ledger li:first-child { border-top: 0; }
.ledger small { display: block; color: var(--sub); font-size: 13px; }
.ledger b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger a { color: var(--ink); font-weight: 800; text-decoration: none; }
.ledger em { font-style: normal; margin-left: 4px; }
.ledger .pos { color: var(--ok); }
.addon { display: grid; gap: 4px; text-decoration: none; color: var(--ink); border-style: dashed; }
.addon span { color: var(--sub); font-size: 14px; }
.pout { margin: 6px 0 20px; }
.plogin { max-width: 420px; margin: 20px auto; }

/* toast: a real new lead came in while the page was open */
.ptoast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15; display: grid; gap: 1px; padding: 12px 14px 12px 18px; background: var(--ink); color: #fff; border-radius: 14px; cursor: pointer; box-shadow: 0 12px 30px -8px rgba(0,0,0,.5); transform: translateY(16px); opacity: 0; transition: transform .25s, opacity .25s; }
.ptoast::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--brand); }
.ptoast.show { transform: none; opacity: 1; }
.ptoast strong { font-size: 15px; }
.ptoast span { font-size: 13px; opacity: .8; }

@media (min-width: 400px) { .amounts { grid-template-columns: repeat(4, 1fr); } .amt span { font-size: 16px; } .pbuy span { display: inline; } }
@media (min-width: 560px) { .pbrand img { width: 190px; } .pco { display: block; flex: 1; min-width: 0; font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pbal { margin-left: 0; } .tiles { grid-template-columns: repeat(3, 1fr); } .tile:first-child { grid-column: auto; display: grid; grid-template-columns: 1fr; } .tile:first-child .tic { grid-row: auto; width: 34px; height: 34px; margin-bottom: 4px; } .tile:first-child strong { font-size: 22px; } .tile:first-child em { grid-column: auto; } }
@media (min-width: 900px) {
  body.in { padding-bottom: 0; }
  .ptabs { display: none; }
  .pwrap { display: grid; grid-template-columns: 248px 1fr; gap: 24px; padding: 22px 24px; }
  body.out .pwrap { display: block; }
  .pmain { padding: 0; }
  .pside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; align-self: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 106px); }
  .pme { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; border-bottom: 1px solid var(--line); }
  .pavatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), #ff8a5c); color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; flex: none; }
  .pme-t { min-width: 0; display: grid; }
  .pme-t strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pme-t small { color: var(--sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pside nav { display: grid; gap: 3px; }
  .pside nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; font-weight: 700; font-size: 15px; color: var(--sub); text-decoration: none; transition: background .15s, color .15s; }
  .pside nav a:hover { background: var(--bg); color: var(--ink); }
  .pside nav a.on { background: var(--brand-soft); color: var(--brand-d); }
  .pside nav a .ic { width: 20px; height: 20px; }
  .nbadge { margin-left: auto; font-size: 12px; font-weight: 800; background: #ecebf1; color: var(--sub); border-radius: 99px; padding: 1px 8px; min-width: 24px; text-align: center; }
  .nbadge.hot { background: var(--brand); color: #fff; }
  .pside-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
  .pauto { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--sub); text-decoration: none; padding: 6px 8px; border-radius: 10px; }
  .pauto i { width: 9px; height: 9px; border-radius: 50%; background: #c9c6d2; }
  .pauto.on { color: var(--ok); }
  .pauto.on i { background: var(--ok); animation: pulse 2.4s infinite; }
  .pside-foot button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--sub); padding: 6px 8px; cursor: pointer; border-radius: 10px; }
  .pside-foot button:hover { background: var(--bg); color: var(--ink); }
  .ptitle { font-size: 28px; }
  .pbar-in { padding: 10px 24px; }
  .tiles { gap: 14px; }
  .tile { padding: 16px; }
  .pkv { grid-template-columns: 150px 1fr; }
  .sheet-box { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, calc(100vw - 32px)); transform: translate(-50%, -46%); opacity: 0; border-radius: 20px; padding: 22px; transition: transform .2s, opacity .2s; }
  .sheet.show .sheet-box { transform: translate(-50%, -50%); opacity: 1; }
  .ptoast { left: auto; right: 24px; bottom: 24px; width: 320px; }
}
.pcard > .psub:first-child, .pcard > h2.psub:first-of-type { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* onboarding: finish-profile note, password sign-in */
.pfinish { display: block; text-decoration: none; font-weight: 600; }
.pfinish b { font-weight: 800; }
.psub small.muted { color: var(--sub); font-weight: 600; font-size: 14px; }
.ppass { margin-top: 14px; }
.ppass summary { cursor: pointer; font-weight: 700; color: var(--sub); padding: 6px 0; }
.ppass[open] summary { margin-bottom: 8px; }
#password .pbtn + .pbtn { margin-left: 8px; }
/* text us */
.ptext { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; padding: 6px 0; }
.ptext:hover { color: var(--brand); }
.phelp { margin: 22px 0 8px; text-align: center; color: var(--sub); font-size: 14px; }
.phelp a { color: var(--brand); font-weight: 700; text-decoration: none; white-space: nowrap; }
