:root {
  --forest-950: #0d2822;
  --forest-900: #12342c;
  --forest-800: #173f35;
  --forest-700: #225548;
  --forest-100: #dfece7;
  --cream: #fbf8f0;
  --paper: #fffdf8;
  --gold: #d8a84b;
  --gold-light: #f0d391;
  --ink: #1b2723;
  --muted: #68756f;
  --line: #dfe4df;
  --danger: #a13939;
  --shadow: 0 16px 45px rgb(20 54 44 / 9%);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }

.page {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  color: #fff;
  background:
    radial-gradient(circle at 72% -10%, rgb(224 184 93 / 32%), transparent 34%),
    linear-gradient(135deg, var(--forest-950), var(--forest-700));
}

.hero__pattern {
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image:
    linear-gradient(30deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff),
    linear-gradient(150deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff),
    linear-gradient(30deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff),
    linear-gradient(150deg, #fff 12%, transparent 12.5%, transparent 87%, #fff 87.5%, #fff);
  background-position: 0 0, 0 0, 24px 42px, 24px 42px;
  background-size: 48px 84px;
  mask-image: linear-gradient(to right, transparent 10%, #000 70%);
}

.hero__content {
  position: relative;
  padding-block: 62px 70px;
}

.hero--compact { min-height: 265px; }
.hero--compact .hero__content { padding-block: 48px 55px; }
.hero--compact h1 { font-size: clamp(2.5rem, 6vw, 4rem); }

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 50%;
  background: rgb(255 255 255 / 7%);
  font-size: 27px;
}

.brand-mark--dark {
  color: var(--forest-800);
  border-color: var(--forest-100);
  background: var(--forest-100);
}

.brand-mark--small {
  width: 38px;
  height: 38px;
  margin: 0;
  font-size: 21px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow--dark { color: #8a6626; }

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  max-width: 700px;
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .98;
}

.hero__intro {
  margin: 0;
  color: rgb(255 255 255 / 76%);
  font-size: 1.06rem;
}

.audience-main {
  min-height: 430px;
  padding-block: 42px 30px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2, .panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 55%);
  font-size: .77rem;
  font-weight: 650;
}

.connection__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c69237;
}

.connection[data-state="live"] .connection__dot {
  background: #3a966f;
  box-shadow: 0 0 0 3px rgb(58 150 111 / 13%);
}

.connection[data-state="retrying"] .connection__dot { background: #c45c52; }

.nashid-list, .admin-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nashid-list { display: grid; gap: 12px; }

.nashid-card {
  scroll-margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 3px 13px rgb(17 48 39 / 3%);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.nashid-card:hover {
  border-color: #c9d4ce;
  box-shadow: 0 8px 25px rgb(17 48 39 / 7%);
  transform: translateY(-1px);
}

.nashid-card.is-current {
  border-color: var(--forest-700);
  box-shadow: 0 10px 32px rgb(13 40 34 / 18%);
}

.nashid-card.is-current summary {
  color: #fff;
  background:
    radial-gradient(circle at 12% 0%, rgb(240 211 145 / 18%), transparent 32%),
    linear-gradient(135deg, var(--forest-950), var(--forest-700));
}

.nashid-card.is-current .nashid-card__number {
  color: var(--forest-950);
  background: var(--gold-light);
  box-shadow: 0 0 0 4px rgb(255 255 255 / 9%);
}

.nashid-card.is-current .nashid-card__prompt {
  color: rgb(255 255 255 / 78%);
}

.nashid-card.is-current .chevron {
  color: #fff;
  border-color: rgb(255 255 255 / 28%);
  background: rgb(255 255 255 / 7%);
}

.nashid-card.is-current .current-badge {
  color: var(--forest-950);
  background: var(--gold-light);
}

.nashid-card.is-current .current-badge__dot {
  background: var(--forest-700);
  box-shadow: 0 0 0 3px rgb(34 85 72 / 16%);
}

.nashid-card summary {
  display: grid;
  min-height: 82px;
  padding: 16px 21px;
  align-items: center;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 15px;
  cursor: pointer;
  list-style: none;
}

.nashid-card summary::-webkit-details-marker { display: none; }

.nashid-card__number {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--forest-700);
  border-radius: 50%;
  background: var(--forest-100);
  font-family: Georgia, serif;
  font-size: .95rem;
}

.nashid-card__title {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 600;
  text-overflow: ellipsis;
}

.nashid-card__title-area {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.current-badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 5px 9px;
  align-items: center;
  gap: 6px;
  color: #725114;
  border-radius: 999px;
  background: #f4dfae;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .7rem;
  font-weight: 800;
}

.current-badge__dot, .current-button__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b67c17;
  box-shadow: 0 0 0 3px rgb(182 124 23 / 14%);
}

