:root {
  --bg: #07060f;
  --panel: #12101c;
  --line: #2a2540;
  --gold: #e8b84a;
  --mint: #7ee0c5;
  --ink: #f4efe4;
  --mute: #9a90b0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(1200px 600px at 10% -10%, #1a1433, var(--bg)); color: var(--ink); font-family: "Segoe UI", system-ui, sans-serif; }
header.top {
  height: 68px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line); background: #0c0a16cc; backdrop-filter: blur(10px);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { border-radius: 12px; }
.brand b { display: block; }
.brand small { color: var(--mute); font-size: 11px; }
.stats { color: var(--gold); font-size: 14px; letter-spacing: .04em; }
.shell { display: flex; height: calc(100% - 68px); }
aside { width: 220px; background: #0a0814; border-right: 1px solid var(--line); padding: 12px; }
aside button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 4px 0;
  background: transparent; color: var(--mute); border: 0; border-radius: 10px; cursor: pointer;
}
aside button.on, aside button:hover { background: #1b1630; color: var(--gold); }
main { flex: 1; overflow: auto; padding: 22px; }
.view { display: none; } .view.on { display: block; }
h1 { margin: 0 0 8px; font-size: 1.7rem; }
.lead { color: var(--mute); max-width: 46rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.glow { box-shadow: 0 0 0 1px #e8b84a22, 0 12px 40px #0006; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.kpis .card h2 { margin: 6px 0 0; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
input, select, textarea {
  background: #07060f; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
button.btn { background: var(--gold); color: #1a1408; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.lang-card { text-align: left; color: inherit; cursor: pointer; width: 100%; }
.lang-card:hover { border-color: var(--gold); }
.native { font-size: 1.25rem; color: var(--mint); margin: 4px 0; }
.tag { font-size: 11px; color: var(--gold); letter-spacing: .05em; }
.muted { color: var(--mute); font-size: 13px; }
.opt { display: block; width: 100%; margin: 8px 0; padding: 12px; text-align: left; background: #1b1630; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--gold); }
#chat { min-height: 240px; background: #07060f; border-radius: 12px; padding: 12px; }
.trace-wrap { position: relative; width: 320px; height: 320px; }
.glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 160px; color: #2a254088; pointer-events: none; }
canvas { border: 2px dashed var(--line); border-radius: 12px; background: #0a0814; touch-action: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.warn { background: #1a1408; border: 1px solid #5a4a20; color: #e6d7a8; padding: 10px 12px; border-radius: 10px; }
@media (max-width: 760px) {
  .shell { flex-direction: column; height: auto; min-height: calc(100% - 68px); }
  aside { width: auto; display: flex; overflow: auto; }
  aside button { width: auto; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
