/* =========================================================
   Trading Desk — base theme
   Black & gold, terminal-inspired aesthetic.
   Gold = brand/UI chrome. Green/red are reserved for
   financial direction only (P&L, compra/venta, alcista/bajista) —
   never repurpose them as decoration.
   ========================================================= */

:root {
  --bg: #0a0805;
  --bg-alt: #0e0b07;
  --panel: #130f09;
  --card: #17130b;
  --card-hover: #1c170d;
  --border: #2c2513;
  --border-soft: #201b0f;

  --text: #f3ede1;
  --text-dim: #b7a983;
  --text-faint: #6f6549;

  --gold: #ffcc33;
  --gold-dim: rgba(255, 204, 51, 0.14);
  --gold-strong: #ffdb66;

  --green: #17e8a0;
  --green-dim: rgba(23, 232, 160, 0.12);

  --red: #ff5566;
  --red-dim: rgba(255, 85, 102, 0.12);

  --amber: #ff9d4d;
  --amber-dim: rgba(255, 157, 77, 0.12);

  --blue: #4fb2ff;
  --blue-dim: rgba(79, 178, 255, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.35);

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(255,204,51,0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,204,51,0.04), transparent 55%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--gold-dim); color: var(--gold); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Top nav ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.topnav-top {
  position: relative;
  overflow: hidden;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.topnav-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.topnav-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 5px var(--gold);
  opacity: 0;
  animation-name: topnav-drift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes topnav-drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.7; }
  85% { opacity: 0.45; }
  100% { transform: translate(var(--drift-x, 80px), var(--drift-y, -14px)) rotate(180deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .topnav-particle { animation: none; opacity: 0.35; }
}

.brand, .topnav-quote, .topnav-right {
  position: relative;
  z-index: 1;
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 26px;
  white-space: nowrap;
  color: var(--text);
  flex-shrink: 0;
}

.brand-dot {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
  flex-shrink: 0;
}

.topnav-quote {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 13.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 6px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.navlinks::-webkit-scrollbar { display: none; }

.navlink {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.navlink:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.navlink.active { color: var(--gold); background: var(--gold-dim); }
.nav-ico { font-size: 13px; opacity: 0.9; }

.navlinks-mobile { display: none; }

.topnav-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}
.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8a6a1f);
  color: #1a1206;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 800;
}
.user-name { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }

/* Estado de sincronización con la nube, junto al usuario. */
.sync-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  cursor: help;
}

/* ---------- Auth gate ---------- */

.auth-screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-card);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.auth-title { font-family: var(--font-mono); font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.auth-sub { font-size: 12.5px; color: var(--text-dim); margin: 0 0 18px; line-height: 1.5; }
.auth-error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,85,102,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.auth-foot { font-size: 11px; color: var(--text-faint); margin: 16px 0 0; line-height: 1.5; }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  font-size: 14px;
  flex-shrink: 0;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- Footer ---------- */

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text-dim); }

/* ---------- Ticker (bolsa-style scrolling bar) ---------- */

.ticker-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 7px 0;
  animation: ticker-scroll 45s linear infinite;
  will-change: transform;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 0 16px;
  border-right: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.ticker-label { color: var(--text-faint); letter-spacing: 0.03em; }
.ticker-value { color: var(--text); font-weight: 700; }
.ticker-value.pos { color: var(--green); }
.ticker-value.neg { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Layout ---------- */

.app-root {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-sub { color: var(--text-dim); font-size: 13.5px; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: transform .1s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--text-faint); background: var(--card-hover); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1206;
  font-weight: 700;
}
.btn-primary:hover { background: var(--gold-strong); border-color: var(--gold-strong); }

.btn-ghost { background: transparent; }

.btn-danger { color: var(--red); border-color: rgba(255,85,102,0.3); background: transparent; }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-sm { padding: 6px 10px; font-size: 12px; }

.btn-icon { padding: 8px; width: 34px; justify-content: center; }

/* ---------- KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
}

.kpi-delta { font-size: 11.5px; font-weight: 600; }
.kpi-delta.pos { color: var(--green); }
.kpi-delta.neg { color: var(--red); }
.kpi-delta.neutral { color: var(--text-faint); }

/* ---------- Panels / grid ---------- */

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title .hint { font-family: var(--font-sans); font-size: 11.5px; font-weight: 400; text-transform: none; color: var(--text-faint); }

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  margin-left: 2px;
  vertical-align: middle;
}
.info-tip:hover, .info-tip:focus {
  color: var(--gold);
  border-color: var(--gold);
  outline: none;
}
.info-tip-bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}
.info-tip:hover .info-tip-bubble, .info-tip:focus .info-tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.info-tip-below .info-tip-bubble {
  bottom: auto;
  top: calc(100% + 9px);
  transform: translateY(-4px);
}
.info-tip-below:hover .info-tip-bubble, .info-tip-below:focus .info-tip-bubble {
  transform: translateY(0);
}

/* ---------- Cards grid (entities) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.entity-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border-color .15s, transform .15s;
}
.entity-card:hover { border-color: var(--text-faint); }

.entity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.entity-title { font-weight: 700; font-size: 15px; }
.entity-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.entity-actions { display: flex; gap: 6px; flex-shrink: 0; }

.entity-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}

.metric-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-family: var(--font-mono); }
.metric-value { font-size: 14px; font-weight: 700; font-family: var(--font-mono); }
.metric-value.pos { color: var(--green); }
.metric-value.neg { color: var(--red); }

/* ---------- Badges / chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-amber { background: var(--amber-dim); color: var(--amber); }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
}

/* ---------- Progress bars ---------- */