.nashid-card__prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.chevron {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.15rem;
  transition: transform .2s;
}

details[open] .chevron { transform: rotate(180deg); }

.nashid-card__body {
  padding-block: 0 28px;
  padding-inline: 84px 26px;
}

.lyrics {
  padding: 27px clamp(20px, 5vw, 44px);
  color: #283b34;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  background: #f6f5ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 3vw, 1.42rem);
  line-height: 2;
  white-space: pre-wrap;
}

.empty-state {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 { margin-bottom: 8px; color: var(--ink); }
.empty-state p { margin-bottom: 0; }

.empty-state__icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 17px;
  place-items: center;
  color: #8a6626;
  border-radius: 50%;
  background: #f4e8c9;
  font-size: 1.5rem;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 15px;
  border: 2px solid var(--forest-100);
  border-top-color: var(--forest-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.footer {
  display: flex;
  padding-block: 28px 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 11px;
  color: #8b938f;
  border-top: 1px solid var(--line);
  font-family: Georgia, serif;
  font-size: .9rem;
  font-style: italic;
  text-align: center;
}

.catalog-link {
  color: var(--forest-700);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .86rem;
  font-style: normal;
  font-weight: 750;
  text-decoration: none;
}
.catalog-link:hover { text-decoration: underline; }

.current-toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: 22px;
  display: grid;
  width: min(470px, calc(100% - 28px));
  min-height: 72px;
  padding: 11px 13px;
  align-items: center;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 16px;
  cursor: pointer;
  background: var(--forest-900);
  box-shadow: 0 18px 55px rgb(8 31 24 / 32%);
  text-align: start;
  transform: translateX(50%);
  animation: toast-in .24s ease-out;
}

.current-toast__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #62430c;
  border-radius: 50%;
  background: var(--gold-light);
  font-size: 1.2rem;
}

.current-toast__content { min-width: 0; }
.current-toast__content small, .current-toast__content strong { display: block; }
.current-toast__content small { margin-bottom: 3px; color: rgb(255 255 255 / 62%); font-size: .68rem; }
.current-toast__content strong { overflow: hidden; font-family: Georgia, serif; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.current-toast__action { color: var(--gold-light); font-size: .72rem; font-weight: 750; white-space: nowrap; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(50%, 12px); }
  to { opacity: 1; transform: translate(50%, 0); }
}

/* Admin */
.admin-body { background: #f4f2eb; }

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 30px 20px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgb(42 101 84 / 13%), transparent 40%),
    #f4f2eb;
}

