:root {
  --bg: #080a0d;
  --bg-elevated: #0b0e12;
  --surface: #0f1217;
  --surface-2: #15191f;
  --surface-3: #1b2028;
  --surface-4: #222832;

  --line: #282e37;
  --line-strong: #3a424e;
  --line-soft: rgba(255, 255, 255, 0.07);

  --text: #f5f2e9;
  --text-soft: #d7d8d4;
  --muted: #9aa2ad;
  --muted-2: #6f7884;

  --yes: #41d392;
  --yes-soft: rgba(65, 211, 146, 0.11);
  --yes-border: rgba(65, 211, 146, 0.3);

  --no: #ff6b6b;
  --no-soft: rgba(255, 107, 107, 0.11);
  --no-border: rgba(255, 107, 107, 0.3);

  --warning: #e7b95e;
  --warning-soft: rgba(231, 185, 94, 0.11);

  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.24);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-heavy: 0 32px 120px rgba(0, 0, 0, 0.58);

  --radius-sm: 11px;
  --radius: 18px;
  --radius-lg: 24px;
  --page: 1380px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at 50% -15%,
      rgba(255, 255, 255, 0.055),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012),
      transparent 28%
    ),
    var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.locked {
  overflow: hidden;
}

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

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);
  border-radius: 999px;
  background: var(--surface-4);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

