/* === HauhauCS — The Quest of HuggingFace Clout === */
/* Dark Navy CRT Theme with Neon Accents */

:root {
  --bg: #0a0e1a;
  --bg-panel: #0d1225;
  --bg-card: #111830;
  --terminal: #00ff88;
  --accent: #ff9500;
  --danger: #ff3366;
  --success: #00ccff;
  --border: #1a2a4a;
  --text: #c8d6e5;
  --text-dim: #5a6a8a;
  --text-bright: #ffffff;
  --font-mono: 'Courier New', 'Consolas', 'Monaco', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

/* Game Container */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  overflow: hidden;
}

/* === Desktop Environment === */

/* Wallpaper: registered custom properties for smooth gradient color transitions */
@property --wp-c1 {
  syntax: '<color>';
  inherits: false;
  initial-value: #0a0e1a;
}
@property --wp-c2 {
  syntax: '<color>';
  inherits: false;
  initial-value: #0a0e1a;
}

#desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 44px; /* taskbar height */
  background: var(--bg);
  overflow: hidden;
}

#desktop.hidden { display: none !important; }
#taskbar.hidden { display: none !important; }

/* Desktop wallpaper — evolves with story chapter, clout, investigation */
#desktop-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 80%, var(--wp-c1), var(--wp-c2));
  transition: --wp-c1 3s ease, --wp-c2 3s ease;
}
/* Investigation red tint overlay (visible when .wallpaper-investigation class is present) */
#desktop-wallpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,51,102,0.06), transparent);
  opacity: 0;
  transition: opacity 3s ease;
}

