/* Plua Agent UI — Pixel Art 2.5D Animated Workspace */
/* Terraria-inspired aesthetic: dark charcoal, warm amber, teal accents */

/* ============================================
   CSS VARIABLES — PIXEL ART PALETTE
   ============================================ */
:root {
  /* Core palette */
  --void: #1a1a2e;
  --surface: #16213e;
  --surface-2: #0f3460;
  --surface-3: #1a1a2e;
  --border: rgba(244, 162, 97, 0.25);
  --border-hover: rgba(244, 162, 97, 0.6);

  /* Accent colors */
  --amber: #f4a261;
  --amber-dark: #e76f51;
  --teal: #2a9d8f;
  --teal-dark: #264653;
  --cyan: #00e5ff;
  --gold: #ffd700;
  --purple: #9b5de5;

  /* Text */
  --text: #e8e4d9;
  --text-muted: #a89968;
  --text-dim: #5a5a5a;

  /* Badges */
  --free: #34d399;
  --premium: #a78bfa;
  --byok: #60a5fa;
  --error: #f87171;

  /* Pixel art specific */
  --pixel-size: 4px;
  --tile-size: 32px;
  --grid-unit: 8px;
}

/* ============================================
   RESET + BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  overflow: hidden;
  height: 100vh;
  font-size: 14px;
}

/* ============================================
   PIXEL ART HELPERS
   ============================================ */
.pixel-border {
  box-shadow:
    inset calc(var(--pixel-size) * -1) calc(var(--pixel-size) * -1) 0 0 rgba(0,0,0,0.4),
    inset var(--pixel-size) var(--pixel-size) 0 0 rgba(255,255,255,0.1);
}

.pixel-shadow {
  box-shadow:
    calc(var(--pixel-size) * 2) calc(var(--pixel-size) * 2) 0 0 rgba(0,0,0,0.5);
}

.pixel-inset {
  box-shadow:
    inset var(--pixel-size) var(--pixel-size) 0 0 rgba(0,0,0,0.4),
    inset calc(var(--pixel-size) * -1) calc(var(--pixel-size) * -1) 0 0 rgba(255,255,255,0.05);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  padding: 0 20px;
  background: var(--teal-dark);
  border-bottom: var(--pixel-size) solid var(--amber);
  display: flex;
  align-items: center;
  box-shadow: 0 var(--pixel-size) 0 rgba(0,0,0,0.3);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  font-size: 20px;
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber);
  animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { text-shadow: 0 0 4px var(--amber); }
  to { text-shadow: 0 0 16px var(--amber), 0 0 24px rgba(244,162,97,0.5); }
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Space Grotesk', monospace;
}

.header-nav {
  display: flex;
  gap: 16px;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.15s;
  padding: 4px 8px;
  border: 2px solid transparent;
}

.header-nav a:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* MODEL BADGE */
.model-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 3px solid;
  font-family: monospace;
  text-transform: uppercase;
}

.free-badge {
  color: var(--free);
  border-color: var(--free);
  background: rgba(52, 211, 153, 0.1);
  box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.2);
}

.premium-badge {
  color: var(--premium);
  border-color: var(--premium);
  background: rgba(167, 139, 250, 0.1);
  box-shadow: inset 0 0 0 2px rgba(167, 139, 250, 0.2);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  height: calc(100vh - 52px);
  margin-top: 52px;
  overflow: hidden;
  position: relative;
}

/* ============================================
   ISOMETRIC WORKSPACE BACKGROUND
   ============================================ */
.workspace-bg {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, #0d1b2a 0%, #1a1a2e 40%, #16213e 100%);
  overflow: hidden;
}

/* Grid lines */
.workspace-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244,162,97,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,162,97,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: perspective(600px) rotateX(45deg);
  transform-origin: center bottom;
  top: 20%;
  opacity: 0.5;
}

/* Floor tiles - isometric grid */
.isometric-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: var(--surface);
  border-top: 4px solid var(--teal);
}

/* ============================================
   AGENT CHARACTER
   ============================================ */
.agent-character {
  position: absolute;
  width: 48px;
  height: 64px;
  z-index: 50;
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
              bottom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  filter: drop-shadow(2px 4px 0 rgba(0,0,0,0.5));
}

