:root {
  --bg: #070a10;
  --bg-alt: #0c121d;
  --panel: #0d1624;
  --panel-alt: #101c2d;
  --line: #1a2a41;
  --line-strong: #5a88bb;
  --text: #f7fbff;
  --muted: #b8cae0;
  --pos: #33d17a;
  --neg: #ff4d6d;
  --neutral: #a5b2c3;
  --warn: #f2a93b;
  --capitulation: #ff4d6d;
  --neutral_label: #b8c1ce;
  --risk_on: #3ad187;
  --overheat: #f2a93b;
  --banner-stale: #4a3111;
  --banner-partial: #143453;
  --banner-offline: #4b1923;
  --font-ui: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-ui);
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(41, 71, 107, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(41, 71, 107, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 100% -10%, rgba(24, 57, 98, 0.3), transparent 42%),
    linear-gradient(180deg, #06090f, #0a111a 45%, #070a10);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

body {
  letter-spacing: 0.015em;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 50% 50%, rgba(31, 66, 108, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(6, 9, 15, 0.98), rgba(7, 10, 16, 0.99));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.app-loader__label {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #eaf6ff;
  text-shadow: 0 0 14px rgba(89, 179, 255, 0.28);
  animation: app-loader-pulse 900ms ease-in-out infinite;
}

body.app-boot-loading {
  overflow: hidden;
}

body.app-boot-loading .app-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.92);
  backdrop-filter: blur(6px);
}

#header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.18rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #eef6ff;
}

#header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.brand-title {
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
  gap: 0.45rem;
}

.brand-logo {
  height: 1.8rem;
  width: auto;
  border-radius: 4px;
}

.branding-tag {
  font-size: 0.58rem;
  padding: 0.1rem 0.35rem;
  opacity: 0.85;
  border-style: dashed;
}

.brand-credit-chip {
  border: 1px solid rgba(89, 179, 255, 0.62);
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  background: rgba(18, 44, 72, 0.84);
  color: #dff0ff;
  cursor: pointer;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  align-self: flex-start;
}

.brand-credit-chip:hover {
  border-color: rgba(120, 197, 255, 0.9);
  background: rgba(24, 60, 94, 0.9);
}

.brand-credit-chip.brand-credit-chip-copied {
  border-color: rgba(51, 209, 122, 0.7);
  background: rgba(24, 66, 45, 0.88);
  color: #d8ffe9;
}

#last-updated {
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

#conn-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#regime-alert-chip {
  cursor: pointer;
}

#regime-alert-chip[hidden] {
  display: none !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  background: rgba(12, 25, 41, 0.7);
  border-radius: 4px;
  padding: 0.16rem 0.45rem;
  font-size: 0.69rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-ok {
  border-color: rgba(51, 209, 122, 0.45);
  color: #b7ffd7;
}

.status-warn {
  border-color: rgba(242, 169, 59, 0.45);
  color: #ffdb9f;
}

.status-error {
  border-color: rgba(255, 77, 109, 0.45);
  color: #ffc0cd;
}

.status-neutral {
  border-color: rgba(128, 151, 180, 0.45);
  color: #cfdae7;
}

#app-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.tab {
  border: 1px solid var(--line);
  color: #d5e6fa;
  background: rgba(13, 24, 39, 0.9);
  border-radius: 4px;
  padding: 0.34rem 0.62rem;
  min-width: max-content;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

#app-nav .tab {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.tab:hover {
  border-color: var(--line-strong);
  color: #dbebff;
}

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

.tab-active {
  border-color: #59b3ff;
  color: #eaf4ff;
  background: linear-gradient(180deg, rgba(27, 60, 95, 0.75), rgba(10, 25, 40, 0.9));
  box-shadow: inset 0 1px 0 rgba(132, 190, 255, 0.25);
}

#global-banner {
  margin: 0.6rem 0.9rem 0;
  padding: 0.48rem 0.62rem;
  border: 1px solid transparent;
  border-left-width: 3px;
  border-radius: 3px;
  font-size: 0.77rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

#global-banner.banner-hidden {
  display: none;
}

#global-banner.banner-offline {
  background: var(--banner-offline);
  border-color: rgba(255, 77, 109, 0.4);
}

