* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(79, 124, 255, 0.22), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(51, 214, 180, 0.18), transparent 36%),
    linear-gradient(180deg, #0a1022 0%, #090f1f 40%, #070d1d 100%);
  color: #e8ecf4;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* Admin / section pages (aligned with card grid pattern) */
h1.page-header {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.text-muted-2 {
  color: rgba(255, 255, 255, 0.78);
}

/* track-helper.js: add-to-tracking confirmation (stay on page) */
#moneyTrackAddToast.money-track-add-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10050;
  max-width: min(100vw - 2rem, 20rem);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(136, 168, 255, 0.35);
  background: linear-gradient(150deg, #1a2850 0%, #111a36 100%);
  color: #e8eeff;
  font-size: 0.875rem;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(6, 10, 25, 0.45);
}

.track-status-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.track-status {
  display: inline-block;
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
}

a.track-status:hover {
  text-decoration: none;
  filter: brightness(1.12);
}

.track-status--general {
  border: 1px solid rgba(80, 140, 220, 0.45);
  background: rgba(60, 100, 180, 0.18);
  color: #b8d4ff;
}

.track-status--trend {
  border: 1px solid rgba(120, 180, 100, 0.45);
  background: rgba(80, 140, 70, 0.16);
  color: #c8e8b8;
}

.track-status--dm {
  border: 1px solid rgba(160, 120, 210, 0.45);
  background: rgba(110, 80, 170, 0.18);
  color: #dcc8ff;
}

.track-status--muted {
  color: #64748b;
}

/* Admin page: stacked cards, data management sections */
.admin-page .admin-card-stack {
  max-width: 1320px;
}

.admin-page .admin-ops-stack {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 1320px;
  margin-bottom: 0.5rem;
}

.admin-page .admin-ops-section .card-header {
  cursor: default;
}

.admin-page .admin-ops-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.admin-page .admin-ops-collapse-toggle:hover .admin-card-title,
.admin-page .admin-ops-collapse-toggle:focus-visible .admin-card-title {
  color: rgba(255, 210, 170, 0.98);
}

.admin-page .admin-ops-collapse-toggle:focus-visible {
  outline: 1px solid rgba(255, 190, 130, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

.admin-page .admin-ops-chevron {
  color: rgba(255, 190, 130, 0.9);
  font-size: 0.8rem;
  line-height: 1;
  width: 0.9rem;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.15s ease;
}

.admin-page .admin-ops-collapse-toggle[aria-expanded="false"] .admin-ops-chevron {
  transform: rotate(-90deg);
}

.admin-page .admin-breadcrumb a {
  color: rgba(255, 195, 150, 0.92);
  text-decoration: none;
}

.admin-page .admin-breadcrumb a:hover {
  color: rgba(255, 220, 180, 1);
  text-decoration: underline;
}

.admin-page .admin-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 1100px;
}

@media (min-width: 768px) {
  .admin-page .admin-hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.admin-page a.admin-hub-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-page a.admin-hub-card:hover {
  border-color: rgba(255, 175, 100, 0.7);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 190, 120, 0.16),
    inset 0 1px 0 rgba(255, 200, 140, 0.14);
  transform: translateY(-2px);
  color: inherit;
}

.admin-page .admin-hub-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.admin-page .admin-hub-card-desc {
  font-size: 0.85rem;
  color: rgba(200, 210, 230, 0.78);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.admin-page .admin-hub-card-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: rgba(210, 220, 240, 0.72);
  flex: 1;
}

.admin-page .admin-hub-card-list li {
  margin-bottom: 0.25rem;
}

.admin-page .admin-hub-card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 195, 150, 0.95);
  letter-spacing: 0.02em;
}

.admin-page .admin-labs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-page .admin-card {
  border-radius: 0.5rem;
}

.admin-page .admin-surface-card {
  background: linear-gradient(155deg, rgba(22, 30, 52, 0.94) 0%, rgba(12, 16, 32, 0.98) 55%, rgba(8, 12, 26, 1) 100%);
  border: 1px solid rgba(230, 145, 75, 0.42);
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 170, 95, 0.08),
    inset 0 1px 0 rgba(255, 190, 130, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.admin-page .admin-surface-card .card-header {
  background: linear-gradient(180deg, rgba(28, 36, 58, 0.55) 0%, rgba(14, 18, 34, 0.35) 100%);
  border-bottom: 1px solid rgba(220, 130, 65, 0.28);
}

.admin-page .admin-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.96);
}

.admin-page .admin-card-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 195, 150, 0.9);
  border: 1px solid rgba(230, 145, 80, 0.4);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(90, 45, 20, 0.28);
}

.admin-page #adminAuditStripMeta {
  color: rgba(220, 230, 245, 0.92);
}

.admin-page .admin-mini-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}

.admin-page .admin-compact-body {
  font-size: 0.9rem;
}

.admin-page .admin-code-tag {
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(180, 210, 255, 0.95);
}

.admin-page .admin-backup-select {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  background-color: rgba(8, 12, 24, 0.92);
  color: #e4e9f4;
  border-color: rgba(120, 140, 200, 0.35);
  border-radius: 8px;
}

.admin-page .admin-backup-select:focus {
  border-color: rgba(100, 160, 255, 0.55);
  box-shadow: 0 0 0 0.15rem rgba(79, 124, 255, 0.2);
}

.admin-page .admin-backup-toolbar .btn {
  border-radius: 8px;
}

.admin-page .admin-backup-pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-page .admin-modal-content {
  background: linear-gradient(180deg, #141a2e 0%, #0c101f 100%);
  border: 1px solid rgba(230, 145, 75, 0.45);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 160, 90, 0.12);
}

.admin-page .admin-modal-content .modal-header.border-secondary,
.admin-page .admin-modal-content .modal-footer.border-secondary {
  border-color: rgba(220, 130, 65, 0.35) !important;
}

.admin-page .admin-modal-input {
  background-color: rgba(8, 12, 24, 0.95);
  color: #e8ecf4;
  border-color: rgba(120, 140, 200, 0.35);
}

.admin-page .admin-modal-input:focus {
  border-color: rgba(100, 160, 255, 0.55);
  box-shadow: 0 0 0 0.15rem rgba(79, 124, 255, 0.2);
}

/* Modals: labels + custom toggles (Bootstrap .form-check-input fights dark theme) */
.admin-page .admin-modal-content .form-label {
  color: rgba(235, 240, 255, 0.92);
}

