/* ================= WebDuet ================= */
:root {
  --bg: #000;
  --bg2: #0b0b0b;
  --card: #111;
  --card2: #1c1c1c;
  --line: rgba(255, 255, 255, .1);
  --line2: rgba(255, 255, 255, .22);
  --text: #fff;
  --muted: #8c8c8c;
  --accent: #fff;
  --on-accent: #000;
  --accent-soft: rgba(255, 255, 255, .08);
  --danger: #ff5a5a;
  --shadow: 0 10px 40px rgba(0, 0, 0, .7);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --kb: 0px;
  color-scheme: dark;
}

/* ---------- фиксированный экран: без зума, без «резинки», без выделения ---------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: none;
}

body {
  position: fixed;
  inset: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .35;
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.hidden {
  visibility: hidden;
}

.scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.ic {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ic.rot {
  animation: spin 1.2s linear infinite;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.center {
  text-align: center;
}

.pad {
  padding: 14px 4px;
}

/* ---------- каркас ---------- */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity .2s;
}

.ready #app {
  opacity: 1;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 10px calc(var(--safe-l) + 16px);
  min-height: calc(var(--safe-t) + 62px);
  background: var(--bg);
  touch-action: none;
}

.top-titles {
  flex: 1;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#view {
  flex: 1;
  padding: 0 max(16px, calc((100% - 760px) / 2)) 28px;
  padding-left: max(calc(var(--safe-l) + 16px), calc((100% - 760px) / 2));
  padding-right: max(calc(var(--safe-r) + 16px), calc((100% - 760px) / 2));
}

.tabbar {
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  padding: 4px var(--safe-r) calc(var(--safe-b) + 2px) var(--safe-l);
  touch-action: none;
}

.tab {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s;
}

.tab.on {
  color: var(--accent);
}

.tab .ic {
  width: 25px;
  height: 25px;
}

.tab-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  line-height: 18px;
}

/* ---------- кнопки ---------- */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}

.icon-btn:active {
  background: var(--card2);
  transform: scale(.94);
}

.icon-btn.sm {
  width: 36px;
  height: 36px;
}

.icon-btn.sm .ic {
  width: 20px;
  height: 20px;
}

.icon-btn.lg .ic {
  width: 30px;
  height: 30px;
}

.icon-btn.accent {
  background: var(--accent);
  color: var(--on-accent);
  width: 40px;
  height: 40px;
  margin-left: 4px;
}

.icon-btn.danger {
  color: var(--danger);
}

.icon-btn.video-btn {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--card2);
  font-weight: 650;
  font-size: 16px;
  transition: transform .1s, filter .15s;
}

.btn:active {
  transform: scale(.97);
  filter: brightness(1.15);
}

.btn .ic {
  width: 21px;
  height: 21px;
}

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn.danger {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
}

.btn.danger-text {
  color: var(--danger);
}

.btn.block {
  display: flex;
  width: 100%;
  margin-top: 10px;
}