#global-banner.banner-stale {
  background: var(--banner-stale);
  border-color: rgba(242, 169, 59, 0.4);
}

#global-banner.banner-partial {
  background: var(--banner-partial);
  border-color: rgba(89, 179, 255, 0.4);
}

#global-banner.banner-ws {
  background: #143242;
  border-color: rgba(95, 160, 200, 0.4);
}

.regime-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 9, 15, 0.78);
  display: grid;
  place-items: center;
  padding: 0.9rem;
}

.regime-alert-overlay[hidden] {
  display: none !important;
}

.regime-alert-modal {
  width: min(31rem, 100%);
  border: 1px solid rgba(89, 179, 255, 0.58);
  border-radius: 6px;
  background: linear-gradient(165deg, rgba(20, 36, 55, 0.98), rgba(14, 22, 35, 0.99));
  box-shadow: 0 0 0 1px rgba(89, 179, 255, 0.2), 0 14px 42px rgba(0, 0, 0, 0.52);
  padding: 0.74rem 0.76rem;
  display: grid;
  gap: 0.34rem;
}

.regime-alert-modal h2 {
  margin: 0 0 0.16rem;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: #e6f2ff;
}

.regime-alert-summary {
  color: #d1e5fb;
  font-size: 0.73rem;
  line-height: 1.32;
}

.regime-alert-detail {
  border: 1px dashed rgba(132, 178, 226, 0.42);
  border-radius: 3px;
  padding: 0.16rem 0.38rem;
  color: #deecfb;
  font-size: 0.69rem;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.regime-alert-detail[hidden] {
  display: none !important;
}

.regime-alert-note {
  margin: 0.04rem 0 0;
  padding: 0.12rem 0.02rem 0;
  border-top: 1px solid rgba(132, 178, 226, 0.2);
  color: #9fc1df;
  font-size: 0.63rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.regime-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.regime-alert-actions .tab {
  border-color: rgba(132, 178, 226, 0.58);
  background: rgba(26, 50, 77, 0.92);
  color: #ebf5ff;
}

.regime-alert-actions .tab:hover {
  border-color: rgba(160, 200, 242, 0.92);
}

.regime-alert-modal.regime-theme-capitulation {
  border-color: rgba(255, 77, 109, 0.62);
  background: linear-gradient(165deg, rgba(38, 18, 25, 0.98), rgba(17, 13, 21, 0.99));
  box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.2), 0 14px 42px rgba(0, 0, 0, 0.52);
}

.regime-alert-modal.regime-theme-capitulation .regime-alert-summary {
  color: #ffd0db;
}

.regime-alert-modal.regime-theme-capitulation .regime-alert-detail {
  border-color: rgba(232, 137, 162, 0.42);
  color: #f9d9e1;
}

.regime-alert-modal.regime-theme-capitulation .regime-alert-note {
  border-top-color: rgba(232, 137, 162, 0.24);
  color: #f0b8c8;
}

.regime-alert-modal.regime-theme-risk-on {
  border-color: rgba(51, 209, 122, 0.62);
  background: linear-gradient(165deg, rgba(18, 44, 31, 0.98), rgba(12, 24, 18, 0.99));
  box-shadow: 0 0 0 1px rgba(51, 209, 122, 0.2), 0 14px 42px rgba(0, 0, 0, 0.52);
}

.regime-alert-modal.regime-theme-risk-on .regime-alert-summary {
  color: #c6f9dd;
}

.regime-alert-modal.regime-theme-risk-on .regime-alert-detail {
  border-color: rgba(132, 222, 171, 0.42);
  color: #dcffed;
}

.regime-alert-modal.regime-theme-risk-on .regime-alert-note {
  border-top-color: rgba(132, 222, 171, 0.24);
  color: #baf0cf;
}

.regime-alert-modal.regime-theme-overheat {
  border-color: rgba(242, 169, 59, 0.62);
  background: linear-gradient(165deg, rgba(47, 34, 19, 0.98), rgba(22, 18, 12, 0.99));
  box-shadow: 0 0 0 1px rgba(242, 169, 59, 0.2), 0 14px 42px rgba(0, 0, 0, 0.52);
}

.regime-alert-modal.regime-theme-overheat .regime-alert-summary {
  color: #ffe2b1;
}

.regime-alert-modal.regime-theme-overheat .regime-alert-detail {
  border-color: rgba(242, 196, 115, 0.42);
  color: #fff1d7;
}

.regime-alert-modal.regime-theme-overheat .regime-alert-note {
  border-top-color: rgba(242, 196, 115, 0.24);
  color: #f6d8a2;
}

#app-main {
  padding: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

#app-main.gridstack-ready {
  display: block;
}

