    :root {
      color-scheme: light;
      --bg: #f4f4f6;
      --card: #ffffff;
      --border: #e2e2e9;
      --text: #18181b;
      --muted: #71717a;
      --brand-yellow: #F9A025;
      --brand-purple: #713485;
      --brand-orange: #EE8422;
      --accent: var(--brand-yellow);
      --accent-hover: #e08f15;
      --on-accent: #1a0d22;
      --accent-purple: var(--brand-purple);
      --accent-purple-hover: #8e4ba8;
      --radius: 10px;
      --space: 16px;
      --thead-bg: rgba(0,0,0,0.04);
      --row-hover: rgba(0,0,0,0.035);
      --dropdown-hover: rgba(0,0,0,0.06);
      --sync-option-hover: rgba(0,0,0,0.04);
      --btn-deployed-yes-hover-bg: rgba(0,0,0,0.06);
      --sql-job-bar-bg: rgba(0,0,0,0.08);
      --overlay-scrim: rgba(0,0,0,0.45);
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
      --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
      --shadow-lg: 0 12px 40px rgba(0,0,0,0.18);
      --shadow-toast: 0 4px 12px rgba(0,0,0,0.15);
      --map-placeholder-bg: #e4e4e9;
      --note-text: #92400e;
      --note-text-hover: #78350f;
      --spinner-border: rgba(0,0,0,0.2);
      --spinner-top: var(--accent-purple);
      --location-near-bg: rgba(34, 197, 94, 0.16);
      --location-near-border: rgba(34, 197, 94, 0.42);
      --location-near-color: #166534;
      --location-near-hover-bg: rgba(34, 197, 94, 0.24);
      --location-near-hover-border: rgba(34, 197, 94, 0.55);
      --programmed-fg: #15803d;
      --programmed-bg: rgba(34, 197, 94, 0.18);
      --programmed-border: rgba(34, 197, 94, 0.45);
    }
    html[data-theme="dark"] {
      color-scheme: dark;
      --bg: #0f0f12;
      --card: #18181c;
      --border: #2a2a30;
      --text: #e4e4e7;
      --muted: #71717a;
      --accent-hover: #ffb03d;
      --thead-bg: rgba(255,255,255,0.04);
      --row-hover: rgba(255,255,255,0.02);
      --dropdown-hover: rgba(255,255,255,0.08);
      --sync-option-hover: rgba(255,255,255,0.05);
      --btn-deployed-yes-hover-bg: rgba(255,255,255,0.05);
      --sql-job-bar-bg: rgba(255,255,255,0.08);
      --overlay-scrim: rgba(0,0,0,0.6);
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
      --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
      --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
      --shadow-toast: 0 4px 12px rgba(0,0,0,0.35);
      --map-placeholder-bg: #111;
      --note-text: #c4a0a0;
      --note-text-hover: #d4b0b0;
      --spinner-border: rgba(255,255,255,0.35);
      --spinner-top: #fff;
      --location-near-bg: rgba(34, 197, 94, 0.18);
      --location-near-border: rgba(34, 197, 94, 0.45);
      --location-near-color: #d1fae5;
      --location-near-hover-bg: rgba(34, 197, 94, 0.26);
      --location-near-hover-border: rgba(34, 197, 94, 0.6);
      --programmed-fg: #86efac;
      --programmed-bg: rgba(34, 197, 94, 0.22);
      --programmed-border: rgba(34, 197, 94, 0.5);
    }
    * { box-sizing: border-box; }
    body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 44px 28px 32px; line-height: 1.5; max-width: 1400px; margin-left: auto; margin-right: auto; }
    h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 20px; letter-spacing: -0.02em; }
    .title-row { display:flex; align-items:center; gap: 14px; margin-bottom: 14px; }
    .title-row h1 { flex: 0 1 auto; min-width: 0; font-weight: 700; }
    .title-logo-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
    .title-logo { height: 44px; width: auto; max-width: min(240px, 100%); display: block; object-fit: contain; }
    .title-actions { flex: 0 0 auto; display:flex; align-items:center; gap:8px; }
    .btn-thin { padding: 4px 8px; font-size: 11px; min-height: 0; line-height: 1.1; opacity: 0.78; }
    .btn-thin:hover { opacity: 0.92; }
    .toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space); margin-bottom: 24px; flex-wrap: wrap; }
    .toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
    .btn { background: var(--accent); color: var(--on-accent); border: none; padding: 9px 15px; border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 600; transition: background 0.15s ease, color 0.15s ease; }
    .btn:hover { background: var(--accent-hover); color: var(--on-accent); }
    .btn:focus-visible { outline: 2px solid var(--accent-purple); outline-offset: 2px; }
    .btn.secondary { background: var(--card); color: var(--text); border: 1px solid rgba(113, 52, 133, 0.5); }
    .btn.secondary:hover { background: rgba(113, 52, 133, 0.14); border-color: var(--accent-purple); }
    .btn.secondary.danger-soft { background: rgba(220, 38, 38, 0.10); color: var(--text); border-color: rgba(220, 38, 38, 0.5); }
    .btn.secondary.danger-soft:hover { background: rgba(220, 38, 38, 0.20); border-color: rgba(220, 38, 38, 0.85); color: var(--text); }
    .btn.danger { background: rgba(220, 38, 38, 0.92); color: #fff; border: 1px solid rgba(220, 38, 38, 1); }
    .btn.danger:hover { background: rgba(220, 38, 38, 1); color: #fff; border-color: rgba(185, 28, 28, 1); }
    .btn.danger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .btn-location-near { background: var(--location-near-bg) !important; border-color: var(--location-near-border) !important; color: var(--location-near-color) !important; }
    .btn-location-near:hover { background: var(--location-near-hover-bg) !important; border-color: var(--location-near-hover-border) !important; }
    .btn-theme-toggle { position: fixed; top: 14px; right: 14px; z-index: 10001; min-width: 7.5rem; }
    .btn.btn-sync { background: var(--accent-purple); color: #fff; border: none; }
    .btn.btn-sync:hover { background: var(--accent-purple-hover); color: #fff; }
    .btn-split-toggle { min-width: 42px; padding: 9px 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; }
    table { width: 100%; border-collapse: collapse; }
    #main-table, #pinned-table, #pending-table {
      border-collapse: separate;
      border-spacing: 0;
      background: var(--card);
      border-radius: 12px;
      overflow: visible;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
    }
    #main-table { table-layout: auto; }
    #pinned-table { table-layout: fixed; }
    #main-table thead tr:first-child th:first-child,
    #pinned-table thead tr:first-child th:first-child,
    #pending-table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
    #main-table thead tr:first-child th:last-child,
    #pinned-table thead tr:first-child th:last-child,
    #pending-table thead tr:first-child th:last-child { border-top-right-radius: 12px; }
    #main-table tbody tr:last-child td:first-child,
    #pinned-table tbody tr:last-child td:first-child,
    #pending-table tbody tr:last-child td:first-child { border-bottom-left-radius: 12px; }
    #main-table tbody tr:last-child td:last-child,
    #pinned-table tbody tr:last-child td:last-child,
    #pending-table tbody tr:last-child td:last-child { border-bottom-right-radius: 12px; }
    th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
    th { background: var(--thead-bg); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
    #main-table thead th { position: sticky; top: 0; z-index: 5; background: var(--card); }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: var(--row-hover); }
    .skeleton-row:hover td { background: var(--card); }
    #main-table tbody tr.skeleton-row td {
      padding-top: 17px;
      padding-bottom: 17px;
      vertical-align: middle;
    }
    .skeleton-block {
      display: block;
      height: 16px;
      border-radius: 6px;
      max-width: 100%;
      background: linear-gradient(90deg, var(--row-hover) 0%, color-mix(in srgb, var(--border) 55%, var(--row-hover)) 50%, var(--row-hover) 100%);
      background-size: 200% 100%;
      animation: skeleton-shimmer 1.2s ease-in-out infinite;
    }
    .skeleton-block--thumb { width: 36px; height: 36px; border-radius: 10px; margin: 0 auto; }
    .skeleton-block--wide { width: 72%; min-width: 120px; height: 16px; }
    .skeleton-block--short { width: 48px; margin-left: auto; }
    .skeleton-block--battery { height: 22px; border-radius: 8px; width: 80%; max-width: 140px; }
    .skeleton-actions-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      min-height: 36px;
    }
    .skeleton-block--action { width: 76px; height: 32px; border-radius: 6px; flex-shrink: 0; }
    .skeleton-block--action-wide { width: 108px; }
    .skeleton-block--action-danger {
      background: linear-gradient(90deg, rgba(220, 38, 38, 0.10) 0%, rgba(220, 38, 38, 0.26) 50%, rgba(220, 38, 38, 0.10) 100%);
      background-size: 200% 100%;
    }
    .skeleton-location-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      min-height: 36px;
      padding: 6px 14px;
      border-radius: 999px;
      border: 1px solid rgba(113, 52, 133, 0.45);
      background: var(--card);
      min-width: 108px;
      max-width: 100%;
    }
    .skeleton-location-pill--near {
      background: var(--location-near-bg);
      border-color: var(--location-near-border);
    }
    .skeleton-location-pill-inner {
      display: block;
      height: 10px;
      width: min(118px, 78%);
      border-radius: 5px;
      background: linear-gradient(90deg, var(--row-hover) 0%, color-mix(in srgb, var(--border) 50%, var(--row-hover)) 50%, var(--row-hover) 100%);
      background-size: 200% 100%;
      animation: skeleton-shimmer 1.2s ease-in-out infinite;
    }
    .skeleton-location-pill--near .skeleton-location-pill-inner {
      background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.08) 100%);
      background-size: 200% 100%;
    }
    .skeleton-row .skeleton-block:not(.skeleton-block--thumb):not(.skeleton-block--wide):not(.skeleton-block--short):not(.skeleton-block--battery):not(.skeleton-block--action):not(.skeleton-block--action-wide) { width: 56%; min-width: 64px; }
    @keyframes skeleton-shimmer {
      0% { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }
    @media (prefers-reduced-motion: reduce) {
      .skeleton-block,
      .skeleton-location-pill-inner { animation: none; opacity: 0.85; }
    }
    #main-table.tables-data-loading,
    #pinned-section.tables-data-loading,
    #pending-section.tables-data-loading {
      opacity: 0.72;
      transition: opacity 0.15s ease;
    }
    .mono { font-family: ui-monospace, monospace; font-size: 13px; }
    .detail-panel { display: none; position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 100; align-items: center; justify-content: center; padding: 24px; }
    .detail-panel.open { display: flex; }
    .content-section { margin-bottom: 28px; }
    .detail-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); position: relative; }
    .detail-head { margin: 0; padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 52px; }
    .detail-head h2 { margin: 0; font-size: 1.1rem; }
    .detail-head-inner-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
    .btn-detail-reflash { background: rgba(220, 38, 38, 0.85); color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
    .btn-detail-reflash:hover { background: rgba(220, 38, 38, 1); }
    .detail-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .detail-battery-cal-wrap { width: 100%; flex-basis: 100%; display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; justify-content: flex-end; }
    .detail-sql-panel { display:none; margin: 0 0 16px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
    .detail-sql-panel pre { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
    .detail-location-card { margin: 0 0 16px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
    .detail-location-line { font-size: 12px; color: var(--text); margin: 0 0 6px; word-break: break-word; }
    .detail-location-muted { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
    .detail-location-map { width: 100%; height: 220px; border: 0; border-radius: 8px; background: var(--map-placeholder-bg); }
    .detail-json-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
    .detail-json-toggle-link { color: var(--muted); text-decoration: none; cursor: pointer; font-size: 12px; }
    .detail-json-toggle-link:hover { color: var(--text); text-decoration: underline; }
    .admin-mode-wrap { display: none; align-items: center; gap: 6px; }
    .admin-mode-wrap select { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 8px; font-size: 12px; }
    .detail-body { padding: 24px; overflow: auto; }
    .detail-body pre { background: var(--bg); padding: 16px; border-radius: 8px; overflow: auto; font-size: 12px; margin: 0 0 16px; white-space: pre-wrap; word-break: break-all; }
    .copy-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
    .copy-row input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 8px; font-family: inherit; }
    .copy-row .btn { flex: 0 0 auto; }
    .close-detail { position: absolute; top: 16px; right: 16px; background: transparent; color: var(--muted); border: none; cursor: pointer; font-size: 24px; line-height: 1; }
    .close-detail:hover { color: var(--text); }
    .form-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .form-inline input { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); width: 200px; }
    .toast { position: fixed; bottom: 24px; right: 24px; background: var(--accent-purple); color: #fff; padding: 12px 20px; border-radius: var(--radius); display: none; z-index: 200; font-size: 13px; box-shadow: var(--shadow-toast); }
    .toast.show { display: block; animation: fadeIn 0.2s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .actions { white-space: nowrap; text-align: right; }
    .restore-wrap { display: flex; gap: 6px; align-items: center; }
    .backup-select { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius); font-size: 13px; min-width: 200px; }
    .table-controls { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
    .btn-icon-refresh { margin-left: auto; padding: 8px 10px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .btn-icon-refresh svg { display: block; vertical-align: middle; }
    .btn-icon-refresh:disabled { opacity: 0.55; cursor: not-allowed; }
    .table-controls input[type="search"], .table-controls select { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius); font-size: 13px; }
    .table-controls input[type="search"]:focus, .table-controls select:focus { outline: none; border-color: var(--accent); }
    .table-controls label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
    .table-controls label input { margin: 0; }
    .trackers-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; margin-bottom:8px; flex-wrap: wrap; }
    .trackers-foot { display: flex; justify-content: flex-end; margin-top: 12px; margin-bottom: 4px; }
    .pager-bar { display: inline-flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
    .pager-range { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .pager-page-size { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
    .pager-page-size select { background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 12px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
    .pager-nav { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .pager-page-mid {
      display: inline-block;
      min-width: 10.5rem;
      width: 10.5rem;
      text-align: center;
      font-size: 12px;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }
    .pager-arrow {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      padding: 0;
      margin: 0;
      border-radius: 6px;
      border: 1px solid rgba(113, 52, 133, 0.55);
      background: rgba(113, 52, 133, 0.12);
      color: var(--brand-purple);
      font-size: 15px;
      line-height: 1;
      font-weight: 700;
      cursor: pointer;
      flex-shrink: 0;
      box-sizing: border-box;
      font-family: inherit;
    }
    .pager-arrow:hover:not(:disabled) { background: rgba(113, 52, 133, 0.22); border-color: var(--accent-purple-hover); color: var(--accent-purple-hover); }
    .pager-arrow:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }
    .help-toggle { color: var(--muted); text-decoration: none; font-size: 13px; }
    .help-toggle:hover { color: var(--accent); }
    .section-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 10px; color: var(--text); }
    .section-desc { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
    .help-box { display: none; margin-top: 12px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
    .help-box.open { display: block; }
    .help-box h3 { margin: 0 0 8px; font-size: 14px; }
    .help-box p { margin: 0 0 8px; }
    .help-box code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
    th[data-sort] { cursor: pointer; user-select: none; }
    th[data-sort]:hover { color: var(--accent); }
    .battery-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
    .battery-graphic { display: inline-flex; align-items: center; flex-direction: row; }
    .battery-track {
      position: relative;
      width: 38px;
      height: 12px;
      border: 1px solid var(--muted);
      border-radius: 3px;
      padding: 1px;
      box-sizing: border-box;
      background: var(--bg);
      overflow: hidden;
    }
    .battery-fill {
      display: block;
      height: 100%;
      border-radius: 2px;
      box-sizing: border-box;
      max-width: 100%;
    }
    .battery-fill.battery-fill--nonzero { min-width: 2px; }
    .battery-cap {
      width: 3px;
      height: 6px;
      margin-left: 1px;
      background: var(--muted);
      border-radius: 0 2px 2px 0;
      flex-shrink: 0;
    }
    .battery-pct { font-variant-numeric: tabular-nums; }
    .columns-dropdown-wrap { position: relative; }
    .columns-dropdown { display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 220px; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; z-index: 50; box-shadow: var(--shadow-md); }
    .columns-dropdown.open { display: block; }
    .columns-visibility { margin-bottom: 12px; }
    .columns-visibility label { display: block; margin-bottom: 6px; }
    .columns-reorder ul { list-style: none; padding: 0; margin: 8px 0 0; }
    .columns-reorder li { padding: 4px 0; display: flex; align-items: center; gap: 8px; }
    .columns-reorder li.dragging { opacity: 0.6; }
    .columns-reorder li .col-label { flex: 1; }
    .columns-reorder li button { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 2px 6px; font-size: 12px; }
    .columns-reorder li button:hover { color: var(--accent); }
    th.dragging { opacity: 0.5; }
    .col-actions { white-space: nowrap; text-align: right; min-width: 260px; }
    td[data-column="name"], th[data-column="name"] { min-width: 180px; padding-left: 10px; }
    td[data-column="location"], th[data-column="location"] { min-width: 160px; }
    .tracker-name-cell { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
    .tracker-name-text {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 700;
      font-size: 14px;
      letter-spacing: -0.015em;
      color: var(--text);
    }
    th.col-thumb, td.col-thumb {
      width: 56px;
      max-width: 64px;
      padding: 8px;
      text-align: center;
      vertical-align: middle;
      box-sizing: border-box;
    }
    .tracker-model-thumb-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      margin: 0 auto;
      box-sizing: border-box;
    }
    .tracker-model-thumb-wrap--compact {
      width: 32px;
      height: 32px;
    }
    .tracker-model-thumb {
      max-width: 40px;
      max-height: 40px;
      width: auto;
      height: auto;
      object-fit: contain;
      object-position: center;
      display: block;
      margin: 0;
      border-radius: 4px;
    }
    .tracker-model-thumb--compact {
      max-width: 32px;
      max-height: 32px;
    }
    .tracker-model-region {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-left: 6px;
    }
    .tracker-model-region img {
      width: 16px;
      height: 16px;
      object-fit: cover;
      border-radius: 50%;
      display: block;
      box-shadow: 0 0 0 1px var(--border);
    }
    .tracker-model-thumb-fallback {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin: 0 auto;
      width: 28px;
      height: 28px;
      max-width: 28px;
      max-height: 28px;
      min-width: 28px;
      min-height: 28px;
      border-radius: 50%;
      border: 1px dashed var(--muted);
      color: var(--muted);
      font-size: 13px;
      font-weight: 600;
      line-height: 1;
      box-sizing: border-box;
    }
    .tracker-new-badge { display: inline-flex; align-items: center; justify-content: center; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--on-accent); background: rgba(249, 160, 37, 0.88); }
    .programmed-check { display:inline-flex; align-items:center; justify-content:center; margin-left:6px; width:16px; height:16px; border-radius:999px; background: var(--programmed-bg); color: var(--programmed-fg); font-size:11px; line-height:1; border:1px solid var(--programmed-border); }
    .pin-star { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; margin: -4px 0 -4px -2px; min-width: 22px; min-height: 22px; font-size: 14px; line-height: 1; opacity: 0.95; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
    .pin-star.pinned { color: var(--brand-yellow); opacity: 1; }
    .pin-star.unpinned { opacity: 0; }
    tr:hover .pin-star.unpinned, .pin-star.unpinned:focus-visible { opacity: 0.95; }
    .pin-star:hover, .pin-star:focus-visible { color: var(--brand-yellow); }
    .sync-modal { display: none; position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 110; align-items: center; justify-content: center; padding: 24px; }
    .sync-modal.open { display: flex; }
    .sync-modal .detail-card { max-width: 480px; }
    .sync-modal .sync-option { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; border-radius: 6px; }
    .sync-modal .sync-option:hover { background: var(--sync-option-hover); }
    .sync-modal .sync-option input { margin: 0; }
    .sync-modal .sync-list { max-height: 240px; overflow: auto; margin: 12px 0; }
    .sync-modal .load-more { margin-top: 8px; }
    .create-dropdown-wrap.create-split-wrap {
      position: relative;
      display: inline-flex;
      align-items: stretch;
      vertical-align: middle;
    }
    .create-split-wrap #btn-create-main {
      font-weight: 700;
      font-size: 14px;
      padding: 11px 17px;
      min-height: 42px;
      border-radius: var(--radius) 0 0 var(--radius);
      margin: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .create-split-wrap .btn-split-toggle {
      border-radius: 0 var(--radius) var(--radius) 0;
      margin: 0;
      padding: 11px 12px 11px 10px;
      min-width: 42px;
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-left: 1px solid color-mix(in srgb, var(--on-accent) 34%, transparent);
      box-shadow: none;
    }
    .create-dropdown .create-option { display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 0; background: transparent; border: none; color: var(--text); cursor: pointer; border-radius: 6px; font-size: 14px; line-height: 1.25; }
    .create-dropdown .create-option:hover { background: var(--dropdown-hover); }
    .create-dropdown { display: none; }
    .create-dropdown.open { display: block; }
    tr.archived-row { background: rgba(220, 38, 38, 0.18); }
    tr.archived-row:hover { background: rgba(220, 38, 38, 0.25); }
    .actions-group { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
    .actions-group .btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
    .options-wrap { position: relative; display: inline-block; }
    .options-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px 8px; font-size: 18px; line-height: 1; border-radius: 4px; }
    .options-btn:hover { color: var(--text); background: var(--border); }
    .options-dropdown { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; min-width: 160px; padding: 6px 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; z-index: 300; box-shadow: var(--shadow-md); }
    .options-dropdown.open { display: block; }
    .options-dropdown button { display: block; width: 100%; text-align: left; padding: 8px 14px; margin: 0; background: transparent; border: none; color: var(--text); cursor: pointer; font-size: 13px; }
    .options-dropdown button:hover { background: var(--dropdown-hover); }
    tr.note-row td { padding: 2px 12px 10px 12px; vertical-align: top; border-top: none; border-bottom: 1px solid var(--border); background: transparent; }
    .note-row-inner { margin-left: 28px; border-left: 3px solid var(--accent-purple); padding: 10px 12px 12px 14px; background: rgba(113, 52, 133, 0.08); border-radius: 0 8px 8px 0; box-sizing: border-box; }
    .note-row-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
    tr.row-stale-day { background: rgba(220, 38, 38, 0.08); }
    tr.row-stale-day:hover { background: rgba(220, 38, 38, 0.14); }
    tr.row-stale-week { background: rgba(220, 38, 38, 0.18); }
    tr.row-stale-week:hover { background: rgba(220, 38, 38, 0.26); }
    tr.row-never-tracked { background: rgba(59, 130, 246, 0.10); }
    tr.row-never-tracked:hover { background: rgba(59, 130, 246, 0.16); }
    tr.row-recently-created { background: rgba(249, 160, 37, 0.1); }
    tr.row-recently-created:hover { background: rgba(249, 160, 37, 0.16); }
    #pending-table td, #pending-table th { vertical-align: middle; }
    #pending-table thead th:last-child { text-align: right; }
    .pending-name-cell { font-size: 14px; color: var(--text); font-weight: 500; }
    .note-text { color: var(--note-text); font-size: 13px; cursor: text; display: inline-block; min-height: 1.2em; }
    .note-text:hover { color: var(--note-text-hover); }
    .note-input { width: 100%; max-width: 560px; padding: 4px 8px; font-size: 13px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; box-sizing: border-box; }
    .note-input::placeholder { color: var(--muted); }
    .btn-deployed-no { background: rgba(220, 38, 38, 0.85); color: #fff; border: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
    .btn-deployed-no:hover { background: rgba(220, 38, 38, 1); }
    .btn-deployed-yes { background: transparent; color: var(--text); border: 1px solid transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
    .btn-deployed-yes:hover { border-color: var(--border); background: var(--btn-deployed-yes-hover-bg); }
    .btn-location-link { text-decoration: none; white-space: nowrap; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; }
    .sql-job-wrap { display:none; margin-top:8px; width: 380px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; flex-basis: 100%; }
    .sql-job-head { display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--muted); margin-bottom:6px; }
    .sql-job-bar { width:100%; height:8px; border-radius:999px; background: var(--sql-job-bar-bg); overflow:hidden; }
    .sql-job-fill { height:100%; width:0%; background: var(--accent-purple); transition: width 0.2s ease; }
    .sql-job-msg { font-size:12px; margin-top:6px; color:var(--text); }
    .sql-job-counters { font-size:11px; margin-top:4px; color:var(--muted); white-space:pre-wrap; }
    .sql-job-errors { margin-top:6px; font-size:12px; }
    .sql-job-errors pre { max-height:170px; overflow:auto; background:var(--bg); border:1px solid var(--border); border-radius:6px; padding:8px; }
    .orphan-modal-card { max-width: 720px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }
    .orphan-modal-table-wrap { overflow: auto; max-height: min(420px, 55vh); margin: 12px 0; border: 1px solid var(--border); border-radius: 8px; }
    .orphan-modal-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .orphan-modal-table-wrap th, .orphan-modal-table-wrap td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
    .orphan-modal-table-wrap th { position: sticky; top: 0; background: var(--card); z-index: 1; }
    .orphan-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: 8px; }
    .spinner-inline { display:inline-block; width:12px; height:12px; border:2px solid var(--spinner-border); border-top-color: var(--spinner-top); border-radius:50%; animation: spinInline 0.8s linear infinite; vertical-align:middle; margin-right:6px; }
    @keyframes spinInline { to { transform: rotate(360deg); } }
    body.is-resizing * { transition: none !important; animation: none !important; }
    .global-loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10000; pointer-events: none; background: transparent; overflow: hidden; display: none; }
    .global-loading-bar.active { display: block; }
    .global-loading-bar.active::after { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 42%; background: var(--accent); opacity: 0.95; animation: globalLoadSlide 0.85s ease-in-out infinite; }
    @keyframes globalLoadSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

    .battery-watch-section { margin: 0 0 16px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-sizing: border-box; }
    .battery-watch-inner {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
      gap: 16px;
      align-items: stretch;
    }
    @media (max-width: 900px) {
      .battery-watch-inner { grid-template-columns: 1fr; }
    }
    .battery-watch-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; display: flex; flex-direction: column; align-items: flex-start; }
    .battery-watch-head { margin-bottom: 8px; font-size: 14px; }
    .battery-watch-table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
    .battery-watch-table th, .battery-watch-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
    .battery-watch-table th { color: var(--muted); font-weight: 600; }
    .battery-watch-table td.bw-name-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .battery-watch-table tbody tr { cursor: pointer; }
    .battery-watch-table tbody tr.battery-watch-row--selected { background: var(--row-hover); }
    .battery-watch-empty { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
    .battery-watch-chart-wrap {
      min-width: 0;
      min-height: clamp(300px, 42vh, 640px);
      position: relative;
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
    }
    .battery-watch-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; flex: 0 0 auto; }
    .battery-watch-chart-title { font-size: 12px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
    .battery-watch-chart-actions { flex: 0 0 auto; }
    .battery-watch-chart-hint { font-size: 11px; color: var(--muted); margin: 0 0 6px; line-height: 1.3; flex: 0 0 auto; }
    .battery-watch-chart-host {
      position: relative;
      width: 100%;
      flex: 1 1 auto;
      min-height: 240px;
      height: auto;
      box-sizing: border-box;
      touch-action: none;
    }
    #battery-watch-chart { display: block; width: 100%; height: 100%; max-width: 100%; box-sizing: border-box; }
    .battery-watch-table th.bw-ms-th, .battery-watch-table td.bw-ms-cell { width: 72px; text-align: center; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
    .battery-watch-table .bw-ms-btn { font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 6px; margin: 0 2px 0 0; border-radius: 4px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; min-width: 22px; }
    .battery-watch-table .bw-ms-btn:hover { background: var(--row-hover); }
    .battery-watch-table .bw-ms-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
    .battery-watch-table tbody tr.battery-watch-row--dimmed { opacity: 0.35; }
    .detail-battery-watch-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: 8px; white-space: nowrap; }
    .detail-battery-watch-wrap input { margin: 0; }
