/* =========================================================
   PRIMOX SEM — Field Experience Styles
   Loaded for engineer role only, alongside app.css.
   Mobile-first. Touch targets. Minimal chrome.
   Think: Uber driver app, not Airtable.
   ========================================================= */

/* ===== IBM Plex — self-hosted, engineer app only (font-src 'self') ===== */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-700.woff2") format("woff2"); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); }

/* ===== Primox Field — WARM THEME =====
   Scoped to engineer sessions only (body.field-mode). The office UI never gets
   this class, so app.css is untouched. We override the shared design tokens so
   every existing field rule that references them warms up through the cascade. */
body.field-mode {
  --surface:      #FCFAF4;  /* warm card */
  --surface-2:    #EDE8DB;  /* warm inset */
  --border:       #E4DECF;  /* warm border */
  --text:         #1C1B18;  /* warm charcoal ink */
  --text-muted:   #5A5344;  /* warm taupe */
  --brand-gold:   #B0851F;  /* bronze */
  --warn:         #B05C3E;  /* terracotta */
  --err:          #B05C3E;
  --r:            12px;     /* softer radii */
  --r-lg:         18px;
  /* field-only extras */
  --f-cream:      #F4F1E9;
  --f-sage:       #5C7A5A;
  --f-sage-bg:    #E7EEDF;
  --f-bronze-bright: #D6A63A;

  background: var(--f-cream);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
body.field-mode #view { background: var(--f-cream); }

/* ----- Layout overrides for field view ----- */
body.field-mode #appHeader {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

body.field-mode #appNav {
  display: none; /* replaced by bottom nav */
}

body.field-mode #view {
  padding-bottom: 80px; /* space for bottom nav */
}

/* ----- Bottom navigation bar ----- */
.field-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 8px rgba(0,0,0,.1);
}

.field-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-decoration: none;
  padding: 8px 4px;
  transition: color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.field-nav-btn .field-nav-icon { font-size: 22px; line-height: 1; }
.field-nav-btn.active { color: var(--brand-gold); }
.field-nav-btn:hover { background: var(--surface-2); }
.field-nav-btn.report-btn { color: var(--err, #c62828); }
.field-nav-btn.report-btn.active { color: var(--err, #c62828); }

/* ----- My Day sections ----- */
.my-day-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s-4, 16px);
  padding: var(--s-3) var(--s-3) var(--s-4);
  max-width: 640px;
  margin: 0 auto;
}

.my-day-greeting {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding: var(--s-2) 0 0;
}

.my-day-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ----- Field card ----- */
.field-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r, 8px);
  overflow: hidden;
}

.field-card-header {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2, #f5f5f5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.field-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.field-card-body {
  padding: var(--s-4);
}

.field-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--s-1);
}

