.app-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 10px;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 0;
}

.app-brand {
  color: #78ffe7;
  font-weight: 950;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.app-nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #d9fbff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(217, 251, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.app-nav-btn:hover {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.38);
}

.app-nav-btn.is-active,
.app-nav-btn[aria-current="page"] {
  pointer-events: none;
  cursor: default;
  background: rgba(94, 234, 212, 0.18);
  border-color: rgba(94, 234, 212, 0.52);
  color: #ffffff;
}

body.code-lock {
  overflow: hidden;
}

.code-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 14, 0.84);
  backdrop-filter: blur(12px);
}

.code-gate[hidden] {
  display: none !important;
}

.code-gate-panel {
  width: min(520px, 100%);
  padding: 26px 24px 22px;
  border: 1px solid rgba(126, 232, 221, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 17, 27, 0.98), rgba(9, 11, 19, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.code-gate-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.12);
  color: #7ee8dd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.code-gate-panel h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.code-gate-desc {
  margin: 10px 0 0;
  color: #d7e3ee;
  font-size: 16px;
  line-height: 1.65;
}

.code-gate-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.code-gate-field span {
  color: #a9b2ba;
  font-size: 13px;
  font-weight: 700;
}

.code-gate-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(126, 232, 221, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #eef4ff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.code-gate-field input::placeholder {
  color: #718191;
  letter-spacing: 0;
}

.code-gate-note {
  margin: 12px 0 0;
  color: #9fb0be;
  font-size: 12px;
  line-height: 1.6;
}

.code-gate-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: #ff8e8e;
  font-size: 13px;
  font-weight: 700;
}

.code-gate-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 6px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6dffe8, #31c8ff);
  color: #041014;
  font-size: 15px;
  font-weight: 900;
}

.code-gate-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.code-gate-actions button {
  flex: 1;
}

.code-gate-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(217, 251, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9fbff;
  font-size: 15px;
  font-weight: 900;
}

.code-gate-cancel:hover {
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.32);
}
:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --panel: #151619;
  --panel-2: #1b1d22;
  --ink: #eef4ff;
  --muted: #a3a8b2;
  --line: #30333a;
  --accent: #39d0c8;
  --accent-strong: #7ee8dd;
  --gold: #f5c45e;
  --field: #101216;
  --field-strong: #1d2026;
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(145deg, #07080a 0%, var(--bg) 52%, #101114 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
}

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

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  height: auto;
  margin: 0 auto;
  padding: 22px 22px 30px;
  overflow: visible;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(350px, 450px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 82px);
  height: auto;
}

.settings-panel,
.output-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.settings-panel {
  padding: 20px;
  background: linear-gradient(180deg, rgba(21, 22, 25, .98), rgba(12, 13, 16, .98));
  overflow-y: auto;
}

.output-panel {
  padding: 22px;
  background: linear-gradient(180deg, rgba(21, 22, 25, .97), rgba(10, 11, 14, .98));
  overflow-y: auto;
}

.settings-panel,
.output-panel {
  scrollbar-color: #4b5565 #111317;
  scrollbar-width: thin;
}

.settings-panel::-webkit-scrollbar,
.output-panel::-webkit-scrollbar {
  width: 10px;
}

.settings-panel::-webkit-scrollbar-track,
.output-panel::-webkit-scrollbar-track {
  background: #111317;
  border-radius: 999px;
}

.settings-panel::-webkit-scrollbar-thumb,
.output-panel::-webkit-scrollbar-thumb {
  background: #4b5565;
  border: 2px solid #111317;
  border-radius: 999px;
}

.brand-row,
.output-toolbar,
.track-head {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.app-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #24262d, #0f766e);
  color: #ffcf5a;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .3);
}

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

h1 {
  font-size: 22px;
  line-height: 1.15;
}

.brand-row p,
.output-toolbar p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.brand-row .app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
  color: #7f8794;
  font-size: 12px;
}

.app-meta a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 800;
}

.app-meta a:hover {
  text-decoration: underline;
}

