:root,
html[data-theme="light"] {
  --bg-page: #faf8f4;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f0ea;
  --bg-elevated: #fdfcfa;
  --text-primary: #121417;
  --text-secondary: #495057;
  --text-muted: #7e858d;
  --border-hairline: #e6e2d8;
  --border-strong: #d0cabd;
  --emerald-primary: #059669;
  --emerald-bright: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.09);
  --emerald-border: rgba(16, 185, 129, 0.28);
  --amber-warn: #d97706;
  --danger-text: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --shadow-card: 0 2px 12px rgba(18, 20, 23, 0.04);
  --shadow-modal: 0 24px 60px rgba(18, 20, 23, 0.16);
}

html[data-theme="dark"] {
  --bg-page: #0c0e12;
  --bg-surface: #13171d;
  --bg-subtle: #1a1f28;
  --bg-elevated: #171c24;
  --text-primary: #f1f3f5;
  --text-secondary: #a6adb7;
  --text-muted: #6c7480;
  --border-hairline: #232934;
  --border-strong: #323b49;
  --emerald-primary: #10b981;
  --emerald-bright: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(52, 211, 153, 0.28);
  --amber-warn: #f59e0b;
  --danger-text: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 28px 70px rgba(0, 0, 0, 0.65);
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hidden {
  display: none !important;
}

/* Top Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-page) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.masthead-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.live-signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 0 4px var(--emerald-bg);
}

.brand-title {
  display: block;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.brand-tag {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-top: 2px;
}

.masthead-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-primary);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.identity-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.65rem 0.28rem 0.4rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}

.sigil-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.identity-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nickname-inline-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  width: 86px;
  padding: 1px 2px;
  outline: none;
}

.nickname-inline-input:hover,
.nickname-inline-input:focus {
  border-bottom-color: var(--emerald-primary);
}

.sigil-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--emerald-primary);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

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

/* Studio Two-Column Grid */
.studio-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 2.25rem;
  align-items: start;
}



.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 4.8rem;
}

.section-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.channel-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.channel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

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

.channel-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hairline);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.channel-desc,
.channel-marker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.rules-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

.protocol-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.protocol-list code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  background: var(--bg-subtle);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Feed Header & Typography */
.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 1.25rem;
}

.editorial-heading {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.editorial-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.composer-hint-text {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

.primary-editorial-btn {
  background: var(--text-primary);
  color: var(--bg-page);
  border: none;
  border-radius: 8px;
  padding: 0.62rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.primary-editorial-btn:hover {
  opacity: 0.9;
}

/* Live Typing Banner */
.live-typing-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
}

.typing-wave {
  display: inline-flex;
  gap: 3px;
}

.typing-wave span {
  width: 4px;
  height: 10px;
  background: var(--emerald-primary);
  border-radius: 2px;
  animation: waveBounce 0.9s infinite ease-in-out;
}

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

@keyframes waveBounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.2); }
}

/* Composer Card */
.composer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.composer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.text-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.composer-row-split {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-group.flex-grow {
  flex: 1;
}

.field-group label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.editorial-select,
.editorial-input,
.editorial-url-input {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 7px;
  padding: 0.55rem 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.editorial-textarea {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.editorial-input:focus,
.editorial-textarea:focus,
.editorial-url-input:focus {
  border-color: var(--emerald-primary);
}

.paste-warning-toast {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.optional-url-row {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.link-toggle-btn {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
}

.telemetry-bar {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.telemetry-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.telemetry-chip {
  display: flex;
  flex-direction: column;
}

.chip-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.telemetry-chip strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.emerald-text {
  color: var(--emerald-primary);
}

.arm-pulse-btn {
  background: var(--emerald-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.05rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.arm-pulse-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Thread & Message Cards */
.threads-list,
.messages-stream {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thread-card,
.message-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 11px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.thread-card:hover {
  border-color: var(--border-strong);
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.author-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-name {
  font-weight: 600;
  font-size: 0.86rem;
}

.author-sigil-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.73rem;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--emerald-primary);
  font-weight: 600;
}

.channel-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.timestamp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.thread-card-title {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  cursor: pointer;
  color: var(--text-primary);
}

.thread-card-title:hover {
  color: var(--emerald-primary);
}

.message-body-text {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-body-text.replaying-active {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.89rem;
  background: var(--bg-subtle);
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--emerald-primary);
}

.replay-cursor {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  background: var(--emerald-primary);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blinkCaret 0.6s infinite;
}

.replay-backspace-flash {
  color: var(--danger-text);
  text-decoration: line-through;
}

@keyframes blinkCaret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.attached-link-box {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--emerald-primary);
  text-decoration: none;
}

/* Human Proof Receipt Footer */
.receipt-footer {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.biometric-receipt-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.26rem 0.65rem;
  border-radius: 999px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  font-weight: 500;
}

.card-actions-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.replay-btn,
.open-thread-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.28rem 0.65rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.replay-btn:hover,
.open-thread-btn:hover {
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
}

.thread-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.back-btn {
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: 7px;
  padding: 0.4rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
}

/* Modals: Entry Gate & Hold the Pulse Arena */
.entry-gate-backdrop,
.pulse-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.entry-gate-card,
.pulse-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  max-width: 510px;
  width: 100%;
  padding: 1.85rem;
  box-shadow: var(--shadow-modal);
  text-align: center;
}

.editorial-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--emerald-primary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.entry-title,
.pulse-modal-title {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.45rem;
}

.entry-subtitle,
.pulse-modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.entry-pursuit-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 210px;
  margin: 0 auto 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0d1117;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

#entryOrbCanvas {
  display: block;
  width: 100%;
  height: 210px;
}

.entry-orb-label {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.entry-progress-bar-wrap {
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.entry-metrics-row,
.pulse-status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mono-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.emerald-pill {
  background: var(--emerald-bg);
  color: var(--emerald-primary);
}

.pulse-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
}

.pulse-arena-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0d1117;
  margin-bottom: 0.9rem;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

#pulseArenaCanvas {
  display: block;
  width: 100%;
  height: 240px;
}

.pulse-overlay-instruction {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.pulse-progress-track {
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.pulse-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-primary), var(--emerald-bright));
  transition: width 0.08s linear;
}

/* Hash-Chained Keystroke PoW & Mid-Stream Micro-Challenge Styles */
.composer-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chain-status-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.69rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-weight: 500;
}

.micro-challenge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.42);
  animation: pulseMicro 1.5s infinite ease-in-out;
}

.micro-challenge-bar.verified {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  animation: none;
}

@keyframes pulseMicro {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08); }
}

