:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #17202c;
  --muted: #5c6878;
  --line: #dce3ec;
  --primary: #0c6b58;
  --primary-dark: #084d3f;
  --accent: #b45309;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(23, 32, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(20px, 4vw, 52px) 22px;
  background: #17202c;
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  color: #9dd9ce;
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 19px;
}

.status {
  min-width: 116px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  color: #dce3ec;
  font-size: 13px;
  text-align: center;
}

.status.ok {
  border-color: #70e0be;
  color: #70e0be;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.wide {
  grid-column: 1 / -1;
}

.muted-panel {
  background: #fbfcfe;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

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

.transaction-grid {
  grid-template-columns: 1.7fr 1fr 1.8fr 0.8fr 0.8fr 0.8fr auto;
  align-items: end;
}

.config-grid {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  height: 42px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  padding: 0 11px;
}

button {
  border: 0;
  background: var(--primary);
  color: white;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  background: var(--primary-dark);
}

.button-link.disabled {
  pointer-events: none;
  opacity: 0.5;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

button.secondary:hover {
  background: #eef3f8;
}

.button-row {
  display: flex;
  gap: 8px;
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row button {
  white-space: nowrap;
}

.output {
  overflow: auto;
  min-height: 118px;
  max-height: 260px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e6edf3;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.output.compact {
  min-height: auto;
  max-height: 220px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: white;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
}

th {
  background: #eef3f8;
  color: #344054;
  font-size: 13px;
}

td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.deposit {
  background: #dff7ec;
  color: var(--primary-dark);
}

.withdraw {
  background: #fff1e3;
  color: var(--accent);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .button-row {
    grid-column: 1 / -1;
  }
}

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

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .transaction-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }
}
