:root {
  --bg: #000000;
  --ash: #080808;
  --panel: #0a0a0a;
  --accent: #ff4d00;
  --danger: #d7263d;
  --text: #ffffff;
  --dim: #94a3b8;
  --border: rgba(255, 77, 0, 0.12);
  --success: #38d995;
  --warn: #ffb347;
  --glass: rgba(10, 10, 10, 0.76);
  --rail-w: 60px;
  --side-w: 320px;
  --top-h: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 4px);
  opacity: 0.35;
  mix-blend-mode: screen;
}

body::after {
  z-index: -1;
  background: radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.55) 100%);
}

#heatSim {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  display: block;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

#fireApp.fire-v4-root {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--side-w);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px) brightness(0.45);
}

#fireApp.fire-v4-root *,
#fireApp.fire-v4-root *::before,
#fireApp.fire-v4-root *::after {
  box-shadow: none;
}

#fireApp.fire-v4-root button,
#fireApp.fire-v4-root input,
#fireApp.fire-v4-root textarea,
#fireApp.fire-v4-root select {
  font: inherit;
}

#fireApp.fire-v4-root button {
  cursor: pointer;
}

#fireApp.fire-v4-root a {
  color: inherit;
  text-decoration: none;
}

#fireApp.fire-v4-root ::selection {
  background: rgba(255, 77, 0, 0.3);
  color: var(--text);
}

.fire-v4-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 10px;
  background: rgba(0, 0, 0, 0.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.fire-v4-rail-top,
.fire-v4-rail-nav,
.fire-v4-rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fire-v4-rail-logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(255, 77, 0, 0.28);
}

.fire-v4-rail-nav {
  gap: 12px;
}

.fire-v4-rail-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.34);
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.fire-v4-rail-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.35;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fire-v4-rail-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.fire-v4-rail-btn.is-active {
  color: var(--text);
  border-color: var(--border);
}

.fire-v4-rail-btn.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
}

.fire-v4-rail-btn.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: 0 0 16px rgba(255, 77, 0, 0.18);
  pointer-events: none;
}

.fire-v4-rail-health {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.fire-v4-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 10px rgba(56, 217, 149, 0.6);
  animation: fireV4Pulse 1.6s ease-in-out infinite;
}

.fire-v4-health-dot.is-offline {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(215, 38, 61, 0.55);
}

