/* CivilPro — design system. Mobile-first, clean white "carousel" aesthetic. */

:root {
  /* surfaces */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e6eaf0;
  --border-strong: #d3dae6;

  /* ink */
  --ink: #0f1b33;          /* near-navy heading ink */
  --text: #1f2a44;
  --muted: #6b7890;
  --faint: #94a3b8;

  /* brand */
  --primary: #2563eb;
  --primary-ink: #1e3a8a;
  --primary-soft: #e8f0ff;
  --accent: #06b6d4;       /* cyan, echoes reference carousel */
  --accent-ink: #0e7490;

  /* status */
  --success: #16a34a;
  --success-soft: #e9faf0;
  --danger: #dc2626;
  --danger-soft: #fef2f3;
  --warn: #f59e0b;
  --warn-soft: #fff7ea;

  /* shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(16, 27, 51, .04), 0 8px 24px rgba(16, 27, 51, .06);
  --shadow-sm: 0 1px 2px rgba(16, 27, 51, .06);

  --bar-h: 58px;
  --maxw: 560px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.app-root { min-height: 100vh; }

/* ---------- Layout ---------- */
.screen {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--bar-h) + env(safe-area-inset-top)) 0 96px;
  min-height: 100vh;
}
.container { padding: 16px; }
.section { margin-bottom: 22px; }
.section + .section { margin-top: 4px; }

/* ---------- Top app bar ---------- */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.appbar-inner {
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  height: var(--bar-h); padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.appbar .title { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.2px; }
.appbar .title .acc { color: var(--primary); }
.iconbtn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink); font-size: 20px; line-height: 1;
}
.iconbtn:active { background: var(--surface-2); }
.appbar .spacer { flex: 1; }

/* ---------- Typography ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--primary-ink); background: var(--primary-soft);
  padding: 6px 12px; border-radius: var(--radius-pill);
}
.display { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; margin: 12px 0 2px; line-height: 1.15; }
.display .acc { color: var(--primary); }
.subtle { color: var(--muted); font-size: 14px; margin: 0; }
h2.h { font-size: 15px; font-weight: 800; color: var(--ink); margin: 0 0 10px; letter-spacing: -.2px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-tap { cursor: pointer; transition: transform .08s ease, box-shadow .15s ease; }
.card-tap:active { transform: scale(.985); box-shadow: var(--shadow); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 15px; border-radius: var(--radius-sm);
  padding: 13px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, background .15s ease; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn-primary:active { background: var(--primary-ink); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }
.btn.sm { padding: 9px 14px; font-size: 14px; width: auto; }

.screen.has-proj-nav { padding-bottom: calc(96px + 64px + env(safe-area-inset-bottom)); }
.has-proj-nav .fab { bottom: calc(74px + env(safe-area-inset-bottom)); }

/* Project section icon nav (labour / materials / billing) */
.proj-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 44;
  max-width: var(--maxw); margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; justify-content: space-around;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(16, 27, 51, .06);
}
.proj-nav-btn {
  flex: 1; appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 6px 4px; border-radius: 12px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-family: inherit;
}
.proj-nav-btn.on { background: var(--primary-soft); color: var(--primary-ink); }
.proj-nav-btn:active { transform: scale(.96); }
.proj-nav-ic { font-size: 20px; line-height: 1; }
.proj-nav-lb { font-size: 10px; font-weight: 800; letter-spacing: -.1px; white-space: nowrap; }

