:root {
  --bg: #f5f7fd;
  --bg-strong: #ecf0fb;
  --panel: #ffffff;
  --panel-soft: #eef2ff;
  --sidebar: #17103f;
  --sidebar-deep: #11082d;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --ink: #18213f;
  --muted: #667095;
  --muted-strong: #4a5274;
  --line: #dbe2f4;
  --line-strong: #c9d1ea;
  --accent: #34e786;
  --accent-deep: #0bca63;
  --accent-soft: rgba(52, 231, 134, 0.14);
  --danger: #f2577b;
  --danger-soft: rgba(242, 87, 123, 0.14);
  --amber: #ffb84d;
  --amber-soft: rgba(255, 184, 77, 0.16);
  --blue: #6b84ff;
  --blue-soft: rgba(107, 132, 255, 0.14);
  --gray-soft: rgba(110, 122, 158, 0.14);
  --nav-active: rgba(68, 255, 165, 0.09);
  --chip: rgba(255, 255, 255, 0.08);
  --shadow-xl: 0 30px 70px rgba(23, 16, 63, 0.14);
  --shadow-md: 0 16px 36px rgba(25, 36, 75, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(93, 108, 255, 0.12), transparent 22%),
    radial-gradient(circle at 90% 10%, rgba(52, 231, 134, 0.08), transparent 20%),
    linear-gradient(180deg, #f7f9ff, #eff3ff);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  border: 0;
}

input,
select {
  outline: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px 18px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-deep));
  color: #f8f9ff;
  box-shadow: var(--shadow-xl);
}

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

.brand-copy {
  display: grid;
  gap: 4px;
  align-content: center;
  margin-left: -28px;
}

.brand-mark {
  width: 128px;
  height: 88px;
  object-fit: contain;
  object-position: left center;
  flex: none;
}