.fire-v4-health-copy {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.fire-v4-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.fire-v4-topbar {
  height: var(--top-h);
  min-height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.fire-v4-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-crumbs span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fire-v4-statusline {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--dim);
  font-size: 11px;
}

.fire-v4-statusline strong {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}

.fire-v4-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.fire-v4-feed {
  height: 100%;
  overflow-y: auto;
  padding: 40px clamp(20px, 8vw, 120px) 170px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  will-change: transform;
}

.fire-v4-chat-feed {
  gap: 18px;
}

.fire-v4-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fire-v4-turn-user {
  align-items: flex-end;
}

.fire-v4-turn-assistant {
  align-items: stretch;
}

.fire-v4-turn-label {
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-turn-user .fire-v4-turn-label {
  text-align: right;
}

.fire-v4-turn-bubble {
  width: min(100%, 960px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fire-v4-turn-user .fire-v4-turn-bubble {
  width: min(100%, 760px);
  margin-left: auto;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.fire-v4-turn-query {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fire-v4-turn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.fire-v4-turn-provider,
.fire-v4-turn-state {
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-turn-state {
  color: var(--accent);
}

.fire-v4-turn-results {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255, 255, 255, 0.04);
}

.fire-v4-turn-placeholder {
  padding: 14px 16px;
  border-left: 1px solid var(--border);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.fire-v4-turn-placeholder.is-error {
  border-left-color: rgba(215, 38, 61, 0.5);
  color: #ffb3bc;
}

.fire-v4-loading-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 77, 0, 0.18);
  background: rgba(5, 5, 5, 0.62);
}

.fire-v4-loading-orbit {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.fire-v4-loading-orbit span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: fireV4Spin 0.9s linear infinite;
}

.fire-v4-loading-orbit strong {
  position: relative;
  z-index: 1;
}

.fire-v4-loading-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fire-v4-loading-kicker {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.fire-v4-loading-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.fire-v4-loading-message {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}

.fire-v4-loading-bar {
  height: 3px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.fire-v4-loading-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.fire-v4-feed::-webkit-scrollbar,
.fire-v4-sidepanel::-webkit-scrollbar,
.fire-v4-login-shell::-webkit-scrollbar {
  width: 4px;
}

.fire-v4-feed::-webkit-scrollbar-thumb,
.fire-v4-sidepanel::-webkit-scrollbar-thumb,
.fire-v4-login-shell::-webkit-scrollbar-thumb {
  background: var(--accent);
}

.fire-v4-feed::-webkit-scrollbar-track,
.fire-v4-sidepanel::-webkit-scrollbar-track,
.fire-v4-login-shell::-webkit-scrollbar-track {
  background: transparent;
}

.fire-v4-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
  padding-bottom: 120px;
}

.fire-v4-empty-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.fire-v4-empty-copy strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.fire-v4-empty-copy span {
  color: var(--dim);
  font-size: 13px;
}

.fire-v4-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  background: rgba(5, 5, 5, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.fire-v4-item::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.fire-v4-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 77, 0, 0.4);
  background: rgba(255, 77, 0, 0.03);
}

.fire-v4-item.is-selected {
  border-color: rgba(255, 77, 0, 0.5);
}

.fire-v4-item.is-repairing {
  animation: fireV4Repair 1.4s ease-in-out infinite;
}

.fire-v4-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.fire-v4-item-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fire-v4-company {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.fire-v4-linkbtn,
.fire-v4-item-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  padding: 0;
}

.fire-v4-linkbtn svg,
.fire-v4-item-check svg,
.fire-v4-command-tool svg,
.fire-v4-send svg,
.fire-v4-close svg,
.fire-v4-fab svg,
.fire-v4-login-submit svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fire-v4-item:hover .fire-v4-item-check,
.fire-v4-item.is-selected .fire-v4-item-check {
  color: var(--text);
}

.fire-v4-confidence {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.fire-v4-confidence strong {
  color: var(--text);
}

.fire-v4-contactline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fire-v4-contact {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.fire-v4-titlemono {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.fire-v4-bodyline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
}

.fire-v4-bodyline a {
  color: #68d2ff;
}

.fire-v4-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--dim);
  font-size: 12px;
  max-width: 100%;
}

.fire-v4-meta span,
.fire-v4-meta a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fire-v4-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--dim);
}

.fire-v4-dot.is-success {
  background: var(--success);
  box-shadow: 0 0 10px rgba(56, 217, 149, 0.6);
}

.fire-v4-dot.is-warn {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
}

.fire-v4-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fire-v4-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fire-v4-tag.is-ad {
  opacity: 0.65;
}

.fire-v4-command-wrapper {
  position: absolute;
  left: 50%;
  width: min(100%, 850px);
  z-index: 30;
  transition: top 0.5s cubic-bezier(0.19, 1, 0.22, 1), bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1), transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#fireApp.fire-v4-root.is-idle .fire-v4-command-wrapper {
  top: 50%;
  transform: translate(-50%, -50%);
}

#fireApp.fire-v4-root.is-active .fire-v4-command-wrapper {
  top: auto;
  bottom: 24px;
  transform: translateX(-50%);
}

.fire-v4-command-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(15, 15, 15, 0.95);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.fire-v4-command-shell.is-focused {
  box-shadow: 0 0 15px rgba(255, 77, 0, 0.18), 0 10px 40px rgba(0, 0, 0, 0.45);
}

.fire-v4-command-input {
  min-height: 56px;
  max-height: 240px;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  padding: 0;
  overflow-y: auto;
  pointer-events: auto;
  z-index: 1001;
}

.fire-v4-command-input::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.fire-v4-command-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fire-v4-command-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fire-v4-command-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.fire-v4-command-tool:hover,
.fire-v4-command-tool.is-active {
  color: var(--text);
}

.fire-v4-send {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 77, 0, 0.06);
  color: rgba(255, 255, 255, 0.4);
  padding: 0;
}