.agent-sprite {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Agent body - pixel art style */
.agent-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 36px;
  background: var(--teal);
  border: 3px solid #1a5c52;
  border-radius: 2px;
  animation: agentIdle 1s steps(2) infinite;
}

.agent-head {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: #f4a261;
  border: 3px solid #c27839;
  border-radius: 50%;
  animation: agentHeadBob 1.2s steps(2) infinite;
}

.agent-eyes {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 4px;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.agent-eye {
  width: 3px;
  height: 4px;
  background: #1a1a2e;
  border-radius: 0;
  animation: agentBlink 3s steps(1) infinite;
}

@keyframes agentIdle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-2px); }
}

@keyframes agentHeadBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-1px); }
}

@keyframes agentBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

/* Agent states */
.agent-character.walking .agent-body {
  animation: agentWalk 0.4s steps(4) infinite;
}

@keyframes agentWalk {
  0% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  25% { transform: translateX(-50%) translateY(-3px) rotate(-3deg); }
  50% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  75% { transform: translateX(-50%) translateY(-3px) rotate(3deg); }
  100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
}

.agent-character.working .agent-body {
  animation: agentWork 0.6s steps(2) infinite;
}

@keyframes agentWork {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* Speech bubble */
.speech-bubble {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: var(--void);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-family: monospace;
  border: 3px solid var(--amber-dark);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  animation: bubblePop 0.2s ease-out;
  z-index: 60;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--amber-dark);
  border-bottom: none;
}

@keyframes bubblePop {
  from { transform: translateX(-50%) scale(0); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ============================================
   STATION ZONES
   ============================================ */
.station-zone {
  position: absolute;
  z-index: 10;
  cursor: pointer;
  transition: transform 0.2s;
}

.station-zone:hover {
  transform: scale(1.02);
}

.station-desk {
  bottom: 20%;
  left: 12%;
  width: 100px;
}

.station-terminal {
  bottom: 20%;
  left: 35%;
  width: 100px;
}

.station-art {
  bottom: 20%;
  left: 52%;
  width: 100px;
}

.station-browser {
  bottom: 20%;
  left: 68%;
  width: 100px;
}

/* Station furniture - pixel art blocks */
.station-furniture {
  position: relative;
  height: 60px;
}

.desk-block {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 24px;
  background: #8b5a2b;
  border: 3px solid #5c3d1e;
  border-radius: 2px;
}

.screen-block {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 32px;
  background: #1a1a2e;
  border: 3px solid #2a9d8f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screen-block.active {
  background: #0f3460;
  box-shadow: 0 0 12px rgba(42,157,143,0.5);
  animation: screenFlicker 0.1s steps(1) infinite;
}

@keyframes screenFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}

.screen-text {
  font-size: 6px;
  color: var(--teal);
  font-family: monospace;
  animation: screenScroll 2s linear infinite;
}

@keyframes screenScroll {
  from { transform: translateY(100%); }
  to { transform: translateY(-100%); }
}

.station-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: monospace;
  white-space: nowrap;
}

.station-zone.active .station-label {
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber);
}

/* ============================================
   SIDEBAR — PIXEL ART PANELS
   ============================================ */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 4px solid var(--amber);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 20;
  box-shadow: 4px 0 0 rgba(0,0,0,0.3);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 4px solid var(--amber);
  padding: 4px;
  gap: 2px;
  background: var(--teal-dark);
}

.sidebar-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  font-family: monospace;
}

.sidebar-tab:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(244,162,97,0.3);
}

.sidebar-tab.active {
  background: var(--surface-2);
  color: var(--amber);
  border-color: var(--amber);
}

.sidebar-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Sidebar panels */
.sidebar-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.sidebar-panel.active {
  display: flex;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--amber);
  border-bottom: 2px solid rgba(244,162,97,0.2);
  font-family: monospace;
}

.panel-desc {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 12px 8px;
  line-height: 1.5;
}

/* Memory list */
.memory-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.memory-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(244,162,97,0.08);
  transition: background 0.15s;
}

.memory-item:hover {
  background: rgba(244,162,97,0.05);
}

.memory-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.memory-val {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* History list */
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(244,162,97,0.08);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 4px solid transparent;
}

