:root {
  --bg: #f5f1e8;
  --bg-accent: radial-gradient(circle at top left, rgba(12, 98, 84, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(172, 127, 52, 0.18), transparent 28%), #f5f1e8;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fffdf7;
  --ink: #17211c;
  --muted: #5e675f;
  --line: rgba(23, 33, 28, 0.12);
  --brand: #0c6254;
  --brand-deep: #073c34;
  --accent: #ac7f34;
  --danger: #a34d32;
  --shadow: 0 24px 80px rgba(38, 46, 40, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg-accent);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  margin-bottom: 24px;
}

.hero-copy,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 18, 16, 0.84), rgba(7, 28, 24, 0.62)),
    url("/waba-background.jpg") center center / cover no-repeat;
  border-color: rgba(255, 255, 255, 0.08);
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.94;
  color: #f5f2e8;
}

.hero-text,
.section-label,
.hint,
.status-message,
.meter-meta span,
.summary-stats span,
.comparison-meta,
.trade-list,
.markdown-output {
  color: var(--muted);
}

.eyebrow,
.section-label {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--brand);
}

.hero-text {
  max-width: 56ch;
  margin: 18px 0 0;
  line-height: 1.65;
  color: rgba(245, 242, 232, 0.88);
}

.hero-copy .eyebrow {
  color: #f5deb0;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.dashboard {
  display: grid;
  gap: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading-spaced {
  margin-top: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 33, 28, 0.14);
  background: var(--panel-strong);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(12, 98, 84, 0.24);
  border-color: rgba(12, 98, 84, 0.34);
}

.table-shell {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--panel-strong);
}

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

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(12, 98, 84, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-input,
.table-select {
  min-width: 128px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 15px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: white;
  font-weight: 800;
}

.secondary-button {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(12, 98, 84, 0.08);
  color: var(--brand-deep);
  font-weight: 800;
}

.ghost-button {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(163, 77, 50, 0.1);
  color: var(--danger);
  font-weight: 800;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.hint {
  margin: 0;
  font-size: 0.92rem;
}

.meter-wrap {
  display: grid;
  gap: 14px;
}

.meter-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(12, 98, 84, 0.1);
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  transition: width 300ms ease;
}

.meter-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.meter-meta strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.4rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-stats div,
.comparison-item,
.trade-list li {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.summary-stats span,
.summary-stats strong {
  display: block;
}

.summary-stats strong {
  margin-top: 6px;
  font-size: 1.05rem;
}

.comparison-list,
.trade-list {
  display: grid;
  gap: 12px;
}

.comparison-item {
  display: grid;
  gap: 10px;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.94rem;
}

.comparison-bars {
  display: grid;
  gap: 8px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.08);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
}

.bar-current > span {
  background: linear-gradient(90deg, rgba(12, 98, 84, 0.5), var(--brand));
}

.bar-target > span {
  background: linear-gradient(90deg, rgba(172, 127, 52, 0.55), var(--accent));
}

.trade-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trade-list li strong {
  color: var(--ink);
}

.status-message {
  margin-bottom: 16px;
  line-height: 1.6;
}

.markdown-output {
  line-height: 1.7;
}

.markdown-output h2,
.markdown-output h3 {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
}

.markdown-output table {
  min-width: 100%;
  margin: 16px 0;
}

.markdown-output code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(12, 98, 84, 0.08);
}

.empty-state {
  color: var(--muted);
}

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

  .hero-copy,
  .card {
    padding: 18px;
  }

  .form-grid,
  .summary-stats,
  .form-footer,
  .meter-meta,
  .section-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .section-heading,
  .form-footer,
  .meter-meta {
    align-items: start;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    justify-self: stretch;
  }

  .table-shell {
    overflow: visible;
    border: none;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tbody tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
  }

  td {
    display: grid;
    gap: 8px;
    padding: 0;
    border-bottom: none;
  }

  td + td {
    margin-top: 12px;
  }

  td::before {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  td:nth-child(1)::before {
    content: "Asset Name";
  }

  td:nth-child(2)::before {
    content: "Ticker/Type";
  }

  td:nth-child(3)::before {
    content: "Amount ($)";
  }

  td:nth-child(4)::before {
    content: "Asset Class";
  }

  td:nth-child(5)::before {
    content: "Actions";
  }

  .table-input,
  .table-select,
  .ghost-button {
    min-width: 0;
    width: 100%;
  }
}
