:root {
  color-scheme: dark;

  --accent-1: #181111;
  --accent-2: #1f1513;
  --accent-3: #391714;
  --accent-4: #4e1511;
  --accent-5: #5e1b16;
  --accent-6: #6f271f;
  --accent-7: #85352a;
  --accent-8: #a04a3b;
  --accent-9: #e54d2e;
  --accent-10: #ec6142;
  --accent-11: #ff977d;
  --accent-12: #fbd3cb;

  --accent-a2: rgba(229, 77, 46, 0.06);
  --accent-a3: rgba(229, 77, 46, 0.1);
  --accent-a4: rgba(229, 77, 46, 0.16);
  --accent-a5: rgba(229, 77, 46, 0.22);
  --accent-a6: rgba(229, 77, 46, 0.3);
  --accent-a7: rgba(229, 77, 46, 0.4);
  --accent-a8: rgba(229, 77, 46, 0.54);

  --bg: #111111;
  --surface: #191919;
  --surface-2: #222222;
  --surface-3: #2a2a2a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: var(--accent-8);
  --text: #eeeeee;
  --text-muted: #b4b4b4;
  --text-subtle: #7b7b7b;

  --success: #30a46c;
  --warning: #ffb224;
  --danger: #e5484d;
  --info: #0090ff;

  --hover-wash: rgba(255, 255, 255, 0.045);
  --active-wash: rgba(255, 255, 255, 0.085);

  --btn-bg: var(--accent-9);
  --btn-bg-hover: var(--accent-10);
  --btn-border: var(--accent-10);
  --btn-highlight: rgba(255, 255, 255, 0.14);
  --btn-text: #ffffff;

  --field-bg: rgba(255, 255, 255, 0.03);
  --field-bg-hover: rgba(255, 255, 255, 0.05);
  --field-bg-focus: rgba(255, 255, 255, 0.06);
  --field-h-md: 40px;
  --field-px: 12px;
  --field-radius: 10px;
  --field-font: 14px;
  --placeholder: var(--text-subtle);

  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.48);
  --shadow-4: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.5);
  --shadow-5: 0 4px 10px rgba(0, 0, 0, 0.55), 0 16px 36px rgba(0, 0, 0, 0.55);
  --shadow-6: 0 10px 24px rgba(0, 0, 0, 0.6), 0 32px 64px rgba(0, 0, 0, 0.62);
  --shadow-xs: var(--shadow-2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.42);
  --shadow-md: var(--shadow-4);
  --shadow-lg: var(--shadow-5);
  --shadow-xl: var(--shadow-6);
  --overlay: rgba(0, 0, 0, 0.72);

  --radius: 10px;
  --radius-panel: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-base: 0;
  --z-sticky: 100;
  --z-dropdown: 1000;
  --z-overlay: 1100;
  --z-modal: 1200;
  --z-toast: 1300;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(90% 52% at 50% -12%, rgba(255, 255, 255, 0.035), transparent 68%);
  background-attachment: fixed;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #000000;
  box-shadow: var(--shadow-2);
  color: var(--accent-9);
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.top-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 22px;
}

.top-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms var(--ease);
}

.top-nav-link:hover {
  color: var(--text);
}

.top-nav-link.is-active {
  color: var(--text);
  font-weight: 500;
}

.top-nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-8);
  border-radius: 2px 2px 0 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

.proxy-progress {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: var(--z-sticky);
  display: grid;
  gap: 9px;
  width: 236px;
  padding: 13px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow-4);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  pointer-events: none;
}

.proxy-progress.is-open {
  opacity: 1;
  transform: translateY(0);
}

.proxy-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.proxy-progress-caption {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.proxy-progress-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-11);
  font-variant-numeric: tabular-nums;
}

.proxy-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.proxy-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-9);
  transition: width 600ms var(--ease-out);
}

.proxy-progress.is-indeterminate .proxy-progress-bar {
  width: 38%;
  animation: proxy-progress-slide 1400ms var(--ease) infinite;
}

.proxy-progress-note {
  margin: 0;
  min-height: 15px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-subtle);
}

@keyframes proxy-progress-slide {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(260%);
  }
}

@media (max-width: 640px) {
  .proxy-progress {
    left: 16px;
    bottom: 16px;
    width: min(236px, calc(100vw - 32px));
  }
}

.quota-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 7px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-1);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease);
}

.quota-pill:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.quota-pill:active {
  transform: translateY(0);
}

.quota-art {
  flex: none;
  color: var(--accent-11);
}

.quota-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.quota-caption {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.quota-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.quota-value strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-11);
  font-variant-numeric: tabular-nums;
}

.quota-unit {
  font-size: 10.5px;
  color: var(--text-muted);
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  min-height: 36px;
  padding: 4px 10px 4px 6px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    transform 100ms var(--ease);
}

.user-trigger:hover {
  background: var(--hover-wash);
  border-color: var(--border);
}

.user-trigger:active {
  transform: scale(0.98);
  background: var(--active-wash);
}

.user-trigger:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  flex: none;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.user-identity {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
  text-align: left;
}

.user-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-id {
  overflow: hidden;
  font-size: 10.5px;
  color: var(--text-subtle);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  flex: none;
  color: var(--text-subtle);
  transition: transform 180ms var(--ease);
}

.user-trigger[aria-expanded="true"] .user-chevron {
  transform: rotate(180deg);
}

.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-dropdown);
  width: 224px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.96) translateY(-4px);
  transform-origin: top right;
  transition: opacity 140ms var(--ease), transform 180ms var(--ease-out);
}

.user-pop.is-open {
  opacity: 1;
  transform: none;
}

.user-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.user-pop-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.user-pop-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.user-pop-meta {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--text-subtle);
}

.user-pop-quota {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.user-pop-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.user-pop-item:hover {
  background: var(--hover-wash);
}

.user-pop-item:active {
  background: var(--active-wash);
}

.user-pop-item--danger {
  color: var(--danger);
}

.user-pop-item--danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.workspace {
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

.workbench {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}

.workbench::-webkit-scrollbar,
.panel-body::-webkit-scrollbar {
  width: 9px;
}

.workbench::-webkit-scrollbar-track,
.panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.workbench::-webkit-scrollbar-thumb,
.panel-body::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: content-box;
}

.workbench::-webkit-scrollbar-thumb:hover,
.panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
  background-clip: content-box;
}