.fire-v4-send.is-ready {
  color: var(--text);
  background: var(--accent);
}

.fire-v4-send.is-ready svg {
  stroke: #000;
}

.fire-v4-send:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: none;
}

.fire-v4-send:hover {
  filter: brightness(1.15);
}

.fire-v4-status-log {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  padding: 0 6px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.fire-v4-status-log strong {
  color: var(--text);
}

.fire-v4-sidepanel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(8, 8, 8, 0.94);
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.fire-v4-sidepanel-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.fire-v4-sidepanel-header,
.fire-v4-sidepanel-footer {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fire-v4-sidepanel-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 0;
}

.fire-v4-sidepanel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.fire-v4-sidepanel-subtitle {
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
}

.fire-v4-sidepanel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fire-v4-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fire-v4-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-input,
.fire-v4-select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  color: var(--text);
  padding: 0 12px;
}

.fire-v4-input:focus,
.fire-v4-select:focus,
.fire-v4-login-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255, 77, 0, 0.3);
}

.fire-v4-checks {
  display: grid;
  gap: 8px;
}

.fire-v4-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}

.fire-v4-check input {
  accent-color: var(--accent);
}

.fire-v4-brains {
  display: grid;
  gap: 8px;
}

.fire-v4-brain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.fire-v4-brain.is-active {
  color: var(--text);
  border-color: var(--danger);
}

.fire-v4-range {
  width: 100%;
  accent-color: var(--accent);
}

.fire-v4-quota {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fire-v4-quota-ring {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.fire-v4-quota-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: #000;
}

.fire-v4-quota-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fire-v4-quota-core strong {
  font-size: 14px;
}

.fire-v4-quota-core span,
.fire-v4-sidepanel-health,
.fire-v4-sidepanel-footnote {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: var(--dim);
}

.fire-v4-detail {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.97);
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.fire-v4-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.fire-v4-detail-domain {
  color: #68d2ff;
  font-size: 12px;
}

.fire-v4-close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  padding: 0;
}

.fire-v4-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fire-v4-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fire-v4-timeline-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
}

.fire-v4-timeline-pin {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.fire-v4-timeline-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fire-v4-timeline-copy strong {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-timeline-copy span {
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.fire-v4-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fire-v4-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
}

.fire-v4-lead-card {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 77, 0, 0.24);
  background: rgba(8, 8, 8, 0.97);
  overflow: hidden;
}

.fire-v4-lead-card-head,
.fire-v4-lead-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fire-v4-lead-card-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 0;
}

.fire-v4-lead-card-company {
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fire-v4-lead-card-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fire-v4-lead-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fire-v4-lead-primary strong {
  color: var(--accent);
  font-size: 16px;
}

.fire-v4-lead-primary span {
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.fire-v4-lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.fire-v4-lead-row {
  min-width: 0;
  padding: 12px;
  background: rgba(5, 5, 5, 0.92);
}

.fire-v4-lead-row span,
.fire-v4-lead-row strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fire-v4-lead-row span {
  margin-bottom: 5px;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fire-v4-lead-row strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.fire-v4-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.07em;
}

.fire-v4-btn:hover {
  filter: brightness(1.15);
}

.fire-v4-btn.is-primary {
  background: var(--accent);
  color: #000;
}

.fire-v4-btn.is-danger {
  border-color: rgba(215, 38, 61, 0.4);
  color: var(--danger);
}

.fire-v4-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.fire-v4-overlay.is-open {
  display: flex;
}

.fire-v4-overlay-card {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid rgba(215, 38, 61, 0.45);
  background: rgba(10, 10, 10, 0.94);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.fire-v4-overlay-card h2 {
  margin: 0;
  color: var(--danger);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fire-v4-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 110;
}

.fire-v4-toast {
  min-width: 220px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(17, 17, 17, 0.94);
  color: var(--text);
  font-size: 12px;
}

.fire-v4-toast.is-error {
  border-left-color: var(--danger);
}

.fire-v4-fab {
  position: absolute;
  right: 28px;
  bottom: 110px;
  z-index: 40;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.88);
  color: var(--text);
  padding: 0;
}

.fire-v4-fab.is-locked {
  border-color: rgba(215, 38, 61, 0.4);
  color: var(--danger);
}

.fire-v4-fab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fire-v4-login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  z-index: 90;
}

.fire-v4-login-shell {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: rgba(8, 8, 8, 0.92);
  border: 1px solid var(--border);
}

.fire-v4-login-logo {
  color: var(--accent);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 77, 0, 0.32);
}

