/* ============================================================
   REGISTAR — style.css
   All visual styles. No inline styles in HTML.
   ============================================================ */

/* ------------------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Colours */
  --bg:            #080808;
  --surface:       #0f0f0f;
  --surface-raised: #141414;
  --border:        #1a1a1a;
  --border-hover:  #242424;
  --accent:        #c8f135;
  --accent-dim:    rgba(200, 241, 53, 0.12);
  --accent-glow:   rgba(200, 241, 53, 0.25);
  --amber:         #f5a623;
  --amber-dim:     rgba(245, 166, 35, 0.12);
  --red:           #f13535;
  --red-dim:       rgba(241, 53, 53, 0.12);

  /* Text */
  --text-primary:   #f0f0f0;
  --text-secondary: #888;
  --text-muted:     #444;
  --text-on-accent: #080808;

  /* Typography */
  --font-heading:  'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-mono:     'DM Mono', 'Menlo', monospace;
  --font-body:     'DM Sans', 'Helvetica Neue', sans-serif;

  /* Layout */
  --header-h:      56px;
  --sidebar-w:     280px;
  --sidebar-footer-h: 72px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;

  /* Transitions */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:        120ms;
  --t-mid:         220ms;
  --t-slow:        400ms;
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Custom Scrollbars
   ------------------------------------------------------------ */
::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 1px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

/* ------------------------------------------------------------
   Noise Texture Overlay
   ------------------------------------------------------------ */
.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------
   Sticky Header
   ------------------------------------------------------------ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 28px;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
}

.logo-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Formerly .song-count-label — now used as the TOKENS counter label */
.song-count-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.song-count {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 0.04em;
  min-width: 32px;
  text-align: right;
}

/* ------------------------------------------------------------
   App Layout
   ------------------------------------------------------------ */
.app-layout {
  display: flex;
  height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
}

/* ------------------------------------------------------------
   Left Sidebar
   ------------------------------------------------------------ */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

/* Search */
.sidebar-search-wrap {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 32px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Song List */
.song-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.song-list {
  display: flex;
  flex-direction: column;
}

.song-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  gap: 8px;
}

.song-list-item:hover {
  background: var(--surface-raised);
  border-left-color: var(--border-hover);
}

.song-list-item.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.song-list-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.song-list-item-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.song-list-item.active .song-list-item-title {
  color: var(--accent);
}

.song-list-item-artist {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-list-item-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.badge-registered {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(200, 241, 53, 0.3);
}

.badge-draft {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-hover);
}

.badge-pending {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

/* Empty list */
.song-list-empty {
  padding: 32px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: none;
}

.song-list-empty.visible {
  display: block;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-new-song {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-new-song svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------
   Main Content
   ------------------------------------------------------------ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

/* ------------------------------------------------------------
   Empty State
   ------------------------------------------------------------ */
.empty-state:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 48px 24px;
}

.empty-state-inner {
  text-align: center;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state-glyph {
  font-size: 72px;
  line-height: 1;
  color: var(--border-hover);
  font-family: serif;
  filter: drop-shadow(0 0 24px var(--accent-glow));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.empty-state-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  line-height: 1;
}

.empty-state-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ------------------------------------------------------------
   Song Detail
   ------------------------------------------------------------ */
.song-detail {
  padding: 32px 36px;
  min-height: 100%;
  animation: fade-up var(--t-mid) var(--ease);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.song-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.song-detail-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.song-detail-title {
  font-family: var(--font-heading);
  font-size: 48px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-detail-artist {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.song-detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 6px;
}

/* ------------------------------------------------------------
   Tab Bar
   ------------------------------------------------------------ */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.tab-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  position: relative;
  background: none;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fade-up var(--t-mid) var(--ease);
}

.tab-panel.active {
  display: block;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary */
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: #d4f545;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--border);
}

.btn-danger:hover {
  background: var(--red-dim);
  border-color: var(--red);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 11px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 13px;
}

/* Disabled */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Form Elements
   ------------------------------------------------------------ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%23444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  margin-top: 2px;
}

.form-input.has-error,
.form-textarea.has-error,
.form-select.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-dim);
}

/* Row layout for forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Divider */
.form-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* Section heading */
.form-section-heading {
  font-family: var(--font-heading);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* ------------------------------------------------------------
   Cards / Data Surfaces
   ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color var(--t-fast) var(--ease);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* Data row inside cards */
.data-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.data-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.data-row-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  padding-top: 1px;
}

.data-row-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

/* ------------------------------------------------------------
   Status Badges
   ------------------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-registered {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(200, 241, 53, 0.3);
}

.status-registered::before {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}

.status-draft {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border-hover);
}

.status-draft::before {
  background: var(--text-muted);
}

.status-pending {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: rgba(245, 166, 35, 0.3);
}

.status-pending::before {
  background: var(--amber);
  box-shadow: 0 0 4px var(--amber);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-error {
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(241, 53, 53, 0.3);
}

.status-error::before {
  background: var(--red);
}

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

/* ------------------------------------------------------------
   Platform Chips / Checkboxes
   ------------------------------------------------------------ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.platform-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}

.platform-item:hover {
  border-color: var(--border-hover);
}

.platform-item.checked {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.platform-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-hover);
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}

.platform-item.checked .platform-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.platform-checkbox-icon {
  display: none;
  width: 9px;
  height: 9px;
  color: var(--text-on-accent);
}

.platform-item.checked .platform-checkbox-icon {
  display: block;
}

.platform-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.platform-item.checked .platform-name {
  color: var(--accent);
}

/* ------------------------------------------------------------
   Upload Log
   ------------------------------------------------------------ */
.changelog-list {
  display: flex;
  flex-direction: column;
  position: relative;
}

.changelog-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}