.brand-name {
  margin: 0;
  font-family: inherit;
  font-size: 1.36rem;
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.brand-caption {
  margin: 0;
  color: rgba(248, 249, 255, 0.6);
  font-size: 0.8rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  background: transparent;
  color: rgba(248, 249, 255, 0.86);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.9;
}

.nav-link:hover,
.nav-link.active {
  background: var(--nav-active);
  color: #9ff6c7;
  transform: translateX(2px);
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-footer-pill {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: #b6c4ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-footer p {
  margin: 14px 0 0;
  color: rgba(248, 249, 255, 0.68);
  line-height: 1.6;
}

.workspace {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}

.searchbar svg {
  width: 20px;
  height: 20px;
  fill: var(--text-muted);
  flex: none;
}

.searchbar input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.92rem;
}

.searchbar input::placeholder {
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-badge,
.watchlist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.topbar-button,
.add-button,
.save-button,
.remove-button,
.watchlist-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    background 160ms ease;
}

.topbar-button:hover,
.add-button:hover,
.save-button:hover,
.remove-button:hover,
.watchlist-create:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.topbar-button {
  min-height: 48px;
  padding: 0 18px;
  background: #ffffff;
  border: 1px solid rgba(201, 209, 234, 0.9);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-weight: 700;
}

.topbar-button.muted {
  color: var(--muted-strong);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #6f83d1, #5269c4);
  color: white;
  font-weight: 700;
}

.watchlist-frame {
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.watchlist-tabs {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.tab-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-row::-webkit-scrollbar {
  display: none;
}

.tab-chip {
  flex: none;
  padding: 7px 11px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.tab-chip.active {
  color: var(--accent-dark);
  border-color: rgba(0, 140, 122, 0.14);
  background: var(--accent-soft);
}

.watchlist-create {
  flex: none;
  min-height: 54px;
  padding: 0 18px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.watchlist-create span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #072516;
  font-size: 1.4rem;
  line-height: 1;
}

.watchlist-panel {
  overflow: hidden;
}

.panel-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 16px 14px;
  background: var(--surface-soft);
  color: var(--text-main);
  border-bottom: 1px solid var(--border-soft);
}

.panel-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: var(--accent);
  font-weight: 700;
}

.panel-title h1,
.info-head h2 {
  margin: 0;
  font-family: inherit;
  letter-spacing: -0.04em;
}

.panel-title h1 {
  font-size: clamp(1.22rem, 2vw, 1.56rem);
  font-weight: 700;
}

.board-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.metric-pill,
.connection-badge,
.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.68rem;
}

.signal-pill {
  gap: 0;
  min-height: 22px;
  min-width: 48px;
  padding: 3px 5px;
  font-size: 0.5rem;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: center;
  justify-content: center;
}

.metric-pill {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.metric-pill span {
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-status {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.connection-badge {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.connection-badge.live {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: rgba(0, 140, 122, 0.16);
}

.connection-badge.offline {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(216, 93, 120, 0.16);
}

.check-status {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.check-status span {
  display: block;
}

.panel-body {
  padding: 14px 14px 16px;
  background: var(--surface);
}

.public-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar-status-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.add-form {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(180px, 220px) auto;
  gap: 14px;
  align-items: end;
  flex: 1 1 auto;
}

.add-form label,
.controls-target,
.sort-control {
  display: grid;
  gap: 6px;
}

.add-form label span,
.controls-target span,
.sort-control span {
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 600;
}

.table-input,
.table-select,
.add-form input,
.sort-control select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink);
}

.table-input:focus,
.table-select:focus,
.add-form input:focus,
.sort-control select:focus {
  border-color: rgba(0, 140, 122, 0.36);
  box-shadow: 0 0 0 4px rgba(0, 140, 122, 0.1);
}

.table-input--small {
  min-height: 40px;
  padding-inline: 12px;
}

.table-select {
  padding-right: 34px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #61709e 50%),
    linear-gradient(135deg, #61709e 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.toolbar-filters {
  display: flex;
  gap: 14px;
  flex: none;
}

.sort-control {
  min-width: 188px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 600;
}

.toggle-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.add-button {
  min-height: 46px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.table-shell {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
}

.watchlist-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: white;
}

.watchlist-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 8px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
  text-transform: uppercase;
}

.watchlist-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid #efe9df;
  vertical-align: middle;
}

.watchlist-table tbody tr:last-child td {
  border-bottom: 0;
}

.watchlist-table tbody tr:hover {
  background: #fcfbf8;
}

.rank-cell {
  width: 42px;
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 0.76rem;
}

.stock-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
}

.logo-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  flex: none;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 2px;
  border-radius: 50%;
  background: white;
}

.logo-badge[data-ticker="AAPL"] .logo-image {
  transform: translateY(-5px) scale(0.94);
}

.logo-badge[data-ticker="WMT"] .logo-image {
  transform: scale(1.08);
}

.logo-badge[data-ticker="NKE"] .logo-image {
  padding: 3px;
  transform: translateY(0) scale(1.12);
}

.logo-badge[data-ticker="JOBY"] .logo-image {
  transform: translateY(-1px) scale(0.94);
}

.logo-badge[data-ticker="PG"] .logo-image {
  padding: 4px;
  transform: scale(1.18);
}

.logo-badge[data-ticker="GOOGL"] .logo-image {
  transform: scale(0.98);
}

.logo-badge[data-ticker="JPM"] .logo-image {
  padding: 3px;
  transform: scale(1.18);
}

.logo-badge[data-ticker="ONON"] .logo-image {
  padding: 3px;
  transform: scale(1.18);
}

.logo-badge[data-ticker="RKLB"] .logo-image {
  padding: 3px;
  transform: scale(1.16);
}

.logo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.stock-copy {
  min-width: 0;
  max-width: 104px;
}

.stock-copy strong,
.value-strong,
.distance-strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
}

.value-strong--compact {
  max-width: 112px;
  font-size: 0.82rem;
  line-height: 1.28;
  font-weight: 700;
}