/* Billing — sticky save bar above bottom nav */
.screen.has-billing-savebar { padding-bottom: calc(96px + 64px + 56px + env(safe-area-inset-bottom)); }
.billing-savebar {
  position: fixed; left: 0; right: 0; z-index: 45;
  max-width: var(--maxw); margin: 0 auto;
  bottom: calc(52px + env(safe-area-inset-bottom));
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(16, 27, 51, .06);
}
.billing-savebar-meta { flex: 1; min-width: 0; line-height: 1.2; }
.billing-savebar-lbl { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.billing-savebar-amt { display: block; font-size: 16px; font-weight: 800; color: var(--ink); }
.billing-savebar .btn { width: auto; flex: none; min-width: 118px; padding: 12px 16px; margin: 0; white-space: nowrap; }
.has-billing-savebar .toast { bottom: calc(118px + env(safe-area-inset-bottom)); }

/* Floating action button */
.fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 45;
  width: 58px; height: 58px; border-radius: 20px; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 28px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(37,99,235,.4);
}
.fab:active { transform: scale(.94); }
@media (min-width: 600px) { .fab { right: calc(50% - var(--maxw)/2 + 18px); } }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.input, .select, textarea.input {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 13px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7890' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
textarea.input { min-height: 72px; resize: vertical; }
.field-error .input, .field-error .select { border-color: var(--danger); }
.err-msg { color: var(--danger); font-size: 12.5px; font-weight: 600; margin-top: 5px; display: none; }
.field-error .err-msg { display: block; }

/* input group: number + unit select */
.group { display: flex; gap: 8px; }
.group .input { flex: 1; }
.group .select { width: 104px; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 .field { margin-bottom: 0; }

/* segmented toggle */
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 13px; color: var(--muted);
  padding: 7px 14px; border-radius: var(--radius-pill);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; border: 1.5px solid var(--border-strong); background: var(--surface);
  cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--text);
  padding: 8px 13px; border-radius: var(--radius-pill);
}
.chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }

.check-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px;
}
.check-row:last-child { border-bottom: 0; }
.check-row input { margin-top: 3px; accent-color: var(--primary); }
.check-row.muted { opacity: .55; cursor: default; }

