:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1c2420;
  --muted: #627069;
  --line: #d8ded7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --amber: #b45309;
  --red: #b91c1c;
  --blue: #2563eb;
  --shadow: 0 14px 32px rgba(28, 36, 32, 0.09);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(540px, 718px) 1fr;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.trading-desk-brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
  min-width: 0;
}

.trading-desk-copy {
  min-width: 0;
}

.survival-score-mark {
  position: relative;
  display: grid;
  grid-column: 3;
  justify-self: end;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(126px, 10vw, 152px);
  height: clamp(126px, 10vw, 152px);
}

.survival-score-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 2px;
}

.survival-score-mark img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(69, 25, 11, 0.2));
}

.survival-score-info {
  position: absolute;
  right: 4px;
  bottom: 8px;
  z-index: 1;
  display: inline-grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.survival-score-info:hover,
.survival-score-info:focus-visible {
  background: #edf7f5;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.trading-desk-title {
  margin-bottom: 0;
  color: var(--accent-dark);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.trading-desk-subhead {
  margin: 0 0 6px;
  color: #000;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.trading-desk-tagline {
  margin: 10px 0 0;
  color: #3f625d;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, sans-serif;
  font-size: clamp(9px, 0.55vw, 11px);
  font-weight: 600;
  letter-spacing: 0.018em;
  line-height: 1.2;
  text-transform: none;
}

.trading-desk-tagline-accent {
  color: var(--accent-dark);
  font-weight: 800;
}

.trade-desk-modes {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(540px, 718px);
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
}

.beta-overview-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.beta-overview-card > strong {
  width: 100%;
  grid-column: auto;
  color: var(--accent-dark);
  text-align: center;
}

.beta-product-line {
  align-self: center;
  color: #334155;
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.beta-product-line i {
  padding-inline: 7px;
  color: var(--accent);
  font-style: normal;
}

.trade-desk-mode {
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.9));
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  width: 100%;
  height: 144px;
  min-height: 144px;
}

.trade-desk-mode strong {
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.trade-desk-mode small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trade-desk-mode.is-active {
  border-color: rgba(15, 118, 110, 0.55);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.98), rgba(204, 251, 241, 0.82));
}

.trade-desk-mode.is-construction {
  opacity: 0.78;
}

.beta-access-button,
.beta-submit {
  align-self: end;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.trade-desk-mode .beta-access-button {
  min-height: 38px;
  border: 1px solid rgba(45, 212, 191, 0.9);
  background: transparent;
  color: #2dd4bf;
  box-shadow: none;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 950;
  letter-spacing: 0.035em;
}

.trade-desk-mode .beta-access-button:hover,
.trade-desk-mode .beta-access-button:focus-visible {
  border-color: #5fffe4;
  background: rgba(45, 212, 191, 0.08);
  color: #5fffe4;
  box-shadow: none;
}

.beta-access-button:hover,
.beta-submit:hover {
  background: var(--accent-dark);
}

.beta-access-dialog {
  width: min(94vw, 680px);
  height: auto;
  max-width: 680px;
  max-height: 92vh;
  margin: auto;
  border-radius: 18px;
  overflow: auto;
}

.beta-access-form {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 4vw, 34px);
  background: #fff;
}

.beta-access-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.beta-access-head h2 { margin-bottom: 8px; }
.beta-access-head p:last-child { margin-bottom: 0; color: var(--muted); }

.beta-onboarding-note {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #d6c3a2;
  border-radius: 12px;
  background: #fff8ef;
}

.beta-onboarding-note strong {
  color: #7c351f;
}

.beta-onboarding-note p {
  margin: 0;
  color: #5c4a3b;
  font-size: 13px;
  line-height: 1.5;
}

.beta-disclosure-button {
  justify-self: start;
  min-height: 34px;
  padding: 6px 12px;
  color: #7c351f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.beta-product-options { display: grid; gap: 10px; }
.beta-product-options label {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.beta-product-options input { width: 18px; height: 18px; }
.beta-product-options span { display: grid; gap: 3px; }
.beta-product-options small { color: var(--muted); }

.beta-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.beta-contact-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.beta-contact-grid label:first-child { grid-column: 1 / -1; }
.beta-contact-grid input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.beta-optional-consent,
.beta-required-consent {
  display: flex;
  gap: 10px;
  color: #34413b;
  font-size: 13px;
  line-height: 1.5;
}
.beta-optional-consent {
  color: var(--muted);
}
.beta-required-consent {
  font-weight: 700;
}
.beta-optional-consent input,
.beta-required-consent input { flex: 0 0 auto; width: 18px; height: 18px; }
.beta-honeypot { position: absolute; left: -10000px; }
.beta-form-actions { display: flex; align-items: center; gap: 14px; }
.beta-form-actions p { margin: 0; color: var(--muted); font-size: 13px; }
.beta-submit:disabled { opacity: .6; cursor: wait; }

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr; }
  .trade-desk-modes { grid-column: 1; grid-template-columns: 1fr; }
  .survival-score-mark { grid-column: 1; grid-row: 1; justify-self: end; width: 118px; height: 118px; }
  .trade-desk-mode { width: min(100%, 230px); height: 144px; min-height: 144px; margin-inline: auto; }
  .beta-contact-grid { grid-template-columns: 1fr; }
  .beta-contact-grid label:first-child { grid-column: auto; }
  .beta-form-actions { align-items: stretch; flex-direction: column; }
  .beta-overview-card { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 10px; height: auto; min-height: 144px; }
  .beta-overview-card > strong { grid-column: auto; }
  .beta-product-line i { padding-inline: 3px; }
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  overflow-x: auto;
}

.weekly-scan-banner {
  padding: 12px clamp(18px, 4vw, 48px) 0;
}

