/* ===================================================================
   wavgram v1.00 — OS/2 Warp 3.0 Inspired Theme
   =================================================================== */

:root {
  --desktop:          #007878;
  --win-bg:           #c3c3c3;
  --win-border-lo:    #ffffff;
  --win-border-hi:    #858585;
  --win-border-edge:  #424242;
  --title-start:      #000080;
  --title-end:        #1084d0;
  --title-inactive:   #808080;
  --title-text:       #ffffff;
  --btn-face:         #c3c3c3;
  --text:             #000000;
  --text-inv:         #ffffff;
  --sel-bg:           #000080;
  --sel-text:         #ffffff;
  --input-bg:         #ffffff;
  --menu-bg:          #c3c3c3;
  --status-bg:        #c3c3c3;
  --scrollbar:        #c3c3c3;
  --shadow:           rgba(0,0,0,0.55);
  --accent:           #00aaff;
  --danger:           #aa0000;
  --success:          #005500;
  --warn:             #aa6600;
  --font:             'Tahoma', 'Verdana', 'Arial', sans-serif;
  --font-mono:        'Courier New', monospace;

  /* Theme-overridable structural colors */
  --topbar-bg:        linear-gradient(90deg, #000066 0%, #000080 40%, #1060b0 100%);
  --topbar-border:    #000040;
  --topbar-text:      #ffffff;
  --topbar-text-dim:  rgba(255,255,255,0.85);
  --art-panel-bg:     #0a0a20;
  --player-bg:        linear-gradient(180deg, #1a1a3a 0%, #0a0a20 100%);
  --player-border:    #000040;
  --player-text:      #ffffff;
  --player-text-dim:  #8899cc;
  --cover-ph-bg:      linear-gradient(135deg, #0a0a2a 0%, #1a1050 50%, #0a2040 100%);
  --lb-list-bg:       #ffffff;
  --lb-hover-bg:      #e8eeff;
  --play-btn-bg:      #000080;
  --play-btn-hi:      #4040c0;
  --play-btn-lo:      #000040;
  --progress-fill:    linear-gradient(90deg, #0044cc 0%, #0099ff 100%);
  --radio-bg:         #0a0a20;
  --radio-text:       #ffffff;
  --radio-text-dim:   #8899cc;
  --radio-border:     #223366;
  --text-muted:       #888888;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  background: var(--desktop);
  color: var(--text);
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,0,0,0.03) 0px,
      rgba(0,0,0,0.03) 1px,
      transparent 1px,
      transparent 8px
    );
}

a { color: var(--title-start); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--title-end); }

img { max-width: 100%; display: block; }

/* ── Beveled borders ────────────────────────────────────────────────── */
.raised {
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
}
.raised-sm {
  border-top:    1px solid var(--win-border-lo);
  border-left:   1px solid var(--win-border-lo);
  border-right:  1px solid var(--win-border-edge);
  border-bottom: 1px solid var(--win-border-edge);
}
.sunken {
  border-top:    2px solid var(--win-border-edge);
  border-left:   2px solid var(--win-border-edge);
  border-right:  2px solid var(--win-border-lo);
  border-bottom: 2px solid var(--win-border-lo);
}
.sunken-sm {
  border-top:    1px solid var(--win-border-edge);
  border-left:   1px solid var(--win-border-edge);
  border-right:  1px solid var(--win-border-lo);
  border-bottom: 1px solid var(--win-border-lo);
}

/* ── Window ─────────────────────────────────────────────────────────── */
.window {
  background: var(--win-bg);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  box-shadow: 3px 3px 8px var(--shadow);
}

.window-titlebar {
  background: linear-gradient(90deg, var(--title-start) 0%, var(--title-end) 100%);
  color: var(--title-text);
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.window-titlebar .title-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.window-titlebar .title-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-titlebar .title-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
  text-decoration: none;
}
.rss-link:hover { opacity: 1; }

.title-btn {
  width: 16px;
  height: 14px;
  background: var(--btn-face);
  border-top:    1px solid var(--win-border-lo);
  border-left:   1px solid var(--win-border-lo);
  border-right:  1px solid var(--win-border-edge);
  border-bottom: 1px solid var(--win-border-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  font-weight: bold;
}

.title-btn:hover { background: #d0d0d0; text-decoration: none; }
.title-btn:active {
  border-top:    1px solid var(--win-border-edge);
  border-left:   1px solid var(--win-border-edge);
  border-right:  1px solid var(--win-border-lo);
  border-bottom: 1px solid var(--win-border-lo);
}

.window-menubar {
  background: var(--menu-bg);
  border-bottom: 1px solid var(--win-border-hi);
  padding: 0 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.menu-item {
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.menu-item:hover, .menu-item.active {
  background: var(--sel-bg);
  color: var(--sel-text);
  text-decoration: none;
}

.window-content {
  padding: 8px;
}

.window-statusbar {
  background: var(--status-bg);
  border-top: 1px solid var(--win-border-hi);
  padding: 2px 6px;
  font-size: 11px;
  color: #333;
  display: flex;
  gap: 8px;
}

.status-cell {
  border-top:    1px solid var(--win-border-edge);
  border-left:   1px solid var(--win-border-edge);
  border-right:  1px solid var(--win-border-lo);
  border-bottom: 1px solid var(--win-border-lo);
  padding: 1px 6px;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  padding: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--topbar-border);
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  text-decoration: none;
  color: var(--topbar-text);
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1px;
  border-right: 2px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

.topbar-logo:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: var(--topbar-text); }

.topbar-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.topbar-logo .ver {
  font-size: 9px;
  opacity: 0.7;
  font-weight: normal;
  letter-spacing: 0;
}

.topbar-nav {
  display: flex;
  align-items: stretch;
  flex: 1;
  flex-wrap: wrap;
}

.topbar-nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--topbar-text-dim);
  font-size: 12px;
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

.topbar-nav a:hover { background: rgba(255,255,255,0.15); color: var(--topbar-text); text-decoration: none; }

.topbar-right {
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  margin-left: auto;
}

.topbar-user {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}

.main-content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.columns {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.col-main  { flex: 1; min-width: 0; }
.col-side  { width: 220px; flex-shrink: 0; }
.col-wide  { width: 320px; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  background: var(--btn-face);
  color: var(--text);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:hover { background: #d0d0d0; text-decoration: none; color: var(--text); }

.btn:active, .btn.pressed {
  border-top:    2px solid var(--win-border-edge);
  border-left:   2px solid var(--win-border-edge);
  border-right:  2px solid var(--win-border-lo);
  border-bottom: 2px solid var(--win-border-lo);
  padding: 5px 13px 3px 15px;
}

.btn-primary {
  background: var(--title-start);
  color: #fff;
  border-color: #0000b0 #000040 #000040 #0000b0;
}
.btn-primary:hover { background: #0000a0; color: #fff; }
.btn-primary:active { padding: 5px 13px 3px 15px; }

.btn-danger {
  background: #c03030;
  color: #fff;
  border-color: #e04040 #800000 #800000 #e04040;
}
.btn-danger:hover { background: #d03030; color: #fff; }

.btn-sm { padding: 2px 8px; font-size: 11px; }
.btn-sm:active { padding: 3px 7px 1px 9px; }

.btn-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
  font-weight: bold;
}

input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=search],
textarea,
select {
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 3px 5px;
  width: 100%;
  border-top:    2px solid var(--win-border-edge);
  border-left:   2px solid var(--win-border-edge);
  border-right:  2px solid var(--win-border-lo);
  border-bottom: 2px solid var(--win-border-lo);
  outline: none;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
textarea:focus,
select:focus {
  outline: 1px solid var(--title-end);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23333'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}

input[type=file] {
  font: inherit;
  font-size: 12px;
  background: var(--win-bg);
  padding: 4px;
  width: 100%;
}

.form-hint { font-size: 11px; color: #555; margin-top: 2px; }

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 140px; }

/* ── Flash messages ─────────────────────────────────────────────────── */
.flash-msg {
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  border-left: 4px solid;
}
.msg-success { background: #d0f0d0; border-color: #007700; color: #004400; }
.msg-error   { background: #f0d0d0; border-color: #aa0000; color: #660000; }
.msg-info    { background: #d0e8f8; border-color: #0055aa; color: #003388; }
.msg-warn    { background: #fff0cc; border-color: #aa7700; color: #664400; }

/* ── Panel / Card ───────────────────────────────────────────────────── */
.panel {
  background: var(--win-bg);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  margin-bottom: 8px;
}

.panel-header {
  background: var(--sel-bg);
  color: var(--sel-text);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.panel-body {
  padding: 8px;
}

.section-title {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--title-start);
  border-bottom: 1px solid var(--win-border-hi);
  padding-bottom: 3px;
  margin-bottom: 8px;
}

/* ── Track cards ────────────────────────────────────────────────────── */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.track-card {
  background: var(--win-bg);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  cursor: pointer;
  transition: box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}

.track-card:hover {
  box-shadow: 2px 2px 6px var(--shadow);
}

.track-card .cover-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #1a1a3a;
  overflow: hidden;
  position: relative;
}

.track-card .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-card .cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cover-ph-bg);
}

.cover-placeholder svg { opacity: 0.4; }

.track-card .track-info {
  padding: 5px 6px;
}

.track-card .track-title {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--title-start);
}

.track-card .track-artist {
  font-size: 10px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card .track-meta {
  font-size: 10px;
  color: #777;
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.track-card .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0,0,128,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.track-card:hover .play-overlay { opacity: 1; }

.play-overlay svg { fill: #fff; margin-left: 3px; }

/* ── Track list (alternative view) ─────────────────────────────────── */
.track-list {
  border-top:    2px solid var(--win-border-edge);
  border-left:   2px solid var(--win-border-edge);
  border-right:  2px solid var(--win-border-lo);
  border-bottom: 2px solid var(--win-border-lo);
  background: #fff;
}

.track-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
}

.track-list-item:last-child { border-bottom: none; }
.track-list-item:hover { background: #e0e8f8; }
.track-list-item.playing { background: var(--sel-bg); color: var(--sel-text); }
.track-list-item.playing .tli-meta { color: #aad4ff; }

.tli-num  { width: 20px; text-align: right; font-size: 11px; color: #888; flex-shrink: 0; }
.tli-cover { width: 32px; height: 32px; flex-shrink: 0; object-fit: cover; }
.tli-cover-placeholder {
  width: 32px; height: 32px; flex-shrink: 0;
  background: #1a1050;
  display: flex; align-items: center; justify-content: center;
}
.tli-info  { flex: 1; min-width: 0; }
.tli-title { font-size: 12px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tli-artist{ font-size: 11px; color: #555; }
.playing .tli-artist { color: #aad4ff; }
.tli-meta  { font-size: 10px; color: #888; white-space: nowrap; flex-shrink: 0; }

/* ── Audio Player ───────────────────────────────────────────────────── */
.player-bar {
  background: var(--player-bg);
  border-top: 2px solid var(--player-border);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.player-cover {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 2px solid #333;
  overflow: hidden;
  background: #111;
}

.player-cover img { width: 100%; height: 100%; object-fit: cover; }

.player-info { flex: 1; min-width: 0; }

.player-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--player-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 11px;
  color: var(--player-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ctrl-btn {
  width: 28px;
  height: 28px;
  background: var(--btn-face);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ctrl-btn:hover { background: #d8d8d8; }
.ctrl-btn:active {
  border-top:    2px solid var(--win-border-edge);
  border-left:   2px solid var(--win-border-edge);
  border-right:  2px solid var(--win-border-lo);
  border-bottom: 2px solid var(--win-border-lo);
}

.ctrl-btn svg { fill: #333; pointer-events: none; }
.ctrl-btn.playing svg { fill: #000080; }
.ctrl-btn.active { background: #dde; }
.ctrl-btn.active svg { stroke: #000080; fill: none; }
.ctrl-btn.active .lb-loop-label { color: #000080; }

.ctrl-btn-play {
  width: 34px;
  height: 34px;
  background: var(--play-btn-bg);
  border-top:    2px solid var(--play-btn-hi);
  border-left:   2px solid var(--play-btn-hi);
  border-right:  2px solid var(--play-btn-lo);
  border-bottom: 2px solid var(--play-btn-lo);
}
.ctrl-btn-play svg { fill: #fff; }
.ctrl-btn-play:hover { filter: brightness(1.25); }

.player-progress {
  flex: 1;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.progress-bar-wrap {
  height: 12px;
  background: #000;
  border-top:    1px solid #444;
  border-left:   1px solid #444;
  border-right:  1px solid #888;
  border-bottom: 1px solid #888;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--progress-fill);
  transition: width 0.3s linear;
  pointer-events: none;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8899cc;
  font-family: var(--font-mono);
}

.player-vol {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 6px;
  background: #333;
  border-top:    1px solid #444;
  border-left:   1px solid #444;
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--btn-face);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #424242;
  border-bottom: 1px solid #424242;
  cursor: pointer;
}

/* ── Lightbox ───────────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active { display: flex; }

.lightbox-window {
  background: var(--win-bg);
  border-top:    3px solid var(--win-border-lo);
  border-left:   3px solid var(--win-border-lo);
  border-right:  3px solid var(--win-border-edge);
  border-bottom: 3px solid var(--win-border-edge);
  box-shadow: 6px 6px 20px rgba(0,0,0,0.8);
  width: 92vw;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.lightbox-titlebar {
  background: linear-gradient(90deg, var(--title-start) 0%, var(--title-end) 100%);
  color: #fff;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
  font-size: 12px;
}

.lightbox-titlebar .title-text { flex: 1; }

.lightbox-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.lb-art-panel {
  width: 340px;
  flex-shrink: 0;
  background: var(--art-panel-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px;
  gap: 12px;
}

.lb-cover {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  background: #1a1050;
  border: 3px solid #333;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-cover img { width: 100%; height: 100%; object-fit: cover; }

.lb-meta {
  width: 100%;
  color: #ccc;
  text-align: center;
}

.lb-meta .lb-title {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 4px;
  word-break: break-word;
}

.lb-meta .lb-artist { font-size: 13px; color: #88aaff; margin-bottom: 2px; }
.lb-meta .lb-album  { font-size: 11px; color: #8899cc; margin-bottom: 2px; }
.lb-meta .lb-extra  { font-size: 11px; color: #667799; }

.lb-player {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lb-progress {
  height: 14px;
  background: #111;
  border-top:    1px solid #333;
  border-left:   1px solid #333;
  cursor: pointer;
  position: relative;
}

.lb-progress-fill {
  height: 100%;
  background: var(--progress-fill);
  pointer-events: none;
}

.lb-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #556688;
  font-family: var(--font-mono);
}

.lb-tracklist-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--lb-list-bg);
  border-left: 2px solid #999;
}

.lb-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 12px;
}

.lb-track-item:hover { background: var(--lb-hover-bg); }
.lb-track-item.active { background: var(--sel-bg); color: #fff; }
.lb-track-item.active .lb-ti-dur { color: #aad4ff; }

.lb-ti-num  { width: 22px; text-align: right; font-size: 10px; color: #999; flex-shrink: 0; }
.lb-track-item.active .lb-ti-num { color: #aad4ff; }
.lb-ti-thumb { width: 30px; height: 30px; flex-shrink: 0; object-fit: cover; }
.lb-ti-thumb-ph { width: 30px; height: 30px; flex-shrink: 0; background: #1a1050; }
.lb-ti-info { flex: 1; min-width: 0; }
.lb-ti-title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-ti-artist{ font-size: 10px; color: #666; }
.lb-track-item.active .lb-ti-artist { color: #aad4ff; }
.lb-ti-dur   { font-size: 10px; color: #999; flex-shrink: 0; font-family: var(--font-mono); }
.lb-ti-plays { font-size: 9px; color: #8899cc; flex-shrink: 0; min-width: 24px; text-align: right; }
.lb-track-item.active .lb-ti-plays { color: #aad4ff; }

.lb-nav-btns {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: var(--win-bg);
  border-top: 1px solid #bbb;
  justify-content: center;
}

/* ── User profile header ────────────────────────────────────────────── */
.profile-header {
  background: linear-gradient(180deg, #0a0a30 0%, #101040 100%);
  padding: 16px;
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: #1a1050;
  border: 3px solid #333;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-avatar svg { opacity: 0.5; }

.profile-info { flex: 1; min-width: 0; }

.profile-displayname {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

.profile-username {
  font-size: 12px;
  color: #8899cc;
  margin-bottom: 6px;
}

.profile-bio {
  font-size: 12px;
  color: #aabbcc;
  max-width: 500px;
  line-height: 1.5;
}

.profile-role-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: var(--title-start);
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Subpage tabs ───────────────────────────────────────────────────── */
.subpage-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--win-border-edge);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.subtab {
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  background: var(--win-bg);
  color: var(--text);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-hi);
  border-bottom: none;
  text-decoration: none;
  margin-bottom: -2px;
  white-space: nowrap;
}

.subtab:hover { background: #d8d8d8; text-decoration: none; color: var(--text); }
.subtab.active {
  background: var(--win-bg);
  font-weight: bold;
  border-bottom: 2px solid var(--win-bg);
  padding-bottom: 7px;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
}

.data-table th {
  background: var(--sel-bg);
  color: var(--sel-text);
  padding: 4px 8px;
  text-align: left;
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid #000040;
}

.data-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

.data-table tr:nth-child(even) td { background: #f0f0f8; }
.data-table tr:hover td { background: #dde8ff; }

/* ── Upload zone ────────────────────────────────────────────────────── */
.upload-zone {
  border: 3px dashed var(--win-border-hi);
  background: #f8f8f8;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.upload-zone:hover, .upload-zone.drag-over {
  background: #e8eeff;
  border-color: var(--title-end);
}

.upload-zone input[type=file] { display: none; }

.upload-icon { margin: 0 auto 10px; opacity: 0.4; }

.upload-progress {
  margin-top: 10px;
  display: none;
}

.progress-track {
  height: 16px;
  background: #111;
  border-top:    1px solid #444;
  border-left:   1px solid #444;
  border-right:  1px solid #888;
  border-bottom: 1px solid #888;
  position: relative;
  overflow: hidden;
}

.progress-track-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #0044cc 0px, #0044cc 8px,
    #0066ff 8px, #0066ff 16px
  );
  background-size: 32px 100%;
  animation: progress-stripe 0.5s linear infinite;
  transition: width 0.3s;
}

@keyframes progress-stripe {
  from { background-position: 0 0; }
  to   { background-position: 32px 0; }
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: bold;
  mix-blend-mode: difference;
}

/* ── Admin layout ───────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.admin-sidebar {
  width: 180px;
  flex-shrink: 0;
}

.admin-sidebar .panel-body { padding: 0; }

.admin-nav-item {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--win-border-hi);
}

.admin-nav-item:hover { background: var(--sel-bg); color: var(--sel-text); text-decoration: none; }
.admin-nav-item.active { background: #2020a0; color: #fff; font-weight: bold; }

.admin-main { flex: 1; min-width: 0; }

/* ── Invite code display ────────────────────────────────────────────── */
.invite-code {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 4px;
  background: #000;
  color: #00ff88;
  padding: 8px 16px;
  display: inline-block;
  border: 2px solid #004400;
  user-select: all;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
}

.invite-row.used { opacity: 0.55; }
.invite-row .code { font-family: var(--font-mono); font-weight: bold; letter-spacing: 2px; }

/* ── Login / Setup pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--desktop);
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 8px);
  padding: 20px;
}

.auth-window {
  width: 100%;
  max-width: 380px;
}

.auth-logo {
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, #000066 0%, #000080 100%);
  color: #fff;
}

.auth-logo h1 {
  font-size: 28px;
  letter-spacing: 6px;
  font-weight: bold;
}

.auth-logo .ver {
  font-size: 10px;
  opacity: 0.6;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 2px;
}

.auth-logo .tagline {
  font-size: 10px;
  color: #8899cc;
  letter-spacing: 1px;
  margin-top: 6px;
  font-style: italic;
}

/* ── Dashboard stats ────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stat-card {
  background: var(--win-bg);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
  padding: 10px 8px;
  text-align: center;
}

.stat-num  { font-size: 24px; font-weight: bold; color: var(--title-start); line-height: 1; }
.stat-label{ font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── Scrollbar style ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--win-bg); }
::-webkit-scrollbar-thumb {
  background: var(--btn-face);
  border-top:    2px solid var(--win-border-lo);
  border-left:   2px solid var(--win-border-lo);
  border-right:  2px solid var(--win-border-edge);
  border-bottom: 2px solid var(--win-border-edge);
}
::-webkit-scrollbar-button {
  background: var(--btn-face);
  border-top:    1px solid var(--win-border-lo);
  border-left:   1px solid var(--win-border-lo);
  border-right:  1px solid var(--win-border-edge);
  border-bottom: 1px solid var(--win-border-edge);
  height: 16px;
  width: 16px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .columns       { flex-direction: column; }
  .col-side, .col-wide { width: 100%; }
  .admin-layout  { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .lightbox-body { flex-direction: column; }
  .lb-art-panel  { width: 100%; }
  .lb-tracklist-panel { max-height: 200px; }
  .topbar-nav a  { padding: 0 7px; font-size: 11px; }
  .player-progress { display: none; }
  .track-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 480px) {
  .main-content { padding: 6px; }
  .topbar-nav a  { display: none; }
  .topbar-nav a.mobile-show { display: flex; }
  .track-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Misc ───────────────────────────────────────────────────────────── */
.text-muted   { color: #666; font-size: 11px; }
.text-small   { font-size: 11px; }
.text-center  { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.hidden { display: none !important; }

.badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: bold;
}
.badge-admin  { background: #aa0000; color: #fff; }
.badge-editor { background: #005500; color: #fff; }
.badge-contrib{ background: #004488; color: #fff; }

.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: #888;
}

.empty-state svg { opacity: 0.25; margin: 0 auto 10px; }

/* ── Landing Panel ──────────────────────────────────────────────────── */
.landing-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.landing-poster-wrap {
  flex-shrink: 0;
  width: 160px;
}

.landing-poster-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--win-border-hi);
  box-shadow: 3px 3px 8px var(--shadow);
}

.landing-content {
  flex: 1;
  min-width: 0;
  color: var(--text);
  line-height: 1.7;
  font-size: 13px;
}

/* Typography inside rendered markdown */
.landing-content h2 { font-size: 18px; font-weight: bold; margin: 0 0 10px; color: var(--title-start); letter-spacing: 0.5px; }
.landing-content h3 { font-size: 15px; font-weight: bold; margin: 12px 0 6px; color: var(--title-start); }
.landing-content h4 { font-size: 13px; font-weight: bold; margin: 10px 0 4px; color: var(--title-start); }
.landing-content h5 { font-size: 12px; font-weight: bold; margin: 8px 0 4px; }
.landing-content p  { margin: 0 0 10px; }
.landing-content p:last-child { margin-bottom: 0; }
.landing-content ul, .landing-content ol { margin: 0 0 10px 20px; }
.landing-content li { margin-bottom: 4px; }
.landing-content blockquote {
  border-left: 4px solid var(--win-border-hi);
  margin: 10px 0;
  padding: 6px 10px;
  background: rgba(0,0,0,0.05);
  font-style: italic;
  color: #555;
}
.landing-content hr  { border: none; border-top: 2px solid var(--win-border-hi); margin: 12px 0; }
.landing-content a   { color: var(--title-end); }
.landing-content a:hover { color: var(--accent); }
.landing-content code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0,0,0,0.08);
  padding: 1px 4px;
  border: 1px solid var(--win-border-hi);
}
.landing-content pre {
  background: #111;
  color: #e0e0e0;
  padding: 10px;
  overflow-x: auto;
  font-size: 11px;
  margin-bottom: 10px;
  border: 1px solid var(--win-border-edge);
}
.landing-content pre code { background: none; border: none; padding: 0; color: inherit; }
.landing-content strong { font-weight: bold; }
.landing-content em { font-style: italic; }

@media (max-width: 600px) {
  .landing-body { flex-direction: column; }
  .landing-poster-wrap { width: 100%; max-width: 200px; margin: 0 auto; }
}

/* ── Radio Station ───────────────────────────────────────────────────── */
.radio-station {
  background: var(--radio-bg);
  border: 2px solid var(--radio-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
}

.radio-logo-wrap {
  width: 64px;
  height: 64px;
  border: 3px solid var(--radio-border);
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radio-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.radio-station-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--radio-text);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.radio-station-desc {
  font-size: 13px;
  color: var(--radio-text-dim);
  max-width: 480px;
  line-height: 1.6;
  text-align: left;
}
.radio-station-desc p { margin: 0 0 8px; }
.radio-station-desc p:last-child { margin-bottom: 0; }
.radio-station-desc h2,.radio-station-desc h3,.radio-station-desc h4 {
  font-size: 14px; font-weight: bold; color: var(--radio-text);
  margin: 10px 0 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.radio-station-desc strong { color: var(--radio-text); font-weight: bold; }
.radio-station-desc em { font-style: italic; }
.radio-station-desc a { color: var(--progress-fill, #0099ff); text-decoration: none; }
.radio-station-desc a:hover { text-decoration: underline; }
.radio-station-desc ul,.radio-station-desc ol { padding-left: 20px; margin: 4px 0 8px; }
.radio-station-desc li { margin-bottom: 3px; }
.radio-station-desc blockquote {
  border-left: 3px solid var(--radio-border);
  margin: 8px 0; padding: 4px 12px;
  color: var(--radio-text-dim); font-style: italic;
}
.radio-station-desc hr { border: none; border-top: 1px solid var(--radio-border); margin: 10px 0; }
.radio-station-desc code {
  font-family: monospace; font-size: 11px;
  background: rgba(0,0,0,0.3); padding: 1px 5px;
  color: var(--radio-text);
}
.radio-station-desc pre {
  background: rgba(0,0,0,0.3); border: 1px solid var(--radio-border);
  padding: 8px 10px; overflow-x: auto; margin: 8px 0;
}
.radio-station-desc pre code { background: none; padding: 0; }

.radio-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--radio-border);
  padding: 8px 16px;
  min-width: 300px;
  justify-content: center;
}

.radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
  transition: background 0.3s;
}

.radio-dot.live {
  background: #ff3a3a;
  box-shadow: 0 0 6px #ff3a3a;
  animation: radio-pulse 1.2s ease-in-out infinite;
}

@keyframes radio-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.radio-status-text {
  font-size: 12px;
  color: var(--radio-text-dim);
  font-family: var(--font-mono);
}

.radio-nowplaying {
  font-size: 13px;
  color: var(--radio-text);
  font-style: italic;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.radio-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-vol-wrap svg { flex-shrink: 0; }

.radio-popout-note {
  font-size: 11px;
  color: var(--radio-text-dim);
  max-width: 380px;
  text-align: center;
  line-height: 1.5;
}