.btn.grow {
  flex: 1;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.btn-row.wrap-row {
  margin-top: 22px;
}

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.btn-grid .btn {
  font-size: 15px;
  padding: 0 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--card2);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.pill-btn .ic {
  width: 18px;
  height: 18px;
}

.pill-btn.on,
.pill-btn.accent {
  background: var(--accent);
  color: var(--on-accent);
}

.link {
  color: var(--text);
  font-size: 16px;
  padding: 10px 4px;
  min-width: 64px;
  text-align: left;
}

.link.strong {
  font-weight: 800;
  text-align: right;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.sync .ic {
  width: 20px;
  height: 20px;
}

.sync.ok {
  color: var(--muted);
}

.sync.off {
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
}

.sync.busy {
  color: var(--text);
}

.sync.err {
  color: var(--danger);
}

/* ---------- поиск, фильтры ---------- */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 4px 0 12px;
  margin: 2px 0 10px;
  background: var(--card);
  border-radius: 14px;
  color: var(--muted);
}

.searchbar .ic {
  width: 20px;
  height: 20px;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.searchbar input::-webkit-search-cancel-button {
  display: none;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* ---------- строки песен ---------- */
.rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 6px 2px 6px 4px;
  border-radius: 14px;
  transition: background .15s;
}

.row:active {
  background: var(--card);
}

.row.is-cur {
  background: var(--accent-soft);
}

.row.is-cur .row-title {
  color: var(--text);
}

.row-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row-play .ic {
  width: 20px;
  height: 20px;
}

.row.is-cur .row-play {
  background: var(--accent);
  color: var(--on-accent);
}

.row-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.row-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.row-off {
  color: var(--muted);
  display: flex;
}

.row-off .ic {
  width: 18px;
  height: 18px;
}

.num {
  display: inline-block;
  min-width: 22px;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 10px;
  vertical-align: 1px;
}

.badge.wip {
  color: var(--muted);
}

.order-btns {
  display: flex;
}

.row.pick {
  cursor: pointer;
  padding-left: 8px;
}

.pick-box,
.check-box {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.row.pick.on .pick-box,
.row.pick.on .check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.check-box .ic {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.pk-count {
  font-size: 13px;
  padding: 0 4px 6px;
}

/* ---------- пустые состояния, подсказки ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
}

.empty-ic {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.empty-ic .ic {
  width: 34px;
  height: 34px;
}

.empty-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-text {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 18px;
  max-width: 320px;
  margin-inline: auto;
}

.hint {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin: 2px 0 12px;
  border-radius: 14px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 14px;
}

.hint .ic {
  color: var(--text);
  width: 22px;
  height: 22px;
}

/* ---------- списки ---------- */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.list-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 128px;
  padding: 14px;
  border-radius: 20px;
  background: var(--card);
  text-align: left;
  transition: transform .1s;
}

.list-card:active {
  transform: scale(.97);
}

.list-card.add {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px dashed var(--line2);
  background: transparent;
}

.lc-emoji {
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: auto;
}

.lc-emoji.sm {
  font-size: 26px;
  width: 34px;
  text-align: center;
  margin: 0;
}

.lc-name {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
}

.lc-count {
  font-size: 13px;
  color: var(--muted);
}

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}

.hero-emoji {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--card);
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.emoji {
  height: 48px;
  border-radius: 12px;
  font-size: 26px;
  background: var(--card2);
}

.emoji.on {
  outline: 2px solid var(--accent);
}

/* ---------- календарь ---------- */
.cal {
  background: var(--card);
  border-radius: 20px;
  padding: 8px 8px 10px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 12px;
}

.cal-wd,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-wd span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0 6px;
}

.day {
  position: relative;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.day span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day.we {
  color: var(--muted);
}

.day.out {
  opacity: .32;
}

.day.today span {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.day.has span {
  background: var(--card2);
}

.day.sel span {
  background: var(--accent);
  color: var(--on-accent);
}

.dots {
  position: absolute;
  bottom: 1px;
  display: flex;
  gap: 3px;
}

.dots b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.section {
  margin-top: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}

.section .section-head {
  margin-top: 0;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ev-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 18px;
  background: var(--card);
  text-align: left;
  transition: transform .1s;
}

.ev-card:active {
  transform: scale(.98);
}

.ev-card.past {
  opacity: .6;
}

.ev-date {
  width: 52px;
  height: 56px;
  border-radius: 14px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ev-date b {
  font-size: 22px;
  line-height: 1;
}

.ev-date span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.ev-main {
  flex: 1;
  min-width: 0;
}

.ev-title {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.ev-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-meta .ic {
  width: 15px;
  height: 15px;
}

.ev-chev {
  color: var(--muted);
  width: 20px;
  height: 20px;
}

.ev-hero {
  text-align: center;
  padding: 4px 0 14px;
}

.ev-hero h2 {
  margin: 6px 0 14px;
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1.2;
}

.ev-hero-date {
  color: var(--muted);
  font-weight: 600;
}

.ev-hero-date::first-letter {
  text-transform: uppercase;
}

.time-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.time-chip {
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--card2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-chip span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.time-chip b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.time-chip.main {
  background: var(--accent);
  color: var(--on-accent);
}

.time-chip.main span {
  color: inherit;
  opacity: .6;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
}

.info-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}

.info-ic .ic {
  width: 21px;
  height: 21px;
}

.info-body {
  flex: 1;
  min-width: 0;
}

.info-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.info-val {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}

.map-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.map-links .chip {
  height: 32px;
  font-size: 13px;
}

/* ---------- формы ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.f-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.f-label .ic {
  width: 17px;
  height: 17px;
}

.field input,
.field textarea,
.login input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  /* меньше 16px — iPhone начнёт приближать поле */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field textarea:focus,
.login input:focus {
  border-color: var(--line2);
  background: var(--card);
}

.field textarea {
  resize: none;
  line-height: 1.4;
}

.field input[type="date"],
.field input[type="time"] {
  display: block;
  text-align: left;
}

.field input::-webkit-date-and-time-value {
  text-align: left;
}

.field-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

.seg {
  display: flex;
  padding: 4px;
  border-radius: 14px;
  background: var(--card2);
}

.seg button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border-radius: 11px;
  font-weight: 650;
  font-size: 15px;
  color: var(--muted);
}

.seg button .ic {
  width: 18px;
  height: 18px;
}

.seg button.on {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.nums {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.num-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  background: var(--card2);
}

.num-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-item {
  padding: 12px;
  border-radius: 16px;
  background: var(--card2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.up-item .field input {
  background: var(--card);
}

.up-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.up-file {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.up-file .ic {
  width: 16px;
  height: 16px;
  color: var(--text);
}

.up-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--card2);
  overflow: hidden;
  margin: 10px 0 6px;
}

.up-item .up-progress {
  background: var(--card);
  margin: 0;
}

.up-progress.big {
  height: 10px;
  border-radius: 5px;
}

.up-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s;
}

.up-state {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.up-state .ic {
  width: 16px;
  height: 16px;
}

.up-item.ok .up-state {
  color: var(--text);
}

.up-item.err .up-state {
  color: var(--danger);
}

/* ---------- шторки ---------- */
#sheets {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.sheet-wrap {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  opacity: 0;
  transition: opacity .25s;
  touch-action: none;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--kb);
  margin: 0 auto;
  max-width: 640px;
  max-height: calc(var(--vvh, 100dvh) - var(--safe-t) - 12px);
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1);
}

.sheet.tall {
  height: calc(var(--vvh, 100dvh) - var(--safe-t) - 12px);
}

.sheet-wrap.open .sheet-backdrop {
  opacity: 1;
}

.sheet-wrap.open .sheet {
  transform: none;
}

.sheet-grip {
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.sheet-grip i {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--muted);
  opacity: .45;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 calc(var(--safe-r) + 16px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 16px);
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 -16px 8px;
  padding: 0 16px 6px;
  background: var(--bg2);
}

.sheet-head h3 {
  margin: 0;
  font-size: 17px;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-head>span {
  min-width: 64px;
}

.menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.menu-head>div:last-child {
  min-width: 0;
}

.menu-head .row-sub {
  white-space: normal;
}

.menu-art {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-art.emoji-art {
  background: var(--card2);
  font-size: 30px;
}

.menu {
  display: flex;
  flex-direction: column;
}

.menu button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 17px;
  text-align: left;
}

.menu button:active {
  background: var(--card2);
}

.menu button .ic {
  color: var(--muted);
}

.menu button.danger,
.menu button.danger .ic {
  color: var(--danger);
}

.confirm {
  padding: 8px 0 4px;
  text-align: center;
}

.confirm p {
  font-size: 17px;
  margin: 6px 0 14px;
}

/* ---------- отправка / видео ---------- */
.share {
  text-align: center;
  padding: 6px 0;
}

.share-ic {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  margin: 4px auto 12px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-ic .ic {
  width: 38px;
  height: 38px;
}

.share-title {
  font-size: 20px;
  font-weight: 800;
}

.share-state {
  font-size: 14px;
  min-height: 20px;
}

.share-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 0;
}

.video-box {
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 9 / 12;
  max-height: 58vh;
  width: 100%;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.video-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}

.vid-title {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  margin-top: 12px;
}

/* ---------- мини-плеер ---------- */
.mini {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 6px;
  padding: 6px 6px 6px 8px;
  margin-left: calc(var(--safe-l) + 8px);
  margin-right: calc(var(--safe-r) + 8px);
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
}

.mini-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
}

.mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.mini-art {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-art .ic {
  width: 22px;
  height: 22px;
}

.mini-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- большой плеер ---------- */
.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}

.pl-art {
  width: min(68vw, 300px, 36vh);
  aspect-ratio: 1;
  border-radius: 28px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.pl-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
  margin-top: 22px;
  line-height: 1.2;
}

.pl-sub {
  color: var(--muted);
  text-align: center;
  min-height: 20px;
  margin-top: 4px;
}

.slider {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
  margin-top: 16px;
}

.sl-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--line2);
  transition: height .15s;
}

.slider.drag .sl-track {
  height: 10px;
  border-radius: 5px;
}

.sl-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: var(--accent);
  width: 0;
}

