/* JobShutter — design language v1 (2026-07-08 refresh) */
:root {
  /* ===== Design tokens (04-design-language.md) ===== */
  /* Ink ramp */
  --ink-900: #0E1116;            /* primary text, app bar */
  --ink-700: #3A4351;            /* secondary text */
  --ink-500: #6B7686;            /* tertiary text, placeholders, icons at rest */
  --ink-300: #C6CDD7;            /* borders, dividers */
  --ink-100: #EEF1F5;            /* page background */
  --surface: #FFFFFF;            /* cards, panels, modals */
  /* Accent — the single accent */
  --accent: #2563EB;
  --accent-ink: #1D4ED8;         /* hover / pressed */
  --accent-soft: #E7EEFF;        /* subtle accent tint: active nav, section head, selection bar */
  /* Status — status only */
  --ok: #188A54;
  --warn: #B7791F;
  --danger: #C0392B;
  --overlay: rgba(14,17,22,.62);
  /* Elevation */
  --shadow-1: 0 1px 2px rgba(14,17,22,.06);
  --shadow-2: 0 4px 16px rgba(14,17,22,.12);
  /* Radii */
  --r-card: 10px;
  --r-btn: 8px;
  --r-chip: 6px;
  --r-modal: 14px;

  /* ===== Legacy semantic aliases (repointed to the new palette) ===== */
  --bg: var(--ink-100);
  --panel: var(--surface);
  --border: var(--ink-300);
  --text: var(--ink-900);
  --muted: var(--ink-500);
  --sidebar-w: 216px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.47 -apple-system, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
h1 { font-size: 28px; line-height: 34px; font-weight: 600; margin: 0 0 8px; }
h2 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 24px 0 12px; }
h3 { font-size: 17px; line-height: 24px; font-weight: 600; }

/* focus ring on every interactive element (keyboard + a11y) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .card:focus-visible,
.project-card:focus-visible, .nav-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- app shell (sidebar + content) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; z-index: 30;
}
.sidebar .logo {
  font-size: 17px; font-weight: 600; padding: 4px 12px 14px; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 0;
}
.sidebar .logo span { color: var(--accent); }
.logo-cam { height: 22px; width: auto; display: inline-block; margin-right: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 4px;
  padding: 9px 12px; border-radius: var(--r-btn); margin-bottom: 2px;
  color: var(--ink-700); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.soon { opacity: .45; cursor: default; pointer-events: none; }
.nav-item .soon-tag { margin-left: auto; font-size: 11px; text-transform: uppercase;
                      letter-spacing: .06em; color: var(--muted); }
.sidebar .spacer { flex: 1; }
.sidebar .whoami { padding: 8px 12px; font-size: 13px; color: var(--muted);
                   border-top: 1px solid var(--border); }
.content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

header { padding: 18px 26px 8px; background: var(--panel); border-bottom: 1px solid var(--border); }
header h1 { margin: 0 0 2px; font-size: 22px; line-height: 28px; }
header .sub { color: var(--muted); font-size: 13px; }
header .back { color: var(--accent); text-decoration: none; font-size: 13px; }
.header-row { display: flex; justify-content: space-between; font-size: 13px; }
main { padding: 14px 26px 60px; max-width: 1400px; }

@media (max-width: 860px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center;
             padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .logo { display: none; }
  .nav-search { padding: 0; margin: 0 8px 0 0; flex: 0 1 130px; min-width: 70px; }
  .nav-search input { padding: 6px 8px; font-size: 12.5px; }
  .nav-item { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center;
              gap: 2px; padding: 8px 4px; margin: 0; }
  .nav-item .ni-ic { font-size: 17px; line-height: 1; }
  .nav-item .ni-lbl { font-size: 10.5px; line-height: 1.1; white-space: nowrap;
                      overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-item .soon-tag, .sidebar .whoami { display: none; }
  .sidebar .spacer { display: none; }
  .app-shell { flex-direction: column; }
  .content { margin-left: 0; }
}

@media (max-width: 480px) {
  .nav-search { display: none; }
}

/* ---------- inputs & buttons ---------- */
input, select, textarea {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 8px 10px; flex: 1; font-size: 14px;
}
input::placeholder, textarea::placeholder { color: var(--ink-500); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent);
  outline-offset: 1px; border-color: var(--accent); }
