/* ============================================================================
   KEYCARD — The Blank Company key card management
   Design system: BLANKCO (D:/CALVIN.VAULT/05 PROJECTS/BLANKCO/Design System)
   Lemon #FFFF00 · Black · White · Endless Mist · Outfit · 8px grid.
   Shape since v4.5.0: phones and tablets wear the rounded look (mist floor,
   white cards, floating black top bar and tab bar); desktop from 1025 px wears
   the BLANK CORE skin (left sidebar, big number cards) — see the last section.
   ============================================================================ */

@font-face { font-family: 'Outfit'; src: url('assets/fonts/Outfit-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('assets/fonts/Outfit-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('assets/fonts/Outfit-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('assets/fonts/Outfit-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('assets/fonts/Outfit-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  /* colors.css — brand tokens */
  --innovation-lemon: #FFFF00;
  --endless-mist: #D9E1E2;
  --blank-white: #FFFFFF;
  --blank-gray: #B4B4B4;
  --blank-black: #000000;
  --state-problem: #D0021B;
  --state-outcome: #1E8E3E;
  --text-secondary: #4A4A4A;
  --border-subtle: #E4E4E4;

  --surface-inverse: var(--blank-black);
  --surface-muted: var(--endless-mist);
  --accent: var(--innovation-lemon);

  /* typography.css */
  --font-sans: 'Outfit', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --tracking-caps: 0.08em;
  --tracking-tight: -0.02em;

  /* spacing.css */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --content-max: 1200px;

  /* effects.css */
  --transition-fast: 120ms ease;
  --hover-dim: #1A1A1A;
  --hover-yellow-dim: #EDED00;
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.24);

  /* ---- rounded look (v4.4.0, Calvin 2026-09-04) ----------------------------
     Same names as B-PEOPLE so the two apps share one vocabulary. Light only;
     dark mode later = a second set of values for this block, nothing else. */
  --surface-page:   #D9E1E2;   /* Endless Mist — the page floor */
  --surface-card:   #FFFFFF;   /* every content surface */
  --surface-sunken: #D9E1E2;   /* inset blocks and inputs on a card */
  --surface-nav:    #000000;   /* the top bar and other black panels */
  --on-inverse:     #FFFFFF;   /* text on a black surface */
  --on-accent:      #000000;   /* text on lemon — always black */
  --text-muted:     #6E6E6E;   /* NOT --blank-gray: that is 2.07:1 on white */
  --radius-card: 16px;
  --radius-ui:   10px;
  --radius-pill: 999px;
  --gap-card:    12px;         /* between cards */
  --page-inset:  12px;         /* page edge and the floating bar's offset */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The `hidden` attribute must always win. Any `display:` rule silently beats it,
   which has bitten this project twice — dropdown panels that wouldn't close, and
   check-in fields that showed before you picked anything. Fix it once, here. */
[hidden] { display: none !important; }

html, body {
  background: var(--surface-page);
  color: var(--blank-black);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface-nav);
  color: var(--on-inverse);
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--s3);
  height: 64px;
  /* floating black card — the same material as B-PEOPLE's sidebar (v4.4.0).
     Edges line up with the page's outer padding: content-max + 2 × s4. */
  position: sticky;
  top: var(--page-inset);
  z-index: 40;
  margin: var(--page-inset) auto 0;
  width: calc(100% - var(--page-inset) * 2);
  max-width: calc(var(--content-max) + var(--s4) * 2);
  border-radius: var(--radius-card);
}
.topbar .brand-link {
  display: flex; align-items: center; gap: var(--s3);
  text-decoration: none; color: inherit;
  padding: 6px 10px; margin-left: -4px;
  border-radius: var(--radius-ui);
  transition: background var(--transition-fast);
}
.topbar .brand-link:hover { background: var(--hover-dim); }
.topbar .bmark { height: 32px; width: auto; display: block; }
.topbar .brand {
  font-weight: 800;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  font-size: 15px;
  white-space: nowrap;
}
.topbar .brand span { color: var(--accent); }
.topbar nav { display: flex; gap: var(--s1); margin-left: auto; }
.topbar nav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.topbar nav a:hover { background: var(--hover-dim); color: var(--on-inverse); }
.topbar nav a.active { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* ---------- signed-in chip ---------- */
.user-chip { position: relative; margin-left: var(--s3); }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: var(--on-inverse); cursor: pointer;
  padding: 5px 12px 5px 6px; font-family: var(--font-sans);
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast);
}
.chip:hover { background: var(--hover-dim); }
.chip img, .chip-dot { width: 22px; height: 22px; border-radius: 999px; object-fit: cover; flex: none; }
.chip-dot { background: var(--accent); }
.chip-name { font-size: 12px; font-weight: 700; }
.chip-role {
  font-size: 9px; font-weight: 700; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; background: var(--accent); color: var(--on-accent);
  padding: 2px 7px; border-radius: var(--radius-pill);
}
.chip-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  background: var(--surface-card); color: var(--blank-black);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-overlay);
  border-radius: var(--radius-card); overflow: hidden;
  min-width: 220px;
}
.chip-who { padding: 12px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 2px; }
.chip-who b { font-size: 14px; }
.chip-who span { font-size: 12px; color: var(--text-secondary); word-break: break-all; }
.chip-action {
  width: 100%; padding: 12px; border: none; background: var(--surface-nav); color: var(--accent);
  cursor: pointer; font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.chip-action:hover { background: var(--hover-dim); }

/* ---------- sign-in / waiting screens ---------- */
.gate {
  max-width: 520px; margin: 8vh auto 0; text-align: center;
  padding: var(--s6) var(--s5);
  background: var(--surface-card); border-radius: var(--radius-card);
}
.gate-mark { height: 64px; width: auto; margin: 0 auto var(--s5); display: block; }
.gate .divider-bar { margin: 0 auto var(--s3); }
.gate-copy { font-size: 15px; color: var(--text-secondary); margin: var(--s3) 0; line-height: 1.6; }
.gate-copy b { color: var(--blank-black); }
.gate-err {
  background: var(--state-problem); color: var(--on-inverse);
  padding: 10px 14px; font-size: 13px; font-weight: 500; margin: var(--s3) 0;
  border-radius: var(--radius-ui);
}
.gate-btn { margin-top: var(--s3); padding: 16px 28px; font-size: 13px; }
.gate-foot { font-size: 12px; color: var(--text-secondary); margin-top: var(--s5); line-height: 1.6; }
.gate-diag { font-size: 11px; color: var(--text-secondary); margin-top: var(--s3); line-height: 1.6; word-break: break-word; }

/* ---------- people & access ---------- */
.acct-list { background: var(--surface-card); border-radius: var(--radius-card); overflow: hidden; }
.acct-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap;
}
.acct-row:last-child { border-bottom: 0; }
.acct-row.is-pending { background: rgba(255,255,0,0.16); }
.acct-av { width: 34px; height: 34px; border-radius: 999px; object-fit: cover; flex: none; }
.acct-av.ghost { background: var(--surface-muted); border: 1px solid var(--border-subtle); }
.acct-who { display: flex; flex-direction: column; min-width: 160px; flex: 1 1 200px; }
.acct-who b { font-size: 15px; }
.acct-who span { font-size: 12px; color: var(--text-secondary); word-break: break-all; }
.acct-row select { max-width: 230px; width: auto; }
.acct-row select:disabled { opacity: 0.5; }
.acct-name { max-width: 220px; font-size: 15px; font-weight: 700; padding: 6px 8px; }

/* what each role can do */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap-card); background: transparent; }
.role-card { background: var(--surface-card); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 6px; border-radius: var(--radius-card); }
.role-card.own { background: var(--accent); }
.role-card b { font-size: 14px; font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.role-card span { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.role-card.own span { color: var(--blank-black); }

/* ---------- demo banner ---------- */
.demo-banner .short { display: none; }
.demo-banner {
  /* still lemon on purpose — demo mode must stay unmistakable so nobody
     records real cards in the sandbox; only the shape softened (v4.4.0) */
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-align: center;
  padding: var(--s2) var(--s3);
  margin: var(--s2) auto 0;
  width: calc(100% - var(--page-inset) * 2);
  max-width: calc(var(--content-max) + var(--s4) * 2);
  border-radius: var(--radius-ui);
}

/* ---------- layout ---------- */
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--s5) var(--s4) 96px; min-height: calc(100vh - 60px); }  /* reserve height: the footer must never be visible-then-shoved (CLS 0.75) */

