/* Keep the company's essential information in sight at every screen size.
   Every section button stays visible: no sideways-scrolling rows (mobile fit pass, Nov 2026). */
.terminal-section-bar {
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  padding: 4px 0 16px;
}
.terminal-section-bar .terminal-section-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  height: auto;
  min-width: 0;
  max-width: 100%;
}
.terminal-core-sections,
.terminal-research-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}
.terminal-section-nav button[data-native-tab] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--atelier-line, var(--line));
  border-radius: 10px;
  background: var(--atelier-surface, var(--surface));
  color: var(--atelier-muted, var(--ink));
  font-size: 12px;
  font-weight: 550;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.terminal-section-nav .terminal-core-sections button {
  font-size: 13px;
  font-weight: 600;
}
.terminal-section-nav button[data-native-tab]:hover {
  border-color: var(--atelier-edge, var(--muted));
  color: var(--atelier-text, var(--ink));
}
.terminal-section-nav button[data-native-tab].active {
  border-color: var(--atelier-edge, var(--muted));
  background: rgba(197, 176, 142, .14);
  color: var(--atelier-accent, #c5b08e);
  box-shadow: inset 0 -2px 0 var(--atelier-accent, #c5b08e);
}
.terminal-section-nav button[data-native-tab]:focus-visible {
  outline: 2px solid var(--atelier-accent, #c5b08e);
  outline-offset: 2px;
}
.terminal-research-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  color: var(--atelier-muted, var(--muted));
  font-size: 11px;
  font-weight: 550;
}
.terminal-research-label span { display: none; }
.terminal-section-bar .chart-tools { flex-shrink: 0; padding-top: 2px; }
html[data-theme="light"] .terminal-section-nav button[data-native-tab] { color: #5f6065; }
html[data-theme="light"] .terminal-section-nav button[data-native-tab].active {
  color: #6a5335;
  border-color: #bdb09a;
  background: rgba(128, 102, 66, .12);
  box-shadow: inset 0 -2px 0 #6a5335;
}
@media (max-width: 1100px) {
  .terminal-section-bar { flex-wrap: wrap; gap: 10px; }
  .terminal-section-bar .terminal-section-nav { flex-basis: 100%; }
  .terminal-section-bar .chart-tools { margin-left: auto; }
}
@media (max-width: 680px) {
  .terminal-section-bar { padding-top: 4px; padding-bottom: 12px; }
  /* Row 1: the four essentials as one segmented row (fits 360px without truncation). */
  .terminal-core-sections {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--atelier-line, var(--line));
    border-radius: 12px;
    background: var(--atelier-surface-raised, var(--surface));
  }
  .terminal-section-nav .terminal-core-sections button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 6px;
    border-color: transparent;
    border-radius: 9px;
    background: transparent;
    font-size: 12px;
    box-shadow: none;
  }
  .terminal-section-nav .terminal-core-sections button.active { box-shadow: inset 0 0 0 1px var(--atelier-edge, var(--muted)); }
  /* Row 3: research tools wrap, so all seven are visible with no sideways scroll. */
  .terminal-research-sections { flex-wrap: wrap; gap: 6px; }
  .terminal-research-sections button[data-native-tab] { flex: 1 1 auto; padding: 0 12px; }
  .terminal-research-label span { display: inline; font-size: 11px; font-weight: 450; color: var(--atelier-quiet, var(--muted)); }
  /* Row 4: engine switch fills the row, expand button beside it. */
  .terminal-section-bar .chart-tools { width: 100%; margin-left: 0; gap: 8px; }
  .terminal-section-bar .chart-tools .engine-switch { flex: 1; }
  .terminal-section-bar .chart-tools .engine-switch button { flex: 1 1 0; }
  .terminal-section-bar .chart-tools .icon-button { width: 46px; height: 46px; flex: none; }
}