.tab-panel[hidden] {
  display: none !important;
}

.widget {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  min-height: 0;
}

.widget > .grid-stack-item-content {
  position: relative;
  border: 1px solid #3d638f;
  border-radius: 4px;
  padding: 0.58rem 0.62rem 0.62rem;
  background: linear-gradient(165deg, rgba(30, 50, 77, 0.98), rgba(15, 28, 44, 0.99));
  animation: panel-enter 260ms cubic-bezier(0.2, 0.85, 0.28, 1);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.widget > .grid-stack-item-content::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(107, 176, 255, 0.6), transparent);
  pointer-events: none;
}

.widget h2 {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #d4e3f5;
  font-family: var(--font-mono);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  border-bottom: 1px solid rgba(102, 142, 186, 0.5);
  padding: 0.2rem 0.24rem 0.3rem;
  margin: 0 0 0.52rem;
  border-radius: 3px 3px 0 0;
}

.widget-header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.widget-header-title h2 {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.widget-header-title .tooltip-icon {
  margin-left: 0;
}

.widget-header-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  margin-left: auto;
  flex: 0 0 auto;
}

.widget-header-tools[hidden] {
  display: none !important;
}

.widget-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: #6bb0ff;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.widget-learn-more:hover {
  color: #9accff;
  text-decoration: underline;
}

.learn-more-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(125, 179, 236, 0.65);
  border-radius: 999px;
  background: rgba(11, 25, 40, 0.72);
  color: #cfe6ff;
  font-size: 0.68rem;
  line-height: 1;
  font-family: var(--font-mono);
  font-weight: 700;
}

.tooltip-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(125, 179, 236, 0.65);
  border-radius: 999px;
  background: rgba(11, 25, 40, 0.72);
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: help;
  user-select: none;
  flex: 0 0 auto;
}

.tooltip-icon:not([data-tooltip-text]) {
  display: none;
}

.tooltip-icon:focus-visible {
  outline: 1px solid rgba(120, 188, 255, 0.88);
  outline-offset: 2px;
  border-radius: 2px;
}

.widget-tooltip-layer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: max-content;
  max-width: min(20rem, 76vw);
  border: 1px solid rgba(126, 183, 236, 0.85);
  border-radius: 4px;
  padding: 0.4rem 0.58rem;
  background: rgba(8, 15, 25, 0.98);
  color: #d6e6f8;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.62);
  pointer-events: none;
  white-space: normal;
  line-height: 1.3;
  font-size: 0.68rem;
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: normal;
}

.widget-tooltip-layer[hidden] {
  display: none !important;
}

#app-main.gridstack-ready .widget-header-title {
  cursor: grab;
}

#app-main.gridstack-ready .widget-header-title:active {
  cursor: grabbing;
}

#app-main.gridstack-ready .widget-header:hover {
  text-shadow: 0 0 8px rgba(132, 190, 255, 0.4);
}

.widget-content {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

#app-main.gridstack-ready .grid-stack-item-content {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 146, 187, 0.45) rgba(11, 19, 30, 0.5);
}

#app-main.gridstack-ready .widget-filtered > .grid-stack-item-content {
  opacity: 0.28;
  filter: saturate(0.5);
  border-color: rgba(76, 105, 142, 0.85);
}

#app-main.gridstack-ready .widget-highlighted > .grid-stack-item-content {
  border-color: rgba(89, 179, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(89, 179, 255, 0.25);
}

#app-main.gridstack-ready .widget .ui-resizable-se {
  opacity: 0.4;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

#app-main.gridstack-ready .widget:hover .ui-resizable-se {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(89, 179, 255, 0.6)) brightness(1.2);
}

.kpi-value {
  font-size: clamp(1.3rem, 2.4vw, 1.95rem);
  line-height: 1.05;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.15rem;
}

