:root {
  color-scheme: light;
  --bg: #eef3f6;
  --bg-soft: #f8fafb;
  --surface: #ffffff;
  --surface-soft: #f6f9fa;
  --surface-strong: #101828;
  --text: #101828;
  --muted: #667085;
  --muted-strong: #475467;
  --line: #d8e2e8;
  --line-strong: #b9c8d2;
  --primary: #0f766e;
  --primary-dark: #0b5d56;
  --primary-soft: rgba(15, 118, 110, 0.1);
  --orange: #f7931a;
  --blue: #2563eb;
  --navy: #344054;
  --amber: #a75a10;
  --danger: #b42318;
  --success: #0a7a42;
  --shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0.4) 240px, rgba(238, 243, 246, 0) 520px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 226, 232, 0.9);
  background: rgba(248, 250, 251, 0.88);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(247, 147, 26, 0.22));
}

.brand-mark circle {
  fill: var(--orange);
}

.brand-mark path {
  fill: white;
}

.brand p,
.panel-heading p,
.metric-label {
  color: var(--muted);
}

.brand p,
.panel-heading p {
  margin-top: 4px;
  font-size: 13px;
}

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

.service-pill,
.network-chip,
.badge,
.wallet-button,
.testnet-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.service-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.wallet-button {
  min-height: 40px;
  border-radius: 8px;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.testnet-chip {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.09);
  color: var(--danger);
}

.wallet-button:hover {
  border-color: var(--primary);
}

.service-pill.is-ok {
  border-color: rgba(10, 122, 66, 0.25);
  background: rgba(10, 122, 66, 0.08);
  color: var(--success);
}

.service-pill.is-error,
.badge.is-failed {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.icon-button:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 34px) 56px;
}

.user-guide,
.notice,
.launch-warning,
.workspace,
.status-band,
.activity-section {
  margin-top: 18px;
}

.notice:first-child,
.launch-warning:first-child,
.user-guide:first-child,
.workspace:first-child {
  margin-top: 0;
}

.launch-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted-strong);
  box-shadow: var(--shadow-soft);
}

.launch-warning strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--danger);
  color: white;
  font-size: 12px;
  white-space: nowrap;
}

.launch-warning span {
  font-size: 14px;
  font-weight: 800;
}

.user-guide {
  display: grid;
  gap: 14px;
}

.guide-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.guide-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

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

.guide-step-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.guide-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: white;
  font-weight: 900;
}

.guide-step-card strong {
  display: block;
  font-size: 14px;
}

.guide-step-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.07);
  color: var(--danger);
  font-weight: 800;
}

.notice.is-success {
  border-color: rgba(10, 122, 66, 0.24);
  background: rgba(10, 122, 66, 0.08);
  color: var(--success);
}

.notice.is-info {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 18px;
  align-items: start;
}

.main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.main-column .status-band {
  margin-top: 0;
}

.bridge-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.side-rail {
  display: grid;
  gap: 18px;
  align-content: start;
}

.settlement-card,
.metric,
.bridge-panel,
.deposit-panel,
.ops-panel,
.activity-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.settlement-card,
.bridge-panel,
.deposit-panel,
.ops-panel {
  padding: 20px;
}

.bridge-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.redeem-panel .panel-kicker {
  color: var(--blue);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.amount-row {
  width: 100%;
}

.field input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.redeem-panel .field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

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

.amount-row span {
  color: var(--text);
  font-weight: 900;
}

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

.quick-amounts button,
.tab,
.copy-button,
.open-button,
.secondary-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 900;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.quick-amounts button:hover,
.tab:hover,
.copy-button:hover,
.open-button:hover,
.secondary-button:hover {
  border-color: var(--primary);
  background: white;
  transform: translateY(-1px);
}

.redeem-panel .quick-amounts button:hover,
.redeem-panel .secondary-button:hover {
  border-color: var(--blue);
}

.primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #a2b2b0;
  box-shadow: none;
  transform: none;
}

.secondary-button:disabled,
.wallet-button:disabled,
.quick-amounts button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #eef2f3;
  color: #9aa7b2;
  box-shadow: none;
  transform: none;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.button-row .primary-button,
.button-row .secondary-button {
  width: 100%;
  margin-top: 0;
}