.progress-row { margin-top: 2px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-bottom: 4px; font-family: var(--font-mono); }
.progress-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--gold); transition: width .3s; }
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.015); }

/* ---------- Tabs ---------- */

.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabbtn {
  padding: 9px 4px;
  margin-right: 18px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabbtn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .empty-ico { font-size: 26px; margin-bottom: 10px; opacity: 0.7; }
.empty-state .empty-title { color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.risk-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 157, 77, 0.35);
  background: rgba(255, 157, 77, 0.08);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.risk-notice-icon { flex-shrink: 0; font-size: 14px; }
.risk-notice strong { color: var(--amber); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented button {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12.5px;
}
.segmented button.sel-bull.active { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.segmented button.sel-bear.active { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.segmented button.sel-neutral.active { border-color: var(--text-dim); color: var(--text); background: rgba(255,255,255,0.06); }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(3,5,8,0.7);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modal-in .12s ease-out;
}
.modal.modal-wide { max-width: 760px; }
@keyframes modal-in { from { opacity:0; transform: translateY(-6px);} to {opacity:1; transform:none;} }

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-family: var(--font-mono); font-weight: 800; font-size: 15px; }
.modal-close { background: transparent; border: none; color: var(--text-faint); font-size: 18px; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Señales (level rows / image preview) ---------- */

.level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.level-row .level-input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  font-size: 13.5px;
}
.level-row .level-input:focus { outline: none; border-color: var(--gold); }
.level-row .badge { flex-shrink: 0; min-width: 76px; justify-content: center; }

.image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  font-size: 12px;
  color: var(--text-dim);
}
.image-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.image-preview span { flex: 1; word-break: break-all; }

/* ---------- Discord view ---------- */

.discord-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.discord-profile-left { display: flex; align-items: center; gap: 14px; }
.discord-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8a6a1f);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 800; color: #1a1206;
}
.discord-username { font-weight: 700; font-size: 15px; }
.discord-since { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.discord-roles { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.social-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 11.5px; font-weight: 600; color: var(--text-dim);
}
.social-btn:hover { border-color: var(--text-faint); color: var(--text); }
.social-ico { font-size: 18px; }

.feed-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.feed-item:last-child { border-bottom: none; }
.feed-item-title { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.feed-item-body { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; max-width: 620px; }
.feed-item-meta { font-size: 11px; color: var(--text-faint); margin-top: 6px; font-family: var(--font-mono); }
.feed-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.channel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.channel-pill {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); display: inline-block; margin-right: 6px; }

.discord-widget-frame {
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.zone-composer-panel { padding: 22px; }

.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.zone-header-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.zone-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 720px) { .zone-cols { grid-template-columns: 1fr; } }

.zone-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}
.zone-col-title.res { color: var(--red); }
.zone-col-title.sup { color: var(--green); }

.zone-level-row { margin-bottom: 8px; }
.zone-level-row .field { margin-bottom: 0; }

.zone-range-box {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 14px;
}
.zone-range-box.buy { background: var(--green-dim); border-color: rgba(23,232,160,0.3); }
.zone-range-box.sell { background: var(--red-dim); border-color: rgba(255,85,102,0.3); }
.zone-range-box .field { margin-bottom: 10px; }
.zone-range-box .field:last-child { margin-bottom: 0; }

.zone-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.zone-regenerate {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 600;
  padding: 0;
}
.zone-regenerate:hover { color: var(--gold-strong); }

.zone-preview-textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  outline: none;
}
.zone-preview-textarea:focus { border-color: var(--gold); }

.zone-preview {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ---------- Toasts ---------- */

.toast-root { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in .15s ease-out;
}
.toast.error { border-color: var(--red); }
@keyframes toast-in { from { opacity:0; transform: translateX(10px);} to {opacity:1; transform:none;} }

/* ---------- Misc ---------- */

.section-gap { margin-top: 28px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-box { position: relative; height: 190px; }
.chart-box.small { height: 150px; }

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
}
.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.settings-danger { border: 1px solid rgba(255,85,102,0.3); border-radius: var(--radius); padding: 16px; background: var(--red-dim); }

.attention-panel {
  border-color: rgba(255,157,77,0.35);
  background: linear-gradient(180deg, rgba(255,157,77,0.06), var(--panel) 60%);
  margin-bottom: 28px;
}
.attention-panel .panel-title { color: var(--amber); margin-bottom: 12px; }
.attention-list { display: flex; flex-direction: column; gap: 9px; }
.attention-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); }
.attention-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.attention-dot.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.attention-dot.danger { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .navlinks { display: none; }
  .navlinks-mobile.open { display: flex; }
  .navlinks-mobile { flex-direction: column; padding: 8px 16px 14px; border-top: 1px solid var(--border-soft); }
  .navlinks-mobile .navlink { padding: 10px 6px; }
  .icon-btn { display: flex; align-items: center; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
  .user-name { display: none; }
  .topnav-quote { display: none; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
