:root,
body[data-theme="light"] {
  color-scheme: light;
  --ink: #17202a;
  --muted: #68707a;
  --line: #d6dce2;
  --line-strong: #c7d0d8;
  --paper: #ffffff;
  --surface: #f2f5f7;
  --panel: #fbfcfd;
  --panel-alt: #eef2f5;
  --accent: #006d77;
  --accent-hover: #00565e;
  --accent-ink: #ffffff;
  --accent-glow: 0 2px 6px rgba(0, 109, 119, 0.25);
  --success: #2e7d32;
  --warning: #e65100;
  --warning-bg: #fff3e0;
  --card-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-text: #17202a;
  --btn-border: #c7d0d8;
  --btn-bg-hover: #f4f7f9;
  --btn-text-hover: #17202a;
  --btn-border-hover: #9bb0c0;
  --border-radius: 6px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e0e0ff;
  --muted: #8892b0;
  --line: #1c223a;
  --line-strong: #2a3456;
  --paper: #0b0d1e;
  --surface: #050510;
  --panel: #080916;
  --panel-alt: #0e1128;
  --accent: #00ffcc;
  --accent-hover: #00d9ae;
  --accent-ink: #050510;
  --accent-glow: 0 0 12px rgba(0, 255, 204, 0.4);
  --success: #00ffcc;
  --warning: #ffaa00;
  --warning-bg: #2a1f05;
  --card-bg: #0d1026;
  --btn-bg: #0d1026;
  --btn-text: #e0e0ff;
  --btn-border: #1c223a;
  --btn-bg-hover: #141836;
  --btn-text-hover: #00ffcc;
  --btn-border-hover: #00ffcc88;
  --border-radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  overflow: hidden;
}

.panel {
  height: 100%;
  overflow-y: auto;
  padding: 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.theme-switch {
  display: inline-flex;
  background: var(--panel-alt, #eef2f5);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: auto;
  line-height: 1;
}

.theme-toggle-btn:hover {
  color: var(--ink);
}

.theme-toggle-btn.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body[data-theme="dark"] .theme-toggle-btn.active {
  background: #141836;
  color: #00ffcc;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.help-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: auto;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.help-trigger-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.help-trigger-btn svg {
  flex-shrink: 0;
}

.help-nav {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 0;
}

.help-nav-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  border-radius: 4px 4px 0 0;
}

.help-nav-btn:hover {
  color: var(--ink);
  background: rgba(0, 109, 119, 0.05);
}

.help-nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0, 109, 119, 0.08);
}

.help-pane {
  display: none;
}

.help-pane.active {
  display: block;
}

.help-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.help-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.help-card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 8px;
}

.help-card ul {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  padding-left: 20px;
  margin-bottom: 8px;
}

.help-card li {
  margin-bottom: 4px;
}

.help-tip {
  background: var(--panel-alt);
  border-left: 3.5px solid var(--accent);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  margin-top: 10px;
}

.help-tip strong {
  color: var(--accent);
}

/* --------------------------------------------------
 * Workflow Tabs
 * -------------------------------------------------- */

.workflow-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 18px;
  background: #eaeff2;
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #556575;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.tab-btn.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8e2e8;
  color: #43505c;
  font-size: 10px;
  font-weight: 800;
}

.tab-btn.active .tab-num {
  background: var(--accent);
  color: #ffffff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: tabFade 0.2s ease;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------
 * Sub-Tabs inside Tab 3 (Editor)
 * -------------------------------------------------- */

.subtab-nav {
  display: flex;
  gap: 4px;
  background: #eef2f5;
  padding: 4px;
  border-radius: 8px;
  margin: 12px 0 16px 0;
  border: 1px solid var(--line);
}

.subtab-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #556270;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.subtab-btn:hover {
  color: #172130;
  background: rgba(255, 255, 255, 0.6);
}

.subtab-btn.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.subtab-pane {
  display: none;
}

.subtab-pane.active {
  display: block;
  animation: tabFade 0.15s ease;
}

.step-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
}

.step-footer .btn-step-next {
  width: 100%;
}

