/* Terminal Explorer Styling - LEV Timer SOTA Bayesian Engine */

.terminal-layout {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .terminal-layout {
    grid-template-columns: 280px 1fr;
  }
  .col-dossier {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .terminal-layout {
    grid-template-columns: 100%;
  }
  .share-banner {
    flex-direction: column;
    align-items: stretch !important;
  }
  .share-banner > div {
    max-width: 100%;
    flex-wrap: wrap;
  }
  #preset-selector {
    max-width: 100% !important;
    width: 100%;
  }
  .kpi-ribbon {
    grid-template-columns: 1fr !important;
  }
  .queue-row {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .queue-metrics {
    width: 100%;
    justify-content: space-between;
  }
}

/* Card Shells */
.terminal-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 18px rgba(32, 25, 17, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

.terminal-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Column 1: Tree & Sensors */
.cluster-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cluster-group:hover {
  border-color: var(--brand);
}

.cluster-group.blind-spot {
  border-color: var(--danger);
  background: rgba(171, 63, 78, 0.04);
}

.cluster-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.cluster-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
}

.cluster-multiplier-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(32, 25, 17, 0.08);
  font-weight: 600;
}

.cluster-multiplier-badge.good {
  background: rgba(31, 143, 100, 0.15);
  color: var(--success);
}

.cluster-multiplier-badge.elevated {
  background: rgba(184, 101, 18, 0.15);
  color: var(--warning);
}

.cluster-multiplier-badge.danger {
  background: rgba(171, 63, 78, 0.15);
  color: var(--danger);
}

.cluster-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(32, 25, 17, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

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

.blind-spot-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--danger);
  margin-top: 0.2rem;
}

.sensor-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sensor-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: #ffffff;
  border: 1px solid rgba(219, 205, 189, 0.6);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.sensor-item-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.sensor-item-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.sensor-item-btn.active .sensor-role-tag {
  color: rgba(255, 255, 255, 0.8);
}

.sensor-item-btn.active .sensor-val-status {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.sensor-btn-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sensor-btn-title {
  font-weight: 600;
  line-height: 1.2;
}

.sensor-role-tag {
  font-size: 0.68rem;
  color: var(--muted);
}

.sensor-val-status {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(32, 25, 17, 0.06);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.sensor-val-status.measured {
  background: rgba(31, 143, 100, 0.15);
  color: var(--success);
  font-weight: 700;
}

/* Column 2: Center Runway Plot & Decision Matrix */
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.plot-container {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
  position: relative;
}

.plot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scenario-pill-group {
  display: inline-flex;
  background: rgba(32, 25, 17, 0.06);
  border-radius: 20px;
  padding: 0.15rem;
  gap: 0.15rem;
}

.scenario-pill {
  border: none;
  background: transparent;
  padding: 0.3rem 0.65rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.15s ease;
}

.scenario-pill.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.runway-svg {
  width: 100%;
  height: 260px;
  overflow: visible;
}

/* EVSI Diagnostic Queue */
.section-subhead {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.queue-row:hover {
  background: #ffffff;
  border-color: var(--brand);
}

.queue-rank {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--brand);
  width: 24px;
}

.queue-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.queue-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}

.queue-prompt {
  font-size: 0.72rem;
  color: var(--muted);
}

.queue-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-cost-badge {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.queue-evsi-score {
  font-size: 0.75rem;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-weight: 700;
}

.queue-action-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.queue-action-btn:hover {
  opacity: 0.9;
}

/* Actionability Sliders */
.action-slider-box {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.action-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.action-gain-pill {
  background: rgba(31, 143, 100, 0.15);
  color: var(--success);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.75rem;
}

.action-slider-control {
  width: 100%;
}

/* Column 3: SOTA Dossier */
.dossier-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dossier-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}

.dossier-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  font-family: var(--font-display);
}

.dossier-badge-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dossier-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(32, 25, 17, 0.08);
}

.dossier-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dossier-block-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dossier-block-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
}

.dossier-compare {
  background: rgba(171, 63, 78, 0.05);
  border-left: 3px solid var(--danger);
  padding: 0.5rem 0.65rem;
  border-radius: 0 6px 6px 0;
}

.dossier-target-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
}

.dossier-target-table td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid rgba(219, 205, 189, 0.5);
}

.dossier-target-table td:last-child {
  font-weight: 700;
  text-align: right;
  font-family: var(--font-mono);
}

/* Input Form in Dossier */
.dossier-input-card {
  background: #ffffff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dossier-input-row {
  display: flex;
  gap: 0.5rem;
}

.dossier-input-field {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
}

.dossier-apply-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}

.dossier-apply-btn:hover {
  opacity: 0.9;
}

.share-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--brand);
  font-weight: 600;
}

.share-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
