@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: oklch(0.958 0.004 250);
  --paper: oklch(0.982 0.003 255);
  --card: oklch(0.995 0.002 255);
  --surface: oklch(0.968 0.004 252);
  --ink: oklch(0.225 0.015 262);
  --soft: oklch(0.45 0.018 258);
  --dim: oklch(0.6 0.014 255);
  --line: color-mix(in oklch, var(--ink) 13%, transparent);
  --line-strong: color-mix(in oklch, var(--ink) 23%, transparent);
  --accent: oklch(0.5 0.19 264);
  --accent-deep: oklch(0.42 0.17 265);
  --accent-soft: color-mix(in oklch, var(--accent) 10%, transparent);
  --green: oklch(0.52 0.1 162);
  --danger: #b4231d;
  --display:
    "Schibsted Grotesk", "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --sidebar-width: 238px;
  --shell-max: 1160px;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--display);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-size: var(--text-base);
  line-height: 1.65;
  background: var(--canvas);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 46%, transparent);
  outline-offset: 3px;
}

a {
  color: inherit;
}

button {
  transition-property: transform, color, background-color, border-color;
  transition-duration: 160ms;
}

button:active:not(:disabled) {
  transform: scale(0.96);
}

[hidden] {
  display: none !important;
}

.skip {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  color: var(--paper);
  background: var(--ink);
  font-size: var(--text-sm);
  text-decoration: none;
}

.skip:focus {
  transform: translateY(0);
}

.shell {
  display: flex;
  min-height: 100dvh;
  background: var(--canvas);
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 0 0 14px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 24px 22px 20px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
}

.brand-mark {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--accent);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--soft);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.nav-item svg {
  flex: 0 0 16px;
}

.nav-item.selected {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.sidebar-account {
  margin-top: auto;
  padding: 16px 14px 8px;
}

.sidebar-account .button {
  width: 100%;
}

.login-funds {
  margin: 0 0 22px;
  color: var(--soft);
  font-size: var(--text-xs);
}

.login-form {
  display: grid;
  gap: 16px;
  max-width: 360px;
  padding: 8px 0 24px;
}

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

.login-field label {
  color: var(--soft);
  font-size: var(--text-sm);
}

.login-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--card);
  font-size: var(--text-sm);
}

.login-field input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(124, 165, 255, 0.12);
}

.login-form .field-error {
  min-height: 1.4em;
  margin: 0;
}

.login-form .button.primary {
  width: fit-content;
  min-width: 96px;
}

.workspace-label {
  display: block;
  color: var(--soft);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.sidebar-bottom #identity {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: var(--text-sm);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--green);
}

.workspace {
  flex: 1;
  min-width: 0;
}

main {
  width: min(var(--shell-max), 100%);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 56px) clamp(24px, 4vw, 64px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 26px;
}

.page-heading > div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.page-heading p {
  color: var(--soft);
  font-size: var(--text-base);
}

.page-heading .view-label {
  color: var(--soft);
  font-size: var(--text-sm);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: transparent;
  font: 700 var(--text-sm) / 1 var(--display);
  white-space: nowrap;
}

.button.primary {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}

.button.quiet {
  min-height: 42px;
  padding: 0 16px;
  color: #11151f;
  border-color: #f4f6fa;
  background: #f4f6fa;
}

.button.quiet svg {
  flex: 0 0 16px;
}

.network-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: var(--text-sm);
}

.network-bar strong {
  font-weight: 600;
  color: var(--ink);
}

.network-bar #network-description:empty {
  display: none;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-sm);
}

.notice.error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--card));
}

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

.metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric > span {
  color: var(--soft);
  font-size: var(--text-sm);
}

.metric small {
  margin-left: 6px;
  color: var(--soft);
  font-size: var(--text-2xs);
}