.two-col-footer {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

.two-col-footer button {
  width: 100%;
}

/* --------------------------------------------------
 * Tab 4 Project Summary Card
 * -------------------------------------------------- */

.summary-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  color: var(--ink);
  font-weight: 700;
}

.export-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.full-width-btn {
  width: 100%;
  font-size: 14px;
  padding: 12px;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.import-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.12;
}

h2 {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #39434d;
}

h3 {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.control-section {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.control-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: #43505c;
  font-size: 12px;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.hint.multiline,
.hint.multiline span {
  display: block;
}

.hint strong {
  color: #43505c;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d0d8;
  border-radius: var(--border-radius);
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
}

input[type="color"] {
  padding: 2px 4px;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.15);
}

input[type="file"] {
  min-height: auto;
  padding: 8px;
}

.file-control {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.file-control input[type="file"] {
  padding: 4px;
  font-size: 11px;
}

.icon-button,
.trash-button {
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #c7d0d8;
  border-radius: var(--border-radius);
  background: #f8fafb;
  color: #556575;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-button:hover,
.trash-button:hover {
  background: #f0f4f7;
  color: var(--accent);
  border-color: #7d8a95;
}

.trash-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

textarea {
  resize: vertical;
  line-height: 1.35;
}

.tracklist-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.tracklist-header-row .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.tracklist-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-track-action {
  font-size: 11px;
  padding: 3px 8px;
  height: 24px;
  min-height: 24px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #c7d0d8;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-track-action:hover {
  background: #e2e8f0;
  border-color: #9cb0c0;
  color: var(--accent);
}

.tracklist-tools {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.small-tool-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #c7d0d8;
  border-radius: 4px;
  background: #f8fafb;
  color: #43505c;
  cursor: pointer;
}

.small-tool-btn:hover {
  background: #eef2f5;
  border-color: #9cb0c0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.checkbox.hidden {
  display: none;
}

.checkbox input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.option-stack {
  display: grid;
  gap: 8px;
}

.logo-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.label-set-field {
  display: grid;
  gap: 10px;
}

.label-set-field.hidden {
  display: none;
}

.mini-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-actions button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

button {
  min-height: 40px;
  border: 1px solid var(--btn-border);
  border-radius: var(--border-radius);
  padding: 8px 12px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover {
  border-color: var(--btn-border-hover);
  background: var(--btn-bg-hover);
  color: var(--btn-text-hover);
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.secondary {
  border-color: var(--btn-border);
  background: var(--panel-alt);
  color: var(--btn-text);
}

.secondary:hover {
  border-color: var(--btn-border-hover);
  background: var(--btn-bg-hover);
  color: var(--btn-text-hover);
}

/* --------------------------------------------------
 * Preview Stage & Pagination
 * -------------------------------------------------- */

.preview-wrap {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto 12px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

.sheet-pagination-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-nav-btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
}

.page-nav-btn:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  color: var(--btn-text-hover);
}

.page-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sheet-page-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sheet-page-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.sheet-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sheet-pill {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-pill:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  color: var(--btn-text-hover);
}

.sheet-pill.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.preview-scale-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #43505c;
}

.preview-scale-controls select {
  min-height: 28px;
  padding: 2px 6px;
  font-size: 11px;
  width: auto;
}

.sheet-host {
  margin: 0 auto;
  transition: width 0.2s ease;
}

.sheet-host.zoom-fit {
  width: min(100%, 650px);
}

.sheet-host.zoom-85 {
  width: min(100%, 750px);
}

.sheet-host.zoom-100 {
  width: min(100%, 880px);
}

.sheet-host svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(31, 41, 55, 0.16);
  border-radius: 2px;
}

/* Interactive SVG Label Click Highlight */
.sheet-host svg g[data-label-index] {
  cursor: pointer;
  transition:
    filter 0.15s ease,
    opacity 0.15s ease;
}

.sheet-host svg g[data-label-index]:hover {
  filter: drop-shadow(0 0 3px rgba(0, 109, 119, 0.5));
}

.sheet-host svg g.active-label-slot {
  filter: drop-shadow(0 0 5px rgba(0, 109, 119, 0.9));
}

.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 8px 20px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}

.footer-credits {
  flex: 1 1 520px;
  text-align: left;
}

.footer-credits .credit-main {
  color: var(--fg);
  font-size: 12.5px;
  margin-bottom: 3px;
}

.footer-credits .privacy-note {
  color: var(--muted);
  font-size: 11.5px;
}

.footer-kofi {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

/* --------------------------------------------------
 * Modals & Overlays
 * -------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 25, 33, 0.65);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  z-index: 10;
  width: 100%;
  max-height: 90vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
}

.modal-lg {
  max-width: 780px;
}

.modal-xl {
  max-width: 980px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--accent);
  text-transform: none;
  font-weight: 700;
}

.sub-counter {
  display: inline-block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  min-height: auto;
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--accent);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-alt);
  gap: 12px;
}

.footer-actions-right {
  display: flex;
  gap: 10px;
}

/* --------------------------------------------------
 * Search Modal Content
 * -------------------------------------------------- */

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--panel-alt);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.search-field {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-field input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
}

.btn-search-submit {
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 700;
  min-height: 35px;
  align-self: flex-end;
}

.search-status {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.search-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.search-card:hover {
  border-color: #9cb0c0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.search-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--panel-alt);
  object-fit: cover;
  display: block;
}

.search-card-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-card-artist {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-card-meta {
  font-size: 11px;
  color: var(--muted);
}

.search-card-actions {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
}

.search-card-actions button {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
}

.search-card-actions button.btn-add-new-album {
  margin-top: 6px;
  font-size: 11.5px;
}

/* --------------------------------------------------
 * Import Directory / Selection Modal
 * -------------------------------------------------- */

.import-filter-bar {
  margin-bottom: 14px;
}

.import-filter-bar input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
}

.album-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.album-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}

.album-item-check {
  width: 18px;
  height: 18px;
}

.album-item-art {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: var(--panel-alt);
  object-fit: cover;
  flex-shrink: 0;
}

.album-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.album-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.album-item-sub {
  font-size: 12px;
  color: var(--muted);
}

.album-item-path {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #ffcc80;
}

.badge-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.badge-info {
  background: var(--panel-alt);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* --------------------------------------------------
 * Side-by-Side Review & Diff Merge
 * -------------------------------------------------- */

.review-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-nav button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}

.review-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--panel-alt);
  border-radius: 6px;
}