.kpi-label {
  color: #c3d4e8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
  margin-bottom: 0.3rem;
}

#w_regime .regime-score {
  font-size: clamp(1.95rem, 3.4vw, 2.85rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-shadow: 0 0 22px rgba(121, 182, 244, 0.18);
  margin-bottom: 0.2rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
}

#w_regime .regime-score-value {
  color: #f7fbff;
}

#w_regime .regime-score-suffix {
  color: #b8cae0;
  font-size: clamp(0.95rem, 1.65vw, 1.4rem);
  font-weight: 600;
}

#w_regime .regime-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.28rem;
}

#w_regime .regime-label-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(141, 170, 204, 0.62);
  border-radius: 3px;
  padding: 0.13rem 0.42rem;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  font-family: var(--font-mono);
  font-weight: 700;
}

#w_regime .regime-label-neutral {
  border-color: rgba(136, 174, 212, 0.78);
  color: #e6f2ff;
  background: rgba(73, 108, 148, 0.22);
}

#w_regime .regime-label-capitulation {
  border-color: rgba(255, 77, 109, 0.72);
  color: #ffd0d9;
  background: rgba(255, 77, 109, 0.18);
}

#w_regime .regime-label-risk-on {
  border-color: rgba(51, 209, 122, 0.72);
  color: #c6f9dd;
  background: rgba(51, 209, 122, 0.15);
}

#w_regime .regime-label-overheat {
  border-color: rgba(242, 169, 59, 0.72);
  color: #ffe2b1;
  background: rgba(242, 169, 59, 0.15);
}

#w_regime .regime-confidence {
  color: #d2e6fa;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

#w_regime .regime-trend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-bottom: 0.24rem;
}

#w_regime .regime-trend-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(97, 136, 176, 0.6);
  border-radius: 3px;
  padding: 0.12rem 0.34rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  font-family: var(--font-mono);
  background: rgba(16, 31, 49, 0.62);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.05rem 0.7rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 1.35rem;
  border-bottom: 1px dashed rgba(118, 157, 200, 0.54);
}

.metric-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 0.77rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mini-chart {
  display: grid;
  gap: 0.22rem;
  margin: 0.08rem 0 0.22rem;
}

.mini-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 6rem) minmax(0, 1fr) minmax(3.6rem, auto);
  gap: 0.42rem;
  align-items: center;
}

.mini-chart-label {
  color: #b7cae0;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-chart-track {
  position: relative;
  height: 0.48rem;
  border: 1px solid rgba(117, 155, 197, 0.52);
  border-radius: 2px;
  background: rgba(11, 23, 36, 0.92);
  overflow: hidden;
}

.mini-chart-axis {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(127, 163, 201, 0.54);
}

.mini-chart-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  transition: width 180ms ease, left 180ms ease;
}

.mini-chart-fill-pos {
  background: linear-gradient(90deg, rgba(33, 115, 70, 0.8), rgba(51, 209, 122, 0.95));
}

.mini-chart-fill-neg {
  background: linear-gradient(90deg, rgba(176, 42, 71, 0.95), rgba(255, 77, 109, 0.82));
}

.mini-chart-fill-neutral {
  background: rgba(127, 156, 188, 0.85);
}

.mini-chart-value {
  color: #d0e1f5;
  font-size: 0.67rem;
  line-height: 1;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sentiment-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11.5rem;
  border: 1px solid rgba(90, 170, 255, 0.55);
  border-radius: 3px;
  padding: 0.12rem 0.34rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(16, 31, 49, 0.85);
  font-size: 0.69rem;
}

.sentiment-marker-neutral {
  border-color: rgba(141, 170, 204, 0.55);
  color: #d1e2f4;
}

.sentiment-marker-good {
  border-color: rgba(51, 209, 122, 0.6);
  background: rgba(51, 209, 122, 0.13);
  color: #bcf7d8;
}

.sentiment-marker-warn {
  border-color: rgba(242, 169, 59, 0.6);
  background: rgba(242, 169, 59, 0.14);
  color: #ffdfad;
}

.sentiment-marker-hot {
  border-color: rgba(255, 120, 74, 0.62);
  background: rgba(255, 120, 74, 0.14);
  color: #ffd1ba;
}

