:root {
  --bg: #f4efe7;
  --panel: rgba(255, 250, 242, 0.86);
  --text: #1f1b18;
  --muted: #6a5f56;
  --line: rgba(56, 42, 31, 0.14);
  --brand: #a33d2e;
  --brand-strong: #7d2d22;
  --gold: #d6a348;
  --shadow: 0 24px 60px rgba(76, 49, 23, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 163, 72, 0.28), transparent 34%),
    radial-gradient(circle at right 20%, rgba(163, 61, 46, 0.18), transparent 28%),
    linear-gradient(145deg, var(--bg), #fbf7f1);
}

body.admin-open {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -12vw;
  right: -8vw;
  background: rgba(214, 163, 72, 0.12);
}

body::after {
  bottom: -12vw;
  left: -10vw;
  background: rgba(163, 61, 46, 0.1);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 88px 72px 20px;
}

.admin-trigger {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(56, 42, 31, 0.12);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.25rem;
}

.admin-trigger:hover {
  transform: translateY(-1px);
}

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(27, 17, 11, 0.36);
  backdrop-filter: blur(6px);
}

.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(460px, 100%);
  height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.98), rgba(244, 236, 225, 0.98));
  border-left: 1px solid rgba(56, 42, 31, 0.12);
  box-shadow: -24px 0 60px rgba(55, 36, 21, 0.18);
  transform: translateX(100%);
  transition: transform 220ms ease;
  overflow-y: auto;
}

.admin-panel.is-open {
  transform: translateX(0);
}

.admin-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-panel__header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.admin-close,
.admin-primary,
.admin-secondary {
  border: none;
  border-radius: 16px;
}

.admin-close {
  width: 42px;
  height: 42px;
  background: rgba(31, 27, 24, 0.08);
  cursor: pointer;
}

.admin-login,
.admin-form {
  display: grid;
  gap: 16px;
}

.admin-login label,
.admin-form label {
  display: grid;
  gap: 8px;
}

