/* Wolf Pack Ops — José's dashboard. Same family as JB Ops: iOS-style grouped lists, a sticky top bar in the brand
   color, tabular money, light + dark. Real brand from Brand/Brand Notes.md (10-22-26): Wolf Yellow #FEF200 as a fill with
   black text on it, Logo Black #231F20 chrome. Yellow is never text on a light surface — text/rings use --accent
   (black in light mode, yellow in dark). Anton for the wordmark, Oswald for display, Inter for reading. */

@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/fonts/oswald-latin.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }

:root {
  --logo: #231F20; --iron: #3B3637; --ash: #D6D2D3;
  --wolf: #FEF200; --on-wolf: #231F20; --wolf-soft: #FFF8A6; --wolf-ink: #231F20; --accent: #231F20;
  --paper: #F4F4F2; --card: #FFFFFF; --sunk: #EBEAE7; --ink: #231F20; --ink-2: #3B3637; --muted: #625D5E; --faint: #8A8586;
  --rule: #E3E2DF; --chrome: #231F20; --on-chrome: #FFFFFF;
  --ok: #2F7D4F; --ok-bg: #E3F1E8; --warn: #A86A00; --warn-bg: #FBF0D9; --bad: #B3362B; --bad-bg: #F8E3E0; --info: #2F5F8F; --info-bg: #E2ECF6;
  --r-lg: 16px; --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(35, 31, 32, .06), 0 2px 10px rgba(35, 31, 32, .05);
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121011; --card: #231F20; --sunk: #1A1718; --ink: #FFFFFF; --ink-2: #D6D2D3; --muted: #A9A4A5; --faint: #7D7879;
    --rule: #3B3637; --chrome: #000000; --wolf-soft: #3A3610; --wolf-ink: #FEF200; --accent: #FEF200;
    --ok: #5DBB85; --ok-bg: #18301F; --warn: #E2A53A; --warn-bg: #33270F; --bad: #EE7366; --bad-bg: #361A17; --info: #79A8D8; --info-bg: #172634;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121011; --card: #231F20; --sunk: #1A1718; --ink: #FFFFFF; --ink-2: #D6D2D3; --muted: #A9A4A5; --faint: #7D7879;
  --rule: #3B3637; --chrome: #000000; --wolf-soft: #3A3610; --wolf-ink: #FEF200; --accent: #FEF200;
  --ok: #5DBB85; --ok-bg: #18301F; --warn: #E2A53A; --warn-bg: #33270F; --bad: #EE7366; --bad-bg: #361A17; --info: #79A8D8; --info-bg: #172634;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
  min-height: 100dvh; overflow-x: hidden;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 40; background: var(--chrome); color: var(--on-chrome);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px; min-height: 52px;
}
.top .back { background: none; border: 0; color: var(--on-chrome); padding: 6px 8px 6px 0; font-size: 15px; display: flex; align-items: center; gap: 2px; cursor: pointer; text-decoration: none; }
.top .back::before { content: "‹"; font-size: 26px; line-height: 0; margin-top: -3px; }
.wordmark { display: flex; align-items: center; gap: 8px; line-height: 1; text-decoration: none; }
.wordmark b { font: 700 20px/1 var(--display); letter-spacing: .02em; }
.wordmark img { height: 34px; width: auto; display: block; }
/* WP-6: monochrome shield + white WOLFPACK / MASONRY wordmark. The bar is Logo Black (#000 in dark), so the white
   wordmark reads in both themes; the dark wordmark is for light surfaces (login). */