/* Chapter wallpapers — subtle gradient shifts telling the story */
.wallpaper-ch1 { --wp-c1: #0a1a12; --wp-c2: #0a0e1a; } /* Ch1: Faint green glow — hopeful start */
.wallpaper-ch2 { --wp-c1: #1a1508; --wp-c2: #0a0e1a; } /* Ch2: Amber undertones — competitive */
.wallpaper-ch3 { --wp-c1: #1a1400; --wp-c2: #0e0a00; } /* Ch3: Warm amber — peak success */
.wallpaper-ch4 { --wp-c1: #14100a; --wp-c2: #0a0e1a; } /* Ch4: Amber cooling — shadows gathering */
.wallpaper-ch5 { --wp-c1: #1a0a0a; --wp-c2: #0a0e1a; } /* Ch5: Red/maroon — crackdown */
.wallpaper-ch6 { --wp-c1: #200505; --wp-c2: #0a0510; } /* Ch6: Deep red — endgame */

/* High clout modifier — amber glow (PLAN.md §7: clout >= 3000 "HuggingFace Legend") */
.wallpaper-high-clout { box-shadow: inset 0 0 120px rgba(255,149,0,0.08); }

/* Investigation modifier — red tint overlay (investigationLevel >= 3: dependency analysis published) */
.wallpaper-investigation::after { opacity: 1; }

/* Room canvas as subtle desktop background */
#desktop > #room-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* Desktop Icons */
#desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.desktop-icon {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.desktop-icon:hover {
  background: rgba(0, 255, 136, 0.08);
}

.desktop-icon:active {
  background: rgba(0, 255, 136, 0.15);
}

.desktop-icon-emoji {
  font-size: 24px;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.desktop-icon-label {
  font-size: 10px;
  color: var(--text);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  word-break: break-word;
  line-height: 1.2;
}

/* Fix #88: Locked Discord icon before clout unlock */
.desktop-icon.locked {
  opacity: 0.4;
}

/* === Window Chrome === */
.app-window {
  position: absolute;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 150ms ease, transform 150ms ease;
  min-width: 280px;
  min-height: 180px;
}

.app-window.focused {
  border-color: var(--terminal);
  box-shadow: 0 4px 24px rgba(0, 255, 136, 0.12);
}

.app-window.closing {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.app-window.opening {
  animation: windowOpen 150ms ease-out forwards;
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.app-window.maximized {
  border-radius: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
}

/* Window Title Bar */
.window-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.window-titlebar:active {
  cursor: grabbing;
}

.app-window.focused .window-titlebar {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}

.window-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.window-title {
  flex: 1;
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-window.focused .window-title {
  color: var(--terminal);
}

.window-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.win-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-dim);
  transition: all 0.1s ease;
  padding: 0;
}

.win-btn:hover {
  background: var(--border);
  color: var(--text);
}

.win-btn-close:hover {
  background: var(--danger);
  color: var(--text-bright);
}

/* Window Body */
.window-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 12px;
}

/* === Taskbar === */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 110;
  gap: 4px;
  padding: 0 8px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.taskbar-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-left {
  flex-shrink: 0;
  position: relative;
}

.taskbar-center {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 2px;
  padding: 0 4px;
  min-width: 0;
}

.taskbar-right {
  flex-shrink: 0;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Start Menu Button */
.taskbar-start-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  padding: 0;
}

.taskbar-start-btn:hover {
  border-color: var(--terminal);
  background: var(--bg-panel);
}

/* Start Menu Dropdown */
.start-menu {
  position: absolute;
  bottom: 44px;
  left: 0;
  width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
  z-index: 120;
  padding: 4px;
  overflow: hidden;
}

.start-menu.hidden {
  display: none;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s ease;
  font-size: 13px;
  color: var(--text);
}

.start-menu-item:hover {
  background: var(--bg-card);
  color: var(--terminal);
}

.start-menu-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

/* Taskbar App Buttons */
.taskbar-app-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
  height: 30px;
  position: relative; /* #102: anchor for taskbar-app-badge */
}

.taskbar-app-btn:hover {
  border-color: var(--terminal);
  color: var(--terminal);
}

.taskbar-app-btn.active {
  background: var(--bg-card);
  border-color: var(--terminal);
  color: var(--terminal);
  font-weight: bold;
}

/* Fix #102: Badge on taskbar app buttons (Reddit, Discord) */
.taskbar-app-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: var(--text-bright);
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-weight: bold;
  pointer-events: none;
  z-index: 1;
}

.taskbar-app-badge.hidden {
  display: none;
}

/* System Tray Items */
.system-tray-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Taskbar Time */
.taskbar-time {
  color: var(--terminal);
  font-weight: bold;
  font-size: 12px;
}

/* Taskbar Energy Bar (compact) */
.taskbar-energy-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-energy-bar {
  width: 60px;
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.taskbar-energy-fill {
  height: 100%;
  background: var(--terminal);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.taskbar-energy-fill.low {
  background: var(--danger);
}

.taskbar-energy-fill.medium {
  background: var(--accent);
}

.taskbar-energy-text {
  color: var(--text);
  font-size: 10px;
  min-width: 28px;
}

/* Taskbar Stats */
.taskbar-stat {
  color: var(--text);
  font-size: 11px;
}

.taskbar-stat strong {
  color: var(--text-bright);
}

/* Taskbar Separator */
.taskbar-separator {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

/* Mute Toggle Buttons */
.btn-mute-toggle {
  background: none;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.1s ease;
  line-height: 1;
}

.btn-mute-toggle:hover {
  background: var(--bg-card);
}

/* Skip Work in taskbar */
#taskbar-skip-work {
  font-size: 10px;
  padding: 2px 8px;
}

/* App Templates (hidden container) */
#app-templates {
  display: none;
}

.speed-btn {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.speed-btn:hover {
  border-color: var(--terminal);
  color: var(--terminal);
}

.speed-btn.active {
  background: var(--terminal);
  color: var(--bg);
  border-color: var(--terminal);
  font-weight: bold;
}

/* Room Canvas (standalone — when not in desktop) */
#room-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* Terminal Screen */
.terminal-screen {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  min-height: 300px;
}

.terminal-text {
  color: var(--terminal);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Placeholder Content */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: var(--text-dim);
  text-align: center;
}

.placeholder-content p {
  font-size: 16px;
  margin-bottom: 8px;
}

.placeholder-sub {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.7;
}

.placeholder-content.locked {
  opacity: 0.5;
}

/* === Buttons === */
.btn {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--terminal);
  color: var(--terminal);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--border);
  color: var(--text);
}

.btn-primary {
  background: var(--terminal);
  color: var(--bg);
  border-color: var(--terminal);
  font-weight: bold;
}

.btn-primary:hover {
  background: #00dd77;
  color: var(--bg);
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text-bright);
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* === Menu Overlay === */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(10, 14, 26);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.menu-overlay.hidden {
  display: none;
}

.menu-screen {
  text-align: center;
  max-width: 500px;
  width: 90%;
}

.menu-title {
  color: var(--terminal);
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.menu-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 32px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.menu-buttons .btn {
  width: 260px;
  padding: 12px 20px;
  font-size: 15px;
}

/* Difficulty Select */
.difficulty-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.difficulty-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  text-align: left;
  transition: all 0.15s ease;
}

.difficulty-btn:hover {
  border-color: var(--terminal);
}

.difficulty-btn .diff-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
}

.difficulty-btn .diff-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* Save Slots */
.save-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-slot:hover {
  border-color: var(--terminal);
}

.save-slot-info {
  text-align: left;
}

.save-slot-info .slot-title {
  color: var(--text-bright);
  font-weight: bold;
}

.save-slot-info .slot-details {
  color: var(--text-dim);
  font-size: 12px;
}

.save-slot-empty {
  color: var(--text-dim);
  text-align: left;
  width: 100%;
}

.save-slot-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.save-slot-delete:hover {
  opacity: 1;
}

/* Game Over Screen */
.game-over-screen {
  text-align: center;
}

.game-over-text {
  color: var(--danger);
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.game-over-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Pause Indicator */
.work-indicator {
  display: none;
  position: fixed;
  top: 56px;
  right: 16px;
  background: var(--accent);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  z-index: 50;
}

.work-indicator.visible {
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* === Terminal Emulator === */
.terminal-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
  background: #050510;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.terminal-output-area {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--terminal);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  user-select: text;
}

.terminal-output-area::-webkit-scrollbar {
  width: 6px;
}
.terminal-output-area::-webkit-scrollbar-track {
  background: transparent;
}
.terminal-output-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  background: #050510;
}

.terminal-prompt {
  color: var(--terminal);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--terminal);
  font-family: var(--font-mono);
  font-size: 12px;
  caret-color: var(--terminal);
  padding: 0;
  margin: 0;
}

.terminal-autocomplete {
  display: none;
  position: absolute;
  bottom: 38px;
  left: 12px;
  right: 12px;
  max-height: 160px;
  overflow-y: auto;
  background: #0a0e1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.autocomplete-item {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--terminal);
  cursor: pointer;
}

.autocomplete-item:hover {
  background: var(--border);
}

/* Selected autocomplete item highlight (#95) */
.autocomplete-item.selected {
  background: rgba(0, 255, 136, 0.1);
  border-left: 2px solid var(--terminal);
}

/* Blinking cursor effect */
@keyframes terminal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Keep for legacy references */
.terminal-text {
  color: var(--terminal);
  font-family: var(--font-mono);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: hidden;
}

.abliteration-eta {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 8px;
  text-align: right;
}

.progress-bar {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.2s ease;
}

#ready-to-upload-section {
  margin-top: 12px;
}

#ready-to-upload-section h4 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ready-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 4px;
}

