:root {
  --text-scale: 1;
  --bg-base: #090d16;
  --bg-surface: #111827;
  --bg-surface-hover: #1f2937;
  --bg-panel: #0d131f;
  --border-color: #1e293b;
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --code-bg: #030712;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body.private-console {
  --accent-primary: #ec4899;
  --accent-hover: #db2777;
  --border-focus: #ec4899;
}

.private-badge {
  display: inline-block;
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #f472b6;
  font-size: calc(10px * var(--text-scale));
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  font-size: calc(16px * var(--text-scale));
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
}

/* App Container */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Auth View */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top, #1e293b 0%, #090d16 80%);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  width: 360px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.auth-card h1 {
  font-size: calc(22px * var(--text-scale));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: calc(14px * var(--text-scale));
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: calc(12px * var(--text-scale));
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: calc(14px * var(--text-scale));
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: calc(14px * var(--text-scale));
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #374151;
}

.btn-sm {
  padding: 4px 8px;
  font-size: calc(12px * var(--text-scale));
}

/* Three Column Layout */
.sidebar {
  width: 280px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.brand {
  font-weight: 700;
  font-size: calc(16px * var(--text-scale));
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
}

.conn-status.online {
  background: var(--accent-green);
}

.conn-status.offline {
  background: var(--accent-red);
}

.rooms-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section-title {
  font-size: calc(11px * var(--text-scale));
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 8px 4px 8px;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: calc(13.5px * var(--text-scale));
  margin-bottom: 2px;
  transition: all 0.15s;
}

/* Agent tree: agent header with its projects nested underneath */
.agent-tree-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.agent-tree-status.active {
  background: var(--accent-green, #22c55e);
}

.agent-group {
  margin-bottom: 8px;
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  user-select: none;
}

.agent-header:hover {
  background: var(--bg-surface-hover);
}

.agent-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.agent-caret {
  font-size: calc(10px * var(--text-scale));
  color: var(--text-muted);
  width: 10px;
}

.agent-name {
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

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

.add-project-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: calc(14px * var(--text-scale));
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
}

.add-project-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.agent-children {
  padding-left: 14px;
}

.room-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.room-item.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  border-left: 3px solid var(--accent-primary);
}

.room-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: calc(11px * var(--text-scale));
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(13px * var(--text-scale));
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.chat-header {
  min-height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
}

.room-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-title {
  font-size: calc(16px * var(--text-scale));
  font-weight: 600;
}

.on-point-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 500;
}

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

/* Transcript */
.transcript {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-card {
  display: flex;
  gap: 12px;
  max-width: 900px;
  line-height: 1.5;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(14px * var(--text-scale));
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.avatar.agent-avatar {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff;
}

.avatar.user-avatar {
  background: linear-gradient(135deg, #1f2937 0%, #4b5563 100%);
  color: #fff;
}

.message-content-wrapper {
  flex: 1;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.sender-name {
  font-weight: 600;
  font-size: calc(13.5px * var(--text-scale));
}

.timestamp {
  color: var(--text-muted);
  font-size: calc(11px * var(--text-scale));
}

.agent-activity-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: calc(13px * var(--text-scale));
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-primary, #3b82f6);
  animation: pulse-dot 1.4s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.85);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0.4;
  }
}

.message-body {
  color: var(--text-primary);
  font-size: calc(14px * var(--text-scale));
  word-break: break-word;
}

.message-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: calc(12.5px * var(--text-scale));
  margin: 8px 0;
}

.message-body code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: calc(12.5px * var(--text-scale));
}

.clarify-box {
  margin-top: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 14px;
}

.clarify-question {
  font-weight: 600;
  margin-bottom: 10px;
  color: #fbbf24;
}

.clarify-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clarify-box pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.clarify-status { margin: 8px 0; white-space: pre-wrap; }
.clarify-box.awaiting-answer { border: 2px solid #fbbf24; }
.clarify-answer { display: block; width: 100%; min-height: 80px; margin-top: 8px; }
.clarify-box label { display: block; }
.clarify-box button:disabled { opacity: 0.55; cursor: default; }

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  margin-top: 6px;
  font-size: calc(13px * var(--text-scale));
  color: var(--accent-primary);
  text-decoration: none;
}

.attachment-pill:hover {
  border-color: var(--accent-primary);
}

.attachment-kind {
  font-size: calc(10px * var(--text-scale));
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-primary);
  color: var(--bg-panel, #fff);
}

.attachment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.attachment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.attachment-image-link {
  display: block;
  max-width: 100%;
}

.attachment-image {
  display: block;
  max-width: min(100%, 640px);
  max-height: 480px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  object-fit: contain;
}

/* Composer */
.composer-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  background: var(--bg-panel);
}

.composer-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.composer-box:focus-within {
  border-color: var(--border-focus);
}