.review-search-bar label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-by-side-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.diff-col {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.diff-col-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.diff-local .diff-col-header {
  background: #f8fafb;
}

.diff-online .diff-col-header {
  background: #e6f4f5;
}

.diff-col-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #17202a;
  text-transform: uppercase;
}

.diff-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.diff-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f4;
}

.diff-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.diff-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.cover-thumb-container {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  background: #eaeff2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

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

.cover-thumb-empty {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}

.info-preview-box {
  background: #f9fbfb;
  border: 1px solid #e1e7ec;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.info-preview-box strong {
  color: #17202a;
}

.tracks-preview-box {
  background: #f9fbfb;
  border: 1px solid #e1e7ec;
  border-radius: 6px;
  padding: 8px 10px;
  max-height: 140px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.diff-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #2b3947;
  cursor: pointer;
}

/* --------------------------------------------------
 * Drag & Drop Overlay & Toast
 * -------------------------------------------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 109, 119, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
}

.drop-message {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-message h2 {
  color: #ffffff;
  font-size: 24px;
  text-transform: none;
}

.drop-message p {
  color: #d1ecf0;
  font-size: 15px;
}

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

.toast {
  background: #17202a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease;
  pointer-events: auto;
}

.toast.toast-success {
  background: #0f5132;
  border-left: 4px solid #75b798;
}

.toast.toast-warning {
  background: #664d03;
  border-left: 4px solid #ffda6a;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .panel {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-wrap {
    height: auto;
    overflow: visible;
    padding: 16px;
  }

  .side-by-side-container {
    grid-template-columns: 1fr;
  }
}

.netmd-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef7f8;
  border: 1px solid #c2e2e5;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #006d77;
  font-weight: 500;
}

.netmd-status-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #006d77;
  border-top-color: transparent;
  border-radius: 50%;
  animation: netmd-spin 0.8s linear infinite;
}

@keyframes netmd-spin {
  to {
    transform: rotate(360deg);
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .panel,
  .preview-toolbar,
  .site-footer,
  .modal,
  .toast-container {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .preview-wrap {
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .sheet-host {
    width: 210mm;
    height: 297mm;
    margin: 0;
  }

  .sheet-host svg {
    width: 210mm;
    height: 297mm;
    box-shadow: none;
  }
}

/* --------------------------------------------------
 * Dark Mode Overrides (Nudelity Cyber Theme)
 * -------------------------------------------------- */

body[data-theme="dark"] h1 {
  color: #00ffcc;
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.35);
}