.sl-thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  left: 0;
  transition: transform .15s;
}

.slider.drag .sl-thumb {
  transform: scale(1.35);
}

.pl-times {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: -4px;
}

.pl-ctrls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 6px;
}

.icon-btn.skip {
  position: relative;
}

.icon-btn.skip small {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -38%);
}

.pl-play {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px;
  transition: transform .1s;
}

.pl-play:active {
  transform: scale(.94);
}

.pl-play .ic {
  width: 34px;
  height: 34px;
}

.pl-extra {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.pl-queue-wrap {
  width: 100%;
  margin-top: 10px;
}

.pl-queue-wrap .section-title {
  margin: 6px 4px 6px;
}

.row.q {
  min-height: 52px;
  padding-left: 10px;
  cursor: pointer;
}

/* ---------- настройки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card-title .ic {
  color: var(--text);
  width: 21px;
  height: 21px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 17px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 15px;
}

.stat-row span {
  color: var(--muted);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 2px;
  font-size: 15px;
  cursor: pointer;
}

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

.toggle i {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: var(--card2);
  flex-shrink: 0;
  transition: background .2s;
}

.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}

.toggle input:checked+i {
  background: var(--accent);
}

.toggle input:checked+i::after {
  background: #000;
}

.toggle input:checked+i::after {
  transform: translateX(20px);
}

.kbd {
  display: inline-block;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--card2);
}

.big-ic {
  width: 64px;
  height: 64px;
  margin: 6px auto 0;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form.center h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.form.center p {
  margin: 0;
}

/* ---------- вход ---------- */
.login {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 20px) 24px calc(var(--safe-b) + 20px);
}