.login-card {
  width: min(430px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card h1, .admin-titlebar h1 {
  margin-bottom: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -.025em;
}

.muted { color: var(--muted); line-height: 1.5; }

label {
  display: block;
  margin: 20px 0 7px;
  color: #3e4e48;
  font-size: .82rem;
  font-weight: 700;
}

input, textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid #cfd6d1;
  border-radius: 10px;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

textarea {
  min-height: 300px;
  line-height: 1.65;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 3px rgb(34 85 72 / 12%);
}

.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: .84rem;
}

.button {
  display: inline-flex;
  min-height: 41px;
  padding: 9px 15px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s, opacity .15s;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button--wide { width: 100%; margin-top: 18px; }
.button--primary { color: #fff; background: var(--forest-800); }
.button--primary:hover { background: var(--forest-700); }
.button--secondary { border-color: var(--line); background: #fff; }
.button--secondary:hover { border-color: #bec9c3; background: #fafafa; }
.button--ghost { border-color: rgb(255 255 255 / 18%); color: rgb(255 255 255 / 82%); background: transparent; }
.button--ghost:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.button--danger { color: #fff; background: var(--danger); }

.text-link {
  display: block;
  margin-top: 20px;
  color: var(--forest-700);
  font-size: .84rem;
  font-weight: 650;
}
.text-link--center { text-align: center; }

.admin-header {
  color: #fff;
  background: var(--forest-900);
  box-shadow: 0 2px 9px rgb(0 0 0 / 8%);
}

.admin-header__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-family: Georgia, serif; font-size: 1.05rem; }
.admin-brand small { margin-top: 2px; color: rgb(255 255 255 / 57%); font-size: .7rem; }
.admin-header__actions { display: flex; gap: 8px; }

.admin-main { padding-block: 42px 70px; }

.admin-titlebar {
  display: flex;
  margin-bottom: 27px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
}

.admin-titlebar h1 { margin-bottom: 5px; }
.admin-titlebar p:last-child { margin-bottom: 0; }

.admin-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(330px, .82fr) minmax(420px, 1.18fr);
  gap: 22px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 4px 18px rgb(17 48 39 / 4%);
}

.panel__heading {
  display: flex;
  min-height: 70px;
  padding: 17px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.panel__heading--library {
  min-height: 105px;
  align-items: stretch;
  flex-direction: column;
}

.panel__title-row { display: flex; align-items: center; justify-content: space-between; }

.admin-tabs {
  display: grid;
  padding: 3px;
  grid-template-columns: 1fr 1fr;
  border-radius: 9px;
  background: #eeeee8;
}

.admin-tab {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  font-size: .76rem;
  font-weight: 750;
}
.admin-tab.is-active { color: var(--forest-800); background: #fff; box-shadow: 0 2px 6px rgb(20 48 40 / 8%); }

.count-badge {
  display: grid;
  min-width: 28px;
  height: 28px;
  padding-inline: 8px;
  place-items: center;
  color: var(--forest-700);
  border-radius: 999px;
  background: var(--forest-100);
  font-size: .78rem;
  font-weight: 750;
}

.admin-list { padding: 10px; }

.admin-list__item {
  display: grid;
  min-height: 59px;
  padding: 7px 7px 7px 5px;
  align-items: center;
  grid-template-columns: 25px 31px minmax(0, 1fr) auto;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background .15s, border-color .15s, opacity .15s;
}

.admin-list__item + .admin-list__item { margin-top: 4px; }
.admin-list__item:hover { background: #f5f6f2; }
.admin-list__item.is-selected { border-color: #ccdbd5; background: #edf4f1; }
.admin-list__item.is-current { border-color: #ddc17d; background: #fff9e9; }
.admin-list__item.is-dragging { opacity: .42; }
.admin-list__item.drag-over { border-top: 2px solid var(--gold); }
.admin-list__item.is-library-item { grid-template-columns: 31px minmax(0, 1fr) auto; }

.library-icon { color: #9a7b40; font-size: 1rem; text-align: center; }

.program-toggle {
  min-height: 32px;
  padding: 6px 9px;
  color: var(--forest-700);
  border: 1px solid #c8d7d1;
  border-radius: 8px;
  cursor: pointer;
  background: #f4f8f6;
  font-size: .68rem;
  font-weight: 750;
  white-space: nowrap;
}
.program-toggle.is-included { color: #765716; border-color: #dfca91; background: #fff7df; }

.drag-handle {
  color: #a5ada9;
  cursor: grab;
  font-size: 1.25rem;
  text-align: center;
}
.drag-handle:active { cursor: grabbing; }

.admin-list__position {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-family: Georgia, serif;
  font-size: .78rem;
}

.admin-list__title {
  overflow: hidden;
  padding: 10px 5px;
  color: var(--ink);
  border: 0;
  cursor: pointer;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  font-weight: 600;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-controls {
  display: flex;
  min-width: max-content;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  white-space: nowrap;
}

.current-button {
  display: inline-flex;
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8a6626;
  border: 1px solid #ddc98e;
  border-radius: 999px;
  cursor: pointer;
  background: #fffaf0;
  font-size: .7rem;
  font-weight: 800;
}

.current-button[aria-pressed="true"] { color: #674707; background: #f4dfae; }
.current-button__empty { font-size: 1.1rem; line-height: 1; }

.mini-button, .icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  color: #56645e;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  background: #fff;
}
.mini-button:hover, .icon-button:hover { color: var(--forest-800); border-color: #b8c7c0; }
.mini-button:disabled { cursor: default; opacity: .3; }
.icon-button { border: 0; background: transparent; font-size: 1.5rem; }

.empty-state--compact { padding: 55px 20px 65px; }
.editor-placeholder { min-height: 430px; padding-top: 140px; }
.editor-panel form { padding-bottom: 20px; }
.editor-panel form > label, .editor-panel form > input, .editor-panel form > textarea, .editor-panel form > .form-error { width: calc(100% - 40px); margin-inline: 20px; }
.editor-panel form > input, .editor-panel form > textarea { display: block; }

.editor-panel form > .checkbox-row {
  display: flex;
  margin-top: 15px;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.checkbox-row input { width: 18px !important; height: 18px; margin: 0; accent-color: var(--forest-700); }

.editor-actions {
  display: flex;
  padding: 20px 20px 0;
  align-items: center;
  gap: 9px;
}
.spacer { flex: 1; }

.toast {
  position: fixed;
  z-index: 20;
  top: 88px;
  left: 50%;
  padding: 11px 17px;
  color: #fff;
  border-radius: 999px;
  background: var(--forest-700);
  box-shadow: 0 8px 25px rgb(0 0 0 / 17%);
  font-size: .84rem;
  font-weight: 700;
  transform: translateX(-50%);
}
.toast[data-kind="error"] { background: var(--danger); }

.confirm-dialog {
  width: min(430px, calc(100% - 36px));
  padding: 0;
  border: 0;
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 25px 80px rgb(0 0 0 / 27%);
}
.confirm-dialog::backdrop { background: rgb(7 26 21 / 65%); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 32px; text-align: center; }
.confirm-dialog__icon {
  display: grid;
  width: 47px;
  height: 47px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--danger);
  border-radius: 50%;
  background: #f8dfdf;
  font-size: 1.25rem;
  font-weight: 800;
}
.confirm-dialog h2 { margin-bottom: 8px; font-family: Georgia, serif; }
.confirm-dialog p { color: var(--muted); line-height: 1.55; }
.confirm-dialog__actions { display: flex; justify-content: center; gap: 9px; margin-top: 24px; }

@media (max-width: 849px) {
  .admin-grid { grid-template-columns: 1fr; }
  .editor-panel { scroll-margin-top: 15px; }
  .editor-placeholder { min-height: 200px; padding-top: 55px; }
}

@media (max-width: 600px) {
  .page { width: min(100% - 28px, 1120px); }
  .hero { min-height: 285px; }
  .hero__content { padding-block: 48px 56px; }
  .audience-main { padding-top: 32px; }
  .nashid-card summary { min-height: 74px; padding: 13px; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
  .nashid-card__number { width: 38px; height: 38px; }
  .nashid-card__prompt > span:first-child { display: none; }
  .nashid-card__body { padding: 0 13px 13px; }
  .lyrics { padding: 22px 18px; }
  .current-toast { bottom: 12px; grid-template-columns: 40px minmax(0, 1fr); }
  .current-toast__action { display: none; }
  .login-card { padding: 32px 24px; }
  .admin-header__actions .button:first-child { display: none; }
  .admin-main { padding-block: 30px 50px; }
  .admin-titlebar { align-items: flex-start; flex-direction: column; }
  .admin-titlebar .button { width: 100%; }
  .admin-list__item { grid-template-columns: 22px 28px minmax(0, 1fr) auto; padding-inline: 2px 4px; }
  .current-button { width: 31px; min-width: 31px; padding: 0; }
  .current-button span:last-child:not(:first-child) { display: none; }
  .editor-actions { flex-wrap: wrap; }
  .editor-actions .spacer { display: none; }
  .editor-actions .button { flex: 1; }
  .editor-actions .button--danger { flex-basis: 100%; order: 2; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
