:root {
  color-scheme: dark;
  --bg: #0c1116;
  --bg-soft: #101820;
  --panel: #0f151b;
  --panel-2: #121b24;
  --line: #1f3a52;
  --line-soft: rgba(59, 104, 138, 0.38);
  --text: #e7eef4;
  --muted: #9aa7b1;
  --dim: #6f7e88;
  --blue: #2f86ff;
  --blue-2: #174fd7;
  --green: #28d7a0;
  --green-2: #087a5e;
  --amber: #f7a322;
  --red: #f15d61;
  --purple: #a45cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(28, 81, 117, 0.2), transparent 34rem),
    linear-gradient(180deg, #0d1115 0%, #0b1114 56%, #0a1111 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(38, 55, 66, 0.7);
  border-radius: 8px;
  background: rgba(12, 17, 22, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions,
.panel-heading,
.lookup-title,
.block-top,
.subtabs,
.legend,
.panel-controls {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(49, 210, 153, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, #124c2f, #272c0e);
  color: #8dffd9;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand small,
.panel-heading small,
.faq-panel small {
  color: var(--muted);
}

.main-tabs,
.segmented,
.subtabs {
  display: flex;
  padding: 4px;
  border-radius: 8px;
  background: rgba(18, 27, 30, 0.88);
  gap: 4px;
}

.main-tabs button,
.segmented button,
.subtabs button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.main-tabs button.active,
.segmented button.active,
.subtabs button.active {
  background: rgba(7, 10, 13, 0.65);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.top-actions {
  justify-content: flex-end;
  gap: 14px;
}

.ghost-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #145caa;
  border-radius: 8px;
  color: #5fb1ff;
  text-decoration: none;
  font-weight: 800;
}

.segmented.small button {
  min-height: 32px;
  padding: 0 13px;
  font-size: 13px;
}

main {
  padding-top: 14px;
}

.tab-page,
.address-detail {
  display: none;
}

.tab-page.active,
.address-detail.active {
  display: block;
}

.hero-grid,
.chart-grid,
.address-layout {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: 2fr 1fr 1fr 2fr;
  align-items: stretch;
}

.chart-grid,
.address-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 16px;
}

.panel,
.share-card,
.spark-card,
.reward-card,
.lookup-band {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 30, 0.95), rgba(10, 15, 19, 0.96));
  box-shadow: 0 0 0 1px rgba(10, 22, 34, 0.42), var(--shadow);
}

.panel,
.share-card,
.spark-card,
.reward-card {
  overflow: hidden;
}

.share-card {
  padding: 22px;
  background: linear-gradient(140deg, #1648b4 0%, #2220ad 100%);
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(118, 164, 194, 0.15);
}

.panel .panel-heading {
  padding: 16px 18px 14px;
}

.panel-heading h2,
.lookup-title h1,
.faq-panel h3 {
  margin: 0;
}

.panel-heading h2 {
  font-size: 17px;
}

.mini-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: #78ffe2;
  font-weight: 850;
}

.status-pill,
.block-top span,
.subtabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(40, 215, 160, 0.15);
  color: #78f9d0;
  font-size: 12px;
  font-weight: 850;
}

.share-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding-top: 20px;
}

.donut {
  position: relative;
  display: grid;
  width: 138px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1649ba 0 54%, transparent 55%),
    conic-gradient(#f5f7ff calc(var(--value) * 1turn), rgba(255, 255, 255, 0.18) 0);
}

.donut span {
  font-size: 31px;
  font-weight: 900;
}

.donut small {
  position: absolute;
  bottom: 35px;
  color: #c3d5ff;
}

.stacked-metrics {
  display: grid;
  gap: 18px;
}

.stacked-metrics span,
.spark-card span,
.bar-row span,
.pending-line span,
.block-card time,
.block-card footer,
.account-card small,
.calculator-grid span,
.faq-panel p,
.empty-state,
.lookup-title p,
.settlement-card small,
.payout-row span,
.ledger-item small {
  color: var(--muted);
}

.stacked-metrics strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 30px;
}

.spark-card {
  min-height: 178px;
  padding: 20px;
}

.spark-card strong {
  display: block;
  margin-top: 10px;
  font-size: 33px;
}

.spark-card canvas {
  width: 100%;
  height: 74px;
  margin-top: 12px;
}

.reward-card {
  padding: 22px;
  background: linear-gradient(135deg, #0aa86e, #08796c);
}

.reward-card .panel-heading {
  border-color: rgba(255, 255, 255, 0.12);
}

.bar-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 104px;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}