.history-item:hover {
  background: rgba(244,162,97,0.08);
  border-left-color: var(--amber);
}

.history-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.history-model {
  color: var(--teal);
  font-family: monospace;
  font-weight: 700;
}

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

/* Keys list */
.keys-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(244,162,97,0.08);
}

.key-provider {
  font-size: 12px;
  font-weight: 700;
  color: var(--byok);
  text-transform: uppercase;
  font-family: monospace;
}

.key-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 2px;
  transition: all 0.15s;
  font-family: monospace;
  font-size: 10px;
}

.key-delete:hover {
  color: var(--error);
  border-color: var(--error);
}

.key-empty {
  font-size: 11px;
  color: var(--text-dim);
  padding: 16px 12px;
  text-align: center;
  font-family: monospace;
}

/* ============================================
   SIDEBAR BUTTONS
   ============================================ */
.btn-new-session {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(244,162,97,0.15);
  border: 3px solid var(--amber);
  color: var(--amber);
  border-radius: 2px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.btn-new-session:hover {
  background: var(--amber);
  color: var(--void);
  box-shadow: none;
}

.btn-icon {
  background: none;
  border: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(244,162,97,0.1);
}

.sidebar-toggle {
  display: none;
}

/* ============================================
   CHAT AREA
   ============================================ */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 20;
}

/* Model bar */
.model-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 4px solid var(--teal);
  background: var(--surface);
  min-height: 44px;
  flex-shrink: 0;
}

.model-select {
  background: var(--surface-2);
  border: 3px solid var(--amber);
  color: var(--text);
  border-radius: 2px;
  padding: 6px 12px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.model-select:hover, .model-select:focus {
  border-color: var(--amber-dark);
  box-shadow: 0 0 8px rgba(244,162,97,0.3);
}

.model-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: monospace;
}

.byok-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--byok);
  background: rgba(96,165,250,0.15);
  border: 3px solid var(--byok);
  border-radius: 2px;
  padding: 3px 8px;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Messages container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Welcome state */
.welcome-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
}

.welcome-icon {
  font-size: 56px;
  color: var(--amber);
  text-shadow: 0 0 20px var(--amber), 0 0 40px rgba(244,162,97,0.4);
  animation: logoGlow 2s ease-in-out infinite alternate;
}

.welcome-state h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.welcome-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.chip {
  background: var(--surface-2);
  border: 3px solid var(--border);
  color: var(--text-muted);
  border-radius: 2px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.chip:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(244,162,97,0.1);
  box-shadow: none;
}

/* Message bubbles */
.message {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  animation: msgIn 0.2s steps(2) out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user { align-items: flex-end; }
.message-agent { align-items: flex-start; }

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 3px solid;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.msg-avatar.user-avatar {
  background: var(--surface-3);
  color: var(--amber);
  border-color: var(--amber-dark);
}

.msg-avatar.agent-avatar {
  background: var(--teal-dark);
  color: var(--teal);
  border-color: var(--teal);
}

.msg-meta { display: flex; align-items: center; gap: 8px; }

.msg-model-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: monospace;
  border: 2px solid;
}

.msg-model-tag.free { color: var(--free); border-color: var(--free); }
.msg-model-tag.premium { color: var(--premium); border-color: var(--premium); }
.msg-model-tag.byok { color: var(--byok); border-color: var(--byok); }