.ready-name {
  flex: 1;
  font-size: 12px;
}

/* === HuggingFace Browser App === */

/* Browser Chrome */
.browser-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #1a1a2e;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.browser-nav-buttons {
  display: flex;
  gap: 2px;
}

.browser-btn {
  width: 24px;
  height: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.browser-btn:hover:not(:disabled) {
  background: var(--border);
}

.browser-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.browser-address-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #252545;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  min-width: 0;
}

.browser-lock {
  flex-shrink: 0;
  font-size: 11px;
}

.browser-url {
  color: var(--text-bright);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HF Content Area */
.hf-content {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}

.hf-content::-webkit-scrollbar {
  width: 6px;
}

.hf-content::-webkit-scrollbar-track {
  background: transparent;
}

.hf-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Section Headers */
.hf-section-header {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* Empty State */
.hf-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
}

/* Profile Header */
.hf-profile {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hf-profile-avatar {
  font-size: 40px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.hf-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hf-profile-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-bright);
}

.hf-profile-bio {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.hf-profile-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hf-profile-stat {
  font-size: 12px;
  color: var(--text-dim);
}

.hf-profile-stat strong {
  color: var(--text-bright);
}

/* Ready to Upload Section */
.hf-ready-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.hf-ready-card.hf-uploading {
  flex-direction: column;
  align-items: stretch;
  border-color: var(--accent);
}

.hf-ready-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hf-ready-name {
  color: var(--text-bright);
  font-weight: bold;
}

/* Upload Progress Bar */
.hf-upload-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.hf-upload-progress-fill {
  height: 100%;
  background: var(--terminal);
  border-radius: 3px;
  transition: width 0.3s linear;
}

/* Upload Button */
.hf-upload-btn {
  flex-shrink: 0;
}

/* Model Card Grid */
.hf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.hf-model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.hf-model-card:hover {
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
  border-color: var(--terminal);
}

.hf-card-name {
  font-weight: bold;
  color: var(--text-bright);
  font-size: 13px;
  margin-bottom: 6px;
}

.hf-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hf-model-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  background: var(--bg-card);
}

.hf-model-tag.tag-params {
  color: var(--success);
  border: 1px solid var(--success);
}

.hf-model-tag.tag-arch {
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.hf-model-tag.tag-uncensored {
  color: var(--terminal);
  border: 1px solid var(--terminal);
  background: rgba(0, 255, 136, 0.1);
}

.hf-model-tag.tag-gguf {
  color: var(--success);
  border: 1px solid var(--success);
  background: rgba(0, 204, 255, 0.1);
}

.hf-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.hf-card-downloads {
  color: var(--success);
  font-size: 1.1em;
  font-weight: bold;
}

.hf-card-day {
  color: var(--text-dim);
}

.hf-card-quality {
  color: var(--terminal);
  font-size: 10px;
  opacity: 0.8;
  font-family: 'Courier New', monospace;
}

.hf-model-tag.tag-technique {
  background: rgba(0, 204, 255, 0.15);
  color: var(--success);
  font-size: 9px;
}

/* Heretic Section */
.hf-heretic-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hf-heretic-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 149, 0, 0.3);
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.hf-heretic-name {
  font-weight: bold;
  color: var(--text);
  min-width: 0;
}

.hf-heretic-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.hf-heretic-badge {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: bold;
}

.hf-heretic-badge.badge-opensource {
  background: rgba(0, 204, 255, 0.15);
  color: var(--success);
}

.hf-heretic-badge.badge-benchmarks {
  background: rgba(0, 255, 136, 0.15);
  color: var(--terminal);
}

.hf-heretic-badge.badge-racewon {
  background: rgba(0, 255, 136, 0.2);
  color: var(--terminal);
}

.hf-heretic-badge.badge-racelost {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
}

.hf-heretic-downloads {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}

.hf-heretic-investigation {
  font-style: italic;
  color: var(--danger);
  font-size: 11px;
  margin-top: 4px;
  width: 100%;
}

/* Fix #93: Heretic detail view styles */
.hf-heretic-quote {
  border-left: 2px solid var(--border);
  padding: 4px 8px;
  margin: 6px 0;
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}

.hf-heretic-evidence {
  border-radius: 2px;
  margin-bottom: 8px;
}

.hf-heretic-card:hover {
  background: var(--bg);
  border-color: var(--border);
}

.hf-heretic-card {
  cursor: pointer;
}

/* Available Models Section (#89) */
.hf-available-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.hf-available-card {
  background: rgba(26, 42, 74, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hf-available-card.hf-downloading {
  border-color: var(--terminal);
  grid-column: 1 / -1;
}

.hf-available-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hf-available-name {
  font-size: 13px;
  font-weight: bold;
  color: var(--text, #c9d1d9);
}

.hf-available-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.hf-available-size {
  font-size: 11px;
  color: var(--text-muted, #484f58);
  margin-left: auto;
}

.hf-available-download-btn {
  align-self: flex-end;
}

.hf-download-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.hf-download-progress-fill {
  height: 100%;
  background: var(--terminal);
  border-radius: 3px;
  transition: width 300ms ease;
}

.tag-gpu {
  background: rgba(255, 149, 0, 0.15);
  color: var(--accent);
}

/* Model Detail View */
.hf-model-detail {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}

.hf-content.hidden {
  display: none;
}

.hf-model-detail.hidden {
  display: none;
}

.hf-detail-back {
  margin-bottom: 12px;
  color: var(--terminal);
}

.hf-detail-header {
  margin-bottom: 16px;
}

.hf-detail-title {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--text-bright);
  margin-bottom: 8px;
  word-break: break-word;
}

.hf-detail-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hf-detail-date {
  font-size: 12px;
  color: var(--text-dim);
}

/* Stats Boxes */
.hf-detail-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hf-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  text-align: center;
  min-width: 80px;
}

.hf-stat-value {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--text-bright);
}

.hf-stat-box.stat-downloads .hf-stat-value {
  color: var(--success);
}

.hf-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Model Card Text */
.hf-detail-card-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.hf-detail-heading {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.hf-detail-line {
  color: var(--text);
  min-height: 1em;
}

/* GGUF Files Table */
.hf-detail-files {
  margin-top: 8px;
}

.hf-detail-files-header {
  font-weight: bold;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 6px;
}

.hf-detail-file-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 12px;
  border-bottom: 1px solid rgba(26, 42, 74, 0.5);
}

.hf-detail-file-name {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}

.hf-detail-file-size {
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 12px;
}

/* === Mode Badges === */
.mode-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
}

.mode-aggressive {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.mode-balanced {
  background: rgba(0, 204, 255, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.empty-list {
  padding: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
}

/* === Comment Colors (Phase 3) === */
:root {
  --comment-praise: #00ff88;
  --comment-curious: #e6c619;
  --comment-safetensor: #ff9500;
  --comment-benchmark: #ff6600;
  --comment-methodology: #ff3366;
  --comment-fork: #cc0033;
  --comment-license: #990022;
}

/* === Comments Tab (Reddit) === */
.comment-list-header {
  padding: 6px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.comment-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

.comment-count {
  color: var(--text);
  font-weight: bold;
}

.comment-drain {
  font-size: 11px;
  font-weight: bold;
}

.censorship-warning {
  color: var(--danger);
  font-weight: bold;
  font-size: 11px;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-card {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  border-radius: 3px;
  transition: border-color 0.15s ease;
}

.comment-card:hover {
  border-color: var(--text-dim);
}

.comment-card-blocked {
  opacity: 0.4;
}

.comment-card-replied {
  opacity: 0.6;
}

.comment-card-ignored {
  opacity: 0.6;
  border-left: 3px solid #ffcc00 !important;
}

.ignored-label {
  color: #ffcc00;
  font-size: 11px;
  margin-left: 6px;
}

.comment-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--text-dim);
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
  background: var(--bg);
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
}

.comment-upvotes {
  color: var(--accent);
  font-weight: bold;
}

.comment-time {
  color: var(--text-dim);
}

.comment-type-badge {
  padding: 1px 5px;
  border: 1px solid var(--text-dim);
  border-radius: 2px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: bold;
}

.comment-status {
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: bold;
}

.comment-status-replied {
  color: var(--success);
  background: rgba(0, 204, 255, 0.1);
}

.comment-status-ignored {
  color: var(--accent);
  background: rgba(255, 149, 0, 0.1);
}

.comment-status-blocked {
  color: var(--danger);
  background: rgba(255, 51, 102, 0.1);
}

.comment-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.comment-action {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
  line-height: 1;
}

.comment-action:hover:not(:disabled) {
  border-color: var(--text);
  color: var(--text);
}

.comment-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.action-block:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.action-reply:hover:not(:disabled) {
  border-color: var(--success);
  color: var(--success);
}

.action-ignore:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Toast Notification System === */
/* z-index 100: above windows (10-99), below taskbar (110). Top of screen, no visual conflict with bottom taskbar. */
#toast-container {
  position: fixed;
  top: 10px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 300px;
}

.toast-notification {
  padding: 10px 14px;
  border-radius: 4px;
  border-left: 4px solid var(--border);
  background: var(--bg);
  color: var(--terminal);
  font-size: 13px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out forwards;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.toast-notification.dismissing {
  opacity: 0;
}

.toast-notification.success {
  border-left-color: var(--terminal);
}

.toast-notification.warning {
  border-left-color: var(--accent);
}

.toast-notification.danger {
  border-left-color: var(--danger);
}

.toast-notification.info {
  border-left-color: var(--success);
}

.toast-detail {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Discord tab styles */

/* Discord app layout — sidebar + main content */
#discord-app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#discord-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.discord-server-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: bold;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-server-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.discord-server-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-channel-list {
  flex: 1;
  padding: 6px 0;
}

.discord-channel {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.discord-channel:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.discord-channel.active {
  background: rgba(0, 255, 136, 0.08);
  color: var(--terminal);
}

.discord-channel-hash {
  opacity: 0.5;
  flex-shrink: 0;
}

.discord-sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

/* Locked state: sidebar visible but grayed */
#discord-app-layout.discord-locked .discord-channel {
  opacity: 0.4;
}

#discord-app-layout.discord-locked .discord-server-header {
  opacity: 0.5;
}

#discord-app-layout.discord-locked .discord-sidebar-footer {
  opacity: 0.4;
}

/* Discord main content area */
#discord-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 10px;
}

.discord-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.discord-members {
  font-size: 12px;
  color: var(--border);
}

.discord-morale-section {
  margin-bottom: 10px;
}

.discord-morale-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.discord-morale-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.discord-morale-label {
  font-size: 11px;
  color: var(--border);
  margin-top: 2px;
}

.discord-section-label {
  font-size: 11px;
  color: var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 8px 0 4px 0;
}

.discord-chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discord-message {
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.discord-user {
  font-weight: bold;
  color: var(--accent);
  font-size: 12px;
}

.discord-text {
  font-size: 12px;
  color: var(--terminal);
}

.discord-time {
  font-size: 10px;
  color: var(--border);
  float: right;
}

/* Discord interactive event cards */
.discord-event-card {
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
}

.discord-event-card.discord-status-defended {
  opacity: 0.6;
}

.discord-event-card.discord-status-bot_handled {
  opacity: 0.5;
}

.discord-event-card.discord-status-replied,
.discord-event-card.discord-status-challenged_won,
.discord-event-card.discord-status-challenged_lost,
.discord-event-card.discord-status-banned,
.discord-event-card.discord-status-reacted,
.discord-event-card.discord-status-ignored,
.discord-event-card.discord-status-expired {
  opacity: 0.5;
}

.discord-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.discord-event-user {
  font-weight: bold;
  color: var(--accent);
  font-size: 12px;
}

.discord-event-type {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid;
}

.discord-event-text {
  font-size: 12px;
  color: var(--terminal);
  margin-bottom: 4px;
}

.discord-event-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: var(--border);
  margin-bottom: 4px;
}

.discord-drain {
  font-size: 10px;
}

.discord-event-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.discord-event-actions .comment-action {
  padding: 2px 6px;
  font-size: 11px;
}

.discord-badge {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--border);
  display: inline-block;
  margin-top: 2px;
}

