:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --panel-2: #eef3f1;
  --line: #d9e1de;
  --text: #17211d;
  --muted: #64716c;
  --green: #12b981;
  --green-2: #0b8d63;
  --red: #d33f49;
  --amber: #9a6a05;
  --input: #fbfdfc;
  --shadow: 0 18px 48px rgba(22, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(18, 185, 129, 0.12), transparent 300px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.resultsBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand img {
  width: 36px;
  height: 36px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: 0;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 24px;
}

.inputPane,
.summaryPane,
.tableWrap,
.resultsBar {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inputPane {
  padding: 16px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  height: 300px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 14px;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 185, 129, 0.16);
}

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

.actions {
  margin-top: 14px;
}

button {
  border: 1px solid var(--green-2);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font-weight: 650;
}

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

button.secondary {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.buttonIcon {
  display: inline-block;
  margin-right: 6px;
}

.summaryPane {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.metric {
  min-height: 118px;
  padding: 18px;
  background: var(--panel);
}

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

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

.metric.total {
  grid-column: 1 / -1;
}

.resultsBar {
  margin-top: 16px;
  padding: 12px 14px;
  color: var(--muted);
}

.tableWrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

td {
  font-size: 13px;
}

.wallet {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.amount {
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--green-2);
  font-weight: 700;
}

.warning {
  color: var(--amber);
}

.error {
  color: var(--red);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 56px 16px;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 14px;
  }

  .topbar,
  .resultsBar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  textarea {
    height: 240px;
  }
}
