:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --text: #1e2420;
  --muted: #637067;
  --line: #d9ded5;
  --panel: #ffffff;
  --accent: #0c7a5a;
  --accent-hover: #086949;
  --ink: #1c2d2a;
  --warn: #a85512;
  --shadow: 0 14px 30px rgba(31, 46, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
}

.wallet-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-select {
  height: 44px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p,
.panel-head span,
.metric span,
.details span,
.field span,
.quote-row span {
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel,
.details,
.log {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 86px;
  padding: 16px;
  border-radius: 8px;
}

.metric span,
.details span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.25;
}

.swap-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 18px;
  border-radius: 8px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 122, 90, 0.14);
}

.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.quote-row strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.secondary {
  color: var(--ink);
  background: #edf2ee;
  border: 1px solid var(--line);
}

.secondary:hover:not(:disabled) {
  background: #e4ece6;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
}

.details a {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.details a:hover {
  text-decoration: underline;
}

.log {
  min-height: 74px;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.warn {
  color: var(--warn);
}

@media (max-width: 820px) {
  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-select {
    width: 100%;
  }

  .status-grid,
  .swap-layout,
  .details {
    grid-template-columns: 1fr;
  }

  .topbar .primary {
    width: 100%;
  }
}