/* Shared app-wide toggle (admin backup modals + analysis pattern pickers) */
.admin-page .admin-modal-toggle,
.app-body .app-form-toggle {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.admin-page .admin-modal-toggle-input,
.app-body .app-form-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-page .admin-modal-toggle-box,
.app-body .app-form-toggle-box {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(10, 14, 28, 0.98);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.08rem;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

/* White ✓ drawn with borders — no SVG / Bootstrap background fight */
.admin-page .admin-modal-toggle-box::after,
.app-body .app-form-toggle-box::after {
  content: "";
  display: none;
  width: 0.32rem;
  height: 0.65rem;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
}

.admin-page .admin-modal-toggle-input:checked + .admin-modal-toggle-box,
.app-body .app-form-toggle-input:checked + .app-form-toggle-box {
  background: linear-gradient(165deg, #5a9cff 0%, #1f6cf0 55%, #1558d4 100%);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 2px rgba(90, 156, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.admin-page .admin-modal-toggle-input:checked + .admin-modal-toggle-box::after,
.app-body .app-form-toggle-input:checked + .app-form-toggle-box::after {
  display: block;
}

.admin-page .admin-modal-toggle-input:indeterminate + .admin-modal-toggle-box,
.app-body .app-form-toggle-input:indeterminate + .app-form-toggle-box {
  border-color: rgba(255, 200, 130, 0.85);
  background: linear-gradient(165deg, #5c5a68 0%, #353340 100%);
  box-shadow:
    0 0 0 2px rgba(255, 190, 120, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-page .admin-modal-toggle-input:indeterminate + .admin-modal-toggle-box::after,
.app-body .app-form-toggle-input:indeterminate + .app-form-toggle-box::after {
  content: "";
  display: block;
  width: 0.55rem;
  height: 3px;
  margin: 0;
  border: none;
  border-radius: 1px;
  background: #ffffff;
  transform: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6));
}

.admin-page .admin-modal-toggle-input:focus-visible + .admin-modal-toggle-box,
.app-body .app-form-toggle-input:focus-visible + .app-form-toggle-box {
  outline: 2px solid rgba(180, 210, 255, 0.95);
  outline-offset: 3px;
}

.admin-page .admin-modal-toggle-input:disabled + .admin-modal-toggle-box,
.app-body .app-form-toggle-input:disabled + .app-form-toggle-box {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.admin-page .admin-modal-toggle-input:disabled ~ .admin-modal-toggle-text,
.app-body .app-form-toggle-input:disabled ~ .app-form-toggle-text {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-page .admin-modal-toggle-text,
.app-body .app-form-toggle-text {
  color: rgba(240, 244, 255, 0.96);
  line-height: 1.45;
}

.admin-page .admin-modal-toggle-text code,
.app-body .app-form-toggle-text code {
  color: rgba(170, 205, 255, 0.98);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.app-body .app-form-toggle-text.is-monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  word-break: break-word;
}

.admin-page .admin-restore-pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(80, 40, 20, 0.25);
  border: 1px solid rgba(255, 160, 80, 0.25);
  color: rgba(255, 230, 210, 0.95);
}

.admin-page .admin-stat-tile {
  background: linear-gradient(165deg, rgba(20, 28, 48, 0.85) 0%, rgba(10, 14, 28, 0.92) 100%);
  border: 1px solid rgba(120, 150, 220, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  min-height: 4.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-page .admin-stat-value {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.96);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.admin-page .admin-stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 0.3rem;
  line-height: 1.3;
}

.admin-page .admin-stat-table-wrap {
  border-radius: 8px;
  border: 1px solid rgba(120, 150, 220, 0.15);
  background: rgba(6, 10, 22, 0.45);
  padding: 0.35rem 0.5rem;
}

/* Bootstrap .table sets --bs-table-color for light backgrounds; force light text on dark admin panels */
.admin-page .admin-stat-table {
  --bs-table-bg: transparent;
  --bs-table-color: #e8ecf4;
  --bs-table-striped-color: #e8ecf4;
  --bs-table-active-color: #e8ecf4;
  --bs-table-hover-color: #e8ecf4;
  color: #e8ecf4;
  font-size: 0.875rem;
}

.admin-page .admin-stat-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.88) !important;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.admin-page .admin-stat-table tbody td {
  color: #e8ecf4 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08);
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.admin-page .admin-stat-table tbody td.font-monospace {
  color: rgba(200, 225, 255, 0.98) !important;
}

.admin-page .admin-stat-git {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(30, 45, 80, 0.35);
  border: 1px solid rgba(120, 150, 220, 0.18);
}

.admin-page .admin-audit-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.admin-page .admin-audit-overview-tile {
  flex: 1 1 8rem;
  min-width: 7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(22, 35, 62, 0.55);
  border: 1px solid rgba(120, 150, 220, 0.2);
}

.admin-page .admin-audit-overview-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  color: rgba(235, 242, 255, 0.98);
}

.admin-page .admin-audit-overview-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(160, 180, 220, 0.88);
  margin-top: 0.15rem;
}

.admin-page .admin-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.65rem;
}

.admin-page .admin-audit-card.ts-suite-card {
  position: relative;
}

.admin-page .ts-suite-info {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(160, 190, 255, 0.55);
  background: rgba(30, 48, 82, 0.95);
  color: rgba(210, 225, 255, 0.98);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-page .ts-suite-info:hover,
.admin-page .ts-suite-info:focus-visible {
  border-color: rgba(255, 190, 120, 0.85);
  color: #fff;
  background: rgba(50, 70, 110, 0.98);
  outline: none;
}

.admin-page .admin-audit-card.is-executive {
  border-color: rgba(90, 180, 255, 0.45);
  background: rgba(20, 38, 68, 0.85);
}

.admin-page .admin-audit-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.admin-page .admin-audit-card-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: rgba(240, 246, 255, 0.98);
  line-height: 1.25;
}

/* Bootstrap .h1–.h6 defaults can paint dark text on dark admin cards */
.admin-page .admin-audit-card .admin-audit-card-title,
.admin-page .admin-audit-card h1,
.admin-page .admin-audit-card h2,
.admin-page .admin-audit-card h3,
.admin-page .admin-audit-card h4,
.admin-page .admin-audit-card h5,
.admin-page .admin-audit-card h6,
.admin-page .admin-audit-card .h1,
.admin-page .admin-audit-card .h2,
.admin-page .admin-audit-card .h3,
.admin-page .admin-audit-card .h4,
.admin-page .admin-audit-card .h5,
.admin-page .admin-audit-card .h6 {
  color: rgba(240, 246, 255, 0.98) !important;
}

.admin-page .table thead th {
  color: rgba(220, 230, 255, 0.92);
  border-color: rgba(120, 150, 220, 0.25);
}

.admin-page .admin-audit-synthesis-tag {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(140, 200, 255, 0.85);
  vertical-align: middle;
}

.admin-page .admin-audit-card-date {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: rgba(150, 175, 220, 0.9);
  white-space: nowrap;
}

.admin-page .admin-audit-card-quip {
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(255, 190, 120, 0.92);
  font-style: italic;
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
}

.admin-page .admin-audit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.admin-page .admin-audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.admin-page .admin-audit-badge .admin-audit-badge-n {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-page .admin-audit-badge--critical {
  color: #ffb4b4;
  background: rgba(180, 40, 40, 0.22);
  border-color: rgba(255, 100, 100, 0.35);
}

.admin-page .admin-audit-badge--high {
  color: #ffc98a;
  background: rgba(180, 100, 20, 0.2);
  border-color: rgba(255, 170, 80, 0.32);
}

.admin-page .admin-audit-badge--medium {
  color: #ffe08a;
  background: rgba(140, 120, 30, 0.18);
  border-color: rgba(220, 190, 80, 0.28);
}

.admin-page .admin-audit-badge--low {
  color: #b8d4ff;
  background: rgba(60, 100, 180, 0.18);
  border-color: rgba(120, 170, 255, 0.28);
}

.admin-page .admin-audit-badge--info {
  color: #c8d0e0;
  background: rgba(80, 90, 110, 0.25);
  border-color: rgba(140, 150, 170, 0.3);
}

.admin-page .admin-audit-badge--fixed {
  color: #9ef0b8;
  background: rgba(30, 120, 70, 0.22);
  border-color: rgba(80, 220, 140, 0.35);
}

.admin-page .admin-audit-badge--open {
  color: #ffd0a0;
  background: rgba(120, 70, 20, 0.2);
  border-color: rgba(220, 150, 60, 0.3);
}

.admin-page .admin-audit-badge--wont {
  color: #d4c4f0;
  background: rgba(90, 70, 130, 0.28);
  border-color: rgba(160, 130, 210, 0.4);
}

.admin-page .admin-critical-card.is-wont {
  opacity: 0.85;
  border-color: rgba(160, 130, 210, 0.35);
}

.admin-page .admin-audit-badge--score {
  color: #9ed4ff;
  background: rgba(40, 100, 180, 0.25);
  border-color: rgba(100, 180, 255, 0.38);
}

.admin-page .admin-critical-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audits-page .audits-queue-filters .btn {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.audits-page .audits-category-filter {
  width: auto;
  min-width: 9rem;
  max-width: 12rem;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  color: rgba(230, 236, 248, 0.95);
  border-color: rgba(148, 163, 184, 0.35);
}

.audits-page .audits-start-grid {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.audits-page .audits-start-card.is-all {
  grid-column: 1 / -1;
  border-color: rgba(230, 145, 75, 0.65);
  background: linear-gradient(155deg, rgba(40, 28, 18, 0.55) 0%, rgba(12, 16, 32, 0.95) 60%);
}

.audits-page .audits-start-card.is-all .admin-critical-prompt {
  min-height: 12rem;
}

.audits-page .audits-start-card .admin-critical-prompt {
  min-height: 9rem;
  font-size: 0.72rem;
}

/* Collapsible audits sections (queue + runs) */
.audits-page .audits-collapse-panel-head,
.audits-page .audits-runs-panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}

.audits-page .audits-collapse-toggle,
.audits-page .audits-runs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.audits-page .audits-collapse-toggle:hover .admin-card-title,
.audits-page .audits-collapse-toggle:focus-visible .admin-card-title,
.audits-page .audits-runs-toggle:hover .admin-card-title,
.audits-page .audits-runs-toggle:focus-visible .admin-card-title {
  color: rgba(255, 210, 170, 0.98);
}

.audits-page .audits-collapse-toggle:focus-visible,
.audits-page .audits-runs-toggle:focus-visible {
  outline: 1px solid rgba(255, 190, 130, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

.audits-page .audits-collapse-chevron,
.audits-page .audits-runs-chevron {
  color: rgba(255, 190, 130, 0.9);
  font-size: 0.8rem;
  line-height: 1;
  width: 0.9rem;
  flex-shrink: 0;
}

.audits-page .audits-collapse-panel.is-collapsed .audits-collapse-chevron,
.audits-page .audits-collapse-panel.is-collapsed .audits-runs-chevron {
  transform: rotate(-90deg);
  display: inline-block;
}

.audits-page .audits-collapse-panel.is-collapsed #auditsQueueBody,
.audits-page .audits-collapse-panel.is-collapsed #auditsRunsBody {
  display: none;
}

.audits-page .audits-queue-toolbar {
  margin-left: auto;
}

.audits-page .audits-runs-count {
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: rgba(255, 210, 170, 0.95);
  border: 1px solid rgba(230, 145, 80, 0.4);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  background: rgba(90, 45, 20, 0.35);
}

.audits-page .audits-runs-hint {
  font-size: 0.72rem;
  color: rgba(210, 220, 240, 0.88);
  margin-left: auto;
}

.audits-page .audits-runs-empty {
  font-size: 0.8rem;
  color: rgba(210, 220, 240, 0.88);
}

.audits-page .audits-runs-empty a {
  color: rgba(255, 190, 120, 0.95);
}

.audits-page .audits-runs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.15rem 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.audits-page .audits-runs-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.75rem;
  color: rgba(210, 220, 240, 0.92);
  cursor: pointer;
  user-select: none;
}

.audits-page .audits-runs-select-all input,
.audits-page .audits-run-check {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: rgba(255, 160, 90, 0.95);
  cursor: pointer;
}

.audits-page .audits-runs-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.audits-page .audits-run-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(9.5rem, 12rem) minmax(5.5rem, auto) 1fr auto;
  column-gap: 0.5rem;
  row-gap: 0.15rem;
  align-items: center;
  padding: 0.4rem 0.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.78rem;
  color: rgba(232, 236, 244, 0.96);
}

.audits-page .audits-run-row:last-child {
  border-bottom: none;
}

.audits-page .audits-run-row-main {
  display: contents;
}

.audits-page .audits-run-check-wrap {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.audits-page .audits-run-domain {
  grid-column: 2;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audits-page .audits-run-outcome {
  grid-column: 3;
  justify-self: start;
  min-width: 5.25rem;
  justify-content: center;
}

.audits-page .audits-run-when {
  grid-column: 4;
  font-size: 0.7rem;
  color: rgba(200, 214, 235, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audits-page .audits-run-delete {
  grid-column: 5;
  justify-self: end;
  margin: 0;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  line-height: 1.2;
  border-radius: 4px;
  border: 1px solid rgba(255, 120, 120, 0.4);
  background: rgba(120, 30, 30, 0.35);
  color: rgba(255, 200, 200, 0.95);
  cursor: pointer;
}

.audits-page .audits-run-delete:hover,
.audits-page .audits-run-delete:focus-visible {
  background: rgba(160, 40, 40, 0.55);
  color: #fff;
}

.audits-page .audits-run-summary {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(220, 228, 242, 0.92);
  padding-left: 0;
}

.audits-page .audits-run-row .audits-complete-run {
  grid-column: 1 / -1;
  width: fit-content;
  margin-top: 0.15rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
}

@media (max-width: 700px) {
  .audits-page .audits-run-row {
    grid-template-columns: 1.25rem minmax(0, 1fr) auto auto;
  }

  .audits-page .audits-run-check-wrap {
    grid-column: 1;
  }

  .audits-page .audits-run-domain {
    grid-column: 2;
  }

  .audits-page .audits-run-outcome {
    grid-column: 3;
  }

  .audits-page .audits-run-delete {
    grid-column: 4;
  }

  .audits-page .audits-run-when {
    grid-column: 2 / -1;
    white-space: normal;
  }

  .audits-page .audits-runs-hint,
  .audits-page .audits-queue-toolbar {
    margin-left: 0;
    width: 100%;
  }
}

.admin-page .admin-critical-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.admin-page .admin-critical-card.is-done {
  opacity: 0.72;
}

.admin-page .admin-critical-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.admin-page .admin-critical-card-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: rgba(235, 242, 255, 0.96);
}

.admin-page .admin-critical-why {
  color: rgba(210, 222, 245, 0.92);
  line-height: 1.45;
}

.admin-page .admin-critical-prompt {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.72);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 0.55rem 0.65rem;
}

/* Date field: narrow, roughly the width of YYYY-MM-DD (not full row) */
.admin-page .admin-date-select {
  width: auto !important;
  min-width: 9.25rem;
  max-width: 12rem;
  flex: 0 0 auto;
}

.admin-page .admin-form-select {
  background-color: rgba(15, 20, 38, 0.95);
  color: #e8ecf4;
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-page .admin-form-select:focus {
  border-color: rgba(100, 149, 255, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(79, 124, 255, 0.2);
}

.admin-page .admin-form-select option:disabled {
  color: rgba(255, 255, 255, 0.38);
}

.admin-page .admin-action-result .alert {
  font-size: 0.875rem;
}

/* Symbol management: Bootstrap alerts on dark admin cards */
.admin-page .admin-symbol-status-alert.alert-info {
  background-color: rgba(13, 110, 253, 0.22);
  color: #eaf2ff;
  border-color: rgba(130, 180, 255, 0.55) !important;
}
.admin-page .admin-symbol-status-alert.alert-success {
  background-color: rgba(25, 135, 84, 0.28);
  color: #e6fff1;
  border-color: rgba(110, 231, 170, 0.55) !important;
}
.admin-page .admin-symbol-status-alert.alert-warning {
  background-color: rgba(255, 193, 7, 0.2);
  color: #fff9e6;
  border-color: rgba(255, 214, 120, 0.55) !important;
}
.admin-page .admin-symbol-status-alert.alert-danger {
  background-color: rgba(220, 53, 69, 0.25);
  color: #ffeef1;
  border-color: rgba(255, 150, 170, 0.55) !important;
}
.admin-page .admin-symbol-status-alert .admin-code-tag,
.admin-page .admin-symbol-status-alert code {
  color: #c8d4f0;
}
.admin-page .admin-symbol-status-alert .text-muted-2 {
  color: rgba(200, 210, 230, 0.72) !important;
}
.admin-page .admin-symbol-status-alert .text-success {
  color: #9eecc0 !important;
}

.admin-page .admin-fundamental-db {
  line-height: 1.45;
}

.admin-page .admin-fundamental-log {
  max-height: 11rem;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: #c8d4f0;
  line-height: 1.4;
}

.admin-page .admin-fundamental-log:empty::before {
  content: "No fundamental events logged yet. Run Pull or click Refresh status.";
  color: rgba(255, 255, 255, 0.38);
  font-style: italic;
}

.admin-page .admin-cf-tunnel-log {
  max-height: 16rem;
}

.admin-page .admin-cf-tunnel-log:empty::before {
  content: "Click Check status to print tunnel state here.";
}

.admin-page .admin-cf-tunnel-log-line {
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-page .admin-cf-tunnel-status-table {
  width: 100%;
  max-width: 52rem;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0 0 0.35rem;
}

.admin-page .admin-cf-tunnel-status-table th,
.admin-page .admin-cf-tunnel-status-table td {
  padding: 0.28rem 0.55rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-page .admin-cf-tunnel-status-table th {
  width: 6.5rem;
  color: rgba(200, 212, 240, 0.55);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.admin-page .admin-cf-tunnel-status-table td {
  color: #d7def0;
}

.admin-page .admin-cf-tunnel-status-table tr:last-child th,
.admin-page .admin-cf-tunnel-status-table tr:last-child td {
  border-bottom: none;
}

.admin-page .admin-orbis-api-status {
  max-height: 22rem;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: #c8d4f0;
  line-height: 1.4;
}

.admin-page .admin-orbis-api-state {
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.admin-page .admin-orbis-api-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.7rem;
}

.admin-page .admin-orbis-api-section {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.admin-page .admin-orbis-api-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.admin-page .admin-orbis-api-kv {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.12rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-page .admin-orbis-api-kv:last-child {
  border-bottom: none;
}

.admin-page .admin-orbis-api-kv-k {
  color: rgba(255, 255, 255, 0.5);
  flex: 0 1 auto;
}

.admin-page .admin-orbis-api-kv-v {
  color: #d7def0;
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

.admin-page .admin-flask-check-out {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 18rem;
  overflow: auto;
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.admin-page .admin-flask-cmd {
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-page .admin-orbis-api-cmds {
  display: grid;
  gap: 0.45rem;
}

.admin-page .admin-orbis-api-cmd-block .admin-orbis-api-kv-k {
  display: block;
  margin-bottom: 0.2rem;
}

@media (max-width: 900px) {
  .admin-page .admin-orbis-api-grid {
    grid-template-columns: 1fr;
  }
}

/* ~15 activity lines visible; scroll for older entries */
.admin-page .admin-orbis-api-log.admin-cf-tunnel-log {
  max-height: calc(15 * (1.4em + 0.35rem) + 1rem);
  overflow-y: auto;
}

.admin-page .admin-orbis-api-cmd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem 0.55rem;
}

.admin-page .admin-orbis-api-cmd-row .admin-orbis-api-cmd {
  flex: 1 1 16rem;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
}

.admin-page .admin-orbis-api-copy-btn {
  flex: 0 0 auto;
  padding: 0.1rem 0.45rem;
  line-height: 1.3;
}

.admin-page .admin-orbis-api-keys-toolbar {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 165, 233, 0.08);
}

.admin-page .admin-orbis-api-keys-stats {
  margin-bottom: 0.55rem;
}

.admin-page .admin-orbis-api-keys-list {
  max-height: 14rem;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: #c8d4f0;
}

.admin-page .admin-orbis-api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
  gap: 0.35rem 0.65rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-page .admin-orbis-api-key-row:last-child {
  border-bottom: none;
}

.admin-page .admin-orbis-api-key-row--revoked {
  opacity: 0.55;
}

.admin-page .admin-orbis-api-key-once {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #d7def0;
}

.admin-page .admin-orbis-api-key-once code {
  user-select: all;
  word-break: break-all;
}

@media (max-width: 700px) {
  .admin-page .admin-orbis-api-key-row {
    grid-template-columns: 1fr;
  }
}

.admin-page .admin-orbis-api-status:empty::before {
  content: "Click Check status to inspect the API service.";
  color: rgba(255, 255, 255, 0.38);
  font-style: italic;
}

.admin-page .admin-cf-tunnel-file-log {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(200, 212, 240, 0.78);
}

.admin-page .admin-cf-tunnel-file-log-head {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.admin-page .admin-cf-tunnel-file-log-line {
  margin-bottom: 0.2rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-page .admin-cf-tunnel-file-log-line:last-child {
  margin-bottom: 0;
}

.admin-page .admin-fund-log-line {
  margin-bottom: 4px;
}

.admin-page .admin-fund-log-line:last-child {
  margin-bottom: 0;
}

.admin-page .admin-fund-log-ok {
  color: #8ce8b0;
}

.admin-page .admin-fund-log-warn {
  color: #f0c878;
}

.admin-page .admin-fund-log-err {
  color: #f0a0a0;
}

.admin-page .admin-fund-log-info {
  color: #9ec4ff;
}

/* Sector index recompute: Bootstrap alerts sit on a dark card — boost contrast */
.admin-page #recomputeSectorIndicesResult .admin-recompute-alert.alert-info {
  background-color: rgba(13, 110, 253, 0.22);
  color: #eaf2ff;
  border-color: rgba(130, 180, 255, 0.55) !important;
}
.admin-page #recomputeSectorIndicesResult .admin-recompute-alert.alert-success {
  background-color: rgba(25, 135, 84, 0.28);
  color: #e6fff1;
  border-color: rgba(110, 231, 170, 0.55) !important;
}
.admin-page #recomputeSectorIndicesResult .admin-recompute-alert.alert-warning {
  background-color: rgba(255, 193, 7, 0.2);
  color: #fff9e6;
  border-color: rgba(255, 214, 120, 0.55) !important;
}
.admin-page #recomputeSectorIndicesResult .admin-recompute-alert.alert-danger {
  background-color: rgba(220, 53, 69, 0.25);
  color: #ffeef1;
  border-color: rgba(255, 150, 170, 0.55) !important;
}

.header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.header-end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-left: auto;
  justify-content: flex-end;
}

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

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-brand:hover {
  color: inherit;
  text-decoration: none;
  opacity: 0.92;
}

.site-brand--header {
  flex-shrink: 0;
}

.site-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(126, 184, 255, 0.55),
    0 0 18px rgba(46, 130, 255, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

.site-brand-logo-wrap .site-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 100%;
  min-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(80, 190, 255, 0.45));
}

.site-brand--footer .site-brand-logo-wrap {
  width: 48px;
  height: 48px;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.site-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2f5ff;
  white-space: nowrap;
}

.site-brand-tagline {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7eb8ff;
  white-space: nowrap;
}

.site-brand-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(122, 145, 210, 0.25);
  display: flex;
  justify-content: flex-start;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
}

.header-stack {
  flex-direction: column;
  align-items: stretch;
}

.header-stack > h1 {
  flex: 0 0 auto;
  width: 100%;
}

.header > h1 {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 575px) {
  .header-end {
    width: 100%;
    justify-content: flex-end;
  }

  .site-brand-name,
  .site-brand-tagline {
    white-space: normal;
  }
}

h1 {
  margin: 0;
  font-size: 24px;
}

.pull-btn {
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 20px rgba(79, 124, 255, 0.28);
}

.pull-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rules-link {
  color: #d5deff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.rules-link:hover {
  color: #f2f5ff;
}

.status {
  margin-top: 14px;
  color: #bac5e6;
}

.pull-meta {
  margin-top: 12px;
  color: #a9bbea;
  font-size: 14px;
}

.pull-meta.pull-meta-synced {
  color: #5ad88a;
}

.pull-meta.pull-meta-behind {
  color: #ff6b6b;
}

.dashboard-page #status:empty {
  display: none;
  margin-bottom: 0 !important;
}

.section-title {
  margin: 16px 0 10px;
  font-size: 18px;
}

.section-title--structural {
  color: #4ade80;
}

.section-title--daily {
  color: #60a5fa;
}

.controls {
  margin-top: 14px;
}

.search-input {
  width: 100%;
  max-width: 420px;
  background: rgba(17, 26, 54, 0.92);
  color: #eef3ff;
  border: 1px solid #3a4f89;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.search-input:focus {
  border-color: #6f98ff;
  box-shadow: 0 0 0 0.2rem rgba(100, 145, 255, 0.25);
  background: rgba(17, 26, 54, 1);
}

/*
 * Text-like fields only. Exclude native date/number/time/etc. so calendar icons and
 * spinners stay visible (global dark fill + same-color chrome was hiding them).
 */
.app-body .form-control:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"]),
.app-body
  input:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
.app-body textarea,
.app-body select {
  color: #eef3ff !important;
  caret-color: #eef3ff;
  background: rgba(17, 26, 54, 0.92) !important;
  border-color: #3a4f89 !important;
}

.app-body .form-control:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"])::placeholder,
.app-body
  input:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])::placeholder,
.app-body textarea::placeholder {
  color: #a9bbea !important;
  opacity: 1;
}

.app-body .form-control:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
.app-body
  input:not([type="date"]):not([type="number"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]):focus,
.app-body textarea:focus,
.app-body select:focus {
  color: #eef3ff !important;
  background: rgba(17, 26, 54, 1) !important;
  border-color: #6f98ff !important;
}

/* Native pickers + number steppers: dark scheme + light chrome so controls stay visible. */
.app-body input[type="date"],
.app-body input[type="number"],
.app-body input[type="time"],
.app-body input[type="datetime-local"],
.app-body input[type="month"],
.app-body input[type="week"] {
  color: #eef3ff !important;
  caret-color: #eef3ff;
  background-color: #161c30 !important;
  border-color: #4a5d94 !important;
  color-scheme: dark;
}

.app-body input[type="date"]:focus,
.app-body input[type="number"]:focus,
.app-body input[type="time"]:focus,
.app-body input[type="datetime-local"]:focus,
.app-body input[type="month"]:focus,
.app-body input[type="week"]:focus {
  color: #eef3ff !important;
  background-color: #1a223c !important;
  border-color: #6f98ff !important;
}

/*
 * WebKit: default calendar glyph is often low-contrast on dark fields; replace with a
 * light SVG so the control stays visible (Safari/Chrome).
 */
.app-body input[type="date"]::-webkit-calendar-picker-indicator,
.app-body input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.app-body input[type="month"]::-webkit-calendar-picker-indicator,
.app-body input[type="week"]::-webkit-calendar-picker-indicator {
  opacity: 1 !important;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  margin: 0 0.2rem 0 0;
  cursor: pointer;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e8ecf4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.app-body input.app-date-input[type="date"] {
  padding-inline-end: 0.35rem;
  min-height: calc(1.5em + 0.5rem + 2px);
}

.app-body input[type="number"]::-webkit-inner-spin-button,
.app-body input[type="number"]::-webkit-outer-spin-button {
  filter: invert(0.92) brightness(1.15);
  opacity: 1;
  height: 1.25rem;
}

.app-body select option {
  background: #111a36;
  color: #eef3ff;
}

/* WebKit autofill can force unreadable colors; override for dark UI. */
.app-body input:-webkit-autofill,
.app-body input:-webkit-autofill:hover,
.app-body input:-webkit-autofill:focus,
.app-body textarea:-webkit-autofill,
.app-body select:-webkit-autofill {
  -webkit-text-fill-color: #eef3ff !important;
  transition: background-color 9999s ease-in-out 0s;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.category-card {
  border: 1px solid #3a4a7f;
  border-radius: 12px;
  background: linear-gradient(150deg, #162144 0%, #111a36 100%);
  color: #e8eeff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.category-card:hover {
  border-color: #88a8ff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(6, 10, 25, 0.35);
}

.category-card.active {
  border-color: #9bb6ff;
  background: linear-gradient(150deg, #253975 0%, #152551 100%);
  box-shadow: 0 10px 24px rgba(63, 95, 176, 0.25);
}

.category-card.tone-worth-long {
  border-color: #3a8f7b;
  background: linear-gradient(150deg, #133d38 0%, #0f2f2b 100%);
}

.category-card.tone-worth-short {
  border-color: #9e4f4f;
  background: linear-gradient(150deg, #452024 0%, #2d161a 100%);
}

.category-card.tone-conditional-long {
  border-color: #5f7e34;
  background: linear-gradient(150deg, #2a3b19 0%, #1f2c13 100%);
}

.category-card.tone-conditional-short {
  border-color: #8f6840;
  background: linear-gradient(150deg, #3c2a17 0%, #2d2115 100%);
}

.category-card.tone-not-worth {
  border-color: #5e6385;
  background: linear-gradient(150deg, #202741 0%, #171d33 100%);
}

.category-card.tone-unclassified {
  border-color: #485272;
  background: linear-gradient(150deg, #1c2339 0%, #151a2c 100%);
}

.category-grid-spotlight {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.section-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a8b8e8;
  letter-spacing: 0.02em;
}

.category-card.tone-integrated-strong {
  border-color: #2f9d6a;
  background: linear-gradient(150deg, #123d2c 0%, #0f2f24 100%);
}

.category-card.tone-integrated-conditional {
  border-color: #6f8f3a;
  background: linear-gradient(150deg, #2a3b19 0%, #1f2c13 100%);
}

.category-card.tone-integrated-speculative {
  border-color: #b07a2e;
  background: linear-gradient(150deg, #3d2d14 0%, #2d2110 100%);
}

.category-card.tone-integrated-avoid {
  border-color: #5e6385;
  background: linear-gradient(150deg, #202741 0%, #171d33 100%);
}

.category-card.tone-integrated-neutral {
  border-color: #5a6a8a;
  background: linear-gradient(150deg, #1e2840 0%, #171f32 100%);
}

.category-card.tone-integrated-short {
  border-color: #9e4f4f;
  background: linear-gradient(150deg, #452024 0%, #2d161a 100%);
}

.category-card.tone-ta-only {
  border-color: #4a5580;
  background: linear-gradient(150deg, #1a2240 0%, #141a30 100%);
}

.category-card.tone-divergence-quality {
  border-color: #7a6abf;
  background: linear-gradient(150deg, #2a2450 0%, #1e1a3a 100%);
}

.category-card.tone-divergence-aligned {
  border-color: #3db8a0;
  background: linear-gradient(150deg, #154840 0%, #103530 100%);
}

.category-card.tone-structural-strong-long {
  border-color: #2f9d6a;
  background: linear-gradient(150deg, #123d2c 0%, #0f2f24 100%);
}

.category-card.tone-structural-conditional-long {
  border-color: #6f8f3a;
  background: linear-gradient(150deg, #2a3b19 0%, #1f2c13 100%);
}

.category-card.tone-structural-neutral {
  border-color: #5a6a8a;
  background: linear-gradient(150deg, #1e2840 0%, #171f32 100%);
}

.category-card.tone-structural-conditional-short {
  border-color: #b07a4a;
  background: linear-gradient(150deg, #3d2818 0%, #2a1c10 100%);
}

.category-card.tone-structural-strong-short {
  border-color: #9e4f4f;
  background: linear-gradient(150deg, #452024 0%, #2d161a 100%);
}

.category-card.tone-structural-spotlight-top {
  border-color: #e8c547;
  background: linear-gradient(150deg, #4a3a10 0%, #2f2710 100%);
}

.category-card.tone-structural-spotlight-good {
  border-color: #2f9d6a;
  background: linear-gradient(150deg, #123d2c 0%, #0f2f24 100%);
}

.category-card.tone-structural-spotlight-decent {
  border-color: #6f8f3a;
  background: linear-gradient(150deg, #2a3b19 0%, #1f2c13 100%);
}

.classification-cell,
th.classification-col {
  min-width: 12rem;
  max-width: 18rem;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.diag-col,
.diag-cell {
  font-size: 11px;
  white-space: nowrap;
  vertical-align: middle;
}

th.diag-yn,
td.diag-yn {
  width: 3.5rem;
  min-width: 3.5rem;
  max-width: 3.5rem;
  text-align: center;
}

th.diag-ecs,
td.diag-ecs {
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th.diag-news,
td.diag-news {
  min-width: 8.5rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

th.diag-run-col,
td.diag-run-cell {
  width: 4.25rem;
  min-width: 4.25rem;
  text-align: center;
}

.diag-yes {
  color: #4ade80;
  font-weight: 600;
}

.diag-no {
  color: #f87171;
  font-weight: 600;
}

.entry-rank-cell,
th.entry-rank-col {
  width: 3.5rem;
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #e8eef7;
}

.entry-score-cell,
th.entry-score-col {
  width: 4.25rem;
  min-width: 4.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.track-cell,
th.track-col {
  width: 4.75rem;
  min-width: 4.75rem;
}

.classification-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
}

.classification-lines > div {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.classification-lines .classification-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8ea8e8;
  margin-right: 4px;
}

.classification-structural {
  color: #e8f0ff;
  margin-bottom: 2px;
}

.classification-tactical {
  color: #c8daf8;
}

.classification-daily {
  margin-top: 3px;
}

/* Match synthetic sector index mini-card type scale */
.category-name,
.sector-index-mini-card__name {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  font-size: 11px;
  color: #c6d3f7;
  margin-bottom: 4px;
}

.category-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #e8eeff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.category-list-section {
  margin-top: 8px;
}

.dashboard-sector-index-details {
  border: 1px solid #2f3b6c;
  border-radius: 14px;
  background: rgba(16, 24, 52, 0.72);
  padding: 12px 14px 14px;
  box-shadow: 0 8px 22px rgba(6, 10, 25, 0.28);
}

.dashboard-sector-index-details > summary {
  list-style: none;
  cursor: pointer;
}

.dashboard-sector-index-details > summary::-webkit-details-marker {
  display: none;
}

.dashboard-sector-index-summary {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dashboard-sector-index-chevron {
  flex-shrink: 0;
  margin-top: 8px;
  color: #88a8ff;
  transition: transform 0.15s ease;
  font-size: 14px;
  line-height: 1;
}

.dashboard-sector-index-details[open] > summary .dashboard-sector-index-chevron {
  transform: rotate(90deg);
}

.dashboard-sector-index-summary-main {
  flex: 1;
  min-width: 0;
}

.sector-index-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.sector-index-graph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.sector-index-graph-card {
  border: 1px solid #2f3b6c;
  border-radius: 12px;
  background: rgba(12, 18, 40, 0.6);
  padding: 12px;
}

.sector-index-graph-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.sector-index-graph-title {
  font-size: 0.95rem;
  margin: 0;
  color: #e2e8f0;
}

.sector-index-graph-level {
  font-size: 0.8rem;
  color: #94a3b8;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}

.sector-index-graph-svg {
  width: 100%;
  height: 180px;
  display: block;
}

.sector-index-graph-range {
  margin-top: 4px;
}

.sector-index-graph-baseline {
  color: #8892b0;
}

.agg-symbol-row {
  cursor: pointer;
}

.agg-symbol-row:hover {
  background: rgba(120, 150, 220, 0.12);
}

.agg-symbol-caret {
  display: inline-block;
  width: 1em;
  color: #8fa6df;
}

.agg-analysis-cell {
  background: rgba(10, 15, 34, 0.6);
  padding: 12px 14px;
}

.ted-chart-cell {
  background: rgba(10, 15, 34, 0.55);
  padding: 10px 12px;
  vertical-align: top;
}

.ted-chart-row td {
  border-top: none;
}

.ted-price-window-slot {
  max-width: 1100px;
}

.sector-index-graph-table-details > summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: #9db2e6;
}

.sector-index-graph-table-details[open] > summary {
  margin-bottom: 4px;
}

.sector-index-mini-card {
  border: 1px solid #3a4a7f;
  border-radius: 12px;
  background: linear-gradient(150deg, #162144 0%, #111a36 100%);
  padding: 10px 12px;
  color: #e8eeff;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.sector-index-mini-card:hover {
  border-color: #88a8ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(6, 10, 25, 0.28);
}

.sector-index-mini-card.active {
  border-color: #9bb6ff;
  background: linear-gradient(150deg, #253975 0%, #152551 100%);
  box-shadow: 0 8px 20px rgba(63, 95, 176, 0.22);
}

.sector-drilldown-panel {
  border-top: 1px solid #2f3b6c;
  padding-top: 12px;
}

th.sortable-sector {
  cursor: pointer;
  user-select: none;
}

th.sortable-sector:hover {
  color: #d6def7;
}

.sector-index-mini-card--universe {
  grid-column: 1 / -1;
  border-color: #5a73c4;
  background: linear-gradient(150deg, #1a2850 0%, #121c3a 100%);
}

.sector-index-mini-card__level {
  margin-bottom: 6px;
}

.sector-index-mini-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}

.sector-index-details-panel .table-wrap {
  margin-top: 0;
}

.table-wrap {
  margin-top: 18px;
  background: rgba(16, 24, 52, 0.9);
  border: 1px solid #2f3b6c;
  border-radius: 14px;
  overflow: auto;
  box-shadow: 0 10px 28px rgba(6, 10, 25, 0.32);
}

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

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #2a3662;
  white-space: nowrap;
}

thead {
  background: #1d2d5f;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: #d6def7;
}

tbody tr:hover {
  background: #18244b;
}

.clickable-row {
  cursor: pointer;
}

.selected-row {
  background: #22386d;
}

.expanded-row td {
  border-bottom: 1px solid #2a3662;
}

.expanded-cell {
  padding: 0;
  background: #101a38;
  white-space: normal;
}

.symbol-expansion {
  padding: 0.75rem 1rem 1rem;
}

.symbol-expansion-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.symbol-expansion-title {
  margin: 0;
  font-size: 1.1rem;
}

.symbol-expansion-daily,
.symbol-expansion-structural {
  margin-bottom: 0.5rem;
}

.symbol-expansion-pane {
  padding-top: 0.35rem;
}

.inline-analysis--structural .summary-block--structural {
  border-left: 3px solid rgba(136, 168, 255, 0.55);
}

.structural-summary-stats {
  font-size: 0.85rem;
  margin: 0.5rem 0 0.75rem;
}

.inline-analysis {
  padding: 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inline-analysis > h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.analysis-meta {
  margin: 0 0 12px;
  color: #9fb0dd;
  font-size: 13px;
}

.positive {
  color: #23d18b;
}

.negative {
  color: #f57171;
}

/* Bootstrap table color variables can override plain class colors. */
.table td.positive,
.table th.positive {
  color: #34d399 !important;
}

.table td.negative,
.table th.negative {
  color: #f87171 !important;
}

/* Tracking page: positive diff = blue, negative = red, zero = default. */
.table-tracking td.positive,
.trend-score-track-table td.positive {
  color: #60a5fa !important;
}

.table-tracking td.negative,
.trend-score-track-table td.negative {
  color: #f87171 !important;
}

/* Subtle directional cue at row level. */
.table tbody tr.row-positive td:first-child {
  box-shadow: inset 3px 0 0 #34d399;
}

.table tbody tr.row-negative td:first-child {
  box-shadow: inset 3px 0 0 #f87171;
}

.empty {
  text-align: center;
  color: #aeb8d4;
}

.symbol-company-cell {
  vertical-align: middle;
  min-width: 5.5rem;
  max-width: 14rem;
}

.symbol-company-ticker {
  display: block;
  font-weight: 600;
  line-height: 1.25;
  color: #e8eeff;
}

.symbol-company-name {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: #9fb0d8;
  white-space: normal;
  overflow-wrap: anywhere;
}

.details-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  max-width: min(100%, 52rem);
  width: 100%;
}

.block {
  border: 1px solid #2a3662;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(150deg, #101a36 0%, #0d1530 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 1100px) {
  .details-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .details-content {
    grid-template-columns: 1fr;
  }
}

.graph-block {
  grid-column: 1 / -1;
}

.fundamental-block {
  grid-column: 1 / -1;
}

.fundamental-block .fundamental-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem 1.25rem;
  align-items: start;
}

.fundamental-block .fund-fa-verdict,
.fundamental-block .fundamental-full-details {
  grid-column: 1 / -1;
}

.analysis-compact-section {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-block {
  background: linear-gradient(150deg, #1a2b5b 0%, #132447 100%);
  border-color: #3552a3;
  padding: 12px 14px;
  gap: 10px;
}

.summary-block h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.summary-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.summary-block-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #c8d4ee;
}

.summary-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.summary-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a9bc4;
}

.summary-meta-value {
  color: #e2e8f8;
}

.summary-meta-sep {
  color: #5a6a8a;
}

.summary-block-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.summary-copy-btn,
.summary-copy-for-ai-btn,
.summary-ai-news-btn,
.summary-ai-news-copy-prompt-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid #4a6bb5;
  background: rgba(80, 120, 200, 0.12);
  color: #c8d8ff;
  cursor: pointer;
}

.summary-copy-for-ai-btn {
  border-color: #6b5aa8;
  background: rgba(120, 90, 180, 0.14);
  color: #ddd0ff;
}

.summary-ai-news-btn {
  border-color: #3d8f7a;
  background: rgba(61, 143, 122, 0.16);
  color: #b8f0df;
}

.summary-ai-news-copy-prompt-btn {
  border-color: #6b7a98;
  background: rgba(100, 116, 139, 0.16);
  color: #d5deee;
}

.summary-copy-btn:hover,
.summary-copy-for-ai-btn:hover,
.summary-ai-news-btn:hover,
.summary-ai-news-copy-prompt-btn:hover {
  background: rgba(80, 120, 200, 0.28);
  color: #e8eeff;
}

.summary-copy-for-ai-btn:hover {
  background: rgba(120, 90, 180, 0.28);
}

.summary-ai-news-btn:hover {
  background: rgba(61, 143, 122, 0.32);
  color: #d8fff2;
}

.summary-ai-news-copy-prompt-btn:hover {
  background: rgba(100, 116, 139, 0.32);
  color: #eef2f7;
}

.summary-copy-btn:disabled,
.summary-copy-for-ai-btn:disabled,
.summary-ai-news-btn:disabled,
.summary-ai-news-copy-prompt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-daily-news-block {
  margin-top: 14px;
  padding-top: 0;
  border-top: 1px solid rgba(90, 110, 170, 0.35);
}

.ai-daily-news-block > summary.ai-daily-news-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  padding: 12px 0 8px;
}

.ai-daily-news-block > summary.ai-daily-news-summary::-webkit-details-marker {
  display: none;
}

.ai-daily-news-block > summary.ai-daily-news-summary::before {
  content: "▸";
  color: #8fa6df;
  margin-right: 6px;
}

.ai-daily-news-block[open] > summary.ai-daily-news-summary::before {
  content: "▾";
}

.ai-daily-news-title {
  margin: 0;
  font-size: 0.95rem;
  color: #d6def5;
  font-weight: 600;
}

.ai-daily-news-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-daily-news-body {
  padding-bottom: 8px;
}

.ai-news-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.ai-news-table {
  font-size: 11px;
}

.ai-news-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: #151c33;
  z-index: 1;
}

.ai-news-event,
.ai-news-why {
  min-width: 14rem;
  max-width: 22rem;
  white-space: normal;
}

.ai-news-markdown {
  white-space: pre-wrap;
  font-size: 11px;
  color: #c8d2ec;
  background: rgba(10, 14, 28, 0.55);
  border: 1px solid #2a3662;
  border-radius: 8px;
  padding: 10px;
  max-height: 420px;
  overflow: auto;
}

.ai-news-quant-summary {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #2a3662;
  border-radius: 8px;
  background: rgba(10, 14, 28, 0.55);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ai-news-search-checklist {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid #2a3662;
  border-radius: 8px;
  background: rgba(10, 14, 28, 0.4);
  color: #c8d2ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ai-news-no-qualifying {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.ai-news-grounding {
  color: #c8d2ec;
}

.ai-news-grounding-block + .ai-news-grounding-block {
  margin-top: 10px;
}

.ai-news-grounding-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9db2e6;
  margin-bottom: 6px;
}

.ai-news-source-grid,
.ai-news-query-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ai-news-source-card,
.ai-news-query-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: #93c5fd;
  text-decoration: none;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.ai-news-source-card:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(147, 197, 253, 0.55);
  color: #bfdbfe;
  text-decoration: none;
}

.ai-news-source-card--plain {
  color: #c8d2ec;
  cursor: default;
}

.ai-news-query-chip {
  justify-content: flex-start;
  text-align: left;
  color: #d5deee;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.4);
  font-size: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-news-grounding-sources {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.ai-news-grounding-sources a {
  color: #93c5fd;
  text-decoration: none;
}

.ai-news-grounding-sources a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .ai-news-source-grid,
  .ai-news-query-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .ai-news-source-grid,
  .ai-news-query-grid {
    grid-template-columns: 1fr;
  }
}

.ai-daily-news-status {
  margin-top: 8px;
  font-size: 12px;
  color: #9db2e6;
}

.ai-daily-news-status--error {
  color: #f87171;
}

.summary-copy-btn:disabled,
.summary-copy-for-ai-btn:disabled,
.summary-ai-news-btn:disabled,
.summary-ai-news-copy-prompt-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.summary-ta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 8px;
}

.analysis-compact-section .summary-ta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
}

@media (max-width: 760px) {
  .analysis-compact-section .summary-ta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .summary-ta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
  }
}

@media (max-width: 500px) {
  .summary-ta-grid {
    grid-template-columns: 1fr;
  }
}

.summary-metric {
  min-width: 0;
}

.summary-metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa3d4;
  margin-bottom: 3px;
}

.summary-metric-headline {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #e8eeff;
}

.summary-readings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
}

.summary-reading {
  font-size: 11px;
  line-height: 1.35;
  color: #9fb0d8;
}

.summary-reading::before {
  content: "·";
  margin-right: 4px;
  color: #5a6f9e;
}

.summary-reading:first-child::before {
  content: none;
  margin-right: 0;
}

.summary-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-fundamentals {
  padding-top: 4px;
}

.summary-fundamentals .summary-metric-label {
  margin-bottom: 1px;
}

.summary-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 12px;
  line-height: 1.4;
}

.summary-verdict-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8fa3d4;
}

.summary-verdict-value {
  font-weight: 600;
  color: #d4dcf0;
}

.summary-verdict.summary-tone-long .summary-verdict-value {
  color: #6ee7b7;
}

.summary-verdict.summary-tone-short .summary-verdict-value {
  color: #fca5a5;
}

.summary-verdict.summary-tone-avoid .summary-verdict-value {
  color: #f87171;
}

.summary-verdict.summary-tone-caution .summary-verdict-value {
  color: #fcd34d;
}

.summary-synthesis {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-synthesis-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa3d4;
  margin-bottom: 4px;
}

.summary-synthesis-text {
  font-size: 12px;
  line-height: 1.45;
  color: #b8c5e8;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.summary-synthesis-text--full {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.summary-block .metric-row {
  display: block;
  padding: 6px 0;
}

.summary-block .metric-label {
  display: block;
  min-width: 0;
  margin-bottom: 2px;
  font-size: 12px;
}

.summary-block .metric-value {
  display: block;
  min-width: 0;
  text-align: left;
  line-height: 1.25;
  font-weight: 500;
  color: #d0daf2 !important;
}

.summary-block .metric-value.metric-bullish,
.summary-block .metric-value.metric-bearish,
.summary-block .metric-value.metric-warning,
.summary-block .metric-value.metric-neutral {
  color: #d0daf2 !important;
}

.trade-plan-block.analysis-collapsible {
  background: linear-gradient(150deg, #1a2848 0%, #121d38 100%);
  border-color: #2f4a7a;
  padding: 12px 14px;
}

.trade-plan-block.analysis-collapsible > .analysis-collapsible-summary {
  font-size: 16px;
}

.trade-plan-block.analysis-collapsible > .analysis-collapsible-body {
  padding-top: 8px;
}

.analysis-compact-section .trade-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
}

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

@media (max-width: 760px) {
  .analysis-compact-section .trade-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .trade-plan-grid {
    grid-template-columns: 1fr;
  }
}

.trade-plan-row {
  min-width: 0;
}

.trade-plan-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa3d4;
  margin-bottom: 3px;
}

.trade-plan-value {
  font-size: 13px;
  line-height: 1.4;
  color: #e0e8ff;
}

.trade-plan-muted {
  display: block;
  font-size: 11px;
  color: #8fa0c8;
  margin-top: 2px;
}

.trade-plan-primary-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ec4ff;
  margin-left: 4px;
}

.trade-plan-quality-good {
  color: #7ddea8;
  font-weight: 600;
}

.trade-plan-quality-decent {
  color: #e8c878;
  font-weight: 600;
}

.trade-plan-quality-weak {
  color: #d4a86a;
  font-weight: 600;
}

.trade-plan-quality-avoid {
  color: #e88a8a;
  font-weight: 600;
}

.trade-plan-notes {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.45;
  color: #b8c6e8;
}

.trade-plan-notes p {
  margin: 0 0 4px;
}

.trade-plan-notes p:last-child {
  margin-bottom: 0;
}

.trade-plan-disabled {
  margin: 0;
  font-size: 13px;
  color: #a8b8d8;
}

.trade-plan-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.structural-qdata {
  margin-top: 12px;
}

.structural-qdata-btn {
  background: rgba(120, 150, 220, 0.15);
  border: 1px solid rgba(140, 170, 235, 0.35);
  color: #cdd9f5;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}

.structural-qdata-btn:hover {
  background: rgba(120, 150, 220, 0.28);
}

.structural-qdata-out {
  margin-top: 10px;
}

.structural-qdata-header {
  font-size: 12px;
  color: #b8c6e8;
  margin-bottom: 4px;
}

.structural-qdata-flip {
  font-size: 12px;
  margin-bottom: 8px;
}

.structural-qdata-table {
  font-size: 12px;
}

.structural-qdata-table th {
  white-space: nowrap;
}

.qdata-ord-strong-long { color: #4ade80; font-weight: 600; }
.qdata-ord-cond-long { color: #86efac; }
.qdata-ord-neutral { color: #9ca3af; }
.qdata-ord-cond-short { color: #fca5a5; }
.qdata-ord-strong-short { color: #f87171; font-weight: 600; }

.qdata-note-down { color: #f87171; }
.qdata-note-up { color: #4ade80; }
.qdata-note-neutral { color: #9ca3af; }

.trade-plan-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.trade-plan-gemini-strategy-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b8c6e8;
}

.trade-plan-gemini-strategy-label-text {
  white-space: nowrap;
}

.trade-plan-gemini-strategy-select {
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #5a5080;
  background: rgba(20, 16, 40, 0.65);
  color: #e8e0ff;
  max-width: min(280px, 100%);
  cursor: pointer;
}

.trade-plan-gemini-strategy-select:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-gemini-strategy-select:focus {
  outline: 2px solid rgba(120, 90, 200, 0.45);
  outline-offset: 1px;
}

.trade-plan-gemini-copy-payload-btn,
.trade-plan-share-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #4a6bb5;
  background: rgba(80, 120, 200, 0.12);
  color: #c8d8ff;
  cursor: pointer;
}

.trade-plan-intraday-ext-ai-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #b7791f;
  background: rgba(183, 121, 31, 0.16);
  color: #f6d18a;
  cursor: pointer;
}

.trade-plan-intraday-ext-ai-btn:hover:not(:disabled) {
  background: rgba(183, 121, 31, 0.3);
  color: #ffe6b0;
}

.trade-plan-intraday-ext-ai-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-share-btn:hover:not(:disabled) {
  background: rgba(80, 120, 200, 0.28);
  color: #e8eeff;
}

.trade-plan-share-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-gemini-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #6b4fb5;
  background: rgba(120, 90, 200, 0.14);
  color: #dcc8ff;
  cursor: pointer;
}

.trade-plan-gemini-btn:hover:not(:disabled) {
  background: rgba(120, 90, 200, 0.28);
  color: #f0e6ff;
}

.trade-plan-gemini-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-gemini-out {
  width: 100%;
  align-self: stretch;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(120, 90, 200, 0.35);
  background: rgba(8, 12, 28, 0.55);
  color: #e2e8f8;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

.trade-plan-gemini-out__card {
  display: flex;
  justify-content: center;
}

.trade-plan-gemini-out__card .shareable-trade-card {
  width: 100%;
  max-width: 520px;
}

.trade-plan-gemini-out-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 10px;
}

.trade-plan-gemini-share-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #4a6bb5;
  background: rgba(80, 120, 200, 0.12);
  color: #c8d8ff;
  cursor: pointer;
}

.trade-plan-gemini-share-btn:hover:not(:disabled) {
  background: rgba(80, 120, 200, 0.28);
  color: #e8eeff;
}

.trade-plan-gemini-share-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-gemini-copy-payload-btn,
.trade-plan-structural-copy-payload-btn {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #5a6a8a;
  background: rgba(60, 80, 120, 0.1);
  color: #b8c8e8;
  cursor: pointer;
}

.trade-plan-gemini-copy-payload-btn:hover:not(:disabled),
.trade-plan-structural-copy-payload-btn:hover:not(:disabled) {
  background: rgba(60, 80, 120, 0.22);
  color: #e0e8ff;
}

.trade-plan-gemini-copy-payload-btn:disabled,
.trade-plan-structural-copy-payload-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.trade-plan-gemini-out__text {
  display: none;
}

.trade-plan-gemini-out--error {
  border-color: rgba(245, 113, 113, 0.45);
  color: #fca5a5;
}

.rules-panel {
  margin-top: 14px;
  border: 1px solid #34487f;
  border-radius: 12px;
  background: linear-gradient(150deg, #131e3e 0%, #101833 100%);
  padding: 14px;
  box-shadow: 0 10px 22px rgba(5, 10, 24, 0.28);
  scroll-margin-top: 1rem;
}

.notes-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(52, 72, 127, 0.85);
  border-radius: 10px;
  background: rgba(16, 24, 48, 0.55);
  list-style: none;
  font-size: 0.82rem;
}

.notes-toc a {
  color: #a8b8e7;
  text-decoration: none;
}

.notes-toc a:hover {
  color: #d6e0ff;
  text-decoration: underline;
}

.app-body .notes-doc-nav {
  margin-bottom: 1rem;
}

.app-body .notes-doc-breadcrumb a {
  color: rgba(255, 195, 150, 0.92);
  text-decoration: none;
}

.app-body .notes-doc-breadcrumb a:hover {
  color: rgba(255, 220, 180, 1);
  text-decoration: underline;
}

.app-body .notes-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(52, 72, 127, 0.85);
  border-radius: 10px;
  background: rgba(16, 24, 48, 0.55);
  list-style: none;
  font-size: 0.82rem;
}

.app-body .notes-doc-links a {
  color: #a8b8e7;
  text-decoration: none;
}

.app-body .notes-doc-links a:hover {
  color: #d6e0ff;
  text-decoration: underline;
}

.app-body .notes-doc-links a.is-active {
  color: rgba(255, 210, 160, 0.98);
  font-weight: 600;
  text-decoration: none;
}

.rules-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.rules-subtitle {
  margin: 14px 0 8px;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #a8b8e7;
}

.rules-panel p {
  margin: 0;
  color: #cfd8f3;
}

.rules-panel ul {
  margin: 0;
  padding-left: 18px;
  color: #cfd8f3;
}

.rules-panel li {
  margin: 6px 0;
}

.rules-table th {
  color: #d8e2ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metrics-page .metrics-hero {
  margin-top: 0;
}

.metrics-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 991px) {
  .metrics-layout {
    grid-template-columns: 1fr;
  }

  .metrics-toc {
    position: static;
  }
}

.metrics-toc {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.metrics-toc-nav .metrics-toc-link {
  display: inline-block;
  color: #b8c9f5;
  text-decoration: none;
  font-size: 13px;
  padding: 3px 0;
}

.metrics-toc-nav .metrics-toc-link:hover {
  color: #fff;
}

.metrics-toc-count {
  float: right;
  font-size: 11px;
  color: #7f92c4;
}

.metrics-category {
  scroll-margin-top: 12px;
}

.metrics-category-desc {
  color: #b8c5e8;
  font-size: 14px;
  margin-bottom: 10px;
}

.metrics-table code.metrics-key,
.metrics-table code.metrics-path {
  font-size: 11px;
  color: #9ec5ff;
  word-break: break-word;
}

.metrics-source {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.rules-table td {
  color: #d5def6;
  font-size: 13px;
}

.pattern-json {
  margin: 0;
  border: 1px solid #2b3f75;
  border-radius: 10px;
  background: #0d1530;
  color: #dce6ff;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.app-modal-content {
  border: 1px solid #34487f;
  border-radius: 12px;
  background: linear-gradient(150deg, #131e3e 0%, #101833 100%);
  box-shadow: 0 14px 36px rgba(5, 10, 24, 0.45);
}

.app-modal-content .modal-header {
  border-bottom-color: #2a3662;
}

.app-modal-content .modal-footer {
  border-top-color: #2a3662;
}

.app-body .modal-backdrop.show {
  opacity: 0.72;
}

.tracking-rule-cell {
  min-width: 9rem;
  max-width: 14rem;
  white-space: normal !important;
  line-height: 1.35;
  font-size: 0.85rem;
}

.tracking-rule-ok {
  color: #9ee6c8;
}

.tracking-rule-violated {
  color: #ff8b8b;
  font-weight: 600;
}

.tracking-rule-unknown {
  color: #c9ced8;
}

.table-tracking td.tracking-actions-cell .btn + .btn {
  margin-left: 4px;
}

/* Tracking: keep Actions column only as wide as the buttons (no huge empty cell next to Notes) */
.table-tracking td.tracking-actions-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 12px;
}

.table-tracking td.tracking-notes-cell {
  padding-right: 8px;
}

/* Tracking: notes column — full invalidation text, wrapped */
.tracking-notes-cell {
  box-sizing: border-box;
  min-width: 14rem;
  max-width: 22rem;
  color: #e8ecf4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal !important;
  line-height: 1.35;
  font-size: 0.85rem;
}

.tracking-note-modal .modal-dialog {
  min-width: min(36rem, 100vw - 2rem);
  max-width: min(42rem, 100vw - 2rem);
}

.tracking-note-textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 9rem;
  color: #e8ecf4 !important;
  background-color: #0f1729 !important;
  border-color: #3d5694 !important;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.tracking-note-modal .form-label {
  color: #d5e2ff !important;
}

.tracking-note-modal .modal-title {
  color: #f0f4ff;
}

.rules-hero {
  border-color: #4866b4;
  background: linear-gradient(150deg, #1a2b5b 0%, #142247 100%);
}

.block h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}

.analysis-collapsible-summary {
  cursor: pointer;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e8eeff;
  list-style: none;
  user-select: none;
}

.analysis-collapsible-summary::-webkit-details-marker {
  display: none;
}

.analysis-collapsible-summary::before {
  content: "▸ ";
  display: inline-block;
  color: #8eb4ff;
  transition: transform 0.15s ease;
}

.analysis-collapsible[open] > .analysis-collapsible-summary::before {
  transform: rotate(90deg);
}

.analysis-collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.score-legend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: 1px solid #4a5f99;
  border-radius: 999px;
  color: #bdd0ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.score-legend-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  width: min(520px, 86vw);
  padding: 10px 12px;
  border: 1px solid #3f548e;
  border-radius: 10px;
  background: #101833;
  color: #e3ebff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 10px 22px rgba(5, 10, 24, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.score-legend:hover .score-legend-tooltip,
.score-legend:focus .score-legend-tooltip,
.score-legend:focus-visible .score-legend-tooltip {
  opacity: 1;
  visibility: visible;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #1f2b57;
}

.metric-row:first-of-type {
  border-top: none;
}

.metric-label {
  color: #aeb8d4;
  flex: 1 1 140px;
  min-width: 120px;
}

.metric-value {
  color: #e8ecf4;
  text-align: left;
  font-weight: 600;
  flex: 1 1 160px;
  min-width: 140px;
  overflow-wrap: anywhere;
}

/* Daily blocks under Summary / Trade Plan — match Summary font scale */
.details-content > .block .metric-label,
.details-content > .analysis-collapsible.block .metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa3d4;
}

.details-content > .block .metric-value,
.details-content > .analysis-collapsible.block .metric-value {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.details-content > .block .score-pill,
.details-content > .analysis-collapsible.block .score-pill {
  font-size: 12px;
  padding: 1px 8px;
}

.metric-value.metric-bullish {
  color: #34d399;
}

.metric-value.metric-bearish {
  color: #f87171;
}

.metric-value.metric-warning {
  color: #fbbf24;
}

.metric-value.metric-neutral {
  color: #cbd5e1;
}

.score-pill {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #6f96ff;
  border-radius: 999px;
  color: #c2d3ff;
  background: rgba(86, 132, 255, 0.12);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.structural-history-charts-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.4fr);
  gap: 12px;
  align-items: start;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .structural-history-charts-row {
    grid-template-columns: 1fr;
  }
}

.structural-monthly-charts-grid {
  margin-top: 0.25rem;
}

.chart-card {
  border: 1px solid #263669;
  border-radius: 10px;
  background: #0c1330;
  padding: 10px;
}

.chart-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #cfe0ff;
}

.mini-chart {
  width: 100%;
  height: 170px;
  display: block;
}

.chart-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-item {
  font-size: 12px;
  color: #aeb8d4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-value {
  color: #e8ecf4;
  font-weight: 700;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.chart-range {
  margin-top: 6px;
  font-size: 11px;
  color: #94a4d3;
}

.chart-empty {
  margin: 8px 0 0;
  color: #9fb0dd;
  font-size: 13px;
}

.analysis-standalone {
  margin-top: 12px;
}

.analysis-result-panel {
  border: 1px solid rgba(100, 140, 220, 0.38);
  border-radius: 10px;
  padding: 0.5rem 0.75rem 0.75rem;
  background: rgba(6, 10, 22, 0.5);
}

.analysis-result-panel > summary {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(205, 218, 255, 0.96);
  cursor: pointer;
  list-style-position: outside;
}

.analysis-result-panel > summary:hover {
  color: #ffffff;
}

.analysis-result-body.analysis-standalone {
  margin-top: 0.5rem;
}

.pattern-section-help-details {
  border: 1px solid rgba(100, 140, 220, 0.25);
  border-radius: 10px;
  padding: 0.35rem 0.65rem 0.65rem;
  background: rgba(6, 10, 22, 0.35);
}

.pattern-section-help-summary {
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(130, 190, 255, 0.98);
  cursor: pointer;
  list-style-position: outside;
  padding: 0.15rem 0;
}

.pattern-section-help-summary:hover {
  color: #ffffff;
}

.pattern-section-help-body {
  color: rgba(220, 228, 245, 0.95);
  line-height: 1.5;
  margin-top: 0.35rem;
}

.pattern-section-help-body code {
  color: rgba(170, 210, 255, 0.98);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.08em 0.3em;
  border-radius: 4px;
  font-size: 0.88em;
}

.pattern-cohort-output {
  margin-top: 8px;
  border: 1px solid rgba(255, 170, 95, 0.28);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: rgba(8, 12, 24, 0.55);
  max-height: 72vh;
  overflow: auto;
}

.pattern-cohort-output .table {
  font-size: 0.82rem;
}

.pattern-cohort-output th.sortable-pattern-sector {
  cursor: pointer;
  user-select: none;
}

.pattern-cohort-output th.sortable-pattern-sector:hover {
  color: #d6def7;
}

.pattern-cohort-output details.pattern-sector-block > summary {
  cursor: pointer;
  list-style-position: outside;
}

.pattern-cohort-pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: rgba(232, 236, 244, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pattern-cohort-output details.pattern-cohort-rules {
  color: rgba(232, 236, 244, 0.95);
}

.pattern-cohort-output details.pattern-cohort-rules > summary {
  color: rgba(200, 215, 255, 0.95);
  cursor: pointer;
  list-style-position: outside;
}

.pattern-cohort-output details.pattern-cohort-rules > summary:hover {
  color: #ffffff;
}

.pattern-picker-box {
  max-height: 15rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}

.app-body .app-form-toggle:has(.app-form-toggle-input:disabled) {
  cursor: not-allowed;
}

.pattern-field-groups details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
}

.pattern-field-groups details:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.analysis-chip-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filters {
  margin-top: 10px;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.report-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cfd8f3;
  font-size: 13px;
}

.tracker-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tracker-pill-watch {
  color: #d4e4ff;
  background: rgba(78, 118, 221, 0.24);
  border: 1px solid rgba(117, 156, 255, 0.5);
}

.tracker-pill-buy {
  color: #d7ffe7;
  background: rgba(39, 163, 106, 0.3);
  border: 1px solid rgba(103, 220, 163, 0.55);
}

/* Historical analysis page */
.hist-conditions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hist-condition-row {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) 4rem minmax(8rem, 1.2fr) auto;
  gap: 8px;
  align-items: center;
}

.hist-cond-value-wrap {
  min-width: 0;
}

.hist-metric-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.hist-metric-group {
  border: 1px solid #2a3662;
  border-radius: 8px;
  padding: 10px;
  background: #0f1729;
}

.hist-metric-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9fb0dd;
  margin-bottom: 6px;
}

.hist-metric-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hist-metric-check {
  font-size: 0.85rem;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  cursor: pointer;
}

.hist-results-count {
  font-size: 0.85rem;
  color: #a8b4d4;
  font-weight: 600;
}

.hist-group-sub-row td {
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  padding-left: 1.25rem;
  color: #b8c2de;
}

.hist-sector-group-row td {
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  padding-top: 0.55rem;
  padding-bottom: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hist-charts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hist-symbol-block {
  border: 1px solid #2a3662;
  border-radius: 12px;
  padding: 14px;
  background: #0d1530;
}

.hist-symbol-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.hist-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.hist-chart-card-wrap {
  border: 1px solid #2a3662;
  border-radius: 10px;
  padding: 10px;
  background: #101a36;
}

.hist-series-summary {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #2a3662;
  font-size: 0.88rem;
}

.hist-trend-analysis {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2a3662;
}

.hist-trend-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hist-trend-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.hist-trend-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hist-trend-badge--yes {
  background: rgba(47, 157, 106, 0.2);
  color: #7ddea8;
}

.hist-trend-badge--no {
  background: rgba(94, 99, 133, 0.35);
  color: #b8bfd8;
}

.hist-trend-badge--warn {
  background: rgba(212, 140, 60, 0.2);
  color: #f0b56a;
}

.hist-trend-badge--up {
  background: rgba(99, 179, 255, 0.18);
  color: #9fd0ff;
}

.hist-trend-badge--inwindow {
  background: rgba(212, 200, 106, 0.15);
  color: #d4c86a;
  border: 1px solid rgba(107, 90, 47, 0.55);
}

.hist-trend-lens-note {
  line-height: 1.45;
  padding: 8px 10px;
  background: #0a1020;
  border: 1px solid #243055;
  border-radius: 6px;
}

.hist-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.hist-trend-panel {
  background: #0d152b;
  border: 1px solid #243055;
  border-radius: 8px;
  padding: 10px 12px;
}

.hist-trend-panel h6 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9fb0d8;
  margin-bottom: 8px;
}

.hist-trend-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 0;
  font-size: 0.82rem;
}

.hist-trend-dl dt {
  color: #8b97b8;
  font-weight: 500;
}

.hist-trend-dl dd {
  margin: 0;
  color: #e8edf8;
}

.hist-trend-reason {
  line-height: 1.35;
}

.trend-report-page .trend-report-summary {
  background: #0d152b;
  border: 1px solid #243055;
  border-radius: 8px;
  padding: 12px 14px;
}

.trend-report-comparison {
  background: #10182e;
  border: 1px solid #33406a;
  border-radius: 8px;
  padding: 12px 14px;
}

.trend-report-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px;
  font-size: 0.88rem;
}

.trend-report-row--mismatch > td,
tr.trend-report-row--mismatch > td {
  background: rgba(196, 140, 78, 0.08);
}

.trend-report-row--mismatch td:nth-child(2) strong {
  color: #f0c878;
}

.trend-report-model-section {
  border-top: 2px solid #243055;
  padding-top: 1rem;
}

.trend-report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 16px;
  font-size: 0.88rem;
}

.trend-price-stats-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9fd0ff;
  margin-bottom: 8px;
}

.trend-price-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
}

.trend-price-stat-card {
  background: #0a1020;
  border: 1px solid #243055;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.trend-price-stat-line {
  margin-top: 4px;
}

.trend-price-stat-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #9aa3c7;
}

.trend-report-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.trend-report-badge--yes {
  background: rgba(47, 157, 106, 0.2);
  color: #7ddea8;
}

.trend-report-badge--no {
  background: rgba(94, 99, 133, 0.35);
  color: #b8bfd8;
}

.trend-report-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.trend-report-table th.sort-asc::after {
  content: " ▲";
  opacity: 0.6;
}

.trend-report-table th.sort-desc::after {
  content: " ▼";
  opacity: 0.6;
}

/* Rank Reports — streak results: keep headers readable, scroll sideways if needed */
.streak-results-wrap {
  overflow-x: auto;
}
.streak-results-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.streak-results-table th,
.streak-results-table td {
  white-space: nowrap;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.streak-results-table th.st-col-di,
.streak-results-table td.st-col-di {
  padding-right: 1.35rem;
}
.streak-results-table th.st-col-close,
.streak-results-table td.st-col-close {
  border-left: 1px solid rgba(180, 190, 220, 0.28);
  padding-left: 1.35rem;
}

/* Pattern Watch / Rank Report Stats — detail expand only (not combined ledger) */
.rank-pw-results-table {
  width: 100%;
  table-layout: fixed;
}
.rank-pw-results-table th,
.rank-pw-results-table td {
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-pw-results-table th.pw-col-entry-date,
.rank-pw-results-table td.pw-col-entry-date,
.rank-pw-results-table th.pw-col-entry-price,
.rank-pw-results-table td.pw-col-entry-price {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
/* table-layout: fixed splits columns evenly — reserve room for the full ISO date. */
.rank-pw-results-table th.pw-col-entry-date,
.rank-pw-results-table td.pw-col-entry-date {
  width: 7.5rem;
  overflow: visible;
  text-overflow: clip;
}
.rank-pw-results-table th.pw-col-entry-price,
.rank-pw-results-table td.pw-col-entry-price {
  width: 6.5rem;
}

/* Combined totals ledger — full width, never clip headers */
.rank-combined-detail-table {
  width: 100%;
  table-layout: auto;
}
.rank-combined-detail-table th,
.rank-combined-detail-table td {
  white-space: nowrap;
  padding: 0.55rem 0.85rem;
  vertical-align: middle;
  overflow: visible;
}
.rank-combined-detail-table td:first-child {
  white-space: normal;
}
.rank-combined-detail-table th.sortable {
  padding-right: 1.25rem;
}
.rank-combined-nest-parent {
  cursor: pointer;
}
.rank-combined-nest-parent--open {
  background: rgba(26, 39, 70, 0.35);
}
.rank-combined-nested td:first-child {
  border-left: 2px solid #3a4a72;
}

.trend-window-mode-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trend-window-mode .btn {
  font-size: 0.82rem;
}

.dual-metric-detail-wrap {
  display: grid;
  gap: 14px;
  padding: 12px 8px;
}

.dual-metric-detail-block {
  background: #0a1020;
  border: 1px solid #243055;
  border-radius: 8px;
  padding: 12px 14px;
}

.dual-metric-detail-title {
  font-size: 0.85rem;
  color: #9fd0ff;
  margin-bottom: 8px;
}

.dual-metric-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 16px;
  font-size: 0.82rem;
}

.dual-metric-subtable {
  font-size: 0.78rem;
}

.dual-metric-active-date-tag {
  color: #d4c86a;
  font-size: 0.65rem;
  vertical-align: super;
}

.trend-report-detail-row td {
  background: #070b16;
  border-top: none !important;
}

.trend-report-expand-col {
  width: 2rem;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

.trend-report-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid #33406a;
  border-radius: 4px;
  background: #121a30;
  color: #b8bfd8;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
}

.trend-report-expand-btn:hover,
.trend-report-expand-btn.is-expanded {
  background: #1a2746;
  color: #e8ecff;
  border-color: #4a5f9a;
}

.trend-report-expand-placeholder {
  display: inline-block;
  width: 1.5rem;
  text-align: center;
  color: #4a5270;
}

.trend-report-cycle-row > td {
  background: #0a1020;
  border-top: none;
  padding-top: 0;
  padding-bottom: 0.75rem;
}

.trend-cycle-detail {
  margin: 0.35rem 0 0.5rem 1.75rem;
  padding: 10px 12px;
  border: 1px solid #243055;
  border-radius: 8px;
  background: #0d152b;
}

.trend-cycle-detail-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9fd0ff;
  margin-bottom: 8px;
}

.trend-cycle-detail-table {
  font-size: 0.78rem;
}

.trend-cycle-detail-table th {
  white-space: nowrap;
  font-size: 0.72rem;
  color: #9aa3c7;
}

.trend-cycle-active-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(99, 179, 255, 0.18);
  color: #9fd0ff;
}

.trend-state-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.trend-state-badge--up {
  background: rgba(99, 179, 255, 0.2);
  color: #9fd0ff;
}

.trend-state-badge--est {
  background: rgba(47, 157, 106, 0.22);
  color: #7ddea8;
}

.trend-state-badge--no {
  background: rgba(196, 78, 82, 0.2);
  color: #f0a0a3;
}

.trend-score-track-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.trend-score-track-wrap {
  overflow-x: auto;
}

.trend-score-track-table {
  min-width: 1200px;
  font-size: 0.82rem;
}

.report-stats-detail > td {
  padding-top: 0;
  padding-bottom: 1rem;
  background: rgba(8, 14, 30, 0.55);
  border-top: none;
}

.report-stats-totals-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 600;
}

.report-stats-closed-summary-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 14, 30, 0.35);
}

.agg-symbol-expansion {
  padding: 0.35rem 0.15rem 0.5rem;
}

.agg-symbol-expansion .charts-grid {
  max-width: 640px;
  grid-template-columns: 1fr;
}

.agg-symbol-expansion .agg-price-window-summary,
.agg-symbol-expansion .agg-price-window-table-wrap,
.agg-symbol-expansion .agg-price-window-collapse-body > .h6 {
  max-width: 640px;
}

.agg-symbol-expansion .agg-cycle-compare-table-wrap {
  max-width: 640px;
}

.agg-expansion-divider {
  border-color: rgba(255, 255, 255, 0.08);
  margin: 1rem 0;
  opacity: 1;
}

.agg-price-window-panel {
  margin-bottom: 0.25rem;
}

.agg-price-window-collapse {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(8, 14, 30, 0.35);
  padding: 0.35rem 0.55rem 0.45rem;
}

.agg-price-window-collapse-summary {
  cursor: pointer;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8eeff;
  list-style: none;
  user-select: none;
}

.agg-price-window-collapse-summary::-webkit-details-marker {
  display: none;
}

.agg-price-window-collapse-summary::before {
  content: "▸ ";
  display: inline-block;
  color: #8eb4ff;
  transition: transform 0.15s ease;
}

.agg-price-window-collapse[open] > .agg-price-window-collapse-summary::before {
  transform: rotate(90deg);
}

.agg-price-window-collapse-body {
  padding-top: 0.65rem;
}

.agg-price-vline line,
.agg-price-vline-stroke {
  pointer-events: none;
  stroke: var(--marker-color, #64748b);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.42;
}

.agg-price-vline-label {
  fill: var(--marker-color, #64748b);
  font-size: 7.5px;
  font-weight: 600;
  opacity: 0.72;
}

.agg-price-vline-label-top {
  font-size: 7px;
}

.agg-price-vline-label-bottom {
  font-size: 7px;
  opacity: 0.6;
}

.agg-price-window-chart {
  margin-bottom: 0.75rem;
  max-width: 640px;
}

.agg-price-window-svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  min-height: 180px;
  display: block;
}

.agg-price-marker-legend {
  max-width: 640px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.agg-price-marker-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.agg-price-marker-legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  font-style: normal;
}

.agg-price-marker-cell {
  white-space: nowrap;
}

.agg-price-marker-badge {
  display: inline-block;
  margin-right: 0.25rem;
  margin-bottom: 0.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--marker-color, #94a3b8);
  background: color-mix(in srgb, var(--marker-color, #94a3b8) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--marker-color, #94a3b8) 45%, transparent);
  white-space: nowrap;
}

.agg-price-marker-badge--c1 {
  border-color: color-mix(in srgb, #10b981 50%, transparent);
}

.agg-price-marker-badge--nested {
  border-color: color-mix(in srgb, #f59e0b 50%, transparent);
}

.agg-price-table-marker td {
  background: color-mix(in srgb, var(--marker-color, #10b981) 6%, transparent);
}

.agg-price-window-summary {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  max-width: 640px;
}

.agg-price-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem 0.75rem;
}

.agg-price-summary-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}

.agg-price-deltas {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.agg-price-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.agg-price-delta-label {
  color: #94a3b8;
  min-width: 11rem;
}

.agg-price-window-table-wrap {
  max-width: 640px;
  max-height: 260px;
  overflow: auto;
}

.agg-cycle-compare-collapse {
  border-color: rgba(245, 158, 11, 0.35);
}

.agg-cycle-compare-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.agg-price-table-marker td {
  background: rgba(99, 179, 255, 0.06);
}

.hist-chart-card-wrap--timeline {
  grid-column: 1 / -1;
}

.hist-category-timeline-card h4 {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.hist-timeline-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #d8deec;
}

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

.hist-timeline-legend-item i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.hist-category-timeline {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.hist-timeline-tick,
.hist-timeline-axis-label {
  fill: #9aa3b5;
  font-size: 10px;
}

.hist-cat-legend {
  margin-top: 4px;
}

.fund-source-badges .badge {
  font-weight: 500;
}

.fund-symbol-panel {
  border: 1px solid #2a3662;
}

.fund-source-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.fund-source-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.fund-kv-table th {
  width: 42%;
  font-weight: 500;
  color: #a8b4d4;
}

.fund-score-panel {
  border: 1px solid #3d4f8a;
  border-radius: 6px;
  padding: 0.75rem;
  background: rgba(61, 79, 138, 0.12);
}

.fund-score-table th:last-child,
.fund-score-table td:last-child {
  width: 3rem;
  text-align: center;
}

.fund-eps-canonical th,
.fund-eps-canonical td {
  font-size: 0.78rem;
  white-space: nowrap;
}

.fund-eps-canonical td:last-child {
  white-space: normal;
  min-width: 5rem;
}

.fund-fa-verdict-badge {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fund-verdict-strong {
  background: #1f6b3a;
  color: #e8fff0;
}

.fund-verdict-conditional {
  background: #5a4a12;
  color: #fff8dc;
}

.fund-verdict-speculative {
  background: #6b3a1f;
  color: #ffe8dc;
}

.fund-verdict-avoid {
  background: #5c1f2a;
  color: #ffe0e6;
}

.fund-verdict-neutral {
  background: #3a4258;
  color: #d8e0f0;
}

.fund-fa-verdict-rationale {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.fundamental-summary {
  padding: 0.25rem 0;
}

.fund-summary-takeaway {
  color: #d4dcf0;
}

.fund-summary-evidence {
  margin-bottom: 0.5rem;
  padding-left: 1.1rem;
  color: #b8c4e0;
}

.fund-summary-evidence li {
  margin-bottom: 0.15rem;
}

.fund-pillar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fund-pillar-chip {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(61, 79, 138, 0.35);
  border: 1px solid rgba(125, 145, 200, 0.35);
  color: #c8d4f0;
}

.fundamental-full-details {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.5rem;
}

.fundamental-expand-summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8eb4ff;
  list-style: none;
  user-select: none;
}

.fundamental-expand-summary::-webkit-details-marker {
  display: none;
}

.fundamental-expand-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.fundamental-full-details[open] .fundamental-expand-summary::before {
  transform: rotate(90deg);
}

.fundamental-full-body .fund-score-panel {
  margin-top: 0.25rem;
  max-width: none;
}

@media (max-width: 700px) {
  .hist-condition-row {
    grid-template-columns: 1fr;
  }
}

/* —— Admin knowledge base (football-style KB) —— */
.ofs-kb {
  display: grid;
  grid-template-columns: minmax(15rem, 18.5rem) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  max-width: 72rem;
}

.ofs-kb-search-wrap {
  max-width: 72rem;
  margin: 0 0 1rem;
}

.ofs-kb-repo-docs {
  max-width: 72rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 16, 34, 0.55);
  padding: 0.75rem 0.9rem 0.85rem;
  border-radius: 10px;
}

.ofs-kb-repo-docs-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.92);
}

.ofs-kb-repo-docs-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
}

.ofs-kb-repo-docs-list a,
.ofs-kb-doc-link {
  color: #8eb4ff;
}

.ofs-kb-search-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.35rem;
}

.ofs-kb-search {
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(7, 14, 26, 0.92);
  color: #e8ecf4;
  font-size: 0.95rem;
  outline: none;
}

.ofs-kb-search::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.ofs-kb-search:focus {
  border-color: rgba(79, 124, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

.ofs-kb-search-meta {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.ofs-kb-sidebar {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  padding: 0.85rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(7, 14, 26, 0.72);
}

.ofs-kb-nav-group {
  border: none;
  background: transparent;
  padding: 0;
}

.ofs-kb-nav-group + .ofs-kb-nav-group {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ofs-kb-nav-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  user-select: none;
}

.ofs-kb-nav-summary::-webkit-details-marker {
  display: none;
}

.ofs-kb-nav-summary::after {
  content: "▸";
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.ofs-kb-nav-group[open] > .ofs-kb-nav-summary::after {
  transform: rotate(90deg);
}

.ofs-kb-nav-summary:hover {
  background: rgba(79, 124, 255, 0.08);
}

.ofs-kb-nav-count {
  margin-left: auto;
  margin-right: 0.35rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

.ofs-kb-nav-cat {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d7e2ef;
}

.ofs-kb-nav-group[open] .ofs-kb-nav-blurb {
  display: block;
}

.ofs-kb-nav-blurb {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.5);
}

.ofs-kb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.ofs-kb-nav-link {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: start;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c5d0dc;
  cursor: pointer;
  font: inherit;
}

.ofs-kb-nav-link:hover {
  background: rgba(79, 124, 255, 0.1);
  border-color: rgba(79, 124, 255, 0.22);
}

.ofs-kb-nav-link.is-active {
  background: rgba(79, 124, 255, 0.16);
  border-color: rgba(79, 124, 255, 0.4);
  color: #edf5ff;
}

.ofs-kb-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #7eb6ff;
  white-space: nowrap;
}

.ofs-kb-nav-title-wrap {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.ofs-kb-nav-title {
  font-size: 0.82rem;
  line-height: 1.35;
}

.ofs-kb-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #c5d0dc;
  background: rgba(148, 163, 184, 0.1);
}

.ofs-kb-status-planned {
  color: #9ec5ff;
  border-color: rgba(126, 182, 255, 0.35);
  background: rgba(126, 182, 255, 0.12);
}

.ofs-kb-status-in_progress {
  color: #f0c36a;
  border-color: rgba(240, 195, 106, 0.4);
  background: rgba(240, 195, 106, 0.12);
}

.ofs-kb-status-blocked {
  color: #f0a0a0;
  border-color: rgba(240, 160, 160, 0.4);
  background: rgba(240, 160, 160, 0.12);
}

.ofs-kb-status-done {
  color: #8fd6a8;
  border-color: rgba(143, 214, 168, 0.4);
  background: rgba(143, 214, 168, 0.12);
}

.ofs-kb-todo-table td,
.ofs-kb-todo-table th {
  vertical-align: middle;
}

.ofs-kb-main {
  min-width: 0;
  padding: 1rem 1.15rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(7, 14, 26, 0.55);
}

.ofs-kb-pane-head {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ofs-kb-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.ofs-kb-pane-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #edf5ff;
}

.ofs-kb-pane-summary {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #9eb0c3;
}

.ofs-kb-pane-body p {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #c5d0dc;
  max-width: 46rem;
}

.ofs-kb-pane-body p:last-child {
  margin-bottom: 0;
}

.ofs-kb-pane-body code,
.ofs-kb-crumb code {
  font-size: 0.84em;
}

.ofs-kb-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .ofs-kb {
    grid-template-columns: 1fr;
  }

  .ofs-kb-sidebar {
    position: static;
    max-height: none;
  }

  .ofs-kb-search {
    max-width: none;
  }
}

.ofs-md-view {
  max-width: 52rem;
  margin: 0 auto 2rem;
}

.ofs-md-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.ofs-md-body {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(7, 14, 26, 0.65);
  padding: 1rem 1.15rem 1.35rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #e8ecf4;
}

.ofs-md-body h1,
.ofs-md-body h2,
.ofs-md-body h3,
.ofs-md-body h4 {
  margin-top: 1.35em;
  margin-bottom: 0.45em;
  color: #edf5ff;
}

.ofs-md-body h1 {
  font-size: 1.45rem;
  margin-top: 0;
}

.ofs-md-body h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.35rem;
}

.ofs-md-body h3 {
  font-size: 1rem;
}

.ofs-md-body p,
.ofs-md-body li {
  color: rgba(232, 236, 244, 0.85);
}

.ofs-md-body a {
  color: #8eb4ff;
}

.ofs-md-body code {
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
}

.ofs-md-body pre {
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #050a12;
  border-radius: 8px;
  font-size: 0.8rem;
}

.ofs-md-body pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.ofs-md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.85rem;
}

.ofs-md-body th,
.ofs-md-body td {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.ofs-md-body th {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ofs-md-body .mermaid {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.85rem 0;
  overflow-x: auto;
}