body[data-theme="dark"] h2 {
  color: #00ffcc;
  letter-spacing: 0.5px;
}

body[data-theme="dark"] h3 {
  color: #8892b0;
}

body[data-theme="dark"] label {
  color: #c5cde3;
}

body[data-theme="dark"] .workflow-tabs {
  background: #0b0d1e;
  border: 1px solid #1c223a;
}

body[data-theme="dark"] .tab-btn {
  color: #8892b0;
}

body[data-theme="dark"] .tab-btn:hover {
  color: #e0e0ff;
  background: rgba(0, 255, 204, 0.06);
}

body[data-theme="dark"] .tab-btn.active {
  background: #141836;
  color: #00ffcc;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.25);
  border: 1px solid rgba(0, 255, 204, 0.35);
}

body[data-theme="dark"] .tab-btn.active .tab-num {
  background: #00ffcc;
  color: #050510;
}

body[data-theme="dark"] .tab-num {
  background: #1c223a;
  color: #8892b0;
}

body[data-theme="dark"] .subtab-nav {
  background: #0b0d1e;
  border-color: #1c223a;
}

body[data-theme="dark"] .subtab-btn {
  color: #8892b0;
}

body[data-theme="dark"] .subtab-btn:hover {
  color: #e0e0ff;
  background: rgba(0, 255, 204, 0.06);
}

body[data-theme="dark"] .subtab-btn.active {
  background: #141836;
  color: #00ffcc;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.25);
  border: 1px solid rgba(0, 255, 204, 0.35);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #0b0d1e;
  color: #e0e0ff;
  border-color: #1c223a;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.25);
}

body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .trash-button,
body[data-theme="dark"] .zoom-select {
  background: #0b0d1e;
  border-color: #1c223a;
  color: #8892b0;
}

body[data-theme="dark"] .icon-button:hover,
body[data-theme="dark"] .trash-button:hover {
  background: #141836;
  color: #00ffcc;
  border-color: #00ffcc44;
}

body[data-theme="dark"] button {
  background: #0d1026;
  color: #e0e0ff;
  border: 1px solid #1c223a;
}

body[data-theme="dark"] button:hover {
  background: #141836;
  color: #00ffcc;
  border-color: #00ffcc88;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

body[data-theme="dark"] .primary,
body[data-theme="dark"] .primary-btn,
body[data-theme="dark"] .btn-step-next,
body[data-theme="dark"] .btn-primary,
body[data-theme="dark"] .btn-save-project,
body[data-theme="dark"] .btn-export-pdf,
body[data-theme="dark"] .btn-search-submit,
body[data-theme="dark"] #btn-export-pdf {
  background: #00ffcc;
  color: #050510;
  border-color: #00ffcc;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
}

body[data-theme="dark"] .primary:hover,
body[data-theme="dark"] .primary-btn:hover,
body[data-theme="dark"] .btn-step-next:hover,
body[data-theme="dark"] .btn-primary:hover,
body[data-theme="dark"] .btn-save-project:hover,
body[data-theme="dark"] .btn-export-pdf:hover,
body[data-theme="dark"] .btn-search-submit:hover,
body[data-theme="dark"] #btn-export-pdf:hover {
  background: #00d9ae;
  color: #050510;
  border-color: #00d9ae;
  box-shadow: 0 0 18px rgba(0, 255, 204, 0.55);
}

body[data-theme="dark"] .secondary {
  background: #0e1128;
  color: #e0e0ff;
  border-color: #1c223a;
}

body[data-theme="dark"] .secondary:hover {
  background: #141836;
  color: #00ffcc;
  border-color: #00ffcc88;
}

