.candlestick-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(20, 184, 166, 0.2), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(168, 85, 247, 0.22), transparent 30%),
    #050816;
  color: #f8fafc;
}

body.candlestick-page .topbar .brand,
body.candlestick-page .topbar nav .nav-analyst,
body.candlestick-page .topbar nav .nav-analyst:visited {
  opacity: 1 !important;
  visibility: visible !important;
}

.candle-shell {
  width: min(1840px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 30px;
}

.candle-hero,
.candle-chart-panel,
.candle-forecast-panel,
.candle-card {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(6, 19, 35, 0.92));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.candle-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: end;
  padding: 34px;
  border-radius: 8px;
}

.candle-hero h1 {
  margin: 0;
  font-size: clamp(38px, 4.8vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.candle-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.35;
}

.candle-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.candle-search label {
  display: grid;
  gap: 8px;
  color: #93c5fd;
  font-weight: 800;
}

.candle-search input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  background: rgba(3, 7, 18, 0.82);
  color: #f8fafc;
  font: inherit;
  font-weight: 800;
}

.candle-search button,
.forecast-grid .forecast-action {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  color: #07111f;
  background: linear-gradient(135deg, #ff8a1f 0%, #facc15 52%, #22c55e 100%);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(249, 115, 22, 0.28);
}

.candle-predict-action {
  position: relative;
  display: block;
  align-self: end;
  outline: none;
}

.candle-predict-action button {
  width: 100%;
}

.candle-availability-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.candle-predict-action::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(330px, 78vw);
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.96);
  color: #e2e8f0;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.46);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.candle-predict-action:hover::after,
.candle-predict-action:focus::after,
.candle-predict-action:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.candle-search button:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: none;
  opacity: 0.82;
}

.candle-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
}

body.prediction-ready .candle-workbench {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.prediction-ready) .candle-forecast-panel,
body:not(.prediction-ready) .candle-detail-grid {
  display: none;
}

.candle-chart-panel,
.candle-forecast-panel,
.candle-card {
  border-radius: 8px;
}

.candle-chart-panel {
  min-width: 0;
  padding: 24px;
}

.candle-forecast-panel {
  min-width: 0;
  padding: 18px;
}

.candle-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

body.candlestick-page .candle-panel-head h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 2vw, 32px) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
}

body.candlestick-page .candle-panel-head.compact h2 {
  font-size: clamp(18px, 1.45vw, 24px) !important;
}

.candle-live-strip {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-weight: 800;
  white-space: nowrap;
}

.candle-chart {
  position: relative;
  width: 100%;
  height: clamp(460px, 56vh, 650px);
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: #060b15;
  overflow: hidden;
}

.candle-chart-group + .candle-chart-group {
  margin-top: 18px;
}

.candle-chart-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.candle-chart-label > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.candle-chart-label strong {
  color: #e2e8f0;
  font-size: 16px;
}

.candle-chart-label small {
  color: #94a3b8;
  font-weight: 700;
}

.candle-chart-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.candle-chart-status.live {
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.13);
  color: #6ee7b7;
}

.candle-chart-status.predicted {
  border: 1px solid rgba(56, 189, 248, 0.48);
  background: rgba(56, 189, 248, 0.13);
  color: #7dd3fc;
}

.candle-chart-group-predicted {
  padding-top: 18px;
  border-top: 1px solid rgba(56, 189, 248, 0.22);
}

.predicted-candle-chart {
  height: clamp(300px, 38vh, 420px) !important;
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.05);
}

body.prediction-ready .candle-chart {
  height: clamp(390px, 48vh, 560px);
}

body.prediction-ready .predicted-candle-chart {
  height: clamp(300px, 38vh, 420px);
}

