/* ============================================================================
 * Fieldwork Connect — Brand & component system
 * Industrial black / steel-gray to match the FIELDWORK CONNECT wordmark.
 * Loaded on every page; pages may also inline :root tokens for offline
 * self-containment. Tap targets >=44px, touch inputs >=16px (no iOS zoom).
 * ========================================================================== */

:root {
  /* Core ink & steel */
  --ink:        #141414;
  --ink-2:      #1f1f1f;
  --ink-3:      #2b2b2b;
  --steel:      #6b7280;
  --steel-2:    #9ca3af;
  --steel-3:    #c7cbd1;

  /* Surfaces */
  --bg:         #f5f5f4;
  --surface:    #ffffff;
  --surface-2:  #fafafa;
  --border:     #e5e5e5;
  --border-2:   #d4d4d4;

  /* Text */
  --text:       #141414;
  --muted:      #6b7280;
  --faint:      #9ca3af;

  /* Brand accent (steel-blue, used sparingly for focus/links) */
  --accent:     #2563eb;

  /* Schedule status palette — doubles as the TeamGantt color code */
  --st-red:     #dc2626;   /* Emergency / high priority */
  --st-yellow:  #eab308;   /* Locked start date */
  --st-green:   #16a34a;   /* Ready, schedule flexible */
  --st-blue:    #2563eb;   /* Tentative / bid */
  --st-gray:    #9ca3af;   /* Potential / not yet awarded */

  --st-red-t:    #fef2f2;
  --st-yellow-t: #fefce8;
  --st-green-t:  #f0fdf4;
  --st-blue-t:   #eff6ff;
  --st-gray-t:   #f3f4f6;

  /* Feedback */
  --ok:    #16a34a;
  --warn:  #d97706;
  --danger:#dc2626;

  --radius:    10px;
  --radius-lg: 14px;
  --radius-sm: 7px;

  --shadow:    0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-cond: 'Archivo', 'Oswald', 'Arial Narrow', var(--font-sans);

  --topbar-h: 54px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* clip the off-screen slide-out nav drawer so no page scrolls sideways */
}

h1, h2, h3, .cond {
  font-family: var(--font-cond);
  letter-spacing: .01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------- Topbar / chrome ---------------------------- */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h);
  padding: 0 14px;
  background: linear-gradient(180deg, #141414, #1f1f1f);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.35), 0 2px 12px rgba(0,0,0,.18);
}
header.topbar a.home {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
}
header.topbar a.home img { height: 26px; width: auto; display: block; }
header.topbar a.home img.fw-logo-img { height: 32px; border-radius: 4px; background: #fff; }
@media (max-width: 600px) { header.topbar a.home img.fw-logo-img { height: 28px; } }
header.topbar .wordmark {
  font-family: var(--font-cond);
  font-weight: 800; font-size: 18px; letter-spacing: .02em;
  text-transform: uppercase; color: #fff;
}
header.topbar .wordmark .light { color: var(--steel-2); }
header.topbar .module {
  font-family: var(--font-cond);
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  font-size: 13px; color: var(--steel-2);
  padding-left: 12px; margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,.15);
}
header.topbar .spacer { flex: 1; }
.fw-offline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #fbbf24; background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.4); border-radius: 999px; padding: 3px 10px; margin-left: 10px; white-space: nowrap; }
.fw-offline[hidden] { display: none; }
/* Neutral loading placeholder — pages show this (not their empty state) until fwHydrated(). */
.fw-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 16px; color: var(--muted); font-weight: 600; }
.fw-loading::before { content: ''; width: 16px; height: 16px; border: 2px solid var(--border-2); border-top-color: var(--steel); border-radius: 50%; animation: fw-spin .7s linear infinite; }
@keyframes fw-spin { to { transform: rotate(360deg); } }

.fw-userchip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: #e5e5e5;
}
.fw-userchip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-green); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.fw-userchip .dot.off { background: var(--steel); box-shadow: none; }
.fw-userchip a { color: var(--steel-2); font-size: 12px; }