.login-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo {
  width: min(80vw, 300px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.login p.muted {
  letter-spacing: .04em;
}

.login form {
  margin: 26px 0 16px;
}

.login input {
  text-align: center;
}

.login-err {
  color: var(--danger);
  min-height: 22px;
  margin-top: 10px;
  font-size: 15px;
}

/* ---------- уведомления ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 10px);
  z-index: 100;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 16px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translate(-50%, -140%);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1);
  pointer-events: none;
}

#toast.show {
  transform: translate(-50%, 0);
}

#toast.err {
  background: #000;
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--danger), var(--shadow);
}

.spin {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  opacity: .8;
  vertical-align: middle;
}

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

/* горизонтальный телефон: меньше высоты, компактнее шапка */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar {
    min-height: auto;
    padding-top: calc(var(--safe-t) + 6px);
    padding-bottom: 6px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .pl-art {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* логотип в плеере и меню */
.art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================= v1.1: мягкая чёрно-белая палитра, контуры вместо заливки ================= */
:root {
  --bg: #0d0d0f;
  --bg2: #141417;
  --card: #18181c;
  --card2: #232328;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .2);
  --text: #ececee;
  --muted: #8e8e96;
  --accent: #e4e4e7;
  --on-accent: #0d0d0f;
  --accent-soft: rgba(255, 255, 255, .06);
}

html,
body {
  background: var(--bg);
}

.topbar {
  background: var(--bg);
}

/* кнопки — светлый контур, лёгкая подсветка */
.btn.primary {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75);
}

.icon-btn.accent {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75);
}

.pill-btn {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line2);
}

.pill-btn.on,
.pill-btn.accent {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7);
}