.stock-copy strong {
  line-height: 1.1;
}

.stock-copy span,
.subtle-copy,
.distance-note,
.mobile-stat p,
.updated-copy {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.updated-cell {
  display: grid;
  gap: 3px;
  min-width: 86px;
}

.updated-copy {
  white-space: nowrap;
  font-weight: 600;
}

.value-change {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.value-change.positive {
  color: var(--accent-deep);
}

.value-change.negative {
  color: var(--danger);
}

.value-change.neutral {
  color: var(--muted);
}

.distance-cell {
  min-width: 104px;
}

.watch-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(117, 117, 112, 0.1);
  color: #5b5a54;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.watch-type-pill.core {
  background: rgba(0, 140, 122, 0.12);
  color: #1a6c60;
}

.watch-type-pill.growth {
  background: rgba(216, 224, 245, 0.86);
  color: #55647f;
}

.watch-type-pill.rebound {
  background: rgba(255, 184, 77, 0.14);
  color: #9a6d1e;
}

.watch-type-pill.speculative {
  background: rgba(242, 87, 123, 0.12);
  color: #a94b65;
}

.watch-type-pill.tactical {
  background: rgba(206, 239, 245, 0.88);
  color: #4b7e86;
}

.sparkline {
  display: block;
  width: 70px;
  height: 26px;
}

.sparkline path.line {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline path.area {
  opacity: 0.08;
}

.trend-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 16px;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.trend-button:hover {
  background: rgba(117, 117, 112, 0.06);
}

.trend-button.active {
  background: rgba(117, 117, 112, 0.08);
}

.trend-button:focus-visible,
.live-panel-close:focus-visible,
.live-range-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(0, 140, 122, 0.14);
}

.stock-row--expanded td {
  border-bottom-color: transparent;
}

.expanded-chart-row td {
  padding: 0 12px 14px;
  background: transparent;
  border-bottom: 1px solid #efe9df;
}

.live-ticker-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(24, 24, 24, 0.06);
  color: #1f1f1a;
  overflow: hidden;
}

.trend-panel-inline {
  margin-top: 6px;
}

.live-panel-close,
.live-range-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #dad8d2;
  color: #3f3d37;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.live-panel-close:hover,
.live-range-button:hover {
  background: rgba(255, 255, 255, 0.92);
}

.live-range-button.active {
  background: var(--accent-soft);
  border-color: rgba(0, 140, 122, 0.18);
  color: var(--accent-dark);
}

.live-panel-rangebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.live-chart-wrap {
  min-height: 220px;
  padding: 10px;
  border-radius: 16px;
  background: #f2f2f2;
  border: 1px solid #e0e0dc;
  position: relative;
}

.live-chart {
  display: block;
  width: 100%;
  height: auto;
}

