/* Palette - Shared Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #1a1a2e;
  --bg-card: #16213e;
  --border: #333366;
  --border-focus: #5555bb;
  --text-primary: #e8e8ff;
  --text-secondary: #9999cc;
  --text-muted: #8888bb;
  --text-dim: #555588;
  --accent: #5555bb;
  --accent-hover: #9999cc;
  --success: #66eebb;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

body {
  background: var(--bg-primary);
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Loading screen (shared by PyScript pages) */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }

.loader {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-screen p {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 15px;
}
#loading-screen .sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}
#loading-progress {
  margin-top: 14px;
  width: 220px;
  height: 4px;
  background: #2a2a4e;
  border-radius: 2px;
  overflow: hidden;
}
#loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Common input styles */
input[type="number"],
input[type="text"] {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 16px;
  font-family: var(--font-mono);
  outline: none;
  caret-color: #aaaaff;
}
input:focus { border-color: var(--border-focus); }
input::placeholder { color: var(--text-dim); }

/* Nav bar */
#palette-nav {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
#palette-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
#palette-nav a:hover { color: var(--text-primary); }
#palette-nav .nav-title {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: bold;
}
