body.terminal-mode {
  background: #080f17;
}
.terminal-mode header {
  height: 60px;
  padding: 0 22px;
}
.terminal-mode .brand {
  font-size: 21px;
}
.terminal-mode nav {
  font-size: 13px;
  gap: 22px;
}
.terminal-mode header button {
  padding: 8px 13px;
  background: #192b36;
  color: #b9c8d5;
  font-size: 12px;
}
.terminal-mode main {
  max-width: none;
  margin: 0;
  padding: 0;
}
.terminal-mode footer {
  padding: 16px 24px;
  font-size: 11px;
}
.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.eyebrow,
.panel-title {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #91a3b7;
}
.instrument {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 9px;
}
.instrument strong {
  font-size: 27px;
  letter-spacing: -0.6px;
}
.instrument select {
  font-size: 21px;
  font-weight: 700;
  border: 0;
  padding: 0;
}
.terminal-mode select {
  background: #111e2b;
  color: #dfebf3;
  border: 1px solid #273847;
  border-radius: 5px;
  padding: 6px;
  max-width: 100%;
}
.ticker-stats {
  display: flex;
  gap: 26px;
  color: #8095a7;
  font-size: 11px;
}
.ticker-stats b {
  display: block;
  color: #c7d4df;
  font-size: 13px;
  margin-top: 6px;
}
.terminal-top time {
  display: block;
  font-size: 11px;
  color: #91a3b7;
  margin-top: 8px;
}
.feed {
  font-size: 11px;
  color: #e6b77c;
}
.feed.live {
  color: #60d6aa;
}
.positive {
  color: #64d6a8;
}
.negative {
  color: #ee8790;
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 280px;
  min-height: 620px;
  border-bottom: 1px solid var(--line);
}
.market-watch {
  border-right: 1px solid var(--line);
  padding: 20px 0;
  background: #0d1722;
}
.market-watch > .panel-title {
  padding: 0 16px 17px;
}
.watch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: left;
  gap: 8px 3px;
  width: 100%;
  padding: 18px 14px;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid #1b2936;
  font-size: 12px;
  color: #d8e4ed;
  font-weight: 400;
}
.watch-row strong {
  text-align: right;
  font-weight: 600;
}
.watch-row small {
  font-size: 10px;
  color: #8099ac;
}
.watch-row.selected {
  background: #152b34;
  box-shadow: inset 3px 0 #61d5a6;
}
.watch-row > small:last-child {
  grid-column: 1/3;
}
.watch-note {
  font-size: 11px;
  padding: 16px;
  color: #698194;
}
.chart-panel {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #0b121b;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1d2b38;
  padding: 10px 12px;
  gap: 10px;
}
.chart-toolbar label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  margin: 0;
  white-space: nowrap;
}
.chart-toolbar button,
.drawing-tools button,
.mobile-tabs button {
  background: transparent;
  color: #93a7b8;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 4px;
  font-weight: 500;
}
.chart-toolbar button.selected,
.mobile-tabs button.selected {
  background: #1d3938;
  color: #72dfb6;
}
.drawing-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}
.drawing-tools select {
  font-size: 11px;
}
.drawing-tools span {
  font-size: 10px;
  color: #8195a8;
  margin-left: auto;
}
#chart {
  position: relative;
  height: 500px;
  flex: 1;
  min-height: 380px;
}
.chart-zones {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
#chart-message {
  position: absolute;
  top: 110px;
  left: 18px;
  right: 85px;
  z-index: 3;
  padding: 10px 12px;
  color: #ecc28f;
  background: #17232aeb;
  font-size: 12px;
  border: 1px solid #3c4945;
  border-radius: 5px;
}
.chart-credit {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #647d90;
  padding: 10px 12px;
}
.analysis-panel {
  border-left: 1px solid var(--line);
  padding: 20px 18px;
  background: #0d1722;
  overflow: auto;
  max-height: 710px;
}
.analysis-panel p {
  font-size: 12px;
  line-height: 1.6;
}
.analysis-panel .panel-title {
  margin-bottom: 15px;
}
#scenario {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
}
.history-panel {
  padding: 18px 24px;
  background: #0a141e;
}
.history-heading {
  display: flex;
  align-items: center;
  gap: 20px;
}
.history-heading h2 {
  font-size: 13px;
  margin: 0;
}
.history-heading span {
  font-size: 11px;
  color: #6f879a;
}
#history {
  margin-top: 18px;
  font-size: 12px;
  color: #879daf;
  overflow: auto;
}
.mobile-tabs {
  display: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #78eabb;
  outline-offset: 3px;
}
dialog {
  background: #111c28;
  color: #dbe6ef;
  border: 1px solid #344a5d;
  border-radius: 10px;
  max-width: 720px;
  width: 90vw;
}
dialog::backdrop {
  background: #0009;
}
@media (min-width: 1600px) {
  #chart {
    height: 620px;
  }
  .workspace {
    grid-template-columns: 215px minmax(0, 1fr) 310px;
  }
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 155px minmax(0, 1fr) 230px;
  }
  .ticker-stats {
    gap: 15px;
  }
  .terminal-mode nav {
    gap: 12px;
  }
  .analysis-panel {
    padding: 16px 12px;
  }
  .instrument {
    gap: 10px;
  }
  .instrument strong {
    font-size: 22px;
  }
}
@media (max-width: 760px) {
  .terminal-mode header {
    height: auto;
    padding: 16px;
    gap: 12px;
  }
  .terminal-top {
    padding: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .ticker-stats {
    display: none;
  }
  .terminal-top > div:last-child {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .terminal-top time {
    font-size: 9px;
    margin: 0;
  }
  .instrument select {
    font-size: 18px;
  }
  .instrument strong {
    font-size: 24px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .market-watch {
    display: none;
  }
  .chart-panel {
    width: 100%;
  }
  #chart {
    height: 380px;
    min-height: 380px;
  }
  .chart-toolbar {
    padding: 8px;
    gap: 5px;
  }
  .chart-toolbar button {
    padding: 7px 8px;
  }
  .chart-toolbar label {
    font-size: 10px;
  }
  .drawing-tools {
    padding: 8px;
    font-size: 10px;
    gap: 5px;
  }
  .drawing-tools select {
    max-width: 150px;
  }
  .drawing-tools span {
    display: none;
  }
  .analysis-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
    padding: 16px;
  }
  .mobile-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin: -5px 0 18px;
    padding-bottom: 9px;
  }
  .workspace:not([data-mobile-panel="scenario"]) #scenario {
    display: none;
  }
  .workspace[data-mobile-panel="scenario"] #analysis {
    display: none;
  }
  .workspace[data-mobile-panel="market"] .market-watch {
    display: block;
    order: 3;
  }
  .workspace[data-mobile-panel="market"] .analysis-panel #analysis {
    display: none;
  }
  .workspace[data-mobile-panel="market"] .watch-note {
    display: none;
  }
  #watch {
    display: flex;
  }
  .watch-row {
    flex: 1;
    padding: 12px;
    font-size: 11px;
  }
  .history-panel {
    padding: 16px;
  }
  .history-heading {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chart-credit {
    font-size: 8px;
  }
  .terminal-mode footer {
    padding: 16px;
  }
}
.trend-summary {
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #bfd8df;
}
.trend-summary strong {
  font-size: 27px;
  color: #61d4ab;
}
.trend-summary small {
  font-size: 11px;
  color: #7d93a6;
}
.strength-track {
  height: 3px;
  background: #213242;
  margin-top: 12px;
}
.strength-track i {
  display: block;
  background: #60cfa7;
  height: 100%;
}
.analysis-panel .strength-note {
  font-size: 9px;
  color: #738fa4;
  line-height: 1.5;
}
.analysis-panel dl {
  font-size: 11px;
  margin: 20px 0;
}
.analysis-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #1a2937;
}
.analysis-panel dt {
  color: #7890a4;
}
.analysis-panel dd {
  margin: 0;
  color: #b8ccd9;
}
.analysis-panel ul {
  padding-left: 15px;
  font-size: 11px;
  color: #8fa6b8;
  line-height: 1.7;
}
.as-of {
  font-size: 9px !important;
  color: #6d8497 !important;
}
.mtf-grid {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}
.mtf-grid span {
  flex: 1;
  background: #152431;
  border-radius: 3px;
  padding: 8px;
  text-align: center;
  font-size: 10px;
}
.mtf-grid b {
  display: block;
  margin-top: 5px;
}
.wait-label {
  display: inline-block;
  background: #20323b;
  color: #afc6d7;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 8px 12px;
  border-radius: 4px;
}
.analysis-panel h3 {
  font-size: 14px;
  font-weight: 600;
}
.scenario-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 700;
}
.scenario-heading span {
  font-size: 10px;
  color: #bfced9;
  background: #213440;
  padding: 5px 7px;
  border-radius: 3px;
}
.details-link {
  background: #213b41;
  color: #91e8c2;
  font-size: 11px;
  padding: 9px 12px;
}
#history-filters {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
#history-filters select {
  font-size: 11px;
}
table {
  border-collapse: collapse;
  min-width: 100%;
  white-space: nowrap;
}
td,
th {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #21303d;
  font-size: 11px;
}
th {
  color: #728fa2;
  font-weight: 500;
}
td button {
  background: transparent;
  color: #70cba7;
  font-size: 10px;
  padding: 5px;
}
#details-content p,
#details-content li {
  font-size: 13px;
  color: #9bb1c4;
  line-height: 1.7;
}
#details-content dd {
  margin: 8px 0 18px;
}
.history-panel #history {
  min-height: 70px;
}
.operations-table {
  overflow: auto;
  margin-top: 24px;
}
@media (max-width: 760px) {
  .terminal-mode header nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: #101e2bef;
    border-top: 1px solid #314050;
    padding: 17px 12px;
    justify-content: space-around;
    gap: 10px;
    backdrop-filter: blur(12px);
    font-size: 10px;
  }
  .terminal-mode header nav a:nth-child(5) {
    display: none;
  }
  .terminal-mode header button {
    margin-left: auto;
  }
  .terminal-mode footer {
    padding-bottom: 80px;
  }
  .instrument {
    flex-wrap: wrap;
  }
  .terminal-top > div:last-child {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .chart-toolbar {
    flex-wrap: wrap;
  }
  .chart-toolbar label {
    margin-left: auto;
  }
} /* Definite desktop grid height prevents canvas ResizeObserver / flex feedback. */
@media (min-width: 761px) {
  .workspace {
    height: 650px;
    min-height: 0;
  }
  .chart-panel {
    min-height: 0;
  }
  #chart {
    height: 0;
    min-height: 0;
  }
  .analysis-panel {
    max-height: 650px;
  }
}
@media (min-width: 1600px) {
  .workspace {
    height: 760px;
  }
  .analysis-panel {
    max-height: 760px;
  }
}
@media (max-width: 760px) {
  .workspace {
    height: auto;
  }
  #chart {
    flex: none;
    height: 380px;
    min-height: 380px;
  }
  .analysis-panel {
    max-height: none;
  }
}
.analysis-reasons summary {
  font-size: 10px;
  color: #a2bacd;
  cursor: pointer;
  padding: 7px 0;
}
.analysis-reasons ul {
  margin-top: 5px;
}
@media (min-width: 761px) {
  .analysis-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .analysis-panel #analysis {
    flex: 0 0 55%;
    min-height: 0;
    overflow: auto;
    padding-right: 5px;
  }
  .analysis-panel #scenario {
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin-top: 12px;
    padding-top: 14px;
  }
  .analysis-panel dl {
    margin: 12px 0;
  }
  .analysis-panel dl div {
    padding: 6px 0;
  }
  .mtf-grid {
    margin: 12px 0;
  }
}