.live-chart path.glow {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-chart path.line {
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-chart-grid {
  stroke: rgba(114, 114, 108, 0.16);
  stroke-width: 1;
}

.live-chart-guide {
  stroke: rgba(92, 92, 86, 0.26);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.live-chart-surface {
  position: relative;
}

.live-chart-indicator {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #ffffff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.live-chart-axis {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 58px;
  pointer-events: none;
}

.live-chart-axis span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  color: rgba(78, 78, 72, 0.72);
  font-size: 0.66rem;
  font-weight: 600;
}

.live-chart-overlay {
  position: absolute;
  inset: 0 54px 0 0;
  cursor: crosshair;
}

.live-chart-tooltip {
  position: absolute;
  display: grid;
  gap: 3px;
  min-width: 102px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(245, 247, 252, 0.96);
  border: 1px solid rgba(215, 221, 238, 0.94);
  color: var(--text-main);
  transform: translate(-50%, -100%);
  pointer-events: none;
  box-shadow: 0 12px 24px rgba(10, 12, 24, 0.14);
}

.live-chart-tooltip strong {
  font-size: 0.86rem;
  letter-spacing: -0.03em;
}

.live-chart-tooltip span {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.chart-fallback {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: #6b675f;
  text-align: center;
}

.chart-fallback p {
  margin: 0;
}

.trend-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 4px 0;
}

.trend-empty p {
  margin: 0;
  color: #666258;
  line-height: 1.55;
}

.signal-pill.buy-zone {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.signal-pill.close {
  background: var(--amber-soft);
  color: #c88409;
}

.signal-pill.wait {
  background: var(--blue-soft);
  color: #5f79ff;
}

.signal-pill.review {
  background: var(--gray-soft);
  color: #68759c;
}

.signal-pill.avoid {
  background: var(--danger-soft);
  color: var(--danger);
}

.own-cell {
  display: grid;
  gap: 10px;
}

.own-readout {
  white-space: nowrap;
}

.sentiment-cell {
  min-width: 122px;
}

.sentiment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d8e0f5;
  background: #f9fbff;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.sentiment-button:hover {
  border-color: #bbc9f1;
  background: #f1f5ff;
}

.sentiment-button:focus-visible {
  outline: 0;
  border-color: rgba(0, 140, 122, 0.26);
  box-shadow: 0 0 0 4px rgba(0, 140, 122, 0.1);
}

.sentiment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 33, 63, 0.44);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 58;
}

.sentiment-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sentiment-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(520px, calc(100vw - 36px));
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(201, 209, 234, 0.88);
  box-shadow: var(--shadow-xl);
  transform: translateX(calc(100% + 28px));
  transition: transform 220ms ease;
  z-index: 59;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.sentiment-drawer.open {
  transform: translateX(0);
}

.sentiment-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.sentiment-head h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.drawer-close {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: #f4f7ff;
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.sentiment-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding-right: 2px;
}

.sentiment-empty {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 20px;
  border-radius: 24px;
  background: #f9fbff;
  border: 1px solid #ebeffa;
  color: var(--muted);
  text-align: center;
}

.sentiment-summary-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fbfcff, #f5f8ff);
  border: 1px solid #e6ebf8;
}

