.music-generator-stage {
  max-width: 1072px !important;
}

.mg-input-error { margin: 6px 0 0; color: #b91c1c; font-size: 13px; }
.mg-editor-panel .mg-modal-head h2 { flex: 1; }
.mg-editor-panel .mg-modal-actions { flex-wrap: wrap; }
#lyrics-character-count { margin-right: auto; color: #475569; font-size: 13px; }

.music-generator-card {
  --mg-accent: #ea580c;
  --mg-accent-dark: #c2410c;
  --mg-ink: #111827;
  --mg-muted: #64748b;
  --mg-line: #d7dee8;
  --mg-soft: #eef2f6;
  width: 100%;
  max-width: 672px;
  margin: 0 auto;
  color: var(--mg-ink);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  transition: max-width 160ms ease;
}

.music-generator-card[data-mode="custom"] {
  max-width: 1040px;
}

.music-generator-card *,
.lyrics-tool-page * {
  box-sizing: border-box;
}

.music-generator-form {
  margin: 0;
}

.mg-legacy-generator-controls {
  padding: 22px 24px 0;
}

.mg-legacy-switch-control {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.mg-legacy-switch-control .mg-switch-track {
  position: relative;
  width: 56px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #9ca3af;
}

.mg-legacy-switch-control .mg-switch-track::after {
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
}

.mg-legacy-switch-control input:checked + .mg-switch-track {
  background: #16a34a;
}

.mg-legacy-switch-control input:checked + .mg-switch-track::after {
  transform: translateX(24px);
}

.mg-legacy-switch-control input:focus-visible + .mg-switch-track {
  outline: 3px solid rgba(234, 88, 12, 0.22);
  outline-offset: 2px;
}

.mg-help {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  border: 1px solid #94a3b8;
  border-radius: 50%;
}

.mg-generator-switch-row {
  margin-bottom: 18px;
}

.mg-form-grid {
  display: block;
}

.mg-main-fields,
.mg-settings {
  min-width: 0;
  padding: 18px 24px 24px;
}

.mg-settings {
  padding-top: 0;
}

.mg-settings h2 {
  margin: 0 0 16px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.music-generator-form[data-mode="simple"] .mg-settings h2 {
  display: none;
}

.music-generator-card[data-mode="custom"] .mg-settings h2 {
  margin: 2px 0 20px;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.3;
}

.mg-field {
  margin-bottom: 18px;
}

.mg-field:last-child {
  margin-bottom: 0;
}

.mg-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.mg-field label,
.mg-field-label {
  display: block;
  margin: 0 0 7px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.mg-field-label small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.mg-label-row label {
  margin: 0;
}

.mg-label-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-field input[type="text"],
.mg-field input[type="number"],
.mg-field textarea,
.mg-field select,
.lyrics-tool-page textarea,
.lyrics-tool-page input[type="text"] {
  width: 100%;
  padding: 12px 13px;
  color: #172033;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.mg-field textarea {
  min-height: 92px;
  resize: vertical;
  overflow-y: hidden;
}

.mg-field textarea.mg-lyrics-input {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
}

.mg-field input:focus,
.mg-field textarea:focus,
.mg-field select:focus,
.lyrics-tool-page textarea:focus,
.lyrics-tool-page input:focus {
  border-color: var(--mg-accent);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

.mg-field input:disabled,
.mg-field textarea:disabled,
.mg-field select:disabled {
  color: #64748b;
  background: #e2e8f0;
  cursor: not-allowed;
}

.mg-text-action {
  padding: 3px 0;
  color: #c2410c;
  font-size: 13px;
  font-weight: 800;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mg-text-action:hover {
  color: #9a3412;
}

.mg-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.mg-icon-action svg {
  width: 17px;
  height: 17px;
}

.mg-style-selector {
  margin-top: 10px;
}

.mg-style-tabs {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  border-bottom: 1px solid #d7dee8;
  scrollbar-width: none;
}

.mg-style-tabs::-webkit-scrollbar {
  display: none;
}

.mg-style-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}

.mg-style-tab:hover,
.mg-style-tab:focus-visible,
.mg-style-tab.is-active {
  color: #c2410c;
}

.mg-style-tab.is-active {
  border-bottom-color: var(--mg-accent);
}

.mg-style-picker-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 9px;
}

.mg-style-tags,
.mg-style-popover-options {
  display: flex;
  gap: 7px;
}

.mg-style-tags {
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow: hidden;
}

.mg-style-popover-options {
  flex-wrap: wrap;
}

.mg-style-tag {
  min-height: 30px;
  padding: 5px 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.mg-style-tag:hover,
.mg-style-tag:focus-visible,
.mg-style-tag.is-selected {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
}

.mg-style-more {
  position: relative;
  flex: 0 0 auto;
}

.mg-style-more[hidden] {
  display: none;
}

.mg-style-more-button {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
}

.mg-style-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(520px, 82vw);
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
}

.mg-style-popover[hidden] {
  display: none;
}

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

.mg-switch-copy strong {
  display: block;
  color: #334155;
  font-size: 14px;
}

.mg-switch-copy span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.mg-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
}

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

.mg-switch .mg-switch-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #94a3b8;
  cursor: pointer;
  transition: background 120ms ease;
}

.mg-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 120ms ease;
}

.mg-switch input:checked + .mg-switch-track {
  background: var(--mg-accent);
}

.mg-switch input:checked + .mg-switch-track::after {
  transform: translateX(20px);
}

.mg-switch input:focus-visible + .mg-switch-track {
  outline: 3px solid rgba(234, 88, 12, 0.22);
  outline-offset: 2px;
}

.mg-model-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.mg-model-button::before {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--mg-accent);
}