.bar-row i,
.progress-line {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.bar-row i::before,
.progress-line i {
  content: "";
  display: block;
  width: var(--bar, 40%);
  height: 100%;
  border-radius: inherit;
  background: #071115;
}

.bar-row strong,
.pending-line strong,
.block-value {
  color: #6effd5;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.pending-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.panel {
  margin-top: 16px;
}

.chart {
  display: block;
  width: 100%;
  height: 320px;
  padding: 8px 14px 16px;
}

.legend {
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border-radius: 999px;
}

.legend .blue {
  background: var(--blue);
}

.legend .green {
  background: var(--green);
}

.block-strip,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.block-card {
  min-height: 132px;
  padding: 15px;
  border: 1px solid rgba(45, 102, 148, 0.68);
  border-radius: 8px;
  background: #0f151a;
}

.block-top {
  justify-content: space-between;
  gap: 10px;
}

.block-top strong {
  color: var(--amber);
  font-size: 20px;
}

.block-top span.confirmed {
  background: rgba(40, 215, 160, 0.15);
  color: #55e8bb;
}

.block-top span.pending {
  background: rgba(47, 134, 255, 0.14);
  color: #5facff;
}

.block-card time {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

.block-value {
  margin: 8px 0 10px;
  font-size: 17px;
}

.progress-line i {
  width: var(--progress, 40%);
  background: var(--blue);
}

.block-card.is-confirmed .progress-line i {
  background: var(--green);
}

.block-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(120, 158, 186, 0.18);
  font-size: 12px;
}

.page-panel {
  min-height: 540px;
}

.panel-controls {
  gap: 12px;
}

select,
input {
  min-height: 40px;
  border: 1px solid rgba(68, 111, 146, 0.7);
  border-radius: 8px;
  background: #0a1015;
  color: var(--text);
  outline: 0;
}

select {
  padding: 0 12px;
}

input {
  padding: 0 14px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.16);
}

.lookup-band {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
  border-color: rgba(38, 80, 186, 0.8);
  background: linear-gradient(135deg, #1659c9, #2116b8);
}

.lookup-title {
  gap: 14px;
}

.lookup-title h1 {
  font-size: 24px;
}

.lookup-title p {
  margin: 6px 0 0;
  color: #bdd3ff;
}

.address-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
}

.address-form button {
  min-height: 44px;
  border-radius: 8px;
  background: #071016;
  color: #4aa5ff;
  font-weight: 900;
}

.address-form input {
  background: #0a1015;
  border-color: transparent;
}

.account-card {
  padding-bottom: 18px;
}

.account-card > small,
.account-card > strong,
.balance-box {
  margin-inline: 18px;
}

.account-card > strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #43a4ff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(11, 111, 78, 0.32);
}

.balance-box.amber {
  border: 1px solid rgba(247, 163, 34, 0.65);
  background: rgba(105, 66, 0, 0.35);
}

.balance-box strong {
  display: block;
  margin-top: 8px;
  color: #78ffe2;
  font-size: 30px;
}

.balance-box.amber strong {
  color: #ffb453;
}

.address-chart-card .chart {
  height: 256px;
}

.subtabs {
  margin-top: 16px;
  justify-content: flex-start;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  background: #0d141a;
}

.subtabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.empty-state {
  margin: 0;
  padding: 42px 18px;
  text-align: center;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.calculator-grid label,
.calculator-grid div {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(52, 91, 119, 0.55);
  border-radius: 8px;
  background: #0c1318;
  color: var(--muted);
}

.calculator-grid strong {
  color: var(--green);
  font-size: 19px;
}

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

.ledger-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.ledger-item {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(27, 156, 104, 0.7);
  border-radius: 8px;
  background: rgba(8, 80, 53, 0.18);
}

.ledger-item strong:last-child {
  color: #69ffd3;
  font-size: 23px;
}

.settlement-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 18px;
  padding: 18px;
}

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

.settlement-card,
.payout-row {
  border: 1px solid rgba(52, 91, 119, 0.55);
  border-radius: 8px;
  background: #0c1318;
}

.settlement-card {
  padding: 15px;
}

.settlement-card strong {
  color: var(--amber);
  font-size: 21px;
}

.settlement-table {
  padding: 16px;
  border: 1px solid rgba(52, 91, 119, 0.55);
  border-radius: 8px;
  background: #0a1015;
}

.settlement-table h3 {
  margin: 0 0 12px;
}

.payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
}

.payout-row strong {
  color: var(--green);
}

.payout-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-panel {
  padding-bottom: 12px;
}

.faq-panel article {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 18px;
  border-top: 1px solid rgba(120, 158, 186, 0.16);
}

.faq-panel article > span {
  color: var(--amber);
  font-size: 24px;
  font-weight: 900;
}

.faq-panel pre {
  overflow: auto;
  margin: 12px 0 0;
  padding: 16px;
  border: 1px solid rgba(52, 91, 119, 0.7);
  border-radius: 8px;
  background: #080e12;
  color: #80ffd9;
}

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

  .main-tabs,
  .top-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .chart-grid,
  .address-layout,
  .lookup-band,
  .settlement-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1420px);
    padding-top: 12px;
  }

  .hero-grid,
  .block-strip,
  .cards-grid,
  .compact-grid,
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .share-body,
  .address-form,
  .ledger-item {
    grid-template-columns: 1fr;
  }

  .share-body {
    justify-items: start;
  }

  .panel-heading,
  .panel-controls,
  .pending-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 58px minmax(0, 1fr) 84px;
    gap: 10px;
  }

  .bar-row strong,
  .pending-line strong {
    font-size: 18px;
  }
}