.sentiment-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.sentiment-summary-head h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.sentiment-ticker {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sentiment-summary-copy,
.sentiment-pulled-at {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.sentiment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.sentiment-pill.positive {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.sentiment-pill.mixed {
  background: var(--amber-soft);
  color: #c88409;
}

.sentiment-pill.negative {
  background: var(--danger-soft);
  color: var(--danger);
}

.sentiment-pill.no-major-coverage {
  background: var(--gray-soft);
  color: #68759c;
}

.sentiment-sources-grid {
  display: grid;
  gap: 14px;
}

.sentiment-source-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: white;
  border: 1px solid #e7ebf8;
}

.sentiment-source-card.empty {
  background: #fafcff;
}

.sentiment-source-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sentiment-source-head strong {
  font-size: 0.92rem;
}

.sentiment-source-head span,
.sentiment-source-meta span {
  color: var(--muted);
  font-size: 0.8rem;
}

.sentiment-source-card h3,
.sentiment-source-card p {
  margin: 0;
}

.sentiment-source-card h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.sentiment-source-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.sentiment-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.sentiment-source-link {
  color: #3553df;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.sentiment-source-link:hover {
  text-decoration: underline;
}

.controls-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.save-button,
.remove-button {
  flex: 1 1 0;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.save-button {
  background: rgba(23, 15, 64, 0.08);
  color: var(--ink);
}

.remove-button {
  background: rgba(242, 87, 123, 0.1);
  color: var(--danger);
}

.mobile-board {
  display: none;
}

.mobile-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fbfcff;
  box-shadow: var(--shadow-md);
}

.mobile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

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

.mobile-stat {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: white;
  border: 1px solid #ebeffa;
}

.mobile-stat--wide {
  grid-column: 1 / -1;
}

.mobile-stat span {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mobile-stat strong {
  font-size: 1rem;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 20px;
}

.site-footer {
  padding: 20px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(201, 209, 234, 0.8);
  box-shadow: var(--shadow-md);
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.site-footer a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.info-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(201, 209, 234, 0.8);
  box-shadow: var(--shadow-md);
}

.info-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  align-items: end;
}

.info-head h2 {
  font-size: 1.35rem;
}

.info-head p {
  max-width: 30ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

.alerts-list,
.note-grid {
  display: grid;
  gap: 14px;
}

.alert-card,
.note-card,
.empty-state {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fbfcff;
}

.alert-card strong,
.note-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.alert-card p,
.note-card p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.alert-time {
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 36px));
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  color: white;
  background: rgba(23, 15, 64, 0.94);
  box-shadow: 0 18px 36px rgba(23, 15, 64, 0.24);
  animation:
    toast-in 180ms ease both,
    toast-out 260ms ease 4.7s forwards;
}

.toast.success {
  background: rgba(14, 186, 95, 0.95);
}

.toast.warning {
  background: rgba(232, 160, 44, 0.95);
}

.toast.error {
  background: rgba(231, 76, 112, 0.95);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
  }

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

  .brand-mark {
    width: 104px;
    height: 72px;
  }

  .brand-name {
    font-size: 1.36rem;
  }

  .brand-caption {
    font-size: 0.8rem;
  }

  .sidebar-nav {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: auto;
  }

  .nav-link {
    justify-content: center;
  }

  .nav-link span {
    display: none;
  }

  .sidebar-footer {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 1080px) {
  .panel-toolbar,
  .lower-grid,
  .info-head {
    grid-template-columns: 1fr;
  }

  .toolbar-status,
  .info-head p {
    justify-items: start;
    text-align: left;
  }

  .board-metrics {
    justify-content: start;
  }

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

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-filters {
    width: 100%;
  }

  .sort-control {
    width: 100%;
  }
}

@media (max-width: 860px) {
  .app-shell {
    gap: 14px;
    padding: 12px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 16px;
  }

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

  .brand-mark {
    width: 96px;
    height: 66px;
  }

  .brand-name {
    font-size: 1.28rem;
  }

  .brand-caption {
    font-size: 0.78rem;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar,
  .watchlist-tabs {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .searchbar {
    min-height: 58px;
    padding: 0 16px;
  }

  .searchbar input {
    font-size: 0.96rem;
  }

  .topbar-badge,
  .watchlist-badge {
    min-height: 42px;
    font-size: 0.78rem;
  }

  .watchlist-tabs {
    gap: 12px;
    padding: 12px 14px;
  }

  .tab-row {
    flex-wrap: wrap;
    overflow: visible;
  }

  .tab-chip {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .panel-toolbar {
    gap: 14px;
    padding: 18px 16px;
  }

  .metric-pill {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .check-status {
    font-size: 0.84rem;
  }

  .panel-body,
  .info-card {
    padding: 16px;
  }

  .public-toolbar,
  .add-form,
  .mobile-stats {
    grid-template-columns: 1fr;
  }

  .public-toolbar {
    gap: 12px;
  }

  .table-shell {
    display: none;
  }

  .mobile-board {
    display: grid;
    gap: 14px;
  }

  .mobile-card-head {
    flex-direction: column;
  }

  .mobile-stat--wide {
    grid-column: auto;
  }

  .lower-grid {
    gap: 16px;
  }

  .site-footer {
    padding: 18px;
    font-size: 0.82rem;
  }

  .expanded-chart-row td {
    padding: 0 8px 14px;
  }

  .live-panel-head,
  .live-panel-stats {
    grid-template-columns: 1fr;
  }

  .live-panel-head {
    flex-direction: column;
  }

  .live-panel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-chart-wrap,
  .live-chart {
    min-height: 180px;
    height: 180px;
  }

  .sentiment-drawer {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}
