:root {
  --bg: #f4f7f6;
  --ink: #17211f;
  --muted: #65726f;
  --panel: #ffffff;
  --line: #d8e0de;
  --green: #139b63;
  --red: #c83f4a;
  --teal: #1c8b91;
  --yellow: #d5a11e;
  --heading-soft: #e6c66f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body::before {
  content: "Ares focus experiment: BTCUSDC 15m asset visibile e motore principale | live OFF, micro OFF, promotion OFF";
  display: block;
  position: sticky;
  top: 0;
  z-index: 3000;
  padding: 10px 16px;
  border-bottom: 1px solid #bdd6cc;
  background: #edf7f3;
  color: #18342d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 112px 0 36px;
}

.topbar,
.status-band,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px 18px;
  gap: 20px;
}

.real-mode-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid #efc0c5;
  border-radius: 8px;
  background: #fff0f2;
  color: #8c1d28;
}

.real-mode-banner strong {
  font-size: 16px;
  font-weight: 800;
}

.real-mode-banner span {
  font-size: 14px;
  line-height: 1.4;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d8c28f;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff7e9 0%, #efe1bb 100%);
  box-shadow: 0 8px 22px rgba(119, 94, 29, 0.12);
  text-align: center;
}

.token-logo {
  width: 360px;
  height: 360px;
  object-fit: contain;
}

.text-logo {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17211f;
  color: #ffffff;
  font-weight: 800;
}

.image-logo {
  border-radius: 8px;
  border: 1px solid #b4934d;
  background: #12171a;
  box-shadow: 0 4px 12px rgba(23, 33, 31, 0.14);
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.token-name {
  margin: 0 0 6px;
  color: #23312e;
  font-size: 16px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  color: var(--green);
}

h2 {
  font-size: 20px;
}

.mode-pill {
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e4f3ed;
  color: var(--green);
  text-align: center;
  font-weight: 700;
}

.mode-pill.live {
  background: #f7e5e7;
  color: var(--red);
}

.topbar-actions {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-left: 0;
}

.token-switcher {
  min-width: 320px;
  max-width: 680px;
  width: 100%;
  margin-left: 0;
}

.token-switcher label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.token-switcher-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.token-switcher-row select,
.token-switcher-row button {
  min-height: 40px;
  border-radius: 8px;
  font: inherit;
}

.token-switcher-row select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.token-switcher-row button {
  padding: 8px 14px;
  border: 0;
  background: #9dd2d5;
  color: #ffffff;
  font-weight: 700;
}

.token-add-box {
  margin-top: 10px;
}

.secondary-inline-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f0;
  color: #23312e;
  font-weight: 700;
}

.token-add-form {
  display: grid;
  grid-template-columns: 100px 1fr 1.4fr auto;
  gap: 8px;
  margin-top: 10px;
}

.token-add-form input,
.token-add-form button {
  min-height: 40px;
  border-radius: 8px;
  font: inherit;
}

.token-add-form input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.token-add-form button {
  padding: 8px 14px;
  border: 0;
  background: #9dd2d5;
  color: #ffffff;
  font-weight: 700;
}

.hidden {
  display: none;
}

.dashboard-view-nav {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  width: min(180px, calc(100vw - 24px));
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 13, 16, 0.96);
  border-color: #2b3130;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.dashboard-view-caption {
  margin: 0 0 8px;
  color: #d7c06d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-view-nav-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-view-button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #d2bb73;
  border-radius: 8px;
  background: #efe1bb;
  color: #064f35;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.dashboard-view-button:hover {
  background: #f4e8c4;
  color: #043820;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.dashboard-view-button.is-active {
  background: #e6c66f;
  color: #043820;
  border-color: #f0d685;
  box-shadow: inset 0 0 0 1px rgba(4, 56, 32, 0.22);
}