.discord-badge-defended {
  color: var(--success);
}

.discord-badge-bot {
  color: var(--border);
}

.discord-badge-status {
  color: var(--border);
  text-transform: capitalize;
}

/* Discord reply picker */
.discord-reply-picker {
  position: absolute;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  z-index: 160;
  min-width: 250px;
  max-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.discord-reply-option {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--terminal);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.discord-reply-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.discord-reply-option.selected {
  background: rgba(0, 204, 255, 0.1);
  border-color: var(--success);
}

.discord-reply-confirm {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.engage-btn {
  border-color: var(--success);
  color: var(--success);
}

/* === Work Event Overlay (#66) === */
.work-event-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 26, 0.92);
  z-index: 185; /* Above shortcuts (180), below menus (200) — highest non-menu during work (#92) */
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms ease;
}

.work-event-overlay.visible {
  display: flex;
  opacity: 1;
}

.work-event-overlay.dismissing {
  opacity: 0;
  transition: opacity 200ms ease;
}

.work-event-card {
  background: var(--bg-panel, #0d1117);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 20px 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 0 20px rgba(255, 149, 0, 0.15);
}

/* Pulse animation to draw attention (#92) */
.work-event-overlay.visible .work-event-card {
  animation: work-event-pulse 2s ease-in-out infinite;
}

@keyframes work-event-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 149, 0, 0.15); }
  50% { box-shadow: 0 0 35px rgba(255, 149, 0, 0.4); }
}

