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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #222;
  --border: #333;
  --text: #e5e5e5;
  --text-muted: #888;
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
  --led-green: #00ff66;
  --led-green-dim: #004d1e;
  --led-green-glow: rgba(0, 255, 102, 0.6);
  --led-amber: #ffb000;
  --led-amber-dim: #4d3500;
  --led-amber-glow: rgba(255, 176, 0, 0.6);
  --led-red: #ff3333;
  --led-red-dim: #4d0f0f;
  --led-red-glow: rgba(255, 51, 51, 0.6);
  --led-bg: #0a0c08;
  --led-bg-amber: #0c0a04;
  --led-bg-red: #0c0404;
  --chassis-grain: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.012) 1px, rgba(255,255,255,0.012) 2px);
}

html { font-size: 118%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Studio header */
.studio-header {
  padding: 2rem 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.studio-header h1 { font-size: 1.75rem; font-weight: 700; }
.studio-header .subtitle { color: var(--text-muted); margin-top: 0.25rem; }

/* Session grid */
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 1rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.session-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}
.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.card-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--mono);
}
.card-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-family: var(--mono);
}

.card-body { padding: 0.75rem 1rem 1rem; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.card-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}
.card-clips {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}
.card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Session show */
.session-header {
  padding: 1.5rem 2rem 1rem;
  max-width: 1600px;
  margin: 0 auto;
}
.back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 0.5rem;
}
.back-link:hover { color: var(--accent); }
.session-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}
.session-number {
  color: var(--text-muted);
  font-family: var(--mono);
  font-weight: 400;
}
.session-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Two-column layout */
.session-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  align-items: start;
}

/* Transcript panel */
.transcript-panel {
  overflow-y: auto;
  max-height: calc(100vh - 160px);
  padding-right: 1rem;
}

.session-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.session-summary h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.session-summary p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0.25rem; }

