/* Кнопки, карточки, поля ввода, окна. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 15.5px;
  transition: transform .12s, background .2s;
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: var(--gold); color: #251a02; }
.btn-ghost { background: var(--night-3); color: var(--text); }
.btn-danger { background: #3b2238; color: var(--danger); }
.btn-wide { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--night-2); border: 1px solid var(--line); color: var(--text);
  transition: transform .12s, background .2s;
}
.icon-btn:active { transform: scale(0.92); background: var(--night-3); }
.icon-btn.gold { background: var(--gold); color: #251a02; border-color: transparent; }
.icon-btn.on { background: var(--gold-soft); color: var(--gold); border-color: rgba(246, 196, 83, .4); }

/* ---------- Главная: карточка ближайшего служения ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 22px 20px 20px; border-radius: var(--r-lg);
  background: #1b1e44;
  border: 1px solid var(--line-2);
  isolation: isolate;
}
/* Витраж: несколько конических градиентов, наложенных стёклышками. */
.hero::before {
  content: ''; position: absolute; inset: -40%; z-index: -1; opacity: .55;
  background:
    conic-gradient(from 210deg at 78% 18%, #8c7cf0 0 18%, transparent 18% 34%, #f0789b 34% 46%, transparent 46%),
    conic-gradient(from 20deg at 92% 70%, transparent 0 40%, #4fd1c0 40% 52%, transparent 52% 70%, #f6c453 70% 78%, transparent 78%);
  filter: blur(34px) saturate(1.2);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 30%, rgba(21, 24, 51, .65));
}
@keyframes drift { to { transform: rotate(8deg) scale(1.08); } }

.hero-when { font-weight: 700; color: var(--gold); font-size: 15px; }
.hero-date {
  font-family: var(--display); font-weight: 800;
  font-size: 46px; line-height: 1; letter-spacing: -0.02em; margin: 8px 0 4px;
}
.hero-sub { color: var(--text-2); font-weight: 600; }
.hero-songs { margin: 18px 0 16px; padding: 0; list-style: none; counter-reset: s; }
.hero-songs li {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 0;
  border-top: 1px solid var(--line); counter-increment: s;
}
.hero-songs li::before { content: counter(s); color: var(--text-3); font-weight: 700; width: 16px; }
.hero-songs .t { flex: 1; font-weight: 600; }
.me-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: var(--gold-soft); color: var(--gold);
}

/* ---------- Списки ---------- */

.list { border-radius: var(--r-md); background: var(--night-2); border: 1px solid var(--line); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; min-height: 64px;
  transition: background .15s;
}
.item + .item { border-top: 1px solid var(--line); }
.item:active { background: var(--night-3); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.key {
  flex: none; min-width: 42px; height: 30px; padding: 0 8px;
  display: inline-grid; place-items: center; border-radius: 9px;
  font-weight: 800; font-size: 14px; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(246, 196, 83, .25);
}

.date-tile {
  flex: none; width: 52px; height: 56px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--night-3); line-height: 1.05;
}
.date-tile b { font-family: var(--display); font-size: 20px; }
.date-tile span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.date-tile.next { background: var(--gold); color: #251a02; }
.date-tile.next span { color: #4d3a08; }

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #1a1530;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--night-2); border: 1px solid var(--line-2); color: var(--text-2);
}
.chip.on { background: var(--gold-soft); color: var(--gold); border-color: rgba(246, 196, 83, .45); }
.tag { font-size: 12.5px; font-weight: 600; color: var(--text-3); }

.empty {
  text-align: center; padding: 34px 20px; border-radius: var(--r-md);
  border: 1.5px dashed var(--line-2); color: var(--text-2);
}
.empty p { margin: 0 0 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: var(--r-md); background: var(--night-2); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 24px; }
.stat span { display: block; font-size: 13px; line-height: 1.3; color: var(--text-2); }

/* ---------- Поиск и формы ---------- */

.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; border-radius: 999px;
  background: var(--night-2); border: 1px solid var(--line); color: var(--text-3);
}
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 700; color: var(--text-2); margin: 0 0 7px 4px; }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--night-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 12px 14px; outline: 0; transition: border-color .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; min-height: 320px; white-space: pre; }
.hint { font-size: 13px; color: var(--text-3); margin: 6px 4px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.savebar {
  position: sticky; bottom: calc(var(--safe-b) + 12px); z-index: 5;
  display: flex; gap: 10px; margin-top: 24px;
}
.savebar .btn { flex: 1; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* ---------- Нижние окна ---------- */

.sheet-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(8, 9, 22, 0); transition: background .25s;
}
.sheet-wrap.open { background: rgba(8, 9, 22, .6); }
.sheet {
  width: 100%; max-width: 560px; max-height: 82dvh; overflow-y: auto;
  padding: 8px 18px calc(var(--safe-b) + 18px);
  background: var(--night-2); border-radius: 26px 26px 0 0; border: 1px solid var(--line-2);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; }
.sheet-title { font-family: var(--display); font-size: 18px; margin-bottom: 12px; }
.sheet-text { font-size: 17px; margin: 6px 0 20px; }

.pick-list { display: grid; gap: 6px; }
.pick {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-radius: 14px; text-align: left; font-weight: 600;
  background: var(--night-3);
}
.pick small { color: var(--text-3); font-weight: 600; }
.pick.on { background: var(--gold-soft); color: var(--gold); }
.key-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.key-grid .pick { justify-content: center; padding: 12px 0; }

.toast {
  position: fixed; left: 50%; z-index: 60; bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px); opacity: 0; transition: .25s;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: var(--text); color: var(--night); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-err { background: var(--danger); color: #fff; }
