:root {
  --bg: #0d0f0e;
  --panel: #131614;
  --panel-2: #1a1e1b;
  --line: #303531;
  --text: #f2f2ed;
  --muted: #949b96;
  --soft: #69716c;
  --green: #4ac58b;
  --yellow: #e4bd60;
  --red: #ec7168;
  --blue: #72a7ec;
  --accent: #d4f257;
  --radius: 4px;
  --page-gutter: clamp(14px, 3vw, 56px);
  --chrome-gutter: clamp(14px, 1.25vw, 24px);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, select {
  font: inherit;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.wrap {
  width: calc(100% - (2 * var(--page-gutter)));
  margin: 0 auto;
}

.topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}
.topbar-inner {
  position: relative;
  width: 100%;
}

.site-logo {
  position: absolute;
  top: 18px;
  left: var(--chrome-gutter);
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid #303631;
  border-radius: 6px;
  background: #101310;
  overflow: hidden;
  pointer-events: auto;
}

.site-logo:hover { border-color: #647329; }
.site-logo img { display: block; width: 100%; height: 100%; }

.hard-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hard-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--soft);
  font-size: 12px;
}
.hard-filters select {
  min-width: 96px;
  padding: 4px 8px;
  font-size: 12px;
}
.search {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}
.search:focus { outline: 1px solid #3b4a5e; }

.main { padding: 18px 0 48px; }
.topbar + .main { padding-top: 72px; }

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 14px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.card:hover {
  border-color: #3b4656;
  background: #1a1e25;
}
.card-main { min-width: 0; }
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.consider { color: #8fd8ad; border-color: #2f5d45; background: #14251c; }
.badge.caution { color: #e2c27a; border-color: #6a5524; background: #261f10; }
.badge.risk { color: #e2a0a0; border-color: #6a3333; background: #271616; }

.one-liner {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.trait {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: #c5ced9;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.metric {
  background: #14181e;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
}
.metric .k {
  display: block;
  color: var(--soft);
  font-size: 11px;
  margin-bottom: 2px;
}
.metric .v {
  display: block;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 88px;
}
.card-side .go {
  font-size: 12px;
  color: var(--blue);
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* detail */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.back:hover { color: var(--text); }

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.detail-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
}
.detail-head .sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--soft);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.redlines {
  margin: 0;
  padding-left: 18px;
}
.redlines li { margin: 0 0 6px; font-size: 14px; }

.fold summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.fold[open] summary { margin-bottom: 10px; }
.notes {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* generic firm fallback */
.redline-panel { border-left: 3px solid #a84f4f; }

/* trader-facing account rules */
.trader-ruleset {
  margin: 20px 0 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ruleset-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ruleset-heading h2 {
  margin: 0;
  font-size: 20px;
}

.ruleset-date {
  display: grid;
  gap: 2px;
  min-width: 104px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15191d;
}

.ruleset-date span {
  color: var(--soft);
  font-size: 9px;
}

.ruleset-date time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 8px;
}

.quick-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171a1f;
}

.quick-fact span {
  color: var(--soft);
  font-size: 10px;
}

.quick-fact strong { font-size: 13px; }
.quick-fact.tone-positive { border-left: 2px solid #4d9a70; }
.quick-fact.tone-caution { border-left: 2px solid #ad8534; }
.quick-fact.tone-critical { border-left: 2px solid #ad5656; }
.quick-fact.tone-neutral { border-left: 2px solid #58697d; }

.ruleset-notice {
  margin: 0;
  color: var(--soft);
  font-size: 10px;
}

.plan-picker {
  display: grid;
  grid-template-columns: repeat(var(--plan-cols, 4), minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.plan-choice {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 3px;
  min-width: 0;
  min-height: 78px;
  padding: 10px;
  border-radius: 6px;
  background: #171a1f;
  text-align: left;
  cursor: pointer;
}

.plan-choice:hover { border-color: #566477; }

.plan-choice[aria-selected="true"] {
  border-color: #668bb3;
  background: #1c242d;
  box-shadow: inset 0 -3px #6ea0d8;
}

.plan-choice span {
  color: #7fa9d5;
  font-size: 9px;
}

.plan-choice strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.plan-choice small {
  color: var(--muted);
  font-size: 9px;
}

.plan-choice:focus-visible,
.rules-matrix-wrap:focus-visible,
.plan-source-links a:focus-visible,
.official-source-list a:focus-visible {
  outline: 2px solid #7baadd;
  outline-offset: 2px;
}

.plan-panel {
  padding-top: 18px;
}

.plan-panel[hidden] { display: none; }

.plan-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.plan-name-row h3 {
  margin: 0;
  font-size: 18px;
}

.access-badge {
  padding: 2px 7px;
  border: 1px solid #465669;
  border-radius: 999px;
  background: #19212a;
  color: #b8c7d9;
  font-size: 9px;
}

.plan-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.plan-source-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.plan-source-links a {
  padding: 3px 6px;
  border: 1px solid #315e46;
  border-radius: 4px;
  color: #8ecaa7;
  font-size: 9px;
}

.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.plan-tag {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
}

.plan-tag.tone-positive { color: #91d4ae; border-color: #315e46; background: #16251d; }
.plan-tag.tone-caution { color: #dfbf75; border-color: #695525; background: #261f11; }
.plan-tag.tone-critical { color: #dfa0a0; border-color: #693535; background: #271818; }
.plan-tag.tone-neutral { color: #b8c7d9; border-color: #465669; background: #19212a; }

.rules-matrix-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  scrollbar-color: #495463 #171a1f;
}

.rules-matrix {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.rules-matrix th,
.rules-matrix td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.rules-matrix tr > :last-child { border-right: 0; }
.rules-matrix tbody:last-child tr:last-child > * { border-bottom: 0; }

.rules-matrix thead th {
  background: #12161b;
  color: #d1d8e1;
  font-size: 11px;
  text-align: left;
}

.rules-matrix thead th:first-child,
.rules-matrix tbody th[scope="row"] {
  width: 170px;
}

.rules-platform-summary th,
.rules-platform-summary td {
  background: #17202a;
}

.rules-platform-summary td {
  color: #b9cce0;
  font-size: 11px;
}

.rules-matrix tbody th[scope="row"] {
  background: #15191e;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  text-align: left;
}

.rules-group th {
  padding: 7px 10px;
  background: #20262d;
  color: #d6dce4;
  font-size: 10px;
  font-weight: 650;
  text-align: left;
}

.rules-matrix tr.tone-positive > th:first-child { box-shadow: inset 3px 0 #438563; }
.rules-matrix tr.tone-caution > th:first-child { box-shadow: inset 3px 0 #a17c32; }
.rules-matrix tr.tone-critical > th:first-child { box-shadow: inset 3px 0 #a64e4e; }

.rules-note th,
.rules-note td {
  padding-top: 5px;
  padding-bottom: 6px;
  background: #13171c;
  color: var(--soft);
  font-size: 9px;
}

.rule-value-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px dotted #718095;
  color: #edf3fa;
  cursor: help;
  font-weight: 650;
  outline: none;
}

.rule-value-with-tip:hover { border-bottom-color: #9fc2e7; }

.rule-value-with-tip:focus-visible {
  border-radius: 3px;
  outline: 2px solid #7baadd;
  outline-offset: 3px;
}

.rule-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid #53657a;
  border-radius: 50%;
  color: #9fc2e7;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.floating-tooltip {
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid #52657a;
  border-radius: 6px;
  background: #20262e;
  box-shadow: 0 10px 28px #000a;
  color: #dce4ed;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
}

.floating-tooltip[hidden] { display: none; }

.plan-alerts {
  margin-top: 13px;
}

.plan-alerts h4 {
  margin: 0 0 7px;
  color: var(--soft);
  font-size: 10px;
}

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

.rule-alert {
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171a1f;
}

.rule-alert.tone-critical { border-left: 3px solid #ad5656; }
.rule-alert.tone-caution { border-left: 3px solid #ad8534; }
.rule-alert.tone-positive { border-left: 3px solid #4d9a70; }
.rule-alert.tone-neutral { border-left: 3px solid #58697d; }

.rule-alert strong { font-size: 11px; }

.rule-alert p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.shared-rules {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rules-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.rules-section-heading h3 {
  margin: 0;
  font-size: 14px;
}

.rules-section-heading span {
  color: var(--soft);
  font-size: 9px;
}

.platform-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.platform-group {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171a1f;
}

.platform-group > strong {
  color: #8fb7df;
  font-size: 11px;
}

.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.platform-list span {
  padding: 2px 5px;
  border: 1px solid #343d49;
  border-radius: 4px;
  color: #c2cad4;
  font-size: 9px;
}

.common-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.common-rule {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  min-height: 98px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171a1f;
}

.common-rule.tone-positive { border-top: 2px solid #4d9a70; }
.common-rule.tone-caution { border-top: 2px solid #ad8534; }
.common-rule.tone-critical { border-top: 2px solid #ad5656; }
.common-rule.tone-neutral { border-top: 2px solid #58697d; }

.common-rule > span {
  color: var(--soft);
  font-size: 9px;
}

.common-rule strong {
  margin-top: 2px;
  font-size: 11px;
}

.common-rule p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.ruleset-sources {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15181d;
}

.ruleset-sources summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 11px;
  color: #c5ced8;
  font-size: 11px;
  cursor: pointer;
}

.ruleset-sources summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 19px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.official-source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  padding: 0 11px 10px;
}

.official-source-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.official-source-list a:hover span { color: #a8c9ed; }

.official-source-list span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-source-list time {
  flex: 0 0 auto;
  color: var(--soft);
  font-size: 8px;
}

.ruleset-load-error {
  margin: 16px 0;
  padding: 10px 12px;
  border: 1px solid #643838;
  border-radius: 6px;
  background: #251717;
  color: #e0a2a2;
  font-size: 12px;
}

@media (max-width: 760px) {
  .card {
    grid-template-columns: 1fr;
  }
  .card-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-head {
    flex-direction: column;
  }
  .plan-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .quick-facts,
  .common-rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-choice { min-height: 68px; }
  .plan-source-links { justify-content: flex-start; }
  .alert-grid,
  .platform-groups,
  .official-source-list {
    grid-template-columns: 1fr;
  }
  .rule-alert { min-height: 0; }
}

@media (max-width: 480px) {
  body[data-page="detail"] .main { padding-top: 12px; }
  body[data-page="detail"] .back { margin-bottom: 10px; }
  .ruleset-detail-head {
    gap: 10px;
    margin-bottom: 8px;
  }
  .ruleset-detail-head h1 { font-size: 21px; }
  .ruleset-detail-head .sub { font-size: 12px; }
  .ruleset-detail-head .traits { display: none; }
  .trader-ruleset {
    margin-top: 14px;
    padding-top: 14px;
  }
  .ruleset-heading {
    align-items: flex-start;
    gap: 8px;
  }
  .ruleset-heading h2 { font-size: 18px; }
  .ruleset-date {
    min-width: 88px;
    padding: 6px 8px;
  }
  .plan-picker {
    gap: 4px;
    margin-top: 12px;
  }
  .plan-choice {
    min-height: 60px;
    padding: 6px;
  }
  .plan-choice strong { font-size: 11px; }
  .plan-choice span { font-size: 8px; }
  .plan-choice small { display: none; }
  .plan-panel { padding-top: 8px; }
  .plan-panel-head { display: none; }
  .plan-tags { margin: 0 0 8px; }
  .plan-tag { padding: 2px 5px; font-size: 8px; }
  .quick-fact { min-height: 38px; padding: 7px 8px; }
  .platform-group { grid-template-columns: 52px minmax(0, 1fr); }
}

/* Decision-first rules workspace */
body[data-page="detail"] .main {
  padding-top: 76px;
}

.ruleset-detail-head {
  align-items: center;
  margin-bottom: 0;
  padding: 10px 0 34px;
  animation: detail-head-enter .42s ease both;
}

.firm-detail-brand {
  display: flex;
  align-items: center;
  gap: 19px;
  min-width: 0;
}

.firm-detail-logo {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
}

.ruleset-detail-head .firm-detail-logo img {
  width: 80%;
  height: 80%;
}

.firm-detail-copy { min-width: 0; }

@keyframes detail-head-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ruleset-detail-head h1 {
  margin-bottom: 7px;
  font-size: 42px;
  line-height: 1.1;
}

.ruleset-detail-head .sub {
  max-width: 980px;
  color: #a6aea9;
  font-size: 16px;
  line-height: 1.55;
}

.ruleset-detail-head .traits {
  align-items: center;
  gap: 0;
  margin-top: 12px !important;
  margin-bottom: 0;
}

.ruleset-detail-head .badge,
.ruleset-detail-head .trait {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
}

.ruleset-detail-head .badge { color: var(--accent); }
.ruleset-detail-head .trait { color: var(--muted); }

.ruleset-detail-head .traits > * + *::before {
  content: "·";
  margin: 0 9px;
  color: #4b534e;
}

.trader-ruleset {
  margin: 0 0 42px;
  padding: 0;
  border-top: 1px solid var(--line);
  animation: rules-workspace-enter .5s .06s ease both;
}

@keyframes rules-workspace-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rules-workspace {
  display: grid;
  grid-template-columns: clamp(255px, 16vw, 310px) minmax(0, 1fr);
  background: #0b0d0c;
}

.rules-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 24px;
  background: #111411;
  scrollbar-color: #3a413c #111411;
}

.rules-control-block + .rules-control-block {
  margin-top: 34px;
}

.rules-control-label {
  display: block;
  margin-bottom: 9px;
  color: #6f7872;
  font-size: 11px;
  text-transform: uppercase;
}

.rules-plan-nav {
  display: grid;
}

.rules-plan-button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 14px 10px;
  border: 0;
  border-top: 1px solid #2c322e;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.rules-plan-button strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.rules-plan-button span {
  color: #7b8780;
  font-size: 12px;
  line-height: 1.5;
}

.rules-plan-button[aria-pressed="true"] {
  background: #192018;
}

.rules-plan-button[aria-pressed="true"] strong {
  color: var(--accent);
}

.rules-plan-button:hover,
.rules-plan-button:focus-visible {
  background: #171c17;
  outline: 0;
}

.rules-account-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.rules-account-button {
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid #343b36;
  border-radius: 2px;
  background: transparent;
  color: #9aa49e;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.rules-account-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: #1a2113;
  color: #f2f5e8;
}

.rules-account-button:hover,
.rules-account-button:focus-visible {
  border-color: #748038;
  color: #ffffff;
  outline: 0;
}

.rules-plan-context {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid #2c322e;
}

.rules-plan-context span {
  color: #6f7872;
  font-size: 11px;
}

.rules-plan-context p {
  margin: 7px 0 0;
  color: #aab2ad;
  font-size: 14px;
  line-height: 1.7;
}

.rules-reading {
  min-width: 0;
  padding: 0 clamp(34px, 3.3vw, 64px) 60px;
  animation: rules-reading-enter .36s ease both;
}

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

.rules-account-focus {
  padding: 48px 0 44px;
  border-bottom: 1px solid var(--line);
}

.rules-focus-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.rules-focus-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.rules-focus-heading h2 {
  max-width: 780px;
  margin: 0;
  color: var(--accent);
  font-size: 44px;
  line-height: 1.15;
}

.rules-focus-heading h2.long-value {
  font-size: 27px;
  line-height: 1.3;
}

.rules-focus-heading h2 .rule-value-with-tip {
  color: inherit;
  font-weight: 760;
}

.rules-focus-heading h2 .rule-info {
  border-color: #82942f;
  color: var(--accent);
}

.rules-access-label {
  padding-top: 6px;
  color: var(--green);
  font-size: 12px;
}

.rules-price-detail {
  max-width: 760px;
  margin: 9px 0 27px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.rules-focus-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rules-focus-stat {
  min-width: 0;
  padding: 19px 20px 20px 0;
}

.rules-focus-stat + .rules-focus-stat {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.rules-focus-stat > span {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 12px;
}

.rules-focus-stat strong {
  display: block;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.rules-focus-stat.tone-critical strong { color: var(--red); }
.rules-focus-stat.tone-caution strong { color: var(--yellow); }
.rules-focus-stat.tone-positive strong { color: var(--green); }

.rules-tradeoff {
  max-width: 900px;
  margin: 22px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--red);
  color: #c5cac6;
  font-size: 14px;
  line-height: 1.7;
}

.rules-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 23vw, 430px);
  gap: clamp(52px, 3.8vw, 72px);
  padding: 58px 0 60px;
}

.rules-section-title {
  margin-bottom: 28px;
}

.rules-section-title h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.rules-phase-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(36px, 3vw, 56px);
}

.rules-phase header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rules-phase header span {
  color: var(--soft);
  font-size: 11px;
}

.rules-phase h3 {
  margin: 0;
  font-size: 17px;
}

.rules-phase dl { margin: 0; }

.rules-definition-row {
  display: grid;
  grid-template-columns: minmax(108px, .8fr) minmax(0, 1.2fr);
  gap: 10px 18px;
  padding: 14px 0;
  border-bottom: 1px solid #252a27;
  transition: background .16s ease;
}

.rules-definition-row:hover { background: #101411; }

.rules-definition-row dt {
  color: var(--muted);
  font-size: 13px;
}

.rules-definition-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.rules-definition-row p {
  grid-column: 2;
  margin: -3px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.65;
}

.rules-definition-row.tone-critical dd { color: var(--red); }
.rules-definition-row.tone-caution dd { color: var(--yellow); }
.rules-definition-row.tone-positive dd { color: var(--green); }

.rules-watchlist {
  align-self: start;
}

.rules-watchlist ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule-watch;
}

.rules-watch-item {
  position: relative;
  padding: 18px 0 20px 38px;
  border-top: 1px solid var(--line);
  counter-increment: rule-watch;
}

.rules-watch-item::before {
  content: counter(rule-watch, decimal-leading-zero);
  position: absolute;
  top: 19px;
  left: 0;
  color: var(--red);
  font-size: 11px;
}

.rules-watch-item strong { font-size: 14px; }
.rules-watch-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.rules-shared-watch {
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.rules-shared-watch > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
}

.rules-shared-watch > div span {
  color: var(--muted);
  text-align: right;
}

.rules-shared {
  padding: 52px 0 56px;
  border-top: 1px solid var(--line);
}

.rules-platform-rows {
  border-top: 1px solid var(--line);
}

.rules-platform-rows > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 22px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.rules-platform-rows strong { color: var(--blue); font-size: 13px; }
.rules-platform-rows p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.rules-common-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 0 42px;
  margin-top: 30px;
}

.rules-common-list > div {
  display: grid;
  grid-template-columns: 100px 150px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.rules-common-list span { color: var(--muted); font-size: 12px; }
.rules-common-list strong { font-size: 13px; }
.rules-common-list p {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.65;
}
.rules-common-list .tone-critical strong { color: var(--red); }
.rules-common-list .tone-caution strong { color: var(--yellow); }
.rules-common-list .tone-positive strong { color: var(--green); }

.rules-money {
  padding: 52px 0 56px;
  border-top: 1px solid var(--line);
}

.rules-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(38px, 4vw, 72px);
}

.rules-money-column {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.rules-money-column h3 {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.rules-money-list { margin: 0; }

.rules-money-row {
  display: grid;
  grid-template-columns: minmax(100px, .55fr) minmax(0, 1.45fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid #252a27;
}

.rules-money-row dt {
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
}

.rules-money-row dd {
  min-width: 0;
  margin: 0;
  color: #b4bcb7;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.rules-source-drawer {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rules-source-drawer summary {
  padding: 17px 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.rules-source-drawer > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  padding-bottom: 13px;
}

.rules-source-drawer a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.rules-source-drawer time { color: var(--soft); font-size: 12px; }

body[data-page="detail"] #detail-root > .panel.fold {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

body[data-page="detail"] #detail-root > .panel.fold:last-child {
  border-bottom: 1px solid var(--line);
}

body[data-page="detail"] #detail-root > .panel.fold summary {
  margin: 0;
  padding: 17px 0;
  font-size: 13px;
}

body[data-page="detail"] #detail-root > .panel.fold .notes {
  padding-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
}

.ruleset-faq {
  margin-top: 0;
  padding: 52px 0 56px;
  border-top: 1px solid var(--line);
}

.ruleset-faq-heading {
  margin-bottom: 22px;
}

.ruleset-faq-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
}

.ruleset-faq-heading h2 {
  margin: 0;
  font-size: 28px;
}

.ruleset-faq-list {
  max-width: 1180px;
  border-top: 1px solid var(--line);
}

.ruleset-faq-list details {
  border-bottom: 1px solid var(--line);
}

.ruleset-faq-list summary {
  position: relative;
  padding: 20px 48px 20px 0;
  color: #d8ddd9;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.ruleset-faq-list summary::-webkit-details-marker { display: none; }
.ruleset-faq-list summary::marker { content: ""; }

.ruleset-faq-list summary:hover { color: #ffffff; }

.ruleset-faq-list summary:focus-visible {
  outline: 1px solid #66703d;
  outline-offset: -1px;
}

.ruleset-faq-list summary::after {
  content: "+";
  position: absolute;
  top: 14px;
  right: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}

.ruleset-faq-list details[open] summary::after { content: "-"; }

.ruleset-faq-list details[open] p {
  animation: faq-answer-enter .2s ease both;
}

@keyframes faq-answer-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ruleset-faq-list p {
  max-width: 980px;
  margin: -2px 0 19px;
  color: #aeb6b1;
  font-size: 15px;
  line-height: 1.8;
}

.floating-tooltip {
  border-color: #66703d;
  border-radius: 3px;
  background: #1b201a;
  color: #eef2e9;
}

@media (max-width: 1180px) {
  .rules-content-layout {
    grid-template-columns: 1fr;
  }
  .rules-common-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body[data-page="detail"] .main { padding-top: 64px; }
  .ruleset-detail-head { padding-bottom: 22px; }
  .firm-detail-brand { align-items: flex-start; gap: 13px; }
  .firm-detail-logo { width: 50px; height: 50px; }
  .ruleset-detail-head h1 { font-size: 29px; }
  .ruleset-detail-head .sub { font-size: 14px; }
  .ruleset-detail-head .traits { display: flex; }
  .ruleset-detail-head .trait:nth-of-type(n+4) { display: none; }
  .rules-workspace { display: block; margin: 0 -14px; }
  .rules-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 20px 14px;
  }
  .rules-plan-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rules-plan-button {
    border-top: 0;
    border-left: 1px solid #2c322e;
  }
  .rules-plan-button[aria-pressed="true"] {
    background: #192018;
  }
  .rules-account-nav {
    display: flex;
    flex-wrap: wrap;
  }
  .rules-account-button { min-width: 50px; }
  .rules-plan-context { display: none; }
  .rules-reading { padding: 0 14px 38px; }
  .rules-account-focus { padding: 32px 0 30px; }
  .rules-focus-heading h2 { font-size: 34px; }
  .rules-focus-heading h2.long-value { font-size: 21px; }
  .rules-focus-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-focus-stat:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .rules-focus-stat:nth-child(4) { border-top: 1px solid var(--line); }
  .rules-content-layout { padding: 38px 0 42px; }
  .rules-section-title h2 { font-size: 24px; }
  .rules-phase-columns { grid-template-columns: 1fr; gap: 40px; }
  .rules-platform-rows > div { grid-template-columns: 90px minmax(0, 1fr); }
  .rules-common-list > div { grid-template-columns: 90px minmax(0, 1fr); gap: 9px 14px; }
  .rules-common-list p { grid-column: 1 / -1; }
  .rules-money-grid { grid-template-columns: 1fr; gap: 34px; }
  .rules-money-row { grid-template-columns: 105px minmax(0, 1fr); gap: 14px; }
  .rules-money-row dt,
  .rules-money-row dd { font-size: 13px; }
  .rules-source-drawer > div { grid-template-columns: 1fr; }
  .ruleset-faq { margin-top: 0; padding: 34px 0 40px; }
  .ruleset-faq-heading h2 { font-size: 22px; }
  .ruleset-faq-list summary { padding-top: 16px; padding-bottom: 16px; font-size: 14px; }
  .ruleset-faq-list p { font-size: 14px; }
}

/* Directory workspace */
.directory-shell {
  display: grid;
  grid-template-columns: clamp(210px, 15vw, 260px) minmax(0, 1fr);
  gap: clamp(32px, 3vw, 64px);
  padding-top: 28px;
}

.directory-sidebar {
  min-width: 0;
}

.directory-sidebar-inner {
  position: sticky;
  top: 82px;
  z-index: 10;
  overflow: visible;
  border-top: 1px solid #56604f;
  background: #101310;
}

.filter-title {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 18px 21px;
  border-bottom: 1px solid #2d342f;
  background: #121612;
}

.filter-title::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 52px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.filter-title-copy {
  display: grid;
  gap: 5px;
}

.filter-title-copy > span,
.directory-heading > div > span {
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
}

.filter-title-copy strong {
  font-size: 22px;
  font-weight: 650;
}

.filter-status {
  min-width: 42px;
  padding: 5px 7px;
  border: 1px solid #3a433b;
  border-radius: 2px;
  color: #b8c0ba;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.filter-status.is-active {
  border-color: #6f7e34;
  background: #1a2113;
  color: var(--accent);
}

.search-field {
  display: grid;
  color: var(--muted);
}

.search-field {
  gap: 10px;
  padding: 19px 18px 20px;
  border-bottom: 1px solid #2d342f;
}

.filter-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.search-control {
  position: relative;
  display: block;
}

.search-control > svg {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: #69736c;
  transform: translateY(-50%);
  pointer-events: none;
}

body[data-page="list"] .search {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 9px 11px 9px 36px;
  border: 1px solid #353d37;
  border-radius: 3px;
  background: #0b0e0c;
  color: var(--text);
  font-size: 13px;
}

body[data-page="list"] .search:focus {
  border-color: #778445;
  box-shadow: 0 0 0 2px rgb(212 242 87 / 10%);
  outline: 0;
}

.search-field.is-active .filter-field-heading > span,
.filter-row.is-active > span:first-child {
  color: var(--accent);
}

.filter-section {
  padding: 0 18px;
}

body[data-page="list"] .hard-filters {
  display: grid;
  align-items: stretch;
  gap: 0;
}

.filter-row {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-height: 56px;
  border-top: 1px solid #2d342f;
  color: var(--muted);
  font-size: 11px;
}

.filter-menu {
  position: relative;
  min-width: 0;
}

.filter-menu-trigger {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 11px 20px 11px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d9ddd9;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
}

.filter-menu-trigger::after {
  position: absolute;
  top: 50%;
  right: 2px;
  width: 0;
  height: 0;
  border-top: 5px solid #8c968f;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  transform: translateY(-35%);
  transition: transform .16s ease, border-top-color .16s ease;
  pointer-events: none;
}

.filter-menu.is-open .filter-menu-trigger::after {
  border-top-color: var(--accent);
  transform: translateY(-65%) rotate(180deg);
}

.filter-menu-trigger:hover,
.filter-menu-trigger:focus-visible,
.filter-menu.is-open .filter-menu-trigger {
  color: var(--accent);
}

.filter-menu-trigger:focus-visible {
  box-shadow: inset 0 -1px var(--accent);
  outline: 0;
}

.filter-menu-options {
  position: absolute;
  top: calc(100% + 5px);
  right: -8px;
  z-index: 60;
  width: max(100%, 204px);
  max-height: min(286px, 52vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #465049;
  border-radius: 4px;
  background: #171b18;
  box-shadow: 0 16px 38px rgb(0 0 0 / 42%);
  color-scheme: dark;
  scrollbar-color: #566159 #171b18;
}

.filter-menu-options[hidden] { display: none; }

.filter-menu-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #c7cec9;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.filter-menu-option:hover,
.filter-menu-option:focus-visible {
  background: #242a25;
  color: #ffffff;
  outline: 0;
}

.filter-menu-option[aria-selected="true"] {
  color: var(--accent);
}

.filter-option-mark {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid #59625c;
  border-radius: 2px;
  background: #0d100e;
}

.filter-menu-option[aria-selected="true"] .filter-option-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.filter-menu-option[aria-selected="true"] .filter-option-mark::after {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 5px;
  height: 3px;
  border-bottom: 2px solid #11140f;
  border-left: 2px solid #11140f;
  content: "";
  transform: rotate(-45deg);
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding: 15px 18px 16px;
  border-top: 1px solid #303732;
  background: #121612;
}

.filter-footer > output {
  color: var(--soft);
  font-size: 10px;
}

.clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b0b7b2;
  font-size: 11px;
  cursor: pointer;
}

.clear-filters svg {
  width: 13px;
  height: 13px;
}

.clear-filters:hover:not(:disabled),
.clear-filters:focus-visible { color: var(--accent); }

.clear-filters:focus-visible {
  outline: 1px solid #69762d;
  outline-offset: 3px;
}

.clear-filters:disabled {
  color: #545b56;
  cursor: default;
}

.directory-content {
  min-width: 0;
}

.directory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0 32px;
  border-bottom: 1px solid var(--line);
}

.directory-heading h1 {
  margin: 7px 0 0;
  font-size: 32px;
}

.directory-heading > strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.directory-list {
  margin: 0 -20px;
}

.firm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 32px;
  padding: 30px 20px 29px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease;
}

.firm-row.enters {
  animation: firm-row-enter .42s ease both;
  animation-delay: calc(var(--row-index, 0) * 34ms);
}

.firm-row:hover {
  background: #111411;
}

.firm-row:hover .firm-logo-frame { border-color: #788638; }

.firm-row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.firm-row-main {
  min-width: 0;
}

.firm-row-head {
  display: grid;
  grid-template-columns: 48px minmax(340px, 1.15fr) minmax(360px, .85fr);
  gap: 24px;
  align-items: start;
}

.firm-logo-frame,
.firm-detail-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #343b36;
  border-radius: 6px;
  background: #0a0d0b;
}

.firm-logo-frame {
  width: 48px;
  height: 48px;
  transition: border-color .16s ease, transform .16s ease;
}

.firm-logo-frame img,
.firm-detail-logo img {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.firm-logo-elitetraderfunding img { transform: scale(2.1); }

.firm-row:hover .firm-logo-frame { transform: translateY(-2px); }

@keyframes firm-row-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.firm-name-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.firm-identity h2 {
  margin: 0;
  font-size: 23px;
}

.firm-signal {
  color: var(--muted);
  font-size: 10px;
}

.firm-signal.consider { color: var(--green); }
.firm-signal.caution { color: var(--yellow); }
.firm-signal.risk { color: var(--red); }

.firm-row .one-liner {
  margin: 7px 0 0;
  color: #a5ada8;
  font-size: 14px;
}

.firm-row-meta {
  display: grid;
  gap: 8px;
  padding-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.firm-row-meta time {
  color: var(--soft);
  font-size: 10px;
}

.firm-scan {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0 0 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.firm-scan-item {
  min-width: 0;
  padding: 15px 18px 16px 0;
}

.firm-scan-item + .firm-scan-item {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.firm-scan-item .k {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 11px;
}

.firm-scan-item .v {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.firm-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.firm-row-actions .go {
  color: var(--accent);
  font-size: 12px;
}

@media (max-width: 1240px) {
  .directory-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
  .filter-menu-options {
    right: auto;
    left: -58px;
  }
  .firm-row-head { grid-template-columns: 44px minmax(0, 1fr); }
  .firm-logo-frame { width: 44px; height: 44px; }
  .firm-row-meta { grid-column: 2; }
  .firm-row-meta > span { display: none; }
}

@media (max-width: 760px) {
  body[data-page="list"] .main { padding-top: 64px; }
  .directory-shell {
    display: block;
    padding-top: 14px;
  }
  .directory-sidebar-inner {
    position: static;
    margin: 0 -14px;
    overflow: visible;
  }
  .filter-title { padding: 18px 14px 17px; }
  .filter-title-copy strong { font-size: 20px; }
  .search-field { padding: 16px 14px 18px; }
  .filter-section { padding: 14px 14px 0; }
  body[data-page="list"] .hard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }
  .filter-row:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .filter-row.is-open { z-index: 70; }
  .filter-row:first-child .filter-menu-options {
    right: auto;
    left: -58px;
  }
  .filter-row:nth-child(3) .filter-menu-options {
    right: -8px;
    left: auto;
  }
  .filter-footer { padding: 14px; }
  .directory-heading { padding: 28px 0 20px; }
  .directory-heading h1 { font-size: 24px; }
  .directory-list { margin: 0 -14px; }
  .firm-row {
    display: block;
    padding: 24px 14px 23px;
  }
  .firm-row-head {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
  }
  .firm-logo-frame { width: 42px; height: 42px; }
  .firm-identity h2 { font-size: 20px; }
  .firm-row-meta { grid-column: 2; }
  .firm-scan {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 18px 0 0 54px;
  }
  .firm-scan-item:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .firm-scan-item:nth-child(4) { border-top: 1px solid var(--line); }
  .firm-row-actions {
    flex-direction: row;
    align-items: center;
    margin: 16px 0 0 54px;
  }
}

/* Current promotions */
.firm-promotion {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
}

.firm-promotion > span {
  min-width: 0;
  overflow: hidden;
  color: #c9d0cb;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promotion-code-button {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  padding: 10px 12px;
  border: 1px solid #71812f;
  border-radius: 2px;
  background: #1a2113;
  color: var(--text);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}

.promotion-code-button:hover,
.promotion-code-button:focus-visible {
  border-color: var(--accent);
  background: #222c16;
  outline: 0;
}

.promotion-code-button.copied {
  border-color: var(--green);
  background: #14251c;
}

.promotion-code-button.no-code {
  cursor: default;
}

.promotion-code-label {
  color: #8f9a92;
  font-size: 9px;
}

.promotion-code-button code {
  color: var(--accent);
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.promotion-code-button.detail .promotion-code-label { font-size: 11px; }
.promotion-code-button.detail code { font-size: 20px; }
.promotion-code-button.detail .promotion-copy-status { font-size: 11px; }

.promotion-copy-status {
  color: #aab4ad;
  font-size: 10px;
  text-align: right;
}

.promotion-code-button.copied .promotion-copy-status {
  color: var(--green);
}

.promotion-code-button.compact {
  gap: 7px;
  min-width: 0;
  padding: 5px 8px;
}

.promotion-code-button.compact code {
  font-size: 13px;
}

.promotion-code-button.compact .promotion-copy-status {
  font-size: 9px;
}

.promotion-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 4vw, 72px);
  padding: 23px clamp(20px, 2.1vw, 40px);
  border-top: 1px solid #3f4826;
  border-bottom: 1px solid #3f4826;
  background: #11150e;
  box-shadow: inset 3px 0 var(--accent);
}

.promotion-banner-copy > span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
}

.promotion-banner-copy h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}

.promotion-banner-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.promotion-banner-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px 16px;
}

.promotion-banner-actions .promotion-code-button {
  grid-column: 1 / -1;
}

.promotion-checkout-link,
.promotion-source-link {
  font-size: 12px;
}

.promotion-checkout-link {
  color: var(--accent);
}

.promotion-source-link {
  color: var(--muted);
  text-align: right;
}

.promotion-checkout-link:hover,
.promotion-source-link:hover {
  color: var(--text);
}

.promotion-banner + .trader-ruleset {
  border-top: 0;
}

@media (max-width: 760px) {
  .firm-promotion {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .firm-promotion > span {
    max-width: 100%;
  }

  .promotion-banner {
    grid-template-columns: 1fr;
    gap: 19px;
    margin: 0 -14px;
    padding: 20px 14px 22px;
  }

  .promotion-banner-copy h2 {
    font-size: 21px;
  }

  .promotion-banner-actions {
    justify-content: start;
  }

  .promotion-code-button.detail {
    min-width: min(100%, 290px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ruleset-detail-head,
  .trader-ruleset,
  .rules-reading,
  .firm-row.enters,
  .ruleset-faq-list details[open] p {
    animation: none;
  }

  .firm-logo-frame,
  .filter-menu-trigger::after,
  .rules-plan-button,
  .rules-account-button,
  .rules-definition-row {
    transition: none;
  }
}