.workbench .panel-head {
  min-height: 42px;
  padding: 7px 12px;
  gap: 8px;
}

.workbench .panel-head h2 {
  font-size: 14px;
}

.workbench .panel-body:not(.panel-body--flush) {
  padding: 9px 12px;
  gap: 9px;
}

.workbench .field {
  gap: 4px;
}

.workbench .field label,
.workbench .field-label {
  font-size: 12px;
}

.workbench .input {
  height: 36px;
  font-size: 13px;
}

.workbench .num-field .input {
  font-size: 13px;
}

.workbench .font-list {
  gap: 6px;
  max-height: none;
}

.workbench .font-row {
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 9px;
}

.workbench .font-preview {
  max-height: 32px;
}

.workbench .switch-row {
  padding: 3px 0;
}

.workbench .switch-label {
  font-size: 13px;
}

.workbench .size-row {
  padding: 7px 9px;
  font-size: 13px;
}

.workbench .size-add {
  margin-top: 6px;
}

.workbench .size-form {
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
}

.workbench .song-card {
  gap: 12px;
}

.workbench .song-cover {
  width: 52px;
  height: 52px;
}

.workbench .song-tags {
  margin-top: 4px;
}

.panel {
  display: flex;
  flex-direction: column;
  flex: none;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.panel--editor {
  flex: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.panel-body {
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.panel-body:not(.panel-body--flush) {
  display: grid;
  align-content: start;
  gap: 12px;
}

.panel-body--flush {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--field-bg);
  transition: background-color 160ms var(--ease);
}

.panel-body--flush:focus-within {
  background: var(--field-bg-focus);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label,
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.input {
  display: block;
  width: 100%;
  height: var(--field-h-md);
  padding: 0 var(--field-px);
  font-size: var(--field-font);
  color: var(--text);
  caret-color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--field-radius);
  background-color: var(--field-bg);
  box-shadow: var(--shadow-xs);
  outline: none;
  appearance: none;
  transition:
    border-color 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 200ms var(--ease);
}

.input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.input:hover:not(:focus) {
  border-color: var(--text-subtle);
  background-color: var(--field-bg-hover);
}

.input:focus {
  border-color: var(--border-focus);
  background-color: var(--field-bg-focus);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.55);
}

.input:disabled {
  color: var(--text-muted);
  background-color: var(--field-bg);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.input[type="number"] {
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}

.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 0s 600000s, color 0s 600000s;
}

.input::selection {
  background: var(--accent-a5);
  color: var(--text);
}

.select-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 34px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

.select-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 180ms var(--ease-out);
}

.select-wrap.is-open .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.select-menu {
  position: fixed;
  z-index: var(--z-dropdown);
  display: grid;
  gap: 1px;
  min-width: 208px;
  padding: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--field-radius);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  animation: select-in 150ms var(--ease-out);
}

.select-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 120ms var(--ease);
}

.select-option:hover {
  background: var(--hover-wash);
}

.select-option[aria-selected="true"] {
  background: var(--active-wash);
}

.select-option-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-option-dims {
  flex: none;
  font-size: 11.5px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

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

.num-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.num-field > span {
  font-size: 12px;
  color: var(--text-muted);
}

.num-field .input {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
  padding: 0.5rem 1rem;
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    color 180ms var(--ease),
    transform 100ms var(--ease),
    filter 100ms var(--ease);
}

.btn svg {
  flex: none;
}

.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-text);
  box-shadow: inset 0 1px 0 var(--btn-highlight), var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--btn-bg-hover);
  color: var(--accent-12);
  box-shadow: inset 0 1px 0 var(--btn-highlight), var(--shadow-sm);
}

.btn-primary:active {
  transform: scale(0.98);
  filter: brightness(0.97);
  box-shadow: inset 0 1px 0 var(--btn-highlight), 0 1px 1px rgba(0, 0, 0, 0.35);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

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

.btn-secondary:active {
  transform: scale(0.98);
  background: var(--surface-3);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--hover-wash);
  color: var(--text);
}

.btn-ghost:active {
  background: var(--active-wash);
}

.btn-danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  box-shadow: none;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 20%, transparent);
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
}

