/* Busimatch crypto-tools shared theme
 * Owned by Claude side. Self-contained, no Tailwind dependency.
 * Used by the 13 blockchain-tools pages. */

.ct-scope {
  --ct-bg: #0b1424;
  --ct-bg-2: #0f1c30;
  --ct-card: #13203a;
  --ct-card-2: #182a49;
  --ct-line: #243a5e;
  --ct-line-soft: #1c2e4d;
  --ct-text: #e7eefb;
  --ct-text-soft: #9fb3d1;
  --ct-text-dim: #6c83a6;
  --ct-accent: #4f8cff;
  --ct-accent-2: #3b6fd6;
  --ct-green: #2ec28b;
  --ct-red: #ff5d6c;
  --ct-amber: #ffb648;
  --ct-radius: 14px;
  --ct-radius-sm: 9px;
  --ct-shadow: 0 10px 30px rgba(0,0,0,.35);
  --ct-mono: "SFMono-Regular", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

  color: var(--ct-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ct-scope *, .ct-scope *::before, .ct-scope *::after { box-sizing: border-box; }

.ct-wrap { max-width: 1180px; margin: 0 auto; padding: 4px 0 48px; }

/* ---------- Header ---------- */
.ct-head { margin-bottom: 22px; }
.ct-head h1 {
  font-size: 26px; font-weight: 700; margin: 0 0 6px;
  letter-spacing: -.02em; display: flex; align-items: center; gap: 12px;
}
.ct-head .ct-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--ct-accent), var(--ct-accent-2));
  box-shadow: 0 6px 18px rgba(79,140,255,.35);
}
.ct-head p { margin: 0; color: var(--ct-text-soft); font-size: 14.5px; max-width: 70ch; }

/* ---------- Cards / grid ---------- */
.ct-card {
  background: var(--ct-card);
  border: 1px solid var(--ct-line-soft);
  border-radius: var(--ct-radius);
  padding: 20px;
  box-shadow: var(--ct-shadow);
}
.ct-card + .ct-card { margin-top: 18px; }
.ct-card h2, .ct-card h3 { margin: 0 0 14px; font-weight: 650; letter-spacing: -.01em; }
.ct-card h2 { font-size: 18px; }
.ct-card h3 { font-size: 15px; color: var(--ct-text-soft); }

.ct-grid { display: grid; gap: 18px; }
.ct-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ct-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ct-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.ct-grid.split { grid-template-columns: 1.1fr .9fr; align-items: start; }
@media (max-width: 860px) {
  .ct-grid.cols-2, .ct-grid.cols-3, .ct-grid.cols-4, .ct-grid.split { grid-template-columns: 1fr; }
}

/* ---------- Stats ---------- */
.ct-stat {
  background: var(--ct-bg-2); border: 1px solid var(--ct-line-soft);
  border-radius: var(--ct-radius-sm); padding: 14px 16px;
}
.ct-stat .lbl { font-size: 12px; color: var(--ct-text-dim); text-transform: uppercase; letter-spacing: .05em; }
.ct-stat .val { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ct-stat .sub { font-size: 12.5px; color: var(--ct-text-soft); margin-top: 2px; }

/* ---------- Forms ---------- */
.ct-field { margin-bottom: 14px; }
.ct-field label { display: block; font-size: 12.5px; color: var(--ct-text-soft); margin-bottom: 6px; font-weight: 550; }
.ct-input, .ct-select, .ct-scope input[type=text], .ct-scope input[type=number] {
  width: 100%; background: var(--ct-bg-2); color: var(--ct-text);
  border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm);
  padding: 11px 13px; font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.ct-input:focus, .ct-select:focus, .ct-scope input:focus {
  border-color: var(--ct-accent); box-shadow: 0 0 0 3px rgba(79,140,255,.18);
}
.ct-input::placeholder { color: var(--ct-text-dim); }
.ct-select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239fb3d1' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.ct-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ct-row > * { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--ct-accent), var(--ct-accent-2));
  color: #fff; border: none; border-radius: var(--ct-radius-sm);
  padding: 11px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: transform .08s, filter .15s; white-space: nowrap;
}
.ct-btn:hover { filter: brightness(1.08); }
.ct-btn:active { transform: translateY(1px); }
.ct-btn:disabled { opacity: .5; cursor: not-allowed; }
.ct-btn.ghost { background: var(--ct-card-2); color: var(--ct-text); border: 1px solid var(--ct-line); }
.ct-btn.danger { background: linear-gradient(135deg, #ff6b78, #e0394a); }
.ct-btn.sm { padding: 7px 12px; font-size: 13px; }

.ct-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--ct-bg-2); border: 1px solid var(--ct-line); color: var(--ct-text-soft);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 550; transition: all .12s;
}
.ct-chip:hover { color: var(--ct-text); border-color: var(--ct-accent); }
.ct-chip.is-active { background: rgba(79,140,255,.18); border-color: var(--ct-accent); color: #cfe0ff; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tables ---------- */
.ct-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ct-table th, .ct-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--ct-line-soft); }
.ct-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ct-text-dim); font-weight: 600; }
.ct-table td { font-variant-numeric: tabular-nums; }
.ct-table tbody tr:hover { background: rgba(255,255,255,.02); }
.ct-table .num { text-align: right; }

/* ---------- Misc ---------- */
.ct-pos { color: var(--ct-green); }
.ct-neg { color: var(--ct-red); }
.ct-muted { color: var(--ct-text-dim); }
.ct-mono { font-family: var(--ct-mono); }
.ct-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.ct-badge.ok { background: rgba(46,194,139,.16); color: #5fe0ad; }
.ct-badge.warn { background: rgba(255,182,72,.16); color: #ffce85; }
.ct-badge.bad { background: rgba(255,93,108,.16); color: #ff9aa4; }
.ct-badge.neutral { background: var(--ct-card-2); color: var(--ct-text-soft); }

.ct-hint { font-size: 12.5px; color: var(--ct-text-dim); margin-top: 8px; }
.ct-divider { height: 1px; background: var(--ct-line-soft); margin: 16px 0; border: 0; }
.hidden { display: none !important; }

.ct-empty { text-align: center; color: var(--ct-text-dim); padding: 32px 16px; font-size: 14px; }

/* Spinner */
.ct-spin { width: 18px; height: 18px; border: 2px solid var(--ct-line); border-top-color: var(--ct-accent);
  border-radius: 50%; animation: ct-rot .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes ct-rot { to { transform: rotate(360deg); } }

/* Toast */
.ct-toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.ct-toast {
  background: var(--ct-card-2); color: var(--ct-text); border: 1px solid var(--ct-line);
  border-left: 3px solid var(--ct-accent); border-radius: 10px; padding: 12px 16px; font-size: 14px;
  box-shadow: var(--ct-shadow); max-width: 340px; animation: ct-slide .25s ease;
}
.ct-toast.ok { border-left-color: var(--ct-green); }
.ct-toast.err { border-left-color: var(--ct-red); }
@keyframes ct-slide { from { transform: translateX(20px); opacity: 0; } }

/* Token result list (autocomplete) */
.ct-suggest { position: relative; }
.ct-suggest-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--ct-card-2); border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm);
  max-height: 280px; overflow-y: auto; box-shadow: var(--ct-shadow);
}
.ct-suggest-item { padding: 9px 13px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ct-suggest-item:hover, .ct-suggest-item.is-active { background: rgba(79,140,255,.16); }
.ct-suggest-item img { width: 20px; height: 20px; border-radius: 50%; }
.ct-suggest-item .sym { color: var(--ct-text-dim); text-transform: uppercase; font-size: 12px; }