.section-head { margin-bottom: var(--s5); }
.divider-bar { width: 140px; height: 8px; background: var(--accent); margin-bottom: var(--s3); border-radius: var(--radius-pill); }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--s1);
}
h1.display {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
}
h1.display .thin { font-weight: 300; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.head-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* ---------- stat band ---------- */
.stat-band { display: flex; gap: var(--gap-card); background: transparent; margin-bottom: var(--s5); flex-wrap: wrap; }
.stat-cell { background: var(--surface-card); padding: var(--s3) var(--s4); flex: 1 1 140px; border-radius: var(--radius-card); }
.stat-cell.inverse { background: var(--surface-nav); color: var(--accent); }
.stat-cell .num { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: var(--tracking-tight); }
.stat-cell .lbl { font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; margin-top: 2px; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: var(--radius-ui);
  transition: background var(--transition-fast), color var(--transition-fast);
  background: var(--surface-nav);
  color: var(--accent);
}
.btn:hover { background: var(--hover-dim); }
.btn.secondary { background: var(--accent); color: var(--on-accent); }
.btn.secondary:hover { background: var(--hover-yellow-dim); }
.btn.tertiary { background: transparent; color: var(--blank-black); border: 2px solid var(--blank-black); padding: 10px 18px; }
.btn.tertiary:hover { background: var(--blank-black); color: var(--on-inverse); }
.btn.danger { background: var(--state-problem); color: var(--on-inverse); }
.btn.small { padding: 8px 12px; font-size: 11px; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blank-black); outline-offset: 2px; }

/* ---------- inputs ---------- */
input[type="text"], input[type="search"], input[type="password"], select, textarea {
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-ui);
  background: var(--surface-sunken);
  color: var(--blank-black);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blank-black); background: var(--surface-card); }
label.field { display: block; margin-bottom: var(--s3); }
.field .lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
input[type="color"] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--border-subtle); border-radius: var(--radius-ui); background: var(--surface-card); cursor: pointer; }

.searchbar { position: relative; flex: 1 1 260px; max-width: 420px; }
.searchbar input { padding-left: 40px; }
.searchbar::before {
  content: "→";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  pointer-events: none;
}

.sort-select { width: auto; font-size: 12px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; background: var(--surface-card); border-color: var(--border-subtle); }

/* ---------- instant search dropdown ---------- */
.search-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-ui);
  box-shadow: var(--shadow-overlay);
  z-index: 45;
  max-height: 60vh;
  overflow-y: auto;
}
.sd-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: var(--blank-white); border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; text-align: left;
  font-family: var(--font-sans);
}
.sd-item:last-of-type { border-bottom: none; }
.sd-item.active { background: var(--accent); }
.sd-kind {
  font-size: 9px; font-weight: 700; letter-spacing: var(--tracking-caps);
  color: var(--text-secondary); width: 52px; flex: none;
}
.sd-item.active .sd-kind { color: var(--blank-black); }
.sd-dot { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.25); flex: none; }
.sd-dot.ghost { background: transparent; border-style: dashed; }
.sd-text { display: flex; flex-direction: column; min-width: 0; }
.sd-text b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-text span { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-item.active .sd-text span { color: var(--blank-black); }
.sd-empty, .sd-foot {
  padding: 12px; font-size: 11px; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--text-secondary); text-align: center;
}
.sd-foot { border-top: 1px solid var(--border-subtle); background: var(--surface-muted); }

/* thin progress bar while the app is talking to the database */
body.is-busy::after {
  content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--accent); z-index: 100;
  animation: kcload 900ms ease-in-out infinite;
}
@keyframes kcload { 0% { opacity: .25 } 50% { opacity: 1 } 100% { opacity: .25 } }

.log-row.clickable { cursor: pointer; transition: background var(--transition-fast); }
.log-row.clickable:hover { background: var(--surface-muted); }

/* ---------- grids (card-shaped tiles, spaced apart) ---------- */
.grid { display: grid; gap: var(--s3); background: transparent; }
.grid.projects { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.units { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.tile {
  background: var(--blank-white);
  padding: var(--s4);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  text-align: left;
  font-family: var(--font-sans);
  color: var(--blank-black);
}
.grid.projects .tile { aspect-ratio: 1.586 / 1; }
.tile:hover { background: var(--surface-muted); }
.tile .title { font-size: 22px; font-weight: 700; letter-spacing: var(--tracking-tight); text-transform: uppercase; line-height: 1.1; }
.tile .sub { font-size: 13px; color: var(--text-secondary); margin-top: var(--s1); }
.tile .meta { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: var(--s3); font-size: 12px; }
.tile .meta b { font-size: 20px; font-weight: 800; display: block; line-height: 1.1; }
.tile .meta .cap { font-size: 10px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); }
.tile.addnew {
  background: var(--blank-white);
  border: 2px dashed var(--blank-gray);
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.tile.addnew:hover { border-color: var(--blank-black); color: var(--blank-black); background: var(--blank-white); }

/* ---------- key cards (shaped like real access cards) ---------- */
.keycard {
  padding: var(--s3) var(--s4);
  aspect-ratio: 1.586 / 1;   /* CR80 card proportions */
  min-height: 168px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: filter var(--transition-fast), transform var(--transition-fast);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 16px;       /* deliberate exception to the square-corner rule: these ARE cards */
  text-align: left;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}
.keycard::before {
  /* subtle sheen band, like printed PVC */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
.keycard:hover { filter: brightness(0.95); }
.keycard .kc-top { display: flex; justify-content: space-between; align-items: baseline; }
.keycard .kc-num { font-size: 28px; font-weight: 800; line-height: 1; }
.keycard .kc-status {
  font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
}
.keycard .kc-fields { margin-top: auto; font-size: 11px; line-height: 1.6; }
.keycard .kc-fields .f { display: flex; gap: 6px; }
.keycard .kc-fields .k { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; white-space: nowrap; }
.keycard .kc-fields .v { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keycard.light { color: var(--blank-black); }
.keycard.light .kc-status { background: rgba(0,0,0,0.85); color: var(--blank-white); }
.keycard.dark { color: var(--blank-white); }
.keycard.dark .kc-status { background: rgba(255,255,255,0.92); color: var(--blank-black); }

/* the add-new tile inside a cards grid takes the same card shape */
.grid.cards .tile.addnew {
  border-radius: 16px;
  aspect-ratio: 1.586 / 1;
  min-height: 168px;
}

/* ---------- project two-pane (units left · cards right) ---------- */
.project-pane { display: grid; grid-template-columns: 300px 1fr; gap: var(--s5); align-items: start; }
.unit-list { display: flex; flex-direction: column; gap: var(--s2); }
.unit-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-ui);
  background: var(--surface-card);
  color: var(--blank-black);
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 700; letter-spacing: var(--tracking-tight); text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  text-align: left;
}
.unit-row:hover { border-color: var(--blank-black); }
.unit-row.selected { background: var(--surface-nav); color: var(--accent); border-color: var(--surface-nav); }
.unit-row .cnt { font-size: 10px; font-weight: 500; letter-spacing: var(--tracking-caps); white-space: nowrap; }
.unit-row.addnew { border: 2px dashed var(--blank-gray); color: var(--text-secondary); justify-content: center; font-size: 12px; letter-spacing: var(--tracking-caps); background: transparent; }
.unit-row.addnew:hover { border-color: var(--blank-black); color: var(--blank-black); background: var(--blank-white); }
.legend-col { flex-direction: column; align-items: flex-start; gap: var(--s2); margin: var(--s4) 0 0; }
.cards-col-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.unit-title { font-size: 28px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tracking-tight); line-height: 1.1; }
.unit-title-sub { font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); color: var(--text-secondary); margin-left: var(--s2); white-space: nowrap; }
.edit-colour { font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); align-self: center; }
.edit-colour:hover { color: var(--blank-black); }
@media (max-width: 860px) {
  .project-pane { grid-template-columns: 1fr; }
  .legend-col { flex-direction: row; }
}

/* ---------- searchable dropdown (units / projects) ---------- */
.combo { position: relative; flex: 1 1 260px; min-width: 220px; }
.combo-label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 6px;
}
.combo-btn {
  width: 100%; display: flex; align-items: center; gap: var(--s2);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-ui);
  padding: 12px 14px; cursor: pointer; font-family: var(--font-sans);
  text-align: left; transition: background var(--transition-fast), border-color var(--transition-fast);
}
.combo-btn:hover { background: var(--surface-muted); border-color: var(--blank-black); }
.combo-main { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-tight); }
.combo-sub { font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); }
.combo-caret { margin-left: auto; font-weight: 700; }
.combo-panel {
  /* 58: above the phone tab bar (55), below the bell panel (60) — B2 */
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 58;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-ui); overflow: hidden;
  box-shadow: var(--shadow-overlay); max-height: 340px; display: flex; flex-direction: column;
}
/* `display:flex` above beats the hidden attribute, so restate it */
.combo-panel[hidden] { display: none; }
.combo-search { border: none; border-radius: 0; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); padding: 12px 14px; }
.combo-search:focus { outline: none; border-bottom-color: var(--blank-black); }
.combo-list { overflow-y: auto; }
.combo-item {
  display: flex; align-items: baseline; gap: var(--s2); width: 100%;
  padding: 10px 14px; background: var(--blank-white); border: none;
  border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  text-align: left; font-family: var(--font-sans);
}
.combo-item.active { background: var(--accent); }
.ci-main { font-size: 15px; font-weight: 700; text-transform: uppercase; }
.ci-sub { font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); margin-left: auto; white-space: nowrap; }
.combo-item.active .ci-sub { color: var(--blank-black); }
.combo-empty { padding: 16px; text-align: center; font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); }
.combo-add {
  border: none; border-top: 1px solid var(--border-subtle);
  background: var(--surface-nav); color: var(--accent);
  padding: 12px; cursor: pointer; font-family: var(--font-sans);
  font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.combo-add:hover { background: var(--hover-dim); }

.unit-bar { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--s5); }
.unit-bar-actions { display: flex; gap: var(--s2); align-items: center; }

