.sc-app {
  --sc-ink: #17251f;
  --sc-muted: #607067;
  --sc-brand: #2f6b50;
  --sc-brand-dark: #1f4b38;
  --sc-soft: #edf4ef;
  --sc-line: #d8e2dc;
  --sc-warm: #d8a748;
  color: var(--sc-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1280px;
  margin: 2rem auto;
  line-height: 1.5;
}

.sc-app * { box-sizing: border-box; }
.sc-app button, .sc-app input { font: inherit; }

.sc-hero {
  background: linear-gradient(135deg, #183d2e 0%, #2f6b50 58%, #6d947c 100%);
  border-radius: 24px;
  color: #fff;
  padding: clamp(2rem, 5vw, 4.5rem);
  position: relative;
  overflow: hidden;
}

.sc-hero::after {
  content: "♫";
  position: absolute;
  right: 5%;
  top: -45%;
  font: 700 18rem/1 Georgia, serif;
  color: rgba(255,255,255,.08);
  transform: rotate(-9deg);
}

.sc-eyebrow { margin: 0 0 .5rem; font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
.sc-hero h2 { color: #fff; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.05; margin: 0 0 1rem; max-width: 800px; }
.sc-hero > p:last-child { font-size: 1.05rem; margin: 0; max-width: 650px; opacity: .9; }

.sc-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 1.25rem 0 2rem;
  padding: 0;
}

.sc-steps li { color: #91a098; display: flex; gap: .55rem; align-items: center; position: relative; }
.sc-steps li:not(:last-child)::after { content: ""; height: 1px; background: var(--sc-line); flex: 1; margin: 0 1rem; }
.sc-steps span { align-items: center; border: 1px solid var(--sc-line); border-radius: 50%; display: inline-flex; height: 32px; justify-content: center; width: 32px; }
.sc-steps .is-active { color: var(--sc-brand); }
.sc-steps .is-active span { background: var(--sc-brand); border-color: var(--sc-brand); color: #fff; }

.sc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .46fr); gap: 1.5rem; align-items: start; }
.sc-panel, .sc-selection { background: #fff; border: 1px solid var(--sc-line); border-radius: 18px; box-shadow: 0 12px 35px rgba(28,60,45,.06); }
.sc-filter-panel { padding: 1.25rem; }
.sc-search-label, .sc-export-form > label:not(.sc-check) { display: block; font-size: .78rem; font-weight: 800; margin-bottom: .45rem; text-transform: uppercase; letter-spacing: .05em; }
.sc-search-wrap { position: relative; }
.sc-search-wrap > span { color: var(--sc-muted); font-size: 1.5rem; left: 1rem; position: absolute; top: 50%; transform: translateY(-54%); }
.sc-search, .sc-export-form input[type="text"] { border: 1px solid var(--sc-line); border-radius: 11px; color: var(--sc-ink); min-height: 48px; padding: .75rem 1rem; width: 100%; }
.sc-search { padding-left: 3rem; }
.sc-search:focus, .sc-export-form input:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 3px rgba(47,107,80,.13); outline: 0; }

.sc-categories { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; max-height: 145px; overflow: auto; padding-right: .25rem; }
.sc-category { background: #fff; border: 1px solid var(--sc-line); border-radius: 999px; color: var(--sc-ink); cursor: pointer; padding: .45rem .8rem; }
.sc-category small { color: var(--sc-muted); margin-left: .25rem; }
.sc-category:hover, .sc-category.is-active { background: var(--sc-brand); border-color: var(--sc-brand); color: #fff; }
.sc-category.is-active small { color: rgba(255,255,255,.75); }

.sc-results-head { align-items: baseline; display: flex; justify-content: space-between; margin: 1.5rem .2rem .75rem; }
.sc-results-head h3 { margin: 0; font-size: 1.2rem; }
.sc-result-count { color: var(--sc-muted); font-size: .88rem; }
.sc-song-grid { display: grid; gap: .7rem; }
.sc-song-card { align-items: center; background: #fff; border: 1px solid var(--sc-line); border-radius: 14px; display: flex; gap: 1rem; justify-content: space-between; padding: .9rem 1rem; transition: .18s ease; }
.sc-song-card:hover { border-color: #a9bcb0; transform: translateY(-1px); }
.sc-song-card.is-selected { background: var(--sc-soft); border-color: #abc3b4; }
.sc-song-info { flex: 1; min-width: 0; }
.sc-song-title-row { align-items: flex-start; display: flex; gap: .8rem; justify-content: space-between; }
.sc-song-info h4 { font-size: 1rem; margin: 0 0 .2rem; }
.sc-song-number, .sc-selected-number, .sc-modal-number { color: var(--sc-brand); flex-shrink: 0; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.sc-song-number { background: var(--sc-soft); border-radius: 999px; padding: .17rem .55rem; }
.sc-song-info p { color: var(--sc-muted); font-size: .75rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-song-actions { display: flex; gap: .45rem; flex-shrink: 0; }
.sc-preview, .sc-add, .sc-load-more, .sc-clear, .sc-modal-add { border-radius: 9px; cursor: pointer; font-weight: 700; padding: .5rem .75rem; }
.sc-preview { background: #fff; border: 1px solid var(--sc-line); color: var(--sc-ink); }
.sc-add, .sc-modal-add { background: var(--sc-brand); border: 1px solid var(--sc-brand); color: #fff; }
.sc-add:disabled, .sc-modal-add:disabled { background: transparent; color: var(--sc-brand); cursor: default; }
.sc-load-more { background: #fff; border: 1px solid var(--sc-brand); color: var(--sc-brand); display: block; margin: 1rem auto; }
.sc-no-results { align-items: center; border: 1px dashed var(--sc-line); border-radius: 14px; color: var(--sc-muted); display: flex; gap: .8rem; justify-content: center; min-height: 130px; }
.sc-no-results span { font-size: 2rem; }

.sc-selection { overflow: hidden; position: sticky; top: 2rem; }
.sc-selection-head { align-items: center; border-bottom: 1px solid var(--sc-line); display: flex; justify-content: space-between; padding: 1.2rem; }
.sc-selection-head h3 { font-size: 1.15rem; margin: 0; }
.sc-selected-count { background: var(--sc-soft); border-radius: 999px; color: var(--sc-brand); display: inline-block; font-size: .8rem; margin-left: .25rem; padding: .13rem .5rem; vertical-align: .1rem; }
.sc-clear { background: none; border: 0; color: #a34242; padding: .4rem; }
.sc-clear:disabled { color: #aeb7b1; cursor: default; }
.sc-empty { color: var(--sc-muted); padding: 2.5rem 1rem; text-align: center; }
.sc-empty span { color: #b6c7bd; display: block; font: 3.6rem/1 Georgia, serif; }
.sc-empty p { color: var(--sc-ink); font-weight: 700; margin: .8rem 0 .2rem; }
.sc-selected-list { list-style: none; margin: 0; max-height: 420px; overflow: auto; padding: .4rem 1rem; }
.sc-selected-item { align-items: center; border-bottom: 1px solid #edf1ee; display: grid; gap: .7rem; grid-template-columns: 28px minmax(0,1fr) auto; padding: .7rem 0; }
.sc-order { align-items: center; background: var(--sc-soft); border-radius: 50%; color: var(--sc-brand); display: flex; font-size: .75rem; font-weight: 800; height: 27px; justify-content: center; width: 27px; }
.sc-selected-title { background: none; border: 0; color: var(--sc-ink); cursor: pointer; min-width: 0; padding: 0; text-align: left; }
.sc-selected-title-row { align-items: baseline; display: flex; gap: .5rem; justify-content: space-between; }
.sc-selected-title b, .sc-selected-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-selected-title b { min-width: 0; }
.sc-selected-title small { color: var(--sc-muted); font-size: .68rem; margin-top: .15rem; }
.sc-order-actions { display: flex; gap: .15rem; }
.sc-order-actions button { background: #fff; border: 1px solid var(--sc-line); border-radius: 7px; cursor: pointer; height: 28px; line-height: 1; padding: 0; width: 28px; }
.sc-order-actions button:disabled { opacity: .25; cursor: default; }
.sc-order-actions .sc-remove { color: #a34242; }
.sc-export-form { background: #f7f9f8; border-top: 1px solid var(--sc-line); padding: 1.2rem; }
.sc-export-form input[type="text"] { background: #fff; min-height: 42px; }
.sc-check { align-items: flex-start; display: flex; font-size: .82rem; gap: .5rem; margin: .8rem 0; }
.sc-check input { margin-top: .25rem; }
.sc-export { background: var(--sc-brand); border: 0; border-radius: 11px; color: #fff; cursor: pointer; font-weight: 800; min-height: 50px; width: 100%; }
.sc-export:hover { background: var(--sc-brand-dark); }
.sc-export:disabled { background: #b7c3bc; cursor: default; }
.sc-export-note { color: var(--sc-muted); font-size: .72rem; margin: .6rem 0 0; text-align: center; }

.sc-modal[hidden] { display: none; }
.sc-modal { inset: 0; position: fixed; z-index: 99999; }
.sc-modal-backdrop { background: rgba(15,27,21,.72); inset: 0; position: absolute; }
.sc-modal-card { background: #fff; border-radius: 18px; left: 50%; max-height: min(760px, 86vh); max-width: 720px; overflow: auto; padding: clamp(1.5rem, 4vw, 2.6rem); position: absolute; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 2rem); }
.sc-modal-close { background: var(--sc-soft); border: 0; border-radius: 50%; cursor: pointer; font-size: 1.4rem; height: 38px; position: absolute; right: 1rem; top: 1rem; width: 38px; }
.sc-modal-categories { color: var(--sc-brand); font-size: .72rem; font-weight: 800; letter-spacing: .05em; margin: 0 3rem .45rem 0; text-transform: uppercase; }
.sc-modal-title-row { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; margin: 0 3rem 1rem 0; }
.sc-modal-title { font: 700 clamp(1.6rem, 4vw, 2.4rem)/1.15 Georgia, serif; margin: 0; }
.sc-modal-number { background: var(--sc-soft); border-radius: 999px; font-size: .85rem; padding: .3rem .65rem; }
.sc-modal-lyrics { border-top: 1px solid var(--sc-line); color: #27362e; font-family: Georgia, serif; line-height: 1.7; max-height: 440px; overflow: auto; padding: 1rem .2rem; white-space: pre-wrap; }
.sc-modal-add { margin-top: 1rem; min-height: 46px; width: 100%; }
.sc-modal-open { overflow: hidden; }

@media (max-width: 900px) {
  .sc-layout { grid-template-columns: 1fr; }
  .sc-selection { position: static; }
  .sc-steps b { display: none; }
  .sc-steps li:not(:last-child)::after { margin: 0 .5rem; }
}

@media (max-width: 560px) {
  .sc-app { margin: 1rem auto; }
  .sc-hero { border-radius: 16px; }
  .sc-song-card { align-items: stretch; flex-direction: column; }
  .sc-song-actions button { flex: 1; }
  .sc-song-actions { width: 100%; }
  .sc-categories { max-height: 175px; }
}