.msg-content {
  max-width: 680px;
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  border: 3px solid;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

.message-user .msg-content {
  background: var(--surface-2);
  border-color: var(--amber-dark);
  color: var(--text);
  border-radius: 2px 8px 2px 2px;
}

.message-agent .msg-content {
  background: var(--surface);
  border-color: var(--teal-dark);
  color: var(--text);
  border-radius: 8px 2px 2px 2px;
}

/* Code blocks */
.code-block {
  background: #0d0d1a;
  border: 3px solid var(--teal-dark);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 3px solid var(--teal-dark);
}

.code-lang {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: monospace;
}

.code-copy {
  background: none;
  border: 2px solid var(--text-dim);
  color: var(--text-dim);
  font-size: 10px;
  font-family: monospace;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 2px;
  transition: all 0.15s;
}

.code-copy:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.code-block pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

.code-block code { background: none; padding: 0; border-radius: 0; }

/* Inline code */
code:not(.code-block code) {
  background: var(--surface-3);
  border: 2px solid var(--teal-dark);
  color: var(--teal);
  border-radius: 2px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Images in chat */
.msg-image {
  max-width: 400px;
  border-radius: 2px;
  border: 3px solid var(--teal);
  display: block;
  margin: 8px 0;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

/* Tool activity */
.tool-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 3px solid var(--teal);
  font-family: monospace;
}

.tool-dot {
  width: 8px;
  height: 8px;
  background: var(--amber);
  animation: toolPulse 0.8s steps(2) infinite;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--amber);
}

@keyframes toolPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   INPUT AREA
   ============================================ */
.input-area {
  border-top: 4px solid var(--teal);
  background: var(--surface);
  padding: 10px 16px 12px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 -4px 0 rgba(0,0,0,0.2);
}

.file-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(244,162,97,0.08);
  border: 3px dashed var(--amber);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: -10px -16px;
}

.file-drop-content { text-align: center; }

.file-drop-content p {
  font-size: 14px;
  color: var(--amber);
  font-weight: 700;
  margin-top: 8px;
  font-family: monospace;
}

.file-drop-content span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.attached-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.attached-file {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.attached-file-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}

.attached-file-remove:hover { color: var(--error); }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface-2);
  border: 4px solid var(--teal-dark);
  border-radius: 2px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.input-row:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(42,157,143,0.3);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  overflow-y: auto;
  padding: 4px 0;
}

.chat-input::placeholder { color: var(--text-dim); font-family: monospace; }
.chat-input:disabled { opacity: 0.5; cursor: not-allowed; }

.input-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.btn-mic, .btn-attach, .btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 2px;
  border: 3px solid;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.btn-mic {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}

.btn-mic:hover {
  color: var(--text);
  border-color: var(--teal);
  background: rgba(42,157,143,0.1);
}

.btn-mic.recording {
  color: var(--error);
  border-color: var(--error);
  background: rgba(248,113,113,0.1);
  animation: micPulse 1s steps(2) infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
}

.btn-attach {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}

.btn-attach:hover {
  color: var(--text);
  border-color: var(--teal);
  background: rgba(42,157,143,0.1);
}

.btn-send {
  background: var(--teal);
  color: var(--void);
  border-color: var(--teal);
}

.btn-send:hover {
  background: var(--amber);
  border-color: var(--amber);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(244,162,97,0.4);
}

.btn-send:disabled {
  background: var(--surface-3);
  color: var(--text-dim);
  border-color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
  min-height: 16px;
}

.char-count { font-size: 10px; color: var(--text-dim); font-family: monospace; }
.voice-status { font-size: 10px; color: var(--text-muted); font-family: monospace; }
.hidden { display: none !important; }

/* ============================================
   RIGHT PANEL
   ============================================ */
.right-panel {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-left: 4px solid var(--amber);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 20;
  box-shadow: -4px 0 0 rgba(0,0,0,0.3);
}

.activity-feed { flex: 1; overflow-y: auto; padding: 8px 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 2px solid rgba(244,162,97,0.05);
  font-family: monospace;
  line-height: 1.4;
}

.activity-dot {
  width: 6px;
  height: 6px;
  background: var(--teal);
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 4px var(--teal);
}

.activity-text { line-height: 1.4; }

/* Share link row */
.share-link-row { display: flex; gap: 8px; margin-top: 12px; }

.share-link-input {
  flex: 1;
  background: var(--surface-2);
  border: 3px solid var(--teal-dark);
  color: var(--text);
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.btn-copy {
  background: rgba(244,162,97,0.15);
  border: 3px solid var(--amber);
  color: var(--amber);
  border-radius: 2px;
  padding: 8px 14px;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.btn-copy:hover {
  background: var(--amber);
  color: var(--void);
  box-shadow: none;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,26,46,0.85);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 4px solid var(--amber);
  border-radius: 2px;
  padding: 24px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.5);
}

.modal-sm { width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 3px solid rgba(244,162,97,0.2);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: monospace;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  background: var(--surface-2);
  border: 3px solid var(--border);
  color: var(--text);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 8px rgba(244,162,97,0.2);
}

.modal-body textarea { resize: vertical; min-height: 72px; }