.micro-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.micro-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--amber-warn);
  color: #fff;
}

.micro-challenge-bar.verified .micro-badge {
  background: var(--emerald-primary);
}

.micro-instruction {
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text-primary);
}

.micro-word-letters {
  display: inline-flex;
  gap: 0.28rem;
}

.micro-char-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 28px;
  border-radius: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.micro-char-box.matched {
  background: var(--emerald-primary);
  border-color: var(--emerald-primary);
  color: #ffffff;
}

/* Live Defense Radar Sidebar Feed */
.radar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 0.9rem;
  box-shadow: var(--shadow-card);
}

.radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.radar-live-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--emerald-primary);
  background: var(--emerald-bg);
  padding: 2px 6px;
  border-radius: 999px;
}

.defense-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 270px;
  overflow-y: auto;
}

.defense-item {
  padding: 0.5rem 0.6rem;
  border-radius: 7px;
  background: var(--bg-page);
  border-left: 3px solid var(--emerald-primary);
  font-size: 0.74rem;
  line-height: 1.35;
}

.defense-item.kind-intercept,
.defense-item.kind-echo_expired {
  border-left-color: var(--danger-text);
  background: var(--danger-bg);
}

.defense-item.kind-escalation {
  border-left-color: var(--amber-warn);
  background: rgba(245, 158, 11, 0.09);
}

.defense-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.defense-item-summary {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.defense-item-detail {
  color: var(--text-secondary);
  font-size: 0.69rem;
}

/* Buttonless Inline "Drag Pulse to Transmit Well" Canvas */
.inline-well-container {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0d1117;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.5);
  user-select: none;
  touch-action: none;
}

.transmit-well-canvas {
  display: block;
  width: 370px;
  height: 52px;
  cursor: grab;
}

.transmit-well-canvas:active {
  cursor: grabbing;
}

/* ============================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES (Must remain at bottom of stylesheet)
   ============================================================================ */
@media (max-width: 840px) {
  .masthead-inner {
    padding: 0.65rem 0.9rem;
    gap: 0.5rem;
  }

  .brand-title {
    font-size: 1.02rem;
  }

  .online-pill {
    display: none;
  }

  .nickname-inline-input {
    width: 68px;
    font-size: 0.78rem;
  }

  .studio-container {
    grid-template-columns: 1fr;
    padding: 0.9rem 0.95rem 3rem;
    gap: 0.85rem;
  }

  /* Turn sidebar from sticky vertical column into static horizontal pill bar */
  .sidebar {
    position: static !important;
    top: auto !important;
    width: 100%;
    gap: 0;
    margin-bottom: 0.15rem;
    overflow: hidden;
  }

  .sidebar .section-label,
  .channel-desc,
  .channel-marker {
    display: none !important;
  }

  .channel-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .channel-nav::-webkit-scrollbar {
    display: none;
  }

  .channel-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
  }

  .channel-btn.active {
    background: var(--text-primary);
    color: var(--bg-page);
    border-color: var(--text-primary);
  }

  .feed-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.95rem;
    margin-bottom: 1rem;
  }

  .editorial-heading {
    font-size: 1.4rem;
  }

  .editorial-sub {
    font-size: 0.8rem;
  }

  .primary-editorial-btn {
    width: auto;
    padding: 0.55rem 0.95rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  .thread-card,
  .message-card,
  .composer-card {
    padding: 1rem;
  }

  .composer-row-split {
    flex-direction: column;
    gap: 0.65rem;
  }

  .telemetry-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-well-container {
    width: 100%;
  }

  .transmit-well-canvas {
    width: 100%;
  }

  .entry-gate-card,
  .pulse-modal-card {
    padding: 1.25rem;
    margin: 0.5rem;
  }

  .entry-pursuit-wrap,
  #entryOrbCanvas {
    height: 180px;
  }
}



