:root {
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --background: #f5f7fb;
  --border: #dbe2ef;
  --card: #ffffff;
  --danger: #b42318;
  --ink: #172033;
  --muted: #667085;
  --navy: #0f172a;
  --navy-light: #17233d;
  --success: #15803d;
  --warning: #b54708;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.32), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.2), transparent 35%),
    var(--navy);
}

.auth-card {
  width: min(100%, 470px);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
}

.brand-lockup,
.sidebar-brand,
.card-heading,
.modal-heading,
.panel-heading,
.chat-heading,
.settings-actions,
.composer-actions,
.composer-controls,
.detail-row,
.conversation-row {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  place-items: center;
}

.brand-lockup h1,
.app-header h2,
.section-intro h3,
.panel-heading h3,
.chat-heading h3,
.modal-heading h3 {
  margin: 0;
}

.brand-lockup h1 {
  font-size: 25px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.2;
}

.auth-card .eyebrow {
  color: #a5b4fc;
}

.auth-copy {
  margin: 28px 0 24px;
  color: #cbd5e1;
  line-height: 1.7;
}

.stack-form,
.settings-card,
.modal-card {
  display: grid;
  gap: 12px;
}

label,
legend {
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

input,
select {
  height: 43px;
  padding: 0 12px;
}

textarea {
  min-height: 100px;
  padding: 12px;
  line-height: 1.58;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.auth-card input {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

.button,
.text-button,
.icon-button,
.nav-button,
.conversation-select,
.conversation-delete {
  border: 0;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 750;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button-secondary {
  color: #344054;
  border: 1px solid var(--border);
  background: #fff;
}

.button-secondary:hover:not(:disabled) {
  border-color: #aab7cf;
  background: #f8fafc;
}

.auth-card .button {
  margin-top: 6px;
}

.auth-note {
  margin: 24px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.auth-card .form-error {
  color: #fca5a5;
}

.console-shell {
  --sidebar-width: 238px;
  min-height: 100vh;
}

.app-sidebar {
  display: flex;
  position: fixed;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  flex-direction: column;
  padding: 24px 16px;
  color: #e5edf9;
  background: var(--navy);
}

.sidebar-brand {
  gap: 11px;
  padding: 0 8px 30px;
}

.sidebar-brand .brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  font-size: 10px;
}

.sidebar-brand div {
  display: grid;
  gap: 2px;
}

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand span {
  color: #9fb0ce;
  font-size: 12px;
}

.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  padding: 11px 12px;
  border-radius: 8px;
  color: #a9b8d4;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

.nav-button:hover,
.nav-button.is-active {
  color: #fff;
  background: var(--navy-light);
}

.sidebar-footer {
  display: grid;
  gap: 16px;
  margin-top: auto;
  padding: 22px 8px 0;
}

.status-dot {
  color: #a9b8d4;
  font-size: 11px;
  line-height: 1.5;
}

.status-dot::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #4ade80;
  content: "";
}

.text-button {
  padding: 0;
  color: #c4d0e6;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.text-button:hover {
  color: #fff;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 30px clamp(20px, 4vw, 58px) 44px;
}

.market-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(246, 250, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 2px 2px;
  border-radius: 12px;
  margin-bottom: 18px;
}

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

.market-topbar-head .eyebrow {
  margin: 0;
}

.market-topbar-grid.market-topbar-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0;
}

.market-topbar .status-card {
  padding: 14px 15px;
}

.market-topbar .status-card strong {
  font-size: 16px;
}

.market-topbar .status-label {
  font-size: 11px;
}

.app-header,
.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto 26px;
}

.app-header h2 {
  font-size: 25px;
}

.view-panel {
  max-width: 1480px;
  margin: 0 auto;
}

.section-intro {
  align-items: start;
}

.section-intro h3 {
  font-size: 22px;
}

.section-intro p {
  max-width: 610px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.chat-layout {
  display: grid;
  min-height: calc(100vh - 155px);
  grid-template-columns: 275px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(31, 41, 55, 0.06);
}

.conversation-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fbfcff;
}

.panel-heading,
.chat-heading {
  justify-content: space-between;
  min-height: 79px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h3,
.chat-heading h3 {
  font-size: 16px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #344054;
  background: #fff;
  font-size: 21px;
  line-height: 1;
  place-items: center;
}

.icon-button:hover {
  border-color: #aab7cf;
  background: #f8fafc;
}

.conversation-list {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding: 10px;
}

.conversation-row {
  gap: 4px;
}

.conversation-select {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.conversation-select:hover,
.conversation-select.is-active {
  background: #eef2ff;
}

.conversation-title {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-delete {
  display: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--danger);
  background: transparent;
  font-size: 11px;
}

.conversation-row:hover .conversation-delete,
.conversation-delete:focus-visible {
  display: block;
}

.chat-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.subtle-label {
  color: var(--muted);
  font-size: 12px;
}

.message-list {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 28px clamp(18px, 4vw, 48px);
  background:
    linear-gradient(rgba(248, 250, 252, 0.75), rgba(248, 250, 252, 0.75)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 34px,
      rgba(226, 232, 240, 0.42) 35px
    );
}

.message {
  display: grid;
  width: min(100%, 810px);
  gap: 6px;
}

.message-user {
  align-self: flex-end;
}

.message-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.message-user .message-meta {
  text-align: right;
}

.message-content {
  padding: 13px 15px;
  border: 1px solid #e0e7ff;
  border-radius: 4px 13px 13px 13px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.035);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-user .message-content {
  border-color: var(--accent);
  border-radius: 13px 4px 13px 13px;
  color: #fff;
  background: var(--accent);
}

.typing .message-content {
  color: var(--muted);
  font-style: italic;
}

.welcome-message {
  width: min(100%, 620px);
  margin: auto;
  padding: 29px;
  border: 1px dashed #c7d2fe;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.welcome-message h4 {
  margin: 0 0 10px;
  font-size: 19px;
}

.welcome-message p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.composer {
  display: grid;
  gap: 11px;
  padding: 16px clamp(18px, 4vw, 30px) 20px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.composer-controls {
  gap: 10px;
}

.composer-controls label {
  color: var(--muted);
  font-size: 12px;
}

.composer-controls select {
  width: auto;
  height: 33px;
  max-width: 260px;
  font-size: 12px;
}

.composer-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.composer textarea {
  min-height: 98px;
  border-color: #cbd5e1;
}

.composer-actions {
  justify-content: space-between;
}

.agent-grid,
.status-summary,
.system-grid {
  display: grid;
  gap: 16px;
}

.agent-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.agent-card,
.settings-card,
.status-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.025);
}

.agent-card {
  display: flex;
  min-height: 246px;
  flex-direction: column;
  gap: 14px;
  padding: 21px;
}

.card-heading {
  justify-content: space-between;
  gap: 12px;
}

.card-heading h4 {
  margin: 0;
  font-size: 17px;
}

.agent-tier,
.tag,
.state-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.agent-tier {
  padding: 5px 9px;
  color: #3730a3;
  background: #eef2ff;
}

.agent-description {
  flex: 1;
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  color: #155e75;
  background: #ecfeff;
}

.muted-tag {
  color: var(--muted);
  background: #f2f4f7;
}

.card-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-card .button {
  align-self: flex-start;
}

.settings-card {
  padding: clamp(18px, 3vw, 27px);
}

.settings-card > label {
  display: block;
  margin-bottom: 9px;
}

.settings-card textarea {
  min-height: 470px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.settings-actions {
  justify-content: space-between;
  margin-top: 13px;
}

.status-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.status-card {
  display: grid;
  gap: 7px;
  padding: 19px;
}

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

.status-card strong {
  font-size: 21px;
}

.status-warning {
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #7a2e0a;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  font-size: 13px;
}

.healthy {
  color: var(--success);
}

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

.status-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.detail-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.detail-row {
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f5;
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
}

.detail-row:last-child {
  border-bottom: 0;
}

.state-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
}

.healthy-badge {
  color: #166534;
  background: #dcfce7;
}

.warning-badge {
  color: #9a3412;
  background: #ffedd5;
}

.tool-row {
  display: grid;
  align-items: start;
  gap: 4px;
}

.tool-row span {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  margin: 0;
  padding: 34px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  text-align: center;
  font-size: 13px;
}

.compact-empty {
  padding: 18px 10px;
  border: 0;
  background: transparent;
}

.modal {
  display: grid;
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow-y: auto;
  padding: 22px;
  background: rgba(15, 23, 42, 0.58);
  place-items: center;
}

.modal-card {
  width: min(100%, 670px);
  margin: auto;
  padding: 26px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.modal-heading {
  justify-content: space-between;
  margin-bottom: 6px;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 5px 0 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

legend {
  padding: 0 4px;
}

.checkbox-list {
  display: grid;
  gap: 10px;
}

.checkbox-option {
  display: flex;
  align-items: start;
  gap: 9px;
  color: #475467;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.checkbox-option input {
  width: auto;
  height: auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 7px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 10px;
  color: #fff;
  background: #166534;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  font-size: 14px;
  line-height: 1.5;
}

.toast[data-tone="error"] {
  background: #991b1b;
}

@media (max-width: 1020px) {
  .console-shell {
    --sidebar-width: 194px;
  }

  .app-main {
    padding: 25px 22px 35px;
  }

  .chat-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  .console-shell {
    --sidebar-width: 0;
    display: block;
  }

  .app-sidebar {
    position: static;
    width: auto;
    overflow-y: visible;
    min-height: 0;
    padding: 15px;
  }

  .sidebar-brand {
    padding: 0 0 14px;
  }

  .primary-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .nav-button {
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
    padding: 13px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .app-main {
    min-height: 0;
    margin-left: 0;
    padding: 19px 14px 28px;
  }

  .app-header,
  .section-intro {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .chat-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .conversation-panel {
    max-height: 186px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .conversation-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 72%);
    grid-template-columns: none;
    overflow-x: auto;
  }

  .conversation-delete {
    display: block;
  }

  .message-list {
    min-height: 390px;
    padding: 20px 15px;
  }

  .composer-controls {
    align-items: start;
    flex-wrap: wrap;
  }

  .composer-hint {
    width: 100%;
    margin-left: 0;
  }

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

  .settings-card textarea {
    min-height: 370px;
  }
}

@media (max-width: 460px) {
  .auth-card {
    padding: 29px 22px;
  }

  .status-summary {
    grid-template-columns: 1fr 1fr;
  }

  .composer-actions {
    align-items: center;
  }

  .composer-actions .button {
    padding-inline: 11px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    padding: 19px;
  }
}

/* Market dashboard */
.market-strip { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; justify-content: space-between; padding: 10px 14px; background: #17233df5; color: white; border-radius: 8px; font-size: 12px; backdrop-filter: blur(8px); max-width: 1480px; margin: 0 auto 12px; font-variant-numeric: tabular-nums; }
.market-topbar { position: static; padding: 0; background: transparent; backdrop-filter: none; max-width: 1480px; margin: 0 auto 26px; }
.market-topbar-grid.market-topbar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quote-card, .prediction-card { min-width: 0; padding: 20px; background: white; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 3px 12px #17233d04; }
.quote-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quote-heading h3 { font-size: 16px; margin: 0; }
.quote-badge { display: inline-block; color: #176951; background: #eaf6f0; padding: 4px 7px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.quote-badge.delayed { color: #9a550e; background: #fff2dd; }
.quote-price-line { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.quote-price { font-size: clamp(25px, 2.6vw, 34px); letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.quote-unit, .quote-stamp { color: var(--muted); font-size: 11px; }
.quote-stamp { display: block; margin-top: 4px; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 8px; font-size: 12px; color: var(--muted); }
.chart-ranges { display: flex; gap: 3px; }
.chart-ranges button { padding: 4px 8px; border: 1px solid transparent; background: #f3f5f9; border-radius: 5px; font-size: 11px; cursor: pointer; }
.chart-ranges button[aria-pressed="true"] { color: #3730a3; background: #efedff; border-color: #d6d1fc; }
.quote-chart { min-height: 150px; margin-top: 6px; }
.quote-chart svg { display: block; width: 100%; height: auto; }
.chart-label { font-size: 10px; fill: #7b8799; font-variant-numeric: tabular-nums; }
.chart-empty { display: grid; place-items: center; min-height: 150px; font-size: 12px; color: var(--muted); }
.candle:focus { outline: 1px dashed var(--accent); }
.chart-detail { min-height: 30px; margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quote-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; border-top: 1px solid #edf0f5; padding-top: 14px; }
.quote-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.quote-field span { color: var(--muted); font-size: 11px; }
.quote-field strong { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quote-field strong.data-delayed { color: var(--warning); }
.quote-definition { margin-top: 14px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.quote-definition summary, .prediction-details summary { cursor: pointer; }
.polymarket-panel { max-width: 1480px; margin: 0 auto 30px; }
.polymarket-panel h2 { font-size: 18px; margin: 0; }
.prediction-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.polymarket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.prediction-card > .quote-badge { margin-top: 10px; }
.prediction-time { margin: 8px 0 18px; color: var(--muted); font-size: 11px; }
.outcome-header { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 0 8px 8px; }
.outcome-row { display: grid; grid-template-columns: minmax(100px, 1.3fr) minmax(35px, 1fr) 62px; gap: 10px; align-items: center; padding: 9px 8px; border-top: 1px solid #f1f3f7; font-size: 12px; line-height: 1.5; }
.outcome-row.most-likely { background: #f0f0ff; border-radius: 6px; }
.outcome-label { overflow-wrap: anywhere; }
.outcome-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.probability-bar { height: 6px; background: #eef0f6; border-radius: 8px; overflow: hidden; }
.probability-bar > span { display: block; height: 100%; background: #8982de; border-radius: inherit; }
.most-likely .probability-bar > span { background: #554bce; }
.prediction-details { margin-top: 16px; font-size: 11px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.resolution-rules { white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.prediction-empty { padding: 16px 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
@media (max-width: 1050px) { .quote-card, .prediction-card { padding: 14px; } .quote-field strong { font-size: 13px; } }
@media (max-width: 760px) { .market-topbar-grid.market-topbar-grid, .polymarket-grid { grid-template-columns: 1fr; } .market-strip { flex-wrap: wrap; gap: 4px; font-size: 10px; } .market-strip-item { flex: 1 1 150px; } .market-topbar-head { align-items: flex-start; flex-wrap: wrap; } .quote-chart { min-height: 120px; } }

.collection-health { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.health-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px 16px; }
.health-card p { margin: 5px 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.health-card .health-count { font-size: 16px; color: var(--ink); font-weight: 600; margin-top: 10px; }
.health-card .health-warning { color: var(--warning); }
.health-reason { font-size: 11px; color: var(--muted); }
.comparison-header, .outcome-row.comparison-row { display: grid; grid-template-columns: minmax(95px,1.4fr) minmax(66px,1fr) 65px 65px; gap: 8px; }
.comparison-header > span:not(:first-child) { text-align: right; }
.option-state { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; font-weight: normal; }
.option-state.state-trading { color: #16806a; }
.option-state.state-resolved { color: #5354a4; }
.option-state.state-stale, .option-state.state-book_unavailable, .option-state.state-wide_spread { color: #a86813; }
.outcome-probability { display: flex; flex-direction: column; gap: 5px; text-align: right; }
.outcome-probability .probability-bar { width: 100%; }
.probability-change { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.probability-change.positive { color: #167c62; }
.probability-change.negative { color: #b24451; }
@media (max-width: 760px) {
  .collection-health { grid-template-columns: 1fr; }
  .comparison-header, .outcome-row.comparison-row { grid-template-columns: minmax(76px,1.4fr) minmax(55px,1fr) 52px 52px; gap: 5px; font-size: 11px; }
  .probability-change { font-size: 10px; }
}
.report-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; }
.report-list { display: flex; flex-direction: column; gap: 10px; max-height: 75vh; overflow-y: auto; }
.report-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-align: left; background: var(--panel, #fff); color: inherit; border: 1px solid #cbd5e1; border-radius: 12px; cursor: pointer; }
.report-item:hover, .report-item:focus-visible { border-color: #2563eb; }
.report-reader { min-width: 0; }
.report-reader-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#report-content { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; max-height: 75vh; overflow-y: auto; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } .report-list { max-height: 280px; } }