.key-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: -4px;
  font-family: monospace;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  border-top: 3px solid rgba(244,162,97,0.2);
  padding-top: 16px;
}

/* Buttons */
.btn-ghost {
  background: transparent;
  border: 3px solid var(--border);
  color: var(--text-muted);
  border-radius: 2px;
  padding: 8px 16px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(244,162,97,0.08);
  box-shadow: none;
}

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

.btn-primary {
  background: var(--amber);
  border: 3px solid var(--amber-dark);
  color: var(--void);
  border-radius: 2px;
  padding: 8px 16px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.btn-primary:hover {
  background: var(--amber-dark);
  box-shadow: none;
  transform: translateY(1px);
}

/* ============================================
   REPLAY OVERLAY
   ============================================ */
.replay-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--void);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.replay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 4px solid var(--amber);
  background: var(--surface);
}

.replay-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* ============================================
   ACTION BUTTONS ON MESSAGES
   ============================================ */
.msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}

.message:hover .msg-actions { opacity: 1; }

.msg-action-btn {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-dim);
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 10px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msg-action-btn:hover {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(244,162,97,0.08);
}

/* Share button (glowing pixel envelope) */
.share-btn {
  border-color: var(--teal);
  color: var(--teal);
}

.share-btn:hover {
  color: var(--void);
  border-color: var(--teal);
  background: var(--teal);
}

/* ============================================
   BUDGET METER
   ============================================ */
.budget-meter {
  padding: 8px 12px;
  border-bottom: 2px solid rgba(244,162,97,0.2);
}

.budget-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: monospace;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.budget-bar {
  height: 8px;
  background: var(--surface-3);
  border: 2px solid var(--teal-dark);
  border-radius: 2px;
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.5s ease-out;
  animation: budgetPulse 2s steps(1) infinite;
}

@keyframes budgetPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ============================================
   TASK QUEUE PANEL
   ============================================ */
.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.queue-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(244,162,97,0.08);
  border-left: 4px solid transparent;
}

.queue-item.active {
  border-left-color: var(--amber);
  background: rgba(244,162,97,0.05);
}

.queue-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-family: monospace;
  color: var(--text-dim);
}

.queue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 4px var(--amber);
  animation: toolPulse 1s steps(2) infinite;
}

.queue-progress {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.3s;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-3); }
::-webkit-scrollbar-thumb { background: var(--teal-dark); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: var(--surface-2);
  border-radius: 2px;
  animation: pixelShimmer 0.8s steps(3) infinite;
  background-image: linear-gradient(90deg,
    var(--surface) 0%,
    var(--surface-2) 50%,
    var(--surface) 100%);
  background-size: 200% 100%;
}

@keyframes pixelShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 0;
  animation: typingBounce 0.6s steps(1) infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  font-size: 12px;
  color: var(--text-dim);
  padding: 20px 12px;
  text-align: center;
  line-height: 1.5;
  font-family: monospace;
}

/* ============================================
   RESPONSIVE — MOBILE (2D simplified)
   ============================================ */
@media (max-width: 768px) {
  .workspace-bg { display: none; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 52px;
    bottom: 0;
    z-index: 90;
    transform: translateX(-100%);
    width: 300px;
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 12px;
    bottom: 80px;
    z-index: 80;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 4px solid var(--amber);
    border-radius: 2px;
    color: var(--amber);
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
    font-size: 20px;
  }

  .right-panel { display: none; }
  .model-hint { display: none; }
  .messages-container { padding: 12px; }

  /* Mobile: flat 2D agent character */
  .agent-character { display: none; }

  /* Mobile bottom sheet */
  .mobile-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 4px solid var(--amber);
    border-radius: 8px 8px 0 0;
    z-index: 85;
    padding: 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .mobile-sheet.open { transform: translateY(0); }
}

/* ============================================
   SHARE PAGE (/share/[token])
   ============================================ */
.share-page {
  min-height: 100vh;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.share-header {
  text-align: center;
  margin-bottom: 40px;
}

.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(244,162,97,0.1);
  border: 3px solid var(--amber);
  border-radius: 2px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.share-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.share-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-family: monospace;
}

