    /* ── Page sections ── */
    .page { display: none; }
    .page.active { display: block; }

    /* ── Grid ── */
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

    /* ── Member Card ── */
    .member-card {
      display: flex; align-items: center; gap: 16px; padding: 16px;
      background: var(--bg-surface); border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg); transition: box-shadow 0.2s var(--ease);
    }
    .member-card:hover { box-shadow: var(--shadow-sm); }
    .member-info { flex: 1; min-width: 0; }
    .member-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .member-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

    /* ── Zone Page ── */
    .zone-map-wrap {
      position: relative; width: 100%; height: 200px;
      border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
    }
    .zone-map-wrap .maplibregl-map { width: 100%; height: 100%; }
    .zone-map-pin {
      position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -100%); z-index: 5; pointer-events: none;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    }
    .zone-map-pin svg { width: 36px; height: 36px; }
    .zone-map-crosshair {
      position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
      width: 24px; height: 24px; border-radius: 50%;
      border: 2px solid rgba(59,130,246,0.3);
    }
    .zone-search-wrap {
      position: relative; margin-bottom: 12px;
    }
    .zone-search-input {
      width: 100%; padding: 12px 16px 12px 40px; font-size: 14px; font-family: inherit;
      background: var(--bg-inset); border: 1.5px solid var(--border-subtle); border-radius: 999px;
      color: var(--text-primary); outline: none; transition: border-color 0.2s var(--ease);
    }
    .zone-search-input:focus { border-color: var(--accent); }
    .zone-search-input::placeholder { color: #94A3B8; }
    .zone-search-icon {
      position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
      color: #94A3B8; pointer-events: none;
    }
    .zone-search-results {
      position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
      background: var(--bg-surface); border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md); box-shadow: var(--shadow-md);
      margin-top: 4px; max-height: 200px; overflow-y: auto; display: none;
    }
    .zone-search-results.active { display: block; }
    .zone-search-result {
      padding: 10px 16px; cursor: pointer; font-size: 13px;
      color: var(--text-primary); transition: background 0.1s;
      border-bottom: 1px solid var(--border-subtle);
    }
    .zone-search-result:last-child { border-bottom: none; }
    .zone-search-result:hover { background: var(--bg-surface-hover); }
    .zone-search-result small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 1px; }
    .zone-radius-slider {
      width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
      background: #E2E8F0; border-radius: 3px; outline: none; cursor: pointer;
    }
    .zone-radius-slider::-webkit-slider-thumb {
      -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
      background: var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }
    .zone-radius-slider::-moz-range-thumb {
      width: 22px; height: 22px; border-radius: 50%; border: none;
      background: var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }
    .zone-toggle-row {
      display: flex; align-items: center; gap: 12px; padding: 14px 0;
      border-bottom: 1px solid var(--border-subtle);
    }
    .zone-toggle-row:last-child { border-bottom: none; }
    .zone-toggle-icon {
      width: 36px; height: 36px; border-radius: 10px; display: flex;
      align-items: center; justify-content: center; flex-shrink: 0;
    }
    .zone-toggle-icon svg { width: 18px; height: 18px; }
    .zone-toggle-content { flex: 1; min-width: 0; }
    .zone-toggle-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .zone-toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
    .zone-scope-pills {
      display: flex; gap: 8px; margin-top: 8px;
    }
    .zone-scope-pill {
      flex: 1; padding: 10px 16px; font-size: 13px; font-weight: 600; font-family: inherit;
      border-radius: 999px; cursor: pointer; text-align: center;
      transition: all 0.2s var(--ease); border: 1.5px solid var(--border-subtle);
      background: transparent; color: var(--text-secondary);
    }
    .zone-scope-pill.active {
      background: #1A2536; color: #fff; border-color: #1A2536;
    }
    .zone-scope-subtitle {
      font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 6px;
    }
    .zone-modal-content {
      max-height: 75vh; overflow-y: auto; padding: 0 2px;
    }
    .zone-modal-header {
      display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
    }
    .zone-modal-header h3 { margin: 0; }
    .zone-modal-header .btn-pill-navy { padding: 8px 20px; font-size: 13px; }
    .btn-pill-red-outline {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 14px 32px; font-size: 14px; font-weight: 700; font-family: inherit;
      background: transparent; color: #DC2626; border: 1.5px solid #FCA5A5;
      border-radius: 999px; cursor: pointer; transition: all 0.2s var(--ease);
    }
    .btn-pill-red-outline:hover { background: #FEE2E2; border-color: #DC2626; }
    .zone-info-card {
      background: var(--bg-surface); border-radius: var(--radius-xl);
      box-shadow: var(--shadow-sm); padding: 4px 18px; margin-top: 20px;
    }
    .zone-info-row {
      display: flex; align-items: center; gap: 12px; padding: 14px 0;
      border-bottom: 1px solid var(--border-subtle);
    }
    .zone-info-row:last-child { border-bottom: none; }
    .zone-info-icon {
      width: 36px; height: 36px; border-radius: 10px; display: flex;
      align-items: center; justify-content: center; flex-shrink: 0;
    }
    .zone-info-icon svg { width: 18px; height: 18px; }
    .zone-info-content { flex: 1; }
    .zone-info-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .zone-info-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

    /* ── Map Page ── */
    #page-map.active {
      display: flex; flex-direction: column; height: calc(100vh - 64px);
      overflow: hidden;
    }
    #page-map .page-header { flex-shrink: 0; margin-bottom: 12px; }
    .map-container {
      width: 100%; flex: 1; min-height: 0; border-radius: var(--radius-xl);
      overflow: hidden; position: relative;
    }
    #tracka-map { width: 100%; height: 100%; }
    .map-controls {
      position: absolute; top: 16px; right: 16px; z-index: 10;
      display: flex; flex-direction: column; gap: 8px;
    }
    .map-ctrl-group {
      display: flex; background: var(--bg-surface); border-radius: var(--radius-md);
      box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--border-subtle);
    }
    .map-ctrl-btn {
      padding: 10px 16px; font-size: 12px; font-weight: 600; font-family: inherit;
      border: none; cursor: pointer; background: var(--bg-surface); color: var(--text-secondary);
      transition: all 0.15s var(--ease); min-width: 44px; min-height: 44px;
      display: flex; align-items: center; justify-content: center; gap: 6px;
    }
    .map-ctrl-btn:hover { background: var(--bg-surface-hover); }
    .map-ctrl-btn.active { background: var(--accent); color: #fff; }
    .map-ctrl-btn + .map-ctrl-btn { border-left: 1px solid var(--border-subtle); }
    .map-zoom-slider-wrap {
      position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
      z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 6px;
      background: var(--bg-surface); border-radius: 28px; box-shadow: var(--shadow-md);
      border: 1px solid var(--border-subtle); padding: 10px 8px;
    }
    .map-zoom-end {
      width: 32px; height: 32px; border: none; background: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
      border-radius: 50%; transition: background 0.15s, color 0.15s;
    }
    .map-zoom-end:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
    .map-zoom-range {
      -webkit-appearance: none; appearance: none;
      width: 6px; height: 140px; background: #E2E8F0; border-radius: 3px;
      outline: none; cursor: pointer;
      writing-mode: vertical-lr; direction: rtl;
    }
    .map-zoom-range::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none;
      width: 20px; height: 20px; border-radius: 50%;
      background: var(--accent); border: 3px solid #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: grab;
    }
    .map-zoom-range::-webkit-slider-thumb:active { cursor: grabbing; }
    .map-zoom-range::-moz-range-thumb {
      width: 20px; height: 20px; border-radius: 50%;
      background: var(--accent); border: 3px solid #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: grab;
    }

    /* Map markers */
    .map-marker {
      display: flex; flex-direction: column; align-items: center; cursor: pointer;
      filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
    }
    .map-marker-avatar {
      width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 16px; color: #fff;
      position: relative; background: var(--accent);
      box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    .map-marker-avatar-img {
      width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    }
    .map-marker-status {
      position: absolute; bottom: -2px; right: -2px; width: 16px; height: 16px;
      border-radius: 50%; border: 2.5px solid #fff; z-index: 2;
    }
    .map-marker-status.status-active { background: #10B981; }
    .map-marker-status.status-recent { background: #F59E0B; }
    .map-marker-status.status-stale { background: #6B7280; }
    .map-marker-status.status-offline { background: #4A4A4A; }
    .map-marker-status.status-paused { background: #8B5CF6; }
    .map-marker-speed {
      margin-top: 2px; padding: 2px 8px; border-radius: 999px;
      background: var(--bg-surface); font-size: 10px; font-weight: 600;
      color: var(--text-primary); box-shadow: var(--shadow-sm);
      display: flex; align-items: center; gap: 3px; white-space: nowrap;
    }
    .map-marker-name { display: none; }

    /* (Old map popup CSS removed — replaced by person panel) */

    #page-map { position: relative; }

    /* ── Person Detail Panel (slide-in) ── */
    .person-panel {
      position: absolute; top: 0; right: -460px; width: 440px; height: 100%;
      background: #FFFFFF; z-index: 20;
      transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: -8px 0 30px rgba(0,0,0,0.1);
      border-radius: 20px 0 0 20px;
      overflow-y: auto; padding: 32px 32px;
    }
    .person-panel.open { right: 0; }
    .person-panel-close {
      position: absolute; top: 16px; right: 16px;
      width: 36px; height: 36px; border-radius: 50%;
      background: #F1F5F9; border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px; color: var(--text-secondary); line-height: 1;
      transition: background 0.15s, color 0.15s;
    }
    .person-panel-close:hover { background: #E2E8F0; color: var(--text-primary); }

    /* Shift map controls when panel is open */
    .map-controls, .map-zoom-slider-wrap {
      transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .map-container.panel-open .map-controls { right: 456px; }
    .map-container.panel-open .map-zoom-slider-wrap { right: 456px; }

    /* Panel avatar */
    .pp-avatar-wrap {
      display: flex; justify-content: center; margin-bottom: 16px; margin-top: 8px;
    }
    .pp-avatar {
      width: 80px; height: 80px; border-radius: 50%; position: relative;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 28px; color: #fff;
    }
    .pp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .pp-status-dot {
      position: absolute; bottom: 0; right: 0;
      width: 20px; height: 20px; border-radius: 50%;
      border: 3px solid #fff; z-index: 2;
    }
    .pp-status-dot.status-active { background: #10B981; }
    .pp-status-dot.status-recent { background: #F59E0B; }
    .pp-status-dot.status-stale { background: #6B7280; }
    .pp-status-dot.status-offline { background: #4A4A4A; }
    .pp-status-dot.status-paused { background: #8B5CF6; }

    /* Name + badge */
    .pp-name-section { text-align: center; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: nowrap; }
    .pp-name { font-size: 20px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

    /* Info chips row */
    .pp-chips { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: center; margin-bottom: 24px; }
    .pp-chip {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 12px; border-radius: 999px;
      font-size: 12px; font-weight: 600;
    }
    .pp-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
    .pp-chip-battery-green { background: #D1FAE5; color: #065F46; }
    .pp-chip-battery-amber { background: #FEF3C7; color: #92400E; }
    .pp-chip-battery-red { background: #FEE2E2; color: #991B1B; }
    .pp-chip-time { background: #DBEAFE; color: #1E40AF; }
    .pp-chip-address { background: #EDE9FE; color: #5B21B6; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ── Person Panel Action Cards ── */
    .pp-card {
      background: #FFFFFF; border: 1.5px solid rgba(0,0,0,0.10);
      border-radius: 16px; margin-top: 14px; overflow: hidden;
    }
    .pp-card-row {
      display: flex; align-items: center; gap: 14px; padding: 18px 20px; min-height: 76px;
    }
    .pp-card-row + .pp-card-row { border-top: 1px solid var(--border-subtle); }
    .pp-card-icon {
      width: 44px; height: 44px; border-radius: 12px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .pp-card-icon svg { width: 22px; height: 22px; }
    .pp-card-text { flex: 1; min-width: 0; }
    .pp-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
    .pp-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
    .pp-card-action { flex-shrink: 0; }

    /* History button — matches app's outlined pill */
    .pp-history-btn {
      padding: 10px 22px; font-size: 13px; font-weight: 600; font-family: inherit;
      background: transparent; color: var(--text-primary);
      border: 1.5px solid rgba(0,0,0,0.12); border-radius: 999px;
      cursor: pointer; transition: all 0.15s; white-space: nowrap;
    }
    .pp-history-btn:hover { border-color: rgba(0,0,0,0.25); background: var(--bg-inset); }
    .pp-history-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    /* ── Geofencing Dropdown ── */
    .pp-geofence-header {
      display: flex; align-items: center; gap: 14px; padding: 18px 20px; min-height: 76px;
      cursor: pointer; user-select: none;
    }
    .pp-geofence-header .chevron {
      margin-left: auto; transition: transform 0.2s; color: var(--text-muted);
    }
    .pp-geofence-header.expanded .chevron { transform: rotate(180deg); }
    .pp-geofence-zones {
      display: none; padding: 0 18px 14px;
      border-top: 1px solid var(--border-subtle);
    }
    .pp-geofence-zones.show { display: block; }
    .pp-zone-row {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 0;
    }
    .pp-zone-row + .pp-zone-row { border-top: 1px solid rgba(0,0,0,0.04); }
    .pp-zone-icon {
      width: 38px; height: 38px; border-radius: 10px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .pp-zone-icon svg { width: 18px; height: 18px; }
    .pp-zone-info { flex: 1; min-width: 0; }
    .pp-zone-name {
      font-size: 14px; font-weight: 600; color: var(--text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .pp-zone-address {
      font-size: 11px; color: var(--text-muted); margin-top: 1px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .pp-zone-btns { display: flex; gap: 6px; flex-shrink: 0; }
    .pp-trigger-btn {
      width: 38px; height: 38px; border-radius: 50%; border: 2px solid #CBD5E1;
      background: transparent; cursor: pointer; display: flex;
      align-items: center; justify-content: center;
      transition: all 0.15s; color: #94A3B8; padding: 0;
    }
    .pp-trigger-btn.active {
      background: #1E293B; border-color: #1E293B; color: #FFFFFF;
    }
    .pp-trigger-btn:hover:not(.active) { border-color: #94A3B8; color: #64748B; }
    .pp-trigger-btn:hover:not(.active) {
      border-color: #64748B; color: #64748B;
    }

    /* ── Family page: invite code card (app-matching design) ── */
    .family-code-card {
      background: linear-gradient(135deg, #0D2B3E, #1A4A6E, #0D2B3E);
      border-radius: 20px; padding: 20px; margin-bottom: 24px;
      box-shadow: 0 8px 20px rgba(13,43,62,0.4);
      transition: background 0.4s cubic-bezier(0.33,1,0.68,1), box-shadow 0.4s;
      user-select: none; cursor: pointer;
    }
    .family-code-card.revealed {
      background: linear-gradient(135deg, #0F3854, #236B96, #0F3854);
      box-shadow: 0 8px 28px rgba(13,43,62,0.5);
    }
    .family-code-card-header {
      display: flex; justify-content: space-between; align-items: center;
      margin-bottom: 16px;
    }
    .family-code-card-header-left {
      display: flex; align-items: center; gap: 10px;
    }
    .family-code-card-icon {
      width: 36px; height: 36px; border-radius: 50%;
      background: rgba(255,255,255,0.1); display: flex;
      align-items: center; justify-content: center;
    }
    .family-code-card-icon svg { width: 18px; height: 18px; color: #fff; }
    .family-code-card-label {
      font-size: 14px; font-weight: 500; color: #fff;
    }
    .family-copy-btn {
      padding: 6px 14px; font-size: 12px; font-weight: 600; font-family: inherit;
      background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2);
      border-radius: 20px; cursor: pointer; transition: background 0.15s;
      display: flex; align-items: center; gap: 6px;
    }
    .family-copy-btn:hover { background: rgba(255,255,255,0.22); }
    .family-name-display {
      font-size: 28px; font-weight: 700; color: #fff; letter-spacing: 0.15em;
      text-transform: uppercase; text-align: center; margin-bottom: 16px;
    }
    .family-code-boxes { display: flex; gap: 6px; justify-content: center; }
    .family-code-box {
      width: 40px; height: 48px; border-radius: 12px;
      background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
      display: flex; align-items: center; justify-content: center;
      transition: all 0.4s cubic-bezier(0.33,1,0.68,1);
      font-family: inherit; position: relative;
    }
    .family-code-box .dot {
      font-size: 28px; color: rgba(255,255,255,0.4); font-weight: 900;
      transition: opacity 0.3s;
    }
    .family-code-box .digit {
      font-size: 24px; font-weight: 700; color: #fff;
      opacity: 0; transform: scale(0.7);
      transition: all 0.4s cubic-bezier(0.33,1,0.68,1);
      position: absolute;
    }
    .family-code-card.revealed .family-code-box {
      background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2);
    }
    .family-code-card.revealed .family-code-box .dot { opacity: 0; }
    .family-code-card.revealed .family-code-box .digit { opacity: 1; transform: scale(1); }
    /* Staggered reveal delays */
    .family-code-box:nth-child(1) .digit { transition-delay: 0s; }
    .family-code-box:nth-child(2) .digit { transition-delay: 0.06s; }
    .family-code-box:nth-child(3) .digit { transition-delay: 0.12s; }
    .family-code-box:nth-child(4) .digit { transition-delay: 0.18s; }
    .family-code-box:nth-child(5) .digit { transition-delay: 0.24s; }
    .family-code-box:nth-child(6) .digit { transition-delay: 0.3s; }
    .family-code-divider {
      height: 1px; background: rgba(255,255,255,0.08); margin: 16px 0;
    }
    .family-code-footer { position: relative; height: 24px; margin-top: 14px; }
    .family-code-hint {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      font-size: 13px; color: rgba(255,255,255,0.5);
      transition: opacity 0.3s; position: absolute; width: 100%; left: 0;
    }
    .family-code-hint svg { width: 16px; height: 16px; }
    .family-code-hint.hidden-hint { opacity: 1; }
    .family-code-hint.revealed-hint { opacity: 0; }
    .family-code-card.revealed .hidden-hint { opacity: 0; }
    .family-code-card.revealed .revealed-hint { opacity: 1; }

    /* ── Family member row (rich) ── */
    .fm-row {
      display: flex; align-items: center; gap: 14px;
      padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
      cursor: pointer; transition: background 0.12s;
    }
    .fm-row:last-child { border-bottom: none; }
    .fm-row:hover { background: var(--bg-surface-hover); }
    .fm-avatar-wrap { position: relative; flex-shrink: 0; }
    .fm-avatar {
      width: 52px; height: 52px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; font-weight: 700; color: #fff;
      overflow: hidden;
    }
    .fm-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .fm-status-dot {
      position: absolute; bottom: 1px; right: 1px;
      width: 14px; height: 14px; border-radius: 50%;
      border: 2.5px solid var(--bg-surface); background: #6B7280;
    }
    .fm-status-dot.status-active { background: #10B981; }
    .fm-status-dot.status-recent { background: #F59E0B; }
    .fm-status-dot.status-stale { background: #6B7280; }
    .fm-status-dot.status-offline { background: #4A4A4A; }
    .fm-status-dot.status-paused { background: #8B5CF6; }
    .fm-info { flex: 1; min-width: 0; }
    .fm-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .fm-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
    .fm-self-tag {
      font-size: 11px; font-weight: 500; color: var(--text-muted);
    }
    .fm-chips {
      display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
    }
    .fm-chip {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 8px; border-radius: 6px;
      font-size: 11px; font-weight: 500; white-space: nowrap;
    }
    .fm-chip svg { width: 12px; height: 12px; flex-shrink: 0; }
    .fm-chip-battery-green { background: #D1FAE5; color: #065F46; }
    .fm-chip-battery-amber { background: #FEF3C7; color: #92400E; }
    .fm-chip-battery-red { background: #FEE2E2; color: #991B1B; }
    .fm-chip-time { background: #DBEAFE; color: #1E40AF; }
    .fm-chip-address { background: #EDE9FE; color: #5B21B6; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
    .fm-chevron {
      flex-shrink: 0; width: 20px; height: 20px; color: var(--text-muted);
      transition: transform 0.15s;
    }
    .fm-row:hover .fm-chevron { transform: translateX(2px); color: var(--text-secondary); }

    /* ── Family info cards (bottom) ── */
    .family-info-cards {
      display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
      margin-top: 24px; margin-bottom: 16px;
    }
    .family-info-card {
      background: var(--bg-surface); border: 1.5px solid var(--border-subtle);
      border-radius: var(--radius-md); padding: 16px 14px;
      display: flex; gap: 12px; align-items: flex-start;
    }
    .family-info-card-icon {
      width: 36px; height: 36px; border-radius: 10px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .family-info-card-icon svg { width: 18px; height: 18px; }
    .family-info-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
    .family-info-card-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

    /* ── Family leave button ── */
    .family-leave-btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 14px 24px; font-size: 14px; font-weight: 600;
      font-family: inherit; color: #DC2626; background: transparent;
      border: 1.5px solid #FCA5A5; border-radius: 999px; cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .family-leave-btn:hover { background: #FEE2E2; border-color: #DC2626; }

    /* ── Family person modal content ── */
    .fpm-close {
      position: absolute; top: 16px; right: 16px;
      width: 32px; height: 32px; border-radius: 50%;
      background: var(--bg-surface-hover); border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; color: var(--text-muted); transition: background 0.15s;
    }
    .fpm-close:hover { background: #E2E8F0; color: var(--text-primary); }
    .fpm-avatar-wrap { text-align: center; margin-bottom: 16px; }
    .fpm-avatar {
      width: 72px; height: 72px; border-radius: 50%;
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 24px; font-weight: 700; color: #fff;
      position: relative; overflow: hidden;
    }
    .fpm-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .fpm-name-section { text-align: center; margin-bottom: 12px; }
    .fpm-name { font-size: 20px; font-weight: 700; color: var(--text-primary); }
    .fpm-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
    /* Reuse fm-chip styles */

    .fpm-section {
      background: var(--bg-surface); border: 1.5px solid var(--border-subtle);
      border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
    }
    .fpm-section-row {
      display: flex; align-items: center; gap: 12px;
    }
    .fpm-section-icon {
      width: 40px; height: 40px; border-radius: 12px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .fpm-section-icon svg { width: 20px; height: 20px; }
    .fpm-section-text { flex: 1; min-width: 0; }
    .fpm-section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .fpm-section-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
    .fpm-section-action { flex-shrink: 0; }

    /* ── Speed alert slider ── */
    .fpm-speed-slider-wrap { margin-top: 12px; padding: 0 4px; }
    .fpm-speed-label {
      display: flex; justify-content: space-between; align-items: center;
      font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
    }
    .fpm-speed-value { font-weight: 700; color: var(--text-primary); font-size: 13px; }
    .fpm-speed-slider {
      -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
      border-radius: 3px; background: #E2E8F0; outline: none;
    }
    .fpm-speed-slider::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none; width: 20px; height: 20px;
      border-radius: 50%; background: #F97316; cursor: pointer;
      box-shadow: 0 2px 6px rgba(249,115,22,0.3);
    }
    .fpm-speed-slider::-moz-range-thumb {
      width: 20px; height: 20px; border-radius: 50%;
      background: #F97316; cursor: pointer; border: none;
    }

    /* ── Family person modal remove button ── */
    .fpm-remove-btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 12px 20px; font-size: 13px; font-weight: 600;
      font-family: inherit; color: #DC2626; background: transparent;
      border: 1.5px solid #FCA5A5; border-radius: 999px; cursor: pointer;
      transition: background 0.15s, border-color 0.15s; margin-top: 8px;
    }
    .fpm-remove-btn:hover { background: #FEE2E2; border-color: #DC2626; }

    /* ── Overview page: quick stats row ── */
    .ov-stats-row { display: flex; gap: 12px; margin-bottom: 24px; }
    .ov-stat {
      flex: 1; background: #fff; border: 1.5px solid rgba(0,0,0,0.08);
      border-radius: 16px; padding: 16px; text-align: center; min-width: 100px;
    }
    .ov-stat-icon { width: 36px; height: 36px; border-radius: 10px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
    .ov-stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
    .ov-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

    /* ── Overview page: family member list ── */
    .ov-family-list { background: #fff; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
    .ov-family-row {
      display: flex; align-items: center; gap: 14px; padding: 14px 18px;
      cursor: pointer; transition: background 0.15s;
    }
    .ov-family-row:hover { background: var(--bg-inset); }
    .ov-family-row + .ov-family-row { border-top: 1px solid var(--border-subtle); }
    .ov-family-avatar {
      width: 44px; height: 44px; border-radius: 50%; display: flex;
      align-items: center; justify-content: center; font-weight: 700;
      font-size: 15px; color: #fff; position: relative; flex-shrink: 0;
    }
    .ov-family-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
    .ov-family-dot {
      position: absolute; bottom: -1px; right: -1px; width: 13px; height: 13px;
      border-radius: 50%; border: 2.5px solid #fff;
    }
    .ov-family-dot.status-active { background: #10B981; }
    .ov-family-dot.status-recent { background: #F59E0B; }
    .ov-family-dot.status-stale { background: #6B7280; }
    .ov-family-dot.status-offline { background: #4A4A4A; }
    .ov-family-dot.status-paused { background: #8B5CF6; }
    .ov-family-meta { flex: 1; min-width: 0; }
    .ov-family-name { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .ov-family-status { font-size: 12px; font-weight: 500; flex-shrink: 0; }
    .ov-family-status.text-active { color: #10B981; }
    .ov-family-status.text-recent { color: #F59E0B; }
    .ov-family-status.text-stale { color: #6B7280; }
    .ov-family-status.text-offline { color: #4A4A4A; }
    .ov-family-status.text-paused { color: #8B5CF6; }

    /* ── Overview page: events list ── */
    .ov-events-list { background: #fff; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 16px; padding: 4px 18px; margin-bottom: 24px; }
    .ov-event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
    .ov-event-row + .ov-event-row { border-top: 1px solid rgba(0,0,0,0.04); }
    .ov-event-dot { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
    .ov-event-text { font-size: 13px; color: var(--text-primary); flex: 1; }
    .ov-event-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

    /* ── Overview page: mini map ── */
    .ov-map-card {
      background: #fff; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 20px;
      overflow: hidden; margin-bottom: 16px; cursor: pointer;
      transition: box-shadow 0.15s;
    }
    .ov-map-card:hover { box-shadow: var(--shadow-md); }
    #overview-map { width: 100%; height: 220px; }

    /* ── Overview page: account summary ── */
    .ov-account-card {
      background: #fff; border: 1.5px solid rgba(0,0,0,0.08); border-radius: 16px;
      padding: 8px 0; margin-bottom: 16px;
    }
    .ov-account-row {
      display: flex; align-items: center; gap: 10px; padding: 10px 20px;
      border-bottom: 1px solid rgba(0,0,0,0.04);
    }
    .ov-account-row:last-child { border-bottom: none; }
    .ov-account-label { font-size: 12px; color: var(--text-muted); width: 100px; flex-shrink: 0; }
    .ov-account-value { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