.metric strong {
  display: block;
  margin: 12px 0 8px;
  overflow-wrap: anywhere;
  font: 650 27px / 1 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric p {
  color: var(--soft);
  font-size: var(--text-2xs);
  text-wrap: pretty;
}

.rate-block {
  min-width: 0;
  margin: 0 0 20px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.rate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.rate-head #rate-label {
  color: var(--soft);
  font-size: var(--text-sm);
  font-weight: 600;
}

.rate-block strong {
  display: block;
  margin: 12px 0 8px;
  overflow-wrap: anywhere;
  font: 650 32px / 1 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.rate-block .subtle {
  max-width: 42em;
}

.rate-block .subtle + .subtle {
  margin-top: 4px;
}

.rate-example {
  margin-top: 10px;
  color: var(--soft);
  font-size: var(--text-xs);
  text-wrap: pretty;
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 0 8px;
  color: var(--soft);
  font-size: var(--text-sm);
}

.source-line strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

.source-line span:empty {
  display: none;
}

.operation-panel {
  min-width: 0;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
}

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

h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.badge {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--soft);
  background: var(--surface);
  font-size: var(--text-2xs);
  font-weight: 600;
  white-space: nowrap;
  text-wrap: pretty;
}

.badge.good {
  color: var(--green);
  background: color-mix(in oklch, var(--green) 12%, transparent);
}

.badge.warn {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.balances {
  margin: 18px 0 16px;
  font-size: var(--text-sm);
}

.balances > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.balances dt {
  color: var(--soft);
}

.balances dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.balances small {
  color: var(--soft);
  font-family: var(--display);
  font-size: var(--text-2xs);
}

.subtle {
  color: var(--soft);
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.order-list {
  margin-top: 18px;
}

.order-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.order-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.order-id {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.order-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--soft);
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.order-facts strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.order-row .actions {
  margin-top: 4px;
}

.order-row .subtle {
  max-width: 42em;
}

.order-row .field-error {
  margin-top: 0;
}

.tools {
  margin-top: 22px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tools summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: var(--soft);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.tools summary::-webkit-details-marker {
  display: none;
}

.tools summary::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.tools[open] summary::before {
  transform: rotate(45deg);
}

.tools #demo-wallet {
  margin-top: 12px;
}

.tools label {
  display: block;
  margin-top: 8px;
  color: var(--soft);
  font-size: var(--text-sm);
}

.tools label small {
  margin-left: 6px;
  font-size: var(--text-2xs);
}

.input-action {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.input-action input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--card);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

.input-action input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(124, 165, 255, 0.12);
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: var(--text-sm);
}

.address,
.wallet-note {
  margin: 18px 0 12px;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  line-height: 1.6;
  text-wrap: pretty;
}

.address {
  font-family: var(--mono);
  line-height: 1.7;
}

.ledger {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.ledger-heading {
  margin-bottom: 8px;
  padding: 18px 0 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
  font-size: var(--text-sm);
}

.table th {
  padding: 13px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.table th:first-child,
.table td:first-child {
  padding-left: 0;
  width: 34%;
}

.table th:nth-child(2) {
  width: 20%;
}

.table th:nth-child(3) {
  width: 24%;
}

.table th:last-child {
  width: 22%;
}

.table td {
  padding: 16px 10px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table td:nth-child(3) {
  font-family: var(--mono);
}

.table .number {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.table .status-cell {
  padding-right: 0;
  text-align: right;
}

.receipt-button {
  max-width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
}

.receipt-button span {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: var(--text-2xs);
}

.empty {
  padding: 38px 0;
  color: var(--soft);
  font-size: var(--text-sm);
}

.empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: var(--text-2xs);
}

dialog {
  width: min(520px, calc(100% - 32px));
  max-height: 85vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--card);
  overscroll-behavior: contain;
  box-shadow: 0 22px 70px rgba(10, 14, 24, 0.18);
}

dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 28%, transparent);
}

dialog h2 {
  font-size: 20px;
  font-weight: 600;
}

.receipt-amount {
  margin: 16px 0 8px;
  font: 700 28px / 1 var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.receipt-amount small {
  margin-left: 6px;
  color: var(--soft);
  font-family: var(--display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
}

.receipt-fields {
  margin: 12px 0 0;
}

.receipt-fields > div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.receipt-fields dt {
  color: var(--soft);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.receipt-fields dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  line-height: 1.55;
  text-wrap: pretty;
}

.receipt-fields dd.mono {
  font-family: var(--mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  text-wrap: pretty;
}

.explorer-link {
  margin-top: 16px;
  font-size: var(--text-sm);
}

.explorer-link a {
  color: var(--accent-deep);
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .button.primary:hover:not(:disabled) {
    border-color: var(--accent-deep);
    background: var(--accent-deep);
  }

  .button:not(.primary):not(.quiet):hover:not(:disabled) {
    border-color: var(--ink);
  }

  .button.quiet:hover:not(:disabled) {
    color: #11151f;
    border-color: #fff;
    background: #fff;
  }

  .nav-item:not(.selected):hover {
    color: var(--accent-deep);
    background: color-mix(in oklch, var(--accent) 7%, transparent);
  }

  .receipt-button:hover {
    color: var(--accent-deep);
  }

  .tools summary:hover {
    color: var(--ink);
  }
}

@media (max-width: 900px) {
  main {
    padding: 28px 24px 48px;
  }

  .metric {
    padding: 18px 16px;
  }

  .metric strong {
    font-size: 24px;
  }

  .rate-block {
    padding: 18px 16px;
  }

  .rate-block strong {
    font-size: 28px;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    width: auto;
    padding: 12px 16px 0;
    border-bottom: 1px solid var(--line);
  }

  .wordmark {
    padding: 8px 4px 10px;
    font-size: 16px;
  }

  .nav {
    flex-direction: row;
    gap: 6px;
    padding: 0 0 8px;
  }

  .nav-item {
    min-height: 44px;
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 10px;
  }

  .sidebar-account {
    margin-top: 0;
    padding: 0 0 12px;
  }

  .sidebar-account .button {
    width: fit-content;
  }

  .sidebar-bottom {
    display: flex;
    align-items: baseline;
    gap: 0;
    margin: 0;
    padding: 0 4px 12px;
  }

  .workspace-label {
    display: inline;
  }

  .sidebar-bottom #identity::before {
    content: " · ";
    color: var(--soft);
  }

  .sidebar-bottom #identity {
    display: inline;
    margin: 0;
  }

  main {
    padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .page-heading {
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 18px;
  }

  h1 {
    font-size: 26px;
  }

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

  .metric:first-child {
    grid-column: 1 / -1;
  }
  .metric:nth-child(3) {
    border-left: 1px solid var(--line);
  }

  .metric + .metric {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .table th:nth-child(3),
  .table td:nth-child(3) {
    display: none;
  }

  .table th:first-child {
    width: 42%;
  }

  .table th:nth-child(2) {
    width: 28%;
  }

  .table th:last-child {
    width: 30%;
  }

  .network-bar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .input-action {
    flex-direction: column;
  }

  .input-action .button {
    width: fit-content;
  }
}

@media (max-width: 390px) {
  .nav-item {
    padding: 8px;
    gap: 6px;
  }

  h1 {
    font-size: 24px;
  }

  .metric strong {
    font-size: 22px;
  }

  .rate-block {
    padding: 16px;
  }

  .rate-block strong {
    font-size: 26px;
  }

  .page-heading .button.quiet {
    padding: 0 12px;
  }

  .table .number,
  .table {
    font-size: var(--text-sm);
  }

  .table .status-cell .badge {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip,
  button {
    transition: none;
  }

  button:active:not(:disabled) {
    transform: none;
  }
}

.network-bar {
  flex-wrap: wrap;
}
.network-bar > span:first-child {
  order: 1;
  margin-left: auto;
}
.test-notice {
  font-size: var(--text-xs);
  color: var(--soft);
}
footer {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .metric:nth-child(3) {
    border-left: 1px solid var(--line);
  }
}

.address {
  word-break: break-all;
  text-wrap: balance;
}
@media (max-width: 760px) {
  .table th:first-child {
    width: 32%;
  }
  .table th:nth-child(2) {
    width: 44%;
  }
  .table th:last-child {
    width: 24%;
  }
  .table .badge {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    text-wrap: balance;
  }
  .receipt-button {
    text-wrap: balance;
  }
}