.share-task {
  max-width: 720px;
  width: 100%;
  background: var(--surface);
  border: 4px solid var(--teal-dark);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.share-task-header {
  background: var(--surface-2);
  border-bottom: 4px solid var(--teal);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-task-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: monospace;
}

.share-task-model {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  font-family: monospace;
  border: 2px solid;
}

.share-task-input {
  padding: 16px 20px;
  border-bottom: 3px solid var(--surface-2);
  font-size: 14px;
  color: var(--text-muted);
  font-family: monospace;
}

.share-task-output {
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.share-tools {
  padding: 12px 20px;
  border-top: 3px solid var(--surface-2);
  font-size: 11px;
  color: var(--text-dim);
  font-family: monospace;
}

.share-cta {
  max-width: 480px;
  text-align: center;
  background: var(--surface);
  border: 4px solid var(--amber);
  border-radius: 2px;
  padding: 32px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.share-cta h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.share-cta p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.share-cta-btn {
  display: inline-block;
  background: var(--amber);
  color: var(--void);
  border: none;
  border-radius: 2px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  transition: all 0.15s;
}

.share-cta-btn:hover {
  background: var(--amber-dark);
  box-shadow: none;
  transform: translateY(2px);
}

/* ============================================
   PAYMENT UI — BUDGET METER + UPGRADE BUTTON
   ============================================ */
.budget-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(42, 157, 143, 0.15);
  border: 2px solid var(--teal);
  font-size: 11px;
  font-family: monospace;
}
.budget-label { color: var(--text-muted); }
.budget-amount { color: var(--teal); font-weight: 700; }

.btn-upgrade {
  padding: 6px 14px;
  background: var(--amber);
  color: var(--void);
  border: none;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
}
.btn-upgrade:hover {
  background: var(--amber-dark);
  box-shadow: none;
  transform: translateY(2px);
}

.btn-auth {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 2px solid rgba(255,255,255,0.15);
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-auth:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* BYOK badge */
.byok-badge {
  color: var(--byok);
  border-color: var(--byok);
  background: rgba(96, 165, 250, 0.1);
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* TOPUP MODAL AMOUNTS */
.topup-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.topup-amt {
  padding: 10px;
  background: var(--surface);
  border: 3px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s;
}
.topup-amt:hover, .topup-amt.selected {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(244,162,97,0.1);
}
.topup-custom { margin-top: 12px; }
.topup-custom label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.topup-custom input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 3px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-family: monospace;
}
.topup-custom input:focus { outline: none; border-color: var(--amber); }

/* AUTH MODAL */
.auth-error {
  background: rgba(248,113,113,0.15);
  border: 2px solid var(--error);
  color: var(--error);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  border-radius: 2px;
}

/* TOAST NOTIFICATIONS */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 9999;
  padding: 12px 24px;
  font-size: 13px;
  font-family: monospace;
  font-weight: 600;
  border: 3px solid;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  pointer-events: none;
}
.toast-visible { transform: translateX(-50%) translateY(0); }
.toast-success { background: rgba(52,211,153,0.15); border-color: var(--free); color: var(--free); }
.toast-error { background: rgba(248,113,113,0.15); border-color: var(--error); color: var(--error); }
.toast-warning { background: rgba(244,162,97,0.15); border-color: var(--amber); color: var(--amber); }
.toast-info { background: rgba(42,157,143,0.15); border-color: var(--teal); color: var(--teal); }

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .workspace-bg { display: none; }
  .right-panel { display: none !important; }
  .app-layout { height: calc(100vh - 52px); }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 52px;
    bottom: 0;
    z-index: 200;
    transition: left 0.25s ease;
    width: 260px;
  }
  .sidebar.open { left: 0; }
  .chat-area { width: 100%; }
  .budget-meter { display: none !important; }
  .header-actions { gap: 6px; }
  .btn-auth { padding: 4px 8px; font-size: 10px; }
  .model-badge { font-size: 9px; padding: 3px 7px; }

  /* Touch-friendly inputs */
  .chat-input { font-size: 16px; } /* prevent zoom on iOS */
  .btn-send, .btn-mic, .btn-attach {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  .topup-amounts { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) and (max-width: 1279px) {
  .workspace-bg { display: none; }
  .right-panel { display: none !important; }
  .sidebar { width: 220px; }
}