* { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
    input, select, textarea { font-size: 16px; }

    :root {
      --bg: #0f0f0f;
      --bg-card: #0f0f0f;
      --bg-hover: #272727;
      --bg-secondary: #272727;
      --text: #f1f1f1;
      --text-secondary: #aaa;
      --accent: #ff0000;
      --accent-hover: #cc0000;
      --border: #303030;
      --chip-bg: #272727;
      --chip-active-bg: #f1f1f1;
      --chip-active-text: #0f0f0f;
      --scenic: #f59e0b;
      --traffic: #10b981;
      --airport: #8b5cf6;
      --danger: #ff0000;
      --radius: 12px;
      --header-h: 56px;
      --filter-h: 56px;
    }

    .light {
      --bg: #f9f9f9;
      --bg-card: #f9f9f9;
      --bg-hover: #e5e5e5;
      --bg-secondary: #e5e5e5;
      --text: #0f0f0f;
      --text-secondary: #606060;
      --border: #e0e0e0;
      --chip-bg: #e5e5e5;
      --chip-active-bg: #0f0f0f;
      --chip-active-text: #f1f1f1;
    }

    body {
      font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
    }

    /* Header - YouTube style */
    .header {
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--bg);
      padding: 0 16px;
      height: var(--header-h);
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .logo {
      font-size: 18px;
      font-weight: 700;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
    }

    .logo-icon {
      font-size: 22px;
      line-height: 1;
    }

    .search-box {
      flex: 1;
      max-width: 540px;
      display: flex;
      margin: 0 auto;
    }

    .search-box input {
      flex: 1;
      padding: 8px 16px;
      border: 1px solid var(--border);
      border-right: none;
      border-radius: 20px 0 0 20px;
      background: var(--bg);
      color: var(--text);
      outline: none;
    }

    .search-box input:focus { border-color: #1c62b9; }

    .search-box button {
      padding: 0 20px;
      border: 1px solid var(--border);
      border-radius: 0 20px 20px 0;
      background: var(--bg-secondary);
      color: var(--text);
      cursor: pointer;
      font-size: 16px;
    }

    .header-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
      margin-left: auto;
    }

    .icon-btn {
      width: 40px;
      height: 40px;
      border: none;
      border-radius: 50%;
      background: transparent;
      color: var(--text);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: background 0.2s;
    }

    .icon-btn:hover { background: var(--bg-hover); }
    .icon-btn.active { background: var(--bg-hover); color: var(--accent); }

    /* Filter chips - YouTube style */
    .filter-bar {
      position: sticky;
      top: var(--header-h);
      z-index: 99;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      padding: 12px 16px;
      display: flex;
      gap: 12px;
      overflow-x: auto;
      scrollbar-width: none;
      align-items: center;
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .filter-chip {
      padding: 8px 16px;
      border: none;
      border-radius: 8px;
      background: var(--chip-bg);
      color: var(--text);
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      white-space: nowrap;
      transition: all 0.2s;
    }

    .filter-chip:hover { background: var(--bg-hover); }
    .filter-chip.active {
      background: var(--chip-active-bg);
      color: var(--chip-active-text);
    }

    .region-select {
      padding: 8px 12px;
      border: none;
      border-radius: 8px;
      background: var(--chip-bg);
      color: var(--text);
      font-size: 14px;
      cursor: pointer;
      outline: none;
    }

    /* Stats bar */
    .stats-bar {
      padding: 12px 16px 4px;
      font-size: 14px;
      color: var(--text-secondary);
      display: flex;
      justify-content: space-between;
    }

    /* ===== HOME VIEW - YouTube Grid ===== */
    .home-view { display: block; }
    .watch-view { display: none; }

    .grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      padding: 8px 16px 80px;
    }

    @media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
    @media (max-width: 500px) { .grid { grid-template-columns: 1fr; gap: 16px; padding: 8px 8px 80px; } }

    /* Camera Card - YouTube video card style */
    .cam-card {
      cursor: pointer;
      transition: opacity 0.2s;
    }

    .cam-card:hover { opacity: 0.85; }

    .cam-thumb {
      aspect-ratio: 16/9;
      background: #181818;
      border-radius: 12px;
      overflow: hidden;
      position: relative;
    }

    .cam-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      position: relative;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .cam-thumb img.thumb-loaded {
      opacity: 1;
    }

    .cam-thumb .placeholder {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
      color: #555;
    }

    .cam-thumb .yt-thumb {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .cam-badge {
      position: absolute;
      bottom: 8px;
      right: 8px;
      z-index: 2;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      background: rgba(0,0,0,0.8);
      color: #fff;
    }

    .cam-badge.scenic { background: var(--scenic); color: #000; }
    .cam-badge.traffic { background: var(--traffic); color: #000; }
    .cam-badge.airport { background: var(--airport); color: #fff; }

    .cam-live-badge {
      position: absolute;
      bottom: 8px;
      left: 8px;
      z-index: 2;
      padding: 2px 6px;
      border-radius: 4px;
      background: var(--danger);
      color: #fff;
      font-size: 11px;
      font-weight: 700;
    }

    .cam-info {
      padding: 12px 4px 4px;
      display: flex;
      gap: 12px;
    }

    .cam-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--bg-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
    }

    .cam-details { flex: 1; min-width: 0; }

    .cam-name {
      font-size: 14px;
      font-weight: 500;
      line-height: 1.3;
      margin-bottom: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .cam-meta {
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.4;
    }

    .cam-fav-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      z-index: 3;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(0,0,0,0.6);
      border: none;
      color: #fff;
      cursor: pointer;
      display: none;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      z-index: 2;
    }

    .cam-card:hover .cam-fav-btn { display: flex; }
    .cam-fav-btn.active { display: flex; color: var(--accent); }

    .icon-btn { position: relative; }

    .icon-count {
      position: absolute;
      top: -4px;
      right: -4px;
      min-width: 17px;
      height: 17px;
      padding: 0 4px;
      border-radius: 999px;
      background: var(--accent);
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      line-height: 17px;
      text-align: center;
      box-shadow: 0 0 0 2px var(--bg);
    }

    /* ===== RECENTLY VIEWED ===== */
    .recent-mobile-btn { display: none; }

    .recent-edge-tab {
      position: fixed;
      z-index: 102;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 42px;
      min-height: 112px;
      padding: 12px 8px;
      border: 1px solid var(--border);
      border-left: 0;
      border-radius: 0 14px 14px 0;
      background: var(--bg-secondary);
      color: var(--text);
      box-shadow: 0 10px 30px rgba(0,0,0,.18);
      cursor: pointer;
      writing-mode: vertical-rl;
      letter-spacing: .08em;
      transition: left .25s ease, background .2s ease;
    }

    .recent-edge-tab:hover { background: var(--bg-hover); }
    body.recent-panel-open .recent-edge-tab { left: 344px; }

    .recent-panel {
      position: fixed;
      z-index: 101;
      top: 72px;
      bottom: 20px;
      left: 0;
      width: 344px;
      display: flex;
      flex-direction: column;
      background: var(--bg);
      border: 1px solid var(--border);
      border-left: 0;
      border-radius: 0 18px 18px 0;
      box-shadow: 16px 0 42px rgba(0,0,0,.22);
      transform: translateX(-105%);
      transition: transform .25s ease;
      overflow: hidden;
    }

    .recent-panel.open { transform: translateX(0); }

    .recent-panel-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 16px;
      border-bottom: 1px solid var(--border);
    }

    .recent-panel-title { flex: 1; font-size: 16px; font-weight: 700; }
    .recent-panel-count { color: var(--text-secondary); font-size: 12px; }

    .recent-panel-action {
      border: 0;
      background: transparent;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 6px;
      border-radius: 8px;
      font-size: 13px;
    }

    .recent-panel-action:hover { background: var(--bg-hover); color: var(--text); }

    .recent-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .recent-card {
      display: grid;
      grid-template-columns: 104px minmax(0,1fr);
      gap: 10px;
      padding: 7px;
      border: 0;
      border-radius: 12px;
      background: transparent;
      color: var(--text);
      text-align: left;
      cursor: pointer;
    }

    .recent-card:hover { background: var(--bg-hover); }

    .recent-thumb {
      position: relative;
      width: 104px;
      aspect-ratio: 16/9;
      overflow: hidden;
      border-radius: 9px;
      background: #181818;
    }

    .recent-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .recent-thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #777; }
    .recent-card-copy { min-width: 0; align-self: center; }
    .recent-card-name { font-size: 13px; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .recent-card-meta { margin-top: 5px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .recent-empty { padding: 42px 20px; color: var(--text-secondary); text-align: center; line-height: 1.6; }
    .recent-overlay { display: none; }

    /* ===== WATCH VIEW ===== */
    .watch-view {
      padding: 24px;
      max-width: 1400px;
      margin: 0 auto;
    }

    .watch-layout {
      display: flex;
      gap: 24px;
    }

    .watch-primary {
      flex: 1;
      min-width: 0;
    }

    .watch-player {
      aspect-ratio: 16/9;
      background: #000;
      border-radius: 12px;
      overflow: hidden;
      position: relative;
    }

    .watch-player iframe,
    .watch-player img {
      width: 100%;
      height: 100%;
      border: none;
      object-fit: contain;
    }

    .watch-player .loading-text {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #666;
    }

    .watch-info {
      padding: 12px 0;
    }

    .watch-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .watch-meta-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .watch-meta-left {
      font-size: 14px;
      color: var(--text-secondary);
    }

    .watch-local-time {
      display: none;
      margin-top: 6px;
      font-size: 13px;
      line-height: 1.5;
      color: var(--text);
    }

    .watch-local-time-label {
      color: var(--text-secondary);
      margin-right: 6px;
    }

    .watch-local-time-zone {
      display: inline-block;
      margin-left: 6px;
      color: var(--text-secondary);
      font-size: 12px;
    }

    .watch-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .watch-qr {
      display: none;
    }
    @media (min-width: 769px) {
      .watch-qr {
        display: block;
        width: 80px;
        height: 80px;
        border-radius: 8px;
        overflow: hidden;
        flex-shrink: 0;
      }
      .watch-qr canvas {
        width: 100%;
        height: 100%;
      }
    }

    .watch-action-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      border: none;
      border-radius: 20px;
      background: var(--bg-secondary);
      color: var(--text);
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: background 0.2s;
    }

    .watch-action-btn:hover { background: var(--bg-hover); }
    .watch-action-btn.active { color: var(--accent); }

    .watch-back-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      border: none;
      border-radius: 20px;
      background: var(--bg-secondary);
      color: var(--text);
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      margin-bottom: 12px;
    }

    .watch-back-btn:hover { background: var(--bg-hover); }

    /* Sidebar recommendations */
    .watch-sidebar {
      width: 400px;
      flex-shrink: 0;
    }

    .sidebar-title {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 16px;
      color: var(--text);
    }

    .sidebar-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .rec-card {
      display: flex;
      gap: 8px;
      cursor: pointer;
      padding: 4px;
      border-radius: 8px;
      transition: background 0.2s;
    }

    .rec-card:hover { background: var(--bg-hover); }

    .rec-thumb {
      width: 168px;
      height: 94px;
      border-radius: 8px;
      overflow: hidden;
      background: #181818;
      flex-shrink: 0;
      position: relative;
    }

    .rec-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      position: relative;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .rec-thumb img.thumb-loaded {
      opacity: 1;
    }

    .rec-thumb .placeholder {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      color: #555;
    }

    .rec-badge {
      position: absolute;
      bottom: 4px;
      right: 4px;
      z-index: 2;
      padding: 1px 4px;
      border-radius: 3px;
      font-size: 10px;
      font-weight: 600;
    }

    .rec-badge.scenic { background: var(--scenic); color: #000; }
    .rec-badge.traffic { background: var(--traffic); color: #000; }
    .rec-badge.airport { background: var(--airport); color: #fff; }

    .rec-info {
      flex: 1;
      min-width: 0;
      padding-top: 2px;
    }

    .rec-name {
      font-size: 14px;
      font-weight: 500;
      line-height: 1.3;
      margin-bottom: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .rec-meta {
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.4;
    }

    .rec-dist {
      font-size: 11px;
      color: var(--text-secondary);
      margin-top: 2px;
    }

    /* Watch RWD */
    @media (max-width: 1000px) {
      .watch-layout { flex-direction: column; }
      .watch-sidebar { width: 100%; }
      .watch-view { padding: 0 0 80px; }
      .watch-player { border-radius: 0; }
      .watch-info { padding: 12px 16px; }
      .watch-back-btn { margin: 8px 16px 0; }
      .sidebar-title { padding: 0 16px; }
      .sidebar-list { padding: 0 16px; }
      .rec-thumb { width: 160px; height: 90px; }
    }

    /* Mobile search button - only visible on mobile */
    .mobile-search-btn { display: none; }

    @media (max-width: 500px) {
      .header { padding: 0 8px; gap: 8px; }
      .filter-bar { padding: 8px; }
      .stats-bar { padding: 8px; }
      .logo { font-size: 16px; }
      .search-box { display: none; }
      .mobile-search-btn { display: inline-flex; }
      .recent-mobile-btn { display: inline-flex; }
      #themeBtn { display: none; }
      .cam-fav-btn { display: flex; }
      .rec-thumb { width: 120px; height: 68px; }
    }

    @media (max-width: 768px) {
      .recent-edge-tab { display: none; }
      .recent-overlay {
        position: fixed;
        z-index: 100;
        inset: 0;
        display: block;
        background: rgba(0,0,0,.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
      }
      body.recent-panel-open .recent-overlay { opacity: 1; pointer-events: auto; }
      body.recent-panel-open .cctv-link-btn,
      body.recent-panel-open .scroll-top { opacity: 0 !important; pointer-events: none; }
      .recent-panel {
        top: auto;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 72vh;
        border: 1px solid var(--border);
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(105%);
        box-shadow: 0 -18px 48px rgba(0,0,0,.28);
      }
      .recent-panel.open { transform: translateY(0); }
      .recent-list { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
      .recent-card { grid-template-columns: 120px minmax(0,1fr); }
      .recent-thumb { width: 120px; }
    }

    /* Mobile search bar */
    .search-mobile {
      display: none;
      padding: 0 8px 8px;
      background: var(--bg);
    }

    .search-mobile input {
      width: 100%;
      padding: 8px 16px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: var(--bg-secondary);
      color: var(--text);
      outline: none;
    }

    /* Autocomplete */
    .autocomplete-list {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--bg);
      border: 1px solid var(--border);
      border-top: none;
      border-radius: 0 0 12px 12px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.15);
      z-index: 200;
      max-height: 280px;
      overflow-y: auto;
      display: none;
      -webkit-overflow-scrolling: touch;
    }
    .autocomplete-list.show { display: block; }
    .autocomplete-item {
      padding: 10px 16px;
      cursor: pointer;
      font-size: 14px;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
      border-bottom: 1px solid var(--border);
      min-height: 44px;
    }
    .autocomplete-item:last-child { border-bottom: none; }
    .autocomplete-item:hover { background: var(--bg-secondary); }
    .autocomplete-item:active { background: var(--bg-secondary); }
    .autocomplete-item .ac-icon {
      font-size: 14px;
      opacity: 0.6;
      flex-shrink: 0;
      width: 20px;
      text-align: center;
    }
    .autocomplete-item .ac-text {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .autocomplete-item .ac-text mark {
      background: rgba(28,98,185,0.15);
      color: #1c62b9;
      border-radius: 2px;
      padding: 0 1px;
    }
    .autocomplete-item .ac-count {
      font-size: 11px;
      color: var(--text-secondary);
      flex-shrink: 0;
    }

    /* Loading */
    .loading-spinner {
      text-align: center;
      padding: 60px;
      color: var(--text-secondary);
      grid-column: 1 / -1;
    }

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

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

    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--text-secondary);
      grid-column: 1 / -1;
    }

    .empty-state .emoji { font-size: 48px; margin-bottom: 12px; }

    /* Language dropdown */


    /* Settings menu */
    .settings-menu {
      display: none;
      position: absolute;
      top: var(--header-h);
      right: 16px;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 8px 0;
      z-index: 200;
      box-shadow: 0 8px 24px rgba(0,0,0,0.4);
      min-width: 220px;
    }

    .settings-menu.active { display: block; }

    .settings-section-title {
      padding: 6px 16px 4px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-secondary);
    }

    .settings-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px;
      font-size: 14px;
      cursor: pointer;
      gap: 12px;
    }

    .settings-item:hover { background: var(--bg-hover); }

    .settings-item label {
      cursor: pointer;
      flex: 1;
    }

    .settings-toggle {
      width: 36px;
      height: 20px;
      border-radius: 10px;
      background: var(--border);
      position: relative;
      flex-shrink: 0;
      transition: background 0.2s;
      cursor: pointer;
      border: none;
    }

    .settings-toggle::after {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      transition: left 0.2s;
    }

    .settings-toggle.on {
      background: var(--accent);
    }

    .settings-toggle.on::after { left: 18px; }

    .settings-divider {
      height: 1px;
      background: var(--border);
      margin: 4px 0;
    }

    .settings-version {
      padding: 8px 16px 4px;
      font-size: 11px;
      color: var(--text-secondary);
      text-align: center;
    }

    .settings-panel { display: block; }
    .settings-sub { display: none; }
    .settings-menu.sub .settings-panel { display: none; }
    .settings-menu.sub .settings-sub.active { display: block; }

    .settings-item-value {
      font-size: 13px;
      color: var(--text-secondary);
      margin-left: auto;
    }
    .settings-arrow {
      font-size: 16px;
      color: var(--text-secondary);
      margin-left: 4px;
    }
    .settings-back {
      padding: 10px 16px;
      font-size: 14px;
      cursor: pointer;
      color: var(--accent);
      font-weight: 500;
    }
    .settings-back:hover { background: var(--bg-hover); }

    /* Dead cam indicator */
    .cam-dead-badge {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.6);
      font-size: 12px;
      font-weight: 700;
      color: #ff4444;
      letter-spacing: 1px;
    }

    /* Scroll to top */
    .scroll-top {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--bg-secondary);
      color: var(--text);
      border: 1px solid var(--border);
      cursor: pointer;
      font-size: 20px;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .scroll-top.visible { display: flex; }

    .icon-btn.gps-active {
      color: #007aff;
      background: rgba(0, 122, 255, 0.12);
    }

    .cctv-link-btn {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 44px;
      height: 44px;
      border-radius: 22px;
      background: var(--bg-secondary, #fff);
      color: var(--text, #333);
      border: none;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 9999;
      text-decoration: none;
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .cctv-link-btn:hover {
      transform: scale(1.05);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    /* ===== BROWSE VIEW ===== */
    .browse-view { display: none; padding: 0 16px 80px; max-width: 900px; margin: 0 auto; }
    .browse-header {
      display: flex; align-items: center; gap: 12px;
      padding: 16px 0 12px; position: sticky; top: var(--header-h); background: var(--bg); z-index: 50;
    }
    .browse-back {
      display: flex; align-items: center; gap: 6px;
      padding: 8px 16px; border: none; border-radius: 20px;
      background: var(--bg-secondary); color: var(--text);
      cursor: pointer; font-size: 14px; font-weight: 500;
    }
    .browse-back:hover { background: var(--bg-hover); }
    .browse-title { font-size: 18px; font-weight: 600; }
    .browse-region-label {
      font-size: 13px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.5px; color: var(--text-secondary);
      padding: 16px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
    }
    .browse-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px;
    }
    .browse-cell {
      padding: 14px 12px; border-radius: var(--radius);
      background: var(--bg-secondary); cursor: pointer;
      text-align: center; transition: background 0.2s; min-height: 60px;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    }
    .browse-cell:hover { background: var(--bg-hover); }
    .browse-cell-name { font-size: 14px; font-weight: 500; }
    .browse-cell-count { font-size: 11px; color: var(--text-secondary); }
    .browse-btn {
      width: 40px; height: 40px; border: none; border-radius: 50%;
      background: transparent; color: var(--text); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 18px; transition: background 0.2s;
    }
    .browse-btn:hover { background: var(--bg-hover); }
    @media (max-width: 500px) {
      .browse-view { padding: 0 8px 80px; }
      .browse-grid { gap: 6px; }
      .browse-cell { padding: 12px 8px; min-height: 54px; }
      .browse-cell-name { font-size: 13px; }
    }