/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #22263a;
  --border:      #2e3250;
  --text:        #e2e4f0;
  --text-muted:  #6b7099;
  --text-dim:    #9196b5;

  --green:       #22c55e;
  --orange:      #f97316;
  --yellow:      #eab308;
  --gray:        #6b7280;
  --red:         #ef4444;
  --blue:        #3b82f6;

  --status-working:       #22c55e;
  --status-waiting:       #f97316;
  --status-idle:          #eab308;
  --status-stopped:       #6b7280;
  --status-stale:         #ef4444;
  --status-starting:      #3b82f6;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

#conn-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

#conn-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray);
}

#conn-status.connected::before { background: var(--green); }
#conn-status.disconnected::before { background: var(--red); }

/* ── Toolbar ──────────────────────────────────────────────────────── */
.toolbar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.filter-group {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }
.filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Stats bar ────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}
.stat-item { text-align: center; min-width: 70px; }
.stat-value { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Main layout ──────────────────────────────────────────────────── */
main {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Machine group ────────────────────────────────────────────────── */
.machine-group {
  margin-bottom: 28px;
}

.machine-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.machine-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.machine-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 1px 7px;
  border-radius: 10px;
}

.machine-stat {
  font-size: 10px;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 8px;
  margin-left: 4px;
}

/* ── Session grid ─────────────────────────────────────────────────── */
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ── Session card ─────────────────────────────────────────────────── */
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.session-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: var(--status-color, var(--gray));
}

