:root {
  --bg: #fcf9f4;
  --bg-deep: #f3ede3;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(246, 243, 238, 0.95);
  --ink: #1d1c1a;
  --ink-soft: #5a4a3d;
  --muted: #6d7782;
  --line: rgba(116, 88, 67, 0.16);
  --line-strong: rgba(156, 63, 0, 0.24);
  --navy: #3f5f88;
  --navy-deep: #23384e;
  --orange: #b44b0a;
  --orange-strong: #943d06;
  --green: #1d8754;
  --red: #a1463d;
  --amber: #b96b06;
  --shadow: 0 24px 60px rgba(66, 49, 30, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(180, 75, 10, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(63, 95, 136, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(252, 249, 244, 0.88);
  border-bottom: 1px solid rgba(116, 88, 67, 0.08);
}

.topbar-inner {
  width: min(var(--max-width), calc(100vw - 28px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: "Newsreader", serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: -0.04em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: 1;
  min-width: 0;
}

.topnav a {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.topnav a.is-active {
  color: var(--orange);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-toggle {
  display: none;
  flex: 0 0 auto;
}

.mobile-nav-toggle span[aria-hidden="true"] {
  font-size: 22px;
  line-height: 1;
}

.wallet-menu-shell {
  position: relative;
}

.wallet-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(116, 88, 67, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(48, 34, 22, 0.14);
  display: grid;
  gap: 10px;
}

.wallet-menu[hidden] {
  display: none !important;
}

.wallet-menu-address {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(246, 243, 238, 0.92);
  color: var(--navy-deep);
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
}

.wallet-menu-button {
  width: 100%;
}

.dialog-open {
  overflow: hidden;
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(8px);
}

.app-dialog-overlay[hidden] {
  display: none !important;
}

.app-top-notice {
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 110;
  max-width: min(680px, calc(100vw - 28px));
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(63, 95, 136, 0.16);
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 16px 32px rgba(48, 34, 22, 0.12);
  color: var(--navy-deep);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  transform: translateX(-50%);
}

.app-top-notice[hidden] {
  display: none !important;
}

.app-top-notice--info {
  border-color: rgba(63, 95, 136, 0.16);
  color: var(--navy-deep);
}

.app-top-notice--warning {
  border-color: rgba(185, 107, 6, 0.2);
  color: var(--amber);
}

.app-dialog {
  width: min(100%, 460px);
  padding: 24px 24px 22px;
  border-radius: 28px;
  border: 1px solid rgba(116, 88, 67, 0.12);
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 24px 60px rgba(48, 34, 22, 0.18);
  display: grid;
  gap: 12px;
}

.app-dialog-kicker {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-dialog-title {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 0.95;
}

.app-dialog-message {
  margin: 0;
  color: var(--slate);
  font-size: 17px;
  line-height: 1.65;
  white-space: pre-line;
  max-height: min(46vh, 420px);
  overflow: auto;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.app-dialog-actions[hidden] {
  display: none !important;
}

.app-dialog-actions .primary-button {
  min-width: 132px;
}

.app-dialog--success {
  border-color: rgba(27, 158, 119, 0.18);
}

.app-dialog--success .app-dialog-kicker {
  color: #1b9e77;
}

.app-dialog--warning {
  border-color: rgba(198, 104, 15, 0.2);
}

.app-dialog--warning .app-dialog-kicker {
  color: #c6680f;
}

.app-dialog--error {
  border-color: rgba(191, 74, 74, 0.22);
}

.app-dialog--error .app-dialog-kicker {
  color: #bf4a4a;
}

.admin-topbar-title {
  flex: 1;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.locale-dropdown {
  position: relative;
  display: inline-flex;
}

.locale-select,
.ghost-button,
.primary-button,
.button-link {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.locale-select {
  min-width: 88px;
  padding-right: 42px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--navy-deep) 50%) calc(100% - 24px) calc(50% - 4px) / 8px 8px no-repeat,
    linear-gradient(135deg, var(--navy-deep) 50%, transparent 50%) calc(100% - 18px) calc(50% - 4px) / 8px 8px no-repeat,
    rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--navy-deep);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy-deep);
  border: 1px solid var(--line);
}

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

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.page {
  width: min(var(--max-width), calc(100vw - 28px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.page-view[hidden] {
  display: none !important;
}

.section-block-first {
  margin-top: 0;
}

.hero-grid,
.overview-grid,
.finance-grid,
.withdraw-grid,
.two-column-ledger,
.three-column-ledger,
.form-grid,
.dev-fields,
.metric-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: stretch;
  gap: 28px;
}

.trust-panel,
.surface-card,
.step-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trust-panel,
.surface-card {
  border-radius: var(--radius-xl);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 0 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.eyebrow-blue {
  color: var(--navy);
}

.hero-title,
h1,
h2,
h3 {
  margin: 0;
}

.hero-title {
  display: grid;
  gap: 4px;
  font-family: "Newsreader", serif;
  font-size: clamp(44px, 5vw, 78px);
  line-height: 0.93;
  letter-spacing: -0.05em;
}

.hero-accent {
  color: var(--orange);
  font-style: italic;
}

.hero-summary,
.section-copy,
.microcopy,
.trust-list,
.info-stack span,
.stack-meta,
.box-subtitle {
  color: var(--muted);
}

.hero-summary,
.section-copy {
  max-width: 720px;
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.75;
}

.step-row {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(178px, 1fr);
  gap: 18px;
}

.step-card {
  border-radius: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.step-index {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 16px;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.step-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.1;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.trust-panel,
.surface-card {
  padding: 24px;
}

.trust-stack {
  display: grid;
  gap: 22px;
}

.trust-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.trust-shield {
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.trust-title-label {
  margin: 0;
}

.trust-divider {
  height: 1px;
  margin: 18px 0 22px;
  background: rgba(116, 88, 67, 0.12);
}

.trust-field {
  display: grid;
  gap: 12px;
}

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

.trust-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.06);
}

.trust-pill strong {
  color: var(--navy);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.trust-pill-wide strong {
  color: var(--ink);
  word-break: break-all;
}

.deposit-wallet-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.deposit-wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trust-copy-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  box-shadow: none;
}

.trust-copy-button span {
  font-size: 18px;
}

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

.overview-contract-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.06);
}

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

.overview-contract-box-name {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.overview-contract-mode {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.overview-contract-address {
  color: var(--navy);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.overview-contract-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.overview-contract-actions .link-button {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

.overview-contract-empty {
  padding: 18px;
  border-radius: 28px;
  background: rgba(246, 243, 238, 0.92);
  color: var(--muted);
}

.trust-cta-slot .link-button {
  width: 100%;
  justify-content: center;
  min-height: 78px;
  border: 3px solid rgba(63, 95, 136, 0.9);
  color: var(--navy);
  background: transparent;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trust-head,
.section-minihead,
.card-head,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trust-head {
  margin-bottom: 0;
  align-items: center;
}

.trust-head h2,
.section-header h2,
.section-minihead h2 {
  font-family: "Newsreader", serif;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.live-chip,
.status-chip,
.status-pill,
.box-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
}

.live-chip,
.status-pill.valid {
  background: rgba(29, 135, 84, 0.12);
  color: var(--green);
  border-color: rgba(29, 135, 84, 0.18);
}

.status-pill-inline {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-chip,
.status-pill.bound {
  background: rgba(63, 95, 136, 0.1);
  color: var(--navy);
  border-color: rgba(63, 95, 136, 0.14);
}

.status-pill.pending {
  background: rgba(185, 107, 6, 0.12);
  color: var(--amber);
  border-color: rgba(185, 107, 6, 0.2);
}

.status-pill.frozen,
.status-pill.rejected {
  background: rgba(161, 70, 61, 0.12);
  color: var(--red);
  border-color: rgba(161, 70, 61, 0.2);
}

.status-pill.status-active {
  background: rgba(29, 135, 84, 0.12);
  color: var(--green);
  border-color: rgba(29, 135, 84, 0.18);
}

.status-pill.status-closing {
  background: rgba(185, 107, 6, 0.12);
  color: var(--amber);
  border-color: rgba(185, 107, 6, 0.2);
}

.status-pill.status-closed,
.status-pill.status-retired,
.status-pill.status-expired {
  background: rgba(63, 95, 136, 0.1);
  color: var(--navy);
  border-color: rgba(63, 95, 136, 0.14);
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card,
.list-item,
.box-item {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(116, 88, 67, 0.08);
  background: var(--surface-strong);
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.metric-card small,
.trust-list small,
.value-small {
  color: var(--muted);
  font-size: 12px;
}

.trust-list {
  display: grid;
  gap: 12px;
}

.trust-list div,
.info-stack div {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(116, 88, 67, 0.08);
}

.trust-list div:last-child,
.info-stack div:last-child {
  border-bottom: 0;
}

.trust-list strong,
.info-stack strong {
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.overview-grid,
.finance-grid,
.withdraw-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

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

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

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

.collections-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border: 1px solid rgba(116, 88, 67, 0.08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar-chip-active {
  background: rgba(63, 95, 136, 0.12);
  color: var(--navy);
  border-color: rgba(63, 95, 136, 0.14);
}

.highlight-card {
  background:
    radial-gradient(circle at top right, rgba(180, 75, 10, 0.1), transparent 32%),
    rgba(255, 255, 255, 0.86);
  border-color: var(--line-strong);
}

.section-block {
  margin-top: 36px;
  padding: 0;
  border: 0;
  background: transparent;
}

.stat-card {
  display: grid;
  gap: 10px;
  min-height: 176px;
}

.stat-value {
  font-family: "Newsreader", serif;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.referral-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.history-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.referral-hero-grid,
.protocol-grid,
.protocol-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.referral-access-card,
.referral-bind-card,
.protocol-hero-card,
.protocol-copy-card,
.history-table-card {
  min-height: 100%;
}

.referral-link-stack,
.protocol-card-stack,
.referral-rule-list,
.protocol-copy-card {
  display: grid;
  gap: 14px;
}

.referral-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.referral-meta-row strong {
  color: var(--ink);
  margin-right: 6px;
}

.referral-meta-row em {
  font-style: normal;
}

.referral-rule-list div,
.protocol-inline-card,
.protocol-copy-block {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.06);
}

.referral-rule-list strong,
.protocol-inline-card span,
.protocol-copy-block .eyebrow {
  font-size: 12px;
}

.referral-rule-list span,
.protocol-inline-card strong,
.protocol-copy-block h3 {
  font-size: 24px;
  color: var(--navy);
  font-family: "Newsreader", serif;
  letter-spacing: -0.03em;
}

.referral-how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.ritual-card {
  position: relative;
  padding-top: 72px;
}

.ritual-index {
  position: absolute;
  top: 22px;
  left: 24px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.ritual-card h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.referral-ledger-grid {
  margin-top: 20px;
}

.history-table-shell {
  overflow-x: auto;
}

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

.history-table th,
.history-table td {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(116, 88, 67, 0.08);
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-table td {
  font-size: 14px;
  color: var(--ink);
}

.history-table .link-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.protocol-badge-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.protocol-summary-card {
  min-height: 100%;
}

.protocol-summary-stack {
  display: grid;
  gap: 14px;
}

.protocol-hero-card h3,
.protocol-copy-card h3 {
  font-size: 34px;
  font-family: "Newsreader", serif;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.protocol-summary-card h3,
.protocol-box-card h3 {
  font-size: 30px;
  font-family: "Newsreader", serif;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.protocol-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.protocol-box-card {
  display: grid;
  gap: 16px;
}

.protocol-box-card-empty {
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.protocol-box-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.protocol-box-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.protocol-box-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(40, 66, 97, 0.12);
  background: rgba(234, 238, 244, 0.92);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.protocol-box-type-pill-jackpot {
  border-color: rgba(193, 92, 3, 0.12);
  background: rgba(255, 243, 233, 0.96);
  color: var(--accent);
}

.protocol-section-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.protocol-box-current,
.protocol-history-list {
  display: grid;
  gap: 12px;
}

.protocol-box-meta-row,
.protocol-history-item {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.06);
}

.protocol-box-meta-row span,
.protocol-history-meta,
.protocol-inline-muted,
.protocol-empty-copy {
  color: var(--muted);
  font-size: 14px;
}

.protocol-box-meta-row strong,
.protocol-history-main strong {
  color: var(--ink);
  font-size: 18px;
}

.protocol-box-actions {
  display: flex;
}

.protocol-box-actions .link-button {
  min-height: 52px;
  width: 100%;
  border-width: 2px;
  justify-content: center;
}

.protocol-history-block {
  display: grid;
  gap: 10px;
}

.protocol-history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.protocol-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-header {
  margin-bottom: 20px;
}

.section-header-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-minihead-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-filter-field {
  display: block;
}

.history-filter-select {
  min-width: 180px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  padding: 0 24px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.history-pagination-controls span {
  color: var(--muted);
  font-size: 14px;
}

.section-copy-compact {
  max-width: none;
  margin-top: 0;
  font-size: 15px;
  line-height: 1.7;
}

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

.single-gap {
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(116, 88, 67, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.box-grid {
  position: relative;
  overflow: hidden;
  padding-bottom: 8px;
}

.box-rail-track {
  display: flex;
  align-items: stretch;
  gap: 20px;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.box-item {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 0 0 clamp(320px, 31vw, 400px);
  width: clamp(320px, 31vw, 400px);
  cursor: pointer;
}

.box-item-jackpot {
  border-color: rgba(185, 107, 6, 0.32);
  box-shadow:
    0 24px 60px rgba(66, 49, 30, 0.08),
    0 0 0 1px rgba(185, 107, 6, 0.08);
}

.box-item h3 {
  font-size: 24px;
  font-family: "Newsreader", serif;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.box-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.box-price-line,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.box-price-line strong {
  color: var(--orange);
  font-size: 26px;
}

.box-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-1 {
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 236, 196, 0.28), transparent 16%),
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.12), transparent 12%),
    linear-gradient(180deg, #3a271a 0%, #5d3822 100%);
}

.visual-2 {
  background:
    radial-gradient(circle at 18% 22%, rgba(188, 222, 255, 0.32), transparent 16%),
    radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.16), transparent 12%),
    linear-gradient(180deg, #17314e 0%, #27527c 100%);
}

.visual-3 {
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 210, 143, 0.3), transparent 16%),
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.18), transparent 12%),
    linear-gradient(180deg, #45200c 0%, #965220 54%, #e0b06d 100%);
}

.visual-4 {
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 205, 255, 0.32), transparent 16%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.18), transparent 12%),
    linear-gradient(180deg, #251934 0%, #4f2e74 48%, #7c4fc1 100%);
}

.box-visual::before {
  content: "";
  position: absolute;
  inset: 22px 24px auto 24px;
  height: 72%;
  border-radius: 26px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.22), transparent 58%);
  filter: blur(24px);
  opacity: 0.55;
}

.box-visual::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 68%;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(255, 240, 213, 0.42), transparent 68%);
  filter: blur(14px);
  opacity: 0.55;
}

.box-visual-image {
  position: relative;
  z-index: 1;
  width: 66%;
  max-width: 292px;
  max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 26px 40px rgba(15, 10, 8, 0.28));
  user-select: none;
  pointer-events: none;
}

.visual-1 .box-visual-image {
  filter: drop-shadow(0 26px 40px rgba(15, 10, 8, 0.28)) saturate(0.95) brightness(0.98);
}

.visual-2 .box-visual-image {
  filter: drop-shadow(0 26px 40px rgba(6, 24, 45, 0.34)) hue-rotate(32deg) saturate(1.15) brightness(1.02);
}

.visual-3 .box-visual-image {
  filter: drop-shadow(0 26px 40px rgba(41, 18, 3, 0.34)) hue-rotate(-10deg) saturate(1.12) brightness(1.04);
}

.visual-4 .box-visual-image {
  filter: drop-shadow(0 26px 40px rgba(34, 17, 58, 0.38)) hue-rotate(86deg) saturate(1.18) brightness(1.06);
}

.box-visual-dot {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255, 244, 219, 0.92);
  box-shadow: 0 0 24px rgba(255, 244, 219, 0.25);
}

.box-visual-dot-a {
  width: 18px;
  height: 18px;
  right: 24px;
  bottom: 34px;
}

.box-visual-dot-b {
  width: 10px;
  height: 10px;
  left: 28px;
  bottom: 28px;
  background: rgba(255, 255, 255, 0.86);
}

.box-state {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.box-content {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.box-content p {
  min-height: 48px;
  font-size: 15px;
  line-height: 1.5;
}

.box-jackpot-banner {
  position: absolute;
  right: 18px;
  top: 54px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 132px;
  height: 132px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.box-jackpot-coin-stack {
  position: absolute;
  inset: 0;
  display: block;
}

.box-jackpot-coin {
  position: absolute;
  width: 88px;
  height: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.46) 42%, transparent 44%),
    radial-gradient(circle at center, rgba(255, 248, 236, 0.38), rgba(255, 248, 236, 0.08) 68%, transparent 70%);
  box-shadow:
    0 20px 42px rgba(17, 24, 39, 0.24),
    0 0 22px rgba(255, 224, 163, 0.36),
    0 0 0 12px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  animation: boxCoinFloat 3.4s ease-in-out infinite;
}

.box-jackpot-coin-back {
  top: 18px;
  right: 18px;
  opacity: 0.72;
  --coin-rotate: -10deg;
  --coin-scale: 0.9;
  animation-delay: -1.1s;
}

.box-jackpot-coin-front {
  top: 28px;
  right: -6px;
  --coin-rotate: 10deg;
  --coin-scale: 1;
}

.box-jackpot-coin-image {
  width: 76px;
  height: 76px;
  display: block;
  filter:
    drop-shadow(0 10px 16px rgba(17, 24, 39, 0.24))
    drop-shadow(0 0 10px rgba(255, 236, 189, 0.45));
}

.box-rare-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.08);
}

.box-rare-meta-placeholder {
  visibility: hidden;
}

.box-rare-meta-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.box-rare-meta strong {
  color: var(--navy-deep);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes boxCoinFloat {
  0% {
    transform: translateY(0) rotate(var(--coin-rotate, 0deg)) scale(var(--coin-scale, 1));
  }
  50% {
    transform: translateY(-7px) rotate(var(--coin-rotate, 0deg)) scale(var(--coin-scale, 1));
  }
  100% {
    transform: translateY(0) rotate(var(--coin-rotate, 0deg)) scale(var(--coin-scale, 1));
  }
}

.box-subtitle {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.box-progress-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(63, 95, 136, 0.08);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  min-height: 48px;
}

.box-progress-line strong {
  font-size: 12px;
  font-weight: 800;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.history-asset-toggle-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.list-item {
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.asset-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.asset-main {
  display: grid;
  gap: 4px;
}

.asset-balance {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.asset-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.list-head strong {
  font-size: 15px;
}

.stack-meta {
  font-size: 13px;
  line-height: 1.65;
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.box-action,
.inline-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.box-action.primary,
.inline-action.primary {
  background: var(--orange);
  color: #fff;
}

.box-action.secondary,
.inline-action.secondary {
  background: var(--navy-deep);
  color: #fff;
}

.box-action.ghost,
.inline-action.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy-deep);
  border: 1px solid var(--line);
}

.box-action.secondary {
  background: var(--navy-deep);
  color: #fff;
}

.admin-console {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(116, 88, 67, 0.18);
}

.compact-list div {
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 8px 18px;
}

.internal-list {
  margin-top: 8px;
}

.microcopy {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.overview-finance-grid {
  margin-top: 28px;
}

.finance-card {
  display: grid;
  gap: 14px;
}

.finance-split-list {
  display: grid;
  gap: 12px;
}

.finance-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(246, 243, 238, 0.9);
}

.finance-split-row-compact {
  padding: 10px 14px;
}

.finance-split-row strong {
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.deposit-transfer-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.icon-button,
.icon-badge {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(116, 88, 67, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy-deep);
  font-size: 20px;
  font-weight: 800;
}

.icon-button {
  cursor: pointer;
}

.icon-badge.connected {
  color: var(--green);
  border-color: rgba(29, 135, 84, 0.2);
  background: rgba(29, 135, 84, 0.08);
}

.icon-badge.disconnected {
  color: var(--muted);
}

.finance-value {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.finance-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.finance-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(116, 88, 67, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.finance-footer strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.finance-form {
  margin-top: 4px;
}

.finance-cta-row {
  margin-top: 10px;
}

.withdraw-banner-card {
  display: grid;
  gap: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

span#txHash,
span#randomWord,
span#savedContractAddress,
span#publicContract,
span#walletAddress,
span#inviteLinkDisplay,
span#contractOwner,
span#contractAuthorizedSigner,
span#publicRpcUrl,
span#publicExplorer {
  word-break: break-all;
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
}

.admin-sidebar-identity {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.admin-side-nav {
  display: grid;
  gap: 8px;
}

.admin-side-nav a,
.docs-side-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--navy-deep);
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.admin-side-nav a.is-active,
.docs-side-nav a.is-active {
  color: var(--orange);
  border-color: rgba(198, 104, 15, 0.22);
  background: rgba(255, 247, 240, 0.96);
}

.docs-side-nav {
  display: grid;
  gap: 8px;
}

.admin-content {
  display: grid;
  gap: 20px;
}

.docs-content {
  display: grid;
  gap: 20px;
}

.admin-panel-group {
  margin: 0;
}

.docs-card {
  display: grid;
  gap: 16px;
}

.docs-card h3 {
  font-size: 30px;
  font-family: "Newsreader", serif;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.docs-table,
.docs-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.docs-table div,
.docs-list li {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(246, 243, 238, 0.92);
  border: 1px solid rgba(116, 88, 67, 0.06);
}

.docs-table div {
  display: grid;
  gap: 6px;
}

.docs-table strong {
  color: var(--ink);
}

.docs-table span,
.docs-list li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

#withdrawTokenCodeInput:disabled,
#withdrawTokenCodeInput option:disabled {
  color: #9aa3b2;
}

@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .box-grid {
    grid-auto-columns: minmax(320px, calc((100% - 20px) / 2));
  }

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

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }
}

@media (max-width: 980px) {
  .topbar-inner {
    align-items: center;
    gap: 14px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .topbar-panel {
    display: none;
    width: 100%;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 0 16px;
  }

  .topbar-panel.is-open {
    display: flex;
  }

  .topnav {
    display: grid;
    gap: 10px;
  }

  .topnav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(116, 88, 67, 0.08);
  }

  .topnav a.is-active {
    padding-bottom: 0;
    border-bottom: 1px solid rgba(198, 104, 15, 0.22);
    background: rgba(255, 247, 240, 0.96);
  }

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

  .locale-dropdown,
  .wallet-menu-shell {
    width: 100%;
  }

  .wallet-menu {
    position: static;
    margin-top: 10px;
    min-width: 0;
  }

  .overview-grid,
  .finance-grid,
  .withdraw-grid,
  .referral-stat-grid,
  .history-stat-grid,
  .referral-hero-grid,
  .protocol-grid,
  .protocol-overview-grid,
  .protocol-box-grid,
  .referral-how-grid,
  .three-column-ledger,
  .two-column-ledger,
  .metric-grid,
  .form-grid,
  .dev-fields,
  .step-row {
    grid-template-columns: 1fr;
  }

  .page {
    padding-top: 26px;
  }

  .trust-metric-grid {
    grid-template-columns: 1fr;
  }

  .overview-contract-grid {
    grid-template-columns: 1fr;
  }

  .box-grid {
    grid-auto-columns: 86%;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    min-height: 66px;
    width: min(var(--max-width), calc(100vw - 18px));
  }

  .page {
    width: min(var(--max-width), calc(100vw - 18px));
    padding-bottom: 48px;
  }

  .hero-copy,
  .trust-panel,
  .surface-card,
  .section-block {
    padding: 18px;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button,
  .locale-select {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .hero-title {
    font-size: 44px;
  }

  .stat-value {
    font-size: 36px;
  }

  .docs-card h3,
  .protocol-summary-card h3,
  .protocol-box-card h3,
  .ritual-card h3 {
    font-size: 24px;
  }

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

  .section-minihead-inline {
    align-items: stretch;
    flex-direction: column;
  }

  .history-pagination-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .history-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .history-filter-select {
    width: 100%;
    min-width: 0;
  }

  .history-pagination-controls span {
    text-align: center;
  }

  .box-price-line strong {
    font-size: 24px;
  }

  .button-row,
  .list-actions {
    flex-direction: column;
  }

  .button-row > *,
  .list-actions > *,
  .box-action,
  .inline-action,
  .ghost-button,
  .primary-button,
  .locale-select,
  .mobile-nav-toggle {
    width: 100%;
  }

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

  .docs-sidebar {
    gap: 12px;
  }

  .docs-side-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .docs-side-nav::-webkit-scrollbar {
    display: none;
  }

  .docs-side-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .protocol-history-main,
  .protocol-history-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-table-shell {
    overflow: visible;
  }

  .history-table {
    display: block;
  }

  .history-table thead {
    display: none;
  }

  .history-table tbody {
    display: grid;
    gap: 12px;
  }

  .history-table tr {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(116, 88, 67, 0.08);
    background: rgba(246, 243, 238, 0.92);
  }

  .history-table td {
    display: grid;
    gap: 6px;
    padding: 0;
    border-bottom: 0;
  }

  .history-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .history-table .history-empty-row td::before {
    content: none;
  }
}
