/* AUREA Agent Studio — dark theme matched to aureaswap.com (same palette as
   the AUREA staking frontend). Self-contained; no external CSS frameworks. */
:root {
  --bg: #0a0f1e;
  --bg-deep: #020616;
  --card: #121626;
  --card-2: #141828;
  --panel: #0f1423;
  --border: #282d3c;
  --text: #fff;
  --muted: #848388;
  --muted-2: #626066;
  --gold: #ffd700;
  --gold-light: #ffeb50;
  --gold-soft: rgba(255, 215, 0, 0.1);
  --violet: #8a2be2;
  --violet-soft: rgba(138, 43, 226, 0.16);
  --violet-text: #c9a7f5;
  --green: #02b589;
  --red: #e94d7a;
  --warning: #d9ab52;
  --input-bg: #0e1222;
  --gradient-brand: linear-gradient(45deg, #ffd700 6.62%, #8a2be2 86.5%);
  --on-primary: #141828;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500; padding-bottom: 40px;
}
a { color: var(--gold); }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.pos { color: #2fd3a7; } .neg { color: #ff8fab; }

/* header + tabs */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 10px 16px;
  background: rgba(10, 15, 30, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: var(--gradient-brand); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px;
}
.page-title { font-size: 19px; font-weight: 800; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-muted { background: var(--input-bg); color: var(--muted); }
.badge-ok { background: rgba(2, 181, 137, 0.15); color: #2fd3a7; }
.badge-ng { background: rgba(233, 77, 122, 0.15); color: #ff8fab; }
.badge-warn { background: rgba(217, 171, 82, 0.15); color: var(--warning); }
.tabs {
  display: flex; gap: 4px; max-width: 1180px; margin: 14px auto 0; padding: 4px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px;
  width: calc(100% - 32px);
}
.tab-btn {
  flex: 1; border: none; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 15px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--gold); color: var(--on-primary); }

main { max-width: 1180px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.footer { max-width: 1180px; margin: 6px auto 0; padding: 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* cards, stats, tables */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.card h2 { margin: 0 0 14px; font-size: 19px; font-weight: 800; }
.card h3 { margin: 22px 0 10px; font-size: 15px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.card.sticky { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-label { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 16.5px; font-weight: 800; overflow-wrap: anywhere; }
.metrics-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metrics-col h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.table-wrap { overflow-x: auto; margin: 10px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { border: 1px solid var(--border); padding: 7px 9px; text-align: right; vertical-align: top; }
th { background: var(--panel); font-weight: 800; text-align: right; }
td:first-child, th:first-child { text-align: left; }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 12px 0; border: 1px solid var(--border); background: var(--panel); }
.banner-warn { background: rgba(217,171,82,.12); border-color: rgba(217,171,82,.45); color: #e8c87e; }
.banner-error { background: rgba(233,77,122,.12); border-color: rgba(233,77,122,.45); color: #ff8fab; }
.banner-info { background: var(--violet-soft); border-color: rgba(138,43,226,.5); color: var(--violet-text); }
.gate { border-radius: 12px; padding: 14px; font-weight: 800; font-size: 16px; margin: 14px 0; border: 1px solid var(--border); }
.gate-pass { background: rgba(2,181,137,.12); border-color: rgba(2,181,137,.5); color: #4be3bb; }
.gate-fail { background: rgba(233,77,122,.12); border-color: rgba(233,77,122,.5); color: #ff8fab; }
.gate small { display: block; font-weight: 600; font-size: 13px; margin-top: 4px; }
.assump { background: var(--gold-soft); border: 1px solid rgba(255,215,0,.35); border-radius: 8px; padding: 10px 12px; color: var(--gold-light); font-size: 13.5px; line-height: 1.6; margin: 12px 0; }
.assump dt { font-weight: 800; float: left; margin-right: 8px; }
.assump dd { margin: 0 0 2px; overflow-wrap: anywhere; }
.disclaimer { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.warn-list { margin: 6px 0 6px 18px; padding: 0; line-height: 1.6; font-size: 14px; }
svg.chart { width: 100%; height: auto; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; }

/* buttons & forms */
.btn { appearance: none; border: 1px solid var(--border); background: var(--card-2); color: var(--text); border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { background: var(--input-bg); color: var(--muted-2); cursor: not-allowed; }
.btn-primary { background: var(--gold); border-color: transparent; color: var(--on-primary); font-weight: 800; }
.btn-primary:disabled { background: var(--input-bg); border-color: var(--border); color: var(--muted-2); }
.btn-small { padding: 6px 12px; font-size: 13.5px; }
.btn-wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1 1 120px; }
.file-label { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 120px; }
.form-row { margin: 10px 0; }
.form-row label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
input[type="number"], input[type="text"], select, textarea {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 9px 11px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: var(--panel); }
textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin: 8px 0; }
.msg { min-height: 1.2em; font-size: 14px; font-weight: 600; }
.msg.error { color: #ff8fab; } .msg.ok { color: #2fd3a7; }

/* builder */
.builder-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.json-preview { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 12px; line-height: 1.5; overflow: auto; white-space: pre; }
.validation { font-weight: 800; font-size: 14px; padding: 9px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); }
.validation.ok { color: #2fd3a7; border-color: rgba(2,181,137,.5); }
.validation.ng { color: #ff8fab; border-color: rgba(233,77,122,.5); }
.row-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.row-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-head select, .row-head input { width: auto; flex: 1 1 110px; }
.row-head .btn { flex: 0 0 auto; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.param-grid label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.cond-box { border: 1px solid var(--border); border-left: 3px solid var(--violet); border-radius: 10px; padding: 10px; margin: 8px 0; background: rgba(138,43,226,.05); }
.cond-box.leaf { border-left-color: var(--gold); background: var(--panel); }
.cond-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cond-head select { width: auto; flex: 0 1 150px; }
.cond-depth { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.operand { display: flex; gap: 6px; align-items: center; flex: 1 1 200px; }
.operand select { width: auto; flex: 1; }
.operand input { width: 90px; flex: 0 0 90px; }
.cond-fields { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: end; }
.saved-item { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.saved-item-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.saved-item-name { font-weight: 800; }
.version-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0 0 12px; font-size: 13px; color: var(--muted); }

/* gallery */
/* Top Performers + symbol grouping (Gallery) */
.top-performers { background: linear-gradient(180deg, var(--gold-soft), transparent 130%); border: 1px solid var(--gold); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.top-performers h3 { margin: 0 0 4px; color: var(--gold); text-transform: none; letter-spacing: 0; font-size: 18px; }
.top-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.top-rank { font-size: 20px; font-weight: 800; color: var(--gold); min-width: 38px; }
.top-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top-name { font-weight: 700; color: var(--text); }
.top-sub { color: var(--muted); font-size: 12.5px; }
.top-apr { font-size: 30px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.top-apr.pos { color: #2fd3a7; } .top-apr.neg { color: #ff8fab; }
.symbol-group { margin: 18px 0 8px; color: var(--gold-light); font-size: 15px; letter-spacing: 0.04em; }
.gallery-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.gallery-card h3 { margin: 0 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 17px; }

/* UX expansion: guide, profile, auto-create, leaderboard, copy trading */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.tabs { flex-wrap: wrap; }
.tab-btn { flex: 1 1 auto; }
.help { color: var(--text); font-size: 14.5px; line-height: 1.65; margin: 0 0 14px; }
.help strong { color: var(--gold-light); }
.btn-lg { padding: 14px 22px; font-size: 16.5px; border-radius: 10px; }
.linklike { background: none; border: none; padding: 0; font: inherit; font-weight: 800; color: var(--gold); cursor: pointer; text-decoration: underline; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; }
.step-num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--gradient-brand); color: var(--on-primary); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 6px; }
.glossary > div { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.glossary strong { color: var(--gold); font-size: 14px; }
.glossary span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* profile */
.profile-chip-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--text); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.profile-chip-btn:hover { border-color: var(--gold); }
.avatar-svg { border-radius: 8px; flex: 0 0 auto; display: block; }
.creator { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.creator-name { font-weight: 700; white-space: nowrap; }
.avatar-grid { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel); border: 2px solid var(--border); border-radius: 12px; padding: 8px; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.avatar-pick.selected { border-color: var(--gold); color: var(--gold-light); }
.avatar-preview { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; }

/* AI Auto-Create */
.ac-card { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--card) 55%); }
.ac-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ac-steps li { display: flex; gap: 9px; align-items: center; color: var(--muted-2); font-weight: 700; font-size: 14px; }
.ac-steps li.active { color: var(--gold-light); }
.ac-steps li.done { color: #2fd3a7; }
.ac-step-mark { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.ac-steps li.active .ac-step-mark { border-color: var(--gold); }
.ac-steps li.done .ac-step-mark { border-color: rgba(2,181,137,.5); }

/* leaderboard rows */
.lb-row { flex-wrap: wrap; }
.lb-creator { flex: 0 0 auto; }
.lb-apr-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.lb-apr-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.lb-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.period-row .btn.active { background: var(--gold); color: var(--on-primary); border-color: transparent; }

@media (max-width: 900px) {
  .builder-grid, .metrics-3 { grid-template-columns: 1fr; }
  .card.sticky { position: static; max-height: none; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 18px 14px; }
  .brand-sub { display: none; }
}

/* --- brand unification with aureaswap.com (2026-11-27) --- */
.brand-logo { height: 34px; width: auto; aspect-ratio: 886 / 320; display: block; flex: none; }