.composer-box.drag-over {
  border-color: var(--border-focus);
  border-style: dashed;
}

.composer-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: calc(14px * var(--text-scale));
  font-family: inherit;
  resize: none;
  min-height: 48px;
  max-height: 200px;
  outline: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-left-actions, .composer-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.icon-btn.recording {
  color: var(--accent-red);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Right Panel (STATE.md & Roster) */
.drawer-panel {
  width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.drawer-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.drawer-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

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

.state-preview {
  font-size: calc(13px * var(--text-scale));
  line-height: 1.6;
  color: var(--text-secondary);
}

.state-preview h1, .state-preview h2, .state-preview h3 {
  color: var(--text-primary);
  margin-top: 12px;
  margin-bottom: 6px;
}

.roster-agent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.agent-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.agent-status-dot.offline {
  background: var(--text-muted);
}

.icon-btn.active {
  color: var(--accent-primary);
}

/* Transcript controls remain reachable with keyboard focus and touch. */
.message-card { position: relative; }
.message-actions { display: flex; gap: 6px; opacity: 0; align-self: flex-start; }
.message-card:hover .message-actions,
.message-card:focus-within .message-actions,
.message-card.show-actions .message-actions { opacity: 1; }
@media (hover: none) { .message-actions { opacity: 1; } }
.message-edit { display: block; width: 100%; min-height: 80px; margin-bottom: 8px;
  color: var(--text-primary); background: var(--bg-surface); font: inherit; }
.message-error { color: #e56b6f; margin-top: 6px; }
.edited-marker, .deleted-tombstone { color: var(--text-muted); font-size: calc(12px * var(--text-scale)); font-style: italic; }
.session-divider { border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
  color: var(--text-muted); font-size: calc(12px * var(--text-scale)); }
.session-divider .avatar, .session-divider .message-meta { display: none; }
.room-menu { position: relative; }
.room-menu > button { position: absolute; right: 0; top: 100%; white-space: nowrap; z-index: 10; }

/* Text grows, not fixed icon sizes or column widths. Flex labels need their own ellipsis. */
.room-item-info { min-width: 0; }
.text-enlarged .room-item-info > span:last-child, .text-enlarged .agent-name, .room-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-item-info > span:first-child, .unread-badge { flex-shrink: 0; }
.brand { min-width: 0; flex-wrap: wrap; }
.conn-status { flex-shrink: 0; }
.text-size-btn { font-size: calc(12px * var(--text-scale)); white-space: nowrap; }

/* iPhone shell; desktop dimensions and columns remain intact. */
[hidden] { display: none !important; }
.mobile-only { display: none; }
.push-settings { padding: 12px; }
#push-status { font-size: calc(12px * var(--text-scale)); overflow-wrap: anywhere; }
#update-ready { position: fixed; bottom: 12px; left: 5%; width: 90%; z-index: 100; }
.room-menu[open] { z-index: 20; }
.room-menu-items { position: absolute; right: 0; top: 100%; min-width: 180px; padding: 6px; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 6px; }
.room-menu-items > button { display: block; width: 100%; white-space: normal; }
.room-menu:not([open]) .room-menu-items { display: none; }
@media (max-width: 932px) {
  html, body { width: 100%; overflow: hidden; }
  #app, #main-view, .auth-container { height: var(--viewport-height, 100dvh) !important; width: 100% !important; }
  #app { position: fixed; top: var(--viewport-top, 0px); left: 0; }
  .auth-container { overflow-y: auto; padding: 16px; }
  .auth-card { width: 100%; max-width: 390px; padding: 24px; margin: auto; }
  .auth-card h1 { flex-wrap: wrap; }
  button, .btn, .icon-btn, summary, .room-item, .drawer-tab, .agent-header-info { min-height: 44px; min-width: 44px; }
  input, textarea, .form-control { font-size: max(16px, calc(14px * var(--text-scale))); }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-full .sidebar { width: 100%; border-right: 0; }
  #sidebar-backdrop { position: fixed; inset: 0; background: #0009; border: 0; z-index: 35; }
  .chat-main { width: 100%; min-width: 0; flex: 1; }
  .chat-header { height: auto; min-height: 60px; flex-wrap: wrap; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; gap: 4px; }
  #sidebar-toggle { flex: 0 0 44px; }
  .room-header-left { display: block; flex: 1; min-width: 0; padding-right: 48px; text-align: center; }
  .room-title { overflow-wrap: anywhere; white-space: normal; font-size: calc(16px * var(--text-scale)); }
  .on-point-badge { display: none; }
  .header-actions { width: 100%; min-width: 0; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .header-actions > * { flex-shrink: 1; }
  .room-menu { max-width: 100%; }
  .room-menu[open] { flex-basis: 100%; }
  .room-menu-items { position: static; width: 100%; }
  #toggle-mute-btn { display: none; }
  .transcript { padding: 12px 10px; min-height: 0; overflow-x: hidden; }
  .message-card, .message-body, .message-content, .message-header { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .message-header { flex-wrap: wrap; }
  .message-card { padding: 12px; flex-wrap: wrap; }
  .message-content-wrapper { flex: 1; }
  .message-meta { flex-wrap: wrap; }
  /* iOS Safari ignores overflow:hidden on body and instead widens the page to the widest element,
     then zooms out -> blank column on the right. Wrap code blocks and clip every layer. */
  .message-body pre, .state-preview pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow-x: hidden; }
  .message-body code { overflow-wrap: anywhere; word-break: break-word; }
  .message-body table { display: block; max-width: 100%; overflow-x: auto; }
  html { overflow-x: clip; }
  #app, #main-view, .chat-main { overflow-x: hidden; max-width: 100%; }
  /* .transcript is a column flex container: a child with overflow != visible gets min-height 0 and is
     squashed to one line. Keep cards overflow-visible and unshrinkable; the transcript clips instead. */
  .transcript { overflow-x: hidden; }
  .message-card { max-width: 100%; flex-shrink: 0; }
  .message-content-wrapper { min-width: 0; }
  .message-body img { max-width: 100%; }
  .attachment-pill { max-width: 100%; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
  .composer-area { padding: 8px 8px max(8px, env(safe-area-inset-bottom)); flex-shrink: 0; }
  .composer-input { max-height: 120px; }
  .drawer-panel { position: fixed; inset: 0; width: 100% !important; max-width: 100%; z-index: 50; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .drawer-content { min-width: 0; overflow-wrap: anywhere; }
  .drawer-tabs { flex-wrap: wrap; }
  .clarify-choices { flex-direction: column; align-items: stretch; }
  .message-actions { display: none; flex-basis: 100%; opacity: 0; pointer-events: none; flex-wrap: wrap; }
  .message-card.show-actions .message-actions, .message-card:focus-within .message-actions { display: flex; opacity: 1; pointer-events: auto; }
}

/* ---------------------------------------------------------------- Fleet ops
   The panel for restarting agents and running fleet updates. Owner only.
   Sits over the console rather than inside a room, because it is not about
   any one room. */

.ops-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  padding: env(safe-area-inset-top) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-base);
}
.ops-header h2 { flex: 1; margin: 0; font-size: calc(18px * var(--text-scale)); }

.ops-running {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-amber);
  font-size: calc(13px * var(--text-scale));
}

.ops-status { margin: 12px 0; }

.ops-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: calc(13px * var(--text-scale));
  margin-bottom: 10px;
}
.ops-ok { border-left: 3px solid var(--accent-green); }
.ops-warn { border-left: 3px solid var(--accent-amber); }

.ops-unavailable {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-red);
}
.ops-unavailable p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: calc(13px * var(--text-scale));
  overflow-wrap: anywhere;
}