.app-meta .support-link {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 2px;
  padding: 1px 6px;
  border: 1px solid rgba(245, 196, 94, .32);
  border-radius: 999px;
  background: rgba(245, 196, 94, .06);
  color: #d8bb73;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

.app-meta .support-link:hover {
  background: rgba(245, 196, 94, .14);
  border-color: rgba(245, 196, 94, .58);
  color: #ffd977;
  text-decoration: none;
}

.control-grid {
  display: grid;
  gap: 14px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid rgba(57, 208, 200, .14);
  border-radius: 8px;
  background: rgba(16, 18, 22, .58);
}

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

#settingsStatus {
  min-height: 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-switch legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: #c8d4e5;
  font-size: 13px;
  font-weight: 800;
}

.mode-switch label {
  display: block;
  cursor: pointer;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font-weight: 900;
}

.mode-switch input:checked + span {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(57, 208, 200, .18), rgba(245, 196, 94, .08));
  color: var(--accent-strong);
}

.is-hidden {
  display: none !important;
}

label,
.range-field {
  display: grid;
  gap: 7px;
  color: #c8d4e5;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 208, 200, .16);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #15171c;
  color: #607086;
  cursor: not-allowed;
}

.genre-picker-button {
  justify-content: space-between;
  width: 100%;
  text-align: left;
}

.genre-picker-button::after {
  content: "선택";
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.55;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.blend-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(57, 208, 200, .16);
  border-radius: 8px;
  background: rgba(16, 18, 22, .72);
}

.range-field span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

output {
  color: var(--gold);
  font-weight: 900;
}

.range-field.is-disabled {
  opacity: .45;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-strong);
  color: var(--ink);
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button.copied {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.output-toolbar {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.output-toolbar h2 {
  font-size: 24px;
}

.results {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.track-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(27, 29, 34, .96), rgba(14, 15, 18, .96));
  overflow: hidden;
}

.track-head {
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(57, 208, 200, .13), rgba(245, 196, 94, .08));
  border-bottom: 1px solid var(--line);
}

.track-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(9, 13, 20, .72);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.track-head h3 {
  margin-top: 7px;
  font-size: 18px;
}

.track-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.copy-track {
  flex: 0 0 auto;
}

.prompt-block {
  padding: 16px 18px 18px;
}

.prompt-block h4 {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font: 14px/1.7 "Consolas", "D2Coding", monospace;
  color: #dde8f7;
}

.modal-open {
  overflow: hidden;
}

.genre-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 6, 14, .72);
  backdrop-filter: blur(10px);
}

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

.genre-modal-panel {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(126, 232, 221, .22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 20, 25, .98), rgba(9, 11, 16, .98));
  box-shadow: var(--shadow);
}

.genre-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.genre-modal-head p {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.genre-modal-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.03em;
}

.genre-modal-head button {
  min-width: 72px;
}

.genre-modal-search input {
  min-height: 46px;
  border-color: rgba(126, 232, 221, .28);
  background: rgba(255, 255, 255, .04);
}

.genre-group-list {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding-right: 6px;
}

.genre-group {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.genre-group h3 {
  margin: 0;
  color: #d7e3ee;
  font-size: 13px;
  font-weight: 900;
}

.genre-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.genre-choice {
  min-height: 38px;
  padding: 7px 10px;
  color: #dce8f6;
  font-size: 13px;
  text-align: left;
  background: rgba(16, 18, 22, .9);
}

.genre-choice.is-selected {
  border-color: var(--accent);
  background: rgba(57, 208, 200, .16);
  color: #ffffff;
}

.genre-choice.is-none {
  width: auto;
  min-height: 38px;
  color: #9fb0be;
}

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

  .app-shell {
    padding: 12px;
    height: auto;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .settings-panel,
  .output-panel {
    overflow: visible;
  }

  .output-panel {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .app-nav {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 24px, 1120px);
  }

  .app-nav-links {
    width: 100%;
  }

  .app-nav-links .app-nav-btn {
    flex: 1;
  }

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

  .brand-row,
  .output-toolbar,
  .track-head {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .settings-actions button,
  .genre-modal-head button,
  .genre-choice.is-none {
    width: auto;
  }

  .genre-modal {
    padding: 12px;
  }

  .genre-choice-grid {
    grid-template-columns: 1fr 1fr;
  }
}