.sentiment-marker-critical {
  border-color: rgba(255, 77, 109, 0.62);
  background: rgba(255, 77, 109, 0.16);
  color: #ffc9d4;
}

.pos {
  color: var(--pos);
}

.neg {
  color: var(--neg);
}

.neutral {
  color: var(--neutral);
}

.state-muted {
  opacity: 0.72;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin-right: 0.3rem;
  margin-bottom: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.12rem 0.3rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.pill-critical {
  background: rgba(255, 77, 109, 0.16);
  border-color: rgba(255, 77, 109, 0.5);
}

.pill-warn {
  background: rgba(242, 169, 59, 0.13);
  border-color: rgba(242, 169, 59, 0.5);
}

.pill-info {
  background: rgba(90, 170, 255, 0.14);
  border-color: rgba(90, 170, 255, 0.5);
}

.pill-unknown {
  background: rgba(145, 161, 182, 0.14);
  border-color: rgba(145, 161, 182, 0.45);
}

.reason-list {
  display: grid;
  gap: 0.2rem;
}

.reason-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

#w_regime .reason-item > .sentiment-marker {
  width: 12.6rem;
  min-width: 12.6rem;
  justify-content: center;
}

#w_regime .reason-item {
  flex-wrap: nowrap;
  align-items: center;
}

#w_regime .reason-desc {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reason-desc {
  color: #c8d9ed;
  font-size: 0.72rem;
}

.feed-list {
  display: grid;
  gap: 0.35rem;
}

.feed-item {
  border: 1px solid rgba(112, 152, 198, 0.66);
  background: rgba(14, 24, 38, 0.94);
  border-radius: 3px;
  padding: 0.4rem 0.48rem;
}

.feed-title {
  color: #f3f9ff;
  font-size: 0.76rem;
  line-height: 1.32;
}

.feed-meta {
  margin-top: 0.18rem;
  color: #c0d4ea;
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

.affiliate-list {
  display: grid;
  gap: 0.4rem;
}

.affiliate-item {
  display: grid;
  grid-template-columns: 4.1rem 1fr;
  gap: 0.5rem;
  border: 1px solid rgba(112, 152, 198, 0.66);
  background: rgba(14, 24, 38, 0.94);
  border-radius: 3px;
  padding: 0.42rem 0.45rem;
  align-items: start;
}

.affiliate-thumb {
  width: 4.1rem;
  height: 4.1rem;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(95, 145, 195, 0.55);
  background: #11263c;
}

.affiliate-body {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.affiliate-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
}

.affiliate-subtitle {
  color: #99c0e8;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.affiliate-title {
  color: #f3f9ff;
  font-size: 0.78rem;
  line-height: 1.28;
  font-weight: 600;
  min-width: 0;
}

.affiliate-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.affiliate-rating-stars {
  position: relative;
  display: inline-block;
  color: rgba(242, 193, 75, 0.28);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}

.affiliate-rating-stars::before {
  content: "\2605\2605\2605\2605\2605";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rating-fill, 0%);
  overflow: hidden;
  color: #f2c14b;
  white-space: nowrap;
}

.affiliate-rating-value {
  color: #d8e9fb;
  font-size: 0.62rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.affiliate-description {
  color: #ccdeef;
  font-size: 0.7rem;
  line-height: 1.34;
}

.affiliate-offer {
  color: #c2f8dc;
  font-size: 0.68rem;
  line-height: 1.24;
  font-family: var(--font-mono);
}

.affiliate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  width: fit-content;
  border: 1px solid rgba(89, 179, 255, 0.78);
  border-radius: 3px;
  padding: 0.17rem 0.46rem;
  color: #e7f4ff;
  background: rgba(24, 58, 93, 0.85);
  text-decoration: none;
  font-size: 0.66rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.affiliate-cta:hover {
  border-color: rgba(108, 195, 255, 0.95);
  background: rgba(31, 72, 112, 0.9);
}

.branding-widget {
  display: grid;
  gap: 0.42rem;
}

.branding-app-name {
  color: #d8ecff;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.branding-description {
  color: #d4e8fd;
  font-size: 0.74rem;
  line-height: 1.38;
}

.branding-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  justify-self: start;
  border: 1px solid rgba(89, 179, 255, 0.78);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  color: #ecf6ff;
  background: linear-gradient(120deg, rgba(20, 60, 96, 0.95), rgba(15, 40, 67, 0.95));
  cursor: pointer;
  font-size: 0.67rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.branding-copy-btn:hover {
  border-color: rgba(120, 198, 255, 0.95);
}

.branding-copy-btn.branding-copy-btn-copied {
  border-color: rgba(51, 209, 122, 0.7);
  background: linear-gradient(120deg, rgba(24, 66, 45, 0.95), rgba(16, 49, 34, 0.95));
  color: #dbffec;
}

.branding-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.branding-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  width: fit-content;
  justify-self: start;
  border: 1px solid rgba(112, 152, 198, 0.66);
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  text-decoration: none;
  background: rgba(14, 30, 47, 0.9);
  color: #deedfc;
  font-size: 0.63rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.branding-social-link:hover {
  border-color: rgba(136, 184, 230, 0.92);
}

.branding-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.28rem;
  height: 1.28rem;
  border: 1px solid rgba(133, 179, 223, 0.62);
  border-radius: 999px;
  background: rgba(19, 44, 69, 0.85);
  font-size: 0.56rem;
  font-weight: 700;
}

