:root {
  --bg: #f3f0e8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --ink: #1d241f;
  --muted: #6a746d;
  --line: #ddd9ce;
  --line-strong: #cac4b7;
  --blue: #5f665f;
  --blue-soft: #efeee8;
  --green: #177a57;
  --green-soft: #e5f3ec;
  --red: #d66558;
  --red-soft: #fbe9e5;
  --amber: #ad7a1f;
  --amber-soft: #f7ecd6;
  --shadow: 0 18px 42px rgba(67, 56, 44, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(123, 104, 84, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(190, 197, 184, 0.2), transparent 34%),
    linear-gradient(180deg, #f8f6f0 0%, var(--bg) 100%);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 0 2px 8px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  align-content: start;
  padding-top: 1px;
  max-width: 430px;
}

.brand-lockup-minimal {
  display: block;
}

.brand-copy-minimal {
  gap: 3px;
  padding-top: 0;
}

.brand-kicker {
  margin-bottom: 0;
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.34;
  letter-spacing: 0.015em;
  max-width: 430px;
}

.topbar-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.topbar-market-button {
  min-width: 172px;
  padding: 14px 15px;
  font-weight: 700;
  color: var(--blue);
  font-size: 17px;
  letter-spacing: 0.01em;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(246, 241, 233, 0.98) 0%, rgba(239, 230, 218, 0.94) 100%);
  border-color: rgba(123, 104, 84, 0.18);
  display: grid;
  gap: 8px;
  align-content: center;
  text-align: left;
}

.compose-button,
.close-compose,
.ghost-button {
  border: 1px solid rgba(196, 209, 224, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.compose-button {
  color: var(--blue);
  border-color: rgba(123, 104, 84, 0.22);
  background: rgba(241, 231, 219, 0.9);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 48px;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 22px;
  line-height: 1.12;
}

h3 {
  font-size: 17px;
  line-height: 1.2;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  min-width: 660px;
}

.stats[hidden] {
  display: none;
}

.global-market-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(39, 49, 41, 0.14);
  backdrop-filter: blur(10px);
  padding: 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.global-market-modal.is-collapsed {
  display: none;
}

.global-market-dialog {
  width: min(1320px, 100%);
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 22px 22px 20px;
}

.global-market-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.global-market-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.global-market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
}

.global-market-card {
  border-radius: 18px;
  border: 1px solid rgba(202, 196, 183, 0.78);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 164px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 246, 242, 0.96) 100%);
  box-shadow: 0 10px 24px rgba(90, 100, 86, 0.07);
  overflow: hidden;
}

.global-market-card.market-up {
  border-color: rgba(220, 76, 76, 0.18);
}

.global-market-card.market-down {
  border-color: rgba(18, 150, 104, 0.18);
}

.global-market-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.global-market-card-head h3 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.global-market-card-group {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-market-card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.global-market-card-price {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.global-market-card-change {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.global-market-sparkline {
  width: 100%;
  height: 62px;
  margin-top: auto;
}

.global-market-sparkline path {
  fill: none;
  stroke-width: 2;
  stroke: #7a8a81;
}

.global-market-card.market-up .global-market-sparkline path {
  stroke: var(--red);
}

.global-market-card.market-down .global-market-sparkline path {
  stroke: var(--green);
}

.stat-card {
  background: var(--panel);
  border: 1px solid rgba(196, 209, 224, 0.72);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 13px 15px;
}

.market-index-card {
  min-height: 84px;
  display: grid;
  gap: 5px;
  align-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 246, 242, 0.96) 100%);
  transition: border-color 120ms ease, background 120ms ease;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, auto));
  gap: 8px;
  align-self: stretch;
}

.auth-button {
  min-height: 84px;
  min-width: 78px;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(90, 100, 86, 0.08);
}

.auth-button-login {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 246, 242, 0.96) 100%);
}

.auth-button-register {
  color: #6f5840;
  background: linear-gradient(180deg, rgba(246, 241, 233, 0.98) 0%, rgba(239, 230, 218, 0.96) 100%);
  border-color: rgba(123, 104, 84, 0.18);
}