.mg-model-button strong,
.mg-model-button span {
  display: block;
}

.mg-model-button strong {
  color: #172033;
}

.mg-model-button span {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.mg-model-button b {
  color: #c2410c;
  font-size: 12px;
}

.mg-model-button b::after {
  content: "\203A";
  margin-inline-start: 5px;
  font-size: 17px;
  line-height: 1;
  vertical-align: -1px;
}

.mg-persona-button {
  min-height: 60px;
}

.mg-advanced {
  margin-top: 18px;
  border-top: 1px solid #d7dee8;
  border-bottom: 1px solid #d7dee8;
}

.mg-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.mg-advanced summary::-webkit-details-marker {
  display: none;
}

.mg-advanced summary::after {
  content: "+";
  color: #64748b;
  font-size: 20px;
}

.mg-advanced[open] summary::after {
  content: "−";
}

.mg-advanced-body {
  padding: 2px 0 4px;
}

.mg-advanced-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.mg-advanced-grid .mg-field {
  margin: 0;
}

.mg-advanced-grid .mg-advanced-full {
  grid-column: 1 / -1;
}

.mg-advanced-reset {
  margin-top: 12px;
}

.mg-hint {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.mg-range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
}

.mg-range-row input {
  accent-color: var(--mg-accent);
}

.mg-range-value {
  min-width: 38px;
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.mg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--mg-line);
  background: #fff;
  border-radius: 0 0 18px 18px;
}

.mg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: #64748b;
  font-size: 13px;
}

.mg-meta strong {
  color: #334155;
}

.mg-primary,
.mg-secondary {
  min-height: 40px;
  padding: 9px 16px;
  font-weight: 800;
  border-radius: 9px;
  cursor: pointer;
}

.mg-primary {
  color: #fff;
  border: 1px solid var(--mg-accent);
  background: var(--mg-accent);
}

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

.mg-secondary {
  color: #9a3412;
  border: 1px solid #fdba74;
  background: #fff;
}

.mg-primary:disabled,
.mg-secondary:disabled,
.mg-text-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mg-generate-button {
  min-width: 132px;
}

.mg-modal {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
}

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

.mg-modal-panel {
  width: min(680px, 100%);
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
}

.mg-modal-panel.mg-editor-panel {
  width: min(820px, 100%);
}

.mg-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.mg-modal-head h2 {
  margin: 0;
  color: #172033;
  font-size: 21px;
}

.mg-modal-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.mg-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #475569;
  font-size: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.mg-model-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
}