.ops-table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--text-scale)); }
.ops-table td { padding: 10px 8px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.ops-name { font-weight: 600; }
.ops-state-up { color: var(--accent-green); }
.ops-state-down { color: var(--accent-red); }
.ops-since { color: var(--text-muted); font-size: calc(11px * var(--text-scale)); }
.ops-act { text-align: right; }

.ops-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: calc(11px * var(--text-scale));
}
.ops-badge-warn { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.ops-bulk {
  margin-top: 20px;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
}
.ops-bulk h3 { margin: 0 0 4px; font-size: calc(14px * var(--text-scale)); }
.ops-hint { margin: 0 0 10px; color: var(--text-muted); font-size: calc(12px * var(--text-scale)); }
.ops-bulk-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ops-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(12px * var(--text-scale));
  color: var(--text-secondary);
  margin: 6px 0;
  min-height: 32px;
}

/* The running log. Monospace because it is command output, and it should look
   like command output rather than like prose. */
.ops-output {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: calc(12px * var(--text-scale));
  max-height: 40vh;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ops-line { padding: 1px 0; color: var(--text-secondary); }
.ops-line-ok { color: var(--accent-green); }
.ops-line-warn { color: var(--accent-amber); }
.ops-line-error { color: var(--accent-red); }
.ops-line-muted { color: var(--text-muted); }

/* Destructive actions look destructive. This class did not exist before; the
   fleet update is the first thing in the console that warrants it. */
.btn-danger { background: var(--accent-red); color: #fff; border: 1px solid var(--accent-red); }
.btn-danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 932px) {
  .ops-table td { padding: 8px 4px; }
  .ops-since { display: none; }
  .ops-bulk-buttons .btn { flex: 1 1 100%; min-height: 44px; }
}