.btn {
  background: var(--card2);
}

.chip {
  background: transparent;
  border-color: var(--line2);
  color: var(--muted);
}

.chip.on {
  background: var(--accent-soft);
  border-color: rgba(255, 255, 255, .8);
  color: var(--text);
}

.chip.add {
  border-style: dashed;
  color: var(--text);
  gap: 4px;
}

.chip.add .ic {
  width: 16px;
  height: 16px;
}

/* песни */
.row-play {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line2);
}

.row.is-cur {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.row.is-cur .row-play {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .85);
}

.row-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text);
  opacity: .85;
}

.row-note .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.row-note span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-badge {
  background: var(--card2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line2);
}

/* открытый список на странице «Песни» */
.list-bar {
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--card);
}

.lb-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-emoji {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--card2);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lb-text {
  flex: 1;
  min-width: 0;
}

.lb-title {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-bar .btn-row {
  margin: 12px 0 0;
}

.list-bar .btn.block {
  margin-top: 12px;
}

/* календарь */
.day.today span {
  box-shadow: inset 0 0 0 1px var(--line2);
  font-weight: 800;
}

.day.has span {
  background: var(--card2);
}

.day.sel span {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .85);
  font-weight: 800;
}

.dots b {
  background: var(--muted);
}

.day.sel .dots b {
  background: var(--text);
}

.time-chip.main {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7);
}

.time-chip.main span {
  color: var(--muted);
  opacity: 1;
}

.num-card {
  border-radius: 14px;
  background: var(--card2);
  padding: 4px 4px 8px;
}

.num-card .num-row {
  background: transparent;
}

.costume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 8px 0 12px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
}

.costume .ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.costume input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

/* плеер */
.pl-play {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
}

.mini {
  background: var(--card);
}

/* уведомления и прочее */
#toast {
  background: var(--card2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line2), var(--shadow);
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line2);
  white-space: nowrap;
}

.offline-pill .ic {
  width: 16px;
  height: 16px;
}

.link-box {
  margin: 14px 0 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  font-size: 14px;
  word-break: break-all;
  -webkit-user-select: text;
  user-select: text;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-box.err {
  color: var(--danger);
}

/* поле-кнопка для выпадающих окон */
.picker {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  text-align: left;
}

.picker span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker .ph {
  color: var(--muted);
}

.picker .ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform .15s;
}

.picker.open {
  border-color: var(--line2);
}

.picker.open .ic {
  transform: rotate(180deg);
}

/* выпадающие окна (время, дата, список) */
.pop-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .18s;
  touch-action: none;
}

.pop-wrap.anchored {
  display: block;
  background: transparent;
  padding: 0;
}

.pop-wrap.open {
  opacity: 1;
}

.pop {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  width: 300px;
  max-width: 100%;
  transform: scale(.96);
  transition: transform .18s;
}

.pop-wrap.open .pop {
  transform: none;
}

.pop.sel {
  position: fixed;
  width: auto;
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
  touch-action: pan-y;
}

.opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
}

.opt:active {
  background: var(--card2);
}

.opt.on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.tp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: center;
  margin-bottom: 6px;
}

.tp-list {
  position: relative;
  height: 220px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  border-radius: 12px;
  background: var(--bg2);
  scrollbar-width: none;
}

.tp-list::-webkit-scrollbar {
  display: none;
}

.tp-list button {
  flex-shrink: 0;
  height: 42px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.tp-list button.on {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8);
}