/* Hamburger + slide nav */
.fw-navbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px;
  border: none; background: transparent; color: #fff; cursor: pointer;
  border-radius: 8px; font-size: 20px;
}
.fw-navbtn:hover { background: rgba(255,255,255,.1); }
.fw-navbtn.fw-bell { position: relative; text-decoration: none; }
.fw-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--st-red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--ink); }
.fw-nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .16s ease; z-index: 98;
}
.fw-nav-overlay.open { opacity: 1; pointer-events: auto; }
.fw-nav-drawer {
  position: fixed; top: 0; right: 0; height: 100%; max-height: 100dvh; width: 280px; max-width: 84vw;
  background: var(--ink); color: #fff; z-index: 99;
  transform: translateX(100%); transition: transform .18s ease;
  display: flex; flex-direction: column; padding: 14px 0;
  box-shadow: -8px 0 30px rgba(0,0,0,.4);
  overflow-y: auto; -webkit-overflow-scrolling: touch; /* long menus stay reachable on short screens */
}
.fw-nav-drawer.open { transform: translateX(0); }
.fw-nav-drawer .head {
  padding: 6px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.12);
  font-family: var(--font-cond); font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
}
.fw-nav-drawer a.link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; color: #e5e5e5; text-decoration: none;
  font-size: 15px; min-height: 44px;
}
.fw-nav-drawer a.link:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.fw-nav-drawer a.link.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }
/* Drawer footer: who's signed in + Sign out. On phones this is the ONLY home for sign-out —
 * the topbar identity chip is hidden ≤600px (see the media rule below) so the four action
 * buttons always fit the viewport. */
.fw-nav-drawer .fw-nav-foot { border-top: 1px solid rgba(255,255,255,.12); margin-top: auto; padding: 12px 18px 4px; font-size: 13px; color: var(--steel-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fw-nav-drawer .fw-nav-foot a { color: #fff; min-height: 44px; display: inline-flex; align-items: center; }
.fw-nav-drawer .fw-nav-foot .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-green); flex: none; }
.fw-nav-drawer .fw-nav-foot .dot.off { background: var(--steel); }

/* -------------------------------- Layout -------------------------------- */
.page { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; text-transform: uppercase; }
.page-head .sub { color: var(--muted); font-size: 14px; }

/* -------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .05s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* Touch devices: small buttons stay compact on desktop (fine pointer) but meet the 44px
   tap-target rule on phones/tablets. Applies app-wide so every .btn-sm is field-friendly. */
@media (pointer: coarse) { .btn-sm { min-height: 44px; padding-top: 8px; padding-bottom: 8px; } }

/* --------------------------------- 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: 14px; }

/* --------------------------------- Tags --------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--st-gray-t); color: var(--ink-3);
}
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge.admin { background: #111; color: #fff; }
.badge.member { background: var(--st-gray-t); color: var(--ink-3); }

/* Status chips (schedule color code) */
.st-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; }
.st-chip .sw { width:11px; height:11px; border-radius:3px; }
.sw-red{background:var(--st-red)} .sw-yellow{background:var(--st-yellow)}
.sw-green{background:var(--st-green)} .sw-blue{background:var(--st-blue)} .sw-gray{background:var(--st-gray)}

/* -------------------------------- Inputs -------------------------------- */
input, select, textarea {
  font: inherit; font-size: 16px; /* >=16px: no iOS zoom */
  padding: 9px 11px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
/* Keyboard focus ring for every interactive control (nav tiles, buttons, links, custom
   role=button rows) — not just form fields. Mouse/touch clicks don't trigger :focus-visible. */
.btn:focus-visible, a:focus-visible, button:focus-visible, .tile:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.40); border-radius: 8px;
}
/* Respect reduced-motion for vestibular comfort — kill transitions/animations/hover lifts. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .tile:hover, .card:hover { transform: none !important; }
}
label.fld { display: block; margin: 10px 0; }
label.fld > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

/* -------------------------------- Modals -------------------------------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,20,20,.5);
  display: none; align-items: center; justify-content: center; z-index: 80; padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  position: relative; /* anchor the top-right × */
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto; padding: 20px;
}
.modal h2 { margin: 0 0 12px; font-size: 20px; }
/* Standard top-right close affordance for any card/detail modal (injected by fwAddModalClose as the
   panel's FIRST child). STICKY + float so it stays pinned to the top-right and visible while the
   modal body scrolls; the negative bottom margin keeps it from consuming a line (the title flows up
   beside it). 44×44 on every device (incl. desktop mouse) so it always meets the tap-target rule. */