.btn-sm {
  padding: 0.3125rem 0.625rem;
  min-height: 30px;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.btn:disabled,
.btn.is-loading {
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-loading {
  position: relative;
  color: transparent;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn-primary.is-loading::after {
  border: 2px solid color-mix(in srgb, var(--btn-text) 30%, transparent);
  border-top-color: var(--btn-text);
}

.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after {
  border: 2px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
  border-top-color: var(--text-muted);
}

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

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease),
    transform 100ms var(--ease);
}

.icon-btn:hover {
  background: var(--hover-wash);
  color: var(--text);
}

.icon-btn:active {
  background: var(--active-wash);
  transform: scale(0.96);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.song-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.song-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.song-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.song-cover {
  width: 58px;
  height: 58px;
  flex: none;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.song-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.song-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.song-artist {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.song-album {
  margin: 0;
  font-size: 12px;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 999px;
  background: var(--hover-wash);
  border: 0;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.badge--admin {
  color: #96ccff;
  background: rgba(83, 177, 253, 0.16);
}

.badge--member {
  color: #71d083;
  background: rgba(48, 164, 108, 0.16);
}

.segmented {
  position: relative;
  display: inline-flex;
  flex: none;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.segmented--sm {
  border-radius: 9px;
}

.segmented button {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 5px 12px;
  min-height: 28px;
  cursor: pointer;
  transition: color 150ms var(--ease);
}

.segmented--sm button {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 12px;
  border-radius: 7px;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.segmented button[aria-pressed="true"] {
  color: var(--text);
}

.segmented button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.segmented-thumb {
  position: absolute;
  top: 2px;
  left: 0;
  width: var(--seg-w, 0px);
  height: calc(100% - 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-xs);
  transform: translateX(var(--seg-x, 2px));
  transition:
    transform 220ms var(--ease-out),
    width 220ms var(--ease-out),
    opacity 160ms var(--ease);
}

.segmented.is-idle .segmented-thumb {
  opacity: 0;
}

.segmented--full {
  display: flex;
  width: 100%;
}

.segmented--full button {
  flex: 1;
}

.segmented--sm .segmented-thumb {
  border-radius: 7px;
}

.size-list {
  display: grid;
  gap: 4px;
}

.size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    transform 100ms var(--ease);
}

.size-row:hover {
  background: var(--hover-wash);
}

.size-row:active {
  transform: scale(0.995);
}

.size-row:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.size-row[aria-pressed="true"] {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.size-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.size-value {
  flex: none;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.size-dims {
  flex: none;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.size-row[aria-pressed="true"] .size-dims {
  color: var(--text);
}

.size-remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--text-subtle);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms var(--ease), background-color 140ms var(--ease), color 140ms var(--ease);
}

.size-row:hover .size-remove,
.size-row:focus-within .size-remove {
  opacity: 1;
}

.size-remove:hover {
  color: var(--danger);
  background: var(--hover-wash);
}

.size-row[aria-pressed="true"] .size-value {
  color: var(--text);
}

.size-add {
  margin-top: 10px;
}

.size-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.size-form[hidden] {
  display: none;
}

.size-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.size-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.include-list {
  display: grid;
  gap: 2px;
}

.include-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px;
  border-radius: 9px;
  transition: background-color 150ms var(--ease);
}

.include-row:hover {
  background: var(--hover-wash);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--btn-text);
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease);
}

.check input:checked + .check-box {
  background: var(--btn-bg);
  border-color: var(--btn-border);
}

.check input:focus-visible + .check-box {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.check-mark {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms var(--ease), transform 160ms var(--ease-out);
}

.check input:checked + .check-box .check-mark {
  opacity: 1;
  transform: scale(1);
}

.check-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mini-seg button {
  min-height: 22px;
  padding: 1px 7px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.mini-seg button:hover {
  color: var(--text);
}

.mini-seg button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.mini-seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.head-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-row::-webkit-scrollbar {
  display: none;
}

.textarea {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 16px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  caret-color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  scrollbar-width: thin;
}

.textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.textarea::selection {
  background: var(--accent-a5);
  color: var(--text);
}

.editor-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}

.editor-foot-spacer {
  flex: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 160ms var(--ease);
}

.modal.is-open .modal-scrim {
  opacity: 1;
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: 84vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity 160ms var(--ease), transform 200ms var(--ease-out);
  overflow: hidden;
}

.modal.is-open .modal-panel {
  opacity: 1;
  transform: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.notice-panel {
  width: min(440px, 100%);
}

.notice-body {
  flex: 1;
  min-height: 0;
  padding: 4px 18px 14px;
  overflow-y: auto;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
}

.notice-body p {
  margin: 0 0 10px;
}

.notice-body p:last-child {
  margin-bottom: 0;
}

.notice-body ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.notice-body li {
  margin: 3px 0;
}

.notice-body strong {
  color: var(--text);
  font-weight: 600;
}

.notice-body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--accent-11);
  font-family: inherit;
  font-size: 0.94em;
}

.notice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--border);
}

.notice-status {
  font-size: 12px;
  color: var(--text-subtle);
}

.notice-form {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.notice-textarea {
  height: auto;
  min-height: 128px;
  padding: 10px var(--field-px);
  line-height: 1.7;
  resize: none;
  border-radius: 8px;
  font-family: inherit;
}

.notice-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notice-hint {
  font-size: 12px;
  color: var(--text-subtle);
}

.notice-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-family: inherit;
}

.modal-search {
  display: flex;
  gap: 10px;
  padding: 4px 16px 14px;
}

.control {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  height: var(--field-h-md);
  padding: 0 var(--field-px);
  border: 1px solid var(--border-strong);
  border-radius: var(--field-radius);
  background: var(--field-bg);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 200ms var(--ease);
}

.control:hover {
  background: var(--field-bg-hover);
}

.control:focus-within {
  border-color: var(--border-focus);
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 3px var(--accent-a3), 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}

.control-icon {
  flex: none;
  color: var(--text-subtle);
}

.control-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: var(--field-font);
  color: var(--text);
  caret-color: var(--text);
}

.control-input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.modal-results {
  min-height: 240px;
  max-height: 54vh;
  padding: 8px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 100ms var(--ease);
}

.result-row:hover {
  background: var(--hover-wash);
}

.result-row:active {
  transform: scale(0.997);
  background: var(--active-wash);
}

.result-row:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}

.result-cover {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.result-body {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.result-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-duration {
  flex: none;
  font-size: 12px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
}

.skeleton {
  background: var(--surface-2);
  border-radius: 8px;
  animation: skeleton-pulse 1.4s var(--ease) infinite;
}

.skeleton-cover {
  flex: none;
  width: 44px;
  height: 44px;
}

.skeleton-body {
  flex: 1;
  display: grid;
  gap: 8px;
}

.skeleton-line {
  height: 10px;
  border-radius: 5px;
}

.skeleton-line--title {
  width: 46%;
}

.skeleton-line--sub {
  width: 68%;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 12px;
  text-align: center;
  color: var(--text-subtle);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 340px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--bg);
  background: var(--text);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: transform 220ms var(--ease-out), opacity 160ms var(--ease);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  place-items: center;
  flex: none;
}

.toast--success .toast-icon {
  color: var(--success);
}

.toast--warning .toast-icon {
  color: var(--warning);
}

.toast--danger .toast-icon {
  color: var(--danger);
}

.toast--info .toast-icon {
  color: var(--info);
}

.toast-text {
  min-width: 0;
}

.canvas-column {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "preview editor";
  gap: 14px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.panel--editor {
  grid-area: editor;
  min-height: 0;
}

.panel--preview {
  grid-area: preview;
  min-height: 0;
}

.canvas-column .panel-head {
  min-height: 56px;
}

.canvas-column .panel--editor .panel-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 10px 12px;
}

.canvas-column .panel--editor .head-tools {
  width: 100%;
}

.preview-meta {
  font-size: 12px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.preview-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% -10%, var(--hover-wash), transparent 62%),
    var(--surface-2);
  scrollbar-width: thin;
}

.preview-paper {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: var(--shadow-lg);
}

.preview-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--text-subtle);
  text-align: center;
}

.preview-art {
  margin-bottom: 2px;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.45));
}

.preview-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.preview-spinner,
.search-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}

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