button {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-btn);
  min-height: 36px; padding: 6px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary, #np-create, #cc-search-btn, #upload-btn, #share-all, #share-selected {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
button.primary:hover, #np-create:hover, #cc-search-btn:hover, #upload-btn:hover,
#share-all:hover, #share-selected:hover { background: var(--accent-ink);
  border-color: var(--accent-ink); color: #fff; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; filter: brightness(1.06); }
button.ghost { background: transparent; }

/* ---------- index / projects list ---------- */
.page-title-row { display: flex; align-items: center; justify-content: space-between;
                  gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.page-title-row h1 { margin: 0; font-size: 28px; line-height: 34px; }
.page-count { color: var(--muted); font-size: 13px; margin: -4px 0 4px; }
.search-input { max-width: 420px; width: 100%; }
.import-box { background: var(--panel); border: 1px solid var(--border);
              border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 12px;
              box-shadow: var(--shadow-1); }
.import-box h2 { margin: 0 0 10px; font-size: 15px; line-height: 22px; }
.import-box.collapsed .box-body { display: none; }
.box-toggle { cursor: pointer; user-select: none; display: flex;
              justify-content: space-between; align-items: center; margin: 0; }
.row { display: flex; gap: 8px; }
#cc-results { list-style: none; margin: 10px 0 0; padding: 0; }
#cc-results li { display: flex; justify-content: space-between; align-items: center;
                 padding: 8px 6px; border-top: 1px solid var(--border); }
#cc-results .meta { font-size: 13px; color: var(--muted); }
.progress { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 10px; background: var(--bg); border-radius: var(--r-chip);
       overflow: hidden; border: 1px solid var(--border); }
.fill { height: 100%; width: 0%; background: var(--accent); transition: width .3s; }

.project-list { background: var(--panel); border: 1px solid var(--border);
                border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-1); }
.project-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.project-card:last-child { border-bottom: 0; }
.project-card:hover { background: var(--ink-100); }
.pc-thumb { width: 56px; height: 56px; border-radius: var(--r-btn); object-fit: cover;
            background: var(--accent-soft); color: var(--accent);
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; flex-shrink: 0; }
.pc-main { min-width: 0; flex: 1; }
.pc-name { font-weight: 600; font-size: 15px; }
.pc-addr { font-size: 13px; color: var(--muted); margin-top: 1px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta { font-size: 13px; color: var(--muted); text-align: right; flex-shrink: 0;
           font-variant-numeric: tabular-nums; }
.pc-del { flex-shrink: 0; background: none; border: none; font-size: 15px; min-height: 0;
          padding: 6px 8px; border-radius: var(--r-btn); opacity: .35; cursor: pointer; }
.pc-del:hover { opacity: 1; background: var(--accent-soft); color: var(--danger); }

/* ---------- project page ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center;
           margin: 6px 0 12px; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-default { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-default button { min-height: 34px; font-size: 13px; }
.toolbar-hint { order: 5; }
/* selection-contextual bar: its own full-width row, only shown with a selection */
.toolbar-selection { flex-basis: 100%; display: flex; align-items: center; gap: 8px;
                     flex-wrap: wrap; padding: 7px 10px; border-radius: var(--r-card);
                     background: var(--accent-soft); border: 1px solid var(--border); }
.toolbar-selection.hidden { display: none; }
.toolbar-selection button { min-height: 32px; font-size: 13px; }
.sel-count { font-weight: 700; color: var(--accent); margin-right: 2px; }
/* overflow (⋯) menu */
.overflow-wrap { position: relative; display: inline-block; }
.overflow-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
                 display: flex; flex-direction: column; min-width: 180px; padding: 4px;
                 background: var(--panel); border: 1px solid var(--border);
                 border-radius: var(--r-card); box-shadow: var(--shadow-2); }
