:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-soft: #eef2ec;
  --text: #1b211f;
  --muted: #68716d;
  --line: #dce2dc;
  --accent: #17634f;
  --accent-dark: #0f4b3b;
  --blue: #2d5f91;
  --danger: #a13f3f;
  --shadow: 0 24px 60px rgba(34, 48, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(120deg, rgba(23, 99, 79, 0.08), transparent 30%),
    linear-gradient(280deg, rgba(45, 95, 145, 0.08), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 42px;
}

.hero {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: end;
  padding: 20px 0 26px;
}

.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.mark {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(23, 99, 79, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #fdfdfb, #e8efe9);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  grid-template-columns: repeat(3, 8px);
  gap: 5px;
}

.mark span {
  width: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.mark span:nth-child(1) {
  height: 22px;
  opacity: 0.62;
}

.mark span:nth-child(2) {
  height: 36px;
}

.mark span:nth-child(3) {
  height: 28px;
  background: var(--blue);
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.96;
  font-weight: 760;
}

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

.hero-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.fact span,
.status-line span,
.preview-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong,
.fact strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.grid {
  display: grid;
  grid-template-columns: 0.92fr 1.18fr;
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.action-panel,
.facts-panel,
.log-panel {
  grid-column: 1;
}

.form-panel,
.preview-panel {
  grid-column: 2;
}

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

.panel-head.compact {
  margin-bottom: 14px;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button.subtle {
  background: var(--surface-soft);
  color: var(--text);
  border-color: #d6ddd7;
}

.button.subtle:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  border-color: #bec9c1;
}

.button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border-color: var(--line);
}

.button.full {
  width: 100%;
  margin-top: 14px;
}

.wallet-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wallet-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.button.selector {
  background: #fbfcfa;
  color: var(--muted);
  border-color: var(--line);
}

.button.selector.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.status-line {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code {
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #27302d;
}

.balance {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.balance strong {
  display: block;
  color: var(--text);
  margin-top: 4px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

.field input:focus {
  border-color: rgba(23, 99, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(23, 99, 79, 0.09);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.quote-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-top: 18px;
}

.approval-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.44fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.approval-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.facts-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.fact strong {
  overflow-wrap: anywhere;
}

.preview-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

pre {
  min-height: 150px;
  max-height: 280px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #d4ddd6;
  background: #111a17;
  color: #d6f1e5;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.notice.error {
  color: var(--danger);
}

.notice.ok {
  color: var(--accent-dark);
}

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

.links a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 95, 145, 0.3);
  font-size: 13px;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .brand-row {
    align-items: flex-start;
  }

  .hero-side,
  .facts-panel,
  .quote-row,
  .approval-row {
    grid-template-columns: 1fr;
  }

  .action-panel,
  .form-panel,
  .facts-panel,
  .preview-panel,
  .log-panel {
    grid-column: 1;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .balance {
    text-align: left;
  }

  .preview-grid,
  .status-line {
    grid-template-columns: 1fr;
  }
}
