/* ARC-GNY DAT Companion v2.3 — mobile-first dark theme */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1a2e;
  --bg-card: #232340;
  --bg-card-alt: #2a2a4a;
  --text: #e8e8f0;
  --text-dim: #9898b0;
  --accent: #e74c3c;
  --accent-dim: #c0392b;
  --green: #2ecc71;
  --amber: #d4a843;
  --blue: #42a5f5;
  --radius: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* --- Header --- */

#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--accent);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.freshness {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(46,204,113,0.15);
  color: var(--green);
}

.freshness.stale {
  background: rgba(231,76,60,0.15);
  color: var(--accent);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

/* --- Filter bar --- */

.filter-bar {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.filter-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #444;
  background: transparent;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}

.filter-chip.filter-active {
  background: rgba(231,76,60,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Main content --- */

main {
  padding: 8px 12px 24px;
}

/* --- ECC chip (above command card) --- */

.ecc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.ecc-chip:active {
  background: var(--bg-card-alt);
}

.ecc-chip-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.ecc-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.ecc-chip-number {
  font-size: 15px;
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text);
}

/* --- Command card (RM / DPMOC) --- */

.command-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.command-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.command-row + .command-row {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.command-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  min-width: 32px;
  text-transform: uppercase;
}

.command-info {
  flex: 1;
  min-width: 0;
}

.command-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-hours {
  font-size: 12px;
  color: var(--text-dim);
}

/* --- Call button --- */

.btn-call {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid rgba(46,204,113,0.4);
  background: rgba(46,204,113,0.08);
  text-decoration: none;
  font-size: 14px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  color: var(--green);
}

.btn-call:active {
  background: rgba(46,204,113,0.25);
}

/* --- Sections --- */

.section {
  margin-bottom: 16px;
}

.section h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}

/* --- Event cards --- */

.event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
}

.event-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.event-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.event-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Menlo', monospace;
}

.event-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
}