/* ---------- the bell: pending handovers ---------- */
.bell {
  position: relative; flex: none;
  width: 36px; height: 36px; border: none; border-radius: 999px;
  background: transparent; color: var(--blank-white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
}
.bell:hover { background: rgba(255,255,255,0.14); }
.bell svg { width: 19px; height: 19px; }
.bell-badge {
  position: absolute; top: 1px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--state-problem); color: var(--blank-white);
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.bell-panel {
  position: fixed; top: calc(var(--page-inset) + 64px + 8px); right: var(--page-inset); z-index: 60;
  width: min(400px, calc(100vw - 24px));
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); overflow: hidden;
  /* the panel lives inside the black topbar and would inherit its WHITE text —
     card labels were white-on-white until 2026-08-12 (gotcha 21 family) */
  color: var(--blank-black);
  box-shadow: var(--shadow-overlay);
  max-height: min(520px, 80vh); overflow-y: auto;
}
.bp-head {
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  background: var(--blank-black); color: var(--accent); padding: 10px 14px;
  position: sticky; top: 0;
}
.bp-empty { padding: var(--s4); font-size: 13px; color: var(--text-secondary); text-align: center; }
.bp-row { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.bp-thumb { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--border-subtle); border-radius: 8px; flex: none; }
.bp-thumb.ghost { background: var(--surface-muted); }
.bp-body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.bp-body b { display: block; font-size: 13.5px; }
.bp-body .sub { color: var(--text-secondary); font-size: 12px; }
.bp-dir {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px; margin-bottom: 3px;
}
.bp-dir.in { background: var(--accent); color: var(--blank-black); }
.bp-dir.out { background: var(--surface-muted); color: var(--text-secondary); }
.bp-actions { display: flex; flex-direction: column; gap: 5px; flex: none; }
.bp-actions .btn.small { padding: 7px 11px; font-size: 10px; }

/* activity badge for a transfer still in flight */
.act.pendingx { background: var(--surface-muted); color: var(--blank-black); border: 1px dashed var(--blank-black); }

/* the recipient dropdown inside the dark check-out panel */
.panel select {
  width: 100%; font-family: var(--font-sans); font-size: 16px; font-weight: 700;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  color: var(--blank-white); border-radius: 14px; padding: 13px 15px;
}
.panel select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.panel select option { color: var(--blank-black); background: var(--blank-white); font-weight: 500; }

/* near-white card faces (white CR) need a firmer edge on light pages, or
   "available" cards fade into the background entirely */
.keycard.pale, .card-hero.pale {
  border: 2px solid rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.keycard.pale .kc-num, .card-hero.pale .kc-num { color: rgba(0, 0, 0, 0.85); }

/* the card's identity photo, pinned to the right of the hero */
.hero-flex { display: flex; gap: var(--s4); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.hero-flex .hero-fields { flex: 1 1 320px; }
.hero-shot { flex: none; display: block; }
.hero-shot img {
  display: block; width: 190px; max-width: 42vw; max-height: 190px; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.35);
}
.hero-shot:hover img { outline: 3px solid var(--blank-black); }

/* overwrite modal: the two target buttons */
.who-pick2 { display: flex; gap: 8px; flex-wrap: wrap; }
/* stacked full-width: side by side the labels wrap onto two lines (v4.4.0) */
.who-pick2 .btn { flex: 1 1 100%; }

/* ---------- My Cards + the 7-day checkpoint ---------- */
.due-banner {
  background: var(--state-problem); color: var(--on-inverse);
  font-size: 13px; font-weight: 700; padding: 12px 16px; margin-bottom: var(--s4);
  max-width: 640px; border-radius: var(--radius-ui);
}
.mycard { display: flex; flex-direction: column; }
.mycard .keycard { width: 100%; }
.mycard-meta {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-ui); margin-top: 6px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px;
}
.mycard-meta .mm-where { font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; font-size: 11px; }
.mycard-meta .mm-days { color: var(--text-secondary); }
.mycard-meta.due { border-color: var(--state-problem); border-width: 2px; }
.mycard-meta.due .mm-days { color: var(--state-problem); font-weight: 800; }
.mycard-meta .mm-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- pending-transfer bar on a card ---------- */
.pending-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-nav); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  padding: 10px 14px; margin-top: var(--s3); border-radius: var(--radius-ui);
}
.pending-bar .who { color: var(--on-inverse); }
/* v4.5.3: a record out of step (AVAILABLE + a holder name) — red, with the
   two "where is it really" buttons for CR / management */
.pending-bar.stuck { background: var(--state-problem); color: var(--blank-white); }
.pending-bar.stuck .who { color: var(--blank-white); opacity: .92; text-transform: none; letter-spacing: 0; font-weight: 600; }
.pending-bar .fix-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pending-bar.stuck .btn.tertiary { background: transparent; border-color: #fff; color: #fff; }   /* the desktop skin paints tertiary white — keep it see-through on red */
@media (max-width: 640px) {
  .pending-bar .fix-actions { margin-left: 0; width: 100%; }
  .pending-bar .fix-actions .btn { flex: 1 1 auto; }
}

/* ---------- check in / out: the floating card panel ----------
   Two deliberate breaks from the house style, for the same reason the keycards
   are rounded: this screen IS a card, held in one hand at a door. It gets a
   radius and a shadow. Everything else stays flat and square. */
body.bg-mist { background: var(--surface-muted); }
.move-wrap { display: flex; justify-content: center; }
.panel {
  width: 100%; max-width: 560px;
  background: var(--blank-black);
  color: var(--blank-white);
  border-radius: 20px;
  padding: var(--s5);
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
  /* NO `overflow: hidden` here. It would keep the wash inside the rounded
     corners, but it also clips the unit dropdown, which is taller than the
     panel and has to hang over the edge. The wash inherits the radius instead. */
}
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(130% 100% at 100% 0%, rgba(255,255,0,0.26), rgba(255,255,0,0.05) 42%, transparent 68%),
    linear-gradient(160deg, rgba(255,255,255,0.07), transparent 55%);
}
/* Each child makes its own stacking context, so a bare z-index:1 on all of them
   means DOM order decides — and the card grid comes after the dropdowns. Lift
   the fields above it, or an open dropdown gets painted over by the cards. */
.panel > * { position: relative; z-index: 1; }
.panel > .panel-fields { z-index: 3; }

.panel-badge {
  width: 52px; height: 52px; border-radius: 999px;
  background: var(--accent); color: var(--blank-black);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s3);
}
.panel-badge svg { width: 24px; height: 24px; }
.panel-title { font-size: 30px; font-weight: 800; letter-spacing: var(--tracking-tight); line-height: 1.1; }
.panel-sub { font-size: 14px; color: rgba(255,255,255,0.62); margin-top: 4px; }
.panel-display {
  font-size: 34px; font-weight: 800; text-transform: uppercase;
  letter-spacing: var(--tracking-tight); line-height: 1.05; margin: var(--s3) 0 var(--s4);
}
.panel-lbl {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: rgba(255,255,255,0.58); margin-bottom: 6px;
}
.panel-fields { display: grid; gap: var(--s3); }
.panel-fields .combo { flex: none; min-width: 0; }
.panel-fields .off { opacity: 0.4; pointer-events: none; }
.panel-sec { margin-top: var(--s4); }
.panel-empty {
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: rgba(255,255,255,0.5); border: 1px dashed rgba(255,255,255,0.22);
  border-radius: 14px; padding: var(--s4); text-align: center; margin-top: var(--s2);
}
.pfield { display: block; margin-bottom: var(--s3); }
.pval { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pval .locked {
  font-size: 9px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 2px 8px;
}
.picked-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--blank-black); background: var(--accent);
  padding: 8px 14px; border-radius: 999px;
}
.picked-strip i { opacity: 0.45; font-style: normal; }