.overflow-menu.hidden { display: none; }
.overflow-menu button { display: block; width: 100%; text-align: left; border: 0; min-height: 0;
                        background: transparent; padding: 8px 10px; border-radius: 7px;
                        cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text); }
.overflow-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.save-state { color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.toggle.small { font-weight: 400; font-size: 12px; letter-spacing: normal; }

/* chronological feed: CompanyCam-style date groups */
.day-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 24px 0 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.day-head .day-title { font-size: 16px; font-weight: 600; }
.day-head .day-count { font-size: 13px; color: var(--muted); }

/* organized view sections */
.photo-section { margin-bottom: 24px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-btn) var(--r-btn) 0 0;
  padding: 8px 14px; font-weight: 600; letter-spacing: .06em; font-size: 13px;
  cursor: grab; text-transform: uppercase;
}
.sec-head.sec-unsorted { background: var(--ink-100); color: var(--ink-500); cursor: default; }
.sec-count { font-weight: 400; font-size: 12px; letter-spacing: normal; opacity: .85; }
.sec-tools { display: flex; align-items: center; gap: 12px; }
.sec-rename, .sec-delete { min-height: 0; background: transparent; border: 0; color: inherit;
              opacity: .55; font-size: 15px; padding: 0 4px; cursor: pointer; }
.sec-rename:hover { opacity: 1; }
.sec-delete:hover { opacity: 1; color: var(--danger); }
.sub-head { background: var(--panel); border: 1px solid var(--border); border-top: 0;
            padding: 5px 14px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
            text-transform: uppercase; color: var(--accent); }
.photo-grid.mid-group { border-radius: 0; border-bottom: 0; }
#add-section { margin: 4px 0 18px; }
.photo-section.sortable-ghost { opacity: .4; }
.section-grid { min-height: 74px; padding: 12px; background: var(--panel);
                border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-btn) var(--r-btn); }

/* edit project name/address */
.icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 16px; min-height: 0;
            opacity: .55; padding: 0 4px; vertical-align: middle; }
.icon-btn:hover { opacity: 1; }
.proj-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.proj-edit input { flex: 1 1 240px; padding: 7px 10px; border: 1px solid var(--border);
                   border-radius: var(--r-card); font-size: 14px; background: var(--surface); color: var(--text); }
.proj-edit-actions { display: flex; gap: 8px; }

/* photo cards — THE GRID FIX (200px min, 16px gap) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: repeat(4, 1fr); gap: 4px; }
}
.card { margin: 0; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--r-card); overflow: hidden; cursor: grab; position: relative; }
.card:hover { box-shadow: var(--shadow-1); border-color: var(--ink-500); }
.card.static { cursor: zoom-in; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.play-badge { position: absolute; top: 8px; right: 8px; background: rgba(14,17,22,.65);
              color: #fff; border-radius: 50%; width: 28px; height: 28px;
              display: flex; align-items: center; justify-content: center;
              font-size: 12px; pointer-events: none; }
.card figcaption { display: flex; gap: 6px; align-items: baseline; padding: 6px 8px;
                   font-size: 13px; color: var(--ink-700); min-height: 28px;
                   overflow: hidden; white-space: nowrap; }
.card .num { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--text); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card .cap { overflow: hidden; text-overflow: ellipsis; color: var(--ink-500); }
.card .lbl { cursor: pointer; }
.card .lbl:empty::before { content: "＋ label"; color: var(--ink-500); font-weight: 500; opacity: .75; }
.card .lbl-edit { font: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                  border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px;
                  width: 100%; max-width: 130px; background: var(--surface); color: var(--text); }
/* Item A: inline compass label dropdown (appended to body, floats over the tile) */
.lbl-menu { position: fixed; z-index: 120; background: var(--surface);
            border: 1px solid var(--border); border-radius: 10px;
            box-shadow: 0 8px 28px rgba(14,17,22,.22); width: 200px; padding: 6px;
            font: 13px/1.4 "Segoe UI", sans-serif; }
