/* Cookie Board — theme
   Dark, high contrast, no external fonts or assets so the page works offline of any CDN. */

:root {
  --bg: #0e0b08;
  --bg-panel: #171210;
  --bg-panel-2: #1f1815;
  --line: #33261f;
  --line-soft: #241a15;
  --text: #f4ece4;
  --text-dim: #a3928a;
  --text-mute: #7a6a62;
  --accent: #e8a33d;
  --accent-dim: #8a6224;
  --ok: #4fc98a;
  --warn: #e8c33d;
  --err: #ef6b5f;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(232, 163, 61, 0.10), transparent 62%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 11, 8, 0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { font-size: 32px; line-height: 1; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: -0.2px; }
.brand-sub { margin: 1px 0 0; font-size: 12.5px; color: var(--text-mute); }

.wallet-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.wallet-state {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--bg-panel);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-state.is-connected { color: var(--ok); border-color: #2b5c43; }
.wallet-state.is-error { color: var(--err); border-color: #6a2f2a; }

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

/* ---------- buttons & fields ---------- */

.btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 9px;
  padding: 8px 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s;
}
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #241704; }
.btn-primary:not(:disabled):hover { background: #f2b455; }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn-ghost:not(:disabled):hover { color: var(--text); border-color: var(--accent-dim); }

.wallet-select, select, input[type="text"], input[type="search"] {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
}
.wallet-select:focus, select:focus, input:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.field-inline { flex-direction: row; align-items: center; gap: 9px; }
.field-inline > span { text-transform: none; letter-spacing: 0; font-size: 13px; white-space: nowrap; }
.field.grow { flex: 1 1 260px; }
.field.grow input { width: 100%; }

/* ---------- layout ---------- */

main { padding: 22px 24px 40px; max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.1px; }

.muted { color: var(--text-mute); font-size: 12.5px; }
.small { font-size: 12px; }

.lede { margin: 0 0 16px; color: var(--text-dim); font-size: 13.5px; max-width: 78ch; }

.error {
  margin: 12px 0 0;
  color: var(--err);
  font-size: 13px;
  background: rgba(239, 107, 95, 0.08);
  border: 1px solid rgba(239, 107, 95, 0.3);
  border-radius: 9px;
  padding: 9px 12px;
}

/* ---------- stat cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 11px;
}

.card {
  background: var(--bg-panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.card-label { font-size: 11.5px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.6px; }
.card-value { font-family: var(--mono); font-size: 20px; margin-top: 5px; word-break: break-all; }
.card-note { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }

.card.is-pending .card-value { color: var(--text-mute); }

/* ---------- stamp ---------- */

.stamp-grid { display: flex; flex-wrap: wrap; gap: 11px; align-items: flex-end; }
.stamp-grid .field { flex: 1 1 300px; }
.stamp-grid input { width: 100%; }

.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 7px; }
.steps li {
  font-size: 13px;
  color: var(--text-mute);
  padding-left: 25px;
  position: relative;
}
.steps li::before {
  content: "○";
  position: absolute;
  left: 4px;
  color: var(--line);
}
.steps li.is-active { color: var(--warn); }
.steps li.is-active::before { content: "◐"; color: var(--warn); }
.steps li.is-done { color: var(--ok); }
.steps li.is-done::before { content: "●"; color: var(--ok); }
.steps li.is-failed { color: var(--err); }
.steps li.is-failed::before { content: "✕"; color: var(--err); }

.stamp-result {
  margin-top: 16px;
  background: var(--bg-panel-2);
  border: 1px solid #2b5c43;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13px;
}
.stamp-result .sig { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- chart ---------- */

.chart-wrap { margin-bottom: 20px; }
.chart-title { margin: 0 0 10px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: #f2b455; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--text-mute); font-size: 10px; font-family: var(--mono); }
.chart .empty { color: var(--text-mute); font-size: 13px; }

/* ---------- tables ---------- */

.table-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 13px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 10px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-mute);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(232, 163, 61, 0.05); }

th.num, td.num { text-align: right; font-family: var(--mono); }

.sym { font-weight: 600; }
.addr { font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); }
.addr a { color: var(--text-dim); }
.addr a:hover { color: var(--accent); }

.token-cell { display: flex; align-items: center; gap: 9px; }
.token-logo {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-panel-2);
  object-fit: cover;
  flex: none;
}
.token-logo-fallback {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  flex: none;
  display: grid; place-items: center;
  font-size: 10px; color: var(--text-mute);
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}

.zero { color: var(--text-mute); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 18px 24px 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
}
.footer p { margin: 4px 0; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  main { padding: 16px 14px 30px; }
  .panel { padding: 15px 14px 17px; }
  .wallet-state { max-width: 100%; }
  .brand-sub { display: none; }
}