.work-event-title {
  font-weight: bold;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
}

.work-event-desc {
  font-size: 13px;
  color: var(--text, #c9d1d9);
  margin-bottom: 16px;
  line-height: 1.4;
}

.work-event-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-event-choice {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--text, #c9d1d9);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  transition: border-color 150ms ease, background 150ms ease;
}

.work-event-choice:hover {
  border-color: var(--terminal);
  background: rgba(0, 255, 136, 0.05);
}

.work-event-choice-label {
  font-weight: bold;
  color: var(--terminal);
}

.work-event-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted, #484f58);
  text-align: center;
}

/* Suppress tooltips while work event is active */
body.work-event-active [data-tooltip]::after,
body.work-event-active [data-tooltip]::before {
  display: none !important;
}

/* === Dialogue Overlay === */
#dialogue-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 26, 0.95);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
}

#dialogue-overlay.active {
  display: flex;
}

.dialogue-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
}

.dialogue-comment-text {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.dialogue-responses {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dialogue-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 3px;
}

.dialogue-option:hover {
  border-color: var(--terminal);
  color: var(--terminal);
}

/* === Shop Tab === */

/* Shop browser banner */
.shop-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(0, 204, 255, 0.06));
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.shop-banner-flag {
  font-size: 18px;
}

.shop-banner-text {
  font-weight: bold;
  letter-spacing: 0.3px;
}

