* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #ffffff; color: #131722; font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #f5f7fa; border-bottom: 1px solid #e1e3eb;
  gap: 12px; flex-wrap: wrap;
}
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 8px; }
.symbol { font-weight: 600; color: #131722; margin-right: 8px; }
.topbar button {
  background: #ffffff; color: #131722; border: 1px solid #d1d4dc;
  padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.topbar button:hover { background: #f0f3fa; }
.topbar button:disabled { opacity: 0.4; cursor: not-allowed; }
.topbar input[type="date"] {
  background: #ffffff; color: #131722; border: 1px solid #d1d4dc;
  padding: 3px 6px; border-radius: 4px; font: inherit;
  color-scheme: light;
}
.status { color: #787b86; margin-left: 8px; font-size: 12px; }
.date-label { display: inline-flex; align-items: center; gap: 6px; color: #4a4d57; }

.toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; color: #4a4d57; }
.toggle input { margin: 0; }

#chart { flex: 1; min-height: 0; position: relative; }
#chart.measure-active, #chart.measure-active * { cursor: crosshair !important; }
/* While Shift-measure is armed, make LWC's canvases transparent to pointer
   events so the library doesn't pointer-capture the gesture and suppress
   subsequent mousemove events. */
#chart.measure-active canvas { pointer-events: none !important; }

.legend {
  display: flex; gap: 16px; padding: 6px 12px; background: #f5f7fa;
  border-top: 1px solid #e1e3eb; font-size: 12px; color: #4a4d57;
  flex-wrap: wrap;
}
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { display: inline-block; width: 14px; height: 2px; }

.back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: #ffffff; color: #131722; text-decoration: none;
  border: 1px solid #d1d4dc; border-radius: 4px; font-size: 16px;
  margin-right: 4px;
}
.back:hover { background: #f0f3fa; }

body.landing { display: flex; align-items: center; justify-content: center; }
.landing-main { padding: 24px; max-width: 640px; }
.landing-main h1 { margin: 0 0 8px; font-size: 22px; color: #131722; font-weight: 600; }
.landing-main .sub { margin: 0 0 24px; color: #787b86; }
.symbol-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.symbol-list a {
  display: block; padding: 14px 16px;
  background: #f5f7fa; border: 1px solid #e1e3eb; border-radius: 6px;
  color: #131722; text-decoration: none; font-weight: 500;
}
.symbol-list a:hover { background: #f0f3fa; border-color: #d1d4dc; }