.session-card.working   { --status-color: var(--status-working); }
.session-card.waiting_input { --status-color: var(--status-waiting); border-color: #f9731640; }
.session-card.idle      { --status-color: var(--status-idle); }
.session-card.stopped   { --status-color: var(--status-stopped); opacity: 0.6; }
.session-card.stale     { --status-color: var(--status-stale); border-color: #ef444440; }
.session-card.starting  { --status-color: var(--status-starting); }

.session-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

/* Card header row */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.project-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.status-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.working       { background: #22c55e20; color: var(--green); }
.status-badge.waiting_input { background: #f9731620; color: var(--orange); }
.status-badge.idle          { background: #eab30820; color: var(--yellow); }
.status-badge.stopped       { background: #6b728020; color: var(--gray); }
.status-badge.stale         { background: #ef444420; color: var(--red); }
.status-badge.starting      { background: #3b82f620; color: var(--blue); }

/* Activity line */
.card-activity {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-activity .activity-icon { opacity: 0.6; font-size: 11px; }

/* Last prompt */
.card-prompt {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 10px;
  font-style: italic;
  min-height: 30px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-prompt.empty { opacity: 0.4; font-style: normal; }

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.card-stats {
  display: flex;
  gap: 10px;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Empty state ──────────────────────────────────────────────────── */
#empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

#empty-state h2 { font-size: 20px; margin-bottom: 8px; color: var(--text-dim); }
#empty-state p  { font-size: 14px; max-width: 400px; margin: 0 auto; }

#no-match-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
#no-match-state h2 { font-size: 18px; margin-bottom: 8px; color: var(--text-dim); }
#no-match-state p  { font-size: 13px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; gap: 8px; }
  main   { padding: 12px; }
  .session-grid { grid-template-columns: 1fr; }
}

/* ── Flash animation for new updates ─────────────────────────────── */
@keyframes flash-update {
  0%   { background: var(--surface2); }
  100% { background: var(--surface); }
}

.session-card.updated { animation: flash-update 0.6s ease-out; }

/* ── Session card clickable ──────────────────────────────────────── */
.session-card { cursor: pointer; }
.session-card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

/* ── Detail panel overlay ────────────────────────────────────────── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.detail-overlay.open { opacity: 1; visibility: visible; }

/* ── Detail panel ────────────────────────────────────────────────── */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.detail-panel.open { transform: translateX(0); }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.detail-close:hover { color: var(--text); }

.detail-meta {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-meta-label { color: var(--text-muted); }
.detail-meta-value { color: var(--text); font-weight: 500; }

.detail-section-title {
  padding: 12px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Timeline ────────────────────────────────────────────────────── */
.detail-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.timeline-event {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.timeline-event:last-child { border-bottom: none; }

.timeline-time {
  flex-shrink: 0;
  width: 52px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.timeline-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--gray);
}
.timeline-dot.SessionStart   { background: var(--blue); }
.timeline-dot.UserPromptSubmit { background: var(--green); }
.timeline-dot.PostToolUse    { background: var(--yellow); }
.timeline-dot.Notification   { background: var(--orange); }
.timeline-dot.Stop           { background: var(--red); }

.timeline-body {
  flex: 1;
  min-width: 0;
}
.timeline-type {
  font-weight: 600;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.timeline-summary {
  color: var(--text-muted);
  word-break: break-word;
}

.timeline-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Detail panel responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .detail-panel { width: 100vw; }
}

/* ── Search input ────────────────────────────────────────────────── */
.search-input {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  width: 200px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Sort select ─────────────────────────────────────────────────── */
.sort-select {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--blue); }

/* ── Machine group collapse ──────────────────────────────────────── */
.machine-header { cursor: pointer; user-select: none; }
.machine-header:hover .machine-name { color: var(--text); }
.collapse-toggle { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.machine-group.collapsed .session-grid { display: none; }

/* ── Pin button ──────────────────────────────────────────────────── */
.pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  opacity: 0.3;
  padding: 0 2px;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.pin-btn:hover, .pin-btn.pinned { opacity: 1; }
.session-card.pinned { border-color: var(--blue); }

/* ── Rename machine button ───────────────────────────────────────── */
.rename-machine-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.machine-header:hover .rename-machine-btn { opacity: 0.6; }
.rename-machine-btn:hover { opacity: 1 !important; }

/* ── Theme toggle ────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}
.theme-toggle:hover { background: var(--surface2); }

/* ── Shortcut help overlay ───────────────────────────────────────── */
.shortcut-help {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shortcut-help-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-width: 260px;
}
.shortcut-help-content h3 { margin-bottom: 16px; font-size: 14px; color: var(--text); }
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.shortcut-row:last-of-type { border-bottom: none; margin-bottom: 16px; }
kbd {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: monospace;
  color: var(--text);
}
.shortcut-help-content button {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}
.shortcut-help-content button:hover { color: var(--text); }

/* ── Copy button ─────────────────────────────────────────────────── */
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  opacity: 0.4;
  padding: 0 4px;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.copy-btn:hover { opacity: 1; }

/* ── Reconnecting status ─────────────────────────────────────────── */
#conn-status.reconnecting::before { background: var(--yellow); }

/* ── Delete button in detail panel ──────────────────────────────── */
.detail-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  transition: color 0.15s;
  margin-right: 4px;
}
.detail-delete:hover { color: var(--red); }

/* ── Toast notifications ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: toast-in 0.2s ease-out;
  pointer-events: auto;
}

.toast.error { border-color: var(--red); color: var(--red); }
.toast.info  { border-color: var(--blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Light theme ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f0f2f8;
  --surface:     #ffffff;
  --surface2:    #e8eaf0;
  --border:      #d0d4e8;
  --text:        #1a1d27;
  --text-muted:  #6b7099;
  --text-dim:    #4a4e6a;
}

/* ── Skeleton loader ──────────────────────────────────────────────────────────── */
.skeleton-group {
  margin-bottom: 24px;
}

.skeleton-group-header {
  height: 20px;
  width: 180px;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 12px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk-line {
  border-radius: 4px;
  background: var(--surface2);
  animation: shimmer 1.5s ease-in-out infinite;
}

.sk-title  { height: 14px; width: 60%; }
.sk-body   { height: 12px; width: 90%; }
.sk-short  { width: 45%; }
.sk-footer { height: 10px; width: 75%; margin-top: 4px; }

@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ── Tablet responsive (≤ 1024px) ────────────────────────────────── */
@media (max-width: 1024px) {
  .session-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-panel {
    width: 300px;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .stat-item {
    min-width: 80px;
  }

  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar-right {
    width: 100%;
  }

  .search-input {
    flex: 1;
  }
}

/* ── Mobile (≤ 640px) ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .session-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    width: 100%;
    right: 0;
  }

  header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-meta {
    font-size: 11px;
    gap: 10px;
  }

  .filter-group {
    flex-wrap: wrap;
  }
}

/* ── Stats bar actions (export + tool stats toggle) ──────────────── */
.stats-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  position: relative;
}

.icon-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.icon-btn:hover {
  background: var(--border);
  color: var(--text);
}

.export-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  z-index: 50;
  min-width: 80px;
}

.export-menu button {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.export-menu button:hover {
  background: var(--surface2);
}

/* ── Tool usage stats panel ───────────────────────────────────────── */
.tool-stats-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.tool-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tool-stats-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-stats-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.tool-stat-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.tool-stat-name {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-stat-bar-wrap {
  background: var(--surface2);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.tool-stat-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tool-stat-count {
  color: var(--text-muted);
  text-align: right;
}

.tool-stats-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 0;
}

/* ── Hourly trend panel ───────────────────────────────────────────── */
.trend-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.trend-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.trend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trend-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.sessions { background: var(--blue); }
.legend-dot.tools    { background: var(--green); }

.trend-content {
  overflow-x: auto;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding-bottom: 20px;
  min-width: max-content;
}

.trend-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 60px;
}

.trend-bar {
  width: 6px;
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  transition: height 0.3s ease;
}
.trend-bar.sessions { background: var(--blue); }
.trend-bar.tools    { background: var(--green); opacity: 0.7; }

.trend-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  height: 14px;
  display: flex;
  align-items: center;
}

/* ── Load more button (D-6) ──────────────────────────────────────── */
.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}

.load-more-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Alert rules modal (C-5) ─────────────────────────────────────── */
.alert-rules-content {
  min-width: 360px;
  max-width: 480px;
}

.alert-rules-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.alert-rules-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  max-height: 180px;
  overflow-y: auto;
}

.alert-rules-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

.alert-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface2);
  border-radius: 4px;
  padding: 6px 10px;
}

.alert-rule-label {
  font-size: 12px;
  color: var(--text);
  flex: 1;
}

.alert-rule-del {
  padding: 2px 6px;
  font-size: 14px;
  line-height: 1;
}

.alert-rules-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: middle;
  margin-left: 2px;
}

/* toast warning variant */
.toast.warning {
  background: var(--orange);
  color: #fff;
}

/* ── RC Guide Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.rc-guide-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.rc-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.rc-guide-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.rc-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.rc-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rc-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #0f1117;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rc-step strong { display: block; margin-bottom: 4px; font-size: 13px; }
.rc-step p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.rc-step code {
  background: var(--surface2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 12px;
  color: var(--green);
}

.rc-requirements {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.rc-requirements strong { display: block; margin-bottom: 8px; color: var(--text-dim); }
.rc-requirements ul { list-style: disc; padding-left: 16px; }
.rc-requirements li { margin-bottom: 4px; }
.rc-requirements code {
  background: var(--surface);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: monospace;
  color: var(--green);
}

/* RC row in detail panel */
.rc-row .detail-meta-value { display: flex; gap: 6px; }
.rc-row .icon-btn { font-size: 11px; padding: 2px 8px; }

/* ── Reduced motion accessibility ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .header-title .dot,
  .skeleton-group-header,
  .sk-line,
  .session-card.updated,
  .toast {
    animation: none;
  }
  .filter-btn, .session-card, .detail-overlay, .detail-panel,
  .detail-close, .search-input, .pin-btn, .copy-btn,
  .detail-delete, .icon-btn, .tool-stat-bar, .trend-bar,
  .load-more-btn {
    transition-duration: 0.01s;
  }
}