.pager {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.pager span {
  min-width: 44px;
  text-align: center;
}

.icon-btn--sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.font-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 236px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.font-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    transform 100ms var(--ease);
}

.font-preview {
  display: block;
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

.font-row:hover {
  background: var(--surface-3);
}

.font-row:active {
  transform: scale(0.995);
}

.font-row:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.font-row[aria-pressed="true"] {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.font-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}

.switch-label {
  font-size: 14px;
  color: var(--text);
}

.switch-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-note {
  margin: -2px 0 6px;
  font-size: 11.5px;
  color: var(--text-subtle);
}

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform 200ms var(--ease-out), background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--btn-bg);
  border-color: var(--btn-border);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: var(--btn-text);
  border-color: transparent;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.check-box svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms var(--ease), transform 160ms var(--ease-out);
}

.check input:checked + .check-box svg {
  opacity: 1;
  transform: none;
}

.check-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.include-row .segmented button {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11.5px;
}

.result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 100ms var(--ease);
}

.result:hover {
  background: var(--hover-wash);
}

.result:active {
  background: var(--active-wash);
  transform: scale(0.997);
}

.result:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}

.result-cover {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--text-subtle);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.result-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.result-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app {
    position: static;
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    height: auto;
  }

  .workbench {
    overflow: visible;
  }

  .panel--editor {
    min-height: 480px;
    height: 480px;
  }

  .canvas-column {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas: "editor" "preview";
    gap: 12px;
    overflow: visible;
  }

  .panel--preview {
    min-height: 560px;
  }

  .preview-stage {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .status {
    display: none;
  }

  .user-identity {
    display: none;
  }

  .user-trigger {
    padding: 0 6px;
  }

  .workspace {
    gap: 12px;
    padding: 12px;
  }

  .panel-head {
    padding: 12px;
  }

  .panel-body {
    padding: 12px;
  }

  .preview-stage {
    padding: 12px;
  }

  .canvas-column .panel-head {
    min-height: 0;
    padding: 10px 12px;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    max-height: 88vh;
  }

  .modal-search {
    flex-wrap: wrap;
  }

  .modal-search .btn {
    width: 100%;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: center;
  }

  .toast {
    max-width: none;
    width: 100%;
  }
}

@media (pointer: coarse) {
  :root {
    --field-font: 16px;
  }

  .input,
  .workbench .input,
  .workbench .num-field .input,
  .textarea,
  .home-search-input,
  .control-input {
    font-size: 16px;
  }

  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 0.4rem 0.75rem;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
  }

  .icon-btn--sm {
    width: 36px;
    height: 36px;
  }

  .segmented button {
    min-height: 36px;
    padding: 6px 12px;
  }

  .segmented--sm button {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 12.5px;
  }

  .mini-seg button {
    min-height: 32px;
    padding: 2px 12px;
  }

  .size-row {
    min-height: 48px;
    padding: 10px;
  }

  .size-remove {
    width: 30px;
    height: 30px;
    opacity: 1;
  }

  .switch-track {
    width: 44px;
    height: 26px;
  }

  .switch-thumb {
    width: 20px;
    height: 20px;
  }

  .switch input:checked + .switch-track .switch-thumb {
    transform: translateX(18px);
  }

  .check-box {
    width: 20px;
    height: 20px;
  }

  .select-option {
    align-items: center;
    min-height: 44px;
  }

  .user-pop-item {
    min-height: 44px;
  }

  .result-row,
  .result {
    padding: 12px 10px;
  }

  .deck-recent {
    max-height: 255px;
  }

  .deck-recent-row {
    padding: 8px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: var(--border-strong);
    --text-subtle: var(--text-muted);
  }
}

html,
body,
body * {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
body *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

.home-main {
  --bg: #131313;
  --surface: #1a1a1a;
  --surface-2: #212121;
  --surface-3: #272727;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hover-wash: rgba(255, 255, 255, 0.045);
  --active-wash: rgba(255, 255, 255, 0.08);
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 30px;
  min-height: calc(100dvh - 56px);
  padding: 36px 24px 72px;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--bg);
  isolation: isolate;
}

.home-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-decor-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(255, 151, 125, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 151, 125, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 68% 56% at 50% 26%, #000 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 68% 56% at 50% 26%, #000 8%, transparent 72%);
}

.home-decor-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 151, 125, 0.1);
}

.home-decor-ring--a {
  top: -70px;
  right: -150px;
  width: 430px;
  height: 430px;
  box-shadow:
    0 0 0 64px rgba(255, 151, 125, 0.022),
    0 0 0 65px rgba(255, 151, 125, 0.055),
    0 0 0 152px rgba(255, 151, 125, 0.016),
    0 0 0 153px rgba(255, 151, 125, 0.045);
}

.home-decor-ring--b {
  bottom: 7%;
  left: 5%;
  width: 168px;
  height: 168px;
  border-color: rgba(255, 151, 125, 0.13);
  box-shadow: 0 0 0 34px rgba(255, 151, 125, 0.022);
}

.home-decor-square {
  position: absolute;
  top: 17%;
  left: 7%;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 151, 125, 0.13);
  border-radius: 16px;
  transform: rotate(16deg);
}

.home-decor-square::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 6px;
  height: 6px;
  background: rgba(255, 151, 125, 0.35);
  border-radius: 2px;
}

.home-decor-line {
  position: absolute;
  right: 11%;
  bottom: 17%;
  width: 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 151, 125, 0.32), transparent);
  transform: rotate(-28deg);
}

.home-decor-dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 151, 125, 0.38);
}

.home-decor-dot--a {
  top: 19%;
  right: 23%;
  width: 5px;
  height: 5px;
  box-shadow: 0 0 14px rgba(255, 151, 125, 0.4);
}

.home-decor-dot--b {
  bottom: 25%;
  left: 18%;
  width: 3px;
  height: 3px;
  background: rgba(255, 151, 125, 0.28);
}

.home-hero {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.home-planet {
  position: relative;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 151, 125, 0.26), rgba(58, 20, 15, 0.9) 62%, #140a08 100%);
  border: 1px solid var(--accent-7);
  box-shadow: var(--shadow-4), inset 0 1px 0 rgba(251, 211, 203, 0.08);
  color: var(--accent-11);
}