.wallet-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.wallet-strip span,
.wallet-strip strong {
  overflow-wrap: anywhere;
}

.wallet-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.wallet-strip strong {
  color: var(--text);
  font-size: 13px;
}

.ticket-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #98a7b3;
}

.ticket-empty svg {
  width: 96px;
  height: 96px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}

.ticket {
  display: grid;
  gap: 2px;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  min-height: 50px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ticket-row .ticket-label {
  grid-column: 1 / -1;
}

.ticket-row:last-child,
.item-row:last-child {
  border-bottom: 0;
}

.ticket-label,
.item-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-button,
.open-button {
  min-width: 58px;
  padding: 0 10px;
  font-size: 13px;
}

.open-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

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

.limit-list div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.limit-list span,
.contract-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.limit-list strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.contract-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.contract-row {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.contract-row:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.contract-row strong {
  display: block;
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.flow-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.flow-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.flow-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  font-weight: 900;
}

.btc-icon {
  background: var(--orange);
}

.don-icon {
  background: var(--primary);
}

.evm-icon {
  background: var(--navy);
}

.flow-step strong,
.flow-step span {
  display: block;
}

.flow-step strong {
  font-size: 14px;
}

.flow-step span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.flow-connector {
  height: 2px;
  border-radius: 999px;
  background: var(--line-strong);
}

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

.metric {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 18px;
}

.metric::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.metric:nth-child(1)::after {
  background: var(--orange);
}

.metric:nth-child(2)::after {
  background: var(--blue);
}

.metric:nth-child(3)::after {
  background: var(--primary);
}

.metric:nth-child(4)::after {
  background: var(--navy);
}

.metric-label {
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  white-space: nowrap;
}

.activity-section {
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.tab {
  padding: 0 16px;
}

.tab.is-active {
  background: var(--surface-strong);
  color: white;
  border-color: var(--surface-strong);
}

.activity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
}

.activity-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.activity-item:nth-child(2n) {
  border-right: 0;
}

.activity-item:last-child {
  border-bottom: 0;
}

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

.item-row {
  display: grid;
  grid-template-columns: minmax(94px, 128px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.item-head strong,
.item-row strong {
  overflow-wrap: anywhere;
}

.badge.is-live,
.badge.is-minted,
.badge.is-redeem_completed,
.badge.is-btc_broadcast,
.badge.is-mint_confirmed,
.badge.is-evm_completion_confirmed,
.badge.is-bitcoin_broadcast {
  border-color: rgba(10, 122, 66, 0.25);
  background: rgba(10, 122, 66, 0.08);
  color: var(--success);
}

.badge.is-observed,
.badge.is-btc_observed,
.badge.is-release_prepared,
.badge.is-mint_requested,
.badge.is-release_requested,
.badge.is-redeem_submitted,
.badge.is-intent_created,
.badge.is-awaiting_bitcoin_deposit,
.badge.is-bitcoin_deposit_observed,
.badge.is-external_authorization_requested,
.badge.is-burn_observed,
.badge.is-release_plan_prepared,
.badge.is-evm_completion_submitted,
.badge.is-bitcoin_broadcast_retrying {
  border-color: rgba(167, 90, 16, 0.25);
  background: rgba(167, 90, 16, 0.09);
  color: var(--amber);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .workspace,
  .status-band {
    grid-template-columns: 1fr;
  }

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

  .side-rail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .bridge-stack,
  .side-rail,
  .guide-grid,
  .status-grid,
  .activity-list {
    grid-template-columns: 1fr;
  }

  .activity-item,
  .activity-item:nth-child(2n) {
    border-right: 0;
  }

  .flow-stack {
    grid-template-columns: 1fr;
  }

  .flow-connector {
    width: 2px;
    height: 16px;
    margin-left: 29px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .launch-warning {
    align-items: flex-start;
    flex-direction: column;
  }

  .settlement-card,
  .bridge-panel,
  .deposit-panel,
  .ops-panel {
    padding: 18px;
  }

  .limit-list,
  .button-row,
  .wallet-strip,
  .ticket-row,
  .item-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    width: 100%;
  }

  .copy-button,
  .open-button {
    flex: 1;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 104px;
  }
}