/* Timeframe navigation grouping: ARES_M15 buttons are green, ARES_H1 buttons are blue. */
.dashboard-view-button[data-dashboard-view-button="paper_trading"],
.dashboard-view-button[data-dashboard-view-button="ares_upgrade"] {
  border-color: #7fcf9d;
  background: linear-gradient(180deg, #dcf7e4 0%, #a9e4bd 100%);
  color: #073d24;
}

.dashboard-view-button[data-dashboard-view-button="paper_trading"]:hover,
.dashboard-view-button[data-dashboard-view-button="ares_upgrade"]:hover {
  border-color: #91e6b0;
  background: linear-gradient(180deg, #ecfff1 0%, #b8f0ca 100%);
  color: #052d1b;
}

.dashboard-view-button.is-active[data-dashboard-view-button="paper_trading"],
.dashboard-view-button.active[data-dashboard-view-button="paper_trading"],
.dashboard-view-button.is-active[data-dashboard-view-button="ares_upgrade"],
.dashboard-view-button.active[data-dashboard-view-button="ares_upgrade"] {
  border-color: #6ed493;
  background: linear-gradient(180deg, #8ee8a9 0%, #3dbd70 100%);
  color: #031d12;
  box-shadow: inset 0 0 0 1px rgba(3, 29, 18, 0.22), 0 0 18px rgba(61, 189, 112, 0.2);
}

.dashboard-view-button[data-dashboard-view-button="paper_trade_h1"],
.dashboard-view-button[data-dashboard-view-button="paper_trade_h1_upgrade"] {
  border-color: #7ccaf4;
  background: linear-gradient(180deg, #dff5ff 0%, #a7ddf6 100%);
  color: #06344d;
}

.dashboard-view-button[data-dashboard-view-button="paper_trade_h1"]:hover,
.dashboard-view-button[data-dashboard-view-button="paper_trade_h1_upgrade"]:hover {
  border-color: #9adaff;
  background: linear-gradient(180deg, #effbff 0%, #baeaff 100%);
  color: #04273a;
}

.dashboard-view-button.is-active[data-dashboard-view-button="paper_trade_h1"],
.dashboard-view-button.active[data-dashboard-view-button="paper_trade_h1"],
.dashboard-view-button.is-active[data-dashboard-view-button="paper_trade_h1_upgrade"],
.dashboard-view-button.active[data-dashboard-view-button="paper_trade_h1_upgrade"] {
  border-color: #68c8ff;
  background: linear-gradient(180deg, #91ddff 0%, #3aa8e7 100%);
  color: #031b2a;
  box-shadow: inset 0 0 0 1px rgba(3, 27, 42, 0.22), 0 0 18px rgba(58, 168, 231, 0.22);
}

.dashboard-view-button.oasis-review-nav-button {
  border-color: #fff0a8;
  background: linear-gradient(180deg, #ffe27a 0%, #d5a82b 100%);
  color: #071018;
  box-shadow: 0 0 0 1px rgba(255, 216, 106, 0.22), 0 0 18px rgba(255, 216, 106, 0.2);
}

.dashboard-view-button.oasis-review-nav-button:hover,
.dashboard-view-button.oasis-review-nav-button.is-active,
.dashboard-view-button.oasis-review-nav-button.active {
  border-color: #fff6c7;
  background: linear-gradient(180deg, #fff0a8 0%, #e0b83a 100%);
  color: #05080c;
  box-shadow: 0 0 0 1px rgba(255, 240, 168, 0.35), 0 0 24px rgba(255, 216, 106, 0.28);
}

.page-section {
  margin-top: 18px;
}

body[data-dashboard-view-default="home"] [data-dashboard-view]:not([data-dashboard-view="home"]) {
  display: none !important;
}

body[data-dashboard-view-default="market"] [data-dashboard-view]:not([data-dashboard-view="market"]) {
  display: none !important;
}

body[data-dashboard-view-default="ares"] [data-dashboard-view]:not([data-dashboard-view="ares"]) {
  display: none !important;
}

body[data-dashboard-view-default="talk"] [data-dashboard-view]:not([data-dashboard-view="talk"]) {
  display: none !important;
}

body[data-dashboard-view-default="diary"] [data-dashboard-view]:not([data-dashboard-view="diary"]) {
  display: none !important;
}

.dashboard-view-hint {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wallet-badge {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wallet-badge.readonly {
  background: #edf1f0;
  color: #23312e;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
}

.status-band > div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.status-band > div:last-child {
  border-right: 0;
}

.big-number {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.status-quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.status-quote-card {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.status-quote-card span,
.status-quote-card small {
  display: block;
  overflow-wrap: anywhere;
}

.status-quote-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-quote-card strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: clamp(15px, 1.5vw, 20px);
  line-height: 1.15;
}

.status-quote-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-quote-card .positive {
  color: var(--green);
}

.status-quote-card .negative {
  color: var(--red);
}

.status-quote-grid + .big-number {
  display: none;
}

.subvalue {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.primary-panel {
  grid-row: span 2;
}

.panel-subsection {
  margin-bottom: 16px;
}

.panel-header-tight {
  margin-bottom: 10px;
}

.subheading {
  font-size: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.inline-action-form {
  margin: 0;
}

.timestamp {
  color: var(--muted);
  font-size: 13px;
}

.reason {
  min-height: 54px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: #23312e;
  line-height: 1.45;
}

.decision-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.audit-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.audit-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.audit-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  color: #17211f;
}

.audit-card p {
  margin: 0;
}

.preview-card {
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.preview-card strong {
  display: block;
  margin-bottom: 6px;
}

.operating-profile-card {
  display: grid;
  gap: 8px;
}

.operating-profile-card .form-help {
  margin: 0;
}

.operating-profile-card .compact-insight-list {
  margin: 0;
}

.live-trade-card {
  margin-top: 4px;
}

.inline-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.inline-link:hover {
  text-decoration: underline;
}

.compact-stats-grid {
  margin-top: 12px;
  margin-bottom: 12px;
}

.compact-scroll-wrap {
  max-height: 360px;
}

.compact-reason {
  min-height: 0;
  margin-bottom: 12px;
}

.auto-interpretation {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.auto-interpretation strong {
  display: block;
  margin-bottom: 6px;
  color: #17211f;
  font-size: 16px;
}

.auto-interpretation p {
  margin: 0;
  color: #51615d;
  line-height: 1.45;
}

.compact-insight-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #51615d;
}

.compact-insight-list li + li {
  margin-top: 4px;
}

.venue-pair-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.venue-pair-card {
  min-height: 112px;
}

.venue-pair-card small {
  display: block;
  margin-top: 8px;
  color: #51615d;
  line-height: 1.4;
}

.readiness-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.readiness-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.readiness-pill {
  padding: 6px 10px;
  border-radius: 8px;
  background: #f2e6bf;
  color: #6d530c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.readiness-pill.ready {
  background: #e4f3ed;
  color: var(--green);
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.meter-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meter-grid span,
.config-list dt {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.meter-grid strong,
.config-list dd {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

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

.chart-header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.timeframe-pill {
  border: 1px solid var(--line);
  padding: 7px 11px;
  border-radius: 8px;
  background: #111820;
  color: #dfe8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.timeframe-pill.active {
  background: rgba(23, 127, 134, 0.24);
  color: #f6fbff;
  border-color: rgba(103, 220, 228, 0.55);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.live-dot {
  background: #60d7ff;
}

.buy-dot {
  background: var(--green);
}

.sell-dot {
  background: var(--red);
}

.rsi-dot {
  background: #ffcf66;
}

.config-list {
  margin: 0;
}

.config-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.config-list div:last-child {
  border-bottom: 0;
}

.steps {
  margin: 0;
  padding-left: 20px;
  color: #273633;
  line-height: 1.6;
}

.position-state {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-weight: 700;
}

.position-state.open {
  background: #e4f3ed;
  color: var(--green);
}

.trade-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compact-form {
  margin-top: 4px;
}

.spartan-ask-form {
  display: grid;
  gap: 10px;
}

.spartan-ask-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.spartan-answer-card {
  margin: 0;
}

.spartan-answer-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 4px;
}

.spartan-answer-state,
.spartan-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
  color: #23312e;
  font-size: 12px;
  font-weight: 700;
}

.spartan-answer-badge[hidden] {
  display: none;
}

.ares-attachment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ares-attachment-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ares-secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #57b7ff;
  border-radius: 8px;
  background: #07345a;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.ares-secondary-button:hover {
  border-color: #f3d36b;
  background: #0b4c78;
  color: #ffffff;
}

.ares-attachment-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ares-attachment-status[data-tone="ready"] {
  border-color: rgba(19, 155, 99, 0.35);
  background: rgba(19, 155, 99, 0.08);
  color: var(--green);
}

.ares-attachment-status[data-tone="error"] {
  border-color: rgba(200, 63, 74, 0.35);
  background: rgba(200, 63, 74, 0.08);
  color: var(--red);
}

.ares-prompt-debug {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  overflow: hidden;
}

.ares-prompt-debug[hidden] {
  display: none;
}

.ares-prompt-debug summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 800;
}

.ares-prompt-meta {
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ares-prompt-block {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.ares-prompt-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.ares-prompt-block pre {
  max-height: 360px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  color: #eaf2f1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 Consolas, "Liberation Mono", monospace;
}

.spartan-answer-state.is-thinking::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2c7864;
  box-shadow: 0 0 0 0 rgba(44, 120, 100, 0.45);
  animation: spartan-pulse 1.4s ease-in-out infinite;
}

.spartan-answer-card.is-thinking {
  border-color: rgba(44, 120, 100, 0.35);
  box-shadow: 0 0 0 1px rgba(44, 120, 100, 0.08);
}

.spartan-answer-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.spartan-answer-body p {
  margin: 0;
}

.spartan-answer-paragraph {
  line-height: 1.58;
}

.spartan-answer-inline-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.spartan-answer-inline-list li {
  line-height: 1.5;
}

.spartan-answer-note {
  padding: 10px 12px;
  border: 1px solid rgba(224, 180, 74, 0.25);
  border-radius: 8px;
  background: rgba(224, 180, 74, 0.08);
  color: #5f4b13;
  line-height: 1.5;
}

.spartan-answer-lesson-grid {
  display: grid;
  gap: 10px;
}

.spartan-answer-lesson {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f8;
}

.spartan-answer-lesson-header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.spartan-answer-lesson-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(44, 120, 100, 0.28);
  border-radius: 8px;
  background: rgba(44, 120, 100, 0.10);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.spartan-answer-lesson-title-wrap {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.spartan-answer-lesson-title-wrap strong {
  line-height: 1.25;
}

.spartan-answer-lesson-source {
  color: #62716d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.spartan-answer-lesson-excerpt {
  color: #34443f;
  line-height: 1.55;
}

.spartan-answer-section-grid {
  display: grid;
  gap: 8px;
}

.spartan-answer-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(44, 120, 100, 0.18);
  border-radius: 8px;
  background: rgba(44, 120, 100, 0.05);
}

.spartan-answer-section-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.spartan-answer-details {
  display: grid;
  gap: 8px;
}

.spartan-answer-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

@keyframes spartan-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(44, 120, 100, 0.40);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(44, 120, 100, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(44, 120, 100, 0);
  }
}

.spartan-answer-evidence {
  margin: 0;
  padding-left: 18px;
  color: #23312e;
}

.spartan-answer-evidence[hidden] {
  display: none;
}

.spartan-answer-evidence li {
  margin-bottom: 6px;
  line-height: 1.45;
}

.spartan-answer-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.spartan-answer-suggestions[hidden] {
  display: none;
}

.spartan-suggestion-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f0;
  color: #23312e;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.spartan-suggestion-button:hover {
  background: #e4ecea;
}

.wallet-card {
  display: grid;
  gap: 12px;
}

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

.wallet-pill {
  padding: 6px 10px;
  border-radius: 8px;
  background: #edf1f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wallet-pill.ready {
  background: #e4f3ed;
  color: var(--green);
}

.wallet-pill.warning {
  background: #f2e6bf;
  color: #6d530c;
}

.wallet-network {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-address {
  min-height: 46px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.wallet-help {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wallet-actions button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.wallet-actions button.secondary {
  background: #edf1f0;
  color: #23312e;
}

.wallet-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.trade-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.form-help {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.4;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.size-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.paper-capital-row {
  align-items: end;
}

.smart-position-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smart-position-row button,
.smart-position-card,
.smart-position-checkbox {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151a;
  color: var(--ink);
  font-weight: 700;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.smart-position-card {
  margin-top: 4px;
}

.futures-params-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.futures-param-field {
  display: grid;
  gap: 6px;
}

.futures-param-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.risk-context-field {
  margin-top: 8px;
}

.risk-context-field textarea {
  width: 100%;
  min-height: 56px;
  max-height: 96px;
  padding: 10px 12px;
  border: 1px solid #2c3738;
  border-radius: 8px;
  background: #10151a;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
  resize: vertical;
}

.risk-context-field textarea:focus-visible {
  outline: 2px solid #d8b85b;
  outline-offset: 1px;
  border-color: #d8b85b;
}

.input-row input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.input-row select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

.input-row button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.single-action-row {
  grid-template-columns: 1fr;
}

.danger-button {
  background: var(--red) !important;
  color: #ffffff;
}

.reactivate-button {
  background: var(--green) !important;
  color: #ffffff;
}

.danger-form .save-message {
  min-height: 34px;
}

.save-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf1f0;
  font-size: 13px;
}

.table-panel {
  margin-top: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

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

.stat-card strong {
  font-size: 22px;
  font-weight: 800;
}

.home-fleet-panel {
  margin-top: 16px;
}

.home-fleet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.home-fleet-grid .stat-card strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}

.home-fleet-table-wrap {
  margin-top: 8px;
}

.home-fleet-table th,
.home-fleet-table td {
  white-space: normal;
}

.fleet-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.fleet-chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080c12;
  padding: 12px;
  min-width: 0;
}

.fleet-chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.fleet-chart-card-head strong,
.fleet-chart-card-head span {
  display: block;
}

.fleet-chart-card-head strong {
  color: #eef5fb;
  font-size: 16px;
}

.fleet-chart-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.fleet-chart-score {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #dce8f2;
  font-size: 12px;
  white-space: nowrap;
}

.fleet-chart-card canvas {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.stats-table-wrap {
  margin-top: 8px;
}

.scroll-table-wrap {
  display: block;
  height: 430px;
  max-height: 430px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scroll-table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.scroll-table-wrap table {
  margin: 0;
}

.double-chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

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

.ai-cell-stack {
  display: grid;
  gap: 4px;
}

.ai-cell-subtle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
  color: #23312e;
  font-size: 11px;
  font-weight: 700;
}

.ai-mini-badge.is-source {
  background: #edf5f3;
  border-color: #c9dfd8;
  color: #1f6b55;
}

.ai-mini-badge.is-mode {
  background: #ecf4ff;
  border-color: #c7dbf4;
  color: #245b9b;
}

.ai-mini-badge.is-guard,
.ai-mini-badge.is-veto {
  background: #fff3dd;
  border-color: #ead29a;
  color: #8c6410;
}

@media (max-width: 820px) {
  .topbar,
  .brand,
  .chart-header-side {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    gap: 14px;
  }

  .brand {
    align-items: center;
    text-align: center;
  }

  .token-logo {
    width: 220px;
    height: 220px;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
    margin-left: 0;
  }

  .token-switcher {
    min-width: 0;
    width: 100%;
  }

  .status-band,
  .grid,
  .stats-grid,
  .home-fleet-grid,
  .fleet-chart-grid,
  .decision-audit-grid,
  .double-chart,
  .chart-context-strip,
  .meter-grid,
  .input-row,
  .futures-params-row,
  .size-config-row,
  .token-switcher-row,
  .token-add-form {
    grid-template-columns: 1fr;
  }

  .status-band > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-band > div:last-child {
    border-bottom: 0;
  }
}

/* Dashboard layout refresh */

body {
  background:
    radial-gradient(circle at top, rgba(28, 139, 145, 0.06), transparent 28%),
    linear-gradient(180deg, #f5f8f7 0%, #eef3f1 100%);
}

.app-shell {
  width: min(1460px, calc(100% - 40px));
  padding: 28px 0 42px;
}

.topbar,
.status-band,
.panel {
  box-shadow: 0 12px 28px rgba(23, 33, 31, 0.05);
}

.topbar {
  display: grid;
  gap: 24px;
  padding: 30px 32px;
}

.brand-shell {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(100%, 1080px);
  margin: 0 auto;
  text-align: center;
}

.hero-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 860px;
}

.hero-subtitle {
  margin: 0;
  max-width: 760px;
  color: #4f5f5b;
  font-size: 16px;
  line-height: 1.6;
}

.token-logo {
  width: min(560px, 78vw);
  max-width: 100%;
  height: auto;
  max-height: 280px;
}

.token-name {
  font-size: 18px;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 22px;
}

.topbar-actions {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.topbar-card {
  min-height: 132px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  box-shadow: 0 6px 18px rgba(23, 33, 31, 0.04);
}

body[data-dashboard-view-default="market"] .topbar-actions,
body[data-dashboard-view-default="ares"] .topbar-actions,
body[data-dashboard-view-default="talk"] .topbar-actions,
body[data-dashboard-view-default="diary"] .topbar-actions {
  display: none;
}

body[data-dashboard-view-default="market"] .topbar,
body[data-dashboard-view-default="ares"] .topbar,
body[data-dashboard-view-default="talk"] .topbar,
body[data-dashboard-view-default="diary"] .topbar {
  padding: 22px 24px;
}

body[data-dashboard-view-default="market"] .brand-shell,
body[data-dashboard-view-default="ares"] .brand-shell,
body[data-dashboard-view-default="talk"] .brand-shell,
body[data-dashboard-view-default="diary"] .brand-shell {
  gap: 12px;
  max-width: 840px;
}

body[data-dashboard-view-default="market"] .token-logo,
body[data-dashboard-view-default="ares"] .token-logo,
body[data-dashboard-view-default="talk"] .token-logo,
body[data-dashboard-view-default="diary"] .token-logo {
  width: min(360px, 58vw);
  max-height: 180px;
}

body[data-dashboard-view-default="market"] .hero-subtitle,
body[data-dashboard-view-default="ares"] .hero-subtitle,
body[data-dashboard-view-default="talk"] .hero-subtitle,
body[data-dashboard-view-default="diary"] .hero-subtitle {
  max-width: 620px;
}

body[data-dashboard-view-default="market"] h1,
body[data-dashboard-view-default="ares"] h1,
body[data-dashboard-view-default="talk"] h1,
body[data-dashboard-view-default="diary"] h1 {
  font-size: 32px;
}

.talk-page {
  max-width: 860px;
  margin-right: auto;
  margin-left: auto;
}

.topbar-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
}

.mode-card .mode-pill {
  margin-top: 6px;
}

.status-band {
  margin-top: 18px;
}

.status-band > div {
  min-height: 148px;
  padding: 22px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.big-number {
  font-size: 26px;
  line-height: 1.15;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.main-stack,
.sidebar-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  padding: 22px;
}

.primary-panel {
  display: flex;
  flex-direction: column;
}

.panel-header {
  margin-bottom: 18px;
}

.decision-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reason,
.preview-card,
.auto-interpretation,
.readiness-card,
.position-state,
.wallet-address,
.audit-card,
.stat-card,
.meter-grid div {
  background: #f8faf9;
  box-shadow: 0 6px 18px rgba(23, 33, 31, 0.04);
}

.reason {
  min-height: 72px;
  padding: 16px;
}

.preview-card,
.auto-interpretation,
.readiness-card,
.position-state {
  padding: 16px;
}

.meter-grid {
  gap: 12px;
}

.meter-grid div {
  padding: 14px;
}

.wallet-address {
  min-height: 54px;
}

.table-panel {
  margin-top: 18px;
}

.analytics-grid > .table-panel {
  margin-top: 0;
}

.scroll-table-wrap {
  height: 380px;
  max-height: 380px;
  background: #ffffff;
}

.compact-scroll-wrap {
  height: 260px;
  max-height: 260px;
}

.diary-table-wrap {
  height: 500px;
  max-height: 500px;
}

table {
  min-width: 720px;
}

tbody tr:nth-child(even) {
  background: #fbfcfc;
}

tbody tr:hover {
  background: #f1f6f5;
}

@media (max-width: 1220px) {
  .app-shell {
    width: min(100%, calc(100% - 28px));
  }

  .topbar-actions,
  .overview-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

  .decision-audit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 22px 18px;
  }

  .brand-shell,
  .hero-copy {
    justify-items: flex-start;
    text-align: left;
  }

  .brand {
    align-items: flex-start;
    text-align: left;
  }

  .token-logo {
    width: min(360px, 82vw);
    max-height: 220px;
  }

  .overview-grid,
  .analytics-grid,
  .status-band,
  .stats-grid,
  .home-fleet-grid,
  .fleet-chart-grid,
  .double-chart,
  .meter-grid,
  .input-row,
  .futures-params-row,
  .size-config-row,
  .wallet-actions {
    grid-template-columns: 1fr;
  }

  .big-number {
    font-size: 22px;
  }

  h1 {
    font-size: 32px;
  }
}
.size-config-row input,
.size-config-row select,
.futures-params-row input,
.futures-params-row select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--ink);
}

.size-config-row button,
.futures-params-row button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
}

/* Dark grouped dashboard refresh */

:root {
  --bg: #050607;
  --ink: #eef2f6;
  --muted: #aab5c1;
  --panel: #0b0d10;
  --line: rgba(255, 255, 255, 0.72);
  --green: #37c88a;
  --red: #ff6675;
  --teal: #38b9c2;
  --yellow: #e0b44a;
}

body {
  background:
    radial-gradient(circle at top, rgba(56, 185, 194, 0.08), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(224, 180, 74, 0.08), transparent 18%),
    #050607;
  color: var(--ink);
}

.app-shell {
  width: min(1540px, calc(100% - 28px));
  padding: 20px 0 28px;
}

.topbar,
.status-band,
.panel {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.topbar {
  gap: 18px;
  padding: 20px 22px;
}

.brand {
  padding: 14px;
  border-color: rgba(224, 180, 74, 0.35);
  background: linear-gradient(180deg, rgba(38, 27, 10, 0.88) 0%, rgba(20, 15, 8, 0.94) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.image-logo {
  border-color: rgba(224, 180, 74, 0.45);
  background: #07090b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.token-name {
  color: #d9e3ea;
}

h1 {
  color: #f0c96a;
}

h2 {
  color: #f4f7fb;
}

.hero-subtitle,
.form-help,
.subvalue,
.timestamp,
.wallet-help,
.compact-insight-list,
.auto-interpretation p,
.venue-pair-card small,
th,
.meter-grid span,
.config-list dt {
  color: var(--muted);
}

.eyebrow,
.label,
.audit-label,
.cluster-title {
  color: var(--heading-soft);
}

.topbar-actions {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.topbar-card {
  min-height: 0;
  padding: 16px 18px;
  border-color: var(--line);
  background: #0f1217;
  box-shadow: none;
}

.status-band {
  margin-top: 14px;
}

.status-band > div {
  min-height: 0;
  padding: 16px 18px;
  background: linear-gradient(180deg, #0e1115 0%, #0a0c10 100%);
}

.big-number,
.audit-card strong,
.stat-card strong,
.meter-grid strong,
.config-list dd {
  color: #f5f8fb;
}

.overview-grid,
.analytics-grid {
  gap: 14px;
  margin-top: 14px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.95fr);
}

.analytics-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.main-stack,
.sidebar-stack {
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel-header {
  margin-bottom: 12px;
}

.panel-subsection {
  margin-bottom: 14px;
}

.grouped-subsection {
  display: grid;
  gap: 14px;
}

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

.cluster-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-cluster {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090c10;
}

.insight-grid {
  display: grid;
  gap: 10px;
}

.insight-grid-market,
.insight-grid-context,
.insight-grid-ai {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insight-grid-labs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.insight-grid-labs .auto-interpretation {
  margin-bottom: 0;
  height: 100%;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.admin-wide-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.ares-benchmark-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.sol-alpha-lab-panel {
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0 18px;
  background: rgba(15, 23, 42, 0.38);
}

.compact-panel-header {
  margin-bottom: 4px;
}

.sol-alpha-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sol-alpha-grid .stat-card {
  min-width: 0;
  overflow: hidden;
}

.sol-alpha-grid .stat-card span,
.sol-alpha-grid .stat-card strong {
  max-width: 100%;
}

.sol-alpha-value {
  display: block;
  font-size: clamp(17px, 1.25vw, 22px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sol-alpha-value.long-stat {
  font-size: clamp(12px, 0.9vw, 16px);
  line-height: 1.18;
}

.sol-alpha-table-wrap {
  max-height: 300px;
}

.admin-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.admin-table-wrap {
  max-height: 520px;
}

.insight-grid-context .auto-interpretation {
  padding: 12px;
  margin-bottom: 0;
}

.insight-grid-context .auto-interpretation strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.insight-grid-context .auto-interpretation p {
  font-size: 13px;
  line-height: 1.34;
}

.insight-grid-context .auto-interpretation .form-help + .form-help {
  margin-top: 4px;
}

.support-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.support-table-wide {
  grid-column: 1 / -1;
}

.support-table-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0e13;
}

.support-table-head {
  display: grid;
  gap: 4px;
}

.support-table-head strong {
  color: #f3f7fb;
  font-size: 14px;
  line-height: 1.3;
}

.auto-interpretation strong,
.preview-card strong,
.readiness-card strong,
.operating-profile-card strong,
.topbar-card strong {
  color: var(--heading-soft);
}

.support-table-head span,
.chart-context-chip span,
.legend,
.table th,
th {
  color: var(--muted);
}

.support-table-head span {
  color: #95a1ae;
  font-size: 13px;
  line-height: 1.45;
}

.support-table-wrap {
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0d1116;
  overflow: hidden;
}

.support-table-wrap.scroll-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
}

.support-table-wrap-wide {
  max-height: 300px;
}

.support-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.support-table th,
.support-table td {
  padding: 12px 12px;
  white-space: normal;
  word-break: break-word;
}

.support-table thead th {
  background: #12171d;
  color: #86b7ff;
}

.sentiment-support-table th:nth-child(1),
.sentiment-support-table td:nth-child(1) {
  width: 24%;
}

.sentiment-support-table th:nth-child(2),
.sentiment-support-table td:nth-child(2) {
  width: 16%;
}

.sentiment-support-table th:nth-child(3),
.sentiment-support-table td:nth-child(3) {
  width: 60%;
}

.calendar-support-table th:nth-child(1),
.calendar-support-table td:nth-child(1) {
  width: 40%;
}

.calendar-support-table th:nth-child(2),
.calendar-support-table td:nth-child(2) {
  width: 16%;
}

.calendar-support-table th:nth-child(3),
.calendar-support-table td:nth-child(3) {
  width: 16%;
}

.calendar-support-table th:nth-child(4),
.calendar-support-table td:nth-child(4) {
  width: 28%;
}

.history-support-table th:nth-child(1),
.history-support-table td:nth-child(1) {
  width: 22%;
}

.history-support-table th:nth-child(2),
.history-support-table td:nth-child(2) {
  width: 14%;
}

.history-support-table th:nth-child(3),
.history-support-table td:nth-child(3) {
  width: 10%;
}

.history-support-table th:nth-child(4),
.history-support-table td:nth-child(4) {
  width: 54%;
}

.reason,
.preview-card,
.auto-interpretation,
.readiness-card,
.position-state,
.wallet-address,
.audit-card,
.stat-card,
.meter-grid div,
.topbar-card,
.wallet-pill,
.spartan-answer-state,
.spartan-answer-badge,
.timeframe-pill,
.spartan-suggestion-button,
.scroll-table-wrap,
code {
  background: #11151a;
  border-color: var(--line);
  box-shadow: none;
}

.spartan-answer-state,
.spartan-answer-badge {
  color: #dbe6ef;
}

.reason,
.readiness-card,
.position-state,
.preview-card,
.wallet-address,
.audit-card,
.auto-interpretation,
.stat-card {
  min-height: 0;
}

.reason {
  margin-bottom: 12px;
  padding: 14px;
  color: #d9e2ea;
}

.spartan-answer-evidence,
.spartan-answer-evidence li,
#spartanAnswerHeadline,
#spartanAnswerText,
#spartanAnswerNext,
#spartanAnswerRisk {
  color: #d7e2ec;
}

.spartan-answer-lesson {
  background: #11151a;
  border-color: var(--line);
}

.spartan-answer-note {
  color: #f2d98b;
}

.spartan-answer-lesson-number {
  background: rgba(224, 180, 74, 0.14);
  border-color: rgba(224, 180, 74, 0.28);
  color: #f0c96a;
}

.spartan-answer-lesson-source,
.spartan-answer-lesson-excerpt {
  color: #aeb9c3;
}

.spartan-answer-section {
  border-color: rgba(224, 180, 74, 0.18);
  background: rgba(224, 180, 74, 0.05);
}

.spartan-answer-section-label {
  color: #f0c96a;
}

.spartan-answer-details summary {
  color: #f0c96a;
}

.readiness-pill {
  background: rgba(224, 180, 74, 0.16);
  color: #f0c96a;
}

.readiness-pill.ready,
.wallet-pill.ready,
.mode-pill {
  background: rgba(55, 200, 138, 0.14);
  color: #6ae3ab;
}

.mode-pill.live,
.danger-button {
  background: rgba(255, 102, 117, 0.16) !important;
  color: #ff8b97;
}

.reactivate-button {
  background: #0f684a !important;
  color: #f6fbff;
}

.wallet-badge.readonly,
.timeframe-pill,
.spartan-suggestion-button,
.wallet-actions button.secondary {
  background: #12171d;
  color: #d7e0e8;
}

.wallet-network,
.inline-link {
  color: #7ad4da;
}

.position-state.open {
  background: rgba(55, 200, 138, 0.12);
  color: #7be8b6;
}

.venue-pair-card,
.meter-grid div {
  min-height: 0;
}

.venue-pair-grid {
  gap: 10px;
}

.decision-audit-grid {
  gap: 10px;
  margin-bottom: 12px;
}

.meter-grid {
  margin-bottom: 12px;
}

.decision-footer {
  margin-top: 10px;
  padding-top: 10px;
}

.wallet-card {
  gap: 10px;
}

.wallet-address {
  color: #f0f4f8;
}

.wallet-help {
  min-height: 0;
}

.trade-form {
  margin-top: 12px;
  padding-top: 12px;
}

.save-message {
  min-height: 0;
}

.input-row input,
.input-row select,
.size-config-row input,
.size-config-row select,
.futures-params-row input,
.futures-params-row select {
  background: #1a1f26;
  color: var(--ink);
  border-color: var(--line);
}

.token-switcher-row select,
.token-add-form input,
.token-add-form select,
.spartan-ask-row input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background: #1a1f26;
  color: var(--ink);
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: #95a1ae;
}

.input-row button,
.token-switcher-row button,
.token-add-form button,
.size-config-row button,
.futures-params-row button,
.wallet-actions button {
  background: #126b72;
  color: #f6fbff;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #f0c96a;
  outline-offset: 2px;
}

.input-row button:hover,
.token-switcher-row button:hover,
.token-add-form button:hover,
.size-config-row button:hover,
.futures-params-row button:hover,
.wallet-actions button:hover,
.timeframe-pill:hover,
.spartan-suggestion-button:hover {
  filter: brightness(1.08);
}

canvas {
  background: #0a0d11;
  border-color: var(--line);
}

.chart-context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}

.chart-context-chip {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1218;
}

.chart-context-chip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chart-context-chip strong {
  display: block;
  color: #f5fbff;
  font-size: 14px;
  line-height: 1.3;
}

.table-wrap,
.stats-table-wrap {
  margin-top: 0;
}

.scroll-table-wrap {
  background: #0d1116;
}

.scroll-table-wrap thead th {
  background: #11151a;
}

table {
  min-width: 680px;
}

tbody tr:nth-child(even) {
  background: #0d1116;
}

tbody tr:hover {
  background: #141a20;
}

th,
td {
  border-bottom-color: var(--line);
}

td {
  color: #dce4eb;
}

.stats-grid,
.home-fleet-grid,
.double-chart {
  gap: 10px;
  margin-bottom: 12px;
}

.compact-stats-grid {
  margin-top: 0;
}

.table-panel {
  margin-top: 14px;
}

.analytics-grid > .table-panel {
  margin-top: 0;
}

.positive {
  color: #68e8a8;
}

.negative {
  color: #ff8894;
}

.trade-margin {
  font-weight: 700;
  white-space: nowrap;
}

.trade-margin-cell {
  min-width: 130px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-header-actions {
  align-items: flex-end;
}

.stats-period-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.stats-period-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-period-control span {
  color: #d7c06d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stats-period-control select {
  min-width: 190px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a1f26;
  color: var(--ink);
  font: inherit;
}

.diary-tools {
  justify-content: flex-end;
}

.diary-export-button {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a1f26;
  color: #f4f7fb;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.diary-export-button:hover {
  background: #222a34;
  border-color: #ffffff;
}

.diary-export-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.diary-active-trades {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
  color: #d7e0e8;
  font-weight: 700;
  white-space: nowrap;
}

.diary-active-trades strong {
  margin-left: 6px;
  color: #f0c96a;
}

.diary-active-trades.is-active {
  border-color: #2fc789;
  background: rgba(47, 199, 137, 0.12);
  color: #dffbed;
}

#tradeReportMessage {
  margin-top: 12px;
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 84px;
}

.device-jump-bar {
  display: none;
}

.device-jump-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151a;
  color: #eef2f6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.device-jump-link:hover {
  background: #161c23;
}

.device-card strong {
  display: block;
  margin-top: 4px;
}

.panel-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151a;
  color: #eef2f6;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.panel-mobile-body {
  display: grid;
  gap: 0;
}

.panel-collapsed .panel-mobile-body[hidden] {
  display: none !important;
}

@media (max-width: 1220px) {
  .insight-grid-market,
  .insight-grid-context,
  .insight-grid-ai,
  .support-table-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    width: min(100%, calc(100% - 20px));
    padding: 118px 0 22px;
  }

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

  .venue-pair-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 16px;
  }

  .panel,
  .topbar-card,
  .status-band > div,
  .info-cluster {
    padding: 14px;
  }
}

body.device-mobile .topbar {
  padding: 16px;
}

body.device-mobile .topbar-actions {
  grid-template-columns: 1fr;
}

body.device-mobile .hero-copy {
  gap: 8px;
}

body.device-mobile .hero-subtitle {
  font-size: 14px;
  line-height: 1.45;
}

body.device-mobile .topbar-card {
  min-height: 0;
}

body.device-mobile .topbar-card .form-help {
  margin-bottom: 0;
}

body.device-mobile .device-jump-bar {
  position: sticky;
  top: 8px;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 13, 16, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

body.device-mobile .dashboard-view-nav-row {
  display: flex;
  flex-direction: column;
}

body.device-mobile .dashboard-view-nav {
  top: 8px;
  left: 8px;
  width: min(170px, calc(100vw - 16px));
  padding: 10px;
}

body.device-mobile .panel-toggle {
  display: inline-flex;
}

body.device-mobile [data-mobile-collapsible="true"] .panel-header {
  margin-bottom: 0;
}

body.device-mobile [data-mobile-collapsible="true"]:not(.panel-collapsed) .panel-header {
  margin-bottom: 12px;
}

body.device-mobile .panel-mobile-body {
  gap: 12px;
}

body.device-mobile .panel-mobile-body > .trade-form:first-child,
body.device-mobile .panel-mobile-body > .stats-grid:first-child,
body.device-mobile .panel-mobile-body > .reason:first-child,
body.device-mobile .panel-mobile-body > .config-list:first-child {
  margin-top: 0;
}

body.device-mobile .status-band > div {
  min-height: 0;
}

body.device-mobile .overview-grid,
body.device-mobile .analytics-grid,
body.device-mobile .stats-grid,
body.device-mobile .home-fleet-grid,
body.device-mobile .fleet-chart-grid,
body.device-mobile .double-chart,
body.device-mobile .meter-grid,
body.device-mobile .input-row,
body.device-mobile .futures-params-row,
body.device-mobile .size-config-row,
body.device-mobile .wallet-actions,
body.device-mobile .chart-context-strip {
  grid-template-columns: 1fr;
}

body.device-mobile .risk-context-field textarea {
  min-height: 52px;
  max-height: 84px;
}

body.device-mobile .chart-header-side {
  align-items: flex-start;
}

body.device-mobile #priceChart {
  height: 260px;
}

body.device-mobile .scroll-table-wrap {
  height: 280px;
  max-height: 280px;
}

body.device-mobile .compact-scroll-wrap {
  height: 220px;
  max-height: 220px;
}

body.device-mobile .diary-table-wrap {
  height: 320px;
  max-height: 320px;
}

body.device-mobile .support-table-wrap-wide {
  max-height: 240px;
}

body.device-mobile .panel-header-actions,
body.device-mobile .diary-tools {
  justify-content: flex-start;
}

body.device-mobile .stats-period-control,
body.device-mobile .stats-period-control select {
  width: 100%;
}

body.device-mobile .timeframe-controls {
  width: 100%;
}

body.device-mobile .timeframe-pill {
  flex: 1 1 auto;
  text-align: center;
}

/* Compact multi-page layout */
@media (min-width: 1221px) {
  .app-shell {
    width: min(1540px, calc(100vw - 224px));
    margin-left: 204px;
    margin-right: 20px;
    padding: 14px 0 24px;
  }
}

.dashboard-view-nav {
  width: 168px;
  padding: 8px;
}

.dashboard-view-caption {
  margin-bottom: 6px;
}

.dashboard-view-nav-row {
  gap: 5px;
}

.dashboard-view-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.topbar {
  gap: 12px;
  padding: 14px 16px;
}

.brand-shell {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 12px;
  width: 100%;
  max-width: none;
  text-align: left;
}

.hero-copy {
  justify-items: start;
  gap: 4px;
  max-width: none;
}

.hero-subtitle {
  max-width: 980px;
  font-size: 14px;
  line-height: 1.35;
}

.brand {
  padding: 7px;
}

.token-logo,
body[data-dashboard-view-default="market"] .token-logo,
body[data-dashboard-view-default="ares"] .token-logo,
body[data-dashboard-view-default="talk"] .token-logo,
body[data-dashboard-view-default="diary"] .token-logo {
  width: 96px;
  max-height: 64px;
}

h1,
body[data-dashboard-view-default="market"] h1,
body[data-dashboard-view-default="ares"] h1,
body[data-dashboard-view-default="talk"] h1,
body[data-dashboard-view-default="diary"] h1 {
  font-size: 28px;
}

h2 {
  font-size: 19px;
}

.topbar-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.topbar-card {
  padding: 12px 14px;
}

.topbar-card strong {
  font-size: 18px;
}

.status-band {
  margin-top: 10px;
}

.status-band > div {
  padding: 12px 14px;
}

.big-number {
  font-size: 22px;
}

.overview-grid,
.analytics-grid,
.main-stack,
.sidebar-stack,
.grouped-subsection,
.info-cluster,
.insight-grid,
.support-table-grid,
.stats-grid,
.home-fleet-grid,
.fleet-chart-grid,
.double-chart,
.meter-grid,
.decision-audit-grid {
  gap: 10px;
}

.overview-grid,
.analytics-grid,
.table-panel,
.page-section {
  margin-top: 10px;
}

.panel {
  padding: 14px;
}

.panel-header {
  margin-bottom: 10px;
}

.panel-subsection {
  margin-bottom: 10px;
}

.info-cluster {
  padding: 10px;
}

.reason {
  min-height: 0;
  padding: 12px;
}

.preview-card,
.auto-interpretation,
.readiness-card,
.position-state {
  padding: 12px;
}

.stat-card,
.audit-card,
.meter-grid div,
.support-table-block {
  padding: 10px;
}

.scroll-table-wrap {
  height: 300px;
  max-height: 300px;
}

.compact-scroll-wrap {
  height: 200px;
  max-height: 200px;
}

.diary-table-wrap {
  height: 340px;
  max-height: 340px;
}

#priceChart {
  height: 280px;
}

.ares-pattern-charts-section {
  gap: 12px;
}

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

.ares-pattern-chart-grid.is-fleet-matrix {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ares-pattern-chart-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090c10;
}

.ares-pattern-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.ares-pattern-card-head strong {
  display: block;
  margin-top: 2px;
  color: #f4f7fb;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ares-pattern-side-pill {
  align-self: start;
  max-width: 120px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: #11151a;
  color: #dbe6ef;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.ares-pattern-side-pill.is-long {
  border-color: rgba(55, 200, 138, 0.72);
  background: rgba(55, 200, 138, 0.14);
  color: #76e6b2;
}

.ares-pattern-side-pill.is-short {
  border-color: rgba(255, 102, 117, 0.72);
  background: rgba(255, 102, 117, 0.14);
  color: #ff9aa4;
}

.ares-pattern-side-pill.is-neutral,
.ares-pattern-side-pill.is-mixed {
  border-color: rgba(224, 180, 74, 0.72);
  background: rgba(224, 180, 74, 0.14);
  color: #f1cd73;
}

.ares-tv-stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #050607;
}

.ares-pattern-chart-grid.is-fleet-matrix .ares-tv-stage {
  min-height: 440px;
}

.ares-pattern-chart-grid.is-fleet-matrix .ares-pattern-overlay {
  right: 8px;
  bottom: 132px;
  width: min(320px, calc(100% - 16px));
}

@media (max-width: 900px) {
  .ares-pattern-chart-grid.is-fleet-matrix {
    grid-template-columns: 1fr;
  }
}

.ares-light-chart {
  position: absolute;
  inset: 0 0 126px;
  width: auto;
  height: auto;
}

.ares-light-chart canvas {
  border: 0;
  background: transparent;
}

.ares-fallback-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ares-chart-pattern-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: grid;
  max-width: min(360px, calc(100% - 20px));
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(224, 180, 74, 0.56);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.92);
  color: #f4f7fb;
  pointer-events: none;
}

.ares-level-readout {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  gap: 4px;
  min-width: 116px;
  padding: 8px 10px;
  border: 1px solid rgba(122, 212, 218, 0.50);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.86);
  color: #cfeef0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  pointer-events: none;
}

.ares-level-readout strong {
  color: #f0c96a;
  font-size: 11px;
  line-height: 1.15;
  text-transform: uppercase;
}

.ares-level-readout span {
  white-space: nowrap;
}

.ares-level-readout .is-resistance {
  color: #ff9aa4;
}

.ares-level-readout .is-support {
  color: #8ff0c0;
}

.ares-level-readout .is-fib {
  color: #cfeef0;
}

.ares-indicator-stack {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: 62px 64px;
  height: 126px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  background: #070a0d;
}

.ares-indicator-stack canvas {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.ares-chart-pattern-label span {
  color: #9fb0bd;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.ares-chart-pattern-label strong {
  color: #f4f7fb;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ares-chart-pattern-label.is-long {
  border-color: rgba(55, 200, 138, 0.68);
}

.ares-chart-pattern-label.is-short {
  border-color: rgba(255, 102, 117, 0.68);
}

.ares-chart-pattern-label.is-neutral,
.ares-chart-pattern-label.is-mixed {
  border-color: rgba(224, 180, 74, 0.68);
}

.ares-chart-legend {
  position: absolute;
  top: 78px;
  left: 10px;
  z-index: 3;
  display: grid;
  gap: 4px;
  max-width: min(280px, calc(100% - 20px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.78);
  color: #dbe6ef;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  pointer-events: none;
}

.ares-chart-legend span {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.ares-chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: #dbe6ef;
}

.ares-chart-legend .is-ema-fast {
  background: #31d8c6;
}

.ares-chart-legend .is-ema-mid {
  background: #3478f6;
}

.ares-chart-legend .is-ema-slow {
  background: rgba(219, 230, 239, 0.70);
}

.ares-chart-legend .is-ema-trend {
  background: #ba3df3;
}

.ares-chart-legend .is-volume {
  background: rgba(55, 200, 138, 0.62);
}

.ares-pattern-overlay {
  position: absolute;
  right: 10px;
  bottom: 136px;
  left: auto;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: min(440px, calc(100% - 20px));
  padding: 10px;
  border: 1px solid rgba(224, 180, 74, 0.54);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.82);
  pointer-events: none;
}

.ares-pattern-sketch {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #0c1116;
}

.ares-pattern-sketch svg {
  display: block;
  width: 100%;
  height: 74px;
}

.ares-pattern-sketch .pattern-line {
  fill: none;
  stroke: #38e8ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ares-pattern-sketch .pattern-guide {
  fill: none;
  stroke: rgba(219, 230, 239, 0.56);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.ares-pattern-sketch .pattern-candle {
  fill: #f0c96a;
  stroke: #f0c96a;
  stroke-width: 2;
}

.ares-pattern-sketch.is-long .pattern-candle {
  stroke: #69dfaa;
  fill: #69dfaa;
}

.ares-pattern-sketch.is-short .pattern-candle {
  stroke: #ff7d8a;
  fill: #ff7d8a;
}

.ares-pattern-sketch.is-long .pattern-line,
.ares-pattern-sketch.is-short .pattern-line,
.ares-pattern-sketch.is-neutral .pattern-line,
.ares-pattern-sketch.is-mixed .pattern-line {
  stroke: #38e8ff;
  filter: drop-shadow(0 0 4px rgba(56, 232, 255, 0.55));
}

.ares-pattern-sketch.is-neutral .pattern-line,
.ares-pattern-sketch.is-mixed .pattern-line {
  stroke: #38e8ff;
}

.ares-pattern-readout {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ares-pattern-readout span {
  color: #9fb0bd;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.ares-pattern-readout strong {
  color: #f4f7fb;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ares-pattern-readout p {
  margin: 0;
  color: #cad6df;
  font-size: 13px;
  line-height: 1.35;
}

.ares-pattern-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ares-pattern-metrics span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: #11151a;
  color: #dbe6ef;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ares-chart-attribution {
  margin: 0;
}

body[data-dashboard-view-default="market"] .topbar,
body[data-dashboard-view-default="ares"] .topbar,
body[data-dashboard-view-default="talk"] .topbar,
body[data-dashboard-view-default="diary"] .topbar {
  padding: 12px 14px;
}

body[data-dashboard-view-default="market"] .hero-subtitle,
body[data-dashboard-view-default="ares"] .hero-subtitle,
body[data-dashboard-view-default="talk"] .hero-subtitle,
body[data-dashboard-view-default="diary"] .hero-subtitle {
  max-width: 900px;
}

@media (max-width: 1220px) {
  .app-shell {
    width: min(100%, calc(100% - 20px));
    margin: 0 auto;
    padding: 100px 0 22px;
  }

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

  .ares-tv-stage {
    min-height: 520px;
  }
}

@media (max-width: 820px) {
  .brand-shell {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .token-logo,
  body[data-dashboard-view-default="market"] .token-logo,
  body[data-dashboard-view-default="ares"] .token-logo,
  body[data-dashboard-view-default="talk"] .token-logo,
  body[data-dashboard-view-default="diary"] .token-logo {
    width: 72px;
    max-height: 54px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  h1,
  body[data-dashboard-view-default="market"] h1,
  body[data-dashboard-view-default="ares"] h1,
  body[data-dashboard-view-default="talk"] h1,
  body[data-dashboard-view-default="diary"] h1 {
    font-size: 24px;
  }

  .ares-tv-stage {
    min-height: 500px;
  }

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

  .ares-pattern-overlay {
    grid-template-columns: 1fr;
    right: 8px;
    bottom: 134px;
    width: min(320px, calc(100% - 16px));
  }

  .ares-pattern-sketch {
    min-height: 58px;
  }

  .ares-pattern-sketch svg {
    height: 58px;
  }

  .ares-pattern-metrics {
    grid-template-columns: 1fr;
  }
}

.talk-page-shell {
  max-width: 1040px;
}

.talk-hero {
  align-items: stretch;
}

.talk-hero .brand-shell {
  width: 100%;
}

.ares-brand-shell {
  display: grid;
  grid-template-columns: clamp(128px, 18vw, 190px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.ares-portrait-stage {
  position: relative;
  width: clamp(128px, 18vw, 190px);
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(217, 176, 78, 0.48);
  border-radius: 10px;
  background: #03070b;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.ares-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.ares-portrait-caption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border: 1px solid rgba(217, 176, 78, 0.42);
  border-radius: 999px;
  background: rgba(3, 7, 11, 0.78);
  color: #f6e3a3;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.ares-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #67ffc1;
  box-shadow: 0 0 10px rgba(103, 255, 193, 0.75);
}

.ares-hero-copy {
  min-width: 0;
}

.ares-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ares-hero-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(217, 176, 78, 0.32);
  border-radius: 999px;
  background: rgba(217, 176, 78, 0.08);
  color: #f5df9f;
  font-size: 12px;
  font-weight: 800;
}

.brand-shell:not(.ares-brand-shell) {
  grid-template-columns: clamp(128px, 18vw, 190px) minmax(0, 1fr);
  align-items: center;
}

.brand-shell:not(.ares-brand-shell) .brand {
  width: clamp(128px, 18vw, 190px);
  min-height: clamp(96px, 13vw, 142px);
  box-sizing: border-box;
  justify-content: center;
  padding: 8px;
}

.brand-shell:not(.ares-brand-shell) .token-logo {
  width: 100%;
  height: auto;
  max-height: clamp(80px, 12vw, 126px);
  object-fit: contain;
}

.talk-page {
  display: grid;
  gap: 14px;
}

.talk-page .trade-form {
  border-top: 0;
  padding-top: 0;
}

.talk-page .spartan-answer-card {
  margin-top: 6px;
}

@media (min-width: 1221px) {
  .talk-page-shell {
    padding-left: 210px;
  }
}

@media (max-width: 980px) {
  .admin-dashboard-grid,
  .admin-wide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .brand-shell:not(.ares-brand-shell) {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .brand-shell:not(.ares-brand-shell) .brand {
    width: 96px;
    min-height: 72px;
    padding: 6px;
  }

  .brand-shell:not(.ares-brand-shell) .token-logo {
    max-height: 60px;
  }

  .ares-brand-shell {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .ares-portrait-stage {
    width: 96px;
    border-radius: 8px;
  }

  .ares-portrait-caption {
    display: none;
  }

  .ares-hero-tags {
    display: none;
  }

  body[data-dashboard-view-default="admin"] .app-shell {
    width: min(100% - 20px, 520px);
    padding-top: 10px;
    padding-bottom: 24px;
  }

  body[data-dashboard-view-default="admin"] .dashboard-view-nav {
    position: static;
    width: 100%;
    margin: 0 0 12px;
    padding: 8px;
    overflow-x: auto;
  }

  body[data-dashboard-view-default="admin"] .dashboard-view-caption {
    display: none;
  }

  body[data-dashboard-view-default="admin"] .dashboard-view-nav-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: max-content;
    min-width: 100%;
  }

  body[data-dashboard-view-default="admin"] .dashboard-view-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 12px;
  }

  body[data-dashboard-view-default="admin"] .topbar {
    padding: 14px;
    gap: 12px;
  }

  body[data-dashboard-view-default="admin"] .brand-shell {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
  }

  body[data-dashboard-view-default="admin"] .brand {
    width: 64px;
    height: 64px;
    padding: 6px;
  }

  body[data-dashboard-view-default="admin"] .token-logo {
    width: 52px;
    height: 52px;
  }

  body[data-dashboard-view-default="admin"] .hero-copy {
    min-width: 0;
  }

  body[data-dashboard-view-default="admin"] h1 {
    font-size: 26px;
  }

  body[data-dashboard-view-default="admin"] h2 {
    font-size: 18px;
  }

  body[data-dashboard-view-default="admin"] .hero-subtitle {
    display: none;
  }

  body[data-dashboard-view-default="admin"] .topbar-actions,
  body[data-dashboard-view-default="admin"] .admin-wide-grid,
  body[data-dashboard-view-default="admin"] .futures-params-row {
    grid-template-columns: 1fr;
  }

  body[data-dashboard-view-default="admin"] .topbar-card,
  body[data-dashboard-view-default="admin"] .panel {
    padding: 14px;
  }

  body[data-dashboard-view-default="admin"] .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-dashboard-view-default="admin"] .panel-header .topbar-actions {
    display: block;
  }

  body[data-dashboard-view-default="admin"] .panel-header button,
  body[data-dashboard-view-default="admin"] .topbar-actions button {
    width: 100%;
    min-height: 42px;
  }

  body[data-dashboard-view-default="admin"] .admin-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 12px;
  }

  body[data-dashboard-view-default="admin"] .sol-alpha-lab-panel {
    padding: 10px;
    margin: 12px 0 14px;
  }

  body[data-dashboard-view-default="admin"] .sol-alpha-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-dashboard-view-default="admin"] .sol-alpha-table-wrap {
    max-height: 280px;
  }

  body[data-dashboard-view-default="admin"] .stat-card {
    min-height: 78px;
    padding: 10px;
  }

  body[data-dashboard-view-default="admin"] .stat-card span {
    font-size: 11px;
    line-height: 1.2;
  }

  body[data-dashboard-view-default="admin"] .stat-card strong {
    font-size: 17px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  body[data-dashboard-view-default="admin"] .trade-form {
    margin-top: 10px;
    padding-top: 10px;
  }

  body[data-dashboard-view-default="admin"] .futures-param-field {
    margin-bottom: 0;
  }

  body[data-dashboard-view-default="admin"] .futures-params-row input,
  body[data-dashboard-view-default="admin"] .futures-params-row select,
  body[data-dashboard-view-default="admin"] .risk-context-field textarea {
    min-height: 42px;
    font-size: 16px;
  }

  body[data-dashboard-view-default="admin"] .risk-context-field textarea {
    min-height: 50px;
    max-height: 76px;
  }

  body[data-dashboard-view-default="admin"] .form-help {
    font-size: 13px;
  }

  body[data-dashboard-view-default="admin"] .table-wrap,
  body[data-dashboard-view-default="admin"] .stats-table-wrap,
  body[data-dashboard-view-default="admin"] .admin-table-wrap {
    width: 100%;
    max-height: 340px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-dashboard-view-default="admin"] table {
    min-width: 560px;
  }

  body[data-dashboard-view-default="admin"] th,
  body[data-dashboard-view-default="admin"] td {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  body[data-dashboard-view-default="admin"] td:last-child {
    min-width: 180px;
    white-space: normal;
  }
}

@media (max-width: 390px) {
  body[data-dashboard-view-default="admin"] .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  body[data-dashboard-view-default="admin"] table {
    min-width: 520px;
  }
}

/* Mobile navigation must not cover page content. Keep the full menu, but make it
   part of the document flow and horizontally scrollable on small screens. */
@media (max-width: 820px) {
  body .app-shell {
    width: min(calc(100% - 20px), 560px);
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px;
  }

  body .dashboard-view-nav {
    position: static;
    top: auto;
    left: auto;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  body .dashboard-view-caption {
    display: none;
  }

  body .dashboard-view-nav-row,
  body.device-mobile .dashboard-view-nav-row,
  body[data-dashboard-view-default="admin"] .dashboard-view-nav-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: max-content;
    min-width: 100%;
  }

  body .dashboard-view-button,
  body[data-dashboard-view-default="admin"] .dashboard-view-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 12px;
  }
}
