/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface2:   #21262d;
  --surface3:   #2d333b;
  --border:     #30363d;
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --accent:     #388bfd;
  --accent-h:   #58a6ff;
  --green:      #3fb950;
  --yellow:     #d29922;
  --red:        #f85149;
  --purple:     #a371f7;
  --radius:     8px;
  --sidebar-w:  220px;
}

html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

a { color: var(--accent-h); text-decoration: none; }
a.nav-item { color: inherit; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select { font-family: inherit; font-size: inherit; }
code { font-family: 'SFMono-Regular', Consolas, monospace; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo svg { width: 36px; height: 36px; }
.auth-logo h1 { font-size: 1.5rem; margin-top: 8px; color: var(--text); }
.auth-logo p  { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.form-group input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: none;
  font-weight: 500;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn-primary  { background: var(--accent);  color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-sm       { padding: 5px 10px; font-size: .8rem; }
.btn-full     { width: 100%; }
.btn:disabled { opacity: .4; pointer-events: none; }

.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: .85rem; }
.auth-error  { background: rgba(248,81,73,.12); border: 1px solid rgba(248,81,73,.35); color: var(--red); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: .85rem; display: none; }
.auth-error.show { display: block; }

/* ── App Shell ────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo svg { color: var(--accent); flex-shrink: 0; }
.sidebar-logo span { font-weight: 700; font-size: 1rem; color: var(--text); }

.sidebar-section { padding: 10px 8px 4px; }
.sidebar-section-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 0 8px; margin-bottom: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .875rem;
  transition: background .12s, color .12s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(56,139,253,.15); color: var(--accent-h); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name  { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: none; border: none; color: var(--text-muted); padding: 4px; border-radius: 4px; }
.logout-btn:hover { color: var(--red); }

/* ── Main ─────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 12px;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); }

.period-btns { display: flex; gap: 2px; background: var(--surface2); padding: 3px; border-radius: 8px; }
.period-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.period-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.period-btn:hover:not(.active) { color: var(--text); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Views ────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-trend {
  font-size: .75rem;
  margin-top: 6px;
  color: var(--text-muted);
}
.stat-trend.up   { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ── Charts ───────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h3 { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }
.chart-wrap { position: relative; }
.chart-wrap canvas { max-height: 240px; }

.charts-small {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Tables ───────────────────────────────────────────────── */
.tables-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.table-card-header h3 { font-size: .85rem; font-weight: 600; color: var(--text-muted); }

.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th {
  padding: 8px 16px;
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface2); }
.tbl .mono { font-family: monospace; font-size: .8rem; color: var(--accent-h); }
.tbl .num  { text-align: right; color: var(--text-muted); }
.tbl .bar-cell { width: 120px; }

.mini-bar { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.mini-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ── Events Table ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filter-input {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.filter-input:focus { border-color: var(--accent); }
.filter-input::placeholder { color: var(--text-muted); }
select.filter-input option { background: var(--surface2); }

.events-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.event-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.ev-pageview      { background: rgba(56,139,253,.15); color: var(--accent-h); }
.ev-click         { background: rgba(163,113,247,.15); color: var(--purple); }
.ev-js_error,
.ev-resource_error{ background: rgba(248,81,73,.15);  color: var(--red); }
.ev-form_submit   { background: rgba(63,185,80,.15);  color: var(--green); }
.ev-scroll_depth  { background: rgba(210,153,34,.15); color: var(--yellow); }
.ev-default       { background: var(--surface2); color: var(--text-muted); }

.props-toggle { background: none; border: none; color: var(--text-muted); font-size: .75rem; padding: 2px 6px; border-radius: 4px; }
.props-toggle:hover { background: var(--surface2); color: var(--text); }
.props-detail { font-family: monospace; font-size: .72rem; color: var(--text-muted); padding: 8px 16px 12px; background: var(--surface2); border-top: 1px solid var(--border); white-space: pre-wrap; word-break: break-all; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: .8rem;
}
.page-btn:hover  { background: var(--surface2); color: var(--text); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .35; pointer-events: none; }

/* ── Realtime ─────────────────────────────────────────────── */
.rt-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.live-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(63,185,80,.12);
  border: 1px solid rgba(63,185,80,.3);
  color: var(--green);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
}
.live-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.8); }
}
.rt-stats { display: flex; gap: 20px; }
.rt-stat { text-align: center; }
.rt-stat-val  { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.rt-stat-lbl  { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; }

.rt-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}
.rt-item {
  display: grid;
  grid-template-columns: 90px 130px 1fr 100px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  animation: fadeIn .3s ease;
}
.rt-item:last-child { border-bottom: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rt-time { color: var(--text-muted); font-size: .75rem; font-family: monospace; }
.rt-path { color: var(--accent-h); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-device { color: var(--text-muted); font-size: .75rem; text-align: right; }
.rt-empty { padding: 48px; text-align: center; color: var(--text-muted); }

/* ── Integration ──────────────────────────────────────────── */
.integration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.integration-card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.integration-card p  { color: var(--text-muted); font-size: .85rem; margin-bottom: 16px; }

.key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.key-box code { flex: 1; color: var(--accent-h); font-size: .9rem; word-break: break-all; }

.snippet-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.snippet-box pre { color: var(--text-muted); font-size: .8rem; line-height: 1.7; }
.snippet-box .hl  { color: var(--accent-h); }
.snippet-box .str { color: var(--green); }
.snippet-box .cmt { color: var(--text-muted); font-style: italic; }

.events-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.ev-ref-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}
.ev-ref-name { font-weight: 600; font-size: .82rem; color: var(--text); margin-bottom: 3px; }
.ev-ref-desc { font-size: .75rem; color: var(--text-muted); }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 999; pointer-events: none; }
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: .82rem;
  color: var(--text);
  animation: slideIn .2s ease;
  pointer-events: all;
  max-width: 300px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,17,23,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius);
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ── Theme Toggle Button ──────────────────────────────────── */
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* hide the icon that doesn't match current theme */
html:not([data-theme="light"]) .icon-sun  { display: none; }
html[data-theme="light"]       .icon-moon { display: none; }

/* ── Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f6f8fa;
  --surface:    #ffffff;
  --surface2:   #f0f3f6;
  --surface3:   #e4e8ed;
  --border:     #d0d7de;
  --text:       #1f2328;
  --text-muted: #57606a;
  --accent:     #0969da;
  --accent-h:   #0550ae;
  --green:      #1a7f37;
  --yellow:     #9a6700;
  --red:        #cf222e;
  --purple:     #6e40c9;
}

/* Specific light-mode overrides */
[data-theme="light"] .sidebar    { box-shadow: 1px 0 0 var(--border); }
[data-theme="light"] .snippet-box { background: #f6f8fa; }
[data-theme="light"] .snippet-box pre { color: #24292f; }
[data-theme="light"] .snippet-box .hl  { color: #0550ae; }
[data-theme="light"] .snippet-box .str { color: #116329; }
[data-theme="light"] .snippet-box .cmt { color: #57606a; }
[data-theme="light"] .auth-card  { box-shadow: 0 4px 24px rgba(0,0,0,.08); }
[data-theme="light"] .stat-card  { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
[data-theme="light"] .chart-card { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
[data-theme="light"] .table-card { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
[data-theme="light"] .events-card{ box-shadow: 0 1px 3px rgba(0,0,0,.06); }
[data-theme="light"] .rt-feed    { box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ── Theme Transition ─────────────────────────────────────── */
*, *::before, *::after {
  transition: background-color .18s ease, border-color .18s ease, color .1s ease;
}
/* Disable transition on charts to prevent flicker */
canvas { transition: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .charts-row   { grid-template-columns: 1fr; }
  .tables-row   { grid-template-columns: 1fr; }
  .rt-item      { grid-template-columns: 80px 1fr 80px; }
  .rt-item .rt-device { display: none; }
}
@media (max-width: 640px) {
  :root { --sidebar-w: 52px; }
  .sidebar-logo span,
  .nav-item span,
  .user-meta,
  .sidebar-section-label { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .topbar { padding: 10px 14px; }
  .content { padding: 14px; }
}

/* ── Site Switcher ────────────────────────────────────────── */
.site-switcher-wrap {
  padding: 8px 12px 0;
  margin-bottom: 4px;
}
.site-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text-muted);
}
.site-switcher svg { flex-shrink: 0; }
.site-switcher select {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-switcher select option { background: var(--surface2); color: var(--text); }

@media (max-width: 640px) {
  .site-switcher-wrap { display: none; }
}

/* ── Sites Page ───────────────────────────────────────────── */
.sites-welcome {
  text-align: center;
  padding: 32px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.sites-welcome-icon { font-size: 2.5rem; margin-bottom: 8px; }
.sites-welcome h2 { font-size: 1.2rem; margin-bottom: 6px; }
.sites-welcome p { color: var(--text-muted); }

.site-add-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.site-add-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.site-add-card-header h3 { font-size: .9rem; font-weight: 600; }
.site-add-form { padding: 14px 18px; }

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.sites-empty {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
}

.site-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s;
}
.site-card:hover { border-color: var(--accent); }

.site-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.site-card-body { flex: 1; min-width: 0; }

.site-card-name {
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-active-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  background: var(--green);
  color: #fff;
  flex-shrink: 0;
}
.site-card-url {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-card-url a { color: var(--accent-h); }
.site-card-key {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
}
.site-card-key span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-key-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px;
  color: var(--text-muted);
  line-height: 0;
  transition: color .15s;
}
.copy-key-btn:hover { color: var(--accent); }

.site-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
}
.site-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="light"] .site-card:hover { border-color: var(--accent); }
[data-theme="light"] .site-card { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
