:root {
  --bg: #f2ede5;
  --panel: rgba(255, 250, 244, 0.9);
  --panel-strong: #12263a;
  --card: #fffaf3;
  --line: rgba(18, 38, 58, 0.1);
  --text: #12263a;
  --muted: #5f6772;
  --gold: #b98b39;
  --gold-soft: #ead1a3;
  --green: #2f7d61;
  --red: #9a4c3d;
  --shadow: 0 24px 60px rgba(16, 27, 39, 0.1);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(185, 139, 57, 0.18), transparent 22%),
    radial-gradient(circle at 80% 14%, rgba(18, 38, 58, 0.12), transparent 20%),
    linear-gradient(180deg, #f7f1e8 0%, var(--bg) 55%, #f4ede3 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
.brand strong {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  width: min(1480px, calc(100% - 32px));
  margin: 16px auto;
}

.sidebar,
.hero-card,
.section-card,
.auth-card,
.site-footer,
.page-header {
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 32px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 30px;
  background: rgba(255, 250, 244, 0.84);
  box-shadow: var(--shadow);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: block;
  width: 100%;
}

.brand img {
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

.language-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.language-box span,
.tier-row span,
.hero-stat span,
.snapshot-grid span,
.field-block label,
.faq-item p,
.section-sub,
.sidebar-note {
  color: var(--muted);
}

.language-box select,
.field-block select,
.auth-form input,
.auth-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
}

.auth-form textarea {
  min-height: 160px;
  padding: 14px;
  resize: vertical;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-nav a {
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(18, 38, 58, 0.03);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible {
  border-color: rgba(185, 139, 57, 0.25);
  background: rgba(185, 139, 57, 0.1);
}

.sidebar-nav a.active {
  border-color: rgba(185, 139, 57, 0.28);
  background: rgba(185, 139, 57, 0.14);
  color: var(--text);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 2px 0 28px;
}

.hero-card,
.section-card,
.auth-card,
.page-header,
.site-footer {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(18, 38, 58, 0.96) 0%, rgba(27, 48, 66, 0.96) 58%, rgba(185, 139, 57, 0.8) 100%);
  color: #faf5ed;
}

.hero-card .eyebrow,
.hero-card .hero-text,
.hero-card .hero-stat span,
.hero-card .hero-stat small {
  color: rgba(250, 245, 237, 0.78);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.hero-text {
  margin: 18px 0 0;
  max-width: 56ch;
  font-size: 1.04rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.button-primary {
  background: #fff8ee;
  color: var(--text);
}

.button-secondary {
  border-color: rgba(255, 248, 238, 0.34);
  color: #fff8ee;
}

.sidebar-app-link {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(185, 139, 57, 0.22);
  background: linear-gradient(135deg, #12263a 0%, #1f3952 68%, #b98b39 100%);
  color: #fff8ee;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 32px rgba(18, 38, 58, 0.18);
}

.sidebar-app-link:hover,
.sidebar-app-link:focus-visible {
  background: linear-gradient(135deg, #173049 0%, #234260 62%, #c39643 100%);
  color: #fff8ee;
}

.sidebar-install-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.button-small {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
}

.hero-panel {
  display: grid;
  gap: 14px;
}

body.app-mode .sidebar {
  min-height: calc(100vh - 32px);
}

.hero-stat,
.snapshot-grid article,
.info-card,
.rule-card,
.tier-card,
.direction-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.hero-stat {
  padding: 18px;
  background: rgba(255, 250, 244, 0.12);
  border-color: rgba(255, 248, 238, 0.16);
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  color: #fffaf3;
  font-size: 1.3rem;
}

.hero-stat small {
  display: block;
  margin-top: 6px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.page-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.04;
}

.section-sub,
.page-header p {
  margin: 8px 0 0;
}

.card-grid,
.tiers-grid,
.snapshot-grid,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.card-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

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

.info-card,
.rule-card,
.direction-card {
  padding: 22px;
}

.card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: #efe2c7;
  color: var(--gold);
  font-weight: 700;
}

.info-card h3,
.rule-card h3,
.direction-card h3,
.tier-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.info-card p,
.rule-card p,
.direction-card p {
  margin: 0;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(250, 245, 237, 0.82);
}

.hero-points li::before {
  content: "•";
  margin-right: 10px;
  color: var(--gold-soft);
}

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

.tier-card {
  padding: 22px;
}

.tier-label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tier-card h3 {
  margin-bottom: 16px;
  font-size: 2rem;
}

.tier-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.tier-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.tier-row strong,
.snapshot-grid strong {
  font-size: 1.08rem;
}

.tier-row small {
  color: var(--muted);
}

.snapshot-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.tier-row-accent strong {
  color: var(--gold);
}

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

.faq-item {
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.faq-item summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
}

.faq-item p {
  margin: 0 0 18px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 24px;
}

.auth-copy p,
.auth-hint {
  margin: 0;
}

.auth-copy {
  display: grid;
  gap: 14px;
}

.text-link {
  color: var(--gold);
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-submit {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(154, 76, 61, 0.12);
  color: var(--red);
}

.form-success {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(47, 125, 97, 0.12);
  color: var(--green);
}

.support-form {
  max-width: 720px;
}

.kyc-form {
  max-width: 760px;
}

.dashboard-grid {
  grid-template-columns: 360px minmax(0, 1fr);
}

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

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

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.range-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  color: var(--muted);
}

.range-meta strong {
  justify-self: center;
  color: var(--text);
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(18, 38, 58, 0.05);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.live-price {
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 38, 58, 0.06);
}

.live-price strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.live-price small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(47, 125, 97, 0.14);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill.paused {
  background: rgba(154, 76, 61, 0.14);
  color: var(--red);
}

.status-pill.completed {
  background: rgba(185, 139, 57, 0.18);
  color: #946719;
}

.state-note {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 0 18px 18px 0;
  background: rgba(185, 139, 57, 0.08);
}

.state-note.paused {
  border-left-color: var(--red);
  background: rgba(154, 76, 61, 0.08);
}

.state-note.completed {
  border-left-color: var(--green);
  background: rgba(47, 125, 97, 0.08);
}

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

.snapshot-grid article {
  padding: 18px;
}

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

.deposit-grid-member {
  align-items: stretch;
}

.deposit-address-card,
.deposit-qr-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deposit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.copy-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.deposit-qr {
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
  object-fit: contain;
}

.mono-value {
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.94rem;
  line-height: 1.45;
  word-break: break-all;
}

.dashboard-tiers {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1280px) {
  .app-shell,
  .dashboard-grid,
  .hero-card,
  .auth-card,
  .card-grid.four,
  .card-grid.five,
  .tiers-grid,
  .dashboard-tiers {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .card-grid.two,
  .card-grid.three,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto;
    gap: 14px;
  }

  .sidebar,
  .hero-card,
  .section-card,
  .auth-card,
  .site-footer,
  .page-header {
    padding: 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.2rem;
  }
}