body[data-theme="dark"] .btn-step-prev {
  background: #0b0d1e;
  color: #8892b0;
  border-color: #1c223a;
}

body[data-theme="dark"] .btn-step-prev:hover {
  color: #e0e0ff;
  border-color: #00ffcc88;
}

body[data-theme="dark"] .summary-card {
  background: #0d1026;
  border-color: #1c223a;
}

body[data-theme="dark"] .preview-wrap {
  background: #050510;
  background-image: radial-gradient(#1c223a 1px, transparent 1px);
  background-size: 20px 20px;
}

body[data-theme="dark"] .preview-toolbar,
body[data-theme="dark"] .site-footer {
  background: #080916;
  border-color: #1c223a;
}

body[data-theme="dark"] .modal-dialog,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .search-modal-card,
body[data-theme="dark"] .review-dialog {
  background: #090a18;
  border: 1px solid #00ffcc44;
  box-shadow: 0 0 40px rgba(0, 255, 204, 0.2);
  color: #e0e0ff;
}

body[data-theme="dark"] .modal-header {
  background: #0c0e24;
  border-bottom: 1px solid #1c223a;
}

body[data-theme="dark"] .modal-header h2 {
  color: #00ffcc;
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

body[data-theme="dark"] .modal-footer {
  background: #0c0e24;
  border-top: 1px solid #1c223a;
}

body[data-theme="dark"] .help-nav {
  border-bottom-color: #1c223a;
}

body[data-theme="dark"] .help-nav-btn {
  color: #8892b0;
}

body[data-theme="dark"] .help-nav-btn:hover {
  color: #00ffcc;
  background: rgba(0, 255, 204, 0.06);
}

body[data-theme="dark"] .help-nav-btn.active {
  color: #00ffcc;
  border-bottom-color: #00ffcc;
  background: rgba(0, 255, 204, 0.1);
  text-shadow: 0 0 6px rgba(0, 255, 204, 0.4);
}

body[data-theme="dark"] .help-card {
  background: #0d1026;
  border: 1px solid #1c223a;
  color: #e0e0ff;
}

body[data-theme="dark"] .help-card h3 {
  color: #00ffcc;
}

body[data-theme="dark"] .help-card p,
body[data-theme="dark"] .help-card ul,
body[data-theme="dark"] .help-card li {
  color: #c5cde3;
}

body[data-theme="dark"] .help-card strong {
  color: #ffffff;
}

body[data-theme="dark"] .help-tip {
  background: rgba(0, 255, 204, 0.05);
  border: 1px solid rgba(0, 255, 204, 0.25);
  border-left: 4px solid #00ffcc;
  color: #e0e0ff;
}

body[data-theme="dark"] .help-tip strong {
  color: #00ffcc;
}

body[data-theme="dark"] .search-card {
  background: #0d1026;
  border-color: #1c223a;
}

body[data-theme="dark"] .search-card:hover {
  border-color: #00ffcc;
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.25);
}

body[data-theme="dark"] .search-card-title {
  color: #e0e0ff;
}

body[data-theme="dark"] .search-card-artist {
  color: #00ffcc;
}

body[data-theme="dark"] .toast {
  background: #090a18;
  border: 1px solid #00ffcc;
  color: #00ffcc;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.35);
}

body[data-theme="dark"] .netmd-status-box {
  background: #0d1026;
  border-color: #00ffcc44;
  color: #00ffcc;
}

body[data-theme="dark"] .netmd-status-spinner {
  border-color: #00ffcc;
  border-top-color: transparent;
}

body[data-theme="dark"] .badge-success {
  background: rgba(0, 255, 204, 0.12);
  color: #00ffcc;
  border: 1px solid rgba(0, 255, 204, 0.4);
  box-shadow: 0 0 6px rgba(0, 255, 204, 0.15);
}

body[data-theme="dark"] .badge-warning {
  background: rgba(255, 170, 0, 0.12);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.4);
  box-shadow: 0 0 6px rgba(255, 170, 0, 0.15);
}

body[data-theme="dark"] .badge-info {
  background: #141836;
  color: #e0e0ff;
  border: 1px solid #2a3456;
}