.timeline-clip {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.timeline-clip.active {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
.timeline-clip:hover {
  background: var(--surface);
}

.clip-timestamp {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}
.timestamp-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}
.timestamp-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.clip-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Frame thumbnails in timeline */
.timeline-frame {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.frame-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.frame-timestamp {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-family: var(--mono);
}

/* Highlights section */
.session-highlights {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.session-highlights h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.session-highlights h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.session-highlights p { font-size: 0.9rem; margin-bottom: 0.5rem; }
.session-highlights ul, .session-highlights ol { padding-left: 1.5rem; font-size: 0.9rem; }
.session-highlights li { margin-bottom: 0.25rem; }
.session-highlights strong { color: var(--text); }

/* Video panel */
.video-panel {
  position: relative;
}
.video-sticky {
  position: sticky;
  top: 1rem;
}
.video-player {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}
.video-controls {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}
.mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Episode card extras */
.episode-placeholder {
  background: linear-gradient(135deg, #1a2e1a, #162e21) !important;
}
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.5rem;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag-more { font-style: italic; }

/* Episode show layout */
.episode-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  align-items: start;
}

.episode-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.episode-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Title alternatives */
.alt-titles {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.alt-title {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
}
.alt-title.current {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.title-themes {
  display: flex;
  gap: 6px;
  margin-top: 0.75rem;
}

/* Description */
.episode-description {
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.episode-description p { margin-bottom: 0.5rem; }

/* Chapters */
.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chapter-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}
.chapter-item:hover { background: var(--bg); }
.chapter-time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 40px;
  flex-shrink: 0;
}
.chapter-title {
  font-size: 0.9rem;
}

/* Tags cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pinned comment */
.pinned-comment {
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

/* Promotion tabs */
.promotion-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0.75rem;
}
.promo-tab {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.promo-tab:hover { border-color: var(--accent); color: var(--text); }
.promo-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.promo-content {
  display: none;
  position: relative;
}
.promo-content.active { display: block; }
.promo-text {
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font);
  max-height: 400px;
  overflow-y: auto;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--text); }

/* Transcript */
.episode-transcript {
  max-height: 600px;
  overflow-y: auto;
}
.transcript-line {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}
.transcript-line:hover { background: var(--bg); }
.transcript-time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.transcript-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Shorts */
.shorts-group {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
}
.group-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.short-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.short-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.short-preview {
  position: relative;
  aspect-ratio: 9/16;
  background: #111;
  overflow: hidden;
}
.short-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.short-type-badge {
  background: rgba(245, 158, 11, 0.9) !important;
}

/* Short show layout */
.short-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  align-items: start;
}

.short-video-panel {
  position: sticky;
  top: 1rem;
}
.short-player {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.short-meta-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Memories */
.memories-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  align-items: start;
}

/* Sidebar */
.memories-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.memory-search-form { margin-bottom: 0.25rem; }
.memory-search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}
.memory-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.filter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* hw-btn filter overrides — green lit when active, amber when off */
.hw-btn.filter-btn {
  flex: none;
  border-radius: 4px;
  padding: 4px 10px;
}
/* Dim hw-btn — muted/neutral, visually distinct from amber/green */
.hw-btn.hw-btn-dim {
  color: #777;
  background: linear-gradient(180deg, #1a1a1a, #141414);
  border-color: rgba(120, 120, 120, 0.3);
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(120, 120, 120, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6);
}
.hw-btn.hw-btn-dim:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}
.hw-btn.filter-btn:hover {
  border-color: rgba(180, 140, 40, 0.5);
  color: #c89b3f;
}
.hw-btn.filter-btn.active {
  color: #4ade80;
  background: linear-gradient(180deg, #172917, #111f11);
  border-color: rgba(34, 197, 94, 0.4);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(34, 197, 94, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(34, 197, 94, 0.2);
}
.core-filter { border-color: #f59e0b; color: #f59e0b; }
.core-filter.active { background: #f59e0b; border-color: #f59e0b; color: #000; }

/* Tags list in sidebar */
.tags-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
}
.tag-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.1s;
}
.tag-filter:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.tag-filter.active { background: var(--accent-dim); color: var(--accent); }
.tag-filter.core-tag { color: #f59e0b; }
.tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 4px;
}

/* Importance bars in sidebar */
.importance-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.importance-row {
  display: grid;
  grid-template-columns: 20px 1fr 24px;
  gap: 6px;
  align-items: center;
}
.importance-level {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}
.importance-bar-bg {
  height: 10px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.importance-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  min-width: 1px;
}
.importance-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Active filters bar */
.active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}
.results-count {
  color: var(--text-muted);
  font-weight: 600;
}
.active-filter {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}
.remove-filter {
  margin-left: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
}
.remove-filter:hover { color: var(--text); text-decoration: none; }
.clear-filters {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Memory cards */
.memories-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.memory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  border-left: 3px solid transparent;
  transition: border-color 0.15s;
}
.memory-card:hover { border-left-color: var(--accent); }
.memory-card.core-memory {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.memory-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.memory-id {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.memory-importance {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
}
.importance-10, .importance-9 { color: #ef4444; border-color: #ef4444; }
.importance-8 { color: #f59e0b; border-color: #f59e0b; }
.importance-7 { color: #3b82f6; border-color: #3b82f6; }
.importance-6, .importance-5 { color: var(--text-muted); }
.importance-4, .importance-3, .importance-2, .importance-1 { color: #555; }

.core-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: #f59e0b;
  color: #000;
  letter-spacing: 0.05em;
}

.memory-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.memory-content {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-context {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.memory-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.1s;
}
.memory-tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.memory-tag.core-tag {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

/* Memory detail page */
.memory-detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  align-items: start;
}

.memory-detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.memory-detail-content {
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
}
.memory-detail-content p { margin-bottom: 0.75rem; }

.memory-context-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

/* Actions sidebar */
.memory-detail-actions {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.action-btn {
  width: 100%;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--accent); }
.action-btn.core-active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #000;
}
.action-btn.core-active:hover { background: #d97706; }
.danger-btn { color: #ef4444; border-color: #ef4444; }
.danger-btn:hover { background: #ef4444; color: #fff; }

.importance-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.importance-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.importance-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}
.imp-btn {
  padding: 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--mono);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
}
.imp-btn:hover { border-color: var(--accent); color: var(--text); }
.imp-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.meta-table {
  width: 100%;
  font-size: 0.8rem;
}
.meta-table td {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.meta-table td:first-child {
  color: var(--text-muted);
  width: 100px;
}

/* Agent / Operations */
.agent-controls {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 1rem;
}

.agent-start-form .form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-select {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}
.form-select:focus { outline: none; border-color: var(--accent); }

.form-input {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input-small { width: 80px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.form-check input { accent-color: var(--accent); }

.btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-danger { background: #991b1b; border-color: #dc2626; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.agent-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-running { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.status-stopped { background: rgba(107, 114, 128, 0.2); color: #6b7280; }

.agent-model {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}
.agent-uptime {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* Agent log */
.agent-log-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.agent-log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.log-filters {
  display: flex;
  gap: 4px;
}

.agent-log {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  height: 60vh;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
}

.log-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.log-entry {
  display: flex;
  gap: 0.5rem;
  padding: 1px 0;
  word-break: break-word;
}

.log-time {
  color: #555;
  flex-shrink: 0;
}

.log-label {
  flex-shrink: 0;
  font-weight: 600;
}

.log-content {
  white-space: pre-wrap;
}

/* Log type colors */
.log-boot .log-label { color: #a78bfa; }
.log-boot .log-content { color: #a78bfa; }
.log-text .log-label { color: #e5e5e5; }
.log-text .log-content { color: #e5e5e5; }
.log-thinking .log-label { color: #666; }
.log-thinking .log-content { color: #666; font-style: italic; }
.log-tool_call .log-label { color: #22d3ee; }
.log-tool_call .log-content { color: #22d3ee; }
.log-tool_result .log-label { color: #4ade80; }
.log-tool_result .log-content { color: #4ade80; }
.log-event .log-label { color: #888; }
.log-event .log-content { color: #888; }
.log-dream .log-label { color: #c084fc; }
.log-dream .log-content { color: #c084fc; }
.log-compacted .log-label { color: #fbbf24; }
.log-compacted .log-content { color: #fbbf24; }
.log-tool_error .log-label { color: #ef4444; }
.log-tool_error .log-content { color: #ef4444; }
.log-tool_error .log-collapsible { color: #ef4444; }
.log-error .log-label { color: #ef4444; }
.log-error .log-content { color: #ef4444; }

/* Collapsible tool results */
.log-collapsible {
  color: #4ade80;
  cursor: pointer;
}
.log-collapsible .log-preview { display: inline; }
.log-collapsible .log-full {
  display: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-collapsible.expanded .log-preview { display: none; }
.log-collapsible.expanded .log-full { display: inline; }

/* Agent chat input */
.agent-chat {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 1rem;
}
.agent-chat-form {
  display: flex;
  gap: 0.5rem;
}
.chat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

/* Agent runs table */
.agent-runs {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}
.agent-runs h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.runs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.runs-table th {
  text-align: left;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.runs-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.run-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.run-running { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.run-stopped { background: rgba(107, 114, 128, 0.2); color: #6b7280; }
.run-error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.run-killed { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.run-link { color: var(--accent); text-decoration: none; }
.run-link:hover { text-decoration: underline; }
.run-active { background: var(--accent-dim); }
.viewing-run {
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.5rem;
}
.btn-sm {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  margin-left: 0.5rem;
}
.btn-sm:hover { border-color: var(--accent); }

/* Agent embed card */
.agent-embed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-decoration: none !important;
  color: var(--text);
  display: block;
  transition: border-color 0.15s;
}
.agent-embed-card:hover { border-color: var(--accent); }
.embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.embed-name { font-weight: 600; font-size: 0.9rem; }
.embed-model { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); }
.embed-log { margin-top: 0.5rem; }
.embed-log-entry {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 0;
}

/* Memory form */
.memory-form-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
}

.memory-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.form-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.form-field {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}
.form-field:focus { outline: none; border-color: var(--accent); }

.form-textarea {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
}
.form-textarea:focus { outline: none; border-color: var(--accent); }

.form-importance-picker {
  display: flex;
  gap: 4px;
}
.form-imp-option input[type="radio"] { display: none; }
.form-imp-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.15s;
}
.form-imp-label:hover { border-color: var(--accent); color: var(--text); }
.form-imp-option input[type="radio"]:checked + .form-imp-label {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.edit-btn {
  display: block;
  text-align: center;
  text-decoration: none !important;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
}
.edit-btn:hover { background: #2563eb; }

/* Memory title row */
.memories-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Bulk selection */
.bulk-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.bulk-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.bulk-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.bulk-count {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
}

.bulk-select-all {
  cursor: pointer;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.bulk-action-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-select-sm {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
  font-family: var(--font);
}
.form-select-sm:focus { outline: none; border-color: var(--accent); }

.bulk-tag-input {
  width: 100px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
  font-family: var(--font);
}
.bulk-tag-input:focus { outline: none; border-color: var(--accent); }

.btn-sm-danger {
  color: #ef4444 !important;
  border-color: #ef4444 !important;
}
.btn-sm-danger:hover { background: #ef4444 !important; color: #fff !important; }

/* Flash messages */
.flash-notice, .flash-alert {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
  font-size: 0.85rem;
}
.flash-notice { color: #22c55e; }
.flash-alert { color: #ef4444; }

/* Recording dashboard */
.recording-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.recording-prerequisites {
  margin-top: 1rem;
}
.recording-prerequisites h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.prereq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.prereq-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prereq-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prereq-ok { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.prereq-missing { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.prereq-info { background: var(--text-muted); }
.prereq-label { font-size: 0.9rem; }
.prereq-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.recording-monitor {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recording-monitor-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
}

.recording-preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.recording-preview {
  position: relative;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.recording-camera-info {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recording-status-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-value {
  font-size: 1rem;
  font-weight: 600;
}
.mono { font-family: var(--mono); }

.process-list {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.process-list h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.process-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 2px 0;
  color: var(--text-muted);
}
.process-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
  flex-shrink: 0;
}
.process-dot.dot-alive {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.3);
}
.process-dot.dot-dead {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
}

.recording-narration {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.recording-narration h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.narration-feed {
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: #0a0a0a;
  border-radius: 6px;
  padding: 0.5rem;
}
.narration-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  font-style: italic;
}
.narration-entry {
  display: flex;
  gap: 0.5rem;
  padding: 2px 0;
}
.narration-time {
  color: #555;
  flex-shrink: 0;
}
.narration-text {
  color: #a78bfa;
  white-space: pre-wrap;
}

.recording-postprod {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.recording-postprod h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.postprod-entry {
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--text-muted);
}
.postprod-stopping { color: #fbbf24; }
.postprod-merging { color: #22d3ee; }
.postprod-chunks { color: #22d3ee; }
.postprod-naming { color: #22d3ee; }
.postprod-done { color: #22c55e; }

.run-stopping { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.run-failed { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* App bar — persistent top bar */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  background: #111;
  border-bottom: 1px solid var(--border);
}
.app-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Mode tabs */
.mode-tabs {
  display: flex;
  gap: 4px;
}
.mode-tab {
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.mode-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  text-decoration: none;
}
.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.mode-tab.active:hover {
  text-decoration: none;
}

/* Shoot widgets row */
.shoot-widgets {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.shoot-widget {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  min-width: 140px;
}
a.shoot-widget:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.shoot-widget.widget-active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.widget-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.widget-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.widget-dot.dot-alive {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.3);
}
.widget-dot.dot-dead {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
}
.widget-label {
  font-weight: 600;
}
.widget-stat {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.widget-hint {
  font-size: 0.7rem;
  color: #555;
  font-style: italic;
  margin-top: 2px;
}

/* Mode sub-nav (Post / Workshop) */
.mode-subnav {
  display: flex;
  gap: 4px;
  padding: 0.5rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.subnav-link {
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.subnav-link:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}
.subnav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.subnav-link.active:hover {
  text-decoration: none;
}

/* Shoot dashboard (legacy — kept for reference) */
.shoot-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}
.shoot-overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.shoot-hints h2,
.shoot-running h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ── Shoot Dashboard v2 ─────────────────────────────────── */
.shoot-page {
  padding: 0.75rem 2rem 0.75rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Pin shoot page to fill viewport below app-bar — no page scroll */
body:has(.shoot-page) {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body:has(.shoot-page) .app-bar {
  display: none;
}
body:has(.shoot-page) .shoot-page {
  flex: 1;
  min-height: 0;
}

/* Bot state section divider */
.bs-divider {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Server section (inside Haksnbot column) */
.server-section {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.server-section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.server-chat { margin-top: 0.45rem; }
.server-section-header h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.server-section-header h3 span {
  color: var(--text);
}
.server-info-item {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}
.server-weather-badge {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}
.player-count {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--led-green);
  text-shadow: 0 0 4px var(--led-green-glow);
}
.server-chat-feed {
  background: var(--led-bg);
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  height: 150px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.4;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.chat-line {
  display: flex;
  gap: 0.4rem;
  padding: 1px 0;
}
.chat-time {
  color: var(--led-amber-dim);
  flex-shrink: 0;
}
.chat-user {
  color: var(--led-green);
  text-shadow: 0 0 4px var(--led-green-glow);
  flex-shrink: 0;
  font-weight: 500;
}
.chat-msg {
  color: var(--led-green);
  text-shadow: 0 0 3px rgba(0, 255, 102, 0.15);
  word-break: break-word;
  opacity: 0.7;
}
.chat-system {
  color: var(--led-amber);
  text-shadow: 0 0 4px var(--led-amber-glow);
  font-style: italic;
  opacity: 0.6;
}

/* Shoot grid — two-column layout with resize handle */
.shoot-grid {
  display: grid;
  grid-template-columns: var(--shoot-left-width, 380px) 6px 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.shoot-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding-right: 0.5rem;
  overflow-y: auto;
}
.shoot-right {
  min-width: 0;
  min-height: 0;
  padding-left: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Draggable column resize handle */
.shoot-resize {
  cursor: col-resize;
  position: relative;
  z-index: 10;
  min-height: 100%;
}
.shoot-resize::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  border-radius: 1px;
  background: var(--border);
  transition: background 0.15s, box-shadow 0.15s;
}
.shoot-resize:hover::after {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}
.shoot-grid.resizing {
  user-select: none;
  cursor: col-resize;
}
.shoot-grid.resizing .shoot-resize::after {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}
.bot-banner-col {
  background:
    var(--chassis-grain),
    linear-gradient(180deg, #1e1e1e 0%, #161616 40%, #131313 100%);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.5);
}
.bot-banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.bot-banner-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

/* Status badges */
.dep-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.dep-ok {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.dep-down {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Bot info rows */
.bot-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}
.bot-info-label {
  color: var(--text);
  font-weight: 500;
}
.bot-info-detail {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Dependency row — inline single line */
.dep-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dep-row-right {
  margin-left: auto;
}

/* LED-style select (server picker etc.) */
.led-select-wrap {
  padding: 1px 2px 1px 6px;
  display: inline-flex;
  align-items: center;
}
.led-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--led-green, #22c55e);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  cursor: pointer;
  padding: 0 12px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2322c55e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.led-select option {
  background: #1a1a1a;
  color: #ddd;
}
.dep-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dep-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
}
.dep-dot.dot-alive {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.3);
}
.dep-dot.dot-dead {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
}

/* ── Auth error + auth code displays ── */
.auth-error {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  word-break: break-word;
}
.auth-code-panel {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.auth-code-panel a {
  color: #60a5fa;
  text-decoration: underline;
}
.auth-code-value {
  color: #fbbf24;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}
.auth-code-wait {
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: hw-rec-pulse 2s ease-in-out infinite;
}
.dep-label {
  color: var(--text-muted);
}

/* Camera maneuver display */
.bot-maneuver {
  font-size: 0.78rem;
  color: var(--accent);
}

.rec-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.45rem;
  margin-bottom: 0.45rem;
}
.rec-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rec-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.rec-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
}
.rec-controls {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.rec-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
/* ── Broadcast monitor + transport ──────────────────────── */
.hx-monitor {
  margin-top: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.5);
  background: #000;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.04);
}

/* Preview: always rendered, styled as LED/CRT broadcast monitor */
.haksnxot-preview {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--led-bg);
  overflow: hidden;
}

/* Scanline overlay — subtle horizontal lines like a CRT monitor */
.haksnxot-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Green phosphor vignette — soft glow around edges when active */
.haksnxot-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,20,8,0.6) 100%);
  box-shadow: inset 0 0 30px rgba(0,255,102,0.04);
  pointer-events: none;
  z-index: 3;
}

/* Off state — recessed LED display with NO SIGNAL text */
.haksnxot-preview.preview-off {
  background: var(--led-bg);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.haksnxot-preview.preview-off::after {
  background: none;
  box-shadow: none;
}
.hx-no-signal {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--led-green);
  opacity: 0.12;
  text-shadow: 0 0 6px var(--led-green-glow);
  z-index: 4;
}

.haksnxot-preview .preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* Slight green tint + contrast boost — broadcast monitor look */
  filter: contrast(1.05) brightness(0.95);
}

/* Tally light — red REC badge in top-right of monitor */
.hx-tally {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(220, 38, 38, 0.9);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
  animation: tally-blink 1.5s step-start infinite;
}
@keyframes tally-blink {
  50% { opacity: 0.3; }
}

/* Transport strip — brushed metal panel below monitor */
.hx-transport {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background:
    linear-gradient(180deg,
      #1e1e1e 0%,
      #161616 40%,
      #131313 100%);
  border-top: 1px solid #2a2a2a;
  /* Fine horizontal grain */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.012) 1px,
      rgba(255, 255, 255, 0.012) 2px
    ),
    linear-gradient(180deg, #1e1e1e, #131313);
}

.hx-transport-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Haksnxot header extras ────────────────────────────── */
.hx-header-btn {
  margin-left: auto;
}
.hw-btn-sm {
  padding: 4px 10px;
  font-size: 0.7rem;
}
.hx-tracking {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}


/* ── Hardware buttons (broadcast panel) ────────────────── */
.hw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  cursor: pointer;
  text-transform: uppercase;
  /* Default: amber standby backlight */
  color: #c89b3f;
  background: linear-gradient(180deg, #252010, #1c1a0e);
  border: 1px solid rgba(180, 140, 40, 0.3);
  text-shadow: 0 0 6px rgba(200, 155, 63, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(200, 155, 63, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(200, 155, 63, 0.1);
}
.hw-btn:active {
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Icon inside button */
.hw-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Lit: CAMERA shifts amber → green ── */
.hw-btn-green.hw-lit {
  color: #4ade80;
  background: linear-gradient(180deg, #172917, #111f11);
  border-color: rgba(34, 197, 94, 0.4);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(34, 197, 94, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(34, 197, 94, 0.2);
}
.hw-btn-green.hw-lit .hw-icon {
  filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.8));
}

/* ── Lit: RECORD shifts amber → red ── */
.hw-btn-red.hw-lit {
  color: #f87171;
  background: linear-gradient(180deg, #291717, #1f1111);
  border-color: rgba(239, 68, 68, 0.4);
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(239, 68, 68, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(239, 68, 68, 0.2);
  animation: hw-rec-pulse 2s ease-in-out infinite;
}
.hw-btn-red.hw-lit .hw-icon {
  filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.8));
}

@keyframes hw-rec-pulse {
  0%, 100% { text-shadow: 0 0 8px rgba(239, 68, 68, 0.9); }
  50% { text-shadow: 0 0 14px rgba(239, 68, 68, 1), 0 0 28px rgba(239, 68, 68, 0.4); }
}

/* ── Lit: DISCORD private shifts amber → blue ── */
.hw-btn-blue.hw-lit {
  color: #60a5fa;
  background: linear-gradient(180deg, #171e29, #111722);
  border-color: rgba(59, 130, 246, 0.4);
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(59, 130, 246, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(59, 130, 246, 0.2);
}
.hw-btn-blue.hw-lit .hw-icon {
  filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.8));
}

/* ── Stream channel toggles row ── */
.stream-toggles {
  display: flex;
  gap: 6px;
  margin-top: 0.35rem;
}
.stream-toggles .hw-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.65rem;
  min-width: 0;
  gap: 5px;
}

/* Inline process diode inside toggle buttons */
.stream-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #555;
  box-shadow: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.stream-dot.dot-alive {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.7), 0 0 8px rgba(34, 197, 94, 0.3);
}
.stream-dot.dot-dead {
  background: #555;
  box-shadow: none;
}

/* Camera info below preview */
.cam-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Connection page */
.connection-page { max-width: 1400px; margin: 0 auto; padding: 0 2rem 3rem; }
.connection-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
}
.connection-info h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }

/* Bot state — compact HUD */
.bs {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
}
.bs-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
}
.bs-line .led-row {
  flex: 1;
  min-width: 0;
}
.bs-line .led-display {
  flex: 1;
  min-width: 0;
}
.bs-line .led-display-coord {
  width: 6ch;
  flex: none;
}
.bs-line .led-display-num {
  width: 4ch;
  flex: none;
  padding: 1px 5px;
}
.bs-coords { font-weight: 600; }
.bs-dim { color: var(--led-amber-dim); text-shadow: none; }
.bs-hostile { color: var(--led-red); text-shadow: 0 0 4px var(--led-red-glow); }
.bs-sep { color: #444; }
.bs-bar {
  display: inline-block;
  width: 40px;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 2px;
}
.bs-bar .bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.health-bar .bar-fill { background: #22c55e; }
.food-bar .bar-fill { background: #f59e0b; }

/* Tag rows — shared by bot state + server panel */
.bs-tag-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  min-height: 1.2rem;
}
.bs-tag-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  line-height: 1;
}
.bs-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.bs-tag-row > .led-display:not(.led-display-sm) {
  flex: 1;
  min-width: 0;
}
.bs-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-family: var(--mono);
  background: var(--led-bg);
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  color: var(--led-green);
  text-shadow: 0 0 4px var(--led-green-glow);
  white-space: nowrap;
}
.bs-tag-hostile {
  background: var(--led-bg-red);
  border-color: rgba(255, 51, 51, 0.3);
  color: var(--led-red);
  text-shadow: 0 0 4px var(--led-red-glow);
}

/* Section headers inside bot state / server panel */
.bs-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.bs-header-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.bs-header-row .led-row {
  flex: 1;
  min-width: 0;
}
.bs-header-row .led-display {
  flex: 1;
  min-width: 0;
}
.bs-pill {
  display: inline-block;
  padding: 1px 6px;
  background: var(--led-bg);
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--led-green);
  text-shadow: 0 0 6px var(--led-green-glow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
  white-space: nowrap;
}
.bs-pill-hostile {
  background: var(--led-bg-red);
  color: var(--led-red);
  text-shadow: 0 0 6px var(--led-red-glow);
}

/* Bot state — verbose layout (connection page) */
.bot-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}
.bot-state-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}
.bot-state-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 80px;
  flex-shrink: 0;
}
.bot-state-value {
  font-size: 0.82rem;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.bot-state-value .bar {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
}
.bot-state-value .bar .bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.bot-state-value .bar-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.bot-state-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.bot-state-section h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.armor-slots { display: flex; gap: 0.75rem; }
.armor-slot { display: flex; flex-direction: column; gap: 1px; }
.armor-slot-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); }
.armor-slot-value { font-size: 0.78rem; font-family: var(--mono); }
.nearby-list { display: flex; flex-direction: column; gap: 1px; }
.nearby-item { display: flex; justify-content: space-between; padding: 1px 0.35rem; font-size: 0.78rem; }
.nearby-item:hover { background: var(--bg); }
.nearby-name { font-weight: 500; }
.nearby-distance { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.hostile-item { color: #ef4444; }
.hostile-text { color: #ef4444; }
.food-list { display: flex; flex-wrap: wrap; gap: 3px; }
.food-item { font-size: 0.72rem; font-family: var(--mono); padding: 1px 6px; background: var(--bg); border-radius: 3px; border: 1px solid var(--border); color: var(--text-muted); }

/* Bot controls (used in connection page) */
.bot-controls { margin-top: 0.75rem; display: flex; gap: 0.5rem; align-items: center; }

/* Agent panel tabs */
.agent-panel-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0;
  flex-shrink: 0;
}
.agent-panel-tabs .hw-btn {
  flex: none;
}
.panel-tab.active {
  color: #4ade80;
  background: linear-gradient(180deg, #172917, #111f11);
  border-color: rgba(34, 197, 94, 0.4);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(34, 197, 94, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(34, 197, 94, 0.2);
}
.panel-tab-hint {
  font-size: 0.7rem;
  color: #555;
  margin-left: 0.5rem;
}
.agent-panel-tabs .mode-tabs {
  margin-left: auto;
  gap: 4px;
}
.agent-panel-tabs .mode-tabs a {
  text-decoration: none;
}

/* Agent panels container */
.agent-panels {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.agent-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agent-panel.panel-half {
  flex: 1;
}
.agent-panel.panel-full {
  flex: 1;
}

/* Panel header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.panel-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.panel-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.panel-header-right .hw-btn {
  flex: none;
  padding: 8px 16px;
}
.panel-model-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4px;
}
.panel-btn-row {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* Toggle buttons — hw-btn wrapping a hidden checkbox */
.hw-toggle {
  cursor: pointer;
  user-select: none;
}
.hw-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.hw-toggle-input:checked + .hw-toggle-label {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
}
.hw-toggle:has(.hw-toggle-input:checked) {
  background: linear-gradient(180deg, #172917, #111f11);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(34, 197, 94, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(34, 197, 94, 0.2);
}
.panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
}
.panel-header h3 a {
  color: var(--text);
  text-decoration: none;
}
.panel-header h3 a:hover {
  color: var(--accent);
}
.panel-flag {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Panel controls (legacy — used on non-shoot agent pages) */
.panel-controls {
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.panel-start-form .form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Panel log container — fills remaining space in agent panel */
.panel-log-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel-log-container .agent-log {
  flex: 1;
  height: 0;
  min-height: 120px;
  overflow-y: auto;
}

/* Panel chat — always pinned at bottom of agent panel */
.panel-chat {
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.panel-chat .agent-chat-form {
  display: flex;
  gap: 0.5rem;
}
.panel-chat .chat-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}
.panel-chat .chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── LED / VFD Display System ──────────────────────────── */

/* LED text — green VFD glow */
.led {
  font-family: var(--mono);
  color: var(--led-green);
  text-shadow: 0 0 6px var(--led-green-glow), 0 0 12px rgba(0, 255, 102, 0.3);
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}
.led-amber {
  color: var(--led-amber);
  text-shadow: 0 0 6px var(--led-amber-glow), 0 0 12px rgba(255, 176, 0, 0.3);
}
.led-red {
  color: var(--led-red);
  text-shadow: 0 0 6px var(--led-red-glow), 0 0 12px rgba(255, 51, 51, 0.3);
}
.led-dim {
  opacity: 0.5;
  text-shadow: none;
}
.led-sm {
  font-size: 0.7rem;
}

/* LED display window — fixed-size cutout in panel metal */
.led-display {
  display: inline-block;
  background: var(--led-bg);
  padding: 3px 8px;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 0 1px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.4);
  min-width: 3rem;
  overflow: hidden;
}
.led-display .led {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.led-display-amber { background: var(--led-bg-amber); }
.led-display-red { background: var(--led-bg-red); }
.led-display-sm { padding: 2px 6px; min-width: 2.5rem; }
.led-display-block { display: block; }

/* Transport strip — displays stretch to fill row */
.hx-transport-info .led-row {
  display: flex;
  width: 100%;
}
.hx-transport-info .led-display {
  flex: 1;
  min-width: 0;
}
.hx-move-display {
  flex: 2 !important;
}

/* Recording stats — inline led-rows */
.rec-stats .led-row { flex: 1; min-width: 0; }
.rec-stats .led-display { flex: 1; min-width: 0; }

/* Server header — LED display rows stretch, indicator rows stay compact */
.server-section-header .led-row {
  flex: 1;
  min-width: 0;
}
.server-section-header .led-display {
  flex: 1;
  min-width: 0;
}

/* Panel label — silk-screened engraved text */
.panel-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  line-height: 1;
}

/* Layout helpers */
.led-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.led-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Segmented LED bar graph */
.led-bar {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
  flex: 1;
}
.led-segment {
  flex: 1;
  height: 8px;
  border-radius: 1px;
  background: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.3);
  transition: background 0.3s, box-shadow 0.3s;
}
.seg-on {
  background: var(--led-green);
  border-color: rgba(0, 255, 102, 0.3);
  box-shadow: 0 0 4px var(--led-green-glow);
}
.seg-warn {
  background: var(--led-amber);
  border-color: rgba(255, 176, 0, 0.3);
  box-shadow: 0 0 4px var(--led-amber-glow);
}
.seg-crit {
  background: var(--led-red);
  border-color: rgba(255, 51, 51, 0.3);
  box-shadow: 0 0 4px var(--led-red-glow);
}

/* Status LED — indicator diode */
.status-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led-green);
  box-shadow: 0 0 4px var(--led-green-glow);
  border: 1px solid rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.status-led-warn {
  background: var(--led-amber);
  box-shadow: 0 0 4px var(--led-amber-glow);
}
.status-led-off {
  background: #1a1a1a;
  box-shadow: none;
}

/* LED indicator row — label + diode, compact, no stretch */
.led-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Indicator states — always-visible badges that dim when inactive */
.indicator-off { opacity: 0.15; }
.hx-tally-off {
  background: rgba(100, 30, 30, 0.4);
  box-shadow: none;
  animation: none;
  opacity: 0.3;
}

/* Responsive */
@media (max-width: 1200px) {
  body:has(.shoot-page) {
    height: auto;
    overflow: auto;
  }
  .shoot-page {
    overflow: visible;
  }
  .shoot-grid {
    grid-template-columns: 1fr !important;
  }
  .shoot-resize {
    display: none;
  }
  .shoot-right {
    padding-left: 0;
    height: 70vh;
  }
}

@media (max-width: 1024px) {
  .memories-layout {
    grid-template-columns: 1fr;
  }
  .memories-sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }
  .memories-sidebar .filter-section { flex: 1; min-width: 200px; }
  .memories-sidebar .tags-list { max-height: 150px; }
  .memory-detail-layout {
    grid-template-columns: 1fr;
  }
  .memory-detail-actions {
    position: static;
  }
  .recording-monitor-grid {
    grid-template-columns: 1fr;
  }
  .session-layout,
  .episode-layout {
    grid-template-columns: 1fr;
  }
  .short-layout {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
  .short-video-panel {
    position: static;
    max-width: 300px;
    margin: 0 auto;
  }
  .video-panel { order: -1; }
  .video-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    padding: 0.5rem 0;
  }
  .transcript-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .agent-panels {
    flex-direction: column;
  }
  .agent-panel.panel-half,
  .agent-panel.panel-full {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .sessions-grid,
  .shorts-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .shorts-group { padding: 0 1rem 1.5rem; }
  .studio-header, .session-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .session-layout {
    padding: 0.5rem 1rem 2rem;
  }
  .app-bar {
    padding: 0.5rem 1rem;
  }
  .shoot-widgets {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }
  .mode-subnav {
    padding: 0.5rem 1rem;
  }
}
