* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #111;
  color: #e8e8e8;
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  height: 46px;
  background: #171717;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}

.brand {
  font-size: 19px;
  letter-spacing: -0.5px;
  font-weight: 700;
}

.brand-main {
  color: #f2f2f2;
}

.brand-sub {
  color: #d8a900;
  margin-left: 2px;
}

.page {
  padding: 12px 26px;
}

.controls {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 8px;
}

.controls label {
  display: block;
  color: #aaa;
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: lowercase;
}

select,
button#refresh {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  border-radius: 4px;
  height: 32px;
  padding: 0 10px;
}

button#refresh {
  cursor: pointer;
}

.status {
  color: #999;
  font-size: 12px;
  padding-bottom: 8px;
}

.chart-card {
  position: relative;
  height: calc(100vh - 88px);
  background: #2b2b2b;
  border-radius: 6px;
  border: 1px solid #333;
  overflow: hidden;
}

.chart-title {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: #f3f3f3;
  font-size: 12px;
  font-weight: 700;
}

.chart-title .mode {
  color: #d8a900;
  font-size: 10px;
}

#gexChart {
  width: 100%;
  height: 100%;
}

.watermark {
  position: absolute;
  left: 86px;
  bottom: 46px;
  color: rgba(255, 255, 255, 0.055);
  font-size: 24px;
  font-weight: 700;
  pointer-events: none;
}

.unit {
  position: absolute;
  left: 10px;
  bottom: 5px;
  color: #bbb;
  font-size: 10px;
  pointer-events: none;
}

.pattern-box {
  position: absolute;
  top: 12px;
  right: 18px;
  z-index: 10;
  width: 340px;
  padding: 12px 14px;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.pattern-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8c8c8c;
  margin-bottom: 4px;
}

.pattern-primary {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
}

.pattern-summary {
  font-size: 12px;
  line-height: 1.35;
  color: #cfcfcf;
  margin-bottom: 9px;
}

.pattern-signals {
  display: grid;
  gap: 5px;
}

.pattern-signal {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #d7d7d7;
  border-top: 1px solid #242424;
  padding-top: 5px;
}

.pattern-signal strong {
  color: #ffffff;
}

.pattern-key {
  font-size: 11px;
  line-height: 1.35;
  color: #f0d24a;
  margin-bottom: 9px;
}

.pattern-signal {
  justify-content: flex-start;
}

.pattern-signal span::before {
  content: "• ";
  color: #f0d24a;
}

/* Move Foxchase Read out of the chart overlay */
.pattern-box {
  position: static !important;
  width: auto !important;
  margin: 0 0 8px 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 180px 1fr 1.2fr auto;
  align-items: center;
  column-gap: 14px;
  border-radius: 10px;
  background: rgba(8, 8, 8, 0.78);
}

.pattern-kicker {
  margin-bottom: 0;
}

.pattern-primary {
  margin-bottom: 0;
  white-space: nowrap;
}

.pattern-summary {
  margin-bottom: 0;
}

.pattern-key {
  margin-bottom: 0;
}

.pattern-signals {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.pattern-signal {
  border-top: 0;
  padding-top: 0;
  font-size: 10px;
}

/* FINAL override: Foxchase Read floating overlay box */
.chart-card {
  position: relative !important;
}

#pattern-box.pattern-box {
  position: absolute !important;
  top: 42px !important;
  right: 14px !important;
  z-index: 20 !important;
  width: 285px !important;
  max-width: 285px !important;
  margin: 0 !important;
  padding: 9px 11px !important;
  display: block !important;
  grid-template-columns: none !important;
  align-items: initial !important;
  column-gap: 0 !important;
  border: 1px solid #2d2d2d !important;
  border-radius: 10px !important;
  background: rgba(8, 8, 8, 0.82) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.26) !important;
}

#pattern-box .pattern-kicker {
  margin-bottom: 3px !important;
}

#pattern-box .pattern-primary {
  margin-bottom: 4px !important;
  white-space: normal !important;
}

#pattern-box .pattern-summary {
  margin-bottom: 6px !important;
}

#pattern-box .pattern-key {
  margin-bottom: 6px !important;
}

#pattern-box .pattern-signals {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  white-space: normal !important;
}