.wordmark img.wm { height: 22px; }
.wordmark small { font: 600 9px/1 var(--body); letter-spacing: .28em; color: var(--wolf); margin-top: 3px; }
.top .title { font: 600 17px/1.2 var(--body); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .spacer { flex: 1; }
.top .lang { background: rgba(255,255,255,.1); border: 0; color: var(--on-chrome); border-radius: 999px; padding: 5px 10px; font: 600 12px var(--body); letter-spacing: .06em; cursor: pointer; }

/* ---------- layout ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); outline: none; }
.view.wide { max-width: 1100px; }
h1.big { font: 600 30px/1.1 var(--display); letter-spacing: .01em; margin: 6px 0 4px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
h2.sec { font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 4px 8px; display: flex; align-items: center; gap: 8px; }
h2.sec .count { background: var(--wolf); color: var(--on-wolf); border-radius: 999px; padding: 2px 7px; font-size: 11px; letter-spacing: 0; }
h2.sec .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13.5px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.boot { height: 40vh; }

/* ---------- grouped lists (iOS) ---------- */
.group { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.group + .group { margin-top: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-decoration: none; color: inherit; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; min-height: 52px; }
.item + .item, .item + .field, .field + .item, .field + .field { border-top: 1px solid var(--rule); }
.item.link::after { content: "›"; color: var(--faint); font-size: 22px; line-height: 1; margin-left: 4px; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .d { color: var(--muted); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex-shrink: 0; }
.empty { padding: 22px 16px; color: var(--muted); text-align: center; font-size: 15px; }

/* ---------- tiles (home) ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.tile .n { font: 600 28px/1 var(--display); }
.tile .l { color: var(--muted); font-size: 13.5px; }
.tile.hot { background: var(--wolf); color: var(--on-wolf); }
.tile.hot .l { color: var(--on-wolf); }

/* ---------- pills, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 9px; font-size: 12.5px; font-weight: 600; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pill.new { background: var(--wolf-soft); color: var(--wolf-ink); }
.pill.called, .pill.sent { background: var(--info-bg); color: var(--info); }
.pill.site_walk, .pill.in_progress { background: var(--warn-bg); color: var(--warn); }
.pill.quoted, .pill.scheduled, .pill.draft { background: var(--sunk); color: var(--ink-2); }
.pill.won, .pill.approved, .pill.done, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.lost, .pill.denied, .pill.bad { background: var(--bad-bg); color: var(--bad); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--wolf); color: var(--on-wolf); border-color: var(--logo); }
.scroller { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r); padding: 12px 18px; min-height: 48px; font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; background: var(--sunk); color: var(--ink); }
.btn.primary { background: var(--wolf); color: var(--on-wolf); }
.btn.dark { background: var(--logo); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 4px; text-decoration: none; color: var(--accent); font-weight: 600; font-size: 13.5px; border: 0; cursor: pointer; }
.act svg { width: 22px; height: 22px; }
.act[aria-disabled="true"] { color: var(--faint); pointer-events: none; }

/* ---------- forms ---------- */
.field { display: block; padding: 10px 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.field input, .field textarea, .field select { width: 100%; border: 0; background: transparent; padding: 4px 0; font-size: 17px; outline: none; }
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 0 2px 0 var(--accent); }
.field.inline { display: flex; align-items: center; gap: 12px; }
.field.inline > span { margin: 0; flex: 1; font-size: 16px; color: var(--ink); }
.field.inline input { width: 120px; text-align: right; }
.field.inline .unit { min-width: 34px; }
.switch { appearance: none; width: 51px; height: 31px; border-radius: 999px; background: var(--ash); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.seg { display: flex; background: var(--sunk); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px 6px; font-size: 14.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.notice { border-radius: var(--r); padding: 12px 14px; background: var(--info-bg); color: var(--info); font-size: 14.5px; margin: 12px 0; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- lead / estimate pieces ---------- */
.steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.steps button { flex: 1 0 auto; border: 1px solid var(--rule); background: var(--card); border-radius: var(--r-sm); padding: 9px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.steps button[aria-pressed="true"] { background: var(--wolf); border-color: var(--logo); color: var(--on-wolf); }
/* WP-7 contact card */
.contact-photos { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 16px 6px; }
.contact-photos figure { margin: 0; display: flex; align-items: center; gap: 10px; }
.contact-photos img { width: 64px; height: 64px; border-radius: 50%; display: block; box-shadow: var(--shadow); }
.contact-photos figcaption { display: flex; flex-direction: column; }
.contact-photos .t { font-weight: 600; }
.contact-photos .d { font-size: 13px; color: var(--muted); }
.ci-actions { padding: 10px 12px 12px; }
.ci-actions .act { box-shadow: none; background: var(--sunk); font-family: inherit; }
.intake-msg summary { list-style: none; cursor: pointer; }
.intake-msg summary::-webkit-details-marker { display: none; }
.desc { white-space: pre-wrap; padding: 14px 16px; font-size: 16px; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px; }
@media (min-width: 700px) { .photos { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--sunk); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .badge { position: absolute; left: 6px; bottom: 6px; background: rgba(35,31,32,.78); color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 2px 6px; }
.photo .badge.on { background: var(--ok); }
.note { padding: 12px 16px; }
.note + .note { border-top: 1px solid var(--rule); }
.note .meta { font-size: 12.5px; color: var(--faint); margin-bottom: 2px; }
.note.status .body { color: var(--muted); font-style: italic; }

.lines .line { padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.lines .line + .line { border-top: 1px solid var(--rule); }
.lines .line .name { font-weight: 600; }
.lines .line .nums { display: flex; gap: 8px; align-items: center; grid-column: 1 / -1; flex-wrap: wrap; }
.lines .line input { border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 8px 10px; background: var(--sunk); font-size: 16px; width: 90px; text-align: right; }
.lines .line input.name-in { width: 100%; text-align: left; font-weight: 600; }
.lines .line .x { border: 0; background: none; color: var(--faint); font-size: 22px; cursor: pointer; padding: 0 4px; }
.totals { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); background: var(--logo); color: #fff; border-radius: var(--r-lg); padding: 12px 16px; margin-top: 14px; display: flex; align-items: center; gap: 12px; z-index: 5; }
.totals .tt { font: 600 24px/1 var(--display); }
.totals .bd { font-size: 12.5px; opacity: .75; }

/* ---------- price list ---------- */
.price .rates { display: flex; gap: 14px; font-size: 14px; color: var(--muted); margin-top: 3px; }
.price .rates b { color: var(--ink); font-weight: 600; }
.price.off .t { text-decoration: line-through; color: var(--faint); }
.search { width: 100%; border: 0; background: var(--sunk); border-radius: var(--r); padding: 11px 14px; font-size: 16px; margin-bottom: 10px; }
.preview { background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.preview .p-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; }

/* ---------- week view ---------- */
.week { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.day { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; min-height: 64px; }
.day.today { outline: 2px solid var(--accent); }
.day .dh { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 6px; text-transform: capitalize; }
.day .job { display: block; text-decoration: none; background: var(--wolf-soft); color: var(--wolf-ink); border-radius: var(--r-sm); padding: 7px 9px; font-size: 14px; font-weight: 600; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; }
.day .job.done { background: var(--ok-bg); color: var(--ok); }
.day .job small { display: block; font-weight: 400; opacity: .85; }
.code { font: 600 30px/1 var(--display); letter-spacing: .12em; text-align: center; padding: 18px; background: var(--sunk); border-radius: var(--r); user-select: all; }

/* ---------- bottom tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 600; position: relative; min-height: var(--tabs-h); justify-content: center; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; border-radius: 0 0 3px 3px; background: var(--wolf); box-shadow: 0 0 0 1px var(--logo); }
.tabs a .dot { position: absolute; top: 5px; left: calc(50% + 8px); background: var(--wolf); color: var(--on-wolf); border-radius: 999px; font-size: 10.5px; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 4px; }

/* ---------- sheets + toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18, 16, 17, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 18px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--ash); margin: 4px auto 10px; }
.sheet h3 { font: 600 22px/1.2 var(--display); margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.sheet h3 .x { margin-left: auto; border: 0; background: var(--sunk); border-radius: 50%; width: 32px; height: 32px; font-size: 18px; cursor: pointer; color: var(--muted); }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--logo); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login .mark { font: 700 46px/1 var(--display); letter-spacing: .02em; }
.login .mark img { height: auto; display: block; margin: 0 auto 10px; }
.login .mark .shield { width: 96px; }
.login .mark .wm { width: 220px; margin-bottom: 14px; }
.login .mark .lk-dark { display: none; }
:root[data-theme="dark"] .login .mark .lk-light { display: none; }
:root[data-theme="dark"] .login .mark .lk-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login .mark .lk-light { display: none; }
  :root:not([data-theme="light"]) .login .mark .lk-dark { display: block; }
}
.login .mark small { display: inline-block; font: 700 12px/1 var(--body); letter-spacing: .32em; background: var(--wolf); color: var(--on-wolf); padding: 5px 6px 5px 10px; margin-top: 4px; }
.login input.codein { width: 100%; text-align: center; font: 600 28px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; border: 2px solid var(--rule); border-radius: var(--r); padding: 14px; background: var(--card); margin: 18px 0 12px; }
.login input.codein:focus { border-color: var(--accent); outline: none; }

@media (min-width: 1000px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 92px; flex-direction: column; justify-content: flex-start; padding-top: 76px; border-top: 0; border-right: 1px solid var(--rule); }
  .tabs a { flex: 0 0 auto; min-height: 72px; }
  .tabs a[aria-current="page"]::before { top: 18%; bottom: 18%; left: 0; right: auto; width: 4px; height: auto; border-radius: 0 3px 3px 0; }
  .top { padding-left: 108px; }
  .view { padding-left: 108px; padding-bottom: 40px; }
  .totals { bottom: 12px; }
  .toast { bottom: 24px; }
}
@media print { .tabs, .top { display: none; } }

/* checkbox chips (job → website services) */
.field .chip { display: inline-flex; align-items: center; gap: 6px; }
.field .chip input { width: auto; margin: 0; accent-color: var(--accent); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--wolf-soft); color: var(--wolf-ink); }
.day .job .jt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.day .job small { display: block; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