.changelog-item {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  position: relative;
}

.changelog-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}

.changelog-item:first-child .changelog-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.changelog-content {
  flex: 1;
  min-width: 0;
}

.changelog-action {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.changelog-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlay-in var(--t-mid) var(--ease);
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up var(--t-slow) var(--ease);
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--surface-raised);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

/* ------------------------------------------------------------
   Toast Notifications
   ------------------------------------------------------------ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  animation: toast-in var(--t-mid) var(--ease);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.toast.toast-exit {
  animation: toast-out var(--t-mid) var(--ease) forwards;
}

@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(20px); opacity: 0; }
}

.toast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success  .toast-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.toast-warning  .toast-dot { background: var(--amber);  box-shadow: 0 0 6px var(--amber);  }
.toast-error    .toast-dot { background: var(--red);    box-shadow: 0 0 6px var(--red);    }
.toast-info     .toast-dot { background: var(--text-secondary); }

.toast-success  { border-left: 2px solid var(--accent); }
.toast-warning  { border-left: 2px solid var(--amber);  }
.toast-error    { border-left: 2px solid var(--red);    }
.toast-info     { border-left: 2px solid var(--border-hover); }

/* ------------------------------------------------------------
   Utility Classes
   ------------------------------------------------------------ */
.text-accent   { color: var(--accent); }
.text-amber    { color: var(--amber);  }
.text-red      { color: var(--red);    }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-mono     { font-family: var(--font-mono); }
.text-heading  { font-family: var(--font-heading); }
.text-xs       { font-size: 11px; }
.text-sm       { font-size: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.flex         { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8        { gap: 8px; }
.gap-16       { gap: 16px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }

/* ------------------------------------------------------------
   Accent bar / highlight element
   ------------------------------------------------------------ */
.accent-bar {
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 24px 0;
}

/* Keyboard shortcut hints */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border-hover);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------
   Responsive (basic — sidebar collapses below 768px)
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-mid) var(--ease);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.8);
  }

  .main-content {
    margin-left: 0;
  }

  .song-detail {
    padding: 20px 20px;
  }

  .song-detail-header {
    flex-direction: column;
  }

  .song-detail-title {
    font-size: 36px;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .modal {
    max-height: 90vh;
  }

  .logo-tag {
    display: none;
  }
}

/* Enforce hidden attribute — prevents CSS display rules overriding [hidden] */
#empty-state[hidden]    { display: none !important; }
#settings-panel[hidden] { display: none !important; }

/* ------------------------------------------------------------
   Account Settings Panel
   ------------------------------------------------------------ */
#settings-panel:not([hidden]) {
  padding: 0;
  display: flex;
  justify-content: center;
}

/* Toggle switch for notification prefs */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-hover);
  border-radius: 20px;
  transition: background 120ms ease;
}

.settings-toggle-track::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 120ms ease, background 120ms ease;
}

.settings-toggle input:checked + .settings-toggle-track {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
}

.settings-toggle input:checked + .settings-toggle-track::before {
  transform: translateX(16px);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}


.audio-upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-audio-pick {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-accent);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--t-fast) var(--ease);
}

.btn-audio-pick:hover {
  opacity: 0.85;
}

.audio-filename {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}


/* ------------------------------------------------------------
   Settings Cog Button (sidebar)
   ------------------------------------------------------------ */
.settings-cog-btn {
  position: relative;
}

.settings-cog-btn svg {
  transition: transform 300ms ease;
}

.settings-cog-btn:hover svg {
  transform: rotate(45deg);
}

/* ------------------------------------------------------------
   Publishing Rights Picker (Settings → Collection Societies)
   ------------------------------------------------------------ */

/* The interactive card when publishing is not yet set */
.pub-rights-card {
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.pub-rights-card:hover,
.pub-rights-card.pub-card-open {
  background: rgba(200, 241, 53, 0.08) !important;
  border-color: rgba(200, 241, 53, 0.45) !important;
}

/* The locked card (agency already selected) */
.pub-rights-locked-card {
  cursor: default;
  position: relative;
}

.pub-rights-locked-card .pub-lock-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

.pub-rights-locked-card:hover .pub-lock-tooltip {
  display: block;
}

/* Popup panel that expands below the card */
.pub-rights-popup {
  display: none;
  margin-top: 8px;
  background: #111;
  border: 1px solid rgba(200, 241, 53, 0.2);
  border-radius: 6px;
  padding: 16px;
  animation: pub-popup-in 0.15s ease;
}

.pub-rights-popup.pub-popup-open {
  display: block;
}

@keyframes pub-popup-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The three agency option cards inside the popup */
.pub-agency-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.pub-agency-btn:hover {
  border-color: rgba(200, 241, 53, 0.35);
  color: var(--text-primary);
}

.pub-agency-btn.selected {
  border-color: var(--accent);
  background: rgba(200, 241, 53, 0.07);
  color: var(--accent);
}