/* segmented controls: mode, who, and which team */
.seg { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,0.09); border-radius: 999px; }
.seg-mode { margin: var(--s4) 0; }
.seg-who { margin-bottom: var(--s4); }
.seg-btn {
  flex: 1 1 0; min-width: 0; padding: 11px 10px; border: none; cursor: pointer;
  background: transparent; color: rgba(255,255,255,0.72); border-radius: 999px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.seg-btn:hover { background: rgba(255,255,255,0.09); color: var(--blank-white); }
.seg-btn.on { background: var(--accent); color: var(--blank-black); }
.seg-btn b { font-size: 12px; font-weight: 700; }
.seg-btn span {
  font-size: 10px; font-weight: 500; letter-spacing: 0.03em; text-transform: none;
  opacity: 0.7; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The team picker is a 2-up GRID, not one squeezed row: with four teams a
   single row crushed "FACILITY CARE" and "TOP MANAGEMENT" onto two lines
   (Calvin, 2026-08-27). Equal cells also stop the buttons jittering as the
   team list changes. */
.seg-team {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; background: transparent; padding: 0; border-radius: 0;
}
.seg-team .seg-btn {
  flex-direction: row; justify-content: center; gap: 8px;
  padding: 13px 12px; background: rgba(255,255,255,0.08);
  white-space: nowrap; letter-spacing: 0.05em;
}
.seg-team .seg-btn:hover { background: rgba(255,255,255,0.15); }
.seg-team .seg-btn.on { background: var(--accent); }
.seg-team .who-dot { flex: none; }

/* two-up card grid, as drawn. Needs .grid.cards in the selector to outrank the
   auto-fill rule up top, which is more specific than a lone class. */
.grid.cards.panel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.panel-cards .keycard { min-height: 0; padding: var(--s3); }
.panel-cards .keycard .kc-num { font-size: 22px; }

/* On the black panel you cannot dim a card and keep its colour — 42% yellow over
   black is the same muddy olive as 42% red. So the tappable cards get a bright
   ring instead, and the blocked ones keep their hue under a veil + hatch. */
.panel-cards .keycard:not(.blocked) { box-shadow: 0 0 0 2px rgba(255,255,255,0.85); }
.panel-cards .keycard.blocked { opacity: 0.8; }
.panel-cards .keycard.blocked::after {
  background:
    linear-gradient(rgba(0,0,0,0.28), rgba(0,0,0,0.28)),
    repeating-linear-gradient(45deg, rgba(0,0,0,.24) 0 7px, transparent 7px 14px);
}
.panel-cards .keycard.chosen { outline: 3px solid var(--accent); outline-offset: 2px; }

/* a pending card addressed to YOU: still hatched (it is frozen), but bright
   and tappable — the tap opens the accept-with-receipt-photo flow */
.panel-cards .keycard.blocked.forme { opacity: 1; cursor: pointer; box-shadow: 0 0 0 2px var(--accent); }
.panel-cards .keycard.blocked.forme .kc-block { background: var(--accent); color: #000; font-weight: 700; }

/* the CR department button when no CR account is bound yet */
.seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* registry: a bound row's name follows the account — visibly not editable */
.person-row input[readonly] { opacity: 0.6; cursor: not-allowed; }

/* v5: phone-notification row at the bottom of the bell panel */
.bp-push { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.16); margin-top: 10px; padding-top: 10px; font-size: 11px; color: rgba(255,255,255,0.72); }

/* v4: bulk check-in bar (Operation / Facility Care) */
.bulk-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.bulk-bar .bulk-count { font-size: 12px; color: rgba(255,255,255,0.72); }
/* in bulk mode the bar pins to the top while the whole condo scrolls under it */
.bulk-bar.live { position: sticky; top: 8px; z-index: 6; background: rgba(0,0,0,0.88); padding: 8px 10px; border-radius: 14px; backdrop-filter: blur(3px); }

/* whole-project bulk view: unit group headers */
.bulk-unit { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 2px; border-bottom: 1px solid rgba(255,255,255,0.16); padding-bottom: 4px; }
.bulk-unit b { font-size: 15px; letter-spacing: 0.03em; }
.bulk-unit span { font-size: 10px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }

/* bulk confirm screen: the per-unit overview list */
.bulk-ov { display: flex; flex-direction: column; gap: 0; border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; overflow: hidden; }
.bulk-ov .bo-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; font-size: 12px; }
.bulk-ov .bo-row:nth-child(even) { background: rgba(255,255,255,0.05); }
.bulk-ov .bo-row b { min-width: 74px; letter-spacing: 0.03em; }
.bulk-ov .bo-row span { color: rgba(255,255,255,0.75); }

/* v4: five department buttons — let them wrap into two tidy rows */
.seg-depts { flex-wrap: wrap; border-radius: 20px; }
.seg-depts .seg-btn { flex: 1 1 31%; min-width: 31%; }

/* dark treatment for the shared controls when they sit inside the panel */
.panel .combo-label { color: rgba(255,255,255,0.58); }
.panel .combo-btn {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  color: var(--blank-white); border-radius: 14px; padding: 13px 15px;
}
.panel .combo-btn:hover { background: rgba(255,255,255,0.13); }
.panel .combo-sub { color: rgba(255,255,255,0.5); }
.panel .combo-panel { border-radius: 14px; overflow: hidden; }
.panel input[type="text"] {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  color: var(--blank-white); border-radius: 14px; padding: 13px 15px; font-size: 16px;
}
.panel input[type="text"]::placeholder { color: rgba(255,255,255,0.36); }
.panel input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.panel .combo-panel input { background: var(--blank-white); color: var(--blank-black); border-radius: 0; font-size: 15px; }
.panel .photo-box { border-color: rgba(255,255,255,0.26); border-radius: 16px; padding: var(--s3); margin-top: var(--s2); }
.panel .photo-box.has { border-color: var(--accent); border-style: solid; }
.panel .photo-box .hint { color: rgba(255,255,255,0.55); }
.panel .photo-preview { border-radius: 12px; border-color: rgba(255,255,255,0.2); }

.panel-actions { display: flex; gap: var(--s2); margin-top: var(--s5); }
.panel-actions .btn { flex: 1 1 0; }
.panel-actions .btn.ghost { flex: 0 1 36%; }
.panel-note {
  margin-top: var(--s3); text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--accent);
}
.btn.light { background: var(--blank-white); color: var(--blank-black); border-radius: 999px; padding: 15px 20px; font-size: 13px; }
.btn.light:hover { background: var(--endless-mist); }
.btn.ghost {
  background: transparent; color: var(--blank-white);
  border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 14px 20px; font-size: 13px;
}
.btn.ghost:hover { background: rgba(255,255,255,0.12); }
.btn.ghost.small { padding: 9px 14px; font-size: 11px; }

@media (max-width: 560px) {
  .panel { border-radius: 16px; padding: var(--s4); }
  .panel-title { font-size: 25px; }
  .panel-display { font-size: 26px; }
  .seg-btn { padding: 10px 6px; font-size: 11px; }
  .seg-btn b { font-size: 11px; }
  /* keep the 2-up team grid readable on a phone */
  .seg-team { gap: 6px; }
  .seg-team .seg-btn { padding: 11px 8px; gap: 6px; font-size: 10.5px; letter-spacing: 0.02em; }
}
/* two cards across on a phone means the card type must still fit — it's the
   difference between a master card and a lift card, so it can't be the bit
   that gets an ellipsis */
@media (max-width: 440px) {
  .panel-cards .keycard { padding: 10px; }
  .panel-cards .keycard .kc-num { font-size: 19px; }
  .panel-cards .keycard .kc-status { font-size: 9px; padding: 2px 6px; }
  .panel-cards .keycard .kc-fields { font-size: 10px; line-height: 1.5; }
  .panel-actions .btn.ghost { flex: 0 1 42%; }
  /* three segments only ever show for admin+; make MANAGEMENT fit anyway.
     The sub line carries the CR person's NAME — 8px was unreadable (S5) */
  .seg-who .seg-btn { padding: 9px 4px; letter-spacing: 0.02em; }
  .seg-who .seg-btn b { font-size: 10px; }
  .seg-who .seg-btn span { font-size: 10px; }
}

/* ---------- check in / out page ---------- */
.mode-toggle { display: flex; gap: 2px; background: var(--blank-black); margin-bottom: var(--s5); flex-wrap: wrap; }
.mode-btn {
  flex: 1 1 220px; padding: 14px; border: none; cursor: pointer;
  background: var(--blank-white); color: var(--blank-black);
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  transition: background var(--transition-fast);
}
.mode-btn:hover { background: var(--surface-muted); }
.mode-btn.on { background: var(--accent); }
.move-steps { display: flex; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.move-step { display: flex; gap: var(--s2); align-items: flex-end; flex: 1 1 280px; }
.move-step.off { opacity: 0.45; }
.step-no, .step-head .step-no {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  background: var(--blank-black); color: var(--accent);
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.step-head { display: flex; gap: var(--s2); align-items: center; margin: var(--s5) 0 var(--s3); }
.step-head .step-no { margin-bottom: 0; }

.keycard.blocked { opacity: 0.42; cursor: not-allowed; position: relative; }
.keycard.blocked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.16) 0 8px, transparent 8px 16px);
}
.keycard.chosen { outline: 4px solid var(--blank-black); outline-offset: 2px; }
.kc-block {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: var(--blank-black); color: var(--blank-white);
  font-size: 9px; font-weight: 700; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; padding: 5px 8px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 0 0 16px 16px;
}
.keycard.oos { opacity: 0.55; }
.keycard.oos::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.18) 0 8px, transparent 8px 16px);
}