.lbl-menu-head { display: flex; align-items: center; justify-content: space-between;
                 padding: 2px 4px 6px; }
.lbl-menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                  color: var(--muted); font-weight: 700; }
.lbl-learn-toggle { background: none; border: 1px solid var(--border); border-radius: 6px;
                    cursor: pointer; font-size: 14px; line-height: 1; padding: 3px 6px; }
.lbl-learn-toggle.on { background: var(--accent-soft); border-color: var(--accent); }
.lbl-menu-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lbl-opt { text-align: left; border: 1px solid var(--border); background: var(--surface);
           border-radius: 7px; padding: 8px; cursor: pointer; font-weight: 600;
           color: var(--text); min-height: 34px; }
.lbl-opt:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lbl-opt.cur { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lbl-menu-free { display: flex; gap: 4px; margin-top: 6px; }
.lbl-menu-free input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border);
                       border-radius: 7px; font: inherit; }
.lbl-menu-free button { padding: 6px 10px; border: 1px solid var(--accent); background: var(--accent);
                        color: #fff; border-radius: 7px; cursor: pointer; font-weight: 600; }
.bulk-learn-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px;
                  font-size: 13.5px; cursor: pointer; }
.bulk-learn-row input { width: auto; }
.card.sortable-ghost { opacity: .35; }
.card.sortable-drag { cursor: grabbing; }

/* select mode */
body.selecting .card { cursor: pointer; }
.card.selected { outline: 2px solid var(--accent); outline-offset: -2px; border-color: var(--accent); border-radius: var(--r-card); }
.card.selected::after { content: "✓"; position: absolute; top: 6px; right: 6px;
                        background: var(--accent); color: #fff; font-weight: 700;
                        width: 22px; height: 22px; border-radius: 50%;
                        display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---------- login ---------- */
.login-page { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; background: var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-modal);
              padding: 32px 36px; text-align: center; width: min(380px, 90vw);
              box-shadow: var(--shadow-2); }
.login-card .logo {
  font-size: 19px; font-weight: 600; color: var(--text); margin: 0 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 0;
}
.login-card .logo span { color: var(--accent); }
.login-card .logo .logo-cam { height: 28px; }
.login-card h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 6px 0 0; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.login-card input { flex: none; }
.login-card button { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.login-card button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.login-error { color: var(--danger); font-size: 13px; }
.login-notice { color: var(--accent); font-size: 13px; }

/* ---------- users page ---------- */
.users-wrap { max-width: 900px; padding: 0 16px 40px; }
.users-table { width: 100%; border-collapse: collapse; margin-top: 8px;
               background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card);
               font-size: 13px; }
.users-table th, .users-table td { text-align: left; padding: 8px 10px;
                                   border-bottom: 1px solid var(--border); }