.admin-login span,
.admin-form span {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-login input,
.admin-form input {
  width: 100%;
  border: 1px solid rgba(56, 42, 31, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
}

.admin-form__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.admin-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-primary,
.admin-secondary {
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

.admin-primary {
  background: var(--brand);
  color: #fff7ef;
}

.admin-secondary {
  background: rgba(31, 27, 24, 0.08);
  color: var(--text);
}

.admin-danger {
  background: rgba(163, 61, 46, 0.12);
  color: var(--brand-strong);
}

.admin-hint,
.admin-feedback {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-feedback {
  min-height: 24px;
}

.admin-request-banner {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(163, 61, 46, 0.1);
  border: 1px solid rgba(163, 61, 46, 0.22);
}

.admin-request-banner__label {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--brand-strong);
}

.admin-request-banner__content {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.admin-feedback.is-error {
  color: var(--brand-strong);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.admin-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(56, 42, 31, 0.1);
}

.admin-stat span,
.admin-stat strong {
  display: block;
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.admin-subtitle {
  margin: 20px 0 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-favorite-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(56, 42, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  margin-bottom: 10px;
}

.admin-favorite-item__info strong,
.admin-favorite-item__info span {
  display: block;
}

.admin-favorite-item__info span {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-favorite-item__actions {
  display: flex;
  gap: 8px;
}

.admin-requests {
  margin-top: 14px;
  border: 1px solid rgba(56, 42, 31, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.admin-requests summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
}

.admin-requests summary::-webkit-details-marker {
  display: none;
}

.admin-requests__list {
  padding: 8px 14px 14px;
}

.admin-request-item {
  border-top: 1px solid rgba(56, 42, 31, 0.12);
  padding: 10px 0;
}

.admin-request-item:first-child {
  border-top: none;
}

.admin-request-item__title {
  margin: 0;
  font-weight: 600;
}

.admin-request-item__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero__copy,
.hero__panel,
.controls,
.section-block,
.sheet-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero__copy {
  padding: 32px;
  border-radius: var(--radius-lg);
  position: relative;
  width: 100%;
}

.hero__panel {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(163, 61, 46, 0.9), rgba(125, 45, 34, 0.92));
  color: #fff8f1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: auto;
  width: min(360px, 100%);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  align-self: center;
  margin-inline: auto;
}

.hero__panel:hover {
  transform: translateY(-1px);
}

.sheet-card__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.request-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(163, 61, 46, 0.25);
  background: rgba(163, 61, 46, 0.07);
  color: rgba(163, 61, 46, 0.75);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.request-icon-btn:hover {
  background: rgba(163, 61, 46, 0.15);
  color: rgb(163, 61, 46);
}

.request-icon-btn__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.hero__panel:disabled {
  cursor: progress;
  opacity: 0.84;
}

.eyebrow,
.section-heading__eyebrow,
.hero__panel-label {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: var(--gold);
}

.hero h1,
.section-heading h2,
.sheet-card__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.98;
  max-width: 12ch;
}

.hero__lead {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero__panel-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 1.45vw, 1.35rem);
  line-height: 1.2;
  white-space: pre-line;
  max-width: none;
}

.hero__panel-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 238, 215, 0.85);
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(56, 42, 31, 0.2);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.95);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 18;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.request-dialog {
  display: grid;
  gap: 12px;
}

.request-switches {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.request-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 42, 31, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.request-switch--master {
  background: rgba(163, 61, 46, 0.08);
  border-color: rgba(163, 61, 46, 0.26);
}

.request-switch input {
  width: 16px;
  height: 16px;
}

.request-notes {
  display: grid;
  gap: 8px;
}

.request-notes span {
  color: var(--muted);
  font-size: 0.9rem;
}

.request-notes textarea {
  width: 100%;
  border: 1px solid rgba(56, 42, 31, 0.15);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 84px;
}

.hero__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.metric-pill {
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.75);
  border: 1px solid rgba(56, 42, 31, 0.12);
}

.metric-pill strong,
.metric-pill span {
  display: block;
}

.metric-pill strong {
  font-size: 1.25rem;
}

.metric-pill span {
  color: var(--muted);
  font-size: 0.85rem;
}

.controls,
.section-block {
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.search-box {
  display: block;
  margin-bottom: 18px;
}

.search-box span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 1px solid rgba(56, 42, 31, 0.15);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--text);
  font-size: 1rem;
}

.search-box input:focus {
  outline: 2px solid rgba(163, 61, 46, 0.18);
  border-color: rgba(163, 61, 46, 0.36);
}

.alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.alphabet__button,
.favorite-button,
.media-link {
  border: none;
  border-radius: 999px;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.alphabet__button {
  padding: 10px 14px;
  background: rgba(255, 250, 242, 0.85);
  border: 1px solid rgba(56, 42, 31, 0.12);
  cursor: pointer;
}

.alphabet__button:hover,
.alphabet__button.is-active {
  transform: translateY(-1px);
  background: rgba(163, 61, 46, 0.1);
  border-color: rgba(163, 61, 46, 0.3);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.featured-grid,
.catalog-grid {
  display: grid;
  gap: 18px;
}

.featured-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sheet-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(247, 239, 229, 0.92));
  animation: rise-in 280ms ease;
}

.sheet-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-card__number {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(31, 27, 24, 0.06);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(163, 61, 46, 0.12);
  color: var(--brand-strong);
  cursor: pointer;
}

.favorite-button:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  background: rgba(163, 61, 46, 0.18);
}

.favorite-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.favorite-button__icon {
  font-size: 1rem;
}

.sheet-card__title {
  font-size: 1.7rem;
  line-height: 1.08;
}

.sheet-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.sheet-card__meta dt {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sheet-card__meta dd {
  margin: 0;
  line-height: 1.45;
}

.sheet-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  justify-content: center;
}

.media-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  border-radius: 10px;
  background: rgba(31, 27, 24, 0.06);
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(56, 42, 31, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.media-link:hover {
  transform: translateY(-1px);
  border-color: rgba(163, 61, 46, 0.3);
}

.media-link svg {
  width: 22px;
  height: 22px;
  display: block;
}

.media-link--youtube {
  background: rgba(255, 0, 51, 0.12);
  border-color: rgba(255, 0, 51, 0.35);
}

.media-link--spotify {
  background: rgba(29, 185, 84, 0.14);
  border-color: rgba(29, 185, 84, 0.34);
}

.media-link--drive {
  background: rgba(66, 133, 244, 0.1);
  border-color: rgba(66, 133, 244, 0.32);
}

.media-link--info {
  background: rgba(163, 61, 46, 0.1);
  border-color: rgba(163, 61, 46, 0.3);
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.media-link--info:hover {
  background: rgba(163, 61, 46, 0.18);
}

/* Presentation dialog */
.presentation-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: min(560px, 92vw);
  width: 100%;
  box-shadow: 0 24px 60px rgba(27, 17, 11, 0.28);
  background: var(--bg);
}

.presentation-dialog::backdrop {
  background: rgba(27, 17, 11, 0.45);
  backdrop-filter: blur(4px);
}

.presentation-dialog__inner {
  padding: 28px 32px;
  position: relative;
}

.presentation-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.presentation-dialog__close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.presentation-dialog__title {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  color: var(--text);
  padding-right: 32px;
}

.presentation-dialog__body {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-line;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .request-switches {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 80px 60px 14px;
  }

  .hero__copy,
  .hero__panel,
  .controls,
  .section-block {
    padding: 20px;
  }

  .sheet-card__meta,
  .admin-form__split,
  .admin-stats,
  .admin-favorite-item {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }
}