.home-planet::before,
.home-planet::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 151, 125, 0.22);
}

.home-planet::before {
  width: 146px;
  height: 56px;
  transform: rotate(-18deg);
  border-left-color: transparent;
  border-right-color: transparent;
}

.home-planet::after {
  width: 124px;
  height: 124px;
  border-color: rgba(255, 151, 125, 0.12);
}

.home-greeting {
  margin: 12px 0 0;
  font-size: clamp(30px, 4.2vw, 42px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.028em;
}

.home-greeting span {
  color: var(--accent-11);
}

.home-handle {
  margin: 6px 0 8px;
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}

.home-mood {
  min-height: 24px;
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}

.home-mood .home-accent,
.home-search-ghost .home-accent {
  color: var(--accent-11);
  font-weight: 500;
}

.home-search-ghost .home-accent {
  font-weight: 600;
  margin: 0 3px;
}

.home-mood.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}

.home-date {
  margin: 0;
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.03em;
}

.home-search-area {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 16px;
  width: min(900px, 100%);
}

.home-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 9px 9px 20px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 16px 36px -16px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background-color 160ms var(--ease), box-shadow 220ms var(--ease);
}

.home-search:hover {
  background: var(--surface-2);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.42),
    0 24px 48px -18px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.home-search:focus-within {
  background: var(--surface-2);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.45),
    0 26px 52px -18px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(251, 211, 203, 0.08);
}

.home-search-icon {
  flex: none;
  color: var(--text-subtle);
  transition: color 160ms var(--ease);
}

.home-search:focus-within .home-search-icon {
  color: var(--accent-11);
}

.home-search-field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.home-search-ghost {
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 48px;
  color: var(--placeholder);
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  .home-search-ghost.is-scrolling {
    right: auto;
    width: max-content;
    padding-right: 20px;
    text-overflow: clip;
    animation: home-search-ghost-scroll 8s ease-in-out infinite alternate;
  }

  .home-search:focus-within .home-search-ghost.is-scrolling {
    animation-play-state: paused;
  }
}

@keyframes home-search-ghost-scroll {
  0%,
  12% {
    transform: translateX(0);
  }

  88%,
  100% {
    transform: translateX(var(--ghost-shift, 0px));
  }
}

.home-search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 48px;
  font-size: 16px;
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
}

.home-key {
  flex: none;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-subtle);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
}

@property --neon-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.home-search-button {
  position: relative;
  flex: none;
  height: 44px;
  padding: 0 24px;
  color: #0a0b0c;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(
      from var(--neon-angle),
      #ff4d8d,
      #ff9a3d,
      #ffe14d,
      #5dff9f,
      #4dd8ff,
      #a78bfa,
      #ff4d8d
    ) border-box;
  border: 2px solid transparent;
  border-radius: 12px;
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.24),
    0 0 14px rgba(255, 77, 141, 0.3),
    0 0 26px rgba(77, 216, 255, 0.28),
    0 0 40px rgba(167, 139, 250, 0.22);
  animation: neon-border-spin 6s linear infinite;
  transition: box-shadow 220ms var(--ease), transform 140ms var(--ease);
}

@keyframes neon-border-spin {
  to {
    --neon-angle: 360deg;
  }
}

.home-search-button:hover {
  color: #000000;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(
      from var(--neon-angle),
      #ff4d8d,
      #ff9a3d,
      #ffe14d,
      #5dff9f,
      #4dd8ff,
      #a78bfa,
      #ff4d8d
    ) border-box;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.38),
    0 0 18px rgba(255, 77, 141, 0.42),
    0 0 32px rgba(77, 216, 255, 0.4),
    0 0 52px rgba(167, 139, 250, 0.32);
}

.home-search-button:active {
  transform: scale(0.98);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 12px rgba(255, 77, 141, 0.28),
    0 0 22px rgba(77, 216, 255, 0.24);
}

.home-search-button.is-loading::after {
  border: 2px solid rgba(10, 11, 12, 0.18);
  border-top-color: #0a0b0c;
}

.home-results {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  scroll-margin-top: 76px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.home-results:empty {
  display: none;
}

.home-empty {
  margin: 0;
  padding: 18px 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.home-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 18px;
}

.deck-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 192px;
  padding: 16px 17px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.deck-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  pointer-events: none;
}

a.deck-card:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}

.deck-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.deck-icon {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 0;
  display: inline-flex;
  color: var(--text-subtle);
  opacity: 0.16;
  pointer-events: none;
}

.deck-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deck-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-meta {
  overflow: hidden;
  font-size: 11.5px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.deck-go {
  flex: none;
  margin-top: 4px;
  margin-left: auto;
  color: var(--text-subtle);
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}

a.deck-card:hover .deck-go {
  color: var(--text);
  transform: translateX(2px);
}

.deck-stack {
  position: absolute;
  right: 15px;
  bottom: 14px;
  z-index: 1;
  width: 88px;
  height: 78px;
  pointer-events: none;
}

.deck-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56px;
  height: 72px;
  background-color: #1d1d1d;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.38);
}

.deck-sheet--front {
  transform: rotate(4deg);
}

.deck-sheet--back {
  right: 18px;
  bottom: -10px;
  opacity: 0.72;
  transform: rotate(-13deg);
}

.deck-sheet.is-empty {
  background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 10px);
}

.deck-avatars {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  display: flex;
  padding-left: 9px;
}

.deck-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -9px;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-3);
  border: 2px solid var(--surface-2);
  border-radius: 50%;
}

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

.deck-badge {
  flex: none;
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #ff977d;
  background: rgba(229, 77, 46, 0.16);
  border: 1px solid rgba(229, 77, 46, 0.3);
  border-radius: 999px;
}

.deck-recent {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  max-height: 235px;
  margin: 0 -6px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}

.deck-recent-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.deck-recent-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.deck-recent-art {
  display: grid;
  flex: none;
  place-items: center;
  width: 27px;
  height: 27px;
  overflow: hidden;
  color: var(--text-subtle);
  background: var(--surface-3);
  border-radius: 7px;
}