.users-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                  color: var(--ink-500); font-weight: 600; }
.users-table tr.inactive td { opacity: .45; }
.users-table td input, .users-table td select { width: 100%; min-width: 80px; box-sizing: border-box; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.learn-cell { white-space: nowrap; }
.learn-badge { display: inline-block; padding: 2px 10px; border-radius: 12px;
               font-size: 12px; font-weight: 600; }
.learn-badge.on, .learn-toggle.on { color: var(--ok); }
.learn-badge.on { background: #E4F4EA; }
.learn-badge.off { background: var(--bg); color: var(--muted); }
.learn-toggle.on { border-color: #B6E0C4; }
.learn-toggle.off { color: var(--muted); }
.add-user-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.add-user-form input, .add-user-form select { flex: 1 1 140px; }

/* ---------- share modal ---------- */
.modal { position: fixed; inset: 0; background: var(--overlay); display: flex;
         align-items: center; justify-content: center; z-index: 40; }
.modal.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-modal);
              padding: 18px 20px; width: min(560px, 94vw); max-height: 80vh; overflow-y: auto;
              box-shadow: var(--shadow-2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-head button { background: none; border: 0; min-height: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-head button:hover { color: var(--text); }
.modal-actions { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.share-expiry-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
                    margin: 4px 0 2px; font-size: 13px; }
.share-expiry-row select, .share-expiry-row input { padding: 5px 8px; border: 1px solid var(--border);
                    border-radius: 7px; background: var(--surface); color: var(--text); font-size: 13px; }
.share-exp { margin-top: 1px; }
.share-list li.share-expired { opacity: .6; }
.share-list li.share-expired .share-exp { color: var(--danger); }
.share-list { list-style: none; margin: 8px 0 0; padding: 0; }
.share-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
                 padding: 8px 4px; border-top: 1px solid var(--border); }
.share-info { min-width: 0; }
.share-info div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-tools { display: flex; gap: 6px; flex-shrink: 0; }
.small { font-size: 12px; }

/* ---------- address autocomplete ---------- */
.ac-wrap { position: relative; flex: 1; display: flex; }
.ac-wrap input { width: 100%; }
.ac-list { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 30;
           background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-btn);
           box-shadow: var(--shadow-2); overflow: hidden; }
.ac-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.ac-item:hover { background: var(--accent-soft); }
.ac-item.ac-map { color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); }
.ac-item.ac-map:first-child { border-top: 0; }

/* ---------- roof insights ---------- */
.ri-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ri-table th, .ri-table td { padding: 5px 8px; border-bottom: 1px solid var(--border);
                             text-align: left; }
.ri-table th { color: var(--muted); font-size: 11px; text-transform: uppercase;
               letter-spacing: .06em; }
.ri-summary { font-size: 15px; margin-bottom: 10px; }
.ri-summary b { color: var(--accent); }
.ri-summary span { color: var(--muted); font-size: 12.5px; }
.ri-hint { color: var(--ink-500); font-size: 11.5px; margin-top: 10px; }
.ri-warn { background: #FBF3DC; border: 1px solid #E4CE8C; border-radius: var(--r-btn);
           padding: 8px 10px; font-size: 12.5px; color: var(--warn); margin-bottom: 10px; }
.ri-cols { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ri-cols .ri-table:first-child { flex: 0 0 200px; width: auto; }
.ri-cols .ri-table:last-child { flex: 1; }
.ri-actions { margin-top: 12px; }
.ri-pdf { display: inline-block; background: var(--accent); color: #fff; font-weight: 600;
          font-size: 13px; padding: 7px 14px; border-radius: var(--r-btn); text-decoration: none; }
.ri-pdf:hover { background: var(--accent-ink); }
.ri-gate { background: #E4F4EA; border: 1px solid #9FD8B0; border-radius: var(--r-btn);
           padding: 8px 12px; font-size: 12.5px; margin: 10px 0 4px; color: var(--ok); }
.ri-lengths-title { font-size: 11px; text-transform: uppercase; color: var(--muted);
                    margin: 16px 0 6px; letter-spacing: .06em; }
.ri-len-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ri-len-table th, .ri-len-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.ri-len-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.ri-len-table td.num, .ri-len-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ri-len-table .derived td { background: var(--accent-soft); font-weight: 600; }
.ri-badge { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 20px;
            padding: 1px 8px; vertical-align: 1px; }
.ri-badge.ok { background: #E4F4EA; color: var(--ok); }
.ri-badge.warn { background: #FBF3DC; color: var(--warn); }
.ri-badge.na { background: var(--ink-100); color: var(--ink-500); }
.ri-diagram { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-btn); max-width: 100%; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: var(--overlay);
            display: flex; align-items: center; justify-content: center; z-index: 50; }
.lb-inner { background: var(--panel); border-radius: var(--r-modal); overflow-y: auto;
            max-width: min(1100px, 94vw); max-height: 92vh; display: flex; flex-direction: column;
            box-shadow: var(--shadow-2); }
#lb-img { max-width: 100%; max-height: min(70vh, calc(92vh - 240px)); object-fit: contain; background: var(--ink-900); }
#lb-video { max-width: 100%; max-height: min(70vh, calc(92vh - 240px)); background: #000; }
.lb-meta { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.lb-line { font-size: 13px; }
.lb-fields { display: flex; gap: 8px; }
.lb-fields input { flex: 1; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---------- job stage chips ---------- */
.status-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; background: #9e9e9e;
  border: none; vertical-align: middle; margin-left: 6px;
}
select.status-chip { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 14px;
                     min-height: 0; }
.st-lead { background: #9e9e9e; }
.st-inspected { background: #f9a825; }
.st-claim-filed { background: #fb8c00; }
.st-approved { background: #43a047; }
.st-scheduled { background: #1e88e5; }
.st-built { background: #5e35b1; }
.st-paid { background: #00897b; }
#status-filter { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); }

/* ---------- map stage pins ---------- */
.stage-pin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(14,17,22,.45);
}

/* ---------- sidebar search ---------- */
.nav-search { padding: 4px 12px 10px; }
.nav-search input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-btn);
  background: var(--ink-100); color: var(--text); font-size: 13px;
}
.nav-search input::placeholder { color: var(--ink-500); }

/* ---------- duplicate finder ---------- */
.dupe-group {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: 10px; background: var(--ink-100);
}
.dupe-item { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.dupe-item img { width: 130px; height: 98px; object-fit: cover; border-radius: var(--r-btn); }
.dupe-meta { font-size: 12px; color: var(--ink-700); text-align: center; }

/* ---------- markup editor ---------- */
.markup-modal {
  position: fixed; inset: 0; z-index: 3000; background: rgba(14,17,22,.92);
  display: flex; align-items: center; justify-content: center;
}
.markup-modal.hidden { display: none; }
.markup-inner { display: flex; flex-direction: column; gap: 10px; max-width: 96vw; max-height: 94vh; }
.markup-toolbar {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  background: #1d2730; padding: 8px 12px; border-radius: var(--r-card); flex-wrap: wrap;
}
.markup-toolbar button { cursor: pointer; }
.mk-tool { font-size: 16px; padding: 5px 10px; border-radius: var(--r-btn); border: 1px solid #3c4a56; background: #26323d; color: #fff; min-height: 0; }
.mk-tool.active { background: var(--accent); border-color: var(--accent); }
.mk-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; min-height: 0; padding: 0; }
.mk-color.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.mk-actions button { padding: 6px 12px; border-radius: var(--r-btn); }
.mk-zoom { display: flex; gap: 6px; }
.mk-zoom button { font-size: 15px; min-width: 38px; padding: 5px 10px; border-radius: var(--r-btn);
                  border: 1px solid #3c4a56; background: #26323d; color: #fff; min-height: 0; }
.markup-canvas-wrap { overflow: hidden; display: flex; justify-content: center;
                      border-radius: var(--r-btn); }
#mk-canvas {
  max-width: 92vw; max-height: 78vh; width: auto; height: auto;
  border-radius: var(--r-btn); cursor: crosshair; touch-action: none;
  transform-origin: 0 0;
}

/* ---------- Zillow cover card (project page) ---------- */
.cover-card { display: block; max-width: 460px; margin: 10px 0 16px; text-decoration: none;
              color: var(--text); background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-1); }
a.cover-card:hover { box-shadow: var(--shadow-2); }
.cc-photos { position: relative; aspect-ratio: 16 / 9; background: var(--ink-300); }
.cc-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
            scrollbar-width: none; overscroll-behavior-x: contain; }
.cc-track::-webkit-scrollbar { display: none; }
.cc-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover;
                scroll-snap-align: start; scroll-snap-stop: always; }
.cc-chip { position: absolute; top: 10px; left: 10px; background: var(--surface); color: var(--text);
           font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
           box-shadow: var(--shadow-1); display: flex; align-items: center; gap: 6px; }
.cc-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cc-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
          width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; border: 0;
          background: rgba(255,255,255,.92); color: var(--ink-900); font-size: 20px; line-height: 1;
          display: flex; align-items: center; justify-content: center; cursor: pointer;
          box-shadow: var(--shadow-1); opacity: 0; transition: opacity .15s; }
.cc-nav:hover { color: var(--ink-900); background: #fff; border: 0; }
.cc-prev { left: 10px; }
.cc-next { right: 10px; }
.cover-card:hover .cc-nav { opacity: 1; }
@media (hover: none) { .cc-nav { opacity: .85; } }
.cc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 6px;
           justify-content: center; pointer-events: none; }
.cc-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55);
          box-shadow: 0 0 2px rgba(14,17,22,.4); transition: transform .15s, background .15s; }
.cc-dot.on { background: #fff; transform: scale(1.3); }
.cc-info { padding: 12px 16px 14px; }
.cc-price { font-size: 26px; line-height: 30px; font-weight: 800; letter-spacing: -.01em; }
.cc-facts { font-size: 14.5px; color: var(--ink-700); margin-top: 3px; }
.cc-facts b { color: var(--text); font-weight: 700; }
.cc-facts .sep { color: var(--ink-300); margin: 0 7px; }
.cc-addr { font-size: 13.5px; color: var(--ink-700); margin-top: 4px; }
.cc-zillow { color: #006AFF; font-weight: 700; margin-left: 8px; font-size: 12.5px; white-space: nowrap; }
a.cover-card:hover .cc-addr { text-decoration: underline; }
.cc-empty { height: 100%; display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: 6px; font-size: 34px; color: var(--ink-500);
            background: linear-gradient(160deg, var(--ink-100), var(--ink-300)); }
.cc-empty span { font-size: 13px; }
.cc-sv { width: 100%; height: 100%; border: 0; display: block; }
.cc-addr-link { display: block; text-decoration: none; color: var(--ink-700); }
.cc-addr-link:hover { text-decoration: underline; }
/* job photos exist: Zillow shrinks to a corner link (lower right, out of the way) */
.zmini { position: fixed; right: 18px; bottom: 18px; z-index: 25;
         display: flex; align-items: center; gap: 10px; max-width: 260px;
         background: var(--surface); border: 1px solid var(--border);
         border-radius: var(--r-card); padding: 8px 12px 8px 8px;
         box-shadow: var(--shadow-2); text-decoration: none; color: var(--text); }
.zmini:hover { border-color: #006AFF; }
.zmini img { width: 56px; height: 42px; object-fit: cover; border-radius: var(--r-btn); }
.zmini-ico { width: 56px; height: 42px; display: flex; align-items: center;
             justify-content: center; font-size: 22px; background: var(--accent-soft);
             border-radius: var(--r-btn); }
.zmini-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.zmini-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zmini-txt span { font-size: 11.5px; color: #006AFF; font-weight: 700; }
header .zaddr { color: inherit; }
header .zaddr:hover { color: #006AFF; }
/* projects list: address opens Zillow (span, not <a> — cards are anchors already) */
.pc-addr .pc-zaddr { cursor: pointer; }
.pc-addr .pc-zaddr:hover { color: #006AFF; text-decoration: underline; }

/* ---------- hidden (internal / team-only) photos ---------- */
.card .hidden-badge { display: none; }
.card.hidden-photo { display: none; }
#photo-gallery.show-hidden .card.hidden-photo { display: block; opacity: .55; }
#photo-gallery.show-hidden .card.hidden-photo img { outline: 2px dashed var(--warn); outline-offset: -2px; }
#photo-gallery.show-hidden .card.hidden-photo .hidden-badge {
  display: block; position: absolute; top: 6px; left: 6px;
  background: rgba(14,17,22,.55); border-radius: var(--r-btn); padding: 1px 6px; font-size: 13px;
}
#hidden-toggle.active { background: var(--warn); border-color: var(--warn); color: #fff; }