.event-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(66,165,245,0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

.event-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.event-address {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.event-client {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.client-phone {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
}

.event-summary {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* --- Directions button (top-right of event header) --- */

.btn-directions {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(66,165,245,0.1);
  text-decoration: none;
  font-size: 20px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.btn-directions:active {
  background: rgba(66,165,245,0.25);
}

.btn-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(66,165,245,0.1);
  -webkit-tap-highlight-color: transparent;
}

.btn-action:active {
  background: rgba(66,165,245,0.25);
}

.btn-action.btn-small {
  font-size: 11px;
  padding: 3px 8px;
}

/* --- Tally chip --- */

.tally-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  background: rgba(212,168,67,0.12);
  padding: 3px 8px;
  border-radius: 6px;
  margin: 4px 0;
  display: inline-block;
}

/* --- Responder chips --- */

.resp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}

.resp-chip {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card-alt);
  border-left: 2px solid #555;
}

.resp-role {
  color: var(--text-dim);
  font-size: 10px;
}

/* --- Vacate section (safety-critical, always visible) --- */

.vacate-section {
  border-left: 3px solid #e53935;
  background: rgba(229,57,53,0.06);
  border-radius: 0 6px 6px 0;
  padding: 6px 8px;
  margin: 6px 0;
}

.vacate-order {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}

.vacate-order + .vacate-order {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.vacate-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.vacate-badge-hpd {
  background: rgba(229,57,53,0.25);
  color: #ef5350;
}

.vacate-badge-dob {
  background: rgba(255,152,0,0.25);
  color: #ff9800;
}

.vacate-info {
  flex: 1;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 0;
}

.vacate-number {
  font-weight: 600;
  color: var(--text);
}

.vacate-type {
  font-weight: 600;
  color: #ef5350;
}

.vacate-apts {
  font-size: 10px;
  color: var(--text-dim);
}

/* --- Street View thumbnail --- */

.event-streetview {
  width: 100%;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
  height: auto;
}

/* --- Expand/Collapse details --- */

.event-expand-trigger {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  padding: 8px 4px;
  margin: 2px -4px;
  -webkit-tap-highlight-color: transparent;
}

.event-expand-trigger:active {
  background: rgba(66,165,245,0.08);
  border-radius: 6px;
}

.expand-arrow {
  font-size: 10px;
  display: inline-block;
  transition: transform 0.15s;
  margin-right: 2px;
}

.event-expand-body.hidden {
  display: none;
}

.event-expand-body {
  padding: 6px 0;
}

/* --- Apartment DA Grid --- */

.da-grid {
  font-size: 11px;
  margin: 6px 0;
  overflow-x: auto;
  background: var(--bg-card-alt);
  padding: 4px;
  border-radius: 6px;
}

.da-grid-header {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 2px;
}

.da-grid-header .da-cell {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 10px;
}

.da-grid-row {
  display: flex;
  margin-bottom: 1px;
}

.da-cell {
  flex: 1;
  min-width: 44px;
  padding: 2px 3px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.da-cell:last-child {
  border-right: none;
}

.da-cell:first-child {
  min-width: 24px;
  max-width: 36px;
  flex: 0 0 36px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.da-fl {
  color: #889;
  font-weight: 600;
}

.da-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  margin: 1px;
}

.da-des { background: rgba(244,67,54,0.25); color: #f44336; }
.da-maj { background: rgba(255,152,0,0.25); color: #ff9800; }
.da-min { background: rgba(255,235,59,0.2); color: #fdd835; }
.da-aff { background: rgba(66,165,245,0.2); color: #42a5f5; }
.da-nvd { background: rgba(150,150,170,0.15); color: #999; }

/* --- Case list --- */

.case-list {
  margin: 6px 0;
}

.case-list-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 4px 0 2px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.case-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
}

.case-unit {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.case-number {
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.case-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-name a {
  color: var(--text);
  text-decoration: none;
}

.case-lodging {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.case-lodging-yes {
  background: rgba(206,147,216,0.15);
  color: #ce93d8;
}

.case-lodging-no {
  background: rgba(66,165,245,0.1);
  color: var(--blue);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.case-lodging-no:active {
  background: rgba(66,165,245,0.25);
}

.case-financial {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 0 0 0;
}

.case-fin-chip {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.case-fin-approved { background: rgba(46,204,113,0.15); color: var(--green); }
.case-fin-pending { background: rgba(212,168,67,0.12); color: var(--amber); }
.case-fin-error { background: rgba(231,76,60,0.15); color: var(--accent); }

/* --- Lodging details --- */

.lodging-details {
  margin: 6px 0;
}

.lodging-row {
  background: var(--bg-card-alt);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 4px;
}

.lodging-hotel {
  font-size: 13px;
  font-weight: 600;
}

.lodging-hotel-address {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

.lodging-hotel-phone {
  font-size: 12px;
  color: var(--green);
  text-decoration: none;
}

.lodging-checkout {
  font-size: 11px;
  color: var(--amber);
}

.lodging-units {
  font-size: 11px;
  color: var(--text-dim);
  margin: 2px 0;
}

.lodging-copy-btn {
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(66,165,245,0.1);
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}

.lodging-copy-btn:active {
  background: rgba(66,165,245,0.25);
}

/* --- Roster --- */

/* Role badges (inline chips matching dashboard pattern) */
.roster-role-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
  margin-right: 6px;
}
.role-sv       { background: rgba(212,168,67,0.25);  color: #D4A843; }
.role-sa       { background: rgba(66,165,245,0.2);   color: #42A5F5; }
.role-spc      { background: rgba(120,144,156,0.25); color: #90a4ae; }
.role-obs      { background: rgba(102,187,106,0.2);  color: #66BB6A; }
.role-support  { background: rgba(38,166,154,0.2);   color: #26A69A; }
.role-default  { background: rgba(255,255,255,0.08); color: #888; }

/* ID card button */
.btn-id-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid rgba(66,165,245,0.4);
  background: rgba(66,165,245,0.08);
  color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  margin-right: 6px;
}
.btn-id-card:active {
  background: rgba(66,165,245,0.25);
}

/* ID card overlay */
.idcard-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.idcard-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.idcard-name {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.idcard-email {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
  word-break: break-all;
}

.idcard-vcid {
  font-size: 32px;
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #1a1a2e;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.idcard-qr {
  display: inline-block;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
}

.idcard-hint {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
}

.roster-row {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.roster-info {
  flex: 1;
  min-width: 0;
}

.roster-name {
  display: block;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-hours {
  font-size: 12px;
  color: var(--text-dim);
}

.roster-id {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Menlo', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Roster shift groups */

.roster-later {
  margin-top: 6px;
}

.roster-later-trigger {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
}

.roster-later-trigger:active {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}

.roster-later-body {
  opacity: 0.7;
}

.roster-later-body .roster-name {
  font-size: 13px;
}

.roster-shift-time {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

.roster-day {
  font-size: 0.75em;
  color: #4fc3f7;
  font-weight: 600;
  margin-right: 4px;
}

.roster-day-divider {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}

/* --- Resources --- */

.resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.resource-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 20px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.resource-btn span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

.resource-btn:active {
  background: var(--bg-card-alt);
}

.resource-subtext {
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  margin-top: -2px;
}

/* --- Booking QR --- */

.booking-qr-section {
  margin-top: 12px;
  text-align: center;
}

.booking-qr-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.booking-qr-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.booking-qr-canvas {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  display: inline-block;
}

/* --- Footer --- */

.companion-footer {
  text-align: center;
  padding: 16px 12px 24px;
  font-size: 11px;
  color: #555;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.companion-footer .countdown {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Menlo', monospace;
}

.companion-footer .countdown-expired {
  color: var(--accent);
}

/* --- QR Scanner overlay --- */

.scanner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.scanner-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

/* --- Utility --- */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 20px 0;
}

.full-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.scan-prompt {
  text-align: center;
  max-width: 280px;
}

.scan-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.scan-prompt h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.scan-prompt p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  background: var(--accent-dim);
}

.hidden {
  display: none;
}

/* --- Spinner --- */

.loading {
  text-align: center;
}

.loading p {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- DPMOC de-emphasis --- */
.command-row-dim {
  opacity: 0.4;
}

/* --- Tally table --- */
.tally-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 6px 0;
  color: var(--text-secondary);
}
.tally-table td {
  padding: 2px 6px;
}
.tally-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #778;
  font-variant: small-caps;
}
.tally-lodged td {
  color: #ce93d8;
}

/* --- Responder VCID --- */
.resp-vcid {
  font-size: 9px;
  color: #667;
  margin-left: 2px;
}

/* --- Freshness tap flash --- */
.freshness-flash {
  animation: freshFlash 0.6s ease;
}
@keyframes freshFlash {
  0% { opacity: 1; }
  30% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* --- Directions SVG icon --- */
.btn-directions svg {
  vertical-align: middle;
}

/* --- My Event highlight --- */
.event-card.my-event {
  border-left: 3px solid #4fc3f7;
  background: rgba(79,195,247,0.06);
}

.my-event-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4fc3f7;
  background: rgba(79,195,247,0.15);
  padding: 1px 5px;
  border-radius: 3px;
}

/* --- Identity badge in header --- */
.identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #4fc3f7;
  background: rgba(79,195,247,0.12);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.identity-clear {
  background: none;
  border: none;
  color: #4fc3f7;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.identity-link {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 2px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* --- Identity picker overlay --- */
.identity-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.identity-modal {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px 16px;
  max-width: 320px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.identity-modal h2 {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}

.identity-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.identity-row:active {
  background: rgba(79,195,247,0.1);
}

.identity-name {
  font-weight: 500;
}

.identity-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card-alt);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.identity-skip {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: none;
  border: 1px solid #444;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.identity-skip:active {
  background: rgba(255,255,255,0.04);
}

/* --- Prevent overscroll bounce on iOS --- */
@media (display-mode: standalone) {
  body {
    overscroll-behavior: none;
  }
}