.candle-time-axis {
  display: none;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  margin-top: 6px;
  padding: 0 86px 0 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.candle-time-axis span {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.candle-time-axis span:first-child {
  text-align: left;
}

.candle-time-axis span:last-child {
  text-align: right;
}

html[data-theme="light"] .candlestick-page {
  background: #f8fafc;
  color: #0f172a;
}

html[data-theme="light"] .candle-hero,
html[data-theme="light"] .candle-chart-panel,
html[data-theme="light"] .candle-forecast-panel,
html[data-theme="light"] .candle-match-board,
html[data-theme="light"] .candle-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .candle-hero p,
html[data-theme="light"] .next-candle-copy p,
html[data-theme="light"] .candle-chart-insights p,
html[data-theme="light"] .candle-match-note,
html[data-theme="light"] .candle-match-card p,
html[data-theme="light"] .projected-pattern-box p,
html[data-theme="light"] .pattern-item p,
html[data-theme="light"] .similarity-box p,
html[data-theme="light"] .trained-model-box p,
html[data-theme="light"] .candle-note {
  color: #475569;
}

html[data-theme="light"] .candle-search input,
html[data-theme="light"] .forecast-metric,
html[data-theme="light"] .candle-chart-insights article,
html[data-theme="light"] .candle-match-summary article,
html[data-theme="light"] .candle-match-card,
html[data-theme="light"] .next-candle-copy div,
html[data-theme="light"] .projected-pattern-box article,
html[data-theme="light"] .pattern-item,
html[data-theme="light"] .validation-box article,
html[data-theme="light"] .similarity-box article,
html[data-theme="light"] .trained-model-box article {
  border-color: rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #0f172a;
}

html[data-theme="light"] .candle-search input,
html[data-theme="light"] .next-candle-copy dd,
html[data-theme="light"] .candle-chart-insights strong,
html[data-theme="light"] .candle-match-summary strong,
html[data-theme="light"] .candle-match-head h3,
html[data-theme="light"] .candle-match-card strong,
html[data-theme="light"] .forecast-metric strong,
html[data-theme="light"] .pattern-item strong,
html[data-theme="light"] .validation-box strong,
html[data-theme="light"] .similarity-box strong,
html[data-theme="light"] .trained-model-box strong,
html[data-theme="light"] .projected-pattern-box strong {
  color: #0f172a;
}

html[data-theme="light"] .candle-match-board {
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(168, 85, 247, 0.1), transparent 34%),
    #ffffff;
}

html[data-theme="light"] .candle-match-card.bullish {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), #f8fafc);
}

html[data-theme="light"] .candle-match-card.bearish {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), #f8fafc);
}

html[data-theme="light"] .candle-live-strip,
html[data-theme="light"] .candle-hover-tooltip {
  border-color: rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="light"] .candle-time-axis {
  color: #475569;
}

html[data-theme="light"] .candle-hover-tooltip strong {
  color: #0f172a;
}

html[data-theme="light"] .candle-chart,
html[data-theme="light"] .next-candle-visual {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

html[data-theme="light"] .candle-chart-label strong {
  color: #0f172a;
}

.candle-hover-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 238px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  background: rgba(2, 6, 23, 0.94);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
  color: #e2e8f0;
  pointer-events: none;
  transform: translate(14px, 14px);
}

.candle-hover-tooltip strong {
  display: block;
  color: #f8fafc;
}

.candle-hover-readout {
  min-height: 76px;
  margin-bottom: 10px;
}