.fire-v4-login-message {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.fire-v4-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fire-v4-login-input {
  height: 42px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0 4px;
}

.fire-v4-login-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.fire-v4-login-submit {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.fire-v4-login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.fire-v4-hidden {
  display: none !important;
}

@keyframes fireV4Pulse {
  0%,
  100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes fireV4Spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fireV4Repair {
  0%,
  100% { border-color: rgba(255, 179, 71, 0.28); }
  50% { border-color: rgba(255, 179, 71, 0.7); }
}

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

.fire-v4-item {
  animation: fireV4SlideIn 0.35s ease-out;
}

@media (max-width: 1200px) {
  #fireApp.fire-v4-root {
    grid-template-columns: var(--rail-w) 1fr;
  }

  .fire-v4-sidepanel {
    position: absolute;
    top: 0;
    right: -320px;
    bottom: 0;
    width: var(--side-w);
    transition: right 0.25s ease;
    z-index: 50;
  }

  #fireApp.fire-v4-root.has-sidepanel .fire-v4-sidepanel {
    right: 0;
  }
}

@media (max-width: 768px) {
  body {
    overflow: hidden;
  }

  #fireApp.fire-v4-root {
    grid-template-columns: 1fr;
  }

  .fire-v4-rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: 58px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 14px;
    border-right: 0;
    border-top: 1px solid var(--border);
  }

  .fire-v4-rail-top,
  .fire-v4-rail-bottom {
    display: none;
  }

  .fire-v4-rail-nav {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
  }

  .fire-v4-stage {
    padding-bottom: 58px;
  }

  .fire-v4-topbar {
    padding: 0 14px;
  }

  .fire-v4-feed {
    padding: 20px 16px 180px;
  }

  .fire-v4-command-wrapper {
    width: calc(100vw - 24px);
  }

  #fireApp.fire-v4-root.is-idle .fire-v4-command-wrapper {
    top: 46%;
  }

  #fireApp.fire-v4-root.is-active .fire-v4-command-wrapper {
    bottom: 70px;
  }

  .fire-v4-command-shell {
    padding: 10px 14px 8px;
    border-radius: 18px;
  }

  .fire-v4-command-input {
    font-size: 16px;
  }

  .fire-v4-fab {
    right: 16px;
    bottom: 146px;
  }

  .fire-v4-item {
    padding: 14px;
  }

  .fire-v4-loading-card {
    grid-template-columns: 1fr;
  }

  .fire-v4-lead-modal {
    padding: 12px;
  }

  .fire-v4-lead-card {
    max-height: calc(100vh - 24px);
  }

  .fire-v4-lead-card-head,
  .fire-v4-lead-card-actions {
    align-items: flex-start;
  }

  .fire-v4-lead-grid {
    grid-template-columns: 1fr;
  }
}

/* FIRE theme refinement: molten, dense, and operational. */
:root {
  --bg: #060302;
  --ash: #0c0705;
  --panel: rgba(17, 10, 7, 0.78);
  --accent: #ff5a1f;
  --accent-2: #ffc46b;
  --ember: #c92512;
  --text: #fff8f1;
  --dim: #b59f91;
  --border: rgba(255, 117, 41, 0.22);
  --glass: rgba(14, 8, 6, 0.76);
}

body {
  background:
    linear-gradient(115deg, rgba(78, 17, 6, 0.34), transparent 34%),
    linear-gradient(180deg, #0a0503 0%, #050302 46%, #010101 100%);
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 112, 42, 0.08) 0 1px, transparent 1px 54px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 7px);
  opacity: 0.42;
}

