:root {
  color-scheme: dark;
  --bg: #08101f;
  --panel: rgba(14, 24, 44, 0.92);
  --panel-2: rgba(21, 32, 58, 0.95);
  --text: #eef4ff;
  --muted: #9db0d3;
  --accent: #74c0fc;
  --accent-2: #c77dff;
  --border: rgba(116, 192, 252, 0.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #122242 0%, #08101f 48%, #050913 100%);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(5, 9, 19, 0.78);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.topnav a {
  color: var(--text);
  text-decoration: none;
}
.nav-link-button {
  padding: 0.7rem 0.9rem;
  line-height: 1;
}
.nav-menu-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.45rem;
  margin-bottom: -0.45rem;
}
.nav-menu-shell::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 0.55rem;
}
.nav-menu-list {
  position: absolute;
  top: calc(100% + 0.05rem);
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
  z-index: 20;
}
#manager-menu-shell:hover #manager-menu,
#manager-menu-shell:focus-within #manager-menu,
#manager-menu-shell.open #manager-menu {
  display: grid !important;
}
.dropdown-link {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.04);
}
.dropdown-link:hover,
.dropdown-link:focus-visible {
  background: rgba(116, 192, 252, 0.12);
}
.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.hero-card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.grid-two {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.78rem;
}
.toolbar, .chat-form {
  display: grid;
  gap: 0.75rem;
}
.toolbar-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.compact-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-shell {
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 12px;
  background: #06101d;
  padding: 0.75rem;
}
.table-shell table { width: 100%; border-collapse: collapse; }
.table-shell th, .table-shell td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.carousel {
  overflow-x: auto;
}
.carousel-track {
  display: flex;
  gap: 1rem;
}
.carousel-card {
  min-width: 220px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}
.stack-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.service-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}
.service-card h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}
.service-card .status-pill {
  display: inline-block;
  margin: 0.25rem 0 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(116, 192, 252, 0.16);
  color: var(--accent);
  font-size: 0.82rem;
}
.muted-card {
  color: var(--muted);
}
.card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}
input, button, textarea, select {
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
button, .button-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04101a;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.text-button {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 0;
  font-weight: 600;
}
.file-picker-label {
  border: 1px solid var(--border);
}
.button-link.secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
progress {
  width: 100%;
  height: 12px;
}
pre {
  white-space: pre-wrap;
  background: #06101d;
  border-radius: 12px;
  padding: 1rem;
  max-height: 280px;
  overflow: auto;
}
.player-shell {
  display: grid;
  gap: 0.85rem;
}
.player-shell audio {
  width: 100%;
}
.waveform-shell {
  display: grid;
  gap: 0.45rem;
}
#track-waveform {
  width: 100%;
  height: 120px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 16, 31, 0.96), rgba(18, 34, 66, 0.96));
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
#track-waveform-status {
  font-size: 0.92rem;
}
.playlist-track-list {
  display: grid;
  gap: 0.5rem;
}
.hidden { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-card {
  width: min(640px, 100%);
  background: var(--panel-2);
  border-radius: 16px;
  padding: 1rem;
  position: relative;
  max-height: 90vh;
  overflow: auto;
}
.modal-card.modal-card-wide {
  width: min(920px, 100%);
}
.modal-close {
  position: absolute;
  right: 1rem;
  top: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
}
.oauth-modal-shell {
  display: grid;
  gap: 0.85rem;
  padding-top: 1.5rem;
}
.oauth-status {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(116, 192, 252, 0.1);
  border: 1px solid var(--border);
}
.oauth-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.oauth-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.oauth-inline-status {
  margin: 0;
  color: var(--muted);
}
.oauth-error {
  margin: 0;
  max-height: 180px;
}
@media (max-width: 768px) {
  .topbar { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .page-shell { padding: 1rem; }
}
