*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 680px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 1.5rem;
  text-align: center;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

form {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row { display: flex; flex-direction: column; gap: .35rem; }

label { font-size: .85rem; color: #94a3b8; }

input[type="text"], select {
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 1rem;
  padding: .55rem .75rem;
  transition: border-color .15s;
}
input[type="text"]:focus, select:focus {
  outline: none;
  border-color: #38bdf8;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: #cbd5e1;
  cursor: pointer;
}

button[type="submit"] {
  background: #0ea5e9;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: .65rem 1.25rem;
  cursor: pointer;
  transition: background .15s;
}
button[type="submit"]:hover { background: #38bdf8; }

.error {
  margin-top: 1rem;
  background: #450a0a;
  border: 1px solid #b91c1c;
  border-radius: 8px;
  color: #fca5a5;
  padding: .75rem 1rem;
  font-size: .9rem;
}

.results {
  margin-top: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
}

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: .55rem .75rem; text-align: left; }
th { font-size: .8rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
td { border-top: 1px solid #1e293b; font-size: .95rem; }
tr:nth-child(even) td { background: #0f172a; }

.mono { font-family: 'Cascadia Code', 'Fira Code', monospace; letter-spacing: .05em; color: #7dd3fc; }

#bit-badge {
  background: #0c4a6e;
  border-radius: 999px;
  color: #38bdf8;
  font-size: .75rem;
  padding: .15rem .6rem;
}

.bit-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: .5rem;
}
.bit {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: .85rem;
  font-weight: 700;
  transition: background .2s;
}
.bit-1 { background: #0ea5e9; color: #fff; }
.bit-0 { background: #1e3a4a; color: #475569; }

.bit-group-sep { width: 4px; }

.hidden { display: none !important; }