.branding-social-label {
  line-height: 1;
}

.placeholder {
  color: #c7dcf2;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

#debug-panel {
  margin: 0 0.9rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(11, 17, 29, 0.94);
  padding: 0.58rem 0.62rem;
}

#debug-panel h2 {
  margin: 0 0 0.48rem;
  color: #95acc9;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#debug-panel pre {
  margin: 0;
  white-space: pre-wrap;
  color: #e1eefb;
  font-size: 0.71rem;
  font-family: var(--font-mono);
  line-height: 1.36;
}

#app-footer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin: 0;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(6, 9, 15, 0.94);
  backdrop-filter: blur(8px);
  display: grid;
  gap: 0.45rem;
}

#footer-disclaimer {
  color: #c7d9ee;
  font-size: 0.69rem;
  letter-spacing: 0.02em;
  line-height: 1.34;
}

#footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(112, 152, 198, 0.66);
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  text-decoration: none;
  background: rgba(14, 30, 47, 0.9);
  color: #deedfc;
  font-size: 0.64rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-link:hover {
  border-color: rgba(136, 184, 230, 0.92);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-loader-pulse {
  0%,
  100% {
    opacity: 0.52;
    filter: saturate(0.9);
  }

  50% {
    opacity: 1;
    filter: saturate(1.08);
  }
}

@media (min-width: 720px) {
  #app-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #app-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #w_regime,
  #w_onchain,
  #w_narratives {
    grid-column: 1 / -1;
  }

  #w_aff_exchanges,
  #w_aff_bots,
  #w_aff_wallets,
  #w_aff_editors_pick,
  #w_aff_onchain_gaming {
    grid-column: span 6;
  }
}

@media (min-width: 1024px) {
  #app-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #app-main:not(.gridstack-ready) {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
  }

  #w_regime {
    grid-column: 1 / -1;
  }

  #w_market {
    grid-column: 1 / 8;
  }

  #w_derivatives {
    grid-column: 8 / -1;
  }

  #w_sentiment {
    grid-column: 1 / 6;
  }

  #w_sectors {
    grid-column: 6 / -1;
  }

  #w_defi {
    grid-column: 1 / 7;
  }

  #w_defi_protocols {
    grid-column: 7 / -1;
  }

  #w_onchain {
    grid-column: 1 / -1;
  }

  #w_narratives {
    grid-column: 1 / -1;
  }

  #w_macro {
    grid-column: 1 / 5;
  }

  #w_macro_events {
    grid-column: 5 / -1;
  }

  #w_aff_exchanges {
    grid-column: 1 / 7;
  }

  #w_aff_bots {
    grid-column: 7 / -1;
  }

  #w_aff_onchain_gaming {
    grid-column: 1 / 7;
  }

  #w_aff_wallets {
    grid-column: 7 / -1;
  }

  #w_aff_editors_pick {
    grid-column: 1 / 7;
  }

  #w_branding {
    grid-column: 7 / -1;
  }
}

@media (max-width: 1023px) {
  #app-main.gridstack-ready .widget-header-title {
    cursor: default;
  }
}