.market-entry-card {
  min-width: 186px;
  justify-self: stretch;
  justify-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(246, 241, 233, 0.98) 0%, rgba(239, 230, 218, 0.96) 100%);
  border-color: rgba(123, 104, 84, 0.18);
  box-shadow: 0 12px 26px rgba(88, 71, 53, 0.11);
}

.market-entry-eyebrow {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.market-entry-title {
  color: #6f5840;
  font-size: 26px;
  line-height: 1.02;
  font-weight: 800;
}

.market-index-card.market-up {
  border-color: rgba(207, 19, 34, 0.2);
  background: linear-gradient(180deg, rgba(255, 242, 240, 0.98) 0%, rgba(255, 233, 230, 0.96) 100%);
}

.market-index-card.market-down {
  border-color: rgba(35, 120, 4, 0.2);
  background: linear-gradient(180deg, rgba(247, 255, 240, 0.98) 0%, rgba(239, 250, 233, 0.96) 100%);
}

.market-index-card.market-flat {
  border-color: rgba(196, 209, 224, 0.72);
}

.market-index-name {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 0;
}

.market-index-price {
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.market-index-change {
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}

.market-index-card.market-up .market-index-price,
.market-index-card.market-up .market-index-change {
  color: #cf1322;
}

.market-index-card.market-down .market-index-price,
.market-index-card.market-down .market-index-change {
  color: #237804;
}

.market-index-date {
  color: var(--muted);
  font-size: 11px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.status-banner {
  display: none;
  margin: 0 4px 18px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.status-banner.is-visible {
  display: block;
}

.status-banner.is-loading {
  color: var(--blue);
  border-color: rgba(123, 104, 84, 0.2);
}

.status-banner.is-error {
  color: var(--red);
  border-color: rgba(220, 76, 76, 0.24);
  background: rgba(255, 245, 245, 0.92);
}

.monitor-strip {
  margin: 0 4px 18px;
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}

.monitor-strip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monitor-strip-head h3 {
  font-size: 20px;
}

.monitor-strip-summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.monitor-strip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.monitor-card {
  border-radius: 16px;
  border: 1px solid rgba(202, 196, 183, 0.8);
  background: rgba(255, 255, 255, 0.76);
  padding: 12px 12px 11px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(67, 56, 44, 0.05);
}

.monitor-card.is-ok {
  border-color: rgba(23, 122, 87, 0.18);
  background: linear-gradient(180deg, rgba(229, 243, 236, 0.7) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.monitor-card.is-warn {
  border-color: rgba(173, 122, 31, 0.22);
  background: linear-gradient(180deg, rgba(247, 236, 214, 0.82) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.monitor-card.is-error {
  border-color: rgba(214, 101, 88, 0.26);
  background: linear-gradient(180deg, rgba(251, 233, 229, 0.9) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.monitor-card.is-idle {
  border-color: rgba(95, 102, 95, 0.16);
  background: linear-gradient(180deg, rgba(239, 238, 232, 0.82) 0%, rgba(255, 255, 255, 0.88) 100%);
}

.monitor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.monitor-card-label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.monitor-card-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.monitor-card-summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.monitor-card-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  min-height: 34px;
}

.monitor-card-time {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.center-panel {
  display: grid;
  gap: 18px;
  align-self: stretch;
  min-height: 0;
}

.panel-stack {
  position: sticky;
  top: 20px;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(202, 196, 183, 0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 0;
}

.stocks-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stocks-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.stocks-panel .panel-head h2 {
  font-size: 19px;
  line-height: 1.2;
  max-width: 420px;
}

.stocks-panel .panel-head > div:first-child {
  display: grid;
  gap: 4px;
}

.stocks-panel .stocks-head-actions {
  width: 100%;
  justify-content: flex-start;
  padding-top: 12px;
  border-top: 1px solid rgba(215, 224, 235, 0.72);
}

.events-list {
  padding: 10px;
  display: grid;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}

.event-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 10px 0;
  flex-wrap: wrap;
}

.announcement-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
  flex-wrap: wrap;
}

.mode-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
  flex-wrap: wrap;
}

.event-filter-button {
  border: 1px solid rgba(202, 196, 183, 0.84);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.event-filter-button.is-active {
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  background: rgba(239, 238, 232, 0.96);
}

.announcement-filter-button {
  border: 1px solid rgba(196, 209, 224, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.announcement-filter-button.is-active {
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  background: rgba(239, 238, 232, 0.96);
}

.mode-filter-button {
  border: 1px solid rgba(196, 209, 224, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.mode-filter-button.is-active {
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  background: rgba(239, 238, 232, 0.96);
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 0;
}

.detail-filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 18px 0;
  flex-wrap: wrap;
}

.detail-filter-button {
  border: 1px solid rgba(196, 209, 224, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.detail-filter-button.is-active {
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  background: rgba(239, 238, 232, 0.96);
}

.detail-metric {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(196, 209, 224, 0.72);
  border-radius: 16px;
  padding: 12px 14px;
}

.detail-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-metric strong {
  font-size: 22px;
}

.detail-events {
  display: grid;
  gap: 10px;
  padding: 12px 18px 18px;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}

.detail-event-card {
  border: 1px solid rgba(196, 209, 224, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
}

.detail-event-card h3 {
  font-size: 15px;
  line-height: 1.4;
  margin: 10px 0 8px;
}

.detail-event-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.detail-event-full {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
  margin: 0 0 10px;
}

.detail-expand {
  margin-bottom: 10px;
}

.detail-expand summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  user-select: none;
}

.detail-expand[open] summary {
  margin-bottom: 10px;
}

.detail-event-head,
.detail-event-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.detail-event-time,
.detail-event-foot span,
.detail-event-foot a {
  color: var(--muted);
  font-size: 12px;
}

.detail-event-foot a {
  color: var(--blue);
  text-decoration: none;
}

.detail-empty {
  padding: 14px;
  border: 1px dashed rgba(196, 209, 224, 0.84);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.detail-pagination {
  padding: 0 18px 18px;
}

.event-stream-alert {
  display: none;
  margin: 10px 0 0;
}

.event-stream-alert.is-visible {
  display: block;
}

.event-stream-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(195, 208, 223, 0.78);
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(242, 246, 252, 0.94) 100%);
  box-shadow: 0 8px 22px rgba(69, 86, 119, 0.08);
  animation: eventAlertSlideIn 380ms ease;
}

.event-stream-alert.is-breaking .event-stream-alert-inner {
  border-color: rgba(212, 56, 13, 0.22);
  background: linear-gradient(180deg, rgba(255, 246, 242, 0.99) 0%, rgba(250, 239, 233, 0.96) 100%);
  box-shadow: 0 10px 28px rgba(176, 67, 35, 0.12);
}

.event-stream-alert-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.event-stream-alert-copy strong {
  font-size: 12px;
  line-height: 1.2;
  color: var(--ink);
}

.event-stream-alert-copy span {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card {
  border: 1px solid rgba(215, 211, 201, 0.88);
  border-radius: 14px;
  padding: 10px 11px;
  background: linear-gradient(180deg, rgba(250, 248, 242, 0.98) 0%, rgba(244, 241, 233, 0.96) 100%);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  position: relative;
}

.event-card:hover {
  transform: translateY(-1px);
  border-color: #bfd1c6;
  background: linear-gradient(180deg, rgba(252, 250, 245, 1) 0%, rgba(245, 242, 235, 0.98) 100%);
}

.event-card.is-active {
  border-color: rgba(123, 104, 84, 0.28);
  background: linear-gradient(180deg, rgba(246, 243, 236, 0.99) 0%, rgba(240, 236, 228, 0.97) 100%);
  box-shadow: 0 10px 24px rgba(88, 71, 53, 0.07);
}

.event-card.is-active::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.event-card.is-fresh {
  animation: eventCardInsert 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.event-card.is-breaking {
  border-color: rgba(212, 56, 13, 0.22);
  background: linear-gradient(180deg, rgba(255, 247, 244, 0.99) 0%, rgba(247, 239, 233, 0.97) 100%);
  box-shadow: 0 10px 22px rgba(176, 67, 35, 0.08);
}

.event-card-fresh-pill {
  padding-inline: 9px;
  font-size: 11px;
  font-weight: 700;
}

.event-card-fresh-pill.fresh {
  background: rgba(72, 114, 212, 0.10);
  color: #4666b6;
  border-color: rgba(72, 114, 212, 0.12);
}

.event-card-fresh-pill.breaking {
  background: rgba(212, 56, 13, 0.12);
  color: #b23a1b;
  border-color: rgba(212, 56, 13, 0.16);
}

.event-card-head,
.event-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.event-card-head {
  margin-bottom: 4px;
}

.event-card h3 {
  font-size: 12px;
  line-height: 1.42;
  font-weight: 600;
}

.event-card-time {
  color: #70819e;
  font-size: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.event-meta,
.event-card-foot,
.notes-meta,
.table-summary,
.stock-strip-data {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.table-summary {
  row-gap: 10px;
}

.table-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(245, 244, 239, 0.96);
  border: 1px solid rgba(215, 211, 201, 0.84);
}

.table-live-value,
.live-delta-up,
.live-delta-down {
  display: inline-block;
}

.live-delta-up {
  animation: liveFlashUp 900ms ease;
}

.live-delta-down {
  animation: liveFlashDown 900ms ease;
}

@keyframes liveFlashUp {
  0% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 0 rgba(225, 109, 99, 0.26);
    background: rgba(225, 109, 99, 0.20);
    border-radius: 8px;
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 8px rgba(225, 109, 99, 0);
    background: rgba(225, 109, 99, 0);
  }
}

@keyframes liveFlashDown {
  0% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 0 rgba(31, 157, 117, 0.24);
    background: rgba(31, 157, 117, 0.18);
    border-radius: 8px;
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 8px rgba(31, 157, 117, 0);
    background: rgba(31, 157, 117, 0);
  }
}

@keyframes eventCardInsert {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes eventAlertSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.pill,
.tag,
.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  padding: 7px 11px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill.positive,
.position-badge.positive {
  background: rgba(245, 241, 228, 0.96);
  color: #7b7566;
}

.pill.negative,
.position-badge.negative {
  background: var(--red-soft);
  color: var(--red);
}

.pill.neutral,
.position-badge.neutral {
  background: #f1efe8;
  color: #687067;
}

.importance-pill {
  min-width: 44px;
  padding-inline: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.importance-pill.critical {
  background: rgba(212, 56, 13, 0.12);
  color: #b23a1b;
}

.importance-pill.important {
  background: rgba(92, 99, 92, 0.10);
  color: #535a53;
}

.importance-pill.normal {
  background: rgba(150, 146, 136, 0.10);
  color: #7c756a;
}

.importance-pill.muted {
  background: rgba(168, 164, 154, 0.08);
  color: #8c877b;
}

.importance-pill.subtle {
  background: rgba(182, 179, 171, 0.06);
  color: #9a958a;
}

.tag {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.16);
  cursor: pointer;
}

.tag.is-active {
  background: #ecebe5;
  border-color: rgba(95, 102, 95, 0.24);
  font-weight: 600;
}

.event-summary {
  padding-bottom: 14px;
}

.event-summary-text {
  padding: 10px 18px 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 90ch;
  font-size: 13px;
}

.event-sector-block {
  margin: 12px 18px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(199, 210, 225, 0.72);
}

.event-sector-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.event-summary .panel-head h2 {
  font-size: 20px;
  line-height: 1.2;
}

.event-sector-head h3 {
  font-size: 18px;
  line-height: 1.2;
}

.sector-tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.sector-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px 13px 11px;
  border-radius: 14px;
  border: 1px solid rgba(196, 209, 224, 0.72);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  text-align: left;
}

.sector-tile:hover {
  transform: translateY(-1px);
}

.sector-tile.is-active {
  border-color: rgba(123, 104, 84, 0.28);
  box-shadow: 0 10px 24px rgba(88, 71, 53, 0.1);
}

.sector-tile-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.sector-tile-change {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.sector-tile-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sector-tile.market-up {
  background: linear-gradient(180deg, rgba(253, 236, 236, 0.96) 0%, rgba(255, 245, 245, 0.92) 100%);
  border-color: rgba(220, 76, 76, 0.22);
}

.sector-tile.market-up .sector-tile-change {
  color: var(--red);
}

.sector-tile.market-down {
  background: linear-gradient(180deg, rgba(225, 246, 237, 0.96) 0%, rgba(240, 251, 245, 0.92) 100%);
  border-color: rgba(18, 150, 104, 0.22);
}

.sector-tile.market-down .sector-tile-change {
  color: var(--green);
}

.sector-tile.market-flat {
  background: rgba(255, 255, 255, 0.84);
}

.sector-tile.market-flat .sector-tile-change {
  color: var(--blue);
}

.sector-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stocks-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.event-stocks-panel,
.aux-stocks-panel {
  min-height: auto;
}

.table-wrap {
  padding: 6px 0 0;
  overflow-x: auto;
  overflow-y: visible;
  min-height: auto;
  flex: 0 0 auto;
}

.stocks-panel table {
  width: 100%;
  table-layout: fixed;
}

.event-stocks-panel table th,
.event-stocks-panel table td,
.aux-stocks-panel table th,
.aux-stocks-panel table td {
  vertical-align: middle;
  padding-left: 12px;
  padding-right: 12px;
}

.table-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0 14px 0 0;
  position: relative;
}

.table-sort-button::after {
  content: "↕";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  opacity: 0.72;
}

.table-sort-button.is-active {
  color: var(--ink);
}

.table-sort-button.is-active::after {
  opacity: 1;
  color: var(--ink);
}

.table-sort-button[data-event-sort-key].is-active,
.table-sort-button[data-aux-sort-key].is-active {
  color: var(--ink);
}

.table-sort-button[data-direction="asc"]::after {
  content: "↑";
}

.table-sort-button[data-direction="desc"]::after {
  content: "↓";
}

.event-stocks-panel table th:nth-child(1),
.event-stocks-panel table td:nth-child(1),
.aux-stocks-panel table th:nth-child(1),
.aux-stocks-panel table td:nth-child(1) {
  width: 80px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-stocks-panel table th:nth-child(2),
.event-stocks-panel table td:nth-child(2),
.aux-stocks-panel table th:nth-child(2),
.aux-stocks-panel table td:nth-child(2) {
  width: 112px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-stocks-panel table th:nth-child(3),
.event-stocks-panel table td:nth-child(3),
.aux-stocks-panel table th:nth-child(3),
.aux-stocks-panel table td:nth-child(3) {
  width: 86px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event-stocks-panel table th:nth-child(4),
.event-stocks-panel table td:nth-child(4),
.aux-stocks-panel table th:nth-child(4),
.aux-stocks-panel table td:nth-child(4) {
  width: 108px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-stocks-panel table th:nth-child(5),
.event-stocks-panel table td:nth-child(5),
.event-stocks-panel table th:nth-child(6),
.event-stocks-panel table td:nth-child(6),
.event-stocks-panel table th:nth-child(7),
.event-stocks-panel table td:nth-child(7),
.aux-stocks-panel table th:nth-child(5),
.aux-stocks-panel table td:nth-child(5),
.aux-stocks-panel table th:nth-child(6),
.aux-stocks-panel table td:nth-child(6),
.aux-stocks-panel table th:nth-child(7),
.aux-stocks-panel table td:nth-child(7) {
  width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event-stocks-panel table th:nth-child(8),
.event-stocks-panel table td:nth-child(8),
.aux-stocks-panel table th:nth-child(8),
.aux-stocks-panel table td:nth-child(8) {
  width: 92px;
  text-align: center;
  white-space: nowrap;
}

.event-stocks-panel table td:nth-child(2),
.aux-stocks-panel table td:nth-child(2) {
  font-weight: 600;
}

.event-stocks-panel table td:nth-child(3),
.aux-stocks-panel table td:nth-child(3) {
  font-weight: 600;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 16px 14px;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 32px;
  color: rgba(80, 91, 107, 0.54);
  font-size: 14px;
  font-weight: 600;
}

.page-button {
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(196, 209, 224, 0.88);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.page-button.is-active {
  background: rgba(239, 238, 232, 0.96);
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 10px 14px 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 241, 0.98);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(219, 214, 204, 0.72);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}

tbody tr {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

tbody tr:hover {
  background: rgba(247, 247, 243, 0.92);
}

tbody tr.is-active {
  background: rgba(244, 242, 236, 0.96);
  box-shadow: inset 2px 0 0 var(--blue);
}

.symbol-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.symbol-button:hover {
  color: #424842;
}

.up {
  color: var(--red);
}

.down {
  color: var(--green);
}

.chart-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  background: rgba(42, 48, 41, 0.16);
  backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 180ms ease;
}

.heatmap-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  background: rgba(42, 48, 41, 0.12);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 180ms ease;
}

.heatmap-modal.is-collapsed {
  opacity: 0;
  pointer-events: none;
}

.heatmap-dialog {
  width: min(1440px, 100%);
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(213, 207, 196, 0.74);
  background: rgba(252, 250, 245, 0.94);
  box-shadow: 0 24px 60px rgba(62, 70, 59, 0.14);
}

.heatmap-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 0;
}

.heatmap-dialog-meta {
  padding: 12px 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.heatmap-dialog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
  overflow: auto;
  min-height: 0;
  align-content: start;
}

.chart-panel.is-collapsed {
  opacity: 0;
  pointer-events: none;
}

.chart-dialog {
  width: min(1680px, 100%);
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
  border-radius: 24px;
  border: 1px solid rgba(213, 207, 196, 0.76);
  background: rgba(252, 250, 245, 0.95);
  box-shadow: 0 26px 64px rgba(62, 70, 59, 0.16);
}

.chart-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 0 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.chart-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chart-side-detail {
  border: 1px solid rgba(213, 207, 196, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

.chart-side-section {
  flex: 0 0 auto;
}

.event-detail-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.financial-section {
  border-bottom: 1px solid rgba(213, 207, 196, 0.72);
}

.chart-side-head {
  padding: 12px 14px 0;
}

.chart-side-detail .notes-meta,
.chart-side-detail .detail-summary,
.chart-side-detail .detail-filter-bar,
.chart-side-detail .detail-pagination {
  flex: 0 0 auto;
}

.chart-side-detail .detail-events {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.financial-snapshot {
  padding: 4px 0 0;
  display: grid;
  gap: 2px;
}

.financial-view-tabs {
  display: flex;
  gap: 6px;
}

.financial-view-button {
  border: 1px solid rgba(213, 207, 196, 0.78);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9px;
  cursor: pointer;
}

.financial-view-button.is-active {
  background: rgba(239, 238, 232, 0.96);
  border-color: rgba(95, 102, 95, 0.22);
  color: var(--blue);
}

.financial-section-group {
  display: grid;
  gap: 4px;
}

.financial-group-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  min-height: 10px;
}

.financial-group-head span {
  color: var(--muted);
  font-size: 9px;
}

.financial-table-wrap {
  border: 1px solid rgba(213, 207, 196, 0.72);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
}

.financial-table th,
.financial-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(221, 217, 206, 0.72);
  font-size: 8.5px;
  line-height: 1.15;
  text-align: left;
}

.financial-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(247, 245, 240, 0.88);
  font-size: 7.5px;
}

.financial-table td {
  font-variant-numeric: tabular-nums;
}

.financial-pct-up {
  color: var(--red);
  font-weight: 600;
}

.financial-pct-down {
  color: var(--green);
  font-weight: 600;
}

.financial-pct-flat {
  color: var(--muted);
  font-weight: 600;
}

.financial-table tr:last-child td {
  border-bottom: none;
}

.financial-table td:not(:first-child),
.financial-table th:not(:first-child) {
  text-align: right;
}

.financial-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 4px 0 2px;
}

.stock-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 10px 12px 0;
}

.stock-strip-quote {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.stock-strip-quote-price {
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stock-strip-quote-change {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-strip-quote.is-up .stock-strip-quote-price,
.stock-strip-quote.is-up .stock-strip-quote-change {
  color: var(--red);
}

.stock-strip-quote.is-down .stock-strip-quote-price,
.stock-strip-quote.is-down .stock-strip-quote-change {
  color: var(--green);
}

.stock-strip-quote.is-flat .stock-strip-quote-price,
.stock-strip-quote.is-flat .stock-strip-quote-change {
  color: var(--ink);
}

.chart-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-strip-data {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.stock-strip-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stock-strip-metric strong {
  color: var(--ink);
  font-weight: 700;
}

.stock-strip-metric.is-up strong {
  color: var(--red);
}

.stock-strip-metric.is-down strong {
  color: var(--green);
}

.stock-strip-metric.is-flat strong {
  color: var(--ink);
}

.chart-collapse-button {
  white-space: nowrap;
}

.chart-toolbar {
  display: flex;
  gap: 6px;
  padding: 0;
  flex-wrap: wrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(213, 207, 196, 0.84);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 5px 9px;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.chart-legend-item[data-layer="ma10"] {
  border-color: rgba(139, 122, 111, 0.24);
  background: rgba(139, 122, 111, 0.08);
}

.chart-legend-item[data-layer="ma20"] {
  border-color: rgba(210, 122, 167, 0.28);
  background: rgba(210, 122, 167, 0.08);
}

.chart-legend-item[data-layer="ma21"] {
  border-color: rgba(47, 143, 103, 0.24);
  background: rgba(47, 143, 103, 0.08);
}

.chart-legend-item[data-layer="ma50"] {
  border-color: rgba(154, 136, 115, 0.24);
  background: rgba(154, 136, 115, 0.08);
}

.chart-legend-item[data-layer="ma200"] {
  border-color: rgba(107, 114, 128, 0.24);
  background: rgba(107, 114, 128, 0.08);
}

.chart-legend-label {
  font-weight: 600;
}

.chart-legend-value {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-legend-item.is-active {
  opacity: 1;
}

.chart-legend-item.is-muted {
  opacity: 0.42;
}

.chart-legend-swatch {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.chart-insight {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 10px;
  padding: 2px 12px 6px;
  align-items: stretch;
  flex: 0 0 auto;
}

.insight-copy {
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(213, 207, 196, 0.76);
  background: rgba(255, 255, 255, 0.8);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.insight-copy h3 {
  margin-top: 1px;
  margin-bottom: 4px;
  font-size: 13px;
}

.insight-copy p:last-child {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 11px;
}

.chart-context-controls {
  padding: 0 12px 6px;
}

.financial-section-inline {
  border: 1px solid rgba(213, 207, 196, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  padding: 7px 10px 8px;
  min-width: 0;
}

.financial-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
}

.financial-inline-head .eyebrow {
  margin-bottom: 0;
}

.financial-inline-head h2 {
  font-size: 15px;
  line-height: 1.1;
  margin-bottom: 0;
}

.financial-inline-controls {
  flex: 0 0 auto;
}

.range-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 9px;
  font-size: 11px;
}

.range-button.is-active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(123, 104, 84, 0.24);
}

.chart-stack {
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 84px;
  flex: 1 1 auto;
  min-height: 0;
}

.chart-box,
.volume-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(215, 224, 235, 0.78);
}

.chart-box {
  height: auto;
  min-height: 0;
  border-radius: 20px 20px 0 0;
  border-bottom: none;
}

.volume-box {
  height: auto;
  min-height: 0;
  border-radius: 0 0 20px 20px;
}

.notes-panel {
  padding-bottom: 18px;
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.heatmap-panel {
  padding-bottom: 0;
}

.heatmap-open-button {
  white-space: nowrap;
  box-shadow: none;
  padding: 10px 14px;
}

.heatmap-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
  flex-wrap: wrap;
}

.heatmap-filter-button {
  border: 1px solid rgba(196, 209, 224, 0.9);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.heatmap-filter-button.is-active {
  color: var(--blue);
  border-color: rgba(95, 102, 95, 0.22);
  background: rgba(239, 238, 232, 0.96);
}

.heatmap-preview-meta {
  padding: 12px 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.heatmap-preview-grid {
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}

.heatmap-tile {
  appearance: none;
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(202, 196, 183, 0.76);
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  min-height: 104px;
  cursor: pointer;
}

.heatmap-tile.market-up {
  background: linear-gradient(180deg, rgba(253, 236, 236, 0.98) 0%, rgba(255, 244, 244, 0.94) 100%);
  border-color: rgba(220, 76, 76, 0.22);
}

.heatmap-tile.market-down {
  background: linear-gradient(180deg, rgba(225, 246, 237, 0.98) 0%, rgba(240, 251, 245, 0.94) 100%);
  border-color: rgba(18, 150, 104, 0.22);
}

.heatmap-tile.market-flat {
  background: rgba(255, 255, 255, 0.92);
}

.heatmap-tile-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.heatmap-tile-change {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.heatmap-tile.market-up .heatmap-tile-change {
  color: var(--red);
}

.heatmap-tile.market-down .heatmap-tile-change {
  color: var(--green);
}

.heatmap-tile.market-flat .heatmap-tile-change {
  color: var(--blue);
}

.heatmap-tile-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.heatmap-dialog-grid .heatmap-tile {
  min-height: 124px;
}

.events-panel {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98) 0%, rgba(251, 248, 242, 0.96) 100%);
}

.events-panel .panel-head,
.events-panel .event-filter-bar,
.events-panel .event-sentiment-bar,
.notes-panel .panel-head,
.notes-panel .notes-meta,
.notes-panel .detail-summary,
.notes-panel .detail-filter-bar,
.notes-panel .detail-pagination {
  flex: 0 0 auto;
}

.notes-panel .detail-events,
.events-panel .events-list {
  flex: 1 1 auto;
}

.events-panel .event-filter-bar,
.events-panel .event-sentiment-bar {
  gap: 6px;
}

.events-panel .event-filter-button,
.events-panel .detail-filter-button {
  padding: 6px 10px;
  font-size: 12px;
}

.center-panel .event-summary {
  flex: 0 0 auto;
}

.center-panel .stocks-panel {
  flex: 1 1 auto;
}

.center-panel .panel {
  background: linear-gradient(180deg, rgba(248, 245, 239, 0.98) 0%, rgba(243, 239, 231, 0.96) 100%);
}

.notes-panel {
  background: linear-gradient(180deg, rgba(241, 237, 229, 0.98) 0%, rgba(236, 232, 223, 0.96) 100%);
}

.notes-meta {
  padding: 16px 22px 0;
}

#stock-note {
  width: calc(100% - 44px);
  margin: 16px 22px 0;
  min-height: 260px;
  resize: vertical;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  line-height: 1.65;
}

.save-button {
  margin: 14px 22px 0;
  border: none;
  background: linear-gradient(135deg, #7b6854, #9a8369);
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

.note-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 22px 0;
}

.compose-layer[hidden] {
  display: none;
}

.compose-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.compose-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 68, 0.18);
  backdrop-filter: blur(4px);
}

.compose-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  background: rgba(249, 247, 242, 0.98);
  border-left: 1px solid rgba(196, 209, 224, 0.9);
  box-shadow: -24px 0 60px rgba(31, 42, 68, 0.12);
  padding: 24px;
  overflow: auto;
}

.compose-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.compose-form {
  display: grid;
  gap: 16px;
}

.compose-form label,
.compose-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
}

.compose-form span,
.compose-form legend {
  font-size: 13px;
  color: var(--muted);
}

.compose-form input,
.compose-form textarea,
.compose-form select {
  width: 100%;
  border: 1px solid rgba(196, 209, 224, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.compose-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compose-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compose-sectors {
  border: 1px solid rgba(215, 224, 235, 0.84);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.sector-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.sector-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(241, 231, 219, 0.76);
  color: var(--ink);
}

.sector-option input {
  width: auto;
}

.compose-hint,
.compose-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state {
  color: var(--muted);
  padding: 30px 22px;
}

@media (max-width: 1360px) {
  .monitor-strip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .events-panel {
    position: static;
    height: auto;
  }

  .panel-stack {
    position: static;
    height: auto;
  }

  .notes-panel {
    grid-column: 1 / -1;
    position: static;
    height: auto;
  }

}

@media (max-width: 980px) {
  .monitor-strip-grid {
    grid-template-columns: 1fr;
  }

  .monitor-strip-head {
    flex-direction: column;
  }

  .shell {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .stats {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compose-grid,
  .compose-grid.three {
    grid-template-columns: 1fr;
  }

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

  .heatmap-dialog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-stack {
    position: static;
    height: auto;
  }

  .stock-strip {
    flex-direction: column;
  }

  .chart-insight {
    grid-template-columns: 1fr;
  }

  .chart-content {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    padding: 16px;
  }

  .chart-dialog {
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }

  .chart-stack {
    grid-template-rows: minmax(0, 1fr) 88px;
    min-height: 540px;
  }

  .chart-side-detail .detail-events {
    max-height: none;
  }
}