.move-form { border-top: 2px solid var(--blank-black); margin-top: var(--s6); padding-top: var(--s4); }

/* colour swatch dot used on the who/team pickers and summary lines */
.who-dot {
  display: inline-block; width: 10px; height: 10px; margin-right: 7px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s3) var(--s4); }
.static-val { font-size: 16px; font-weight: 700; padding: 10px 0; }
.photo-box { border: 2px dashed var(--blank-gray); border-radius: var(--radius-card); padding: var(--s4); margin-top: var(--s4); }
.photo-box.has { border-style: solid; border-color: var(--state-outcome); }
.photo-box .lbl { font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.photo-box .hint { font-size: 13px; color: var(--text-secondary); margin: 6px 0 var(--s3); max-width: 560px; }
.photo-row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.photo-ok { font-size: 12px; font-weight: 700; color: var(--state-outcome); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.photo-miss { font-size: 12px; font-weight: 700; color: var(--state-problem); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.photo-preview { display: block; margin-top: var(--s3); max-width: 320px; width: 100%; border: 1px solid var(--border-subtle); border-radius: var(--radius-ui); }
.move-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); flex-wrap: wrap; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.oos-note {
  margin-top: var(--s3); font-size: 13px; font-weight: 700;
  background: rgba(0,0,0,0.82); color: var(--on-inverse);
  display: inline-block; padding: 6px 10px; border-radius: 6px;
}
.stat-cell.warn { background: var(--state-problem); color: var(--blank-white); }
.stat-btn { border: none; font-family: var(--font-sans); text-align: left; cursor: pointer; }
.stat-btn:hover { filter: brightness(0.92); }

/* ---------- export bar ---------- */
/* inputs default to width:100%, which makes the period dropdown push the
   Export button onto its own line — pin it to its content instead */
.export-bar select { width: auto; min-width: 180px; flex: 0 0 auto; }
.export-bar {
  display: flex; align-items: center; gap: var(--s2);
  flex-wrap: wrap; padding: var(--s3) var(--s4); background: var(--surface-card);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap-card);
}
.export-label { font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; margin-right: var(--s2); }
.report-hint { font-size: 11px; color: var(--text-secondary); margin-left: var(--s2); }
.export-custom { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex-wrap: wrap; }
.export-custom input[type="date"] { width: auto; font-size: 13px; padding: 8px 10px; }
.export-custom .to { font-weight: 700; }

.act.bad { background: var(--state-problem); color: var(--blank-white); }
/* proof photo sits next to the action badge — keeps the detail column clean */
.act-cell { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.proof-mini { display: block; line-height: 0; text-decoration: none; flex: none; }
.proof-mini img {
  width: 30px; height: 30px; object-fit: cover; display: block;
  border: 1px solid var(--border-subtle); border-radius: 6px;
  transition: outline-color var(--transition-fast);
}
.proof-mini:hover img { outline: 2px solid var(--blank-black); outline-offset: 1px; }

/* ---------- card hero (card page) ---------- */
.card-hero {
  padding: var(--s4) var(--s5);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  max-width: 640px;
}
.card-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
.card-hero .kc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s4); }
.card-hero .kc-num { font-size: 48px; font-weight: 800; line-height: 1; }
.card-hero .kc-status { font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.card-hero.light { color: var(--blank-black); }
.card-hero.light .kc-status { background: rgba(0,0,0,0.85); color: var(--blank-white); }
.card-hero.dark { color: var(--blank-white); }
.card-hero.dark .kc-status { background: rgba(255,255,255,0.92); color: var(--blank-black); }
.hero-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); }
.hero-fields .k { display: block; font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; opacity: 0.75; }
.hero-fields .v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s4) 0; align-items: center; }
.legend .li { display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.25); flex: none; }
/* column form (project page): hard-align everything to the left edge */
.legend.legend-col { flex-direction: column; align-items: flex-start; justify-content: flex-start; margin: var(--s4) 0 0; }
.legend.legend-col .li { width: 100%; justify-content: flex-start; text-align: left; }

/* ---------- back button ---------- */
.backbar { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.backbar .crumbs { margin-bottom: 0; }
.btn-back {
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  background: var(--surface-card); color: var(--blank-black);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer; flex: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-back:hover { background: var(--blank-black); color: var(--accent); }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: 12px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; margin-bottom: var(--s3); }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--blank-black); }
.crumbs .sep { margin: 0 6px; color: var(--blank-gray); }

/* ---------- activity log ---------- */
.log { background: var(--surface-card); border-radius: var(--radius-card); overflow: hidden; }
.log-head {
  display: grid;
  grid-template-columns: 140px 150px 1fr 80px;
  gap: var(--s3);
  padding: 12px var(--s4);
  background: var(--surface-nav); color: var(--on-inverse);
  font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.log-head .src { text-align: right; }
.log-row {
  display: grid;
  grid-template-columns: 140px 150px 1fr 80px;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  align-items: baseline;
}
.log-row:last-child { border-bottom: 0; }
.log-row .when { font-size: 12px; color: var(--text-secondary); }
.log-row .act {
  font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  padding: 3px 8px; display: inline-block; width: fit-content; border-radius: 6px;
}
.act.occupied { background: var(--blank-black); color: var(--accent); }  /* check in — card handed out */
.act.returned { background: var(--accent); color: var(--blank-black); } /* check out — back with CR */
.act.sys { background: var(--surface-muted); color: var(--blank-black); }
.log-row .src { font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); text-align: right; }
@media (max-width: 640px) { .log-head { display: none; } .log-row { grid-template-columns: 1fr; gap: 4px; } .log-row .src { text-align: left; } }

/* ---------- search results ---------- */
.result-group { margin-bottom: var(--s5); }
.result-group h3 { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-tight); margin-bottom: var(--s3); }
.result-count { font-size: 12px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); margin-bottom: var(--s4); }

/* ---------- modal (only allowed shadow) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  /* 70: above the phone tab bar (55) and bell panel (60) — a modal owns the
     screen; before this the bar stayed tappable and pages switched UNDER an
     open modal (stress #6 B1) */
  z-index: 70; padding: var(--s3);
}
.modal {
  background: var(--surface-card);
  box-shadow: var(--shadow-overlay);
  border-radius: 20px;
  width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  padding: var(--s5);
}
.modal h2 { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tracking-tight); margin-bottom: var(--s4); }
.modal .modal-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); flex-wrap: wrap; }
.modal .modal-actions .left { margin-right: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: var(--s4); left: 50%; transform: translateX(-50%);
  background: var(--surface-nav); color: var(--on-inverse);
  box-shadow: var(--shadow-overlay);
  border-radius: var(--radius-ui);
  padding: var(--s3) var(--s4);
  font-size: 13px; font-weight: 500;
  z-index: 80; max-width: 90vw;   /* above everything, incl. the modal overlay (70) */
}
.toast b { color: var(--accent); }

/* ---------- settings ---------- */
.settings-block { background: var(--surface-card); border-radius: var(--radius-card); padding: var(--s4); margin-bottom: var(--gap-card); }
.settings-block h2 { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tracking-tight); margin-bottom: var(--s2); }
.settings-block p.hint { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--s3); max-width: 560px; }
.cat-row, .person-row { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.cat-row input[type="text"], .person-row input[type="text"] { max-width: 260px; }
.person-row select { max-width: 220px; width: auto; }
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  background: var(--surface-nav); color: var(--accent); padding: 3px 8px; border-radius: 6px;
}

.empty {
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface-card);
  border-radius: var(--radius-card);
  font-size: 14px;
}
.empty b { display: block; font-size: 20px; font-weight: 800; text-transform: uppercase; color: var(--blank-black); margin-bottom: var(--s1); }

.footer {
  margin-top: var(--s6);
  padding: var(--s4);
  display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted);
  max-width: var(--content-max); margin-left: auto; margin-right: auto;
}

/* ---------- v6 (2026-08-12) ---------- */

/* the bulk review list inside the (light) accept modal — .bulk-ov itself is
   styled for the dark check-in panel, so flip the inks here */
.modal .bulk-ov { border-color: var(--border-subtle); max-height: 40vh; overflow-y: auto; }
.modal .bulk-ov .bo-row:nth-child(even) { background: rgba(0, 0, 0, 0.04); }
.modal .bulk-ov .bo-row span { color: var(--text-secondary); }

