:root {
  --bg: #f5f2ec;
  --panel: #fffdfa;
  --panel-soft: #f7f3ec;
  --ink: #171510;
  --muted: #70685e;
  --line: #e4ddd1;
  --line-strong: #d6ccbe;
  --teal: #117c74;
  --rose: #b44d4f;
  --shadow: 0 14px 34px rgba(44, 32, 18, 0.06);
  --control-radius: 14px;
  --control-height: 46px;
  --marker-size: 26px;
  --donut-hole-inset: 27%;
  --font-ui: "Manrope", sans-serif;
  --font-brand: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-y: auto;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(255, 107, 53, 0.05), transparent 22%),
    linear-gradient(180deg, #faf7f2 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 12px auto 28px;
}

.topbar,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  border-radius: 22px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 122px 146px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.brand-block {
  display: flex;
  align-items: center;
}

h1,
.panel-label {
  margin: 0;
}

.panel-label {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--font-brand);
  font-size: 0.76rem;
  line-height: 1;
  letter-spacing: 0.16em;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
}

.brand-donut {
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--rose) 0deg 150deg, var(--teal) 150deg 360deg);
  box-shadow: 0 6px 16px rgba(20, 18, 14, 0.12);
}

.brand-donut::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
}

.toolbar {
  display: grid;
  grid-template-columns: 118px 66px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  grid-column: 2 / span 2;
}

.market-clocks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  padding-right: 2px;
}

.market-clock-card {
  display: flex;
  align-items: center;
  min-height: calc((var(--control-height) - 6px) / 2);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-soft);
}

.market-clock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  line-height: 1;
}

.market-clock-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.market-clock-value {
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ink);
  min-width: 43px;
  text-align: right;
  white-space: nowrap;
}

.market-clock-colon {
  display: inline-block;
  width: 0.4em;
  text-align: center;
}

.market-clock-colon.is-hidden {
  opacity: 0;
}

.watchlist-anchor {
  position: relative;
  width: 100%;
}

.tab-group,
.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-soft);
}

.tab-group {
  width: 100%;
  min-height: var(--control-height);
}

.watchlist-group {
  position: relative;
  z-index: 2;
  width: 100%;
}

.tab-button,
.segment-button,
.vote-button,
.news-row {
  font: inherit;
}

.tab-button,
.segment-button {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--control-radius);
  cursor: pointer;
}

.tab-button {
  flex: 1 1 0;
  padding: 10px 10px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.segment-button {
  padding: 7px 10px;
  font-size: 0.82rem;
}

.tab-button.active,
.segment-button.active {
  background: var(--ink);
  color: #fff;
}

.watchlist-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.watchlist-trigger.is-open {
  background: var(--ink);
  color: #fff;
}

.watchlist-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 18;
  width: min(292px, calc(100vw - 44px));
  height: 304px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 22px 44px rgba(36, 27, 18, 0.12);
}

.watchlist-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 26px;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.98);
  transform: rotate(45deg);
}

.watchlist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.watchlist-items::-webkit-scrollbar {
  width: 10px;
}

.watchlist-items::-webkit-scrollbar-track {
  background: transparent;
}

.watchlist-items::-webkit-scrollbar-thumb {
  background: #d7cfc2;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.watchlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.watchlist-row:hover {
  border-color: var(--line-strong);
}

.watchlist-select {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  padding: 0;
}

.watchlist-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.watchlist-row-ticker {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.watchlist-row-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-row-price {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.watchlist-action,
.watchlist-remove {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--rose);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.watchlist-action::before,
.watchlist-remove::before {
  content: "♥";
  font-size: 1.02rem;
  line-height: 1;
  transform: translateY(-0.5px);
}

.watchlist-action {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  background: var(--panel-soft);
}

.watchlist-action:not(.is-saved)::before {
  opacity: 0.38;
}

.watchlist-action.is-saved {
  border-color: rgba(180, 77, 79, 0.22);
  background: rgba(180, 77, 79, 0.08);
}

.watchlist-remove:hover {
  background: rgba(180, 77, 79, 0.08);
}

.watchlist-empty {
  padding: 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.search-field,
.compact-field {
  display: flex;
  height: var(--control-height);
}

.search-field {
  position: relative;
  align-items: center;
}

.search-field input,
.compact-field select {
  width: 100%;
  height: 100%;
  min-height: var(--control-height);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 16;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 22px 44px rgba(36, 27, 18, 0.12);
}

.search-suggestions::-webkit-scrollbar {
  width: 10px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background: #d7cfc2;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.search-suggestion {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.search-suggestion:hover {
  border-color: var(--line-strong);
}

.search-suggestion-ticker {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.search-suggestion-name {
  color: var(--muted);
  font-size: 0.77rem;
}

.compact-field {
  position: relative;
  margin-right: 6px;
}

.compact-field::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.compact-field select {
  appearance: none;
  -webkit-appearance: none;
  font-size: 0.86rem;
  padding: 0 24px 0 12px;
  text-align: center;
  text-align-last: center;
}

.login-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  width: 48px;
}

.profile-anchor {
  position: relative;
}

.login-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  position: relative;
  cursor: pointer;
}

.login-button::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  border: 1.8px solid var(--ink);
  background: transparent;
}

.login-button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 18px;
  height: 10px;
  margin-left: -9px;
  border-radius: 10px 10px 9px 9px;
  border: 1.8px solid var(--ink);
  border-bottom: none;
  background: transparent;
}

