@font-face {
  font-family: "Sora";
  src: url("fonts/sora/sora-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("fonts/sora/sora-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("fonts/sora/sora-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("fonts/sora/sora-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("fonts/sora/sora-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #010815;
  --bg-2: #080d1c;
  --panel: rgba(12, 22, 40, 0.72);
  --panel-border: rgba(212, 175, 55, 0.28);
  --text: #e8edf7;
  --muted: #93a1bd;
  --gold: #d4af37;
  --gold-2: #f0d78c;
  --navy: #0a192f;
  --cyan: #00f2fe;
  --glow-gold: 0 0 18px rgba(212, 175, 55, 0.45), 0 0 40px rgba(212, 175, 55, 0.18);
  --glow-cyan: 0 0 16px rgba(0, 242, 254, 0.35);
  --danger: #ff6b7a;
  --ok: #3d9a7a;
  --font: "Sora", "Segoe UI", system-ui, sans-serif;
  --mono: "Sora", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

#xxl-hourglass {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 8, 21, 0.86);
  transition: opacity 0.28s ease, visibility 0.28s;
}
#xxl-hourglass.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#xxl-hourglass .xxl-hg {
  font-size: 58px;
  line-height: 1;
  color: #d4af37;
  animation: xxl-hg-spin 1.05s linear infinite;
  filter: drop-shadow(0 0 14px #d4af37);
}
@keyframes xxl-hg-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  #xxl-hourglass .xxl-hg { animation: none; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Túnel de estrellas (WebGL) — mismo patrón que cibernia.net */
#webgl-container {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: #010815;
}
#webgl-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

a { color: var(--gold-2); text-decoration: none; }
.tg-ia-start { margin: 0.35rem 0 0.15rem; }
.tg-ia-start a { text-decoration: underline; }
a:hover { color: #fff; text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.top {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--glow-gold);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: var(--glow-cyan), 0 0 0 2px rgba(212, 175, 55, 0.55);
  object-fit: cover;
}
.brand .name { font-size: 1.05rem; color: var(--gold-2); text-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
.brand .sub { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; }

.nav { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; }
.nav a, .nav-dd-btn {
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.nav a:hover, .nav a.active, .nav-dd-btn:hover, .nav-dd.is-active > .nav-dd-btn, .nav-dd.is-open > .nav-dd-btn {
  color: #fff;
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: var(--glow-gold);
}
.nav-dd {
  position: relative;
  overflow: visible;
}
.nav-dd-btn::after {
  content: " ▾";
  font-size: 0.75em;
  opacity: 0.8;
}
.nav-dd-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 12rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(8, 14, 28, 0.98);
  box-shadow: var(--glow-gold);
  z-index: 80;
}
.nav-dd.is-open .nav-dd-menu { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-dd-menu a {
  display: block;
  white-space: nowrap;
}
.nav-dd-menu .nav-dd-logout {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  color: #ff8a96;
}
.nav-dd-menu .nav-dd-logout:hover {
  color: #fff;
  border-color: rgba(255, 107, 122, 0.45);
  background: rgba(255, 107, 122, 0.12);
  box-shadow: none;
}
.top, .top-right, .nav { overflow: visible; }
.charts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.charts-toolbar h1 { margin-bottom: 0.35rem; }
.tf-switch {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 254, 0.2);
  background: rgba(1, 8, 21, 0.65);
}
.tf-btn {
  min-width: 2.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.tf-btn:hover {
  color: #fff;
  border-color: rgba(0, 242, 254, 0.35);
}
.tf-btn.is-active {
  color: #010815;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  border-color: transparent;
  box-shadow: var(--glow-cyan);
}
.tf-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.chart-box.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
@media (min-width: 960px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
}
.chart-panel .chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}
.chart-panel .chart-head h2 { margin: 0; flex: 1 1 auto; font-size: 1.05rem; }
.chart-box {
  position: relative;
  width: 100%;
  min-height: 380px;
  height: 420px;
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 254, 0.22);
  overflow: hidden;
  background: linear-gradient(165deg, #010815 0%, #061428 55%, #0a192f 100%);
  box-shadow: inset 0 0 40px rgba(0, 242, 254, 0.04);
}
.chart-box-dark canvas {
  display: block;
}
.chart-hover {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 5;
  max-width: min(92%, 420px);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.22);
  background: rgba(1, 8, 21, 0.82);
  color: #c5d0db;
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.chart-hover.is-empty { opacity: 0; }
.chart-hover-date {
  color: #e8eef5;
  font-weight: 650;
  margin-bottom: 0.2rem;
}
.chart-hover-ohlc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  color: #9aa8b8;
}
.chart-hover-ohlc em {
  font-style: normal;
  color: #6b7c8f;
  margin-right: 0.15rem;
}
.chart-hover-ohlc .up { color: #2dd4a8; }
.chart-hover-ohlc .down { color: #f07178; }
.chart-hover-trade {
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(0, 242, 254, 0.12);
}
.chart-hover-trade strong {
  display: block;
  font-weight: 650;
}
.chart-hover-trade.buy strong { color: #22c55e; }
.chart-hover-trade.sell strong { color: #ef4444; }
.chart-hover-trade-meta {
  display: block;
  color: #9aa8b8;
  margin-top: 0.1rem;
}
.chart-levels .lvl-buy { color: #22c55e; font-weight: 600; }
.chart-levels .lvl-sell { color: #ef4444; font-weight: 600; }
.chart-tv { margin-left: auto; }
.chart-draw-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-left: 0.35rem;
}
.chart-draw-tools .draw-btn {
  min-width: 2.2rem;
  padding: 0.28rem 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1;
  background: rgba(1, 8, 21, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.28);
  color: #e8eef5;
}
.chart-draw-tools .draw-btn:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: #fff;
}
.chart-draw-tools .draw-btn.is-active {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  color: #010815;
  border-color: transparent;
}
.chart-box.is-drawing { cursor: crosshair; }
.chart-box.is-freehand { cursor: crosshair; }
.chart-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}
.chart-draw-svg .draw-hline,
.chart-draw-svg .draw-trend,
.chart-draw-svg .draw-freehand {
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-draw-svg .draw-rect {
  fill: rgba(0, 242, 254, 0.08);
  stroke-width: 1;
}
.chart-draw-svg .draw-measure {
  fill: rgba(212, 175, 55, 0.12);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}
.chart-draw-svg .draw-label {
  font-size: 11px;
  font-family: inherit;
}
.chart-draw-palette {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}
.draw-color-toggle {
  min-width: 2.2rem !important;
  padding: 0.28rem 0.45rem !important;
}
.draw-color-dot {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  vertical-align: middle;
}
.draw-color-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1.55rem);
  gap: 0.3rem;
  padding: 0.45rem;
  background: rgba(1, 8, 21, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.draw-color-menu[hidden] { display: none !important; }
.draw-color-swatch {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.draw-color-swatch.is-active {
  outline: 2px solid #d4af37;
  outline-offset: 1px;
}
.draw-color-select {
  display: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}
.panel.glow { box-shadow: var(--glow-gold), 0 0 24px rgba(0, 0, 0, 0.35); }
.balance-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.balance-toolbar h2 { margin: 0; }
.balance-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.balance-scope .btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

h1, h2 { margin: 0 0 0.75rem; font-weight: 650; }
h1 {
  font-size: 1.45rem;
  color: var(--gold-2);
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}
h2 { font-size: 1.05rem; color: var(--cyan); text-shadow: var(--glow-cyan); }

.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.65rem 0.85rem; border-radius: 10px; margin-bottom: 0.4rem; border: 1px solid transparent; }
.flash .ok { background: rgba(61, 154, 122, 0.18); border-color: rgba(61, 154, 122, 0.45); color: #a8e6cf; }
.flash .error { background: rgba(255, 107, 122, 0.12); border-color: rgba(255, 107, 122, 0.4); color: #ffc0c6; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid rgba(147, 161, 189, 0.18);
  font-size: 0.92rem;
}
.table th { color: var(--gold); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.table tr:hover td { background: rgba(212, 175, 55, 0.05); }
.balance-table tr.balance-total td {
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  font-weight: 600;
  color: var(--gold);
}
.bot-panel .panel {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(147, 161, 189, 0.35);
  letter-spacing: 0.03em;
}
.badge.on { color: #a8e6cf; border-color: #2f6b55; box-shadow: 0 0 10px rgba(61, 154, 122, 0.35); }
.badge.off { color: var(--muted); }
.badge.err { color: #ffc0c6; border-color: #6b2f2f; box-shadow: 0 0 10px rgba(255, 107, 122, 0.3); }
.badge.warn { color: #ffe6a8; border-color: #6b5a2f; box-shadow: 0 0 10px rgba(255, 196, 77, 0.28); }
.health-kpis { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.bulk-bar .bulk-actions,
.bulk-bar > label { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filter-bar label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.filter-bar input, .filter-bar select { min-width: 10rem; }
.row-issue td { background: rgba(255, 107, 122, 0.06); }
pre.log-tail {
  max-height: 28rem; overflow: auto; padding: 0.75rem 1rem;
  font-size: 0.78rem; line-height: 1.35; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(212, 175, 55, 0.25); border-radius: 8px; white-space: pre-wrap; word-break: break-word;
}
.user-alerts {
  list-style: none; margin: 0.85rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.user-alerts li {
  padding: 0.55rem 0.75rem; border-radius: 8px; font-size: 0.9rem;
  border: 1px solid rgba(147, 161, 189, 0.35);
}
.user-alerts .alert-warn { border-color: rgba(255, 196, 77, 0.45); background: rgba(255, 196, 77, 0.08); color: #ffe6a8; }
.user-alerts .alert-err { border-color: rgba(255, 107, 122, 0.45); background: rgba(255, 107, 122, 0.08); color: #ffc0c6; }
.user-alerts .alert-info { border-color: rgba(0, 242, 254, 0.3); background: rgba(0, 242, 254, 0.06); }
.onboard-box {
  margin-top: 1rem; padding: 0.85rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.35); border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}
.onboard-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.onboard-list li {
  display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.35rem 0.55rem;
  padding: 0.35rem 0; border-bottom: 1px solid rgba(147, 161, 189, 0.12);
}
.onboard-list li:last-child { border-bottom: 0; }
.onboard-list .tick { color: var(--muted); }
.onboard-list li.ok .tick { color: #a8e6cf; }
.onboard-list .tip { color: #ffe6a8; }
.onboard-done { margin-top: 0.75rem; }
.human-state {
  margin: 0.65rem 0 0.85rem; padding: 0.65rem 0.85rem;
  border-radius: 8px; border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.06);
}
.human-state.is-drought { border-color: rgba(255, 196, 77, 0.5); background: rgba(255, 196, 77, 0.08); }
.human-state.is-err { border-color: rgba(255, 107, 122, 0.5); background: rgba(255, 107, 122, 0.08); }
.recent-trades { margin-top: 1.25rem; }
.why-not-list { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--text); }
.why-not-list li { margin: 0.35rem 0; }
.badge.gold { color: var(--gold-2); border-color: rgba(212, 175, 55, 0.55); box-shadow: var(--glow-gold); }

label { display: block; margin: 0.75rem 0 0.3rem; color: var(--muted); font-size: 0.88rem; }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(1, 8, 21, 0.75);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 0 12px rgba(0, 242, 254, 0.05);
}
select { cursor: pointer; }
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0; color: var(--muted); }
.check input { width: auto; }

.btn {
  display: inline-block;
  margin-top: 0.85rem;
  margin-right: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.22), rgba(10, 25, 47, 0.9));
  color: var(--gold-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--glow-gold);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.btn { text-decoration: none; }
.btn:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 0 24px rgba(212, 175, 55, 0.55); }
.btn.primary {
  background: linear-gradient(145deg, #c9a227, #8a7018);
  color: #04101c;
  border-color: var(--gold-2);
}
.btn.danger {
  background: linear-gradient(145deg, rgba(255, 107, 122, 0.35), #3a1520);
  border-color: rgba(255, 107, 122, 0.55);
  color: #ffd0d5;
  box-shadow: 0 0 14px rgba(255, 107, 122, 0.25);
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.inline-form { display: inline; }

.login-box {
  max-width: 400px;
  margin: 10vh auto;
  text-align: center;
}
.login-box .logo-xl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  box-shadow: var(--glow-cyan), var(--glow-gold);
  object-fit: cover;
}
.login-box input { max-width: 100%; text-align: left; }

.log {
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(1, 8, 21, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 10px;
  padding: 0.85rem;
  max-height: 28rem;
  overflow: auto;
  color: #c5d0db;
  box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.06);
}
.log.log-expanded {
  max-height: min(85vh, 56rem);
  min-height: 24rem;
}

.meta { color: var(--muted); font-size: 0.9rem; }
.meta-spaced { margin-top: 0.75rem; }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
@media (max-width: 820px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}

.stat {
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.1), rgba(1, 8, 21, 0.5));
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.12);
}
.stat .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-2);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}
.stat .sub {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.fleet-split-h {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--gold-2);
  font-weight: 700;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-bar .field { flex: 1; min-width: 140px; }
.filter-bar input { max-width: none; }
.filter-bar .btn { margin-top: 0; }

.capture-needed {
  display: inline-block;
  margin: 0.35rem 0;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed rgba(255, 196, 77, 0.7);
  background: rgba(255, 196, 77, 0.08);
  color: #ffc44d;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  box-shadow: 0 0 14px rgba(255, 196, 77, 0.25);
}

.docs-index-hint { margin-top: 0.35rem; }
.doc-glossary {
  margin: 0;
  display: grid;
  gap: 0.85rem 1.25rem;
}
.doc-glossary dt {
  margin: 0;
  color: var(--gold-2);
  font-weight: 650;
  font-size: 0.98rem;
}
.doc-glossary dd {
  margin: 0.2rem 0 0;
  color: #cdd8ec;
  line-height: 1.5;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(0, 242, 254, 0.08);
}
.doc-glossary dd:last-of-type { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 720px) {
  .doc-glossary {
    grid-template-columns: 11rem 1fr;
    align-items: baseline;
  }
  .doc-glossary dd {
    padding-bottom: 0.75rem;
  }
}
.doc-card {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(12, 22, 40, 0.7);
  margin-bottom: 0.75rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.doc-card:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}
.doc-card h3 { margin: 0 0 0.35rem; color: var(--gold-2); font-size: 1rem; }
.doc-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.account-hero {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.account-hero .actions { margin-left: auto; }

.pos { color: #a8e6cf; }
.neg { color: #ffc0c6; }

/* —— Responsive / mobile —— */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .wrap { padding: 0.75rem 0.85rem 2.5rem; }
  .top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  .brand img { width: 44px; height: 44px; }
  .brand .name { font-size: 0.95rem; }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .nav a, .nav-dd-btn {
    text-align: center;
    padding: 0.55rem 0.4rem;
    font-size: 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    width: 100%;
  }
  .nav-dd { grid-column: 1 / -1; }
  .nav-dd-menu {
    position: static;
    margin-top: 0.35rem;
    box-shadow: none;
  }
  .nav-dd.is-open .nav-dd-menu { display: flex; flex-direction: column; gap: 0.15rem; }
  .panel { padding: 1rem 0.9rem; border-radius: 12px; }
  h1 { font-size: 1.2rem; }
  .stat .value { font-size: 1.05rem; }
  .account-hero { flex-direction: column; align-items: stretch; }
  .account-hero .actions {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .account-hero .actions .btn { margin-top: 0.35rem; flex: 1 1 auto; text-align: center; }
  .balance-scope .btn { min-height: 44px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .field { min-width: 0; width: 100%; }
  .filter-bar .btn, .filter-bar a.btn { width: 100%; text-align: center; margin-right: 0; }
  .table th, .table td { font-size: 0.8rem; padding: 0.55rem 0.35rem; white-space: nowrap; }
  .login-box { margin: 6vh auto; max-width: 100%; }
  .login-box .logo-xl { width: 96px; height: 96px; }
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="date"] { max-width: 100%; font-size: 16px; /* evita zoom iOS */ }
  .btn { min-height: 44px; }
}

@media (max-width: 400px) {
  .nav { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr; }
}

/* —— Login wallet / user —— */
.wallet-actions { margin-top: 1.25rem; }
.wallet-actions .btn { width: 100%; margin-right: 0; }
.login-sep {
  border: 0;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  margin: 1.5rem 0 1rem;
}
.admin-lan {
  text-align: left;
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-lan summary {
  cursor: pointer;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.admin-form .btn { width: 100%; margin-right: 0; }
.err-text { color: #ffc0c6 !important; }
.ok-text { color: #a8e6cf !important; }
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.kpi {
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(1, 8, 21, 0.45);
}
.kpi-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.kpi-value { font-weight: 650; color: var(--gold-2); }
.row-gap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.row-gap .btn { margin-top: 0; }
.config-form input,
.config-form textarea { max-width: 100%; }
.admin-form textarea.note-field,
.config-form textarea.note-field {
  min-height: 10rem;
  max-width: 100%;
  resize: vertical;
  line-height: 1.45;
}
.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  line-height: 1;
  background: rgba(1, 8, 21, 0.55);
}
.field-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  width: min(18rem, 70vw);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(2, 12, 28, 0.97);
  color: var(--text, #e8eef8);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: var(--glow-gold), 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 80;
  white-space: normal;
}
.field-tip:hover::after,
.field-tip:focus::after {
  opacity: 1;
  visibility: visible;
}
.strategy-box {
  margin: 1.25rem 0 0.5rem;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 12px;
  background: rgba(1, 8, 21, 0.4);
}
.strategy-box legend {
  padding: 0 0.35rem;
  color: var(--gold-2);
  font-weight: 650;
}
.wc-mobile-open {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wc-mobile-open[hidden] { display: none !important; }
.wc-mobile-open .btn { width: 100%; text-align: center; box-sizing: border-box; }
.wc-mobile-open a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.wc-qr-box {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.wc-qr-box img {
  width: 280px;
  height: 280px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #fff;
  box-shadow: var(--glow-gold);
}
.wc-qr-box[hidden] { display: none !important; }
.kucoin-cta,
.exchange-ctas {
  margin-top: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  max-width: 100%;
}
.kucoin-cta-link,
.exchange-cta-link {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  min-width: 11.5rem;
  max-width: 16rem;
  min-height: 4.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(35, 175, 145, 0.4);
  background: rgba(35, 175, 145, 0.08);
  color: var(--text);
  text-decoration: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.exchange-cta-mexc {
  border-color: rgba(0, 184, 232, 0.45);
  background: rgba(0, 184, 232, 0.08);
}
.exchange-cta-bitbase {
  border-color: rgba(255, 122, 26, 0.5);
  background: rgba(255, 122, 26, 0.08);
}
.exchange-cta-etherfi {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.1);
}
.kucoin-cta-link:hover,
.exchange-cta-kucoin:hover {
  border-color: #23af91;
  box-shadow: 0 0 18px rgba(35, 175, 145, 0.35);
  color: #fff;
  text-shadow: none;
}
.exchange-cta-mexc:hover {
  border-color: #00b8e8;
  box-shadow: 0 0 18px rgba(0, 184, 232, 0.35);
  color: #fff;
  text-shadow: none;
}
.exchange-cta-bitbase:hover {
  border-color: #ff7a1a;
  box-shadow: 0 0 18px rgba(255, 122, 26, 0.35);
  color: #fff;
  text-shadow: none;
}
.exchange-cta-etherfi:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
  color: #fff;
  text-shadow: none;
}
.kucoin-cta-link img,
.exchange-cta-link img,
.exchange-cta-ico {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
}
.kucoin-cta-text,
.exchange-cta-text {
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--muted);
  text-align: left;
  max-width: 9.5rem;
}
.kucoin-cta-link:hover .kucoin-cta-text,
.exchange-cta-kucoin:hover .exchange-cta-text { color: #a8e6cf; }
.exchange-cta-mexc:hover .exchange-cta-text { color: #9ee8ff; }
.exchange-cta-bitbase:hover .exchange-cta-text { color: #ffc48a; }
.exchange-cta-etherfi:hover .exchange-cta-text { color: var(--gold-2); }
.login-box .kucoin-cta,
.login-box .exchange-ctas {
  margin-top: 1.5rem;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: visible;
  max-width: 18rem;
  margin-left: auto;
  margin-right: auto;
  gap: 0.75rem;
}
.login-box .exchange-cta-link,
.login-box .kucoin-cta-link {
  width: 100%;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .exchange-cta-link,
  .kucoin-cta-link {
    min-width: 10.25rem;
    max-width: 14rem;
    min-height: 3.75rem;
    padding: 0.55rem 0.7rem;
  }
  .exchange-cta-link img,
  .kucoin-cta-link img {
    width: 40px;
    height: 40px;
  }
  .nav { flex-wrap: wrap; gap: 0.35rem; }
  .top { flex-wrap: wrap; gap: 0.75rem; }
  .panel { padding: 1rem 0.85rem; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .users-table .user-actions { max-width: none; min-width: 12rem; }
  .users-table .btn { min-height: 44px; }
}
@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr; }
}

.wallet-addr {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--cyan);
}
.users-search {
  position: relative;
  max-width: 36rem;
  margin: 0.85rem 0 0;
}
.users-search-box { position: relative; }
.users-search input[type="search"] {
  width: 100%;
  max-width: none;
  margin: 0;
}
.users-search #user-search-count {
  min-height: 1.2rem;
  margin: 0.4rem 0 0;
}
.users-suggest {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.3rem 0;
  list-style: none;
  background: #0a1428;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  box-shadow: var(--glow-gold);
  max-height: 18rem;
  overflow-y: auto;
}
.users-suggest li button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}
.users-suggest li button:hover,
.users-suggest li.is-active button {
  background: rgba(212, 175, 55, 0.14);
}
.users-suggest .suggest-title {
  display: block;
  color: var(--gold-2);
  font-weight: 600;
}
.users-suggest .hint {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}
.panel.is-search-empty { display: none; }
.user-row.is-flash td,
.pending-row.is-flash td,
.orphan-row.is-flash td {
  outline: 1px solid var(--gold);
  background: rgba(212, 175, 55, 0.08);
}
.users-table .user-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 14.5rem;
  max-width: 22rem;
}
.users-table .user-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.users-table .inline-form { display: inline; margin: 0; }
.users-table .note-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.25rem;
}
.users-table .note-form input[type="text"] {
  flex: 1;
  margin: 0;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.users-table .profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.users-table .profile-form input[type="text"] {
  margin: 0;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.user-alias { color: var(--gold-2); }
.tg-id {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.users-bind-form .check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.row-disabled td { opacity: 0.72; }
.users-table .btn {
  width: auto;
  margin: 0;
  padding: 0.4rem 0.72rem;
  font-size: 0.82rem;
}
.bot-tabs { display: none !important; }
.bot-panel {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(147, 161, 189, 0.22);
}
.bot-panel:first-of-type { border-top: 0; padding-top: 0; }
.bot-panel-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--gold-2);
}
.bot-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.config-form select { max-width: 100%; }

html.is-nav-loading,
html.is-nav-loading * {
  cursor: none !important;
}
#cj-load-cursor {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  pointer-events: none;
  will-change: transform;
}
html.is-nav-loading #cj-load-cursor {
  display: block;
}
#cj-load-cursor[hidden] { display: none !important; }
#cj-load-cursor img {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  animation: cj-spin 0.8s linear infinite;
}
@keyframes cj-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.is-nav-loading,
  html.is-nav-loading * {
    cursor: wait !important;
  }
  html.is-nav-loading #cj-load-cursor,
  #cj-load-cursor { display: none !important; }
  #cj-load-cursor img { animation: none; }
  #webgl-container { display: none !important; }
  body {
    background:
      radial-gradient(900px 480px at 8% -8%, rgba(212, 175, 55, 0.14), transparent 55%),
      radial-gradient(800px 520px at 100% 0%, rgba(0, 242, 254, 0.1), transparent 50%),
      linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 45%, #0a1224 100%);
  }
}

@media print {
  #webgl-container { display: none !important; }
  body { background: #fff; color: #000; }
}

/* —— i18n flags (AutoSeller pattern) —— */
.top-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-public { justify-content: space-between; }
.lang-switch {
  display: flex;
  gap: 0.05rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.18rem 0.22rem;
  background: rgba(8, 16, 32, 0.65);
}
.lang-switch button {
  border: 0;
  background: transparent;
  line-height: 0;
  padding: 0.35rem 0.38rem;
  border-radius: 999px;
  opacity: 0.9;
  cursor: pointer;
}
.lang-switch .flag {
  display: block;
  width: 1.35rem;
  height: 0.9rem;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  object-fit: cover;
}
.lang-switch button.is-active {
  opacity: 1;
  background: rgba(212, 175, 55, 0.22);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
}

/* —— community footer —— */
.site-footer {
  margin-top: 2.5rem;
  padding: 1.1rem 0 0.25rem;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  text-align: center;
}
.site-footer .tg-community {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-footer .tg-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #229ed9;
  color: #fff;
  font-size: 0.7rem;
  transform: rotate(-25deg);
}
.site-footer .meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.footer-privacy {
  position: relative;
  display: inline-block;
  margin: 0.85rem auto 0;
  max-width: 36rem;
}
.footer-privacy-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(212, 175, 55, 0.92);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: help;
  padding: 0.2rem 0.35rem;
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.35);
  text-underline-offset: 0.2em;
}
.footer-privacy-trigger:hover,
.footer-privacy-trigger:focus-visible {
  color: #f0d78c;
  text-decoration-color: rgba(240, 215, 140, 0.7);
  outline: none;
}
.footer-privacy-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(0.25rem);
  width: min(92vw, 26rem);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(8, 14, 28, 0.97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 40;
}
.footer-privacy-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(212, 175, 55, 0.35);
}
.footer-privacy:hover .footer-privacy-pop,
.footer-privacy:focus-within .footer-privacy-pop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.footer-privacy-pop p {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(220, 228, 240, 0.92);
}
.footer-privacy-pop p:last-child {
  margin-bottom: 0;
}
.footer-privacy-lead {
  color: rgba(240, 215, 140, 0.95) !important;
  font-weight: 600;
  font-size: 0.82rem !important;
}
.footer-ref-icons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin: 0.85rem auto 0;
  width: 100%;
  overflow-x: auto;
}
.footer-ref-ico {
  display: inline-flex;
  flex-direction: row;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(147, 161, 189, 0.35);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.85;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.footer-ref-ico:hover {
  opacity: 1;
  border-color: rgba(212, 175, 55, 0.55);
}
.footer-ref-ico-bitbase {
  border-color: rgba(255, 122, 26, 0.5);
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.22);
  opacity: 1;
}
.footer-ref-ico-gold {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.28);
  opacity: 1;
}
.footer-ref-ico img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.paper-verdict.status-promising { border-color: rgba(80, 200, 120, 0.45); }
.paper-verdict.status-marginal { border-color: rgba(212, 175, 55, 0.55); }
.paper-verdict.status-no_go { border-color: rgba(220, 80, 80, 0.5); }
.paper-verdict.status-caution { border-color: rgba(230, 140, 60, 0.55); }
.paper-verdict-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.paper-ball {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 10px rgba(100, 116, 139, 0.55);
}
.paper-ball.is-ok {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
}
.paper-ball.is-notok {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}
.paper-ok-label {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}
.paper-ok-label.is-ok { color: #22c55e; }
.paper-ok-label.is-notok { color: #ef4444; }
#paper-verdict-study { margin-top: 0.35rem; }
#paper-spark {
  width: 100%;
  max-width: 720px;
  height: 120px;
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(147, 161, 189, 0.2);
}

.ficha-wait {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 8, 21, 0.72);
  backdrop-filter: blur(6px);
}
.ficha-wait[hidden] { display: none !important; }
.ficha-wait-card {
  min-width: 16rem;
  padding: 1.35rem 1.6rem;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(12, 22, 40, 0.95);
  box-shadow: var(--glow-gold);
  text-align: center;
}
.ficha-wait-spin {
  width: 2.1rem;
  height: 2.1rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  border: 3px solid rgba(0, 242, 254, 0.2);
  border-top-color: #d4af37;
  animation: ficha-spin 0.8s linear infinite;
}
.ficha-wait-card p {
  margin: 0;
  color: var(--gold-2);
  font-weight: 650;
  letter-spacing: 0.03em;
}
@keyframes ficha-spin {
  to { transform: rotate(360deg); }
}

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.home-head h1 { margin: 0 0 0.25rem; }
.status-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.2rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 750;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  cursor: default;
}
.status-pill.is-on {
  color: #0b2a1c;
  background: #7ee0b0;
  box-shadow: 0 0 16px rgba(61, 154, 122, 0.45);
}
.status-pill.is-off {
  color: #fff;
  background: #c43b4a;
  box-shadow: 0 0 16px rgba(196, 59, 74, 0.4);
}
.status-pill .status-tip {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(22rem, 80vw);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(8, 13, 28, 0.96);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: var(--glow-gold);
  text-transform: none;
}
.status-pill:hover .status-tip,
.status-pill:focus .status-tip { display: block; }
.alta-docs-link {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.06);
}
.login-invited {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-2);
}
.ref-share { margin-top: 1.25rem; }
.ref-share h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.ref-url-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.ref-url-row input[type="text"] {
  flex: 1 1 16rem;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.ref-card-img {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: var(--glow-gold);
}
.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(147, 161, 189, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-weight: 650;
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: none;
}
.share-btn:hover { color: #fff; border-color: rgba(212, 175, 55, 0.55); }
.share-x { border-color: rgba(255, 255, 255, 0.35); }
.share-fb { border-color: rgba(24, 119, 242, 0.55); }
.share-li { border-color: rgba(10, 102, 194, 0.55); }
.share-ig { border-color: rgba(225, 48, 108, 0.55); }
.share-tt { border-color: rgba(238, 29, 82, 0.55); }
.share-wa { border-color: rgba(37, 211, 102, 0.55); }
.share-tg { border-color: rgba(38, 165, 228, 0.55); }
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.summary-head h2 { margin: 0; }
.btn-share-rrss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-2);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-share-rrss:hover {
  color: #fff;
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: var(--glow-gold);
}
.btn-share-rrss svg { display: block; fill: currentColor; }
.rrss-popup {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(1, 8, 21, 0.78);
  backdrop-filter: blur(8px);
}
.rrss-popup[hidden] { display: none !important; }
.rrss-popup-card {
  width: min(100%, 28rem);
  max-height: calc(100vh - 2.4rem);
  overflow: auto;
  padding: 1.1rem 1.15rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(10, 18, 32, 0.96);
  box-shadow: var(--glow-gold);
}
.rrss-popup-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--gold-2);
}
.rrss-period-label { margin: 0 0 0.4rem; }
.rrss-period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.rrss-period .btn.is-active {
  color: #fff;
  border-color: rgba(212, 175, 55, 0.85);
  background: rgba(212, 175, 55, 0.22);
  box-shadow: var(--glow-gold);
}
.rrss-popup-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.35rem 0 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.rrss-popup-img[hidden] { display: none; }
.rrss-popup-err { color: #ff8a8a; }
.rrss-popup-share { margin: 0.2rem 0 0.55rem; }
.rrss-popup-share[hidden],
.rrss-popup-hint[hidden] { display: none !important; }
.rrss-popup-close { width: 100%; margin-top: 0.35rem; }
#cfg-test-body {
  white-space: pre-wrap;
  text-align: left;
  line-height: 1.45;
}
body.rrss-open { overflow: hidden; }
body.share-public {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
}
.share-public-card {
  width: min(100%, 28rem);
  padding: 1rem 1.1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(10, 18, 32, 0.96);
  box-shadow: var(--glow-gold);
}
.share-public-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.share-public-card p {
  margin: 0.75rem 0 0;
  color: var(--text);
  word-break: break-word;
}
.share-public-card a { color: var(--gold-2); }
.alta-panel { padding: 1.15rem 1.2rem 1.35rem; }
.alta-progress {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 1rem;
  color: var(--muted);
}
.alta-progress-num {
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--gold-2);
}
.alta-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alta-step {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0.15rem 0.85rem 0.35rem;
  border-left: 2px solid rgba(147, 161, 189, 0.2);
  margin-left: 1.05rem;
}
.alta-step.is-ok { border-left-color: rgba(126, 224, 176, 0.7); }
.alta-step.is-todo { border-left-color: rgba(212, 175, 55, 0.55); }
.alta-step strong { display: block; color: var(--text); }
.alta-step p { margin: 0.25rem 0 0; }
.alta-mark {
  width: 2.1rem;
  height: 2.1rem;
  margin-left: -1.45rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  background: rgba(12, 22, 40, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-2);
}
.alta-step.is-ok .alta-mark {
  background: #7ee0b0;
  color: #0b2a1c;
  border-color: #7ee0b0;
}
.alta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.15rem 0 0;
}