body::after {
  background:
    linear-gradient(155deg, transparent 0 54%, rgba(255, 76, 20, 0.12) 54% 55%, transparent 55%),
    radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.66) 100%);
}

#fireApp.fire-v4-root {
  background: rgba(6, 3, 2, 0.36);
  backdrop-filter: blur(18px) saturate(1.18) brightness(0.68);
}

.fire-v4-rail,
.fire-v4-topbar,
.fire-v4-sidepanel,
.fire-v4-command-shell,
.fire-v4-lead-card,
.fire-v4-overlay-card,
.fire-v4-login-card {
  background:
    linear-gradient(180deg, rgba(26, 13, 8, 0.92), rgba(9, 5, 4, 0.92)) !important;
  border-color: var(--border) !important;
}

.fire-v4-rail {
  border-right-color: rgba(255, 117, 41, 0.25);
}

.fire-v4-rail-btn {
  border-radius: 8px;
}

.fire-v4-rail-btn.is-active {
  background: linear-gradient(180deg, rgba(255, 90, 31, 0.18), rgba(255, 90, 31, 0.04));
}

.fire-v4-topbar {
  box-shadow: 0 1px 0 rgba(255, 196, 107, 0.12), 0 12px 42px rgba(0, 0, 0, 0.3);
}

.fire-v4-turn-user .fire-v4-turn-bubble {
  border-radius: 8px 8px 2px 8px;
  border-color: rgba(255, 196, 107, 0.18);
  background: linear-gradient(135deg, rgba(255, 117, 41, 0.12), rgba(255, 255, 255, 0.035));
}

.fire-v4-turn-results {
  gap: 8px;
  background: transparent;
}

.fire-v4-item,
.fire-v4-loading-card,
.fire-v4-lead-row,
.fire-v4-sidepanel-health,
.fire-v4-sidepanel-footnote {
  border: 1px solid rgba(255, 117, 41, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 90, 31, 0.08), transparent 28%),
    rgba(11, 6, 4, 0.72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.fire-v4-item {
  border-left: 3px solid rgba(255, 90, 31, 0.7);
}

.fire-v4-item::before {
  background: linear-gradient(90deg, rgba(255, 196, 107, 0.3), transparent);
}

.fire-v4-item:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, rgba(255, 90, 31, 0.16), transparent 34%),
    rgba(18, 8, 4, 0.86);
}

.fire-v4-company {
  letter-spacing: 0.01em;
}

.fire-v4-contact {
  color: var(--accent-2);
}

.fire-v4-tag {
  border-radius: 6px;
  background: rgba(255, 90, 31, 0.08);
}

.fire-v4-command-shell {
  border-radius: 8px;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 196, 107, 0.16);
}

.fire-v4-command-shell.is-focused {
  border-color: rgba(255, 196, 107, 0.42) !important;
  box-shadow: 0 0 0 1px rgba(255, 196, 107, 0.12), 0 18px 58px rgba(0, 0, 0, 0.52);
}

.fire-v4-command-tool,
.fire-v4-send,
.fire-v4-input,
.fire-v4-select,
.fire-v4-login-input,
.fire-v4-login-submit,
.fire-v4-fab {
  border-radius: 8px;
}

.fire-v4-send.is-ready,
.fire-v4-login-submit {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  color: #170804;
}

.fire-v4-input,
.fire-v4-select,
.fire-v4-login-input {
  background: rgba(4, 2, 1, 0.86);
}

.fire-v4-sidepanel-header,
.fire-v4-sidepanel-footer,
.fire-v4-lead-card-head,
.fire-v4-lead-card-actions {
  background: rgba(255, 90, 31, 0.035);
}

.fire-v4-lead-card,
.fire-v4-overlay-card,
.fire-v4-login-card {
  border-radius: 8px;
}

.fire-v4-lead-grid {
  gap: 8px;
  background: transparent;
}

@media (max-width: 768px) {
  .fire-v4-command-shell {
    border-radius: 8px;
  }
}