/* ---------- Result cards (carousel "AFTER" style) ---------- */
.result {
  background: var(--success-soft); border: 1px solid #cdeedd;
  border-radius: var(--radius); padding: 16px; margin-top: 4px;
}
.result.muted { background: var(--surface-2); border-color: var(--border); }
.result-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; letter-spacing: .3px; text-transform: uppercase; color: var(--success); margin-bottom: 12px; }
.result.muted .result-head { color: var(--muted); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: rgba(255,255,255,.7); border-radius: var(--radius-sm); padding: 12px; }
.result.muted .stat { background: var(--surface); }
.stat .big { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; line-height: 1.1; }
.stat .big .u { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.stat .lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.stat.wide { grid-column: 1 / -1; }
.breakdown { margin-top: 12px; border-top: 1px dashed var(--border-strong); padding-top: 10px; }
.brow { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
.brow .k { color: var(--muted); }
.brow .v { color: var(--ink); font-weight: 700; }
.note { font-size: 12px; color: var(--faint); margin-top: 10px; line-height: 1.4; }

/* convert output rows */
.conv-list { display: flex; flex-direction: column; gap: 2px; }
.conv-row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.conv-row:last-child { border-bottom: 0; }
.conv-row .cv { font-weight: 800; color: var(--ink); font-size: 17px; }
.conv-row .cu { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- Lists / tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .15s ease;
}
.tile:active { transform: scale(.97); box-shadow: var(--shadow); }
.tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; margin-bottom: 10px; background: var(--primary-soft); }
.tile .tt { font-weight: 800; color: var(--ink); font-size: 14.5px; letter-spacing: -.2px; }
.tile .ts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile.soon { opacity: .62; }
.tile.soon .ic { background: var(--surface-2); }

.plist { display: flex; flex-direction: column; gap: 10px; }
.pitem { display: flex; align-items: center; gap: 13px; }
.pitem .pic { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.pitem .pmeta { flex: 1; min-width: 0; }
.pitem .pname { font-weight: 800; color: var(--ink); font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .psub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .pchev { color: var(--faint); font-size: 20px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill); text-transform: capitalize; }
.badge.b-res { background: var(--primary-soft); color: var(--primary-ink); }
.badge.b-com { background: #ecfdf5; color: #047857; }
.badge.b-other { background: var(--warn-soft); color: #b45309; }

/* summary key-values */
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 14px; }
.kv .v { color: var(--ink); font-weight: 700; font-size: 14px; text-align: right; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 38px 20px; }
.empty .emoji { font-size: 46px; }
.empty h3 { font-size: 17px; color: var(--ink); margin: 12px 0 4px; }
.empty p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* hero (home) */
.hero { padding: 18px 16px 6px; }

/* utility */
.row-between { display: flex; align-items: center; justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.center { text-align: center; }
.danger-link { color: var(--danger); font-weight: 700; background: none; border: 0; cursor: pointer; font-size: 14px; font-family: inherit; padding: 0; }

/* share buttons */
.share-bar { display: flex; gap: 10px; margin-top: 14px; }
.btn-share {
  flex: 1; appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 10px; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-share:active { background: var(--surface-2); transform: scale(.98); }
.btn-share.wa { color: #128C7E; border-color: #a9e0d4; background: #f1fbf8; }
@media (prefers-color-scheme: dark) { .btn-share.wa { background: #0e2620; border-color: #1d5147; color: #56d3ba; } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 60; max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #121a2b; --surface-2: #1b2436; --border: #243049; --border-strong: #2f3d5a;
    --ink: #f1f5fb; --text: #dbe3f0; --muted: #94a3b8; --faint: #64748b;
    --primary-soft: #16264a; --success-soft: #10241b; --danger-soft: #2a1518; --warn-soft: #2a2210;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  }
  .appbar { background: rgba(18,26,43,.86); }
  .stat { background: rgba(255,255,255,.04); }
  .proj-nav { background: rgba(18,26,43,.92); }
  .billing-savebar { background: rgba(18,26,43,.94); }
}

/* site diary — work description + media per day */
.day-diary-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.day-diary-desc { min-height: 72px; margin-bottom: 0; }
.day-diary-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.day-diary-hint { margin: 6px 0 0; font-size: 11px; }
.day-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.day-media-grid:empty { display: none; }
.day-media-item {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
}
.day-media-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 22px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: none;
}
.day-media-del {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0;
}
.day-media-preview {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.day-media-preview-inner { text-align: center; max-width: 100%; }
.day-media-preview-close {
  margin-top: 12px; padding: 10px 20px; border-radius: var(--radius-pill);
  border: none; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer;
}
.day-diary-snippet {
  font-size: 12px; color: var(--muted); margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border-strong); white-space: pre-wrap; line-height: 1.4;
}
.day-diary-badges { font-size: 11px; color: var(--primary); font-weight: 700; margin-top: 4px; }

.day-activity {
  margin-bottom: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.day-activity-empty { background: transparent; border-style: dashed; padding: 10px 12px; margin-bottom: 14px; }
.day-activity-block + .day-activity-block { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.day-activity-head { font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.day-activity-list { margin: 0; padding: 0 0 0 16px; font-size: 12px; line-height: 1.45; color: var(--ink); }
.day-activity-list li { margin: 3px 0; }
.day-activity-snippet { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.day-activity-snippet-row { font-size: 11px; color: var(--ink); line-height: 1.4; margin: 3px 0; }
.day-activity-tag { font-weight: 700; }

.diary-quick-days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.diary-quick-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.diary-day-chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.diary-day-chip.sel { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.diary-day-chip.done:not(.sel) { border-color: #2d6a4f; color: #2d6a4f; }
.diary-sum-list { max-height: 160px; overflow-y: auto; }
.diary-sum-line {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; line-height: 1.35;
}
.diary-sum-line:last-child { border-bottom: none; }
.diary-sum-line-active { background: var(--primary-soft); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }

.cp-pdf-picker {
  position: fixed; inset: 0; z-index: 10000; background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
}
.cp-pdf-picker-card {
  width: 100%; max-width: 420px; max-height: 85vh; overflow: auto;
  background: var(--surface, #fff); border-radius: 16px 16px 12px 12px;
  padding: 18px 16px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.cp-pdf-picker-title { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.cp-pdf-picker-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.cp-pdf-pick-whole {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--primary-soft); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer;
}
.cp-pdf-picker-divider {
  margin: 14px 0 8px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
}
.cp-pdf-picker-weeks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cp-pdf-pick-week {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); cursor: pointer; text-align: left;
}
.cp-pdf-pick-week-label { font-size: 13px; font-weight: 700; line-height: 1.35; }
.cp-pdf-pick-week-sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.cp-pdf-pick-cancel {
  width: 100%; padding: 10px; border: 0; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}

/* Update popup */
.cp-update-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 27, 51, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
}
.cp-update-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border-radius: 16px; padding: 24px 20px; text-align: center;
  box-shadow: 0 20px 50px rgba(15, 27, 51, 0.25);
}
.cp-update-icon { font-size: 36px; margin-bottom: 8px; }
.cp-update-title { margin: 0 0 10px; font-size: 20px; color: var(--ink); }
.cp-update-msg { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--text); }
.cp-update-sub { margin: 0 0 18px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.cp-update-now { width: 100%; margin-bottom: 8px; }
.cp-update-later { width: 100%; }

/* ── Land Development dashboard ── */
.landdev-dash { --ld-earth: #c4a574; --ld-green: #3d9b6a; --ld-green-soft: rgba(61,155,106,.14); --ld-earth-soft: rgba(196,165,116,.12); }
.landdev-dash .container { padding-bottom: 24px; }
.ld-test-banner {
  background: var(--success-soft); padding: 8px 14px; margin-bottom: 12px;
  font-size: 12px; border-radius: var(--radius); border: 1px solid var(--border);
}
.ld-hero {
  background: linear-gradient(145deg, var(--ld-earth-soft) 0%, var(--surface) 42%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px 16px;
  margin-bottom: 14px; position: relative; overflow: hidden;
}
.ld-hero::before {
  content: ''; position: absolute; top: -40px; right: -30px; width: 120px; height: 120px;
  border-radius: 50%; background: var(--ld-green-soft); pointer-events: none;
}
.ld-hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ld-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .3px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--ld-green-soft); color: var(--ld-green); text-transform: uppercase;
}
.ld-client { font-size: 12px; color: var(--muted); font-weight: 600; }
.ld-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 6px; letter-spacing: -.3px; line-height: 1.2; }
.ld-acre-row { margin-bottom: 6px; }
.ld-acre { font-size: 28px; font-weight: 800; color: var(--ld-earth); letter-spacing: -.5px; }
.ld-loc { font-size: 13px; color: var(--text); line-height: 1.4; margin-bottom: 4px; }
.ld-note { font-size: 12px; color: var(--muted); margin: 6px 0 10px; line-height: 1.45; white-space: pre-wrap; }
.ld-total-panel {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.ld-total-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ld-total-amt { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }
.ld-budget-amt { font-size: 16px; font-weight: 700; color: var(--muted); text-align: right; }
.ld-progress { height: 6px; background: var(--surface-2); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.ld-progress-fill { height: 100%; background: linear-gradient(90deg, var(--ld-green), var(--ld-earth)); border-radius: 99px; }
.ld-progress-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ld-cta { width: 100%; margin-bottom: 18px; font-size: 15px; padding: 14px; border-radius: 14px; display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.ld-section-h { font-size: 14px; font-weight: 800; color: var(--ink); margin: 0 0 4px; letter-spacing: -.2px; }
.ld-section-sub { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.ld-phases { margin-bottom: 16px; }
.ld-phase {
  display: grid; grid-template-columns: 36px 1fr auto 16px; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, transform .1s;
  text-decoration: none; color: inherit;
}
a.ld-phase, a.ld-recent-row { text-decoration: none; color: inherit; }
.ld-phase:active { transform: scale(.99); border-color: var(--ld-green); }
.ld-phase-num {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--ld-green); background: var(--ld-green-soft);
}
.ld-phase-title { font-weight: 800; font-size: 14px; color: var(--ink); }
.ld-phase-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ld-phase-amt { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.ld-phase-pending { font-size: 11px; font-weight: 600; color: var(--faint); }
.ld-phase-chev { font-size: 18px; color: var(--muted); font-weight: 300; }
.ld-breakdown { padding: 14px 16px; margin-bottom: 16px; }
.ld-bar-row {
  display: flex; justify-content: space-between; padding: 7px 0;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.ld-bar-row:last-child { border-bottom: none; }
.ld-bar-row span:first-child { color: var(--muted); font-weight: 600; }
.ld-bar-row span:last-child { color: var(--ink); font-weight: 700; }
.ld-tools { margin-bottom: 8px; }
.ld-tool-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ld-tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; font-size: 11px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.ld-tool-ic { font-size: 20px; line-height: 1; }
@media (max-width: 380px) {
  .ld-tool-row { grid-template-columns: repeat(3, 1fr); }
  .ld-tool:nth-child(n+4) { grid-column: span 1; }
}
.ld-step-summary { margin-bottom: 12px; }
.ld-step-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-bottom: 8px; }
.landdev-log-step .container { padding-top: 4px; }
.ld-entries { margin-bottom: 16px; padding: 12px; border-radius: 12px; background: var(--ld-green-soft, rgba(61,155,106,.14)); border: 1px solid rgba(61,155,106,.25); }
.ld-entries-h { font-size: 12px; font-weight: 800; color: var(--ld-green, #3d9b6a); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.ld-entry { padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ld-entry.card-tap { cursor: pointer; }
.ld-entry:last-child { margin-bottom: 0; }
.ld-entry-main { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ld-entry-label { font-weight: 800; font-size: 14px; color: var(--ink); }
.ld-entry-amt { font-weight: 800; font-size: 15px; color: var(--ld-green, #3d9b6a); white-space: nowrap; }
.ld-entry-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ld-entry-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.ld-entry-act {
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.ld-entry-act-del { color: var(--danger); border-color: rgba(220,38,38,.25); background: var(--danger-soft); }
.ld-entry-new { animation: ld-flash 1.2s ease; border-color: var(--ld-green, #3d9b6a); box-shadow: 0 0 0 3px var(--ld-green-soft); }
@keyframes ld-flash { 0%,100%{ background:var(--surface); } 30%{ background:var(--ld-green-soft); } }
.ld-add-form { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ld-recent { padding: 14px 16px; margin-bottom: 14px; }
.ld-recent-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ld-recent-row:last-child { border-bottom: none; padding-bottom: 0; }
.ld-recent-phase { display: block; font-size: 10px; font-weight: 800; color: var(--ld-green, #3d9b6a); text-transform: uppercase; letter-spacing: .3px; }
.ld-recent-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.ld-recent-date { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ld-recent-amt { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.ld-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-trip-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ld-trip-chip {
  font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.ld-trip-chip:active { border-color: var(--ld-green, #3d9b6a); }
.ld-add-form input[type=file].input { padding: 8px; font-size: 13px; }
.ld-clear-total-preview {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: var(--ld-green-soft, rgba(61,155,106,.14)); color: var(--ink); border: 1px dashed rgba(61,155,106,.35);
}
.ld-upload-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ld-upload-btn { cursor: pointer; margin: 0; display: inline-flex; align-items: center; justify-content: center; }
.ld-upload-btn input { display: none !important; }
.ld-scan-box {
  padding: 14px; border-radius: 12px; border: 2px dashed rgba(61,155,106,.4);
  background: var(--ld-green-soft, rgba(61,155,106,.08));
}
.ld-scan-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.ld-scan-status { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 1.2em; }
.ld-scan-status.ld-scan-ok { color: var(--ld-green, #3d9b6a); }
.ld-scan-status.ld-scan-warn { color: #b8860b; }
.ld-scan-status.ld-scan-err { color: #c0392b; }
.ld-scan-preview { margin-top: 8px; }
.ld-scan-result {
  padding: 10px 12px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); font-size: 13px;
}
.ld-scan-result-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ld-green, #3d9b6a); margin-bottom: 4px; }
.ld-scan-result-body { font-weight: 600; color: var(--ink); line-height: 1.45; }
.ld-scan-conf { margin-top: 6px; font-size: 11px; color: var(--muted); }
.ld-manual-details summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 0;
}
.ld-manual-details[open] summary { margin-bottom: 10px; color: var(--ink); }
.ld-pending-files { margin-top: 10px; }
.ld-pending-h { font-size: 12px; font-weight: 800; color: var(--ld-green, #3d9b6a); margin-bottom: 6px; }
.ld-pending-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.ld-pending-chip button { border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.ld-trip-viewer {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.ld-trip-viewer-panel {
  width: 100%; max-width: 520px; max-height: 92vh; background: var(--surface);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
}
.ld-trip-viewer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ld-trip-viewer-title { font-weight: 800; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-trip-viewer-close { border: 0; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.ld-trip-viewer-body { flex: 1; overflow: auto; padding: 8px; min-height: 200px; }
.ld-trip-parsed { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 13px; line-height: 1.45; }
.ld-trip-parsed-h { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ld-green, #2d6a4f); margin-bottom: 8px; }
.ld-trip-parsed-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; font-size: 12px; }
.ld-trip-parsed-times { margin: 8px 0 0; padding-left: 18px; font-size: 12px; }
.ld-trip-parsed-blank { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ld-trip-img { width: 100%; height: auto; display: block; border-radius: 8px; }
.ld-trip-iframe { width: 100%; height: 70vh; border: 0; border-radius: 8px; }
.ld-trip-dl { margin: 10px 14px 14px; text-align: center; text-decoration: none; }
