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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #111;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
}

.hidden {
  display: none !important;
}

#login-screen {
  width: 100%;
  max-width: 340px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#login-form h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

#login-form input {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #eee;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

#login-form input:focus {
  border-color: #555;
}

#login-form button {
  background: #eee;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

#login-form button:hover {
  opacity: 0.85;
}

#login-error {
  color: #e44;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.top-bar h1 {
  margin-bottom: 0;
}

#logout-btn {
  background: none;
  border: 1px solid #333;
  color: #888;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#logout-btn:hover {
  color: #e44;
  border-color: #e44;
}

#public-screen {
  width: 100%;
  max-width: 520px;
  margin-top: 3rem;
  border-top: 1px solid #222;
  padding-top: 2rem;
}

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

#admin-screen .container {
  max-width: 900px;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

section {
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 0.75rem;
}

form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

input {
  flex: 1;
  min-width: 140px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #eee;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: #555;
}

button {
  background: #eee;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

button:hover {
  opacity: 0.85;
}

.result {
  margin-top: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  word-break: break-all;
  line-height: 1.5;
}

.result.ok {
  background: #0a1f0a;
  color: #4c4;
}

.result.err {
  background: #1f0a0a;
  color: #e44;
}

.result.info {
  background: #0a0a1f;
  color: #66c;
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 0.6rem;
}

.keys-table th {
  text-align: left;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #222;
}

.keys-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #1a1a1a;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  white-space: nowrap;
}

.keys-table td:first-child {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keys-table .active {
  color: #4c4;
}

.keys-table .inactive {
  color: #666;
}

.keys-table .bound {
  color: #cc4;
}

.btn-sm {
  background: none;
  border: 1px solid #333;
  color: #888;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-left: 0.3rem;
}

.btn-sm:hover {
  opacity: 1;
}

.btn-danger:hover {
  color: #e44;
  border-color: #e44;
}