/* ToS gate modal */
.tos-dialog {
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 0;
  max-width: min(720px, 96vw);
  width: 100%;
  background: #0c1628;
  color: var(--text, #e8edf7);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.tos-dialog::backdrop {
  background: rgba(1, 8, 21, 0.78);
}
.tos-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.2rem 1.2rem;
  max-height: min(88vh, 900px);
}
.tos-panel h2 {
  margin: 0;
  color: var(--gold-2, #f0d78c);
  font-size: 1.25rem;
}
.tos-body {
  flex: 1 1 auto;
  overflow: auto;
  max-height: 42vh;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(147, 161, 189, 0.25);
  border-radius: 8px;
  background: rgba(1, 8, 21, 0.55);
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #c5d0e6;
}
.tos-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
}
.tos-check input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.tos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.broadcast-form textarea {
  width: 100%;
  max-width: none;
  min-height: 10rem;
  resize: vertical;
  margin: 0.35rem 0 0.75rem;
}
.broadcast-fold {
  margin: 0.55rem 0 0.85rem;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 10px;
  background: rgba(1, 8, 21, 0.45);
  padding: 0.15rem 0.75rem 0.15rem;
}
.broadcast-fold summary {
  cursor: pointer;
  color: var(--gold-2);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 0;
  list-style: none;
}
.broadcast-fold summary::-webkit-details-marker { display: none; }
.broadcast-fold summary::before {
  content: "▸ ";
  color: var(--gold);
}
.broadcast-fold[open] summary::before { content: "▾ "; }
.broadcast-targets {
  margin: 0 0 0.65rem;
  padding: 0 0 0.35rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
  max-height: 14rem;
  overflow-y: auto;
}
.broadcast-targets li { margin: 0.2rem 0; }
.broadcast-list-edit {
  min-height: 22rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.45;
}
.broadcast-edit-rows {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.broadcast-edit-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(147, 161, 189, 0.14);
}
.broadcast-edit-rows .btn { margin: 0; }
.keys-lan-box {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}