.deck-recent-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-recent-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.deck-recent-body strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-recent-body span {
  overflow: hidden;
  font-size: 10.5px;
  color: var(--text-subtle);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-recent-time {
  flex: none;
  margin-left: auto;
  font-size: 10.5px;
  color: #f0c070;
  font-variant-numeric: tabular-nums;
}

.deck-recent-empty {
  padding: 20px 6px;
  font-size: 11.5px;
  color: var(--text-subtle);
  text-align: center;
}

@media (max-width: 820px) {
  .home-deck {
    grid-template-columns: 1fr;
  }

  .deck-card--recent {
    order: -1;
  }
}

.history-panel {
  margin-top: 2px;
}

.history-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  transition: background-color 150ms var(--ease);
}

.history-item:hover {
  background: var(--hover-wash);
}

.history-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  object-fit: cover;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 9px;
}

.history-body {
  flex: 1;
  min-width: 0;
}

.history-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.history-handle {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--text-subtle);
}

.history-detail {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.history-time {
  flex: none;
  font-size: 11.5px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.history-page {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history-pager .btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.history-kind {
  flex: none;
  min-width: 52px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  background: var(--hover-wash);
  border-radius: 999px;
}

.history-kind[data-kind="search"],
.history-kind[data-kind="load"],
.history-kind[data-kind="fetch"] {
  color: #70b8ff;
  background: rgba(0, 144, 255, 0.16);
}

.history-kind[data-kind="export"] {
  color: #71d083;
  background: rgba(48, 164, 108, 0.16);
}

.history-kind[data-kind="password"],
.history-kind[data-kind="avatar"],
.history-kind[data-kind="quota"],
.history-kind[data-kind="cardlimit"],
.history-kind[data-kind="card"],
.history-kind[data-kind="active"],
.history-kind[data-kind="create"],
.history-kind[data-kind="delete"],
.history-kind[data-kind="nickname"] {
  color: #ffc53d;
  background: rgba(255, 178, 36, 0.14);
}

@media (max-width: 720px) {
  .home-main {
    padding: 40px 16px 56px;
  }

  .home-decor-ring--a {
    top: -30px;
    right: -140px;
    width: 280px;
    height: 280px;
    box-shadow:
      0 0 0 40px rgba(255, 151, 125, 0.022),
      0 0 0 41px rgba(255, 151, 125, 0.05);
  }

  .home-decor-ring--b {
    bottom: 12%;
    left: -44px;
    width: 120px;
    height: 120px;
  }

  .home-decor-square {
    top: 12%;
    left: 4%;
    width: 62px;
    height: 62px;
    border-radius: 12px;
  }

  .home-decor-line {
    right: 2%;
    bottom: 10%;
    width: 150px;
  }

  .home-decor-dot--a {
    top: 15%;
    right: 10%;
  }

  .home-planet {
    width: 88px;
    height: 88px;
  }

  .home-planet::before {
    width: 128px;
    height: 50px;
  }

  .home-planet::after {
    width: 110px;
    height: 110px;
  }

  .home-greeting {
    font-size: 26px;
  }

  .home-search {
    gap: 10px;
    padding: 8px 8px 8px 15px;
    border-radius: 17px;
  }

  .home-search-input {
    height: 44px;
    font-size: 16px;
  }

  .home-search-ghost {
    line-height: 44px;
  }

  .home-search-button {
    padding: 0 18px;
  }

  .home-key {
    display: none;
  }

  .history-item {
    padding: 10px 12px;
  }
}

.card-quota-edit {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.card-quota-edit .member-usage {
  font-size: 10.5px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.song-panel {
  width: min(900px, 100%);
  height: min(620px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(168deg, #1d1d1d, #151515 58%, #101010);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.song-atmosphere {
  position: absolute;
  top: -16%;
  right: -8%;
  left: -8%;
  height: 64%;
  background-position: center 30%;
  background-size: cover;
  filter: blur(58px) saturate(1.25);
  opacity: 0.16;
  transform: scale(1.1);
  pointer-events: none;
}

.song-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 38% at 12% 0%, rgba(229, 77, 46, 0.12), transparent 64%);
  pointer-events: none;
}

.song-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.song-body::-webkit-scrollbar {
  width: 9px;
}

.song-body::-webkit-scrollbar-track {
  background: transparent;
}

.song-body::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: content-box;
}

.song-body.is-loading {
  overflow: hidden;
}

.song-body.is-loading > .song-hero,
.song-body.is-loading > .song-facts,
.song-body.is-loading > .song-lyric {
  display: none;
}

.song-skeleton {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 100%;
  padding: 24px 26px;
}

.song-skeleton-hero {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 34px;
}

.song-skeleton-head {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 10px;
}

.song-skeleton-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.song-skeleton-fact {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: #181818;
}

.song-skeleton-lyric {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.song-skeleton-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.song-skeleton-column {
  display: grid;
  align-content: start;
  gap: 9px;
}

.song-skeleton-line,
.song-skeleton-art {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  animation: song-skeleton-pulse 1.5s ease-in-out infinite;
}

.song-skeleton-art {
  width: 176px;
  height: 176px;
  border-radius: 14px;
}

.song-skeleton-line--kicker {
  width: 64px;
  height: 10px;
}

.song-skeleton-line--title {
  width: min(72%, 320px);
  height: 30px;
}

.song-skeleton-line--meta {
  width: 46%;
  height: 13px;
}

.song-skeleton-line--tags {
  width: 128px;
  height: 20px;
  border-radius: 999px;
}

.song-skeleton-line--label {
  width: 52px;
  height: 9px;
}

.song-skeleton-line--value {
  width: 82%;
  height: 14px;
}

.song-skeleton-column .song-skeleton-line:nth-child(2n) {
  width: 74%;
}

.song-skeleton-column .song-skeleton-line:nth-child(3n) {
  width: 88%;
}

.song-skeleton-column .song-skeleton-line:nth-child(4n) {
  width: 62%;
}

@keyframes song-skeleton-pulse {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.song-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease);
}

.song-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.song-close:active {
  transform: scale(0.94);
}

.song-hero {
  position: relative;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 34px;
  padding: 24px 26px 20px;
}

.song-art {
  position: relative;
  width: 176px;
  height: 176px;
}

.song-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.song-art img:not([src]) {
  opacity: 0;
}

.song-vinyl {
  position: absolute;
  top: 20px;
  right: -24px;
  z-index: 0;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #2b2b2b 0 7px, #0b0b0b 8px 14px, transparent 15px),
    repeating-radial-gradient(circle at 50% 50%, #161616 0 3px, #0a0a0a 3px 6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  opacity: 0.9;
}

.song-heading {
  min-width: 0;
  padding: 4px 0 0 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.song-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--text-subtle);
}

.song-kicker span {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-9);
  box-shadow: 0 0 12px var(--accent-9);
}

.song-heading .song-title {
  margin: 8px 0 0;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.song-alias {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-subtle);
}

.song-artists {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--accent-11);
}

.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.song-tag {
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.song-tag--accent {
  color: var(--accent-11);
  background: var(--accent-a3);
  border-color: var(--accent-a6);
}

.song-tag--quality {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.song-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 26px 16px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
}

.song-fact {
  min-width: 0;
  padding: 10px 14px;
  background: #181818;
}

.song-fact span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}

.song-fact strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-lyric {
  margin: 0 26px 16px;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(229, 77, 46, 0.07), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(229, 77, 46, 0.18);
  border-radius: 12px;
}

.song-lyric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.song-lyric-label {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent-11);
}

.song-lyric-hint {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--text-subtle);
}

