/* Chart-only styles from KSP frontend/css/style.css. */

.stance-review-loading,
.stance-review-error {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #30363d;
  border-radius: 8px;
  background: #161b22;
  color: #8b949e;
  font-size: 13px;
}
.stance-review-error {
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.32);
}
.stance-shift-chart-panel {
  min-width: 0;
}
.stance-shift-chart-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.stance-shift-chart-tools span {
  color: #8b949e;
  font-size: 12px;
}
.stance-shift-reset {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #79c0ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.stance-shift-reset:hover {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}
.stance-shift-chart-wrap {
  position: relative;
  min-width: 0;
  cursor: grab;
}
.btc-radar-chart-panel .stance-shift-chart-wrap {
  max-height: 760px;
  overflow-y: auto;
}
.stance-event-markers {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  pointer-events: none;
}
.stance-event-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  padding: 0;
  transform: translate(-50%, -50%) scale(0.7);
  border: 2px solid #0d1117;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 1px #3fb950;
  pointer-events: auto;
  cursor: pointer;
}
.stance-event-marker.opinion { border-radius: 3px; }
.stance-event-marker.short {
  background: #f85149;
  box-shadow: 0 0 0 1px #f85149;
}
.stance-event-marker.opinion.level-swing {
  border-radius: 3px;
}
.stance-event-marker.opinion.level-macro {
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.7);
}
.stance-event-marker.opinion.level-intraday,
.stance-event-marker.short.opinion.level-intraday {
  width: 10px;
  height: 10px;
  background: transparent;
  box-shadow: none;
}
.stance-event-marker.opinion.level-intraday.long { border-color: #3fb950; }
.stance-event-marker.opinion.level-intraday.short { border-color: #f85149; }
.stance-event-marker.opinion.level-position:not(.kind-exit):not(.kind-hedge) {
  width: 0;
  height: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-style: solid;
  border-width: 0 8px 14px;
  border-color: transparent transparent #d29922 transparent;
}
.stance-event-marker.opinion.level-position.long:not(.kind-exit):not(.kind-hedge) {
  border-bottom-color: #3fb950;
}
.stance-event-marker.opinion.level-position.short:not(.kind-exit):not(.kind-hedge) {
  background: transparent;
  box-shadow: none;
  border-bottom-color: #f85149;
}
.stance-event-marker.opinion.kind-exit,
.stance-event-marker.short.opinion.kind-exit {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  color: #d29922;
  font: 700 14px/12px Segoe UI, Microsoft YaHei, sans-serif;
}
.stance-event-marker.opinion.kind-exit.long { color: #3fb950; }
.stance-event-marker.opinion.kind-exit.short { color: #f85149; }
.stance-event-marker.opinion.kind-hedge,
.stance-event-marker.short.opinion.kind-hedge {
  border-radius: 3px;
  background: linear-gradient(90deg, #3fb950 50%, #f85149 50%);
  box-shadow: 0 0 0 1px #d29922;
}
.stance-event-marker.opinion.level-macro:hover,
.stance-event-marker.opinion.level-macro:focus-visible {
  transform: translate(-50%, -50%) rotate(45deg) scale(0.7);
}
.stance-event-marker.opinion.level-intraday:hover,
.stance-event-marker.opinion.level-intraday:focus-visible {
  width: 12px;
  height: 12px;
}
.stance-event-marker.opinion.level-position:not(.kind-exit):not(.kind-hedge):hover,
.stance-event-marker.opinion.level-position:not(.kind-exit):not(.kind-hedge):focus-visible {
  width: 0;
  height: 0;
  border-left-width: 10px;
  border-right-width: 10px;
  border-bottom-width: 18px;
}
.stance-event-marker.neutral,
.stance-event-marker.flat,
.stance-event-marker.hedged,
.stance-event-marker.two_sided {
  background: #d29922;
  box-shadow: 0 0 0 1px #d29922;
}
.stance-ledger-levels {
  display: contents;
}
.stance-event-marker:hover,
.stance-event-marker:focus-visible {
  width: 20px;
  height: 20px;
  z-index: 1;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.stance-shift-tv-chart {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border: 1px solid #21262d;
  border-radius: 7px;
}
.stance-shift-chart {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  pointer-events: none;
}
.stance-shift-chart-tooltip {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  z-index: 3;
  display: none;
  width: min(360px, calc(100% - 20px));
  max-height: 180px;
  overflow: auto;
  padding: 10px 11px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.stance-shift-chart-tooltip.is-long {
  border-color: rgba(63, 185, 80, 0.42);
}
.stance-shift-chart-tooltip.is-short {
  border-color: rgba(248, 81, 73, 0.42);
}
.stance-shift-chart-tooltip.is-neutral {
  border-color: rgba(210, 153, 34, 0.42);
}
.stance-shift-chart-tooltip.is-pinned {
  position: static;
  width: auto;
  max-height: 460px;
  margin-top: 10px;
  border-color: rgba(88, 166, 255, 0.65);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(88, 166, 255, 0.16);
  pointer-events: auto;
}
.stance-shift-chart-tooltip b {
  display: block;
  color: #f0f6fc;
  font-size: 13px;
  line-height: 1.35;
}
.stance-shift-chart-tooltip span {
  display: block;
  margin-top: 4px;
  color: #8b949e;
  font-size: 11px;
  line-height: 1.4;
}
.stance-shift-chart-tooltip p {
  margin: 8px 0 0;
  color: #c9d1d9;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.stance-shift-chart-tooltip > div:not(.kol-shift-list) {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.stance-shift-chart-tooltip > div:not(.kol-shift-list) span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  margin: 0;
  padding: 2px 6px;
  border: 1px solid #21262d;
  border-radius: 999px;
  background: #161b22;
  color: #8b949e;
}
.stance-shift-chart-tooltip > div:not(.kol-shift-list) strong {
  color: #f0f6fc;
  font-weight: 800;
}
.stance-shift-chart-tooltip small {
  display: block;
  margin-top: 8px;
  color: #6e7681;
  font-size: 11px;
  line-height: 1.4;
}
.stance-shift-chart-tooltip .kol-shift-row-head strong {
  color: #f0f6fc;
  font-size: 12px;
  line-height: 1.35;
}
.stance-shift-chart-tooltip .kol-shift-row-head span {
  display: inline;
  margin: 0;
  color: #6e7681;
  font-size: 10px;
  white-space: nowrap;
}
.stance-shift-chart-tooltip .kol-shift-row-head em {
  padding: 2px 6px;
  border: 1px solid rgba(210, 153, 34, 0.34);
  border-radius: 999px;
  color: #d29922;
  background: rgba(210, 153, 34, 0.08);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
}
.stance-shift-chart-tooltip .kol-shift-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  margin: 0;
  padding: 1px 5px;
  border: 1px solid #21262d;
  border-radius: 999px;
  background: #161b22;
  color: #8b949e;
  font-size: 10px;
  line-height: 1.35;
}
.stance-shift-chart-tooltip .kol-shift-row-meta b {
  color: #f0f6fc;
  font-size: 10px;
}
.stance-shift-chart-tooltip .kol-shift-row p {
  margin: 0;
  color: #c9d1d9;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.stance-shift-chart-tooltip .kol-shift-row-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid #21262d;
  border-radius: 6px;
  background: #161b22;
  color: #8b949e;
  font-size: 10px;
  line-height: 1.25;
}
.stance-shift-chart-tooltip .kol-shift-row-stats b {
  color: #f0f6fc;
  font-size: 12px;
  line-height: 1;
}
.stance-ledger-layers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.stance-ledger-layer {
  min-width: 0;
  padding: 8px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
}
.stance-ledger-layer span,
.stance-ledger-layer small {
  display: block;
  color: #8b949e;
  font-size: 12px;
}
.stance-ledger-layer b {
  display: block;
  margin: 4px 0;
  color: #f0f6fc;
  font-size: 16px;
}
.stance-ledger-layer p {
  margin: 6px 0 0;
  color: #c9d1d9;
  font-size: 12px;
}
.stance-ledger-layer .stance-ledger-quote-btn {
  margin: 6px 0 0;
}
.stance-ledger-discards {
  margin: 0 0 12px;
  color: #d29922;
  font-size: 12px;
}
.stance-ledger-events {
  display: grid;
  gap: 8px;
}
.stance-ledger-event {
  padding: 8px;
  border: 1px solid #21262d;
  border-radius: 6px;
  background: #0d1117;
  color: #c9d1d9;
  font-size: 12px;
  line-height: 1.55;
}
.stance-ledger-event header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stance-ledger-event header b {
  color: #f0f6fc;
}
.stance-ledger-event header span,
.stance-ledger-event header em {
  color: #8b949e;
  font-style: normal;
}
.stance-ledger-event p,
.stance-ledger-event blockquote {
  margin: 6px 0 0;
}
.stance-ledger-event blockquote {
  color: #8b949e;
}
.stance-ledger-quote-btn {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #30363d;
  border-radius: 4px;
  background: transparent;
  color: #c9d1d9;
  font-size: 12px;
  cursor: pointer;
}
.stance-ledger-author {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #161b22;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.stance-ledger-author span {
  display: block;
  margin-bottom: 4px;
  color: #8b949e;
}
.stance-ledger-author mark {
  background: rgba(210, 153, 34, 0.35);
  color: #f0f6fc;
}
@media (max-width: 720px) {
  .stance-ledger-layers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .stance-shift-chart-tooltip {
    position: absolute;
    top: 10px;
    left: 10px;
    right: auto;
    width: min(320px, calc(100% - 20px));
    max-height: 180px;
  }
  .stance-shift-chart-tooltip.is-pinned {
    position: static;
    width: auto;
    max-height: 460px;
  }
}
@media (max-width: 720px) {
  .stance-shift-chart {
    min-height: 340px;
  }
}
.btc-radar-hero-actions select,
.btc-radar-context select,
.btc-radar-chart-controls select,
.stance-opinion-picker-toggle {
  min-height: 32px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #0d1117;
  color: #c9d1d9;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.btc-radar-hero-actions select:focus,
.btc-radar-context select:focus,
.btc-radar-chart-controls select:focus,
.stance-opinion-picker-toggle:focus-visible {
  border-color: #58a6ff;
}
.btc-radar-primary-btn,
.btc-radar-secondary-btn {
  min-height: 32px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #161b22;
  color: #c9d1d9;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btc-radar-primary-btn {
  border-color: rgba(88, 166, 255, 0.55);
  background: rgba(88, 166, 255, 0.12);
  color: #b9dcff;
}
.btc-radar-primary-btn:hover,
.btc-radar-secondary-btn:hover {
  border-color: #58a6ff;
  color: #f0f6fc;
}
.btc-radar-primary-btn:disabled,
.btc-radar-secondary-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}
.btc-radar-chart-root {
  min-width: 0;
}
.btc-radar-chart-card {
  overflow: hidden;
  border: 1px solid #30363d;
  border-radius: 10px;
  background: #161b22;
}
.btc-radar-chart-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: #c9d1d9;
  text-align: left;
  cursor: pointer;
}
.btc-radar-chart-toggle:hover {
  background: rgba(88, 166, 255, 0.04);
}
.btc-radar-chart-toggle b {
  display: block;
  color: #f0f6fc;
  font-size: 16px;
}
.btc-radar-chart-toggle small {
  display: block;
  margin-top: 4px;
  color: #8b949e;
  font-size: 11px;
  line-height: 1.45;
}
.btc-radar-chart-toggle > span:last-child {
  color: #58a6ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.btc-radar-chart-body {
  display: none;
  padding: 0 14px 14px;
}
.btc-radar-chart-card.is-open .btc-radar-chart-body {
  display: block;
}
.btc-radar-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid #21262d;
}
.btc-radar-chart-controls label {
  display: grid;
  gap: 4px;
  min-width: 120px;
  color: #8b949e;
  font-size: 10px;
}
.btc-radar-chart-controls label:last-of-type {
  min-width: 155px;
}
.btc-radar-chart-controls select {
  width: 100%;
}
.btc-radar-chart-controls .stance-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  color: #c9d1d9;
  font-size: 12px;
  cursor: pointer;
}
.stance-filter-toggle input {
  margin: 0;
  accent-color: #58a6ff;
}
.stance-opinion-picker {
  position: relative;
  display: grid;
  gap: 4px;
  width: 155px;
  min-width: 0;
  color: #8b949e;
  font-size: 10px;
}
.stance-opinion-picker-toggle {
  position: relative;
  width: 100%;
  padding-right: 26px;
  text-align: left;
  cursor: pointer;
}
.stance-opinion-picker-toggle span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stance-opinion-picker-toggle::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 5px;
  height: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.stance-opinion-picker-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 8px;
  width: min(380px, 80vw);
  padding: 10px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #161b22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.stance-opinion-picker-panel[hidden] {
  display: none;
}
.stance-opinion-picker-hint {
  margin: 0;
  color: #8b949e;
  font-size: 11px;
  line-height: 1.45;
}
.stance-opinion-picker-panel input[type="search"] {
  width: 100%;
  min-height: 30px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #c9d1d9;
  padding: 4px 8px;
}
.stance-opinion-picker-actions {
  display: flex;
  gap: 8px;
}
.stance-opinion-picker-candidates {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.stance-opinion-picker-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: #c9d1d9;
  font-size: 12px;
  cursor: pointer;
}
.stance-opinion-picker-item small {
  display: block;
  color: #8b949e;
  font-size: 11px;
}
.stance-opinion-picker-item code {
  color: #8b949e;
  font-size: 11px;
}
.stance-opinion-picker-empty {
  margin: 0;
  color: #8b949e;
  font-size: 11px;
}
.btc-radar-chart-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #161b22;
}
.btc-radar-chart-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.btc-radar-chart-panel-head h3 {
  margin: 0;
  color: #f0f6fc;
  font-size: 14px;
}
.btc-radar-chart-panel-head p {
  margin: 4px 0 0;
  color: #8b949e;
  font-size: 11px;
}
.btc-radar-chart-panel .stance-shift-chart {
  min-height: 560px;
}
@media (max-width: 720px) {
  .btc-radar-chart-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .btc-radar-chart-controls label {
    min-width: 0;
  }
  .btc-radar-chart-controls label:last-of-type {
    min-width: 0;
  }
  .btc-radar-chart-controls .stance-opinion-picker {
    width: 100%;
  }
  .btc-radar-chart-controls .btc-radar-primary-btn {
    width: 100%;
  }
  .btc-radar-chart-panel-head {
    flex-direction: column;
  }
  .btc-radar-chart-panel .stance-shift-chart {
    min-height: 340px;
  }
}