.login-label {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 22;
  width: min(292px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 22px 44px rgba(36, 27, 18, 0.12);
}

.profile-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 14px;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.98);
  transform: rotate(45deg);
}

.profile-popover-head {
  margin-bottom: 10px;
}

.profile-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-key {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-key.with-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(112, 104, 94, 0.32);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.info-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 4;
  min-width: 196px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 16px 32px rgba(36, 27, 18, 0.12);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.profile-key.with-tooltip:hover .info-tooltip,
.profile-key.with-tooltip:focus-within .info-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.profile-value {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.profile-action {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-action.secondary {
  background: var(--panel-soft);
}

.profile-action.danger {
  color: var(--rose);
}

.search-field input:focus,
.compact-field select:focus {
  outline: none;
  border-color: var(--line-strong);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 14, 10, 0.34);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.login-modal {
  width: min(100%, 360px);
  padding: 20px;
  border: 1px solid rgba(228, 221, 209, 0.94);
  border-radius: 24px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 28px 70px rgba(30, 21, 12, 0.18);
}

.login-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.login-modal-eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--font-brand);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.login-modal-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.login-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

.login-field input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.login-check input {
  margin: 0;
}

.login-submit {
  margin-top: 4px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.market-data-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.login-modal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.login-link-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.form-hint,
.form-feedback {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.form-hint.success,
.form-feedback.success {
  color: var(--teal);
}

.form-hint.error,
.form-feedback.error {
  color: var(--rose);
}

.signup-password-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  transition: opacity 120ms ease;
}

.signup-password-block.is-disabled {
  opacity: 0.56;
}

.signup-password-block.is-disabled input {
  background: #f1ece4;
  color: #9e9386;
}

.workspace {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, 0.98fr);
  grid-template-rows: 500px 320px;
  gap: 12px;
}

.panel {
  border-radius: 22px;
  padding: 14px;
}

.panel-chart {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-detail {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.panel-headlines {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-discussion {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-head {
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.chart-symbol {
  font-family: var(--font-ui);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 10px;
}

.panel-chart-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-panel-symbol {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-soft);
}

.chart-panel-symbol.hidden {
  display: none;
}

.chart-asset-label {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.watchlist-action {
  flex: 0 0 auto;
}

.watchlist-action.hidden {
  display: none;
}

.quote-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  margin-bottom: 10px;
}

.quote-primary,
.quote-secondary {
  display: flex;
  gap: 10px 14px;
  align-items: center;
  flex-wrap: wrap;
}

.quote-name {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
}

.quote-price {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quote-change {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quote-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.quote-meta strong {
  font-variant-numeric: tabular-nums;
}

#dataSourceBadge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.chart-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.chart-timeframe-panel {
  flex: 0 0 auto;
}

.chart-timeframe-panel .segment-button {
  padding: 7px 8px;
}

.chart-container,
.marker-layer {
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

.chart-container {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.marker-layer {
  pointer-events: none;
  z-index: 5;
}

.chart-news-marker {
  position: absolute;
  width: var(--marker-size);
  height: var(--marker-size);
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.98);
  background: var(--marker-gradient);
  box-shadow: 0 10px 24px rgba(18, 13, 9, 0.22);
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.chart-news-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #17120e;
  opacity: 0;
  z-index: 2;
  transition: opacity 120ms ease;
}

.chart-news-marker::after {
  content: "";
  position: absolute;
  inset: var(--donut-hole-inset);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
}

.chart-news-marker.active {
  width: var(--marker-size);
  height: var(--marker-size);
  box-shadow: 0 12px 28px rgba(18, 13, 9, 0.28);
}

.chart-news-marker.active::before {
  opacity: 1;
}

.chart-news-marker:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.chart-news-marker:focus,
.chart-news-marker:focus-visible,
.chart-news-marker:active {
  outline: none;
}

.panel-label {
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head .panel-label {
  margin-bottom: 0;
}

.panel-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.panel-filter {
  width: 74px;
  height: 38px;
  margin-right: 0;
  flex: 0 0 auto;
}

.panel-filter select {
  min-height: 38px;
  font-size: 0.82rem;
}

.news-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: visible;
}

.detail-headline {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.detail-headline-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.detail-date {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0;
}

.detail-tag {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-body {
  margin-top: 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  line-height: 1.72;
  font-size: 0.88rem;
}

.vote-zone {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding-top: 8px;
  overflow: visible;
}

.vote-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto;
}

.vote-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.vote-tooltip {
  width: 280px;
  white-space: normal;
  text-align: left;
  line-height: 1.55;
  left: 50%;
  top: auto;
  bottom: calc(100% + 12px);
  transform: translate(-50%, 10px);
}

.vote-help:hover .vote-tooltip,
.vote-help:focus-within .vote-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.vote-button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-width: 78px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.vote-button.long {
  color: var(--teal);
}

.vote-button.short {
  color: var(--rose);
}

.vote-button.selected.long {
  background: rgba(17, 124, 116, 0.14);
  border-color: rgba(17, 124, 116, 0.28);
  color: var(--teal);
}

.vote-button.selected.short {
  background: rgba(180, 77, 79, 0.14);
  border-color: rgba(180, 77, 79, 0.28);
  color: var(--rose);
}

.vote-button:disabled {
  cursor: default;
  opacity: 0.56;
}

.vote-button.selected:disabled {
  opacity: 1;
}

.vote-note {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.vote-donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.vote-donut {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
}

.vote-donut::after {
  content: "";
  position: absolute;
  inset: var(--donut-hole-inset);
  border-radius: 50%;
  background: var(--panel);
}

.vote-stat {
  min-width: 64px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vote-stat.long {
  color: var(--teal);
}

.vote-stat.short {
  color: var(--rose);
}

.discussion-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.discussion-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.discussion-messages::-webkit-scrollbar {
  width: 10px;
}

.discussion-messages::-webkit-scrollbar-track {
  background: transparent;
}

.discussion-messages::-webkit-scrollbar-thumb {
  background: #d7cfc2;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.discussion-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.discussion-message.own {
  align-items: flex-end;
}

.discussion-message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.discussion-author {
  font-weight: 700;
  color: var(--ink);
}

.discussion-time {
  white-space: nowrap;
}

.discussion-bubble {
  max-width: min(92%, 420px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: keep-all;
}

.discussion-message.own .discussion-bubble {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.discussion-message.own .discussion-author {
  color: var(--teal);
}

.discussion-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
  line-height: 1.55;
}

.discussion-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.discussion-input {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
}

.discussion-input::placeholder {
  color: var(--muted);
}

.discussion-input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.discussion-send {
  height: var(--control-height);
  padding: 0 18px;
  border: none;
  border-radius: var(--control-radius);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.discussion-send:hover {
  opacity: 0.94;
}

.discussion-send:active {
  transform: translateY(1px);
}

.discussion-room-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.74rem;
}

.discussion-room-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(17, 124, 116, 0.08);
}

.discussion-room-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.discussion-room-copy strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.discussion-room-copy span {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.news-list::-webkit-scrollbar {
  width: 10px;
}

.news-list::-webkit-scrollbar-track {
  background: transparent;
}

.news-list::-webkit-scrollbar-thumb {
  background: #d7cfc2;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.news-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
  cursor: pointer;
}

.news-row.active {
  border-color: rgba(180, 77, 79, 0.35);
  box-shadow: inset 0 0 0 1px rgba(180, 77, 79, 0.12);
}

.news-row-line {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

.news-row-time,
.news-row-ticker {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.news-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
}

.positive {
  color: var(--teal);
}

.negative {
  color: var(--rose);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 16px, 1120px);
  }

  .topbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .watchlist-popover {
    left: 0;
    right: auto;
    width: min(100%, 320px);
  }

  .login-modal {
    width: min(100%, 100%);
    padding: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .panel-chart,
  .panel-discussion,
  .panel-detail,
  .panel-headlines {
    grid-column: auto;
    grid-row: auto;
  }

  .chart-stage {
    height: 520px;
  }

  .discussion-bubble {
    max-width: 96%;
  }
}