.pop-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pop-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7);
  background: var(--accent-soft);
}

.pop-btn.ghost {
  box-shadow: inset 0 0 0 1px var(--line2);
  background: transparent;
  color: var(--muted);
}

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dp-nav span {
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 14px;
}

.dp-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-nav .ic {
  width: 20px;
  height: 20px;
}

.dp-wd,
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-wd span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}

.dp-days button {
  height: 38px;
  border-radius: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dp-days button.today {
  box-shadow: inset 0 0 0 1px var(--line2);
}

.dp-days button.on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .85);
  font-weight: 800;
}


.badge.ver {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
}

.badge.ver .ic {
  width: 11px;
  height: 11px;
}

.row.is-open {
  background: var(--accent-soft);
  border-radius: 14px 14px 0 0;
}

.versions {
  margin: 0 0 6px;
  padding: 4px 6px 8px 22px;
  border-radius: 0 0 14px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--line2);
}

.ver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}

.ver-row:first-child {
  border-top: 0;
}

.row-play.sm {
  width: 36px;
  height: 36px;
}

.row-play.sm .ic {
  width: 16px;
  height: 16px;
}

.ver-row.is-cur .row-play {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .85);
}

.ver-main {
  flex: 1;
  min-width: 0;
}

.ver-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ver-row .pill-btn {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.ver-badge {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ver-badge .ic {
  width: 18px;
  height: 18px;
}

.ev-card .ev-date .ic {
  width: 24px;
  height: 24px;
}

.install-btn {
  margin: 0 0 12px;
}


.ed {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1);
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
}

.ed.open {
  transform: none;
}

.ed-top {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 4px;
}

.ed-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2px 6px;
  text-align: left;
}

.ed-title b {
  font-size: 16px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-title small {
  font-size: 11px;
  color: var(--muted);
}

.ed-top .pill-btn {
  margin-left: 4px;
}

.ed-transport {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.ed-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
  flex-shrink: 0;
}

.ed-play .ic {
  width: 22px;
  height: 22px;
}

.ed-time {
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ed-time b {
  font-size: 20px;
}

.ed-time span {
  color: var(--muted);
  font-size: 13px;
}

.ed-busy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ed-busy .spin {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.ed-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.ed-grid {
  display: flex;
}

.ed-heads {
  width: 54px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
}

.ed-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-top: 1px solid var(--line);
}

.ed-head.on {
  background: var(--accent-soft);
}

.ed-head-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  padding: 2px 4px;
  max-width: 54px;
}

.ed-head-name small {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ed-mute {
  width: 34px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ed-mute .ic {
  width: 17px;
  height: 17px;
}

.ed-mute.on {
  color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--line2);
}

.ed-canvas {
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
}

.btn.block.ed-addtrack {
  margin: 10px 12px 14px;
  width: calc(100% - 24px);
}

.ed-mini {
  display: block;
  width: calc(100% - 24px);
  height: 28px;
  margin: 6px 12px;
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
}

.ed-panel {
  border-top: 1px solid var(--line);
  background: var(--bg2);
  padding: 8px 0 calc(var(--safe-b) + 8px);
}

.ed-tools {
  display: flex;
  justify-content: center;
  padding: 0 12px 6px;
}

.ed-seg {
  display: flex;
  width: 100%;
  max-width: 420px;
  padding: 3px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ed-seg button {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}

.ed-seg button .ic {
  width: 17px;
  height: 17px;
}

.ed-seg button.on {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75);
}

.ed-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 12px 6px;
  min-height: 18px;
}

.ed-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 12px;
  scrollbar-width: none;
  touch-action: pan-x;
}

.ed-actions::-webkit-scrollbar {
  display: none;
}

.ed-act {
  flex: 1 0 68px;
  min-width: 68px;
  height: 62px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px;
  font-weight: 650;
}

.ed-act .ic {
  width: 22px;
  height: 22px;
}

.ed-act:active {
  background: var(--card2);
}