.candle-hover-readout .candle-hover-tooltip {
  position: static;
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(360px, 2fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  transform: none;
  box-shadow: none;
}

.candle-hover-readout .candle-hover-tooltip strong {
  font-size: 14px;
}

.candle-hover-readout .candle-tooltip-values {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0 0 0 16px;
  border-top: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
}

.candle-hover-tooltip.predicted {
  border-color: rgba(56, 189, 248, 0.5);
}

.candle-tooltip-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.candle-tooltip-values span {
  display: grid;
  gap: 2px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.candle-tooltip-values b {
  color: #f8fafc;
  font-size: 12px;
  text-transform: none;
  white-space: nowrap;
}

html[data-theme="light"] .candle-tooltip-values b {
  color: #0f172a;
}

@media (max-width: 760px) {
  .candle-hover-readout {
    min-height: 128px;
  }

  .candle-hover-readout .candle-hover-tooltip {
    grid-template-columns: 1fr;
  }

  .candle-hover-readout .candle-tooltip-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
    padding: 8px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-left: 0;
  }
}

.candle-chart a,
.candle-chart [href*="tradingview"],
.candle-chart [class*="logo"],
.candle-chart [class*="attribution"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.candle-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: #93c5fd;
  font-weight: 800;
}

.candle-chart-insights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.candle-chart-insights article {
  min-height: 116px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(2, 6, 23, 0.48);
}

.candle-chart-insights span {
  display: block;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.candle-chart-insights strong {
  display: block;
  margin-top: 7px;
  color: #f8fafc;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.12;
}

.candle-chart-insights p {
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.candle-match-board {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background:
    radial-gradient(circle at 14% 0%, rgba(20, 184, 166, 0.16), transparent 36%),
    radial-gradient(circle at 92% 10%, rgba(168, 85, 247, 0.16), transparent 36%),
    rgba(2, 6, 23, 0.5);
}

.candle-match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.candle-match-head h3 {
  margin: 2px 0 0;
  color: #f8fafc;
  font-size: clamp(22px, 2vw, 30px);
}

.candle-match-head strong {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  background: rgba(20, 184, 166, 0.14);
  color: #2dd4bf;
  white-space: nowrap;
}

.candle-match-note {
  margin: 0 0 14px;
  color: #cbd5e1;
  line-height: 1.45;
}

.candle-match-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.candle-match-summary article {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(15, 23, 42, 0.58);
}

.candle-match-summary span {
  display: block;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.candle-match-summary strong {
  display: block;
  margin-top: 7px;
  color: #f8fafc;
  font-size: 20px;
}

.candle-match-summary p {
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.candle-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.candle-match-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  min-height: 132px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
}

.candle-match-card.bullish {
  border-color: rgba(45, 212, 191, 0.36);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(15, 23, 42, 0.72));
}

.candle-match-card.bearish {
  border-color: rgba(248, 113, 113, 0.34);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.14), rgba(15, 23, 42, 0.72));
}

.candle-match-rank {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
  font-weight: 950;
}

.candle-match-card small {
  display: block;
  color: #93c5fd;
  font-weight: 850;
}

.candle-match-card small:not(.candle-match-clean-title) {
  display: none;
}

.candle-match-card strong {
  display: block;
  margin-top: 7px;
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.15;
  text-transform: capitalize;
}

.candle-match-card p {
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.4;
}

.candle-match-ohlc,
.candle-match-prices {
  color: #94a3b8 !important;
  font-size: 13px;
}

#forecast-confidence {
  display: inline-flex;
  min-width: 82px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 20px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.forecast-toggle {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(2, 6, 23, 0.52);
  color: #dbeafe;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.forecast-toggle-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.forecast-toggle[aria-expanded="true"] .forecast-toggle-icon {
  transform: rotate(180deg);
}

.forecast-details {
  margin-top: 12px;
}

.next-candle-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.26);
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.1), rgba(15, 23, 42, 0.62));
}

.next-candle-visual {
  height: 154px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    rgba(2, 6, 23, 0.72);
  background-size: 100% 33%, 33% 100%, auto;
  display: grid;
  place-items: center;
}

.next-candle-visual svg {
  width: 100%;
  height: 100%;
}

.next-candle-copy span,
.next-candle-copy dt {
  color: #facc15;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.next-candle-copy strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.next-candle-copy p {
  margin: 8px 0 12px;
  color: #cbd5e1;
  line-height: 1.35;
}

.next-candle-copy dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.next-candle-copy div {
  padding: 8px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.52);
}

.next-candle-copy dd {
  margin: 4px 0 0;
  color: #f8fafc;
  font-weight: 900;
}

.forecast-metric {
  min-height: 78px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(2, 6, 23, 0.54);
}

.forecast-metric span,
.pattern-item span,
.validation-box span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.forecast-metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1;
}

.forecast-driver-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.forecast-driver-box h3,
.candle-card h2 {
  margin: 0 0 12px;
}

.forecast-driver-box ul {
  margin: 0;
  padding-left: 18px;
  color: #dbeafe;
  line-height: 1.55;
}

.projected-pattern-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.projected-pattern-box .projected-pattern-summary {
  grid-column: 1 / -1;
}

.projected-pattern-box article {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.2);
  background: rgba(15, 23, 42, 0.58);
}

.projected-pattern-box span {
  display: block;
  color: #facc15;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.projected-pattern-box strong {
  display: block;
  margin-top: 5px;
  color: #f8fafc;
}

.projected-pattern-box p {
  margin: 6px 0 0;
  color: #cbd5e1;
  line-height: 1.4;
}

.candle-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

body.prediction-ready .candle-detail-grid {
  display: none;
}