.song-lyric-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.song-lyric-column {
  display: grid;
  align-content: start;
  gap: 1px;
  min-width: 0;
}

.song-lyric-column + .song-lyric-column {
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.song-lyric-columns.is-single {
  grid-template-columns: 1fr;
}

.song-lyric-columns.is-single .song-lyric-column--mid {
  display: none;
}

.song-lyric-column p {
  margin: 0;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.64;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-lyric-column--head p:first-child {
  color: var(--text);
}

.song-lyric-column p.song-lyric-gap {
  color: var(--text-subtle);
  letter-spacing: 0.3em;
  opacity: 0.7;
}

.song-actions {
  position: relative;
  z-index: 2;
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 10px;
  padding: 14px 26px 18px;
  border-top: 1px solid var(--border);
  background: rgba(12, 12, 12, 0.55);
  backdrop-filter: blur(14px);
}

.song-download,
.song-make {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-align: left;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.song-download {
  color: #141414;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.song-download .song-action-icon {
  background: rgba(0, 0, 0, 0.06);
}

.song-download .song-action-copy span {
  color: rgba(20, 20, 20, 0.62);
}

.song-download:disabled {
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  cursor: not-allowed;
}

.song-download:disabled .song-action-icon {
  background: rgba(255, 255, 255, 0.06);
}

.song-download:hover:not(:disabled) {
  color: #141414;
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.song-download:active:not(:disabled) {
  transform: scale(0.98);
  background: #e6e6e6;
}

.song-make {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-9), var(--accent-7));
  border: 1px solid var(--accent-8);
  box-shadow: 0 10px 26px rgba(229, 77, 46, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.song-make:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-10), var(--accent-8));
  transform: translateY(-1px);
}

.song-make:active:not(:disabled) {
  transform: translateY(0);
}

.song-make:disabled {
  opacity: 0.55;
  cursor: wait;
}

.song-action-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.song-make .song-action-icon {
  background: rgba(0, 0, 0, 0.18);
}

.song-action-copy {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.song-action-copy strong {
  font-size: 13.5px;
  font-weight: 600;
}

.song-action-copy span {
  font-size: 11px;
  color: var(--text-subtle);
}

.song-make .song-action-copy span {
  color: rgba(255, 255, 255, 0.72);
}

.song-cost {
  flex: none;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-11);
  background: var(--accent-a3);
  border: 1px solid var(--accent-a5);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.song-download .song-cost {
  color: rgba(20, 20, 20, 0.62);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

.song-download:disabled .song-action-copy span,
.song-download:disabled .song-cost {
  color: var(--text-subtle);
}

.song-download:disabled .song-cost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.song-make .song-cost {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.22);
}

.song-go {
  flex: none;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 760px) {
  .song-panel {
    border-radius: 14px;
  }

  .song-hero {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 20px;
    padding: 20px 16px 16px;
  }

  .song-art {
    width: 132px;
    height: 132px;
  }

  .song-vinyl {
    display: none;
  }

  .song-heading {
    padding-left: 0;
    border-left: none;
  }

  .song-heading .song-title {
    font-size: 26px;
  }

  .song-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 16px 14px;
  }

  .song-lyric {
    margin: 0 16px 14px;
  }

  .song-actions {
    padding: 12px 16px 14px;
  }

  .song-close {
    top: 10px;
    right: 10px;
  }

  .song-skeleton {
    padding: 20px 16px;
  }

  .song-skeleton-hero {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 20px;
  }

  .song-skeleton-art {
    width: 132px;
    height: 132px;
  }

  .song-skeleton-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.download-panel {
  width: min(430px, 100%);
  min-height: min(340px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
}

.download-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  gap: 20px;
  min-height: 0;
  padding: 30px 26px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.download-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.download-art {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  color: var(--text-subtle);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

.download-art-fallback {
  display: grid;
  place-items: center;
}

.download-art img:not([hidden]) + .download-art-fallback {
  display: none;
}

.download-state {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.download-state[data-state="loading"] {
  justify-items: start;
  text-align: left;
}

.download-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: download-spin 900ms linear infinite;
}

.download-state:not([data-state="loading"]) .download-spinner {
  display: none;
}

.download-state h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.download-state p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-subtle);
}

.download-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.download-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  min-width: 0;
  font-size: 13px;
}

.download-row dt {
  color: var(--text-subtle);
  white-space: nowrap;
}

.download-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.download-progress {
  display: grid;
  gap: 8px;
}

.download-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-subtle);
}

.download-progress-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.download-progress-track {
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.download-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff7a5c, #ffb199);
  border-radius: inherit;
  transition: width 220ms var(--ease);
}

.download-progress[data-phase="active"] .download-progress-fill {
  min-width: 4%;
}

.download-progress[data-phase="done"] .download-progress-fill {
  background: #7ee0a8;
}

.download-save:disabled {
  cursor: default;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
}

.download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px 26px;
}

.download-save,
.download-retry {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #141414;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 100ms var(--ease);
}