/* CR dashboard: the line between MY condos and everyone else's */
.grid-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.grid-divider::before, .grid-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border-subtle); }
.grid-divider span { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); white-space: nowrap; }

/* CR stock on My Cards: compact per-project lists of available cards */
.stock-group { margin-bottom: 24px; }
.stock-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; }
.stock-list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--radius-card); overflow: hidden; background: var(--surface-card); }
.stock-row { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 10px 14px; font: inherit; font-size: 13px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.stock-row:last-child { border-bottom: 0; }
.stock-row:hover { background: rgba(0, 0, 0, 0.04); }
.stock-row b { min-width: 90px; letter-spacing: 0.03em; }
.stock-row span { color: var(--text-secondary); }
.stock-row .sr-go { margin-left: auto; color: inherit; }
.stock-row .sr-pend { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); white-space: nowrap; }
.stock-row.pend .sr-go { margin-left: 10px; }
.stock-row.pend { opacity: 0.75; }

/* the bell's bulk entry is taller than a single handover — give it air */
.bp-bulk .bp-body b { letter-spacing: 0.04em; }

/* the checkpoint-overdue modal list — its own FLEX rows, never .log-row:
   that page grid has 370px of fixed columns and explodes inside a modal
   (one-word-per-line text + a horizontal scrollbar) */