.candlestick-company-footer {
  margin-top: 22px;
}

.candle-card {
  padding: 22px;
}

.pattern-list,
.validation-box,
.similarity-box,
.trained-model-box {
  display: grid;
  gap: 12px;
}

.pattern-item,
.validation-box article,
.similarity-box article,
.trained-model-box article {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.58);
}

.pattern-item strong,
.validation-box strong,
.similarity-box strong,
.trained-model-box strong {
  display: block;
  margin-top: 6px;
  color: #f8fafc;
}

.pattern-item p,
.similarity-box p,
.trained-model-box p,
.candle-note {
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.candle-note {
  font-size: 17px;
}

.candle-error {
  border-color: rgba(248, 113, 113, 0.45) !important;
  color: #fecaca !important;
}

@media (max-width: 1180px) {
  .candle-shell {
    width: min(100% - 28px, 1120px);
  }

  .candle-hero,
  .candle-detail-grid {
    grid-template-columns: 1fr;
  }

  body.prediction-ready .candle-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .candle-search {
    grid-template-columns: 1fr 1fr;
  }

  .candle-chart-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candle-search button,
  .candle-predict-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .candle-shell {
    width: min(100% - 18px, 620px);
    padding-top: 18px;
  }

  .candle-hero,
  .candle-chart-panel,
  .candle-forecast-panel,
  .candle-card {
    padding: 16px;
  }

  .candle-search,
  .candle-panel-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .candle-live-strip {
    white-space: normal;
  }

  .candle-chart {
    height: 420px;
  }

  .candle-chart-insights {
    grid-template-columns: 1fr;
  }

  .next-candle-card {
    grid-template-columns: 1fr;
  }

  .next-candle-visual {
    height: 160px;
  }
}

/* Responsive laptop fit: retain the wide-screen composition where it has room,
   then reflow progressively instead of squeezing or clipping the workbench. */
.candlestick-page,
.candlestick-page * {
  box-sizing: border-box;
}

@media (max-width: 1450px) {
  body.candlestick-page .topbar {
    grid-template-columns: auto minmax(220px, 1fr) !important;
    gap: 10px 18px !important;
    padding: 10px 14px !important;
  }

  body.candlestick-page .topbar-search {
    justify-self: end !important;
    width: min(100%, 360px) !important;
    max-width: 360px !important;
  }

  body.candlestick-page .topbar nav {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
  }

  .candle-shell {
    width: min(100% - 32px, 1380px);
  }

  .candle-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding: 26px;
  }

  .candle-hero h1 {
    font-size: clamp(36px, 5vw, 58px);
  }

  .candle-hero p {
    font-size: clamp(16px, 1.7vw, 20px);
  }

  body.prediction-ready .candle-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .candle-chart-panel,
  .candle-forecast-panel {
    width: 100%;
    max-width: 100%;
  }

  body.prediction-ready .candle-chart {
    height: clamp(380px, 52vh, 540px);
  }
}

@media (max-width: 900px) {
  body.candlestick-page .topbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.candlestick-page .topbar .brand,
  body.candlestick-page .topbar-search,
  body.candlestick-page .topbar nav {
    grid-column: 1 !important;
    justify-self: stretch !important;
  }

  body.candlestick-page .topbar-search {
    width: 100% !important;
    max-width: none !important;
  }

  body.candlestick-page .topbar nav {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    scrollbar-width: thin;
  }

  .candle-search {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .candle-search button,
  .candle-predict-action {
    grid-column: auto;
  }

  .candle-chart-panel {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .candle-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candle-search label {
    grid-column: 1 / -1;
  }

  .candle-search button {
    grid-column: auto;
    width: 100%;
    padding-inline: 12px;
  }

  .candle-time-axis {
    padding-right: 54px;
    font-size: 10px;
  }
}

@media (max-height: 850px) and (min-width: 901px) {
  .candle-shell {
    padding-top: 16px;
  }

  .candle-hero {
    padding-block: 20px;
    gap: 18px;
  }

  .candle-hero h1 {
    font-size: clamp(34px, 4vw, 50px);
  }

  .candle-hero p {
    margin-top: 10px;
    font-size: 16px;
  }

  body.prediction-ready .candle-chart {
    height: clamp(340px, 47vh, 430px);
  }
}