.download-quality {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #f0d18b;
  text-shadow: 0 0 10px rgba(240, 209, 139, 0.25);
  background: linear-gradient(145deg, #17120a, #241a0c 55%, #1b1309);
  border: 1px solid rgba(240, 209, 139, 0.5);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 14px rgba(240, 209, 139, 0.08);
}

.download-save:hover,
.download-retry:hover {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.download-save:active,
.download-retry:active {
  transform: scale(0.98);
  background: #e6e6e6;
}

.download-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--text-subtle);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.download-close:hover {
  color: var(--text);
  background: var(--hover-wash);
}

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

@media (max-width: 520px) {
  .download-panel {
    border-radius: 14px;
  }

  .download-body {
    padding: 26px 20px 0;
  }

  .download-actions {
    padding: 22px 20px 22px;
  }
}

@media (max-width: 640px) {
  .song-lyric-columns {
    grid-template-columns: 1fr;
  }

  .song-lyric-column + .song-lyric-column {
    margin-top: 6px;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .song-lyric-column p {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .song-skeleton-columns {
    grid-template-columns: 1fr;
  }

  .song-skeleton-column + .song-skeleton-column {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 520px) {
  .song-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .song-art {
    width: 108px;
    height: 108px;
  }

  .song-actions {
    grid-template-columns: 1fr;
  }

  .song-skeleton-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .song-skeleton-art {
    width: 108px;
    height: 108px;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0 10px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 0;
    min-height: 52px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .quota-pill {
    gap: 7px;
    min-height: 42px;
    padding: 4px 10px 4px 6px;
    border-radius: 10px;
  }

  .user-trigger {
    min-height: 42px;
  }

  .quota-art {
    width: 19px;
    height: 19px;
  }

  .quota-caption {
    font-size: 9.5px;
  }

  .quota-value strong {
    font-size: 14px;
  }

  .top-nav {
    order: 3;
    width: calc(100% + 28px);
    align-self: stretch;
    gap: 2px;
    margin: 6px -14px 0;
    padding: 0 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-top: 1px solid var(--border);
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav-link {
    flex: none;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .top-nav-link.is-active::after {
    right: 10px;
    left: 10px;
  }

  .user-pop {
    width: 236px;
  }
}

@media (max-width: 720px) {
  .home-main {
    gap: 24px;
    padding: 28px 16px 52px;
  }

  .home-greeting {
    font-size: clamp(24px, 7vw, 28px);
  }

  .home-mood {
    font-size: 14px;
  }

  .home-search-area {
    gap: 12px;
  }

  .home-search {
    gap: 8px;
    padding: 7px 7px 7px 14px;
    border-radius: 16px;
  }

  .home-search-button {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    animation: none;
  }

  .home-results {
    padding: 4px;
    border-radius: 14px;
    scroll-margin-top: 112px;
  }

  .home-deck {
    gap: 10px;
    margin-top: 8px;
  }

  .deck-card {
    min-height: 176px;
    padding: 15px 16px;
  }

  .deck-icon svg {
    width: 68px;
    height: 68px;
  }

  .deck-stack {
    right: 14px;
    bottom: 12px;
  }

  .deck-avatars {
    right: 14px;
    bottom: 14px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .canvas-column {
    order: 1;
    gap: 10px;
  }

  .workbench {
    order: 2;
  }

  .panel--editor {
    height: 360px;
    min-height: 360px;
  }

  .panel--preview {
    min-height: 0;
  }

  .preview-stage {
    min-height: 300px;
    padding: 12px;
  }

  .panel--preview .head-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    width: 100%;
  }

  .panel--preview .preview-meta {
    grid-column: 1;
  }

  .panel--preview .pager {
    grid-column: 2;
    justify-self: end;
  }

  .panel--preview #export-png {
    grid-column: 1;
  }

  .panel--preview #export-pdf {
    grid-column: 2;
  }

  .modal {
    padding: 10px;
  }

  .modal-scrim {
    touch-action: none;
  }

  .modal-panel {
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .song-panel {
    width: 100%;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .download-panel {
    width: 100%;
    height: auto;
    min-height: min(340px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
  }

  .download-body {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .song-close {
    width: 40px;
    height: 40px;
  }

  .download-close {
    width: 40px;
    height: 40px;
  }

  .toast-stack {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .proxy-progress {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(236px, calc(100vw - 24px));
  }

  .history-item {
    gap: 10px;
    padding: 10px 8px;
  }

  .history-time {
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .workspace {
    gap: 8px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .panel--editor {
    height: 340px;
    min-height: 340px;
  }

  .preview-stage {
    min-height: 270px;
  }

  .download-body {
    gap: 16px;
    padding: 24px 18px 20px;
  }

  .download-actions {
    padding: 0 18px 18px;
  }
}

@media (max-width: 430px) {
  .topbar {
    padding: calc(8px + env(safe-area-inset-top)) 10px 0;
  }

  .top-nav {
    width: calc(100% + 20px);
    margin: 6px -10px 0;
    padding: 0 4px;
  }

  .top-nav-link {
    padding: 0 10px;
  }

  .brand-title {
    font-size: 15px;
  }

  .home-main {
    gap: 20px;
    padding: 22px 12px 44px;
  }

  .home-planet {
    width: 78px;
    height: 78px;
  }

  .home-planet::before {
    width: 112px;
    height: 44px;
  }

  .home-planet::after {
    width: 96px;
    height: 96px;
  }

  .home-greeting {
    font-size: 23px;
  }

  .home-handle {
    margin: 4px 0 6px;
  }

  .home-search {
    padding-left: 12px;
  }

  .home-search-icon {
    width: 17px;
    height: 17px;
  }

  .home-search-button {
    padding: 0 13px;
  }

  .deck-card {
    min-height: 164px;
  }

  .workspace {
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }

  .panel--editor {
    height: 320px;
    min-height: 320px;
  }

  .preview-stage {
    min-height: 240px;
    padding: 10px;
  }

  .song-heading .song-title {
    font-size: 23px;
  }

  .song-facts {
    margin: 0 12px 12px;
  }

  .song-lyric {
    margin: 0 12px 12px;
    padding: 10px 12px 12px;
  }

  .song-lyric-column p {
    font-size: 12px;
  }

  .song-actions {
    padding: 10px 12px 12px;
  }

  .song-action-copy strong {
    font-size: 13px;
  }

  .download-body {
    padding: 22px 14px 18px;
  }

  .download-actions {
    padding: 0 14px 16px;
  }
}