.weekly-scan-banner-copy {
  margin: 0;
  padding: 14px 18px;
  border: 1px solid #d7c4a3;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff8ec, #fff2d8);
  color: #6a3b09;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.weekly-scan-banner-link {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  color: #8a4b08;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.weekly-scan-banner-link:hover,
.weekly-scan-banner-link:focus-visible {
  color: #6a3b09;
}

.nav-search {
  display: grid;
  flex: 0 0 215px;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 4px 0 0;
}

.search.nav-search > span {
  color: var(--accent-dark);
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.nav-search input {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #b7d8d2;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 900;
  letter-spacing: 0.035em;
  text-align: center;
  text-transform: uppercase;
}

.nav-search input:hover,
.nav-search input:focus {
  border-color: #b7d8d2;
  background: #edf7f5;
  outline: none;
}

.primary-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 900;
  letter-spacing: 0.035em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-nav-link:hover {
  border-color: #b7d8d2;
  color: var(--accent-dark);
  background: #edf7f5;
}

.primary-nav-link.active {
  border-color: #b7d8d2;
  color: var(--accent-dark);
  background: #edf7f5;
}

.primary-nav-link-admin {
  border-color: #9cc9be;
  background: #e8f6f1;
  color: #115e59;
  box-shadow: 0 3px 10px rgba(17, 94, 89, 0.08);
}

.primary-nav-link-admin:hover,
.primary-nav-link-admin:focus-visible,
.primary-nav-link-admin.active {
  border-color: #7bb8aa;
  background: #dff3ed;
  color: #0f766e;
}

.primary-nav-link.deep-dives-banner {
  border-color: #d98a36;
  background: #fff4df;
  color: #713d08;
  box-shadow: 0 3px 10px rgba(180, 83, 9, 0.12);
}

.primary-nav-link .nav-new-badge {
  padding: 2px 5px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
}

.primary-nav-link.deep-dives-banner:hover,
.primary-nav-link.deep-dives-banner:focus-visible {
  border-color: #b45309;
  background: #ffe8bd;
  color: #713d08;
  outline: none;
}

.primary-nav-link.alerts-beta-link {
  gap: 7px;
  color: #166534;
  border-color: #16a34a;
  background: #ecfdf5;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.14);
}

.primary-nav-link.alerts-beta-link:hover,
.primary-nav-link.alerts-beta-link:focus-visible {
  color: #14532d;
  border-color: #15803d;
  background: #dcfce7;
  outline: none;
}

.primary-nav-link.alerts-beta-link .nav-new-badge {
  color: #fff;
  background: #16a34a;
}

.alerts-unread-count {
  min-width: 19px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.primary-nav-link span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.nav-glossary-trigger {
  margin-left: -5px;
  margin-right: 2px;
  color: var(--accent-dark);
}

.nav-feature-info {
  flex: 0 0 auto;
}

.nav-feature-info.alerts-info {
  color: #166534;
  border-color: #86efac;
  background: #ecfdf5;
}

.ai-disclosure-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
}

.ai-disclosure-dialog {
  width: min(94vw, 820px);
  height: auto;
  max-width: 820px;
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  border-radius: 18px;
  overflow: auto;
}

.ai-disclosure-panel {
  padding: clamp(22px, 4vw, 40px);
  background: #fff;
}

.ai-disclosure-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.ai-disclosure-head h2 {
  max-width: 650px;
  margin: 4px 0 0;
  font-size: clamp(21px, 3vw, 32px);
  line-height: 1.1;
}

.ai-disclosure-close {
  min-height: 36px;
  white-space: nowrap;
}

.ai-disclosure-copy {
  display: grid;
  gap: 16px;
  padding-top: 22px;
}

.ai-disclosure-copy p {
  margin: 0;
  color: #34413b;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.62;
}

.survival-score-dialog {
  width: min(94vw, 940px);
  height: auto;
  max-width: 940px;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto;
  border-radius: 18px;
  overflow: auto;
}

.survival-score-panel {
  padding: clamp(22px, 4vw, 42px);
  background: #fff;
}

.survival-score-head {
  position: sticky;
  top: calc(-1 * clamp(22px, 4vw, 42px));
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
}

.survival-score-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.survival-score-close {
  min-height: 36px;
  white-space: nowrap;
}

.survival-score-copy {
  display: grid;
  gap: 18px;
  padding-top: 24px;
  color: #34413b;
}

.survival-score-copy section {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e4ebe6;
}

.survival-score-copy h3,
.survival-score-copy h4,
.survival-score-copy p,
.survival-score-copy ul,
.survival-score-copy ol {
  margin: 0;
}

.survival-score-copy h3 {
  color: var(--accent-dark);
  font-size: clamp(20px, 2.5vw, 28px);
}

.survival-score-copy h4 {
  margin-top: 6px;
  color: #7c351f;
  font-size: clamp(15px, 1.7vw, 19px);
}

.survival-score-copy p,
.survival-score-copy li {
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.62;
}

.survival-score-copy ul,
.survival-score-copy ol {
  display: grid;
  gap: 5px;
  padding-left: 24px;
}

.survival-score-lead {
  padding: 18px;
  border: 1px solid rgba(166, 75, 42, 0.25);
  border-radius: 12px;
  background: #fff8f3;
  font-size: clamp(16px, 1.7vw, 20px) !important;
}

.survival-score-kicker {
  color: #7c351f;
  font-size: clamp(17px, 2vw, 22px) !important;
  font-weight: 900;
  text-transform: uppercase;
}

.survival-direction-callout {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 2px solid #a64b2a;
  border-radius: 12px;
  background: #fff4ec;
  color: #5f2818;
}

.survival-direction-callout strong {
  font-size: clamp(17px, 2vw, 22px);
}

.survival-direction-callout span {
  font-size: clamp(14px, 1.3vw, 17px);
}

.survival-direction-callout b {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  margin-right: 5px;
  place-items: center;
  border-radius: 50%;
  background: #7c351f;
  color: #fff;
}

.survival-scale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.survival-scale article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf8;
}

.survival-scale article strong {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 16px;
}

.survival-scale-danger article:nth-child(1) { border-left: 5px solid #26866f; }
.survival-scale-danger article:nth-child(2) { border-left: 5px solid #73a843; }
.survival-scale-danger article:nth-child(3) { border-left: 5px solid #d3a52d; }
.survival-scale-danger article:nth-child(4) { border-left: 5px solid #df7a2c; }
.survival-scale-danger article:nth-child(5) { border-left: 5px solid #c94f3d; }
.survival-scale-danger article:nth-child(6) { border-left: 5px solid #871f2f; }

.survival-example-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.survival-example-score span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
  text-align: center;
}

.survival-stages li {
  display: grid;
  gap: 2px;
}

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

.survival-postures article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 94px);
}

.controls {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 94px);
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #eef3ef;
}

.action-directory-heading {
  margin: 0 0 12px;
  color: #a64b2a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.top-picks {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  background: #faf5ff;
}

.top-picks-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4c1d95;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.setup-threshold {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.glossary-term {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.glossary-trigger {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.glossary-trigger:hover,
.glossary-trigger:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
  background: #ffffff;
}

.glossary-popover {
  position: fixed;
  z-index: 1000;
  max-height: min(72vh, 520px);
  padding: 14px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  overflow: auto;
}

.glossary-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.glossary-popover-head strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.glossary-close {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #cbd5cf;
  border-radius: 7px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.glossary-popover p {
  margin: 0 0 9px;
  color: #34413b;
  font-size: 13px;
  line-height: 1.45;
}

.glossary-popover p:last-child {
  margin-bottom: 0;
}

.glossary-short {
  font-weight: 750;
}

.large-description-popover {
  max-height: min(84vh, 840px);
  padding: clamp(24px, 2.25vw, 44px);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
  transform: translate(-50%, -50%);
}

.large-description-popover .glossary-popover-head {
  margin-bottom: clamp(16px, 1.5vw, 26px);
}

.large-description-popover .glossary-popover-head strong {
  font-size: clamp(20px, 1.4vw, 30px);
}

.large-description-popover .glossary-close {
  min-height: 38px;
  padding: 7px 13px;
  font-size: clamp(12px, 0.75vw, 15px);
}

.large-description-popover p {
  margin-bottom: clamp(14px, 1.15vw, 22px);
  font-size: clamp(16px, 1.05vw, 22px);
  line-height: 1.62;
}

.glossary-detail-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.glossary-detail-section h3 {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 17px;
}

.glossary-detail-section .glossary-section-subtitle {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.glossary-detail-section ul {
  columns: 2;
  gap: 28px;
  margin: 10px 0 12px;
  padding-left: 20px;
  color: #34413b;
  font-size: 13px;
  line-height: 1.55;
}

.glossary-detail-section li {
  break-inside: avoid;
  margin-bottom: 4px;
}

.glossary-detail-section .glossary-section-question {
  margin-top: 12px;
  color: var(--accent-dark);
  font-weight: 850;
}

.large-description-popover .glossary-short {
  font-size: clamp(17px, 1.15vw, 24px);
  line-height: 1.55;
}

.top-picks-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.starter-picks {
  border-color: #86efac;
  background: #f0fdf4;
}

.starter-picks-label {
  color: #166534;
}

.starter-picks-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.breakout-picks {
  border-color: #fdba74;
  background: #fff7ed;
}

.breakout-picks-label {
  color: #9a3412;
}

.breakout-picks-dot {
  background: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.continuation-picks {
  border-color: #93c5fd;
  background: #eff6ff;
}

.continuation-picks-label {
  color: #1d4ed8;
}

.continuation-picks-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.starter-empty {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.top-picks-list {
  display: grid;
  gap: 5px;
}

.top-picks-link {
  display: grid;
  grid-template-columns: 48px auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 7px;
  color: #211136;
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
}

.buybox-monthly-confirmation {
  padding: 2px 5px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.top-picks-link:hover {
  background: rgba(124, 58, 237, 0.08);
}

.top-picks-link strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.top-picks-gold-star {
  color: #d97706;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.top-picks-link span {
  min-width: 0;
  overflow: hidden;
  color: #51415f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search,
.control-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.search span,
.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reset-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.utility-actions .utility-action-button,
.utility-actions .rubric-button.glossary-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.filter-reset-button {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #cbd5cf;
  border-radius: 7px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-reset-button:hover {
  border-color: var(--accent);
  background: #f0fdfa;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5cf;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

select[multiple] {
  min-height: 156px;
}

select[multiple] option {
  padding: 7px 9px;
}

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

.segmented button,
.ghost {
  min-height: 40px;
  border: 1px solid #cbd5cf;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.segmented button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost {
  padding: 9px 14px;
}

.ghost.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost:hover,
.segmented button:hover,
.icon-button:hover {
  border-color: var(--accent);
}

.ghost.danger {
  border-color: #fca5a5;
  color: var(--red);
}

.ghost.danger:hover {
  border-color: var(--red);
  background: #fef2f2;
}

.content {
  padding: 22px clamp(18px, 3vw, 38px) 42px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(120px, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 4px;
  font-size: 30px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.section-head #printButton {
  justify-self: end;
}

.ranking-description {
  max-width: 760px;
  margin: 0;
  color: #28584d !important;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.archived-card {
  border-style: dashed;
  background: #fafafa;
}

.card .chart-frame {
  aspect-ratio: 16 / 9;
}

.card button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chart-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid #cfd8d1;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.13) 1px, transparent 1px),
    #f9fbf8;
  background-size: 38px 38px;
}

.chart-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.chart-action-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.chart-buybox-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  justify-content: flex-end;
  max-width: calc(100% - 96px);
  pointer-events: auto;
}

.chart-action-overlay .action-rating {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.direction-conflict-note {
  max-width: min(430px, calc(100vw - 80px));
  padding: 7px 10px;
  border: 1px solid rgba(180, 83, 9, 0.72);
  border-radius: 5px;
  background: rgba(255, 251, 235, 0.94);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
}

.chart-frame.large .direction-conflict-note {
  max-width: 520px;
  font-size: 15px;
}

.rule40-rating {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
  background: #fff;
}

.chart-action-overlay .rule40-rating {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.rule40-pass {
  color: #166534;
  background: #ecfdf3;
}

.rule40-fail {
  color: #9a3412;
  background: #fff7ed;
}

.rule40-unavailable {
  color: #475569;
  background: #f8fafc;
}

.chart-buybox-overlay .buybox-badge {
  border-color: rgba(194, 65, 12, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.chart-buybox-overlay .punchcard-badge {
  border-color: rgba(22, 101, 52, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.placeholder {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.placeholder strong {
  color: var(--ink);
  font-size: 24px;
}

.card-caption {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-title-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-title-line strong,
.card-title-line span,
.card-title-line time {
  min-width: 0;
}

.card-title-line strong {
  flex: 0 0 auto;
  font-weight: 850;
}

.card-title-line span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-line time {
  flex: 0 0 auto;
}

.card-caption p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-category-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-date-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-date-line span::after {
  margin-left: 8px;
  content: "•";
  color: #aab4ae;
}

.card-date-line time {
  color: #46564e;
  font-weight: 750;
}

.card-category-line .action-rating {
  margin-left: auto;
}

.action-rating {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  max-width: max-content;
  padding: 2px 8px 2px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.action-dot {
  display: inline-block;
  width: 16px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.action-actionable {
  color: #15803d;
  background: #ecfdf3;
}

.action-accumulate {
  color: #0284c7;
  background: #e0f2fe;
}

.action-starter {
  color: #15803d;
  background: #ecfdf3;
}

.action-add {
  color: #0f766e;
  background: #f0fdfa;
}

.action-full-position {
  color: #7c3aed;
  background: #f5f3ff;
}

.action-watch {
  color: #b45309;
  background: #fffbeb;
}

.action-listed {
  color: #475569;
  background: #f8fafc;
}

.action-hold {
  color: #1e3a8a;
  background: #dbeafe;
}

.action-developing {
  color: #475569;
  background: #f8fafc;
}

.action-triggered {
  color: #1d4ed8;
  background: #eff6ff;
}

.action-trim {
  color: #b91c1c;
  background: #fef2f2;
}

.archive-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: max-content;
  padding: 2px 8px;
  border: 1px solid #64748b;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.plugnplay-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: max-content;
  padding: 2px 8px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #ecfdf5;
  color: #115e59;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.punchcard-badge,
.buybox-badge,
.buybox-wick-badge,
.breakout-badge,
.punchcard-rating {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: max-content;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.punchcard-badge,
.punchcard-rating {
  background: #f0fdf4;
  color: #166534;
}

.buybox-badge {
  background: #fff7ed;
  color: #c2410c;
}

.buybox-wick-badge {
  background: #fffbeb;
  color: #a16207;
}

.buybox-badge .glossary-trigger,
.buybox-wick-badge .glossary-trigger {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.breakout-badge {
  background: #eef2ff;
  color: #4338ca;
}

.technical-event-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: max-content;
  padding: 2px 8px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #ecfdf5;
  color: #115e59;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.technical-event-risk {
  border-color: #b91c1c;
  background: #fef2f2;
  color: #b91c1c;
}

.technical-event-badge.severity-confirm {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #115e59;
}

.technical-event-badge.severity-caution {
  border-color: #d97706;
  background: #fffbeb;
  color: #92400e;
}

.technical-event-badge.severity-risk,
.technical-event-badge.severity-critical {
  border-color: #b91c1c;
  background: #fef2f2;
  color: #b91c1c;
}

.technical-event-badge.severity-critical {
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
}

.chart-action-overlay .punchcard-rating {
  border-color: rgba(22, 101, 52, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.buy-box-dot {
  background: #ca8a04;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.24);
}

.notes {
  margin-bottom: 0;
  color: #34413b;
  font-size: 14px;
  line-height: 1.45;
}

dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.dialog-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dialog-admin-button {
  min-width: 82px;
  min-height: 36px;
  padding: 0 12px;
}

.detail-print-button {
  min-height: 36px;
  padding: 0 12px;
  background: #fff;
  white-space: nowrap;
}

.chart-print-frame {
  position: fixed;
  top: 0;
  left: -120vw;
  width: 11in;
  height: 8in;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.dialog-admin-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.close {
  z-index: 1;
}

.tab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.tab-toggle input {
  appearance: none;
  position: relative;
  width: 34px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
}

.tab-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 0.15s ease;
}

.tab-toggle input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.tab-toggle input:checked::before {
  transform: translateX(14px);
}

.tab-toggle:focus-within {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.tab-toggle.active {
  border-color: var(--accent);
  background: #ecfdf5;
  color: var(--accent-dark);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, 0.75fr);
  grid-template-rows: minmax(0, calc(100vh - 82px));
  grid-template-rows: minmax(0, calc(100dvh - 82px));
  gap: 18px;
  align-items: start;
  justify-content: stretch;
  height: 100vh;
  height: 100dvh;
  padding: 64px 18px 18px 0;
  background: #111815;
  overflow: auto;
}

.admin-dock {
  display: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.detail-chart {
  display: grid;
  align-content: start;
  gap: 10px;
  justify-self: start;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.detail-chart-shell {
  display: grid;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.timeframe-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 10px;
}

.timeframe-switcher button {
  min-width: 44px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.timeframe-switcher button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.detail .large {
  justify-self: start;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #111815;
}

.detail .large img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  cursor: zoom-in;
}

.analysis-card {
  display: grid;
  align-content: start;
  gap: 14px;
  align-self: stretch;
  overflow: auto;
  overscroll-behavior: contain;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

body.admin-mode .detail,
body.admin-pane-open .detail {
  grid-template-columns: minmax(320px, 360px) minmax(50vw, 1.6fr) minmax(260px, 0.38fr);
  padding-left: 0;
  padding-right: 18px;
}

body.review-assistant-mode.admin-mode .detail,
body.review-assistant-mode.admin-pane-open .detail {
  grid-template-columns: minmax(340px, 380px) minmax(58vw, 1.95fr) minmax(220px, 0.28fr);
}

body.admin-mode .admin-dock,
body.admin-pane-open .admin-dock {
  display: grid;
  align-content: start;
  position: sticky;
  top: 64px;
  z-index: 30;
  padding: 0;
  height: calc(100vh - 82px);
  height: calc(100dvh - 82px);
  max-height: calc(100vh - 82px);
  max-height: calc(100dvh - 82px);
}

body.admin-mode .analysis-card {
  cursor: default;
}

body.admin-mode .detail-chart,
body.admin-pane-open .detail-chart {
  min-width: 50vw;
}

body.review-assistant-mode.admin-mode .detail-chart,
body.review-assistant-mode.admin-pane-open .detail-chart {
  min-width: 58vw;
}

body.review-assistant-mode .analysis-card {
  padding: 12px;
  font-size: 12px;
}

body.review-assistant-mode .analysis-card h3 {
  font-size: 14px;
}

body.admin-mode .admin-dock .admin-panel,
body.admin-pane-open .admin-dock .admin-panel {
  gap: 12px;
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

body.admin-mode.detail-popout-open .detail-popout,
body.admin-pane-open.detail-popout-open .detail-popout {
  inset: 0 396px 0 0;
}

body.admin-mode.detail-popout-open .detail-popout[data-type="analysis"],
body.admin-pane-open.detail-popout-open .detail-popout[data-type="analysis"] {
  inset: 0;
}

.analysis-card .analysis-editor,
.analysis-card input,
.analysis-card select,
.analysis-card textarea,
.analysis-card button,
.analysis-card summary,
.analysis-card label {
  cursor: auto;
}

body.admin-mode .editable-analysis-section {
  position: relative;
  cursor: text;
}

body.admin-mode .editable-analysis-section:hover {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 4px;
}

body.admin-mode .editable-analysis-section:hover::after {
  content: "Edit";
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-popout {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  padding: 52px 18px 18px;
  background: #111815;
  overflow: hidden;
}

.detail-popout[data-type="analysis"] {
  align-content: start;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 58px clamp(10px, 1.5vw, 24px) 44px;
}

.detail-popout[hidden] {
  display: none;
}

.popout-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 11;
}

.detail-popout-content {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.detail-popout[data-type="analysis"] .detail-popout-content {
  align-content: start;
  height: 100%;
  min-height: calc(100vh - 102px);
  min-height: calc(100dvh - 102px);
}

.popout-chart {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: calc(100vh - 70px);
  max-height: calc(100dvh - 70px);
  background: #111815;
  overflow: hidden;
}

.popout-chart img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
}

.analysis-card-popout {
  justify-self: center;
  width: min(2100px, 100%);
  height: calc(100vh - 102px);
  height: calc(100dvh - 102px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 44px);
  gap: 24px;
  cursor: auto;
}

.analysis-card-popout .analysis-header h2 {
  font-size: clamp(30px, 3.2vw, 54px);
  line-height: 1.03;
}

.analysis-card-popout .analysis-meta small {
  font-size: 12px;
}

.analysis-card-popout .analysis-meta strong {
  font-size: clamp(16px, 1.15vw, 20px);
}

.analysis-card-popout h3 {
  font-size: 16px;
}

.analysis-card-popout p,
.analysis-card-popout .analysis-walkthrough {
  font-size: clamp(19px, 1.35vw, 24px);
  line-height: 1.52;
}

.analysis-card-popout .analysis-header p {
  font-size: 16px;
}

.analysis-card-popout .analysis-meta {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.analysis-card-popout .analysis-meta span {
  padding: 13px 14px;
}

.analysis-card-popout .context-layer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.analysis-card-popout .context-block-wide {
  grid-column: span 3;
}

.analysis-card-popout .context-block {
  gap: 8px;
  padding: 16px;
}

.analysis-card-popout .context-block p {
  font-size: 15px;
  line-height: 1.42;
}

.analysis-card-popout .analysis-kv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-card-popout .analysis-kv div,
.analysis-card-popout .rr-row {
  align-items: center;
  padding: 14px 16px;
}

.analysis-card-popout .analysis-kv span,
.analysis-card-popout .rr-row span,
.analysis-card-popout .analysis-kv strong,
.analysis-card-popout .rr-row strong {
  font-size: 18px;
}

.chart-message-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  width: min(1400px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
}

.chart-message-preview {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chart-message-form {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: auto;
}

.chart-message-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.chart-message-head h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.chart-message-form textarea {
  min-height: 220px;
}

.analysis-card-popout .analysis-walkthrough .walk-heading {
  font-size: clamp(21px, 1.55vw, 28px);
}

.analysis-card section {
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.thesis-section {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid #b7d8d2;
  border-radius: 8px;
  background: #edf7f5;
}

.thesis-section h3 {
  margin-bottom: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

.thesis-section p {
  margin: 0;
}

.strategic-intelligence-section {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.strategic-intelligence-section p {
  margin: 0;
}

.strategic-intelligence-section strong {
  color: var(--ink);
}

.strategic-intelligence-section span {
  color: var(--ink);
  font-weight: 750;
}

.analysis-header h2 {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.15;
}

.analysis-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.analysis-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}

.analysis-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.analysis-meta strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.2;
}

.analysis-action {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.technical-event-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
}

.technical-event-section.severity-caution {
  border-color: #fcd34d;
  background: #fffbeb;
}

.technical-event-section.severity-risk,
.technical-event-section.severity-critical {
  border-color: #fecaca;
  background: #fff7f7;
}

.technical-alert-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.technical-alert-story-head h3 {
  margin: 0;
}

.technical-alert-story-head span {
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.severity-caution .technical-alert-story-head span { color: #92400e; }
.severity-risk .technical-alert-story-head span,
.severity-critical .technical-alert-story-head span { color: #b91c1c; }

.technical-alert-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.technical-alert-story-grid div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.technical-alert-story-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.technical-alert-story-grid strong {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.3;
}

.technical-alert-action {
  margin: 0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.technical-event-section > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.technical-event-latest {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ffffff;
}

.technical-event-latest.is-risk {
  border-color: #fecaca;
  background: #fff7f7;
}

.technical-event-latest span,
.technical-event-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.technical-event-latest strong,
.technical-event-row strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
}

.technical-event-latest small,
.technical-event-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.technical-event-latest p {
  margin-top: 3px;
}

.technical-event-list {
  display: grid;
  gap: 6px;
}

.technical-event-row {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #ffffff;
}

.technical-event-row.is-risk {
  border-color: #fecaca;
}

.admin-mode-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-bottom: 10px;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #ecfdf5;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.analysis-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.analysis-card h3 {
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.analysis-card h3 small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none;
}

.analysis-card p {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
}

.analysis-walkthrough {
  display: grid;
  gap: 5px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
}

.analysis-walkthrough .walk-heading {
  margin-top: 4px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.analysis-walkthrough .walk-heading:first-child {
  margin-top: 0;
}

.analysis-walkthrough .walk-secondary {
  font-weight: 850;
}

.analysis-walkthrough strong em {
  font-style: italic;
  font-weight: 850;
}

.analysis-walkthrough .walk-spacer {
  height: 3px;
}

.analysis-card.analysis-card-popout h3 {
  font-size: 16px;
}

.analysis-card.analysis-card-popout p,
.analysis-card.analysis-card-popout .analysis-walkthrough {
  font-size: clamp(19px, 1.35vw, 24px);
  line-height: 1.52;
}

.analysis-card.analysis-card-popout .analysis-header p {
  font-size: 16px;
}

.analysis-card.analysis-card-popout .context-block p {
  font-size: 15px;
  line-height: 1.42;
}

.analysis-card.analysis-card-popout .analysis-walkthrough .walk-heading {
  font-size: clamp(21px, 1.55vw, 28px);
}

.analysis-editor {
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.analysis-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.analysis-editor summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
}

.analysis-editor form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.analysis-editor label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.analysis-editor label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.analysis-editor input,
.analysis-editor select,
.analysis-editor textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
}

.analysis-editor textarea {
  resize: vertical;
  line-height: 1.35;
}

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

.analysis-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.analysis-editor-actions .ghost {
  min-width: 0;
  width: 100%;
}

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

.admin-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  height: auto;
  max-height: calc(100vh - 32px);
  margin: auto auto auto 16px;
  border-radius: 8px;
  background: transparent;
  overflow: auto;
}

.admin-panel {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.admin-dialog.dragging {
  cursor: move;
}

.admin-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.admin-auth,
.admin-controls {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.admin-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.admin-auth {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.admin-auth .label {
  grid-column: 1 / -1;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.admin-actions .ghost {
  width: 100%;
  min-width: 0;
}

.admin-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.learning-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe4de;
  border-radius: 8px;
  background: #f8faf8;
}

.admin-edit-section > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.admin-edit-section[open] > summary {
  margin-bottom: 12px;
}

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

.learning-head h3 {
  margin: 0;
  font-size: 16px;
}

.learning-head > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #cbd5cf;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.learning-summary div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
}

.learning-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.learning-summary strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 74px;
  padding: 9px 11px;
  border: 1px solid #cbd5cf;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

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

.learning-grid .control-group {
  margin-bottom: 0;
}

.learning-outcome {
  display: grid;
  gap: 10px;
}

.learning-outcome summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.learning-output {
  overflow: auto;
  max-height: 220px;
  margin: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.context-layer {
  display: grid;
  gap: 10px;
}

.context-block {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.context-block-wide {
  border-color: #c7d2fe;
  background: #f8f7ff;
}

.context-block p {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
}

.context-block span {
  color: #475569;
  font-weight: 850;
}

.context-scores {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.analysis-kv {
  display: grid;
  gap: 10px;
}

.analysis-kv div,
.rr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.rr-row .rr-move {
  color: #0369a1;
  font-weight: 750;
  white-space: nowrap;
}

.analysis-kv span,
.rr-row span {
  color: #64748b;
  font-size: 13px;
}

.analysis-kv strong,
.rr-row strong {
  color: #0f172a;
  font-size: 13px;
  text-align: right;
}

.rr-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1700px) {
  .detail {
    grid-template-columns: minmax(0, 1fr) minmax(480px, 28vw);
  }

  body.admin-mode .detail,
  body.admin-pane-open .detail {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px) minmax(360px, 0.45fr);
  }

  .detail .large {
    width: 100%;
  }
}

@media (max-width: 1280px) {
  .detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    align-content: start;
    height: 100vh;
    height: 100dvh;
    padding: 72px 0 18px;
  }

  .detail-chart,
  .detail-chart-shell {
    height: auto;
  }

  body.admin-mode .detail,
  body.admin-pane-open .detail {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-rows: auto auto;
    padding: 72px 10px 18px;
  }

  body.admin-mode .admin-dock,
  body.admin-pane-open .admin-dock {
    top: 72px;
  }

  body.admin-mode .analysis-card,
  body.admin-pane-open .analysis-card {
    grid-column: 1 / -1;
  }

  body.admin-mode.detail-popout-open .detail-popout,
  body.admin-pane-open.detail-popout-open .detail-popout {
    inset: 0 min(360px, 36vw) 0 0;
  }

  body.admin-mode.detail-popout-open .detail-popout[data-type="analysis"],
  body.admin-pane-open.detail-popout-open .detail-popout[data-type="analysis"] {
    inset: 0;
  }

  .detail .large {
    width: 100vw;
    height: min(64vh, calc(100vh - 180px));
    height: min(64dvh, calc(100dvh - 180px));
    min-height: 340px;
    max-height: 720px;
  }

  .detail .large img {
    width: auto !important;
    height: 100% !important;
    max-width: 100vw;
    max-height: 100%;
    object-fit: contain;
  }

  .analysis-card {
    width: calc(100vw - 20px);
    height: auto;
    min-height: min(34vh, 360px);
    min-height: min(34dvh, 360px);
    margin: 0 10px;
  }

  .analysis-card-popout {
    width: 100%;
    margin: 0;
  }

  .chart-message-editor {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .chart-message-preview {
    min-height: min(48vh, 420px);
    min-height: min(48dvh, 420px);
  }

  .analysis-card-popout .analysis-meta,
  .analysis-card-popout .context-layer,
  .analysis-card-popout .analysis-kv {
    grid-template-columns: 1fr;
  }

  .analysis-card-popout .context-block-wide {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    display: flex;
  }

  .ranking-description {
    text-align: left;
  }

  .section-head #printButton {
    align-self: flex-start;
  }

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

  .dialog-toolbar {
    top: 10px;
    right: 10px;
  }

  .icon-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
  }

  .controls {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trade-desk-modes {
    grid-template-columns: 1fr;
  }

  .trade-desk-mode {
    width: min(100%, 230px);
    height: 144px;
    min-height: 144px;
    margin-inline: auto;
  }

  .trade-desk-mode.beta-overview-card {
    width: min(100%, 718px);
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    height: auto;
  }

  .beta-overview-card > strong {
    grid-column: auto;
  }

  .analysis-card {
    padding: 12px;
  }

  .detail .large {
    width: 100vw;
    height: auto;
    min-height: 0;
  }

  body.admin-mode .detail,
  body.admin-pane-open .detail {
    grid-template-columns: 1fr;
    padding: 72px 0 18px;
  }

  body.admin-mode .admin-dock,
  body.admin-pane-open .admin-dock {
    position: static;
    height: auto;
    max-height: none;
    margin: 0 10px;
  }

  body.admin-mode.detail-popout-open .detail-popout,
  body.admin-pane-open.detail-popout-open .detail-popout {
    inset: 0;
  }

  .detail-popout[data-type="analysis"] {
    padding: 58px 10px 24px;
  }

  .analysis-card-popout {
    height: calc(100vh - 82px);
    height: calc(100dvh - 82px);
  }

  .detail .large img {
    width: 100vw;
    height: auto !important;
    max-height: none;
    object-fit: contain;
  }
}

@media (max-width: 520px) {
  .nav-search {
    flex-basis: 185px;
  }

  .trading-desk-brand {
    justify-content: flex-start;
    padding-right: 95px;
  }

  .survival-score-mark {
    width: 95px;
    height: 95px;
  }

  .survival-score-info {
    width: 22px;
    height: 22px;
  }

  .survival-score-head {
    display: grid;
  }

  .survival-score-close {
    width: 100%;
  }

  .survival-scale {
    grid-template-columns: 1fr;
  }

  .survival-example-score,
  .survival-postures {
    grid-template-columns: 1fr;
  }

  .ai-disclosure-head {
    display: grid;
  }

  .ai-disclosure-close {
    width: 100%;
  }

  .glossary-detail-section ul {
    columns: 1;
  }

  .glossary-popover {
    left: 12px !important;
    right: 12px;
    width: auto !important;
    max-height: 70vh;
  }

  .glossary-popover.large-description-popover {
    top: 50% !important;
    right: auto;
    left: 50% !important;
    width: calc(100vw - 24px) !important;
    max-height: 86vh;
    padding: 20px;
    transform: translate(-50%, -50%);
  }

  .large-description-popover p {
    font-size: 16px;
    line-height: 1.55;
  }

  .dialog-toolbar {
    top: 8px;
    right: 8px;
  }

  .analysis-meta {
    grid-template-columns: 1fr;
  }

}

@media print {
  .controls,
  .topbar,
  .section-head button,
  dialog {
    display: none;
  }

  .layout {
    display: block;
  }

  .content {
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }

  body.print-detail-chart > :not(#chartDialog),
  body.print-detail-analysis > :not(#chartDialog) {
    display: none !important;
  }

  body.print-detail-chart #chartDialog,
  body.print-detail-analysis #chartDialog {
    position: static;
    display: block !important;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    background: #fff;
    box-shadow: none;
  }

  body.print-detail-chart .dialog-toolbar,
  body.print-detail-analysis .dialog-toolbar,
  body.print-detail-chart #adminDock,
  body.print-detail-analysis #adminDock,
  body.print-detail-chart #detailPopout,
  body.print-detail-analysis #detailPopout {
    display: none !important;
  }

  body.print-detail-chart .detail,
  body.print-detail-analysis .detail {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
  }

  body.print-detail-chart #analysisPanel {
    display: none !important;
  }

  body.print-detail-chart #detailChart {
    page: chart-detail-page;
    display: block !important;
    width: 10.5in;
    height: 7.5in;
    margin: 0;
    padding: 0;
  }

  body.print-detail-chart .detail-chart-shell,
  body.print-detail-chart .chart-frame.large,
  body.print-detail-chart .chart-frame.large picture,
  body.print-detail-chart .chart-frame.large img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  body.print-detail-chart .chart-frame.large img {
    object-fit: contain;
  }

  body.print-detail-chart .timeframe-switcher {
    display: none !important;
  }

  body.print-detail-analysis #detailChart {
    display: none !important;
  }

  body.print-detail-analysis #analysisPanel {
    page: analysis-detail-page;
    display: block !important;
    width: 7.5in;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0.18in;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  body.print-detail-analysis .analysis-editor,
  body.print-detail-analysis button,
  body.print-detail-analysis input,
  body.print-detail-analysis textarea,
  body.print-detail-analysis select {
    display: none !important;
  }
}

@page chart-detail-page {
  size: 11in 8in;
  margin: 0.25in;
}

@page analysis-detail-page {
  size: 8in 14in;
  margin: 0.25in;
}


.analysis-level-grid {
  display: grid;
  gap: 7px;
}

.analysis-level-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.7fr) minmax(80px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  background: #f8fafc;
}

.analysis-level-row span,
.analysis-level-row small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.analysis-level-row strong {
  color: #0f172a;
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .analysis-level-row {
    grid-template-columns: 1fr;
  }
}

/* Admin control center */
.admin-panel {
  padding: 0 16px 18px;
  border-color: #9fbab4;
  border-radius: 12px;
  background: radial-gradient(circle at 100% 0, rgba(20, 184, 166, 0.12), transparent 28%), linear-gradient(180deg, #eef6f3 0, #f8faf9 260px, #f4f7f5 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.admin-head {
  margin: 0 -16px;
  padding: 18px 18px 16px;
  border-bottom: 3px solid #2dd4bf;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 62%, #0f766e 100%);
  color: #fff;
}

.admin-head h2 {
  color: #fff;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.admin-head .eyebrow { color: #99f6e4; }

.admin-subtitle {
  margin: 6px 0 0;
  color: #ccfbf1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-head .icon-button {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-controls > .control-group {
  padding: 10px;
  border: 1px solid #d5e2de;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
}

.admin-controls input:focus,
.admin-controls select:focus,
.admin-controls textarea:focus {
  border-color: #0f766e;
  outline: 3px solid rgba(20, 184, 166, 0.16);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.admin-actions .admin-primary-action,
#adminFullAnalysisSection .analysis-editor-actions button[type="submit"] {
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.2);
}

.admin-status {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  margin: 0 -4px -8px;
  padding: 10px 12px;
  border: 1px solid #b7d5ce;
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.97);
  color: #115e59;
  font-weight: 800;
  box-shadow: 0 -5px 18px rgba(15, 23, 42, 0.07);
}

.learning-panel {
  border-color: #cfddd8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.045);
}

.admin-edit-section > summary { list-style: none; }
.admin-edit-section > summary::-webkit-details-marker { display: none; }

.admin-edit-section > summary::before {
  content: "+";
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  background: #dff5ef;
  color: #0f766e;
  font-weight: 950;
}

.admin-edit-section[open] > summary::before { content: "−"; }

#adminFullAnalysisSection {
  border-color: #7bb8aa;
  background: linear-gradient(180deg, #f0fdfa, #ffffff 110px);
}

#adminFullAnalysisSection > summary {
  color: #115e59;
  font-size: 15px;
}

#adminAnalysisEditor .analysis-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

#adminAnalysisEditor .analysis-editor > summary {
  padding: 9px 10px;
  border-radius: 7px;
  background: #e7f5f1;
  color: #115e59;
}

#adminAnalysisEditor .analysis-editor form { padding-top: 2px; }

#adminAnalysisEditor .analysis-editor label {
  padding: 8px;
  border: 1px solid #dbe7e3;
  border-radius: 8px;
  background: #fff;
}

#adminAnalysisEditor .analysis-editor label span {
  color: #3f625d;
  letter-spacing: 0.035em;
}

.review-field-focus {
  border-color: #0f766e !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18) !important;
  outline: 0;
  animation: reviewFieldPulse 1.2s ease-out 1;
}

.review-inbox {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #d9e6e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbf9, #ffffff 150px);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.04);
}

.review-inbox-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.review-inbox-head h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.review-inbox-head p:last-child {
  margin: 6px 0 0;
  color: #48645f;
}

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

.review-inbox-item {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(170px, 0.65fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid #dbe7e3;
  border-radius: 12px;
  background: #ffffff;
}

.review-inbox-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.review-inbox-title-row h4 {
  margin: 0;
  font-size: 18px;
}

.review-inbox-timeframe {
  color: #496460;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-inbox-setup,
.review-inbox-question,
.review-inbox-empty {
  margin: 6px 0 0;
}

.review-inbox-setup {
  color: #274540;
  font-weight: 700;
}

.review-inbox-question,
.review-inbox-empty {
  color: #53706b;
}

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

.review-inbox-stats div {
  padding: 10px 11px;
  border-radius: 10px;
  background: #f4f9f7;
}

.review-inbox-stats span {
  display: block;
  color: #5b7771;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-inbox-stats strong {
  display: block;
  margin-top: 4px;
  color: #183430;
  font-size: 15px;
}

.review-inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@keyframes reviewFieldPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.28);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
  }
}

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

.human-review-checklist {
  display: grid;
  gap: 8px;
}

.human-review-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #d6e4df;
  border-radius: 8px;
  background: #fbfdfc;
}

.human-review-checklist input[type="checkbox"] {
  margin-top: 2px;
}

.human-review-checklist span {
  color: #24433f;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.human-review-actions {
  flex-wrap: wrap;
}

.human-review-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.human-review-badge,
.human-review-warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.human-review-badge {
  border: 1px solid #9cc9be;
  background: #e8f6f1;
  color: #115e59;
}

.human-review-warning {
  border: 1px solid #f2c889;
  background: #fff7e8;
  color: #9a5b00;
}

.human-review-panel {
  border: 1px solid #dce8e4;
  border-left: 4px solid #115e59;
  border-radius: 10px;
  background: #f8fbfa;
  padding: 12px 14px;
}

.human-review-panel p {
  margin: 6px 0 0;
}

@media (max-width: 1080px) {
  .review-inbox-item {
    grid-template-columns: 1fr;
  }

  .review-inbox-actions {
    justify-content: flex-start;
  }
}

.review-assistant-panel {
  border-color: #7bb8aa;
  background: linear-gradient(180deg, #ecfdf7, #ffffff 130px);
}

#adminReviewAssistantPanel {
  display: grid;
  gap: 12px;
}

.review-assistant-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.review-assistant-progress div,
.review-assistant-card,
.review-assistant-context {
  padding: 9px 10px;
  border: 1px solid #d4e6e0;
  border-radius: 8px;
  background: #fff;
}

.review-assistant-progress span,
.review-assistant-context span {
  display: block;
  color: #53706c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-assistant-progress strong,
.review-assistant-context strong {
  display: block;
  margin-top: 4px;
  color: #103a35;
  font-size: 13px;
}

.review-assistant-card h4 {
  margin: 0;
  color: #115e59;
  font-size: 16px;
}

.review-assistant-card p {
  margin: 8px 0 0;
}

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

.review-assistant-actions button {
  flex: 1 1 120px;
}

.review-assistant-helper {
  color: #46625d;
  font-size: 12px;
}
.external-intelligence {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(77, 190, 177, .35);
  border-left: 4px solid #4dbeb1;
  border-radius: 12px;
  background: rgba(22, 57, 66, .45);
}

.external-intelligence-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.external-intelligence h3 {
  margin: .15rem 0 0;
}

.analysis-eyebrow {
  color: #79d8ca;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.external-intelligence-link {
  flex: 0 0 auto;
  color: #9de9df;
  font-weight: 700;
  text-decoration: underline;
}

.external-intelligence-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.external-intelligence-prompts span {
  padding: .35rem .55rem;
  border-radius: 999px;
  background: rgba(77, 190, 177, .14);
  color: #c8f2ed;
  font-size: .8rem;
}

@media (max-width: 640px) {
  .external-intelligence-heading {
    flex-direction: column;
  }
}