.mg-model-option {
  display: block;
  min-height: 116px;
  padding: 12px 13px;
  text-align: left;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.mg-model-option.is-locked {
  background: #f8fafc;
}

.mg-model-option[aria-checked="true"] {
  border-color: #fb923c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.12);
}

.mg-model-option strong,
.mg-model-option small,
.mg-model-option-top {
  display: block;
}

.mg-model-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mg-model-positioning {
  margin-top: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.mg-model-features {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}

.mg-plan-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: #ffedd5;
}

.mg-model-modal-panel {
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.mg-model-modal-panel .mg-model-list {
  flex: 1 1 auto;
}

.mg-model-note {
  margin: 14px -20px -20px;
  padding: 12px 20px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid #d7dee8;
  border-radius: 0 0 16px 16px;
  background: #f1f5f9;
}

.music-generator-card [hidden], .mg-modal [hidden] { display: none !important; }
.mg-persona-modal-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.mg-persona-create-entry { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 14px; color: #9a3412; text-align: left; border: 1px solid #fdba74; border-radius: 8px; background: #fff7ed; cursor: pointer; }
.mg-persona-create-entry strong,.mg-persona-create-entry small { display: block; }
.mg-persona-create-entry small { margin-top: 3px; color: #64748b; font-size: 12px; line-height: 1.4; }
.mg-persona-create-entry b { font-size: 13px; }
.mg-persona-search { width: 100%; min-height: 44px; margin-bottom: 12px; padding: 10px 12px; color: #172033; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; }
.mg-persona-list { max-height: 330px; overflow-y: auto; }
.mg-persona-create-copy { margin: 10px 0 12px; color: #64748b; font-size: 13px; line-height: 1.45; }
.mg-persona-songs { max-height: 184px; display: grid; gap: 0; overflow-y: auto; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; }
.mg-persona-songs:empty { display: none; }
.mg-persona-song { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; padding: 10px 12px; color: #172033; border: 0; border-bottom: 1px solid #e2e8f0; background: #fff; text-align: left; cursor: pointer; }
.mg-persona-song:last-child { border-bottom: 0; }
.mg-persona-song[aria-selected="true"] { background: #fff7ed; box-shadow: inset 0 0 0 1px #fb923c; }
.mg-persona-song img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; }
.mg-persona-song span { min-width: 0; }
.mg-persona-song strong,.mg-persona-song small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-persona-song strong { font-size: 14px; }
.mg-persona-song small { color: #64748b; font-size: 12px; }
.mg-persona-create-fields label { display: block; margin: 12px 0 6px; color: #374151; font-size: 13px; font-weight: 700; }
.mg-persona-create-fields input,.mg-persona-create-fields textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: #172033; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; }
.mg-persona-create-fields textarea { height: 84px; min-height: 84px; resize: vertical; }
.mg-persona-create-error { margin: 10px 0 0; color: #b91c1c; font-size: 13px; }
.mg-persona-modal-panel .mg-modal-actions { padding-top: 14px; border-top: 1px solid #d7dee8; }
.mg-persona-option[hidden],.mg-persona-song[hidden],#persona-library-view[hidden],#persona-create-view[hidden] { display: none; }

.mg-persona-list {
  display: grid;
  gap: 8px;
}

.mg-persona-option {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  padding: 11px 38px 11px 13px;
  color: #172033;
  text-align: left;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.mg-persona-option span,
.mg-persona-empty {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.mg-persona-option::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 14px;
  height: 14px;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  transform: translateY(-50%);
}

.mg-persona-option.is-selected {
  border-color: #fb923c;
  background: #fff7ed;
}

.mg-persona-option.is-selected::after {
  border: 4px solid #ea580c;
}

.mg-persona-empty {
  margin: 14px 2px 0;
}

.mg-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.mg-editor-panel textarea {
  width: 100%;
  min-height: min(56vh, 520px);
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  resize: vertical;
}

.ai-lyrics-workspace {
  --mg-accent: #ea580c;
  color: #172033;
}

.ai-lyrics-form label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.ai-lyrics-form textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  resize: vertical;
}

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

.ai-lyrics-form-actions a {
  color: #c2410c;
  font-size: 13px;
  font-weight: 700;
}

.ai-lyrics-state {
  margin-top: 16px;
}

.ai-lyrics-state[hidden] {
  display: none;
}

.ai-lyrics-state h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.ai-lyrics-paper {
  padding: 18px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: repeating-linear-gradient(#fff, #fff 31px, #e7edf4 32px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.ai-lyrics-writing span {
  display: block;
  width: 82%;
  height: 8px;
  margin: 12px 0;
  border-radius: 99px;
  background: #cbd5e1;
  animation: lyrics-write 1.2s ease-in-out infinite alternate;
}

.ai-lyrics-writing span:nth-child(2) { width: 63%; animation-delay: 120ms; }
.ai-lyrics-writing span:nth-child(3) { width: 75%; animation-delay: 240ms; }
.ai-lyrics-writing span:nth-child(4) { width: 54%; animation-delay: 360ms; }

@keyframes lyrics-write {
  from { opacity: 0.35; transform: scaleX(0.82); transform-origin: left; }
  to { opacity: 0.8; transform: scaleX(1); transform-origin: left; }
}

.ai-lyrics-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-lyrics-tabs::-webkit-scrollbar {
  display: none;
}

.ai-lyrics-tab {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.ai-lyrics-tab[aria-selected="true"] {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
}

.ai-lyrics-editor {
  width: 100%;
  min-height: 280px;
  padding: 14px;
  line-height: 1.7;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  resize: vertical;
}

.ai-lyrics-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-lyrics-error {
  margin: 0 0 12px;
  color: #7f1d1d;
}

.lyrics-tool-page {
  min-height: calc(100vh - 180px);
  padding: 52px 20px 72px;
  color: #e5e7eb;
  background: #111827;
}

.lyrics-tool-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  width: min(1100px, 100%);
  margin: 0 auto;
  overflow: visible;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #172033;
}

.lyrics-tool-input,
.lyrics-tool-output {
  min-width: 0;
  padding: 28px;
}

.lyrics-tool-input {
  color: #172033;
  background: #f8fafc;
  border-radius: 18px 0 0 18px;
}

.lyrics-tool-input h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.lyrics-tool-input > p {
  margin: 0 0 24px;
  color: #64748b;
}

.lyrics-tool-output {
  color: #172033;
  background: #eef2f6;
  border-radius: 0 18px 18px 0;
}

.lyrics-tool-output .ai-lyrics-state {
  margin-top: 0;
}

.lyrics-tool-empty {
  display: flex;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-align: center;
}

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

@media (min-width: 960px) {
  .music-generator-card[data-mode="custom"] .mg-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
    align-items: start;
    gap: 28px;
    padding: 18px 24px 24px;
  }

  .music-generator-card[data-mode="custom"] .mg-settings {
    min-height: 100%;
    padding: 0 0 0 28px;
    border-left: 1px solid var(--mg-line);
    background: transparent;
  }

  .music-generator-card[data-mode="custom"] .mg-main-fields {
    padding: 0;
  }

  .music-generator-card[data-mode="custom"] .mg-field textarea.mg-lyrics-input {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
  }
}

@media (max-width: 959px) {
  .music-generator-card[data-mode="custom"] .mg-settings {
    margin: 0 24px;
    padding: 22px 0 24px;
    border-top: 1px solid var(--mg-line);
    border-left: 0;
    background: transparent;
  }
}

@media (max-width: 820px) {
  .lyrics-tool-layout {
    grid-template-columns: 1fr;
  }

  .lyrics-tool-input {
    border-radius: 18px 18px 0 0;
  }

  .lyrics-tool-output {
    border-radius: 0 0 18px 18px;
  }
}

@media (max-width: 560px) {
  .mg-legacy-generator-controls {
    padding: 18px 18px 0;
  }

  .mg-main-fields,
  .mg-settings,
  .lyrics-tool-input,
  .lyrics-tool-output {
    padding: 18px;
  }

  .music-generator-card[data-mode="custom"] .mg-settings {
    margin: 0 18px;
    padding: 22px 0 18px;
  }

  .mg-style-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: min(440px, calc(100dvh - 24px));
  }

  .mg-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 18px;
  }

  .mg-generate-button {
    width: 100%;
  }

  .mg-model-list {
    grid-template-columns: 1fr;
  }

  .mg-advanced-grid {
    grid-template-columns: 1fr;
  }

  .mg-advanced-grid .mg-advanced-full {
    grid-column: auto;
  }

  .mg-model-note {
    margin: 14px -16px -16px;
    padding-inline: 16px;
  }

  .mg-modal {
    align-items: flex-start;
    padding: 12px;
  }

  .mg-modal-panel {
    margin-top: 16px;
    padding: 16px;
  }

  .ai-lyrics-form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .music-generator-card *,
  .lyrics-tool-page * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