.ed-sub {
  margin: 0 12px 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line2);
}

.ed-sub-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.ed-sub-head b {
  font-size: 20px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ed-sub .slider {
  margin-top: 4px;
}

.ed-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.ed-presets .chip {
  height: 32px;
  font-size: 13px;
}

.ed-sub-btns {
  display: flex;
  gap: 8px;
}

.ed-sub-btns .btn {
  flex: 1;
  min-height: 44px;
}

.toggle.sm {
  font-size: 13px;
  padding: 4px 0 10px;
}

@media (min-width: 700px) {
  .ed-heads {
    width: 110px;
  }

  .ed-head-name {
    flex-direction: row;
    gap: 6px;
    max-width: 106px;
  }

  .ed-head-name small {
    font-size: 11px;
    max-width: 70px;
  }

  .ed-head {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 6px;
  }
}


.pl-wave-wrap {
  position: relative;
  width: 100%;
  height: min(30vh, 200px);
  margin-top: 10px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 14px 12px;
}

.pl-wave {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
}

.pl-wave-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted);
}

.pl-wave-msg .art-img {
  width: 40%;
  height: auto;
  opacity: .8;
}

.pl-wave-tip {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--card2);
  box-shadow: inset 0 0 0 1px var(--line2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

@media (orientation: landscape) and (max-height: 500px) {
  .pl-wave-wrap {
    height: 90px;
  }
}


.pl-speed {
  width: 100%;
  margin: 6px 0 4px;
  padding: 12px 14px 6px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pl-speed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.pl-speed-head span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pl-speed-head .ic {
  width: 17px;
  height: 17px;
}

.pl-speed-head b {
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pl-speed .slider {
  margin-top: 0;
}

.pl-rate-presets {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 8px;
  scrollbar-width: none;
  touch-action: pan-x;
}

.pl-rate-presets::-webkit-scrollbar {
  display: none;
}

.pl-rate-presets .chip {
  height: 32px;
  font-size: 13px;
  padding: 0 12px;
}

.rate-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--line2);
  color: var(--text);
  font-weight: 700;
}

.pl-rate-presets {
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
}


.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px 0 8px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line2);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dl-btn .ic {
  width: 19px;
  height: 19px;
}

.dl-btn .spin {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.dl-btn.busy {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7);
}

.pick-box .ic {
  width: 15px;
  height: 15px;
}

.dl-btn.done {
  padding: 0 8px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}


.chips.sub {
  padding-top: 0;
  margin-top: -2px;
}

.chips.sub .chip {
  height: 32px;
  font-size: 13px;
}

.row.mat {
  cursor: pointer;
  padding-left: 6px;
}

.mat-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mat-ic .ic {
  width: 20px;
  height: 20px;
}

.video-box.img {
  aspect-ratio: auto;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-box img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}

.btn-grid.one {
  grid-template-columns: 1fr;
}

.tab {
  font-size: 10.5px;
}
/* рисованные значки нижних вкладок - в стиле знака DUET */
.tab-ic { width: 28px; height: 28px; overflow: visible; transition: transform .15s, filter .15s; }
.tab-ic .st { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tab-ic .fill { fill: currentColor; stroke: none; }
.tab.on .tab-ic { transform: translateY(-1px) scale(1.06); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .35)); }
.tab:active .tab-ic { transform: scale(.92); }

/* картинки списков (вместо эмодзи): public/img/icons/*.svg */
.li-ic { width: 18px; height: 18px; flex-shrink: 0; margin-right: 6px; display: inline-block; vertical-align: -3px; }
.chip .li-ic { width: 17px; height: 17px; }
.lb-emoji .li-ic, .menu-art .li-ic { width: 30px; height: 30px; margin: 0; }
.lc-emoji .li-ic { width: 26px; height: 26px; margin: 0; }
.emoji { display: flex; align-items: center; justify-content: center; }
.emoji .li-ic { width: 28px; height: 28px; margin: 0; }
.opt .li-ic { width: 18px; height: 18px; }
.row-sub .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