.modal-x {
  position: sticky; top: 4px; float: right;
  margin: -4px -4px -44px 8px;
  width: 44px; height: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--surface); color: var(--muted);
  font-size: 24px; line-height: 1; border-radius: 10px; cursor: pointer; z-index: 3;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -------------------------------- Toasts -------------------------------- */
/* z-index 320: toasts must be visible above EVERY surface — the doc viewer (200), the daily-report
 * lightbox (300), and the shared image lightbox (310) were swallowing upload/save confirmations. */
.fw-toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 320; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }

/* Shared image lightbox (window.fwImageLightbox) — replaces open-in-new-tab for attachment photos
 * so there is always a way back (✕ / backdrop / Esc). z 310: above the doc viewer + dr-lightbox,
 * below toasts. */
#fw-lb { position: fixed; inset: 0; z-index: 310; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center; }
#fw-lb .fw-lb-img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
#fw-lb .fw-lb-x { position: absolute; top: 10px; right: 12px; width: 48px; height: 48px; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; border-radius: 999px; cursor: pointer; }
#fw-lb .fw-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 64px; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; border-radius: 10px; }
#fw-lb .fw-lb-prev { left: 8px; } #fw-lb .fw-lb-next { right: 8px; }
#fw-lb .fw-lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; font-weight: 600; background: rgba(0,0,0,.4); padding: 4px 12px; border-radius: 999px; }
@media (pointer: coarse) { #fw-lb .fw-lb-x { width: 52px; height: 52px; } }

/* ---- shared card kit (labels + checklists) — fw-cardkit.js K.mount ---- */
.ck-members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.ck-mem { display: inline-flex; align-items: center; gap: 3px; width: 30px; height: 30px; justify-content: center; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; position: relative; }
.ck-mem .ck-rm-mem { position: absolute; top: -5px; right: -5px; border: 0; background: #dc2626; color: #fff; border-radius: 999px; width: 15px; height: 15px; line-height: 13px; font-size: 11px; cursor: pointer; padding: 0; }
.ck-add-mem { border: 1px dashed var(--border-2, #d4d4d4); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; min-height: 30px; cursor: pointer; }
.ck-add-mem:hover { color: var(--ink); border-color: var(--muted); }
.ck-mem-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.ck-mem-opt { display: flex; align-items: center; gap: 7px; font-size: 14px; padding: 5px 2px; cursor: pointer; }
.ck-face .ck-mem-dot { width: 18px; height: 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase; }
@media (pointer: coarse) { .ck-mem, .ck-add-mem { min-height: 40px; } .ck-mem { width: 40px; height: 40px; } .ck-mem-opt { padding: 8px 2px; } }
.ck-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.ck-chip { display: inline-flex; align-items: center; gap: 4px; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; line-height: 1.4; min-height: 22px; }
.ck-chip .ck-rm-lbl { border: 0; background: rgba(255,255,255,.35); color: #fff; border-radius: 999px; width: 16px; height: 16px; line-height: 14px; font-size: 12px; cursor: pointer; padding: 0; }
.ck-add-lbl { border: 1px dashed var(--border-2, #d4d4d4); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; min-height: 26px; cursor: pointer; }
.ck-add-lbl:hover { color: var(--ink); border-color: var(--muted); }
.ck-prog { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.ck-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: var(--st-green, #16a34a); transition: width .15s; }
.ck-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.ck-item input { width: 20px; height: 20px; flex: none; }
.ck-item span { flex: 1; overflow-wrap: anywhere; }
.ck-item.done span { text-decoration: line-through; color: var(--muted); }
.ck-item .ck-rm { border: 0; background: transparent; color: var(--faint); font-size: 16px; cursor: pointer; padding: 0 4px; }
.ck-item .ck-rm:hover { color: #b91c1c; }
.ck-add { display: flex; gap: 6px; margin-top: 6px; }
.ck-add input { flex: 1; min-width: 0; font-size: 16px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.ck-add button { flex: none; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; color: var(--ink); }
@media (pointer: coarse) { .ck-item input { width: 24px; height: 24px; } .ck-add button, .ck-add-lbl { min-height: 44px; } .ck-item .ck-rm { padding: 0 10px; } }
.ck-pal { position: absolute; z-index: 340; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px; width: 210px; }
.ck-pal .ck-pal-text { width: 100%; font-size: 16px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface); color: var(--ink); }
.ck-pal-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ck-pal-c { height: 30px; border: 0; border-radius: 6px; cursor: pointer; }
/* card-face chip strip (compact, no remove button) reuses .ck-chip via a .ck-face wrapper */
.ck-face { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ck-face .ck-dot { width: 30px; height: 8px; border-radius: 999px; }
.fw-toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); max-width: 90vw;
  animation: fwToastIn .18s ease; pointer-events: auto;
}
.fw-toast.ok    { background: #14532d; }
.fw-toast.error { background: #7f1d1d; }
.fw-toast.warn  { background: #78350f; }
@keyframes fwToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------------------------- Sync progress ---------------------------- */
#fw-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--st-red); z-index: 200; transition: width .2s ease, opacity .3s ease;
}

/* --------------------------------- Utils -------------------------------- */
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }

/* ----------------------------- attachments ----------------------------- */
.fw-atts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fw-atts .att { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fw-atts .att img { width: 100%; height: 100%; object-fit: cover; }
.fw-atts .att .doc { font-size: 10px; padding: 4px; text-align: center; word-break: break-all; color: var(--muted); }
.fw-atts .att .up { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.fw-atts .att .rm { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.fw-atts .addbtn { width: 64px; height: 64px; min-height: 44px; border-radius: 8px; border: 1px dashed var(--border-2); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.fw-atts .addbtn:hover { background: var(--surface-2); }

/* ------------------------------ doc viewer ------------------------------ */
.fw-viewer { position: fixed; inset: 0; z-index: 200; background: #1a1a1a; display: flex; flex-direction: column; }
.bv-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #111; color: #fff; overflow-x: auto; flex: none; }
.bv-bar .bv-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.bv-sp { flex: 1; }
.bv-btn { min-width: 44px; height: 44px; border: none; background: #262626; color: #fff; border-radius: 7px; font-size: 16px; cursor: pointer; flex: none; }
.bv-textinput { font-size: 16px; padding: 7px 9px; border-radius: 6px; border: 2px solid var(--accent); background: #fff; color: #111; width: 210px; max-width: 60vw; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.bv-btn.on { background: var(--accent); }
.bv-btn.bv-save { background: var(--st-green); font-size: 14px; padding: 0 12px; font-weight: 700; }
.bv-colors { display: inline-flex; gap: 3px; }
.bv-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #444; cursor: pointer; padding: 0; }
.bv-color.on { border-color: #fff; }
.bv-pages { flex: 1; overflow: auto; padding: 12px; text-align: center; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.bv-page { position: relative; display: inline-block; margin: 0 auto 12px; box-shadow: 0 4px 20px rgba(0,0,0,.5); background: #fff; } /* no max-width: allow zoom past fit-width, .bv-pages scrolls */
.bv-page canvas.bv-overlay ~ canvas, .bv-page > canvas:first-child { display: block; width: 100%; height: auto; }
.bv-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-x pan-y; }
.bv-pages.drawing .bv-overlay { touch-action: none; cursor: crosshair; }
.bv-loading { color: #ccc; padding: 40px; }

/* ---------------------------- job documents ---------------------------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); }
.doc-card .doc-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.doc-card .thumb { height: 96px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--steel); }
.doc-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .meta { padding: 8px 10px; }
.doc-card .meta .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card .meta .sub { font-size: 11px; color: var(--muted); }
.doc-card .badge2 { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--st-blue-t); color: #1e40af; margin-top: 3px; }
.doc-card .cached { color: var(--st-green); }

/* Access-denied overlay for permission gating */
.fw-denied {
  position: fixed; inset: var(--topbar-h) 0 0 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 70; padding: 24px;
  overflow: auto;
}
.fw-denied .box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; max-width: 420px; text-align: center; box-shadow: var(--shadow); }

@media (max-width: 600px) {
  .page { padding: 14px 12px 60px; }
  .page-head h1 { font-size: 22px; }
  header.topbar .wordmark { font-size: 16px; }
  header.topbar .module { display: none; }
  /* Phones: the fixed-width topbar pieces (wordmark + name chip + FOUR 44px buttons) exceeded
   * narrow viewports — flexbox can't shrink them, so the FEEDBACK and MENU buttons were pushed
   * clean off-screen (427px layout on a 375px phone; "Sam has no feedback button"). Hide the
   * identity chip here (it moves to the nav-drawer footer — sign-out stays reachable) and
   * tighten gaps: 20 + 80 logo + 5×6 gaps + 4×44 buttons = 306px, safe down to 320px. */
  header.topbar { gap: 6px; padding: 0 10px; }
  header.topbar .fw-userchip { display: none; }
  /* The Offline pill must not re-blow the width budget (offline is exactly when crews are on
   * phones): float it just below the bar instead of occupying flex space in it. */
  .fw-offline { position: absolute; top: calc(var(--topbar-h) + 4px); right: 8px; margin-left: 0; z-index: 49; }
}

/* ============================================================================
 * Shared line-icon system (Phase 8 UI refresh)
 * SVG mask-image icons, colored by currentColor so they inherit each context and
 * stay NEUTRAL by default (color is reserved for KPIs). Defined in the render-
 * blocking stylesheet so they are always available (no JS timing, offline-safe).
 * ========================================================================== */
.fw-ico { display:inline-block; width:22px; height:22px; flex:none; background-color:currentColor;
  -webkit-mask:no-repeat center / contain; mask:no-repeat center / contain; }
.fw-navbtn .fw-ico { width:22px; height:22px; }
.fw-nav-drawer a.link .fw-ico { opacity:.78; }
.fw-nav-drawer a.link:hover .fw-ico, .fw-nav-drawer a.link.active .fw-ico { opacity:1; }
.fw-ico-home{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5.5 10v9.5h13V10'/%3E%3Cpath d='M9.5 19.5V14h5v5.5'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5.5 10v9.5h13V10'/%3E%3Cpath d='M9.5 19.5V14h5v5.5'/%3E%3C/svg%3E")}
.fw-ico-myday{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E")}
.fw-ico-scheduler{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.5v15'/%3E%3Crect x='7' y='6' width='9' height='3' rx='1.2'/%3E%3Crect x='10' y='10.5' width='8' height='3' rx='1.2'/%3E%3Crect x='7' y='15' width='6' height='3' rx='1.2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.5v15'/%3E%3Crect x='7' y='6' width='9' height='3' rx='1.2'/%3E%3Crect x='10' y='10.5' width='8' height='3' rx='1.2'/%3E%3Crect x='7' y='15' width='6' height='3' rx='1.2'/%3E%3C/svg%3E")}
.fw-ico-board{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='4.5' height='15' rx='1.2'/%3E%3Crect x='9.75' y='4.5' width='4.5' height='9' rx='1.2'/%3E%3Crect x='16' y='4.5' width='4.5' height='12' rx='1.2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='4.5' height='15' rx='1.2'/%3E%3Crect x='9.75' y='4.5' width='4.5' height='9' rx='1.2'/%3E%3Crect x='16' y='4.5' width='4.5' height='12' rx='1.2'/%3E%3C/svg%3E")}
.fw-ico-documents{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7A1.5 1.5 0 0 0 5.5 5v14A1.5 1.5 0 0 0 7 20.5h10A1.5 1.5 0 0 0 18.5 19V8.5z'/%3E%3Cpath d='M13.5 3.5V8.5h5'/%3E%3Cpath d='M8.5 13h7'/%3E%3Cpath d='M8.5 16.5h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7A1.5 1.5 0 0 0 5.5 5v14A1.5 1.5 0 0 0 7 20.5h10A1.5 1.5 0 0 0 18.5 19V8.5z'/%3E%3Cpath d='M13.5 3.5V8.5h5'/%3E%3Cpath d='M8.5 13h7'/%3E%3Cpath d='M8.5 16.5h7'/%3E%3C/svg%3E")}
.fw-ico-chat{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.6a7.6 7.6 0 0 1-10.9 6.9L4 20l1.5-4.9A7.6 7.6 0 1 1 20 11.6z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.6a7.6 7.6 0 0 1-10.9 6.9L4 20l1.5-4.9A7.6 7.6 0 1 1 20 11.6z'/%3E%3C/svg%3E")}
.fw-ico-po{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5.5' y='4.5' width='13' height='15.5' rx='2'/%3E%3Cpath d='M9 4.5V3.9A1.4 1.4 0 0 1 10.4 2.5h3.2A1.4 1.4 0 0 1 15 3.9v.6z'/%3E%3Cpath d='M9 10h6'/%3E%3Cpath d='M9 13.5h6'/%3E%3Cpath d='M9 17h4'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5.5' y='4.5' width='13' height='15.5' rx='2'/%3E%3Cpath d='M9 4.5V3.9A1.4 1.4 0 0 1 10.4 2.5h3.2A1.4 1.4 0 0 1 15 3.9v.6z'/%3E%3Cpath d='M9 10h6'/%3E%3Cpath d='M9 13.5h6'/%3E%3Cpath d='M9 17h4'/%3E%3C/svg%3E")}
.fw-ico-expenses{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h12v17l-2-1.3-2 1.3-2-1.3-2 1.3-2-1.3-2 1.3z'/%3E%3Cpath d='M9 8h6'/%3E%3Cpath d='M9 11.5h6'/%3E%3Cpath d='M9 15h4'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h12v17l-2-1.3-2 1.3-2-1.3-2 1.3-2-1.3-2 1.3z'/%3E%3Cpath d='M9 8h6'/%3E%3Cpath d='M9 11.5h6'/%3E%3Cpath d='M9 15h4'/%3E%3C/svg%3E")}
.fw-ico-reports{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Crect x='5.4' y='12' width='3.2' height='6' rx='0.8'/%3E%3Crect x='10.4' y='8' width='3.2' height='10' rx='0.8'/%3E%3Crect x='15.4' y='5' width='3.2' height='13' rx='0.8'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Crect x='5.4' y='12' width='3.2' height='6' rx='0.8'/%3E%3Crect x='10.4' y='8' width='3.2' height='10' rx='0.8'/%3E%3Crect x='15.4' y='5' width='3.2' height='13' rx='0.8'/%3E%3C/svg%3E")}
.fw-ico-bids{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Ccircle cx='12' cy='12' r='1.1' fill='%23000' stroke='none'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Ccircle cx='12' cy='12' r='1.1' fill='%23000' stroke='none'/%3E%3C/svg%3E")}
.fw-ico-admin{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5.5c0 4.3 3 7.7 7 9.5 4-1.8 7-5.2 7-9.5V6z'/%3E%3Cpath d='M9 12l2.2 2.2L15 10.3'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5.5c0 4.3 3 7.7 7 9.5 4-1.8 7-5.2 7-9.5V6z'/%3E%3Cpath d='M9 12l2.2 2.2L15 10.3'/%3E%3C/svg%3E")}
.fw-ico-guide{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.6 9.2a2.5 2.5 0 0 1 4.2 1.6c0 1.7-2.3 2-2.3 3.4'/%3E%3Ccircle cx='11.5' cy='16.9' r='0.5' fill='%23000' stroke='none'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.6 9.2a2.5 2.5 0 0 1 4.2 1.6c0 1.7-2.3 2-2.3 3.4'/%3E%3Ccircle cx='11.5' cy='16.9' r='0.5' fill='%23000' stroke='none'/%3E%3C/svg%3E")}
.fw-ico-bell{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 10.5a5.5 5.5 0 0 1 11 0c0 4 1.5 5.5 1.5 5.5H5s1.5-1.5 1.5-5.5z'/%3E%3Cpath d='M10 19a2 2 0 0 0 4 0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 10.5a5.5 5.5 0 0 1 11 0c0 4 1.5 5.5 1.5 5.5H5s1.5-1.5 1.5-5.5z'/%3E%3Cpath d='M10 19a2 2 0 0 0 4 0'/%3E%3C/svg%3E")}
.fw-ico-feedback{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 5.5A1.5 1.5 0 0 1 6 4h12a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 18 15H9l-4 3.5V15H6a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3Ccircle cx='9' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3Ccircle cx='12' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3Ccircle cx='15' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 5.5A1.5 1.5 0 0 1 6 4h12a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 18 15H9l-4 3.5V15H6a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3Ccircle cx='9' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3Ccircle cx='12' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3Ccircle cx='15' cy='9.5' r='0.6' fill='%23000' stroke='none'/%3E%3C/svg%3E")}
.fw-ico-menu{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E")}

.fw-ico-activity{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l2.5 7 5-14 2.5 7h4'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l2.5 7 5-14 2.5 7h4'/%3E%3C/svg%3E")}
.fw-ico-map{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.4-6-10a6 6 0 0 1 12 0c0 4.6-6 10-6 10z'/%3E%3Ccircle cx='12' cy='11' r='2.3'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.4-6-10a6 6 0 0 1 12 0c0 4.6-6 10-6 10z'/%3E%3Ccircle cx='12' cy='11' r='2.3'/%3E%3C/svg%3E")}
.fw-ico-crew{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.5' cy='8' r='3'/%3E%3Cpath d='M3 19v-1a4.5 4.5 0 0 1 4.5-4.5h2A4.5 4.5 0 0 1 14 18v1'/%3E%3Cpath d='M16 5.2a3 3 0 0 1 0 5.6'/%3E%3Cpath d='M17.5 13.6A4 4 0 0 1 21 17.5V19'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.5' cy='8' r='3'/%3E%3Cpath d='M3 19v-1a4.5 4.5 0 0 1 4.5-4.5h2A4.5 4.5 0 0 1 14 18v1'/%3E%3Cpath d='M16 5.2a3 3 0 0 1 0 5.6'/%3E%3Cpath d='M17.5 13.6A4 4 0 0 1 21 17.5V19'/%3E%3C/svg%3E")}
.fw-ico-plus{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E")}

/* Quick-add popover (the topbar "+" — fast field capture) */
.fw-qa-pop{position:fixed;top:calc(var(--topbar-h) + 4px);right:8px;z-index:180;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.18);padding:6px;display:flex;flex-direction:column;gap:2px;min-width:250px;max-width:calc(100vw - 16px)}
.fw-qa-item{display:flex;align-items:center;gap:11px;padding:10px 12px;background:none;border:0;border-radius:9px;cursor:pointer;text-align:left;color:var(--ink);width:100%;min-height:48px}
.fw-qa-item:hover,.fw-qa-item:focus{background:var(--surface-2);outline:none}
.fw-qa-item .ic{font-size:22px;flex:0 0 auto;line-height:1}
.fw-qa-item .tx b{display:block;font-size:14px;font-weight:700}
.fw-qa-item .tx small{display:block;font-size:12px;color:var(--muted);margin-top:1px}

/* Pull-to-refresh indicator (touch) */
#fw-ptr{position:fixed;top:0;left:50%;transform:translateX(-50%);z-index:150;display:none;align-items:center;gap:7px;padding:7px 14px;background:var(--surface);border:1px solid var(--border);border-radius:999px;box-shadow:var(--shadow-sm);font-size:12px;font-weight:700;color:var(--muted);pointer-events:none;white-space:nowrap}
#fw-ptr.show{display:inline-flex}
#fw-ptr.armed{color:var(--ink)}
#fw-ptr .ico{font-size:14px;display:inline-block}
#fw-ptr.busy .ico{animation:fw-ptr-spin .8s linear infinite}
@keyframes fw-ptr-spin{to{transform:rotate(360deg)}}