.field-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ----- Status badge ----- */
.field-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 999px;
}
.field-status.planned  { background: var(--surface-2); color: var(--text-muted); }
.field-status.active   { background: color-mix(in srgb, #2e7d32 15%, transparent); color: #2e7d32; }
.field-status.completed { background: color-mix(in srgb, #1565c0 12%, transparent); color: #1565c0; }
.field-status.cancelled { background: color-mix(in srgb, #c62828 10%, transparent); color: #c62828; }

/* ----- Kit cards grid ----- */
.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4) var(--s-4);
}

.kit-card {
  background: var(--surface-2, #f9f9f9);
  border: 1px solid var(--border);
  border-radius: var(--r, 8px);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.kit-card-icon { font-size: 28px; line-height: 1; }
.kit-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.kit-card-serial { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.kit-card-status { margin-top: auto; }

/* ----- Large action buttons ----- */
.field-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-4);
}

.field-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: 16px var(--s-4);
  border-radius: var(--r, 8px);
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s, transform .08s;
}
.field-btn:active { transform: scale(.97); opacity: .9; }

.field-btn.primary {
  background: var(--brand-gold, #C9A227);
  color: #1a1a1a;
}
.field-btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.field-btn.danger {
  background: color-mix(in srgb, #c62828 12%, transparent);
  color: #c62828;
  border: 1px solid color-mix(in srgb, #c62828 30%, transparent);
}
.field-btn.success {
  background: color-mix(in srgb, #2e7d32 12%, transparent);
  color: #2e7d32;
  border: 1px solid color-mix(in srgb, #2e7d32 30%, transparent);
}

.field-btn-icon { font-size: 20px; }

/* ----- Alert cards ----- */
.field-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-left: 4px solid;
  background: var(--surface);
}
.field-alert + .field-alert { border-top: 1px solid var(--border); }
.field-alert.warn { border-color: var(--warn, #e65100); }
.field-alert.err  { border-color: var(--err, #c62828); }
.field-alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.field-alert-body { flex: 1; min-width: 0; }
.field-alert-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.field-alert-sub   { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ----- End of day prompt ----- */
.field-eod {
  border: 2px solid var(--brand-gold, #C9A227);
  border-radius: var(--r, 8px);
  background: color-mix(in srgb, var(--brand-gold, #C9A227) 8%, transparent);
  padding: var(--s-4);
  text-align: center;
}
.field-eod-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 var(--s-1); }
.field-eod-sub   { font-size: 13px; color: var(--text-muted); margin: 0 0 var(--s-3); }

/* ----- Report issue flow ----- */
.report-step {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-5);
  max-width: 540px;
  margin: 0 auto;
}

.severity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

.severity-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-2);
  border-radius: var(--r, 8px);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, background .12s;
}
.severity-btn .sev-icon { font-size: 32px; }
.severity-btn.minor   { border-color: var(--warn, #e65100); color: var(--warn, #e65100); }
.severity-btn.major   { border-color: #b71c1c; color: #b71c1c; }
.severity-btn.critical { border-color: #c62828; color: #c62828; background: color-mix(in srgb, #c62828 8%, transparent); }
.severity-btn.selected { background: var(--brand-gold); color: #1a1a1a; border-color: var(--brand-gold); }

/* ----- Empty / no assignment state ----- */
.field-empty {
  text-align: center;
  padding: var(--s-6) var(--s-4);
  color: var(--text-muted);
}
.field-empty-icon { font-size: 48px; margin-bottom: var(--s-3); }
.field-empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 var(--s-2); }
.field-empty-sub   { font-size: 14px; margin: 0; }

/* ----- Photo capture ----- */
.photo-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--r, 8px);
  border: 1px solid var(--border);
  display: block;
}

/* ----- Responsive: wider screens get a max-width container ----- */
@media (min-width: 600px) {
  .my-day-wrap, .report-step { padding-left: var(--s-4); padding-right: var(--s-4); }
  .kit-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ----- Bundle header (collapsible kit group) ----- */
.kit-bundle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-2);
}
.kit-bundle-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.kit-bundle-icon { font-size: 24px; }
.kit-bundle-name { font-weight: 700; font-size: 15px; color: var(--text); }
.kit-bundle-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kit-bundle-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r, 8px);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.kit-bundle-toggle:hover { background: var(--surface-2); }

/* ----- Kit search bar ----- */
.kit-search-bar {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-3) var(--s-2);
  align-items: center;
}
.kit-search-bar input[type="search"] { min-width: 0; }

/* ----- Weekly diary ----- */
.week-diary { padding: 0; }
.diary-row {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.diary-row:last-child { border-bottom: none; }
.diary-today { background: var(--surface-2); border-left: 3px solid var(--brand-gold, #f0a500); }
.diary-day {
  min-width: 90px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.diary-now {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-gold, #f0a500);
}
.diary-content { flex: 1; }
.diary-project { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.diary-time { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.diary-note { font-size: 12px; margin-bottom: 3px; }

/* ================================================================
   4-WEEK DIARY — Admin and Engineer views
   ================================================================ */

/* Admin grid */
.diary-grid-wrap { overflow: hidden; }
.diary-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diary-table { border-collapse: collapse; min-width: 900px; width: 100%; font-size: 12px; }
.diary-table th, .diary-table td { border: 1px solid var(--border); padding: 0; }
.diary-eng-col { min-width: 120px; max-width: 160px; padding: 6px 8px; font-weight: 600; background: var(--surface-2); white-space: nowrap; text-align: left; }
.diary-week-header { background: var(--surface-2); padding: 6px 4px; text-align: center; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.diary-day-col { width: 52px; min-width: 52px; padding: 4px 3px; text-align: center; font-size: 11px; color: var(--text-muted); background: var(--surface); }
.diary-today-col { background: color-mix(in srgb, var(--brand-gold, #f0a500) 10%, transparent); }
.diary-weekend-col { background: var(--surface-2); }
.diary-eng-name { font-size: 13px; font-weight: 600; padding: 6px 8px; white-space: nowrap; background: var(--surface); min-width: 120px; }
.diary-date-num { font-size: 10px; margin-top: 1px; }
.diary-cell-td { padding: 2px; vertical-align: top; min-height: 48px; }
.diary-weekend { background: var(--surface-2); }
.diary-today { background: color-mix(in srgb, var(--brand-gold, #f0a500) 8%, transparent); }

/* Day cells */
.diary-cell { border-radius: 4px; padding: 4px 5px; min-height: 44px; cursor: pointer; transition: filter .1s; }
.diary-cell:hover { filter: brightness(1.08); }
.diary-cell.diary-planned { background: color-mix(in srgb, var(--brand-gold, #f0a500) 20%, transparent); border-left: 3px solid var(--brand-gold, #f0a500); }
.diary-cell.diary-active { background: color-mix(in srgb, #22c55e 15%, transparent); border-left: 3px solid #22c55e; }
.diary-cell.diary-complete { background: var(--surface-2); border-left: 3px solid var(--border); }
.diary-cell.diary-cancelled { opacity: .45; background: var(--surface-2); }
.diary-cell.diary-empty { background: transparent; cursor: default; }
.diary-cell-title { font-weight: 600; font-size: 11px; color: var(--text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.diary-cell-sub, .diary-cell-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }

/* Site visit badges */
.diary-sv-badge { display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px; margin-top: 2px; text-transform: uppercase; letter-spacing: .03em; }
.sv-in  { background: #dcfce7; color: #166534; }
.sv-out { background: #f1f5f9; color: #475569; }

/* Admin diary header */
.diary-admin-header { margin-bottom: var(--s-3); }

/* Engineer compact diary */
.eng-diary { display: flex; flex-direction: column; gap: var(--s-3); }
.eng-diary-week { border: 1px solid var(--border); border-radius: var(--r, 8px); overflow: hidden; }
.eng-diary-week-label { padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.eng-diary-row { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.eng-diary-row:last-child { border-bottom: none; }
.eng-diary-today { background: color-mix(in srgb, var(--brand-gold, #f0a500) 8%, transparent); border-left: 3px solid var(--brand-gold, #f0a500); }
.eng-diary-weekend { background: var(--surface-2); opacity: .7; }
.eng-diary-day { min-width: 64px; padding: 10px 8px; border-right: 1px solid var(--border); text-align: center; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.eng-diary-dayname { font-weight: 700; font-size: 13px; color: var(--text); }
.eng-diary-date { font-size: 11px; color: var(--text-muted); }
.eng-diary-now { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--brand-gold, #f0a500); letter-spacing: .05em; }
.eng-diary-content { flex: 1; padding: 10px 12px; }
.eng-diary-project { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.eng-diary-loc, .eng-diary-time, .eng-diary-notes { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.eng-diary-free { font-size: 13px; }



/* ================================================================
   TEAM DIARY — Premium Operations Planner
   Outlook + Monday.com aesthetic. No tables. CSS Grid + Flexbox.
   ================================================================ */

/* ---- Outer shell — replaces the old ap-root+sidebar combo ---- */
.ap-shell {
  display: flex;
  flex-direction: column;
  background: #F4F5F7;
  border-radius: var(--r);
  overflow: hidden;
  height: calc(100vh - 140px);
  min-height: 480px;
}

/* ---- Toolbar row ---- */
.ap-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.ap-toolbar-left  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ap-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Nav buttons */
.ap-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.ap-nav-btn:hover { background: #F9FAFB; border-color: #9CA3AF; }
.ap-nav-btn.today { border-color: #2563EB; color: #2563EB; }
.ap-nav-btn.today:hover { background: #EFF6FF; }

.ap-week-label {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  padding: 0 4px;
  white-space: nowrap;
}

/* View toggle */
.ap-view-toggle {
  display: flex;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.ap-view-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  background: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.ap-view-btn + .ap-view-btn { border-left: 1.5px solid #D1D5DB; }
.ap-view-btn:hover { background: #F3F4F6; color: #374151; }
.ap-view-btn.active { background: #2563EB; color: #fff; }

/* Filters */
.ap-filter {
  padding: 6px 10px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  min-width: 120px;
}
.ap-filter:focus { outline: none; border-color: #2563EB; }

/* Add entry button */
.ap-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--brand-gold, #C9A227);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .12s;
}
.ap-add-btn:hover { filter: brightness(1.08); }

/* ---- Legend pill row ---- */
.ap-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.ap-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #4B5563;
  white-space: nowrap;
}
.ap-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Calendar scroll wrapper ---- */
.ap-calendar-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #F4F5F7;
  scroll-behavior: smooth;
}

/* ---- Calendar grid ---- */
/* 
  Engineer column (120px) + 7 day columns.
  On 1280px viewport with 220px sidebar: ~1060px usable.
  1060 - 120 = 940px / 7 = ~134px per day col — no scroll needed.
  min-width: 840px ensures columns never collapse below 100px each,
  which would make cards unreadable and cause visual misalignment.
*/
.ap-calendar {
  display: grid;
  grid-template-columns: 120px repeat(7, minmax(100px, 1fr));
  min-width: 820px;
  width: 100%;
  box-sizing: border-box;
}

/* Sticky header: top-left corner */
.ap-cal-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background: #F4F5F7;
  border-right: 2px solid #E5E7EB;
  border-bottom: 3px solid #E5E7EB;
  padding: 12px 16px;
}

/* Day headers — sticky top */
.ap-cal-day-hd {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-right: 1px solid #E5E7EB;
  border-bottom: 3px solid #E5E7EB;
  padding: 10px 12px;
  text-align: center;
}
.ap-cal-day-hd.is-today {
  background: #EFF6FF;
  border-bottom-color: #2563EB;
}
.ap-cal-day-hd.is-weekend { background: #F9FAFB; }

.ap-cal-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6B7280;
}
.ap-cal-day-num {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  margin-top: 2px;
}
.ap-cal-day-num.is-today {
  color: #2563EB;
}
.ap-cal-day-month {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 1px;
}

/* Engineer name cell — sticky left */
.ap-cal-eng-hd {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  border-right: 2px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  overflow: hidden;
}
.ap-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ap-eng-name-text {
  font-size: 11px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-eng-status-text {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ap-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Day cells */
.ap-cal-cell {
  border-right: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 100px;
  background: #F4F5F7;
  cursor: pointer;
  transition: background .1s;
}
.ap-cal-cell:hover { background: #EBEDF0; }
.ap-cal-cell.is-today { background: #F0F4FF; }
.ap-cal-cell.is-weekend { background: #F9FAFB; }
.ap-cal-cell.is-past { opacity: .72; }

/* Empty cell prompt */
.ap-empty-prompt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #D1D5DB;
  border-radius: 8px;
  font-size: 12px;
  color: #9CA3AF;
  cursor: pointer;
  min-height: 56px;
  transition: border-color .12s, color .12s, background .12s;
}
.ap-empty-prompt:hover {
  border-color: #2563EB;
  color: #2563EB;
  background: #EFF6FF;
}

/* ---- Booking card ---- */
.ap-card {
  background: #fff;
  border-radius: 7px;
  border-left: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  padding: 7px 10px 7px 9px;
  cursor: pointer;
  transition: box-shadow .12s ease, transform .1s ease;
  position: relative;
}
.ap-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.10), 0 2px 5px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.ap-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-card-time {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}
.ap-card-line {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.ap-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ap-badge.on-site   { background: #DBEAFE; color: #1D4ED8; }
.ap-badge.left-site { background: #F1F5F9; color: #475569; }
.ap-badge.kit       { background: #EDE9FE; color: #5B21B6; }
.ap-badge.planned   { background: #FEF3C7; color: #92400E; }

/* Add-more link under stacked cards */
.ap-add-more {
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.ap-add-more:hover { background: #E5E7EB; color: #2563EB; }

/* =========================================================
   Engineer redesign — Phase 1: 5-tab nav + shared screen shell
   Appended last so nav overrides above cascade correctly.
   ========================================================= */

/* ----- Bottom nav: tuned for 5 tabs + SVG icons ----- */
.field-bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); }
.field-nav-btn {
  gap: 3px;
  font-size: 9px;
  letter-spacing: .03em;
  padding: 6px 2px;
  min-width: 0;
}
.field-nav-btn .field-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color .12s;
}
.field-nav-btn .field-nav-icon svg { display: block; width: 24px; height: 24px; }
.field-nav-btn.active .field-nav-icon { color: var(--brand-gold); }
.field-nav-label {
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
}

/* ----- Shared engineer screen shell (Diary / Timesheets / Boot Stock / Profile) ----- */
.field-screen {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-4);
  max-width: 640px;
  margin: 0 auto;
}
.field-screen-head { padding: var(--s-2) var(--s-1) 0; }
.field-screen-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0;
}
.field-screen-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* ----- Profile ----- */
.field-profile-id { display: flex; align-items: center; gap: var(--s-3); }
.field-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-gold, #C9A227);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}
.field-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.field-meta-row .k { color: var(--text-muted); }
.field-meta-row .v { color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }

/* =========================================================
   Phase 2 — My Day. Practical, dense field layout (warm theme).
   Order: engineer/date · today's job · project · survey type ·
   address/postcode · navigate · contact · pack · notes/H&S · start.
   ========================================================= */
.md-wrap {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: 0 var(--s-3) var(--s-4); max-width: 480px; margin: 0 auto;
}

/* Engineer + date header */
.md-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2);
  padding: var(--s-3) var(--s-1) var(--s-2); border-bottom: 1px solid var(--border);
}
.md-head-name { font-size: 15px; font-weight: 700; color: var(--text); }
.md-head-date { font-size: 13px; color: var(--text-muted); }

/* Offline banner */
.md-offline {
  background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--r); padding: var(--s-2) var(--s-3); font-size: 13px; font-weight: 600;
}

/* Loading skeleton */
.md-skeleton { height: 50vh; border-radius: var(--r-lg); background: var(--surface-2); animation: md-pulse 1.2s ease-in-out infinite; }
@keyframes md-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ----- The job ----- */
.md-job2 { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-1) 0; }
.md-job2-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.md-eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--text-muted); }
.md-eyebrow.onsite { color: var(--f-sage); }
.md-title { font-size: 22px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 0; }
.md-subtype { font-size: 13px; color: var(--text-muted); }

/* Location: site · address · postcode chip */
.md-loc { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.md-site { font-size: 15px; font-weight: 600; color: var(--text); }
.md-addr { font-size: 14px; color: var(--text-muted); line-height: 1.35; white-space: pre-wrap; }
.md-pc {
  align-self: flex-start; display: inline-flex; align-items: baseline; gap: 8px; margin-top: 3px;
  padding: 5px 12px; border: 1px solid var(--brand-gold); background: #FBF5E6;
  border-radius: var(--r); cursor: pointer; -webkit-tap-highlight-color: transparent;
  font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--brand-gold);
}
.md-pc-copy { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); }

/* Navigate — compact, practical */
.md-nav { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; gap: 8px; border-radius: var(--r); box-shadow: 0 4px 12px -6px rgba(176,133,31,.55); }
.md-nav .md-nav-icon { font-size: 17px; }

/* Contact */
.md-contact2 {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding: var(--s-2) var(--s-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
}
.md-contact2-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.md-contact2-name { font-size: 15px; font-weight: 700; color: var(--text); }
.md-contact2-btns { display: flex; gap: 6px; flex-shrink: 0; }
.md-contact2-btns .field-btn { width: auto; }
.md-call { padding: 9px 14px; font-size: 14px; }
.md-text { padding: 9px 12px; font-size: 15px; }

/* Inline sections (pack / notes) */
.md-sec { display: flex; flex-direction: column; gap: 6px; padding-top: var(--s-2); border-top: 1px solid var(--border); }
.md-sec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--text-muted); }
.md-sec-count { color: var(--brand-gold); margin-left: 5px; }

/* Also-on-site inline line */
.md-alsoline { font-size: 13px; color: var(--text-muted); padding-top: var(--s-1); }
.md-alsoline .md-eyebrow { margin-right: 6px; }

/* Kit fold (secondary) */
.md-fold { border-top: 1px solid var(--border); }
.md-fold > summary {
  display: flex; align-items: center; gap: var(--s-2); list-style: none; cursor: pointer;
  padding: var(--s-2) var(--s-1); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.md-fold > summary::-webkit-details-marker { display: none; }
.md-fold-badge { color: var(--brand-gold); }
.md-fold-chevron { margin-left: auto; transition: transform .15s; }
.md-fold[open] > summary .md-fold-chevron { transform: rotate(90deg); }
.md-fold-body { padding: 0 var(--s-1) var(--s-2); display: flex; flex-direction: column; gap: 6px; }

/* Primary action — compact */
.md-primary { margin-top: var(--s-3); }
.md-primary .field-btn { width: 100%; padding: 13px; font-size: 16px; font-weight: 700; border-radius: var(--r); }
.md-done { font-size: 15px; font-weight: 700; text-align: center; padding: var(--s-3); border-radius: var(--r); }

/* Later-today switcher */
.md-switch { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-4); }
.md-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-muted); padding: 0 var(--s-1); }
.md-switch-item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
  padding: var(--s-2) var(--s-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.md-switch-time { font-size: 13px; font-weight: 700; color: var(--brand-gold); min-width: 44px; }
.md-switch-where { flex: 1; font-weight: 600; color: var(--text); }
.md-switch-go { color: var(--text-muted); font-size: 18px; }

/* Section label (used in sheets) */
.md-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin-bottom: var(--s-1); }

/* ----- Notes / risk ----- */
.md-note-text, .md-risk-line {
  font-size: 14px; color: var(--text); margin: 0; white-space: pre-wrap; line-height: 1.4;
}
.md-risk {
  background: color-mix(in srgb, var(--warn, #e65100) 8%, transparent);
  border-radius: var(--r, 8px); padding: var(--s-2) var(--s-3);
}
.md-risk-line { color: var(--warn, #e65100); font-weight: 600; margin-top: 2px; }

/* ----- Documents ----- */
.md-docs { display: flex; flex-direction: column; gap: var(--s-1); }
.md-doc {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r, 8px);
  padding: var(--s-2) var(--s-3); cursor: pointer; font-size: 14px; color: var(--text);
}
.md-doc-title { font-weight: 600; }
.md-doc-type { margin-left: auto; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ----- Kit ----- */
.md-kit { display: flex; flex-direction: column; gap: 6px; }
.md-kit-item { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; }
.md-kit-icon { width: 22px; text-align: center; }
.md-kit-name { font-weight: 600; color: var(--text); }
.md-kit-serial { margin-left: auto; font-size: 12px; font-family: monospace; color: var(--text-muted); }

/* ----- Surveyors ----- */
.md-surveyors { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.md-surveyor {
  font-size: 13px; background: var(--surface-2); border-radius: 999px;
  padding: 4px 10px; color: var(--text);
}

/* ----- Start / Finish sheets (rendered via ui.js modal) ----- */
.md-sheet { display: flex; flex-direction: column; gap: var(--s-2); }
.md-sheet-hint { font-size: 13px; color: var(--text-muted); margin: 0; }
.md-checklist { display: flex; flex-direction: column; gap: 2px; }
.md-check {
  display: flex; align-items: center; gap: var(--s-2); padding: 10px var(--s-2);
  border-radius: var(--r, 8px); font-size: 15px; cursor: pointer;
}
.md-check:hover { background: var(--surface-2); }
.md-check input { width: 20px; height: 20px; flex-shrink: 0; }
.md-select, .md-textarea {
  width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--border);
  border-radius: var(--r, 8px); background: var(--surface); color: var(--text);
}
.md-textarea { resize: vertical; }

/* =========================================================
   Primox Field — shared warm refinements (cascade last).
   Moderate radii (not full pills) for a practical field-app feel.
   ========================================================= */
body.field-mode .field-btn { font-weight: 700; }
body.field-mode .field-btn.primary { background: var(--brand-gold); color: #FCFAF4; }
body.field-mode .field-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
body.field-mode .field-btn.success { background: var(--f-sage); color: #FCFAF4; border: none; }

body.field-mode .field-status.active,
body.field-mode .field-status.completed { background: var(--f-sage-bg); color: var(--f-sage); }
body.field-mode .field-status { letter-spacing: .1em; }
body.field-mode .md-done { color: var(--f-sage); background: var(--f-sage-bg); }

/* Serials + codes in IBM Plex Mono */
body.field-mode .md-kit-serial,
body.field-mode .kit-card-serial { font-family: 'IBM Plex Mono', monospace; }

/* Project pack — compact document rows with a bronze type badge */
body.field-mode .md-doc { background: var(--surface); border: 1px solid var(--border); padding: 9px 12px; font-size: 14px; }
body.field-mode .md-doc-type {
  background: var(--brand-gold); color: #FCFAF4; border-radius: 999px;
  padding: 2px 8px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

/* Softer warm card shadow */
body.field-mode .md-contact2,
body.field-mode .md-switch-item { box-shadow: 0 1px 3px rgba(28,24,14,.05); }

/* Nav labels tracked */
body.field-mode .field-nav-label { letter-spacing: .1em; }

/* =========================================================
   Diary tab — tappable week (fx-*), matching the Field design system.
   ========================================================= */
.fx-week { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 8px; }
.fx-week-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #1C1B18; }
.fx-week-range { font: 400 12px "IBM Plex Mono", monospace; letter-spacing: .04em; color: #8C8571; margin-top: 2px; }
.fx-week-nav { display: flex; gap: 8px; }
.fx-week-btn { width: 38px; height: 38px; border-radius: 12px; background: #EDE8DB; border: none; color: #5A5344; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fx-week-btn:active { background: #E4DECF; }

.fx-strip { display: flex; justify-content: space-between; padding: 12px 6px 8px; }
.fx-strip-day { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; padding: 4px 2px 2px; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.fx-strip-day.is-sel { background: #F1E9D2; }
.fx-strip-l { font: 500 10px "IBM Plex Mono", monospace; color: #A79D83; }
.fx-strip-n { width: 34px; height: 34px; border-radius: 11px; background: #EDE8DB; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: #5A5344; }
.fx-strip-n.is-today { background: #1C1B18; color: #F4F1E9; font-weight: 700; }
.fx-strip-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.fx-strip-dot.on { background: #B0851F; }

.fx-day { padding: 10px 4px 0; }
.fx-day-label { font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #B0851F; margin: 8px 0 12px; }
.fx-day-empty { font-size: 14px; color: #8C8571; padding: 8px 2px 20px; }

/* Planned / active day cards */
.fx-dcard-rail { border-left: 3px solid #DED8C8; padding-left: 14px; margin-bottom: 10px; }
.fx-dcard-rail.is-now { border-left-color: #B0851F; }
.fx-dcard { background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(28,24,14,.04); }
.fx-dcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fx-dcard-time { font: 600 13px "IBM Plex Mono", monospace; color: #5A5344; }
.fx-dcard-title { font-size: 16px; font-weight: 600; color: #1C1B18; line-height: 1.25; }
.fx-dcard-sub { font-size: 13px; color: #8C8571; margin-top: 1px; }

/* Completed / cancelled compact rows */
.fx-dcompact { display: flex; align-items: center; gap: 13px; padding: 11px 2px; border-bottom: 1px solid #EBE6D9; }
.fx-dcompact:last-child { border-bottom: none; }
.fx-dcompact.is-cancelled { opacity: .72; }
.fx-dcompact svg { flex-shrink: 0; }
.fx-dcompact-main { flex: 1; min-width: 0; }
.fx-dcompact-title { font-size: 14px; font-weight: 500; color: #1C1B18; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-dcompact.is-cancelled .fx-dcompact-title { text-decoration: line-through; text-decoration-color: #C6BEAA; }
.fx-dcompact-sub { font-size: 12px; color: #8C8571; }
.fx-dcompact-lbl { font: 500 11px "IBM Plex Mono", monospace; flex-shrink: 0; }
.fx-dcompact-lbl--completed { color: #5C7A5A; }
.fx-dcompact-lbl--cancelled { color: #B05C3E; }

/* =========================================================
   Field design system (fx-*) — premium iOS-style, shared by every screen.
   Warm cream, bronze accent, sage success, rounded cards, IBM Plex.
   ========================================================= */
.fx-screen { max-width: 460px; margin: 0 auto; padding: 8px 18px 40px; min-height: 100%; }

.fx-greeting { font-size: 25px; font-weight: 700; letter-spacing: -.02em; color: #1C1B18; padding: 10px 4px 2px; }
.fx-offline { background: #F6EAD9; color: #B05C3E; border: 1px solid #E7D6BF; border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin: 8px 0; }

.fx-todaylabel { font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .18em; color: #B0851F; padding: 18px 4px 8px; }

/* Job hero */
.fx-hero { padding: 2px 4px 18px; }
.fx-hero-time { font: 600 15px "IBM Plex Mono", monospace; color: #5A5344; letter-spacing: .04em; }
.fx-hero-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: #1C1B18; line-height: 1.05; margin: 2px 0 12px; }

.fx-chip { display: inline-flex; align-items: center; font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; }
.fx-chip--planned   { color: #8C7A4A; background: #F1E9D2; }
.fx-chip--active    { color: #5C7A5A; background: #E7EEDF; }
.fx-chip--completed { color: #5C7A5A; background: #E7EEDF; }
.fx-chip--cancelled { color: #B05C3E; background: #F2E2DA; }

/* iOS-style grouped rows */
.fx-rows { background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 3px rgba(28,24,14,.05); }
.fx-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 15px 16px; -webkit-tap-highlight-color: transparent; }
.fx-row + .fx-row { border-top: 1px solid #EFE9DC; }
.fx-row:active { background: #F4EEE0; }
.fx-row-icon { width: 34px; height: 34px; border-radius: 10px; background: #F1E9D2; color: #B0851F; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fx-row-label { font-size: 16px; font-weight: 600; color: #1C1B18; }
.fx-row-sub { font-size: 13px; color: #8C8571; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-row-chev { color: #C4BCA6; flex-shrink: 0; display: flex; }

/* Large CTAs */
.fx-cta { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 18px; margin-top: 22px; border: none; border-radius: 16px; background: #B0851F; color: #FCFAF4; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(176,133,31,.75); -webkit-tap-highlight-color: transparent; transition: transform .08s; }
.fx-cta:active { transform: scale(.98); }
.fx-cta-icon { font-size: 15px; }
.fx-cta--success { background: #5C7A5A; box-shadow: 0 8px 20px -10px rgba(92,122,90,.7); }
.fx-cta--ghost { background: #FCFAF4; color: #1C1B18; border: 1px solid #E7E1D2; box-shadow: none; }

/* Active state */
.fx-active { margin-top: 22px; }
.fx-active-head { display: flex; align-items: center; gap: 8px; font: 700 12px "IBM Plex Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: #5C7A5A; margin-bottom: 12px; }
.fx-active-dot { width: 9px; height: 9px; border-radius: 50%; background: #5C7A5A; box-shadow: 0 0 0 4px #E7EEDF; }
.fx-active-actions { display: flex; flex-direction: column; gap: 10px; }
.fx-active-actions .fx-cta { margin-top: 0; }
.fx-done { margin-top: 22px; text-align: center; font-size: 16px; font-weight: 700; color: #5C7A5A; background: #E7EEDF; border-radius: 16px; padding: 18px; }

/* Later-today switcher */
.fx-later { margin-top: 26px; }
.fx-later-label { font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .16em; color: #8C8571; padding: 0 4px 8px; }
.fx-later-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fx-later-time { font: 700 13px "IBM Plex Mono", monospace; color: #B0851F; min-width: 44px; }
.fx-later-where { flex: 1; font-weight: 600; color: #1C1B18; }

/* Sub-page header */
.fx-subhead { display: flex; align-items: center; gap: 8px; padding: 8px 0 14px; position: relative; }
.fx-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: #B0851F; font-size: 16px; font-weight: 600; cursor: pointer; padding: 6px 6px 6px 0; -webkit-tap-highlight-color: transparent; }
.fx-subhead-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: 700; color: #1C1B18; }
.fx-subbody { display: flex; flex-direction: column; gap: 14px; }

/* Contact page */
.fx-contact { display: flex; flex-direction: column; align-items: center; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 20px; padding: 28px 20px; box-shadow: 0 1px 3px rgba(28,24,14,.05); }
.fx-contact-avatar { width: 76px; height: 76px; border-radius: 50%; background: #B0851F; color: #FCFAF4; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.fx-contact-name { font-size: 22px; font-weight: 800; color: #1C1B18; margin-top: 14px; letter-spacing: -.01em; }
.fx-contact-company { font-size: 14px; color: #8C8571; margin-top: 2px; }
.fx-contact-actions { display: flex; gap: 10px; width: 100%; margin-top: 20px; }
.fx-contact-actions .fx-cta { margin-top: 0; }
.fx-meta { display: flex; justify-content: space-between; width: 100%; margin-top: 16px; padding-top: 14px; border-top: 1px solid #EFE9DC; }
.fx-meta-k { font-size: 13px; color: #8C8571; }
.fx-meta-v { font: 500 14px "IBM Plex Mono", monospace; color: #1C1B18; }

/* Scope page */
.fx-scope { display: flex; flex-direction: column; gap: 14px; }
.fx-scope-type { font: 700 12px "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #B0851F; }
.fx-scope-body { font-size: 17px; line-height: 1.6; color: #1C1B18; white-space: pre-wrap; }

/* Documents page */
.fx-docgroup { display: flex; flex-direction: column; gap: 8px; }
.fx-docgroup-label { font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: #8C8571; padding: 6px 4px 2px; }
.fx-doccard { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 16px; padding: 14px 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 2px rgba(28,24,14,.04); }
.fx-doccard-icon { color: #B0851F; flex-shrink: 0; }
.fx-doccard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-doccard-name { font-size: 15px; font-weight: 600; color: #1C1B18; }
.fx-doccard-meta { font: 400 12px "IBM Plex Mono", monospace; color: #8C8571; margin-top: 2px; }
.fx-doccard-open { color: #B0851F; flex-shrink: 0; }

/* Notes & H&S page */
.fx-notes { display: flex; flex-direction: column; gap: 12px; }
.fx-notecard { background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 16px; padding: 15px 16px; box-shadow: 0 1px 2px rgba(28,24,14,.04); }
.fx-notecard-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.fx-notecard-icon { font-size: 17px; }
.fx-notecard-title { font-size: 15px; font-weight: 700; color: #1C1B18; }
.fx-notecard-text { font-size: 15px; line-height: 1.5; color: #3A362E; margin: 0; white-space: pre-wrap; }

/* Team & Equipment page */
.fx-teamsec { display: flex; flex-direction: column; gap: 8px; }
.fx-teamsec-label { font: 700 11px "IBM Plex Mono", monospace; letter-spacing: .16em; color: #8C8571; padding: 8px 4px 2px; }
.fx-person { display: flex; align-items: center; gap: 12px; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 14px; padding: 12px 14px; }
.fx-person-avatar { width: 36px; height: 36px; border-radius: 50%; background: #EDE8DB; color: #5A5344; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.fx-person-name { font-size: 15px; font-weight: 600; color: #1C1B18; }
.fx-kitcard { display: flex; align-items: center; gap: 12px; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 14px; padding: 12px 14px; }
.fx-kitcard-icon { font-size: 22px; width: 26px; text-align: center; }
.fx-kitcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-kitcard-name { font-size: 15px; font-weight: 600; color: #1C1B18; }
.fx-kitcard-serial { font: 400 12px "IBM Plex Mono", monospace; color: #8C8571; }
.fx-empty-line { font-size: 14px; color: #8C8571; padding: 6px 4px; }

/* =========================================================
   Hours tab (fx-*)
   ========================================================= */
.fx-hours { background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 3px rgba(28,24,14,.05); margin-top: 8px; }
.fx-hrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 16px; -webkit-tap-highlight-color: transparent; }
.fx-hrow + .fx-hrow { border-top: 1px solid #EFE9DC; }
.fx-hrow:active { background: #F4EEE0; }
.fx-hrow.is-today { background: #FBF5E6; }
.fx-hrow-day { flex: 1; font-size: 16px; font-weight: 600; color: #1C1B18; }
.fx-hrs { font: 600 14px "IBM Plex Mono", monospace; }
.fx-hrs--logged { color: #5C7A5A; }
.fx-hrs--missing { color: #B05C3E; }
.fx-hrs--pending { color: #8C8571; }
.fx-hrs--none { color: #C4BCA6; }
.fx-htotal { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 16px 18px; background: #1C1B18; border-radius: 16px; }
.fx-htotal-k { font: 700 12px "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #A79D83; }
.fx-htotal-v { font-size: 22px; font-weight: 800; color: #F4F1E9; }

/* =========================================================
   Stock tab (fx-*)
   ========================================================= */
.fx-stock-head { padding: 10px 4px 12px; }
.fx-stock { display: flex; flex-direction: column; gap: 10px; }
.fx-stockcard { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 16px; padding: 14px 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 2px rgba(28,24,14,.04); }
.fx-stockcard:active { background: #F4EEE0; }
.fx-stockcard-icon { font-size: 26px; width: 30px; text-align: center; flex-shrink: 0; }
.fx-stockcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-stockcard-name { font-size: 16px; font-weight: 600; color: #1C1B18; }
.fx-stockcard-serial { font: 400 12px "IBM Plex Mono", monospace; color: #8C8571; }
.fx-stockcard-cal { font: 500 11px "IBM Plex Mono", monospace; color: #8C7A4A; }
.fx-stockcard-cal.is-overdue { color: #B05C3E; }
.fx-status { font: 700 10px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; flex-shrink: 0; }
.fx-status--ok { color: #5C7A5A; background: #E7EEDF; }
.fx-status--bronze { color: #B0851F; background: #F1E9D2; }
.fx-status--warn { color: #B05C3E; background: #F2E2DA; }
.fx-status--err { color: #FCFAF4; background: #B05C3E; }
.fx-status--muted { color: #8C8571; background: #EDE8DB; }
.fx-kitdetail { display: flex; flex-direction: column; }
.fx-kitdetail .fx-meta { padding: 13px 0; margin: 0; border-top: 1px solid #EFE9DC; }
.fx-kitdetail .fx-meta:first-child { border-top: none; }

/* =========================================================
   Profile tab (fx-*)
   ========================================================= */
.fx-profile { display: flex; flex-direction: column; align-items: center; padding: 28px 20px 8px; }
.fx-profile-avatar { width: 92px; height: 92px; border-radius: 50%; background: #B0851F; color: #FCFAF4; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; box-shadow: 0 8px 22px -10px rgba(176,133,31,.7); }
.fx-profile-name { font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: #1C1B18; margin-top: 16px; }
.fx-profile-role { font-size: 14px; color: #8C8571; margin-top: 3px; }
.fx-profile-meta { background: #FCFAF4; border: 1px solid #E7E1D2; border-radius: 18px; overflow: hidden; margin-top: 24px; box-shadow: 0 1px 3px rgba(28,24,14,.05); }
.fx-profile-meta .fx-meta { padding: 15px 16px; margin: 0; border-top: 1px solid #EFE9DC; }
.fx-profile-meta .fx-meta:first-child { border-top: none; }

/* My Day — prominent job location (tap to navigate). More visible than metadata rows. */
.fx-loc { background: #FBF5E6; border: 1px solid #EAD9B8; border-radius: 14px; padding: 12px 14px 8px; margin: 12px 0 2px; }
.fx-loc-label { font: 700 10px "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: #B0851F; }
.fx-loc-addr { font-size: 15px; font-weight: 600; color: #1C1B18; line-height: 1.35; margin-top: 5px; }
.fx-loc-rows { display: flex; flex-direction: column; margin-top: 8px; }
.fx-loc-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 10px 2px; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.fx-loc-row + .fx-loc-row { border-top: 1px solid #EAD9B8; }
.fx-loc-row:active { background: #F4EAD2; }
.fx-loc-row-icon { font-size: 15px; flex-shrink: 0; }
.fx-loc-row-val { flex: 1; min-width: 0; font: 700 17px "IBM Plex Mono", monospace; letter-spacing: .06em; color: #B0851F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-loc-row-w3w { color: #5C7A5A; font-size: 15px; letter-spacing: .02em; }
.fx-loc-row-chev { color: #C4A96A; flex-shrink: 0; display: flex; }