.page-width {
  width: min(calc(100% - 48px), var(--page));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

/* ================================================================
   HEADER
   ================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 74px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 10, 13, 0.9);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.22em;
  cursor: pointer;
}

.brand:hover {
  opacity: 0.86;
}

.rook-icon {
  position: relative;
  display: block;
  width: 25px;
  height: 30px;
  flex: 0 0 auto;
  background: var(--text);
  clip-path: polygon(
    0 0,
    22% 0,
    22% 22%,
    39% 22%,
    39% 0,
    61% 0,
    61% 22%,
    78% 22%,
    78% 0,
    100% 0,
    100% 34%,
    82% 49%,
    82% 75%,
    100% 88%,
    100% 100%,
    0 100%,
    0 88%,
    18% 75%,
    18% 49%,
    0 34%
  );
}

.desktop-nav {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 18, 23, 0.92);
}

.desktop-nav button {
  border: 0;
  border-radius: 999px;
  padding: 9px 17px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.desktop-nav button.active,
.desktop-nav button:hover {
  background: var(--surface-3);
  color: var(--text);
}

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

.search-trigger,
.balance-display,
.mobile-menu-trigger {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.search-trigger:hover,
.balance-display:hover,
.mobile-menu-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.search-trigger:active,
.balance-display:active,
.mobile-menu-trigger:active {
  transform: translateY(1px);
}

.search-trigger {
  padding: 0 17px;
  color: var(--muted);
}

.balance-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 14px;
}

.balance-display span {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.balance-display strong {
  font-size: 13px;
}

.mobile-menu-trigger,
.mobile-menu {
  display: none;
}

/* ================================================================
   VIEWS
   ================================================================ */

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-enter 180ms ease both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   GLOBAL TYPOGRAPHY
   ================================================================ */

.eyebrow {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 12px;
  padding: 0 21px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.primary-button {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
}

.primary-button:hover {
  background: #ffffff;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.full-width {
  width: 100%;
}

/* ================================================================
   HERO
   ================================================================ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  gap: 74px;
  align-items: center;
  min-height: 690px;
  padding: 84px 0 76px;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(64px, 7vw, 108px);
  line-height: 0.91;
  letter-spacing: -0.075em;
}

.hero h1 span {
  display: block;
  color: var(--muted-2);
}

.hero-text {
  max-width: 700px;
  margin: 31px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.price-explainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 700px;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: var(--line);
}

.price-explainer > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.price-explainer strong {
  font-size: 18px;
}

.price-explainer span {
  color: var(--muted);
  font-size: 11px;
}

/* ================================================================
   FEATURED MARKET
   ================================================================ */

.featured-market {
  position: relative;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      transparent 45%
    ),
    var(--surface);
  box-shadow: var(--shadow);
}

.featured-market h2 {
  margin: 48px 0 30px;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.featured-topline,
.featured-footer,
.market-card-topline,
.market-card-footer,
.summary-topline {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted-2);
  font-size: 11px;
}

.active-status {
  color: var(--yes);
}

.featured-probability,
.market-probability {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.featured-probability {
  margin-bottom: 24px;
}

.featured-probability strong {
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.featured-probability span,
.market-probability span {
  color: var(--muted);
  font-size: 12px;
}

.featured-actions,
.outcome-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.yes-button,
.no-button,
.outcome-choice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  border-radius: 13px;
  padding: 0 17px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.yes-button,
.outcome-choice.yes {
  border: 1px solid var(--yes-border);
  background: var(--yes-soft);
  color: var(--yes);
}

.no-button,
.outcome-choice.no {
  border: 1px solid var(--no-border);
  background: var(--no-soft);
  color: var(--no);
}

.yes-button:hover,
.outcome-choice.yes:hover {
  border-color: var(--yes);
  background: rgba(65, 211, 146, 0.16);
  transform: translateY(-1px);
}

.no-button:hover,
.outcome-choice.no:hover {
  border-color: var(--no);
  background: rgba(255, 107, 107, 0.16);
  transform: translateY(-1px);
}

.yes-button:active,
.no-button:active,
.outcome-choice:active {
  transform: translateY(0);
}

.featured-footer {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

/* ================================================================
   MARKET LIST
   ================================================================ */

.market-section,
.how-section,
.principles-section {
  padding: 83px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 29px;
}

.section-header h2,
.principles-section h2,
.prototype-notice h2,
.dashboard-heading h1 {
  margin: 0;
  font-size: clamp(37px, 4.6vw, 61px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.market-header-actions {
  display: flex;
  gap: 10px;
}

.inline-search,
.proposal-trigger {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 15px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.inline-search {
  min-width: 260px;
  color: var(--muted);
  text-align: left;
}

.proposal-trigger {
  background: transparent;
  color: var(--text);
}

.inline-search:hover,
.proposal-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.category-row {
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.category-button.active,
.category-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

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

.market-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 360px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.018),
      transparent 45%
    ),
    var(--surface);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.market-card.clickable-card {
  cursor: pointer;
}

.market-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.035),
      transparent 48%
    ),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.market-card h3 {
  margin: 23px 0 18px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.market-card h3:hover {
  text-decoration: underline;
  text-decoration-color: var(--muted-2);
  text-underline-offset: 5px;
}

.market-card-probability {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 18px;
}

.market-card-probability strong {
  font-size: 39px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.market-card-probability span {
  color: var(--muted-2);
  font-size: 11px;
}

.market-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.market-card-footer {
  margin-top: 17px;
}

.market-open-button {
  width: 100%;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.market-open-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.empty-state {
  padding: 70px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

/* ================================================================
   EXPLANATION AND PRINCIPLES
   ================================================================ */

.how-section {
  border-top: 1px solid var(--line);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.process-grid article,
.principle-grid article {
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.process-grid article > span {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.process-grid h3 {
  margin: 48px 0 12px;
  font-size: 21px;
}

.process-grid p,
.principle-grid p,
.prototype-notice > p,
.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.principles-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 70px;
  align-items: start;
}

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

.principle-grid strong {
  display: block;
  margin-bottom: 11px;
  font-size: 17px;
}

.prototype-notice {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 70px;
  align-items: end;
  margin-top: 20px;
  margin-bottom: 100px;
  padding: 43px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.025),
      transparent 48%
    ),
    var(--surface);
}

/* ================================================================
   DASHBOARDS
   ================================================================ */

.dashboard-view {
  min-height: calc(100vh - 160px);
  padding-top: 82px;
  padding-bottom: 100px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 31px;
}

.dashboard-heading p {
  max-width: 680px;
  margin-top: 18px;
}

.balance-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.balance-panel span {
  color: var(--muted);
  font-size: 11px;
}

.balance-panel strong {
  font-size: 31px;
  letter-spacing: -0.04em;
}

.balance-panel button {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.balance-panel button:hover {
  color: var(--text);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 17px;
}

.metric-grid article {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.metric-grid span {
  color: var(--muted);
  font-size: 11px;
}

.metric-grid strong {
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--line);
}

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

.panel-header span {
  color: var(--muted-2);
  font-size: 10px;
}

.position-row,
.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(5, minmax(90px, auto));
  gap: 20px;
  align-items: center;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

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

.position-row:last-child,
.activity-row:last-child {
  border-bottom: 0;
}

.position-row h3,
.activity-row h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.position-row span,
.activity-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.position-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.position-stat strong {
  font-size: 13px;
}

.position-side.yes {
  color: var(--yes);
}

.position-side.no {
  color: var(--no);
}

.dashboard-empty {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.dashboard-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
}

.dashboard-empty button {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.dashboard-empty button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.activity-filter-row {
  display: flex;
  gap: 7px;
  padding: 15px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.activity-filter-row::-webkit-scrollbar {
  display: none;
}

.activity-filter-row button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.activity-filter-row button.active,
.activity-filter-row button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.activity-type {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ================================================================
   OVERLAYS
   ================================================================ */

.market-overlay,
.search-overlay,
.proposal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  pointer-events: none;
}

.proposal-overlay {
  z-index: 110;
}

.market-overlay.open,
.search-overlay.open,
.proposal-overlay.open {
  visibility: visible;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  opacity: 0;
  transition: opacity 180ms ease;
}

.market-overlay.open .overlay-backdrop,
.search-overlay.open .overlay-backdrop,
.proposal-overlay.open .overlay-backdrop {
  opacity: 1;
}

/* ================================================================
   MARKET DIALOG
   ================================================================ */

.market-dialog {
  position: absolute;
  inset: 18px;
  max-width: 1480px;
  margin: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--bg);
  box-shadow: var(--shadow-heavy);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.market-overlay.open .market-dialog {
  opacity: 1;
  transform: translateY(0);
}

.market-dialog-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 25px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 13, 0.95);
  backdrop-filter: blur(20px);
}

.market-dialog-header h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(26px, 3.4vw, 47px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.close-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.close-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: rotate(4deg);
}

.market-dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  padding: 24px;
}

.market-information {
  min-width: 0;
}

.market-summary-card,
.information-card,
.order-ticket {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.market-summary-card {
  padding: 23px;
}

.market-probability {
  margin: 35px 0 23px;
}

.market-probability strong {
  font-size: 57px;
  line-height: 1;
  letter-spacing: -0.065em;
}

.outcome-choice.active.yes {
  border-color: var(--yes);
  box-shadow: inset 0 0 0 1px var(--yes);
}

.outcome-choice.active.no {
  border-color: var(--no);
  box-shadow: inset 0 0 0 1px var(--no);
}

.detail-tabs {
  display: flex;
  gap: 7px;
  margin: 18px 0;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar {
  display: none;
}

.detail-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.detail-tabs button.active,
.detail-tabs button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.detail-panel {
  display: none;
}

.detail-panel.active {
  display: grid;
  gap: 15px;
  animation: detail-enter 160ms ease both;
}

@keyframes detail-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.information-card {
  padding: 23px;
}

.information-card h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.information-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.information-card p:last-child {
  margin-bottom: 0;
}

.contract-grid,
.source-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.contract-grid div,
.source-list div {
  min-width: 0;
  padding: 16px;
  background: var(--bg);
}

.contract-grid dt,
.source-list dt {
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contract-grid dd,
.source-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.card-heading p {
  margin-top: 7px;
}

.information-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  min-height: 26px;
  height: fit-content;
  border: 1px solid rgba(65, 211, 146, 0.26);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--yes-soft);
  color: var(--yes);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.information-badge-demo {
  border-color: rgba(255, 190, 92, 0.35);
  background: rgba(255, 190, 92, 0.09);
  color: #ffc66d;
}

.integrity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.integrity-item {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
}

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

.integrity-item strong {
  font-size: 12px;
  text-align: right;
}

.restriction-list {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.restriction-list li {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.danger-card {
  border-color: var(--no-border);
  background: var(--no-soft);
}

/* ================================================================
   MONITORING AND SETTLEMENT RECORDS
   ================================================================ */

.monitoring-grid,
.market-monitoring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.monitoring-grid article,
.market-monitoring-item {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.monitoring-status {
  width: fit-content;
  border: 1px solid rgba(65, 211, 146, 0.25);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--yes-soft);
  color: var(--yes);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.monitoring-grid strong,
.market-monitoring-item strong {
  font-size: 12px;
}

.settlement-record {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.settlement-record-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  padding: 15px;
  background: var(--bg);
}

.settlement-record-row span {
  color: var(--muted);
  font-size: 11px;
}

.settlement-record-row strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

/* ================================================================
   ORDER TICKET
   ================================================================ */

.order-ticket {
  position: sticky;
  top: 112px;
  height: fit-content;
  padding: 23px;
}

.order-ticket h3 {
  margin: 0 0 18px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.ticket-explanation {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.ticket-explanation strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.ticket-explanation p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.amount-label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.amount-input {
  display: flex;
  align-items: center;
  min-height: 61px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
  transition: border-color 150ms ease;
}

.amount-input:focus-within {
  border-color: var(--line-strong);
}

.amount-input span {
  color: var(--muted);
  font-size: 20px;
}

.amount-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding-left: 8px;
  background: transparent;
  color: var(--text);
  font-size: 27px;
  font-weight: 800;
}

.order-calculation {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.order-calculation div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.order-calculation div:last-child {
  border-bottom: 0;
}

.order-calculation span {
  color: var(--muted);
  font-size: 11px;
}

.order-calculation strong {
  font-size: 12px;
  text-align: right;
}

.acknowledgment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.acknowledgment input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--text);
}

.ticket-disclaimer {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* ================================================================
   SEARCH
   ================================================================ */

.search-dialog {
  position: relative;
  width: min(720px, calc(100% - 30px));
  max-height: calc(100vh - 70px);
  margin: 35px auto;
  padding: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-heavy);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.search-overlay.open .search-dialog {
  opacity: 1;
  transform: translateY(0);
}

.search-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.search-header h2 {
  margin: 0;
  font-size: 32px;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--bg);
}

.search-input:focus-within {
  border-color: var(--text-soft);
}

.search-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-input input::placeholder {
  color: var(--muted-2);
}

.search-results {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 17px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover {
  background: var(--surface-2);
}

.search-result strong {
  display: block;
  margin-bottom: 7px;
}

.search-result span {
  color: var(--muted);
  font-size: 11px;
}

.search-result-price {
  color: var(--text) !important;
  font-size: 20px !important;
  font-weight: 800;
}

/* ================================================================
   RULES
   ================================================================ */

.rules-view {
  min-height: calc(100vh - 150px);
  padding-top: 84px;
  padding-bottom: 110px;
}

.rules-heading {
  max-width: 900px;
}

.rules-heading h1 {
  margin: 0;
  font-size: clamp(55px, 7vw, 100px);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.rules-heading > p:last-child {
  max-width: 740px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.rules-navigation {
  position: sticky;
  top: 90px;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 55px 0 24px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 18, 23, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  overflow-x: auto;
  scrollbar-width: none;
}

.rules-navigation::-webkit-scrollbar {
  display: none;
}

.rules-navigation a {
  flex: 0 0 auto;
  border-radius: 9px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.rules-navigation a:hover {
  background: var(--surface-3);
  color: var(--text);
}

.rules-sections {
  display: grid;
  gap: 17px;
}

.rule-section {
  scroll-margin-top: 160px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.018),
      transparent 50%
    ),
    var(--surface);
}

.rule-section h2 {
  margin: 0 0 26px;
  font-size: clamp(30px, 4vw, 49px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.rule-section > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.rule-grid,
.restriction-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.restriction-policy-grid {
  grid-template-columns: repeat(2, 1fr);
}

.rule-grid article,
.restriction-policy-grid article {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.rule-grid strong,
.restriction-policy-grid strong {
  display: block;
  margin-bottom: 11px;
}

.rule-grid p,
.restriction-policy-grid p,
.protection-layout p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.policy-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.policy-list li {
  position: relative;
  padding: 15px 17px 15px 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  line-height: 1.55;
}

.policy-list li::before {
  position: absolute;
  top: 18px;
  left: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
  content: "";
}

.settlement-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.settlement-flow article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
}

.settlement-flow article > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin-bottom: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
}

.settlement-flow strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.settlement-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.protection-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  align-items: start;
}

.protection-controls {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.protection-controls label {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.protection-controls label:last-child {
  border-bottom: 0;
}

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

.protection-controls strong {
  font-size: 12px;
  text-align: right;
}

.prototype-rule {
  border-color: var(--line-strong);
}

/* ================================================================
   PROPOSAL DIALOG
   ================================================================ */

.proposal-dialog {
  position: absolute;
  inset: 18px;
  width: min(900px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  margin: auto;
  padding: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-heavy);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.proposal-overlay.open .proposal-dialog {
  opacity: 1;
  transform: translateY(0);
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.proposal-header h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.proposal-header p:last-child {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.proposal-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.proposal-grid label > span {
  color: var(--muted);
  font-size: 11px;
}

.proposal-grid input,
.proposal-grid select,
.proposal-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.proposal-grid input:hover,
.proposal-grid select:hover,
.proposal-grid textarea:hover {
  border-color: var(--line-strong);
}

.proposal-grid input:focus,
.proposal-grid select:focus,
.proposal-grid textarea:focus {
  border-color: var(--text-soft);
  background: var(--bg-elevated);
}

.proposal-grid input::placeholder,
.proposal-grid textarea::placeholder {
  color: var(--muted-2);
}

.proposal-grid input,
.proposal-grid select {
  min-height: 47px;
}

.proposal-grid textarea {
  min-height: 105px;
}

.proposal-grid .full-field {
  grid-column: 1 / -1;
}

.proposal-review-flow {
  display: flex;
  gap: 7px;
  margin: 22px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.proposal-review-flow::-webkit-scrollbar {
  display: none;
}

.proposal-review-flow span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 10px;
}

/* ================================================================
   TOAST
   ================================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 27px;
  z-index: 200;
  max-width: calc(100% - 30px);
  padding: 13px 18px;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================================================================
   FOOTER
   ================================================================ */

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 34px 90px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

footer strong {
  color: var(--text);
  letter-spacing: 0.18em;
}

footer button {
  border: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

footer button:hover {
  color: var(--text);
}

/* ================================================================
   TABLET
   ================================================================ */

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 80;
    max-width: calc(100vw - 30px);
    transform: translateX(-50%);
    box-shadow: var(--shadow);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .desktop-nav::-webkit-scrollbar {
    display: none;
  }

  .desktop-nav button {
    flex: 0 0 auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .featured-market {
    max-width: 720px;
  }

  .market-grid,
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .principles-section {
    grid-template-columns: 1fr;
    gap: 35px;
  }

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

  .order-ticket {
    position: static;
  }

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

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

  .position-row .position-stat:nth-of-type(n + 4) {
    display: none;
  }

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

  .settlement-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .monitoring-grid,
  .market-monitoring-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 720px) {
  .page-width {
    width: min(calc(100% - 30px), var(--page));
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 0 16px;
  }

  .desktop-nav,
  .search-trigger {
    display: none;
  }

  .brand {
    gap: 10px;
    font-size: 14px;
  }

  .rook-icon {
    width: 21px;
    height: 25px;
  }

  .header-actions {
    gap: 7px;
  }

  .balance-display {
    min-height: 40px;
    padding: 0 11px;
  }

  .balance-display span {
    display: none;
  }

  .mobile-menu-trigger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    padding: 0;
  }

  .mobile-menu-trigger span {
    width: 17px;
    height: 1px;
    margin-inline: auto;
    background: var(--text);
  }

  .mobile-menu {
    position: fixed;
    top: 72px;
    left: 15px;
    right: 15px;
    z-index: 90;
    display: none;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 15px;
    background: rgba(15, 18, 23, 0.98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
  }

  .mobile-menu.open {
    display: grid;
  }

  .mobile-menu button {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 15px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }

  .mobile-menu button:last-child {
    border-bottom: 0;
  }

  .hero {
    min-height: auto;
    padding: 62px 0;
  }

  .hero h1 {
    font-size: clamp(56px, 17vw, 79px);
  }

  .hero-text {
    margin-top: 25px;
    font-size: 15px;
    line-height: 1.6;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions button {
    width: 100%;
  }

  .price-explainer {
    grid-template-columns: 1fr;
  }

  .price-explainer > div {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .featured-market {
    padding: 21px;
  }

  .featured-market h2 {
    margin-top: 35px;
  }

  .featured-topline,
  .featured-footer,
  .section-header,
  .dashboard-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .featured-footer {
    gap: 6px;
  }

  .market-section,
  .how-section,
  .principles-section {
    padding: 62px 0;
  }

  .market-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .proposal-trigger,
  .inline-search {
    width: 100%;
    min-width: 0;
  }

  .market-grid,
  .process-grid,
  .principle-grid,
  .prototype-notice,
  .metric-grid,
  .restriction-policy-grid,
  .settlement-flow,
  .monitoring-grid,
  .market-monitoring-grid,
  .protection-layout,
  .proposal-grid {
    grid-template-columns: 1fr;
  }

  .market-card {
    min-height: 340px;
  }

  .prototype-notice {
    gap: 28px;
    padding: 26px;
  }

  .dashboard-view {
    padding-top: 58px;
  }

  .dashboard-heading {
    gap: 25px;
  }

  .balance-panel {
    align-items: flex-start;
  }

  .metric-grid strong {
    font-size: 23px;
  }

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

  .position-row .position-stat {
    display: flex !important;
  }

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

  .activity-row > strong {
    margin-top: 4px;
  }

  .market-dialog {
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .market-dialog-header {
    padding: 20px;
  }

  .market-dialog-header h2 {
    font-size: 27px;
  }

  .market-dialog-layout {
    padding: 15px;
  }

  .market-summary-card,
  .information-card,
  .order-ticket {
    padding: 18px;
  }

  .contract-grid,
  .source-list,
  .integrity-grid {
    grid-template-columns: 1fr;
  }

  .integrity-item {
    align-items: flex-start;
  }

  .integrity-item strong {
    max-width: 45%;
  }

  .rules-view {
    padding-top: 58px;
    padding-bottom: 85px;
  }

  .rules-heading h1 {
    font-size: clamp(52px, 16vw, 76px);
  }

  .rules-heading > p:last-child {
    font-size: 15px;
  }

  .rules-navigation {
    top: 73px;
    margin-top: 40px;
  }

  .rule-section {
    padding: 23px;
  }

  .rule-section h2 {
    font-size: 31px;
  }

  .settlement-record-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .proposal-dialog {
    inset: 0;
    width: 100%;
    max-height: 100vh;
    padding: 20px;
    border: 0;
    border-radius: 0;
  }

  .proposal-header {
    align-items: flex-start;
  }

  .proposal-grid .full-field {
    grid-column: auto;
  }

  .search-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
    padding: 20px;
  }

  .search-result {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 15px;
  }

  footer {
    flex-direction: column;
    padding: 26px 16px 100px;
  }
}

/* ================================================================
   ROOK V8 AUDIT CORRECTIONS
   ================================================================ */

.decision-tools {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  background: var(--surface);
}

.decision-tools .section-header {
  margin-bottom: 22px;
}

.decision-tools .section-header h2 {
  margin-bottom: 10px;
}

.decision-tools .section-header p:last-child,
.tool-disclosure {
  max-width: 820px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

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

.decision-tool-card {
  display: flex;
  flex-direction: column;
  gap: 19px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: var(--bg);
}

.decision-tool-card h3 {
  margin: 7px 0 0;
  font-size: 22px;
}

.calculator-field > span:first-child {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

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

.decision-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.decision-results > div {
  padding: 14px;
  background: var(--surface);
}

.decision-results dt {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.4;
}

.decision-results dd {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 850;
}

.open-orders-panel {
  margin-bottom: 17px;
}

.open-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

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

.open-order-row h3 {
  margin: 7px 0;
  font-size: 14px;
}

.open-order-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.open-order-row button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.terminal-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.terminal-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  background: var(--bg);
}

.terminal-summary-grid span {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.4;
}

.terminal-summary-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.terminal-summary-grid > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

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

.terminal-rules-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px;
  background: var(--bg);
}

.terminal-rules-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.terminal-rules-grid p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.ticket-control-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.ticket-control-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.ticket-segment button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 9px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.ticket-segment button.active {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.compact-amount-input {
  min-height: 49px;
}

.compact-amount-input input {
  padding-left: 0;
  font-size: 21px;
}

.order-state-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.order-state-flow strong {
  width: 100%;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.order-state-flow span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 8px;
}

.position-reduce-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

@media (max-width: 1180px) {
  .terminal-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .decision-tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .decision-tools {
    padding: 21px;
  }

  .compact-field-grid,
  .decision-results,
  .terminal-summary-grid,
  .terminal-rules-grid {
    grid-template-columns: 1fr;
  }

  .open-order-row {
    grid-template-columns: 1fr;
  }

  .open-order-row button {
    width: 100%;
  }
}

/* ================================================================
   SMALL MOBILE
   ================================================================ */

@media (max-width: 420px) {
  .hero h1 {
    font-size: clamp(51px, 16vw, 67px);
  }

  .featured-actions,
  .outcome-buttons,
  .market-card-actions {
    grid-template-columns: 1fr;
  }

  .yes-button,
  .no-button,
  .outcome-choice {
    min-height: 54px;
  }

  .market-card {
    min-height: 390px;
  }

  .market-dialog-header {
    gap: 15px;
  }

  .close-button {
    width: 38px;
    height: 38px;
  }

  .order-calculation div {
    gap: 10px;
  }

  .protection-controls label {
    flex-direction: column;
    gap: 7px;
  }

  .protection-controls strong {
    text-align: left;
  }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================
   HEADER COLLISION FIX
   ================================================================ */

.site-header {
  grid-template-columns:
    minmax(180px, 1fr)
    auto
    minmax(280px, 1fr);
  column-gap: 20px;
}

.brand {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.desktop-nav {
  position: relative;
  z-index: 1;
  justify-self: center;
  white-space: nowrap;
}

.header-actions {
  position: relative;
  z-index: 2;
  min-width: 0;
  white-space: nowrap;
}

/* Slightly compress the header before switching layouts. */
@media (max-width: 1280px) {
  .site-header {
    grid-template-columns:
      minmax(150px, 1fr)
      auto
      minmax(205px, 1fr);
    column-gap: 12px;
    padding-inline: 22px;
  }

  .desktop-nav button {
    padding-inline: 14px;
  }

  .search-trigger {
    padding-inline: 14px;
  }

  .balance-display {
    padding-inline: 12px;
  }
}

/* Remove Search first instead of letting it collide with Rules. */
@media (max-width: 1160px) {
  .site-header {
    grid-template-columns:
      minmax(145px, 1fr)
      auto
      minmax(145px, 1fr);
  }

  .search-trigger {
    display: none;
  }

  .desktop-nav button {
    padding-inline: 13px;
  }
}

/* Tablet navigation moves below the page and cannot overlap header. */
@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    column-gap: 14px;
  }

  .desktop-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 80;
    display: flex;
    max-width: calc(100vw - 30px);
    transform: translateX(-50%);
    overflow-x: auto;
    box-shadow: var(--shadow);
    scrollbar-width: none;
  }

  .desktop-nav::-webkit-scrollbar {
    display: none;
  }

  .desktop-nav button {
    flex: 0 0 auto;
  }

  .header-actions {
    justify-self: end;
  }
}

/* Phone layout uses the mobile menu only. */
@media (max-width: 720px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
  }

  .desktop-nav {
    display: none;
  }

  .search-trigger {
    display: none;
  }
}


/* ================================================================
   ROOK ACCESSIBILITY AUDIO CONTROLS
   ================================================================ */

.listen-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.listen-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.listen-button:active {
  transform: translateY(0);
}

.listen-button.speaking {
  border-color: rgba(65, 211, 146, 0.45);
  background: var(--yes-soft);
  color: var(--yes);
}

.listen-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  transform: rotate(180deg);
}

.listen-button.speaking .listen-icon {
  animation: rook-audio-pulse 1.1s ease-in-out infinite;
}

@keyframes rook-audio-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(65, 211, 146, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(65, 211, 146, 0.1);
  }
}

.rules-heading-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 36px;
  max-width: none;
}

.rules-heading-layout > div {
  max-width: 900px;
}

.rules-listen-button {
  margin-bottom: 8px;
}

.process-grid article,
.rule-section {
  position: relative;
}

.card-listen-button {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.card-listen-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
  transform: translateY(-1px);
}

.card-listen-button.speaking {
  border-color: rgba(65, 211, 146, 0.45);
  background: var(--yes-soft);
  color: var(--yes);
}

.card-listen-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Larger and more deliberate process numbering. */

.process-grid article > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.process-grid h3 {
  margin-top: 52px;
}

/* Larger section numbers on the Rules page. */

.rule-section > .eyebrow:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 47px;
  height: 32px;
  margin-bottom: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.rule-section > h2 {
  padding-right: 56px;
}

.speech-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .rules-heading-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .rules-listen-button,
  .section-header .listen-button {
    width: 100%;
  }

  .card-listen-button {
    top: 16px;
    right: 16px;
  }

  .process-grid article > span:first-child {
    width: 39px;
    height: 39px;
  }

  .rule-section > h2 {
    padding-right: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .listen-button.speaking .listen-icon {
    animation: none;
  }
}

/* ================================================================
   ROOK COMPLETION WORKSTREAMS
   ================================================================ */

.lifecycle-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 24px;
  color: var(--muted);
  font-size: 11px;
}

.lifecycle-legend strong,
.market-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.market-status-badge.status-open,
.market-status-badge.status-resolved {
  border-color: rgba(65, 211, 146, 0.3);
  background: var(--yes-soft);
  color: var(--yes);
}

.market-status-badge.status-paused,
.market-status-badge.status-disputed {
  border-color: rgba(255, 190, 92, 0.35);
  background: rgba(255, 190, 92, 0.09);
  color: #ffc66d;
}

.market-status-badge.status-voided,
.market-status-badge.status-archived {
  color: var(--muted);
}

.market-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.market-card-status p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.market-card-actions button:disabled,
.order-ticket button:disabled,
.outcome-buttons button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.market-lifecycle-notice {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.position-row {
  grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(85px, auto)) auto;
}

.position-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.position-actions button,
.proposal-history-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.position-actions button:hover,
.proposal-history-actions button:hover {
  background: var(--surface-3);
}

.position-actions span {
  color: var(--muted-2);
  font-size: 9px;
  text-align: right;
}

.proposal-history-panel {
  margin-top: 17px;
}

.proposal-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

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

.proposal-history-row h3 {
  margin: 0 0 7px;
  font-size: 14px;
  line-height: 1.4;
}

.proposal-history-row p,
.proposal-history-row span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.proposal-status {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.proposal-status strong {
  font-size: 12px;
}

.policy-view {
  min-height: calc(100vh - 160px);
  padding: 92px 0 110px;
}

.policy-heading {
  max-width: 900px;
  margin-bottom: 42px;
}

.policy-heading h1 {
  margin: 0;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.policy-heading > p:last-child {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

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

.policy-sections section,
.architecture-grid article,
.readiness-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 27px;
  background: var(--surface);
}

.policy-sections h2,
.architecture-grid h2,
.readiness-table h2 {
  margin: 0 0 15px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.policy-sections p,
.architecture-grid p,
.readiness-table span {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--surface);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.contact-form label > span {
  color: var(--muted);
  font-size: 11px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  background: var(--bg);
  color: var(--text);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

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

.architecture-grid article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  margin-bottom: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

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

.readiness-table > div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.readiness-table strong {
  font-size: 12px;
}

.readiness-table span {
  font-size: 12px;
}

.dialog-focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .position-row {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(90px, auto)) auto;
  }

  .position-actions {
    grid-column: -2 / -1;
  }
}

@media (max-width: 720px) {
  .lifecycle-legend {
    align-items: flex-start;
  }

  .market-card-status {
    align-items: flex-start;
  }

  .market-card-status p {
    max-width: 55%;
  }

  .position-row,
  .proposal-history-row,
  .policy-sections,
  .contact-form,
  .architecture-grid,
  .readiness-table > div {
    grid-template-columns: 1fr;
  }

  .position-actions {
    grid-column: auto;
    align-items: stretch;
  }

  .position-actions span {
    text-align: left;
  }

  .proposal-history-actions button {
    width: 100%;
  }

  .policy-view {
    padding-top: 58px;
  }

  .policy-heading h1 {
    font-size: clamp(43px, 13vw, 64px);
  }
}

/* ================================================================
   ROOK V6 REVENUE TRANSPARENCY AND MARKET TERMINAL
   ================================================================ */

.positive {
  color: var(--yes) !important;
}

.negative {
  color: var(--no) !important;
}

.calculator-view {
  min-height: calc(100vh - 160px);
  padding: 92px 0 110px;
}

.calculator-heading {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  align-items: flex-end;
  margin-bottom: 38px;
}

.calculator-heading > div:first-child {
  max-width: 900px;
}

.calculator-heading h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 94px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.calculator-heading > div:first-child > p:last-child {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.calculator-rate-card {
  flex: 0 0 255px;
  border: 1px solid rgba(65, 211, 146, 0.28);
  border-radius: var(--radius);
  padding: 23px;
  background: var(--yes-soft);
}

.calculator-rate-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.calculator-rate-card strong {
  display: block;
  margin: 13px 0 7px;
  color: var(--yes);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.calculator-rate-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
}

.calculator-controls,
.calculator-results,
.waterfall-section,
.accounting-boundary,
.competitor-comparison,
.profile-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.calculator-controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 27px;
}

.calculator-field > label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.calculator-input {
  display: flex;
  align-items: center;
  min-height: 60px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 17px;
  background: var(--bg);
}

.calculator-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 27px;
  font-weight: 850;
}

.calculator-input span {
  color: var(--muted);
  font-size: 18px;
}

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

.calculator-side button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.calculator-side button.active.yes {
  border-color: var(--yes);
  background: var(--yes-soft);
  color: var(--yes);
}

.calculator-side button.active.no {
  border-color: var(--no);
  background: var(--no-soft);
  color: var(--no);
}

.calculator-controls > p {
  margin: auto 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}

.calculator-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.calculator-results article {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 23px;
  background: var(--surface);
}

.calculator-results span {
  color: var(--muted);
  font-size: 11px;
}

.calculator-results strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.waterfall-section,
.competitor-comparison {
  margin-top: 18px;
  padding: 30px;
}

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

.waterfall-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px;
  background: var(--bg);
}

.waterfall-grid article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  margin-bottom: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.waterfall-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.waterfall-grid p,
.accounting-boundary p,
.comparison-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.accounting-boundary {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 55px;
  margin-top: 18px;
  padding: 34px;
}

.accounting-boundary h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.accounting-boundary > div:last-child {
  display: grid;
  gap: 16px;
}

.comparison-date {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
}

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

.comparison-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.comparison-table th,
.comparison-table td {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: 0;
}

.rook-comparison-row th,
.rook-comparison-row td {
  background: rgba(65, 211, 146, 0.055);
}

.comparison-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
  margin-top: 18px;
}

.comparison-sources {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.comparison-sources a {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--text);
  font-size: 11px;
  text-decoration: none;
}

.comparison-sources a:hover {
  background: var(--surface-2);
}

.profile-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.2fr);
  gap: 26px;
  margin-bottom: 17px;
  padding: 25px;
}

.profile-identity {
  display: flex;
  gap: 16px;
}

.profile-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 20px;
  font-weight: 900;
}

.profile-identity h2 {
  margin: 0;
  font-size: 24px;
}

.profile-identity p:last-child {
  max-width: 460px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.profile-stats > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg);
}

.profile-stats span {
  color: var(--muted-2);
  font-size: 9px;
}

.profile-stats strong {
  font-size: 16px;
}

.profile-chart {
  grid-column: 1 / -1;
  height: 110px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.profile-chart svg {
  width: 100%;
  height: 100%;
}

.position-row {
  grid-template-columns:
    minmax(220px, 1fr)
    repeat(6, minmax(82px, auto))
    minmax(180px, auto);
}

.market-card-sparkline {
  display: grid;
  grid-template-rows: auto 54px;
  gap: 8px;
  min-height: 78px;
  margin: 0 0 18px;
  opacity: 0.9;
}

.market-card-sparkline svg {
  width: 100%;
  height: 54px;
}

.market-card-chart-legend,
.chart-series-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.market-card-chart-legend span,
.chart-series-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.market-card-chart-legend i,
.chart-series-legend i {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.yes-series,
.yes-probability-line {
  color: var(--yes);
  stroke: var(--yes);
}

.no-series,
.no-probability-line {
  color: var(--no);
  stroke: var(--no);
}

.market-card-probability span b {
  font-weight: 800;
}

.terminal-card {
  overflow: hidden;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.participation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.chart-summary > div,
.participation-grid article {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  background: var(--bg);
}

.chart-summary span,
.participation-grid span {
  color: var(--muted-2);
  font-size: 9px;
}

.chart-summary strong,
.participation-grid strong {
  font-size: 15px;
}

.probability-chart {
  position: relative;
  height: 320px;
  margin-top: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 44px 7px 34px;
  background: var(--bg);
}

.probability-chart svg {
  width: 100%;
  height: 100%;
}

.chart-series-legend {
  position: absolute;
  top: 15px;
  left: 18px;
  z-index: 2;
}

.chart-series-legend strong {
  color: inherit;
}

.chart-axis-label {
  position: absolute;
  right: 12px;
  color: var(--muted-2);
  font-size: 8px;
  pointer-events: none;
}

.chart-axis-top {
  top: 48px;
}

.chart-axis-middle {
  top: 50%;
  transform: translateY(-50%);
}

.chart-axis-bottom {
  bottom: 39px;
}

.chart-relationship-note {
  position: absolute;
  right: 14px;
  bottom: 10px;
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
}

.chart-range-controls {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 13px;
}

.chart-range-controls button {
  min-width: 43px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.chart-range-controls button.active,
.chart-range-controls button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

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

.book-layout h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.order-book,
.recent-trades {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.order-book-head,
.order-book-row,
.recent-trade-head,
.recent-trade-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.order-book-row:last-child,
.recent-trade-row:last-child {
  border-bottom: 0;
}

.order-book-head,
.recent-trade-head {
  color: var(--muted-2);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.order-book-row,
.recent-trade-row {
  font-size: 10px;
}

.event-timeline {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.timeline-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  background: var(--bg);
}

.timeline-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 9px;
  font-weight: 900;
}

.timeline-row strong {
  font-size: 12px;
}

.timeline-row p {
  margin: 5px 0 0;
  font-size: 10px;
}

.timeline-status {
  color: var(--muted-2);
  font-size: 9px;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.research-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px;
  background: var(--bg);
}

.research-grid article:first-child {
  grid-column: 1 / -1;
}

.research-grid article > span {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.research-grid h4 {
  margin: 12px 0 9px;
  font-size: 14px;
}

.research-grid p {
  font-size: 11px;
}

.research-grid strong {
  color: var(--text-soft);
  font-size: 10px;
}

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

.money-rule-summary article {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px;
  background: var(--bg);
}

.money-rule-summary span {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.money-rule-summary strong {
  display: block;
  margin: 13px 0 9px;
  font-size: 15px;
}

.money-rule-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.rules-waterfall-example {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.rules-waterfall-example > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: var(--surface);
}

.rules-waterfall-example span {
  color: var(--muted-2);
  font-size: 9px;
}

.rules-waterfall-example strong {
  font-size: 15px;
}

@media (max-width: 1180px) {
  .waterfall-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rules-waterfall-example {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .position-row {
    grid-template-columns:
      minmax(220px, 1fr)
      repeat(3, minmax(82px, auto));
  }

  .position-actions {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  .position-actions span {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .calculator-heading,
  .accounting-boundary {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .calculator-rate-card {
    flex-basis: auto;
  }

  .calculator-layout,
  .profile-summary,
  .book-layout {
    grid-template-columns: 1fr;
  }

  .profile-chart {
    grid-column: auto;
  }

  .waterfall-grid,
  .comparison-notes,
  .money-rule-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .calculator-view {
    padding-top: 58px;
  }

  .calculator-heading h1 {
    font-size: clamp(48px, 14vw, 70px);
  }

  .calculator-results,
  .waterfall-grid,
  .comparison-notes,
  .profile-stats,
  .chart-summary,
  .participation-grid,
  .research-grid,
  .money-rule-summary,
  .rules-waterfall-example {
    grid-template-columns: 1fr;
  }

  .waterfall-section,
  .competitor-comparison {
    padding: 21px;
  }

  .accounting-boundary {
    gap: 24px;
    padding: 24px;
  }

  .profile-identity {
    flex-direction: column;
  }

  .probability-chart {
    height: 230px;
  }

  .card-heading {
    flex-direction: column;
  }

  .timeline-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .timeline-status {
    grid-column: 2;
  }

  .research-grid article:first-child {
    grid-column: auto;
  }

  .chart-range-controls {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

/* ================================================================
   ROOK FINANCIAL MODEL CLARITY
   ================================================================ */

.market-price-note {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
  gap: 30px;
  margin-top: 16px;
  border: 1px solid rgba(65, 211, 146, 0.24);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--yes-soft);
}

.market-price-note strong {
  font-size: 16px;
}

.market-price-note p,
.waterfall-intro,
.money-rule-intro,
.profit-share-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.waterfall-section,
.profit-examples-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.waterfall-intro {
  max-width: 820px;
  margin-top: 15px;
}

.paired-pool-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
}

.paired-pool-summary > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 17px;
  background: var(--bg);
}

.paired-pool-summary span,
.profit-example-grid article > span,
.profit-share-callout > span {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.paired-pool-summary strong {
  font-size: 23px;
}

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

.profit-examples-section {
  margin-top: 18px;
  padding: 30px;
}

.profit-example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.profit-example-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px;
  background: var(--bg);
}

.profit-example-grid article > strong {
  display: block;
  min-height: 38px;
  margin: 12px 0 16px;
  font-size: 14px;
  line-height: 1.35;
}

.profit-example-grid dl {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.profit-example-grid dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  background: var(--bg);
}

.profit-example-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.profit-example-grid dd {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
}

.money-rule-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.money-rule-intro {
  max-width: 900px;
}

.profit-share-callout {
  margin: 18px 0;
  border: 1px solid rgba(65, 211, 146, 0.28);
  border-radius: 13px;
  padding: 20px;
  background: var(--yes-soft);
}

.profit-share-callout strong {
  display: block;
  margin: 11px 0 7px;
  color: var(--yes);
  font-size: 22px;
}

.position-row {
  grid-template-columns: minmax(250px, 1.4fr) repeat(4, minmax(105px, 1fr));
  align-items: start;
}

.position-actions {
  grid-column: 1 / -1;
  align-items: flex-start;
}

.position-actions span {
  text-align: left;
}

.activity-row {
  align-items: start;
}

.activity-financials {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 1px;
  margin: 15px 0 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--line);
}

.activity-financials > div {
  padding: 11px;
  background: var(--bg);
}

.activity-financials dt {
  color: var(--muted-2);
  font-size: 9px;
}

.activity-financials dd {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 800;
}

.activity-total {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: right;
}

.activity-total span {
  color: var(--muted-2);
  font-size: 9px;
}

.activity-total strong {
  font-size: 15px;
}

@media (max-width: 1180px) {
  .profit-example-grid,
  .money-rule-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .position-row {
    grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(105px, 1fr));
  }

  .position-row .position-stat {
    display: flex;
  }
}

@media (max-width: 720px) {
  .market-price-note,
  .paired-pool-summary,
  .profit-example-grid,
  .money-rule-summary,
  .position-row,
  .activity-financials {
    grid-template-columns: 1fr;
  }

  .profit-examples-section {
    padding: 21px;
  }

  .activity-total {
    text-align: left;
  }
}