.ovd-list { border-top: 1px solid var(--border-subtle); }
.ovd-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.ovd-row:hover { background: var(--surface-muted); }
.ovd-days { flex: none; min-width: 34px; padding-top: 2px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.ovd-row .act { flex: none; margin-top: 1px; }
.ovd-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ovd-txt .sub { color: var(--text-secondary); font-size: 12.5px; }

/* the one-time "what's new" note */
.wn { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.wn div { padding-left: 2px; }
/* v4.5.4: the note can be reopened any time — earlier releases fold underneath */
.wn-sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.wn-earlier { margin: -6px 0 18px; border-top: 1px solid var(--border-subtle); }
.wn-earlier summary { cursor: pointer; padding: 10px 0; font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); }
.wn-earlier summary:hover { color: var(--blank-black); }
.wn-earlier .wn-ver { font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; margin: 8px 0; }
.wn-earlier .wn { margin-bottom: 10px; }

/* ---------- v4.3: the phone tab bar (Calvin's floating-pill pick) ----------
   Desktop never sees it; phones swap the top nav links for this. The bar is
   the ONE floating rounded element in the app — deliberate, like the Check
   In/Out panel's corners: it's furniture for thumbs, not a content card. */
.tabbar { display: none; }

@media (max-width: 768px) {
  /* the top bar sheds its links but stays pinned — the 🔔 must never scroll away.
     With the links gone there's room for the wordmark again; bell + avatar
     flock to the right (Calvin, 2026-08-13). */
  .topbar { position: sticky; top: var(--page-inset); z-index: 50; }
  .topbar nav { display: none; }
  .topbar .brand { display: inline !important; font-size: 10.5px; letter-spacing: 0.08em; white-space: nowrap; }
  .topbar .bell { margin-left: auto; }

  .tabbar {
    position: fixed; z-index: 55;
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: stretch;
    height: 64px;
    background: var(--blank-black); color: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
  .tabbar[hidden] { display: none; }
  /* each side gets HALF the bar and keeps clear of the centre bubble, so the
     yellow circle sits dead-centre no matter how many icons a role has
     (Developer's 3-right vs 2-left used to shove it sideways) */
  .tb-side { flex: 1 1 0; min-width: 0; display: flex; justify-content: space-evenly; }
  .tb-side:first-child { margin-right: 38px; }
  .tb-side:last-child { margin-left: 38px; }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 2px; min-width: 44px;
    color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a span { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .tabbar a.active { color: var(--accent); }
  /* the little landing strip under the active label, like the reference.
     SIDE items only — on the centre button this ::after becomes a phantom
     flex item inside the bubble and shoves the icon off-centre. */
  .tb-side a span::after { content: ""; display: block; width: 16px; height: 3px; margin: 2px auto 0; border-radius: 99px; background: transparent; }
  .tb-side a.active span::after { background: var(--accent); }

  /* centre bubble: Check In / Out, raised out of the bar — absolutely centred */
  .tb-center { position: absolute; left: 50%; top: -20px; transform: translateX(-50%); gap: 4px !important; padding: 0 !important; min-width: 0 !important; }
  .tb-bubble {
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent); color: var(--blank-black);
    border: 4px solid var(--blank-black);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
  /* ".tabbar" prefix so this outweighs the generic ".tabbar a svg" 21px rule */
  .tabbar .tb-bubble svg { width: 24px; height: 24px; }
  .tb-center .tb-clabel { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
  .tb-center.active .tb-clabel { color: var(--accent); }

  /* nothing hides behind the bar: the footer is the document's own spacer —
     its margin pushes the whole page end above the floating bar */
  .footer { margin-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- narrow windows & tablets ----------
   Full nav labels plus the wordmark need roughly 1080px once Access appears.
   Below that the wordmark goes first; below 900px the labels shorten too. The
   bar must never wrap — a wrapped nav stretches it and looks broken. */
@media (max-width: 1080px) {
  .topbar .brand { display: none; }
  .topbar nav a { padding: 8px 12px; }
}

@media (max-width: 900px) {
  .topbar { height: 52px; padding: 0 10px; gap: 6px; }
  .bell-panel { top: calc(var(--page-inset) + 52px + 8px); }
  .topbar .brand-link { padding: 4px; margin-left: 0; gap: 8px; }
  .topbar .bmark { height: 24px; }
  .topbar .brand { display: none; }
  .topbar nav { gap: 0; flex: 1; justify-content: flex-end; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { padding: 8px 9px; font-size: 0; letter-spacing: 0; white-space: nowrap; flex: none; }
  .topbar nav a::after {
    content: attr(data-short);
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
  }
  .demo-banner { font-size: 10px; padding: 6px 10px; letter-spacing: 0.04em; }
  .demo-banner .full { display: none; }
  .demo-banner .short { display: inline; }
  .user-chip { margin-left: 6px; }
  .chip { padding: 4px 6px; gap: 5px; }
  .chip img, .chip-dot { width: 20px; height: 20px; }
  .chip-name, .chip-role { display: none; }
  .gate { margin-top: 5vh; }
  .gate-mark { height: 48px; }
}

@media (max-width: 640px) {
  h1.display { font-size: 32px; }
  .page { padding: var(--s4) var(--s3) 72px; }
  .section-head { margin-bottom: var(--s4); }
}

@media (max-width: 400px) {
  .topbar { height: 48px; padding: 0 8px; }
  .bell-panel { top: calc(var(--page-inset) + 48px + 8px); }
  .topbar nav a { padding: 8px 5px; }
  .topbar nav a::after { font-size: 9px; letter-spacing: 0.02em; }
  h1.display { font-size: 27px; }
}

/* ---------- Overwrite: colour first, then the person (v4.3.16) ----------
   The check-in team grid (.seg-team) is skinned for the black panel — reusing
   it inside the white modal would paint white-on-white (gotcha 21). Own skin. */
.cat-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.cat-pick button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 10px; min-height: 46px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  background: transparent; color: var(--blank-black);
  border: 2px solid var(--blank-black); border-radius: var(--radius-ui); cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.cat-pick button:hover { background: var(--endless-mist); }
.cat-pick button.on { background: var(--blank-black); color: var(--blank-white); }
.cat-pick .who-dot { flex: none; margin-right: 0; }
.ow-none { font-size: 13px; color: var(--state-problem); font-weight: 700; }
@media (max-width: 420px) {
  .cat-pick button { padding: 11px 4px; font-size: 10px; letter-spacing: 0.03em; gap: 5px; }
}
/* the picked mode has to READ as picked — .btn.tertiary is declared after
   .btn.secondary, so the old yellow toggle never painted at all */
.who-pick2 .btn.on { background: var(--blank-black); color: var(--blank-white); }

/* ---------- boot loader: a key card flipping (v4.3.18, Calvin 2026-09-17) ----------
   The old boot state was a grey box that said LOADING. This is the app's own
   object doing a small trick instead: a lemon card turns over to its black
   back, rests a beat, turns again. HTML-level 3D (two stacked SVG faces with
   hidden backfaces) — rotateY on elements INSIDE an svg is unreliable on iOS. */
.kc-loader {
  min-height: calc(100vh - 300px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
}
.kc-loader-stage { perspective: 640px; display: flex; flex-direction: column; align-items: center; }
.kc-loader-card {
  position: relative; width: 116px; height: 73px;   /* CR80 card proportions, 1.586 : 1 */
  transform-style: preserve-3d;
  animation: kc-flip 2.2s infinite;
}
.kc-face {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.kc-back { transform: rotateY(180deg); }
.kc-loader-shadow {
  width: 96px; height: 12px; margin-top: 16px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  animation: kc-shadow 2.2s infinite;
}
.kc-loader-text {
  font-size: 11px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--text-secondary); padding-left: 0.26em;   /* optical centring: tracking trails the last letter */
}
.kc-loader-text span { animation: kc-dot 1.2s infinite; opacity: 0.2; }
.kc-loader-text span:nth-child(2) { animation-delay: 0.2s; }
.kc-loader-text span:nth-child(3) { animation-delay: 0.4s; }

/* half a turn, a short rest face-on, the other half, a short rest — the card
   lifts a little as it goes edge-on, like a flick of the wrist */
@keyframes kc-flip {
  0%   { transform: translateY(0)    rotateY(0deg);   animation-timing-function: cubic-bezier(.55, 0, .45, 1); }
  20%  { transform: translateY(-9px) rotateY(90deg);  animation-timing-function: cubic-bezier(.55, 0, .45, 1); }
  40%  { transform: translateY(0)    rotateY(180deg); }
  50%  { transform: translateY(0)    rotateY(180deg); animation-timing-function: cubic-bezier(.55, 0, .45, 1); }
  70%  { transform: translateY(-9px) rotateY(270deg); animation-timing-function: cubic-bezier(.55, 0, .45, 1); }
  90%  { transform: translateY(0)    rotateY(360deg); }
  100% { transform: translateY(0)    rotateY(360deg); }
}
/* the shadow narrows and fades as the card turns its edge to the floor */
@keyframes kc-shadow {
  0%, 40%, 50%, 90%, 100% { transform: scaleX(1);    opacity: 1; }
  20%, 70%                { transform: scaleX(0.32); opacity: 0.45; }
}
@keyframes kc-dot { 0%, 100% { opacity: 0.2; } 35% { opacity: 1; } }

/* people who asked their device for less motion get a calm breathing card */
@media (prefers-reduced-motion: reduce) {
  .kc-loader-card { animation: kc-breathe 2.4s ease-in-out infinite; }
  .kc-loader-shadow, .kc-loader-text span { animation: none; opacity: 0.6; }
  @keyframes kc-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
}
@media (max-width: 640px) { .kc-loader { min-height: calc(100vh - 260px); } }

/* ============================================================================
   v4.5.0 (Calvin, 2026-09-29) — one app, two shapes
   · Phones and tablets (up to 1024 px): the rounded look, exactly as above.
   · Desktop (1025 px and wider): the BLANK CORE skin — white sidebar down the
     left, big number cards, pill buttons, soft shadows, grey list headers.
   Every desktop rule lives inside the one media query below, so nothing in it
   can reach a phone. The only rules outside it are the brand reset (keeps the
   phone top bar reading as before) and two phone layout repairs at the end.
   ============================================================================ */

/* the brand is <b>KEYCARD</b> · <small>The Blank Company</small>; these cancel
   the default styling of <b> and <small>, so on a phone the top bar still reads
   KEYCARD · THE BLANK COMPANY in one weight and one size */
.topbar .brand b { font-weight: inherit; }
.topbar .brand small { font-size: inherit; }

@media (min-width: 1025px) {
  :root {
    --surface-page: #ECF0F1;
    --surface-sunken: #F3F6F6;
    --surface-muted: #F3F6F6;
    --surface-nav: #0B0B0C;
    --blank-black: #0B0B0C;
    --text-secondary: #465053;
    --text-muted: #667275;
    --border-subtle: #E3E9EA;
    --hover-dim: #2A2D2F;
    --state-problem: #C62828;
    --radius-card: 20px;
    --radius-ui: 12px;
    --core-track: #E1E7E8;
    --core-edge: rgba(11, 11, 12, .16);
    --core-bad-bg: #FDECEC;
    --shadow-card: 0 1px 2px rgba(18, 38, 43, .04), 0 14px 32px -22px rgba(18, 38, 43, .22);
    --shadow-overlay: 0 2px 6px rgba(18, 38, 43, .08), 0 24px 48px -16px rgba(18, 38, 43, .28);
  }

  /* ---- surfaces: white card, soft shadow, no hairline boxes ---- */
  .topbar, .stat-cell, .tile, .acct-list, .role-card, .gate, .export-bar, .log,
  .settings-block, .empty, .stock-list, .unit-row { box-shadow: var(--shadow-card); }
  .tile, .stock-list, .unit-row { border-color: transparent; }
  .tile { border-radius: var(--radius-card); }
  .tile:hover { background: var(--surface-card); box-shadow: inset 0 0 0 2px var(--blank-black), var(--shadow-card); }
  .tile.addnew, .grid.cards .tile.addnew { box-shadow: none; border-radius: var(--radius-card); }
  .unit-row:hover { border-color: transparent; box-shadow: inset 0 0 0 2px var(--blank-black), var(--shadow-card); }
  .unit-row.selected { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: inset 0 0 0 1px var(--core-edge), var(--shadow-card); }
  .unit-row.addnew { box-shadow: none; }
  .keycard, .card-hero { box-shadow: var(--shadow-card); border-color: rgba(11, 11, 12, .08); }

  /* ---- sidebar: the top bar becomes a white card down the left edge ---- */
  body { padding-left: 280px; }
  .topbar {
    background: var(--surface-card); color: var(--blank-black);
    position: fixed; top: 12px; left: 12px; bottom: 12px;
    width: 256px; max-width: none; height: auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 16px 14px 14px;
  }

  /* brand block: a lemon tile holding the ink mark, product name big, company
     name small underneath (Calvin picked the lemon tile over the ink one).
     The tile is drawn by ::before so the phone keeps its own <img> untouched. */
  .topbar .brand-link { margin: 0; padding: 6px; gap: 12px; border-radius: 16px; }
  .topbar .brand-link:hover { background: var(--surface-sunken); }
  .topbar .bmark { display: none; }
  .topbar .brand-link::before {
    content: ""; flex: none; width: 44px; height: 44px; border-radius: 14px;
    background: var(--accent) url("assets/logos/b-mark-black-sm.png") center / auto 26px no-repeat;
    box-shadow: inset 0 0 0 1px var(--core-edge), 0 6px 14px -8px rgba(11, 11, 12, .4);
  }
  .topbar .brand { display: grid; gap: 3px; white-space: normal; line-height: 1; letter-spacing: 0; text-transform: none; font-size: 15px; }
  .topbar .brand b { font-size: 19px; font-weight: 800; letter-spacing: .07em; }
  .topbar .brand small { font-size: 11.5px; font-weight: 500; letter-spacing: .01em; color: var(--text-muted); }
  .topbar .brand > span { display: none; }

  .topbar nav { flex-direction: column; margin: 12px 0 0; padding-top: 14px; gap: 2px; border-top: 1px solid var(--border-subtle); }
  .topbar nav a { display: flex; align-items: center; height: 44px; padding: 0 14px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
  .topbar nav a[hidden] { display: none; }
  .topbar nav a:hover { background: var(--surface-sunken); color: var(--blank-black); }
  .topbar nav a.active { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--core-edge); }

  .bell { width: 100%; height: 44px; justify-content: flex-start; gap: 10px; padding: 0 14px; margin-top: auto;
          font: 600 12px var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); }
  .bell:hover { background: var(--surface-sunken); }
  .bell::after { content: "Handovers"; }
  .bell-badge { position: static; margin-left: auto; order: 3; }
  .user-chip { margin: auto 0 0; }
  .bell:not([hidden]) ~ .user-chip { margin-top: 6px; }
  .chip { width: 100%; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--surface-sunken); border-color: transparent; color: var(--blank-black); }
  .chip:hover { background: var(--core-track); }
  .chip-role { box-shadow: inset 0 0 0 1px var(--core-edge); }
  .chip-action, .combo-add { color: #FFFFFF; }
  .chip-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
  .bell-panel { top: auto; bottom: 12px; left: 280px; right: auto; }

  /* ---- number cards ---- */
  .stat-band { gap: 20px; }
  .stat-cell { display: flex; flex-direction: column-reverse; justify-content: space-between; min-height: 132px; padding: 20px; }
  .stat-cell .num { font-size: 46px; letter-spacing: -0.04em; line-height: 1; }
  .stat-cell .lbl { font-size: 12px; font-weight: 600; margin-top: 0; color: var(--text-secondary); }
  .stat-cell.inverse { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--core-edge), var(--shadow-card); }
  .stat-cell.inverse .lbl { color: rgba(11, 11, 12, .72); }
  .stat-cell.warn { background: var(--core-bad-bg); color: var(--state-problem); }
  .stat-cell.warn .lbl { color: var(--state-problem); }
  .grid { gap: 20px; }

  /* ---- buttons: pills; ink = primary, lemon = the one accent ---- */
  .btn { border-radius: 999px; color: #FFFFFF; }
  .btn.secondary { color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--core-edge); }
  .btn.tertiary { color: var(--blank-black); background: var(--surface-card); border-color: var(--border-subtle); box-shadow: var(--shadow-card); }
  .btn.tertiary:hover { background: var(--surface-card); color: var(--blank-black); border-color: var(--blank-black); }
  .panel .btn.tertiary, .modal .btn.tertiary { box-shadow: none; }
  .btn.danger { color: #FFFFFF; }
  .btn-back:hover { background: var(--surface-card); color: var(--blank-black); border-color: var(--blank-black); }
  .cat-pick button, .mode-btn { border-radius: 999px; }

  /* ---- fields: white, hairline, soft focus ring ---- */
  input[type="text"], input[type="search"], input[type="password"], input[type="date"], select, textarea {
    background: var(--surface-card); border-color: var(--border-subtle);
  }
  input:focus, select:focus, textarea:focus { border-color: var(--blank-black); box-shadow: 0 0 0 3px var(--core-track); }
  .panel input:focus, .panel select:focus, .panel textarea:focus, .combo-search:focus { box-shadow: none; }
  .combo-btn { border-color: var(--border-subtle); }
  .combo-panel, .search-drop { box-shadow: var(--shadow-overlay); }

  /* ---- lists: no black header bars; small grey caps instead ---- */
  .log-head, .bp-head { background: var(--surface-sunken); color: var(--text-muted); }
  .log-row .act, .badge, .bp-dir, .keycard .kc-status { border-radius: 999px; }
  .badge { background: var(--surface-sunken); color: var(--text-secondary); }
  .act.occupied { color: #FFFFFF; }
  .act.bad { background: var(--core-bad-bg); color: var(--state-problem); }
  .acct-row.is-pending { background: rgba(255, 255, 0, .14); }
  .modal { border-radius: 24px; }
}

/* ---- phone repairs: two rows the rounded look pushed onto a second line ----
   The rounded look made fields wider and gave Settings blocks an inner padding;
   on a 360-375 px phone that was enough to wrap (a) the colour swatch away from
   its name and (b) the two Activity filters apart. These put both back on one
   line, as on the square version. The filter rule only applies where a row
   holds two selects, so the single Dashboard sort keeps its own width. */
@media (max-width: 768px) {
  .cat-row input[type="text"] { flex: 1 1 calc(100% - 56px); width: auto; min-width: 0; max-width: none; }
  .head-actions .sort-select ~ .sort-select { flex: 1 1 120px; min-width: 0; }
  .head-actions .sort-select:has(~ .sort-select) { flex: 1 1 120px; min-width: 0; }
}

/* Found by tools/mobile-gate (2026-09-29): cards sit inside the page's own
   16 px margin, and a further 24 px inside each card left text 48 px narrower
   than on the square version — long lines wrapped more and pages grew 5-9%.
   16 px inside keeps the card look and gives most of the width back. */
@media (max-width: 640px) {
  .log-row, .acct-row, .export-bar { padding-left: var(--s3); padding-right: var(--s3); }
  .settings-block { padding: var(--s3); }
}
/* the smallest phones (320 px): number cards stay two to a row, as before */
@media (max-width: 359px) {
  .stat-cell { flex: 1 1 120px; padding: var(--s3); }
}
/* Found by tools/mobile-gate once it drew the signed-in chip (2026-09-29): on a
   320 px phone the mark + full wordmark + bell + the user's photo do not fit in
   the top bar, so the whole page could be dragged sideways (3 px on the square
   version, 15 px on the rounded one). The product name stays; the company name
   steps aside on the narrowest phones only. */
@media (max-width: 359px) {
  .topbar .brand small, .topbar .brand > span { display: none; }
}
/* Signed out, waiting for approval, or offline: app.js hides the menu
   (#nav[hidden]) and the page is a single centred card that already carries the
   logo and its own buttons. An empty white sidebar beside it looked broken, so
   on desktop the sidebar only appears once there is a menu to put in it. */
@media (min-width: 1025px) {
  body:has(#nav[hidden]) { padding-left: 0; }
  body:has(#nav[hidden]) .topbar { display: none; }
}

/* v4.5.1: on a phone the "done" message used to land ON the bottom tab bar and
   hide the menu for three seconds. It now sits just above it. */
@media (max-width: 768px) {
  .toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- v4.5.1: the "? Guide" link (Calvin, 2026-09-29) ----------
   A small pill at the very bottom of every page, and a row in the desktop
   sidebar. Both open KEYCARD-Guide.pdf in a new tab. 40 px tall on purpose:
   small to the eye, still a finger-sized target. */
/* v4.5.4: "✨ What's new" joins the row, bottom left; the guide keeps the right */
.guide-row { flex: 0 0 100%; display: flex; justify-content: space-between; gap: 8px; }
.guide-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 10px;
  font-family: inherit; cursor: pointer; line-height: 1;
  border-radius: var(--radius-pill); border: 1px solid var(--border-subtle);
  background: var(--surface-card); color: var(--blank-black); text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.guide-link i {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: 0;
  background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px rgba(11, 11, 12, .16);
}
.guide-link:hover { border-color: var(--blank-black); }
.guide-link.side { display: none; }
@media (min-width: 1025px) {
  .guide-link.side {
    display: flex; width: 100%; height: 44px; min-height: 0; padding: 0 14px; gap: 10px; margin-top: auto;
    border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 600;
  }
  .guide-link.side:hover { background: var(--surface-sunken); color: var(--blank-black); }
  .guide-link.side i { width: 19px; height: 19px; font-size: 11px; }
  /* the guide row now starts the bottom group, so the bell and the chip follow it */
  .guide-link.side ~ .guide-link.side { margin-top: 0; }
  .guide-link.side ~ .bell { margin-top: 0; }
  .guide-link.side ~ .user-chip { margin-top: 6px; }
}

/* ---------- v4.5.5: deep-review fixes (2026-10-02) ----------
   Paint and stacking only — no phone page changes size or order. */

/* 🔔 "Notifications ON / Enable" row: it was white text (and an invisible
   white "Turn off") on the WHITE bell panel, from the days the panel was black */
.bp-push { color: var(--text-secondary); border-top-color: var(--border-subtle); margin-top: 0; padding: 10px 14px 12px; }

/* pending bar (black) — Decline / Cancel stay see-through on every skin (the
   desktop skin painted them white: two blank pills), Accept is lemon so it
   reads as a button, not as loose text on black */
.pending-bar .btn.tertiary { background: transparent; border-color: #fff; color: #fff; }
.pending-bar:not(.stuck) .btn:not(.tertiary) { background: var(--accent); color: var(--on-accent); }

/* bulk mode: the pinned bar stops BELOW the floating top bar (it slid under
   it — "Exit bulk" and the counter were hidden) */
@media (max-width: 1024px) { .bulk-bar.live { top: calc(var(--page-inset) + 64px + 8px); } }
@media (max-width: 900px)  { .bulk-bar.live { top: calc(var(--page-inset) + 52px + 8px); } }
@media (max-width: 400px)  { .bulk-bar.live { top: calc(var(--page-inset) + 48px + 8px); } }

/* phones: the 🔔 panel lives inside the top bar, so the bar must sit above the
   tab bar (55) or the panel's last rows hide under it; and an open dropdown
   is never covered by the tab bar — taps there switched page */
@media (max-width: 768px) {
  .topbar { z-index: 56; }
  body:has(.combo-panel:not([hidden])) .tabbar { visibility: hidden; }
}

/* toasts use the screen's width (they were capped at half of it: a long
   message became six lines on a phone) */
.toast { left: 0; right: 0; margin: 0 auto; width: max-content; max-width: min(90vw, 480px); transform: none; }

/* keyboard focus shows on black surfaces too */
.panel .btn:focus-visible, .pending-bar .btn:focus-visible, .tabbar a:focus-visible { outline-color: var(--accent); }

/* a blocked card YOU can fix (out-of-step record) looks tappable, not dead */
.panel-cards .keycard.blocked[data-fix] { opacity: 1; cursor: pointer; box-shadow: 0 0 0 2px var(--state-problem); }
.panel-cards .keycard.blocked[data-fix] .kc-block { background: var(--state-problem); color: #fff; font-weight: 700; }

/* the "— other CRs' projects —" divider in the project list is a label */
.combo-item.muted { pointer-events: none; color: var(--text-secondary); background: var(--surface-muted); justify-content: center; font-size: 11px; }

/* the chosen Overwrite mode stays visibly chosen under the mouse */
.who-pick2 .btn.on:hover { background: var(--blank-black); color: var(--blank-white); }

@media (min-width: 1025px) {
  /* short laptop windows: the sidebar scrolls instead of crushing Guide /
     What's new / the bell into 5 px slivers on top of each other */
  .topbar { overflow-y: auto; }
  .topbar > * { flex-shrink: 0; }
  /* number tiles: an even grid, no single tile stretched across the row */
  .stat-band { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
