:root {
  --ink: #e8eef5;
  --muted: #9aa8b8;
  --line: rgba(232, 238, 245, 0.12);
  --panel: rgba(10, 16, 24, 0.72);
  --accent: #7eb6ff;
  --danger: #ff8b8b;
  --ok: #8fd6a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, Figtree, system-ui, sans-serif;
  background: #05080d;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(80, 120, 180, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(40, 70, 110, 0.18), transparent 50%),
    linear-gradient(180deg, #0a121c 0%, #05080d 55%, #030507 100%);
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.brand {
  font-family: Figtree, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
}

.brand em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  opacity: 0.9;
}

.sub {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.panel {
  margin-top: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 1.5rem;
}

.panel h1,
.panel h2 {
  margin: 0 0 0.75rem;
  font-family: Figtree, Inter, sans-serif;
  letter-spacing: -0.03em;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.9rem 0 0.35rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font: inherit;
}

input:focus {
  outline: 1px solid var(--accent);
}

.btn {
  margin-top: 1.15rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, #dce8f7, #b7cbe4);
  color: #0b121a;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.err {
  color: var(--danger);
  margin-top: 0.85rem;
  font-size: 0.9rem;
}

.ok {
  color: var(--ok);
}

.qr {
  display: block;
  margin: 1rem auto;
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
}

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--muted);
  text-align: center;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.stat .n {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat .l {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 800px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  margin-top: 0.75rem;
}

.bar {
  flex: 1;
  min-width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(126, 182, 255, 0.25));
  border-radius: 4px 4px 0 0;
}

.range {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  color: #0b121a;
  background: #dce8f7;
  border-color: transparent;
}