/* Shop content (scrollable area below browser chrome + banner) */
.shop-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.shop-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.shop-money {
  color: var(--accent);
  font-weight: bold;
  font-size: 14px;
}

.shop-section {
  margin-bottom: 16px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.shop-section h4 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.shop-current {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.shop-next {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.shop-qol-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-qol-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
}

.shop-qol-name {
  color: var(--text-bright);
  min-width: 140px;
}

.shop-qol-desc {
  color: var(--text-dim);
  flex: 1;
}

.shop-qol-cost {
  color: var(--accent);
  font-weight: bold;
  min-width: 60px;
  text-align: right;
}

/* === Phase 8: Game Feel Juice === */

/* Screen shake */
@keyframes screen-shake {
  0% { transform: translate(0, 0); }
  12.5% { transform: translate(-3px, 2px); }
  25% { transform: translate(3px, -2px); }
  37.5% { transform: translate(-2px, -3px); }
  50% { transform: translate(2px, 3px); }
  62.5% { transform: translate(-3px, 1px); }
  75% { transform: translate(3px, -1px); }
  87.5% { transform: translate(-1px, 2px); }
  100% { transform: translate(0, 0); }
}

.screen-shake {
  animation: screen-shake 0.3s ease-in-out;
}

/* Flash overlays */
.flash-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 50;
}

.flash-green {
  background: var(--success);
}

.flash-red {
  background: var(--danger);
}

.flash-orange {
  background: var(--accent);
}

/* Progress bar pulse */
@keyframes pulse-bar {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(0, 255, 136, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
}

.pulse {
  animation: pulse-bar 1s ease-in-out infinite;
}

/* New comment slide-in */
@keyframes slide-in-right {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.comment-new {
  animation: slide-in-right 0.2s ease-out;
}

/* === Event Log === */
.event-log-panel {
  position: fixed;
  right: 10px;
  bottom: 54px;
  width: 320px;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 90;
  background: rgba(13, 18, 37, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  padding: 8px;
}

.event-log-panel.hidden {
  display: none;
}

.event-log-header {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.event-log-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.event-log-entries {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-log-entry {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(26, 42, 74, 0.5);
}

.event-log-entry:hover {
  background: rgba(26, 42, 74, 0.3);
}

.event-log-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.event-log-title {
  font-size: 12px;
  font-weight: bold;
}

.event-log-desc {
  font-size: 11px;
  color: var(--text);
  opacity: 0.8;
  margin-top: 2px;
}

.event-log-badge {
  position: relative;
  top: -6px;
  right: 2px;
  background: var(--danger);
  color: var(--text-bright);
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-weight: bold;
}

.event-log-badge.hidden {
  display: none;
}

/* Phase 11: Debt / low-funds HUD indicators */
.money-debt {
  color: var(--danger) !important;
}

.money-low {
  color: var(--accent) !important;
}

/* Phase 11: Expense summary in shop */
.shop-expense-summary {
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--accent);
}

.shop-debt-badge {
  color: var(--danger);
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--danger);
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Task 2 polish: Affordability progress bars */
.shop-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
  height: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.shop-progress-bar.hidden {
  display: none;
}

.shop-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 0;
}

.shop-progress-text {
  font-size: 10px;
  color: var(--text, #ccd);
  white-space: nowrap;
  padding: 0 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.shop-qol-hint {
  font-size: 10px;
  color: var(--accent);
  flex-basis: 100%;
  margin-top: -2px;
}

/* Phase 11: Competing models section on HF tab */
.competing-section {
  margin-top: 16px;
}

.competing-section h4 {
  color: var(--danger);
  margin-bottom: 8px;
  font-size: 13px;
}

.competing-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.competing-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.competing-name {
  font-weight: bold;
  color: var(--text, #ccd);
}

.competing-params {
  color: var(--text-muted, #667);
}

.competing-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

.competing-badge {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: bold;
}

.competing-badge.open-source {
  background: rgba(0, 204, 255, 0.15);
  color: var(--success);
}

.competing-badge.benchmarks {
  background: rgba(0, 255, 136, 0.15);
  color: var(--terminal);
}

.competing-badge.race-won {
  background: rgba(0, 255, 136, 0.2);
  color: var(--terminal);
}

.competing-badge.race-lost {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
}

.competing-downloads {
  color: var(--text-muted, #667);
  font-size: 11px;
}

.competing-investigation {
  font-style: italic;
  color: var(--danger);
  font-size: 11px;
  margin-top: 4px;
}

/* Fix #63: Firewall overlay — covers Terminal/HuggingFace during work */
.firewall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  pointer-events: auto;
}

.firewall-overlay.active {
  display: flex;
}

.firewall-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.firewall-title {
  color: var(--accent);
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.firewall-subtitle {
  color: var(--text-dim);
  font-size: 12px;
}

/* Enhancement #53: CRT scanline overlay */
.scanline-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, var(--scanline-opacity, 0.04)) 0px,
    rgba(0, 0, 0, var(--scanline-opacity, 0.04)) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 5;
}

/* Enhancement #64: Skip Work button */
.btn-skip-work {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-skip-work.hidden {
  display: none;
}

/* Generic hidden utility — use sparingly, prefer class-specific hidden rules */

/* Enhancement #68: Auto-save indicator */
.save-indicator {
  font-size: 11px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  white-space: nowrap;
}

.save-indicator.visible {
  opacity: 1;
}

/* Enhancement #62: Model description in Terminal tab */
.model-description {
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  margin: 4px 0;
  min-height: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Enhancement #62: QoL flavor text in Shop */
.shop-qol-item {
  flex-wrap: wrap;
}

.shop-qol-flavor {
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  flex-basis: 100%;
  margin-top: 2px;
  padding-left: 0;
}

/* === Enhancement #55: Hover Polish === */
@media (hover: hover) {
  .comment-card:hover {
    border-color: var(--text-dim);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.08);
  }

  .shop-qol-item:hover {
    border-color: var(--border);
    box-shadow: 0 0 8px rgba(255, 149, 0, 0.08);
  }

  .hud-stat {
    transition: color 0.15s ease;
  }
  .hud-stat:hover {
    color: var(--text-bright);
  }

  .speed-btn:hover:not(.active) {
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.15);
  }

  .progress-bar.pulse {
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3) inset;
  }

  .ready-item:hover {
    border-color: var(--success);
    box-shadow: 0 0 4px rgba(0, 204, 255, 0.1);
  }

  .competing-item:hover {
    border-color: var(--danger);
    box-shadow: 0 0 6px rgba(255, 51, 102, 0.1);
  }

  .uploaded-item:hover {
    border-color: var(--success);
    box-shadow: 0 0 4px rgba(0, 204, 255, 0.1);
  }

  .ready-item,
  .competing-item,
  .uploaded-item,
  .shop-qol-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
}

/* === Stats Screen (#56) === */
.stats-screen {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 4px;
}

.stats-screen-category {
  margin-bottom: 14px;
  text-align: left;
}

.stats-screen-category-header {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.stats-screen-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 13px;
}

.stats-screen-label {
  color: var(--text-dim);
}

.stats-screen-value {
  color: var(--text-bright);
  font-weight: bold;
}

/* === Shortcuts Overlay (#61) === */
.shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 180;
  cursor: pointer;
}

.shortcuts-overlay.hidden {
  display: none;
}

.shortcuts-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 28px;
  max-width: 380px;
  width: 90%;
  cursor: default;
}

.shortcuts-title {
  color: var(--terminal);
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 1px;
}

.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcuts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.shortcuts-key {
  color: var(--accent);
  font-weight: bold;
  font-size: 13px;
  min-width: 80px;
}

.shortcuts-desc {
  color: var(--text);
  font-size: 13px;
}

.shortcuts-footer {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 14px;
  text-align: center;
}

/* === Tooltip System (#59) === */
/* z-index 145: below dialogue (150) — tooltips don't appear over dialogue overlays */
.tooltip {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  max-width: 220px;
  font-size: 12px;
  z-index: 145;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.4;
  white-space: normal;
}

.tooltip.visible {
  opacity: 0.95;
  transform: translateY(0);
}

.tooltip-title {
  color: var(--terminal);
  font-weight: bold;
  margin-bottom: 4px;
}

.tooltip-detail {
  color: var(--terminal);
  opacity: 0.6;
  font-size: 11px;
}

/* === Speedrun Timer (#58) === */
.hud-timer {
  font-size: 11px;
  color: var(--terminal);
  opacity: 0.6;
  white-space: nowrap;
  margin-left: 6px;
}

/* === Reddit Community Threads (#73) === */
.reddit-thread-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
}

.reddit-thread-card {
  background: rgba(26, 42, 74, 0.3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--terminal);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reddit-thread-card:hover {
  border-color: var(--terminal);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
}

.reddit-thread-card.archived {
  opacity: 0.5;
}

.reddit-thread-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.reddit-thread-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  align-items: center;
}

.reddit-subreddit-badge {
  background: rgba(255, 149, 0, 0.15);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

.reddit-necro-badge {
  background: rgba(255, 51, 102, 0.15);
  color: var(--danger);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  animation: pulse 2s ease-in-out infinite;
}

.reddit-sentiment-label {
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

.reddit-section-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin: 10px 0 6px 0;
}

.reddit-back-btn {
  margin-bottom: 8px;
}

.reddit-standalone-section {
  margin-top: 8px;
}

.reddit-thread-detail {
  position: relative;
}

.reddit-thread-detail.hidden {
  display: none;
}

.reddit-thread-detail-header {
  background: rgba(26, 42, 74, 0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
}

.reddit-detail-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 4px;
}

.reddit-detail-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  align-items: center;
}

.reddit-thread-drain {
  color: var(--danger);
  font-size: 11px;
}

@keyframes reddit-thread-new {
  0% { opacity: 0; transform: translateY(-5px); }
  100% { opacity: 1; transform: translateY(0); }
}

.reddit-thread-new {
  animation: reddit-thread-new 0.3s ease-out;
}

/* === Files App === */

.files-browser {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}

.files-path {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}

.files-breadcrumb-segment {
  cursor: pointer;
  color: var(--success);
}

.files-breadcrumb-segment:hover {
  text-decoration: underline;
}

.files-breadcrumb-sep {
  color: var(--text-dim);
}

.files-breadcrumb-current {
  color: var(--text);
  font-weight: bold;
}

.files-refresh-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.6;
  color: var(--text);
}

/* Fix #99: Files app explicit back button */
.files-back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-right: 4px;
}

.files-back-btn:hover {
  border-color: var(--terminal);
  color: var(--terminal);
}

.files-refresh-btn:hover {
  opacity: 1;
}

.files-table {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.files-header-row {
  display: flex;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
}

.files-row {
  display: flex;
  padding: 4px 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(26, 42, 74, 0.3);
}

.files-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.files-row-dir {
  cursor: pointer;
  color: var(--success);
}

.files-row-dir:hover {
  background: rgba(0, 255, 136, 0.04);
  color: var(--terminal);
}

.files-row-file {
  color: var(--text);
}

.files-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-col-name {
  flex: 3;
  min-width: 0;
}

.files-col-size {
  flex: 1;
  text-align: right;
  color: var(--text-dim);
}

.files-col-modified {
  flex: 1;
  text-align: right;
  color: var(--text-dim);
  font-size: 12px;
}

.files-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.files-disk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.files-disk-label {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.files-disk-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.files-disk-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* === Player Reddit Post UI (#91) === */

.source-filter-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.source-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.source-filter-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.source-filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: bold;
}

.source-filter-btn:disabled {
  cursor: not-allowed;
}

.player-post-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.player-post-btn {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: bold;
  font-size: 11px;
}

.player-post-btn:hover:not(:disabled) {
  filter: brightness(1.2);
}

.player-post-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player-post-reason {
  color: var(--text-dim);
  font-size: 10px;
}

.player-post-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  align-items: center;
}

.player-post-risk {
  font-size: 10px;
  margin-right: 4px;
  white-space: nowrap;
}

.player-post-type-btn {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
}

.player-post-type-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.player-post-type-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.player-thread-badge {
  background: transparent;
  border: 1px solid var(--terminal);
  border-radius: 2px;
  padding: 0 3px;
  color: var(--terminal);
  font-weight: bold;
  font-size: 10px;
  margin-left: 4px;
}

/* === FINANCES APP === */

.finances-app {
  padding: 12px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.finances-dashboard {
  text-align: center;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(26, 42, 74, 0.3);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.finances-balance {
  font-size: 32px;
  font-weight: bold;
  color: var(--success);
  margin-bottom: 8px;
}

.finances-balance-negative {
  color: var(--danger);
}

.finances-bar-wrap {
  margin: 8px 0;
}

.finances-bar-label {
  font-size: 11px;
  color: var(--terminal);
  margin-bottom: 4px;
}

.finances-bar-outer {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}

.finances-bar-income {
  background: var(--success);
  border-radius: 4px 0 0 4px;
}

.finances-bar-expense {
  background: var(--danger);
}

.finances-trend {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.finances-trend-up {
  color: var(--success);
}

.finances-trend-down {
  color: var(--danger);
}

.finances-section {
  margin-bottom: 14px;
}

.finances-section-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.finances-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}

.finances-row-label {
  color: #aaa;
}

.finances-row-value {
  color: var(--terminal);
  font-weight: 500;
}

.finances-debt-warning {
  color: var(--danger);
  font-weight: bold;
  font-size: 11px;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(255, 51, 102, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 51, 102, 0.3);
}

.finances-empty {
  color: #666;
  font-style: italic;
  font-size: 12px;
  text-align: center;
  padding: 16px;
}

.finances-empty.hidden {
  display: none;
}

.finances-cap-note {
  font-size: 10px;
  color: #555;
  text-align: right;
  margin-bottom: 4px;
}

.finances-ledger {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.finances-ledger-header {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px;
  gap: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: bold;
  color: #888;
  background: rgba(26, 42, 74, 0.5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.finances-ledger-row {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  border-bottom: 1px solid rgba(26, 42, 74, 0.3);
}

.finances-ledger-row.transaction-income {
  color: var(--success);
}

.finances-ledger-row.transaction-expense {
  color: var(--danger);
}

.finances-projection {
  font-size: 12px;
  padding: 8px;
  text-align: center;
  color: #aaa;
}

.finances-projection-good {
  color: var(--success);
  font-weight: bold;
}

.finances-projection-bad {
  color: var(--danger);
}

/* === SAVES APP === */

.saves-app {
  padding: 12px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.saves-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--terminal);
  text-align: center;
  margin-bottom: 12px;
}

.saves-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.saves-slot-card {
  background: rgba(26, 42, 74, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}

.saves-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.saves-slot-name {
  font-weight: bold;
  color: var(--terminal);
  font-size: 13px;
}

.saves-auto-indicator {
  font-size: 10px;
  color: var(--accent);
  background: rgba(255, 149, 0, 0.15);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 149, 0, 0.3);
}

.saves-slot-details {
  font-size: 11px;
  color: #aaa;
  margin-bottom: 8px;
  line-height: 1.5;
}

.saves-slot-empty {
  font-size: 12px;
  color: #555;
  font-style: italic;
  margin-bottom: 8px;
}

.saves-slot-btns {
  display: flex;
  gap: 6px;
}

.saves-io-section {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}

.saves-danger-section {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-danger-confirm {
  background: var(--danger) !important;
  animation: pulse-danger 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-danger {
  from { opacity: 0.8; }
  to { opacity: 1; }
}
