/* Аудиоархив Манжулей. Layout: одна колонка как в мобильном плеере — заголовок, кнопка «Воспроизвести», вкладки, сгруппированный список; мини-плеер плавает внизу и раскрывается в шторку */
:root {
  --bg: #f1f6f8;
  --card: #ffffff;
  --fill: #e5eef2;
  --fg: #0c1f26;
  --muted: #7a8b92;
  --line: #dce8ed;
  --accent: #0fa8cc;
  --accent-press: #0c8fb0;
  --accent-soft: #dcf5fb;
  --on-accent: #ffffff;
  --danger: #e0473a;
  --shadow: 0 10px 30px rgba(11, 59, 74, .14), 0 2px 6px rgba(11, 59, 74, .06);
  --deep: #0b3b4a;
  --green: #27d09f;
  --green-soft: #dcf7ee;
  --grad: linear-gradient(135deg, #0fa3c6 0%, #16c7e8 100%);
  --grad-deep: linear-gradient(135deg, #0b3b4a 0%, #0f6f86 100%);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 16px/1.4 var(--font); background: var(--bg); color: var(--fg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.solid { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 150px; }

.eyebrow { font-size: 14px; color: var(--muted); margin: 0 0 2px; }
h1 { font-size: clamp(34px, 7vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sub { color: var(--muted); font-size: 17px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 12px; margin-top: 22px; align-items: center; }
.big-play { flex: 1; height: 58px; border: 0; border-radius: 18px; background: var(--grad); color: var(--on-accent); font-size: 19px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 12px; }
.big-play:active { background: var(--accent-press); }
.big-play svg { width: 22px; height: 22px; }
.round { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--card); display: grid; place-items: center; box-shadow: 0 1px 2px rgba(11,59,74,.06); }
.round.on { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 26px; margin-top: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 2px 12px; font-size: 17px; font-weight: 600; color: var(--muted); position: relative; white-space: nowrap; }
.tabs button.active { color: var(--fg); }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabs .n { font-weight: 500; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }

.search { position: relative; margin-top: 18px; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { width: 100%; height: 46px; border: 0; border-radius: 14px; background: var(--fill); padding: 0 14px 0 44px; font-size: 16px; outline: none; }
.search input:focus { background: var(--card); box-shadow: 0 0 0 2px var(--accent); }
.chips { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--card); font-size: 14.5px; font-weight: 500; white-space: nowrap; box-shadow: 0 1px 2px rgba(11,59,74,.06); }
.chip .n { color: var(--muted); margin-left: 4px; font-weight: 400; }
.chip.on { background: var(--accent); color: var(--card); }
.chip.on .n { color: inherit; opacity: .6; }
.hint { color: var(--muted); font-size: 14.5px; padding: 6px 2px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; gap: 12px; }
.section-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.section-head h2 .n { color: var(--muted); font-weight: 500; margin-left: 6px; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 500; padding: 4px 0; }
.link-btn.danger { color: var(--danger); }
select.link-btn { appearance: none; -webkit-appearance: none; text-align: right; }

.group { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 22px; overflow: hidden; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px 12px 12px; position: relative; cursor: pointer; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 90px; right: 0; border-top: 1px solid var(--line); }
.row:hover { background: #fafbfc; }
.cover { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; color: rgba(255,255,255,.92); position: relative; overflow: hidden; }
.cover svg { width: 28px; height: 28px; stroke-width: 2.2; }
.cover .fmt { position: absolute; left: 6px; bottom: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: rgba(255,255,255,.85); }
.r-main { min-width: 0; }
.r-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.r-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.current .r-title { color: var(--accent); }
.r-sub { color: var(--muted); font-size: 14.5px; margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sub .pos { color: #13987a; }
.r-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.tag { border: 0; background: var(--fill); border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 500; color: #4a4f5a; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tag .x { border: 0; background: none; padding: 0; color: var(--muted); font-size: 15px; line-height: 1; }
.tag .x:hover { color: var(--danger); }
.tag.add { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--accent); }
.tag-input { width: 150px; border: 0; border-radius: 8px; padding: 3px 8px; font-size: 13px; background: var(--accent-soft); outline: 2px solid var(--accent); }
.r-right { display: flex; align-items: center; gap: 2px; color: var(--muted); }
.r-play { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--fg); }
.r-play:hover { background: var(--fill); }
.r-play svg { width: 20px; height: 20px; }
.r-forget { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 6px; }
.r-forget:hover { color: var(--danger); }
.r-bar { position: absolute; left: 90px; right: 14px; bottom: 0; height: 3px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.r-bar i { display: block; height: 100%; background: var(--green); }
.empty { background: var(--card); border-radius: 22px; padding: 40px 20px; text-align: center; color: var(--muted); }
.note { margin-top: 22px; font-size: 14px; color: var(--muted); text-align: center; }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; flex: none; }
.eq i { width: 3px; background: var(--green); border-radius: 1px; height: 40%; }
.eq i:nth-child(2) { height: 100%; }
.eq i:nth-child(3) { height: 65%; }
.playing .eq i { animation: eq .9s ease-in-out infinite; }
.playing .eq i:nth-child(2) { animation-delay: -.3s; }
.playing .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 30%; } 50% { height: 100%; } }

.mini { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(688px, calc(100% - 24px)); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 24px; box-shadow: var(--shadow); display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 10px 12px; z-index: 20; cursor: pointer; overflow: hidden; }
.mini .cover { width: 52px; height: 52px; border-radius: 12px; }
.mini .cover svg { width: 22px; height: 22px; }
.m-title { font-weight: 600; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-btns { display: flex; }
.m-btn { width: 46px; height: 46px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; }
.m-btn:hover { background: var(--fill); }
.m-btn svg { width: 26px; height: 26px; }
.m-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.m-progress i { display: block; height: 100%; background: var(--accent); width: 0; }

.sheet-bg { position: fixed; inset: 0; background: rgba(14,16,20,.35); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(560px, 100%); transform: translate(-50%, 104%); background: var(--card); border-radius: 28px 28px 0 0; z-index: 31; transition: transform .3s cubic-bezier(.2,.8,.2,1); padding: 10px 22px calc(24px + env(safe-area-inset-bottom, 0px)); max-height: 94%; overflow-y: auto; visibility: hidden; }
body.sheet-open #sheet { transform: translate(-50%, 0); visibility: visible; }
body.sheet-open #sheetBg { opacity: 1; pointer-events: auto; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.sheet-close { border: 0; background: var(--fill); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; float: right; }
.sheet-close svg { width: 20px; height: 20px; }
.s-cover { width: min(260px, 70%); aspect-ratio: 1; max-width: 100%; border-radius: 26px; margin: 30px auto 22px; display: grid; place-items: center; color: rgba(255,255,255,.92); box-shadow: 0 18px 40px rgba(11,59,74,.18); }
.s-cover svg { width: 64px; height: 64px; stroke-width: 1.8; }
.s-title { font-size: 24px; font-weight: 700; text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
.s-sub { text-align: center; color: var(--muted); margin-top: 4px; }
.seek-wrap { margin-top: 22px; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
input[type=range].bar { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--p, 0%) 100% no-repeat, var(--fill); outline: none; margin: 0; cursor: pointer; }
input[type=range].bar::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
input[type=range].bar::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
.s-controls { display: flex; align-items: center; justify-content: space-between; margin: 18px auto 0; max-width: 360px; }
.s-btn { border: 0; background: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.s-btn:hover { background: var(--fill); }
.s-btn svg { width: 28px; height: 28px; }
.s-btn.skip { font-weight: 700; font-size: 15px; color: #4a4f5a; }
.s-play { width: 78px; height: 78px; border-radius: 50%; border: 0; background: var(--grad); color: var(--on-accent); display: grid; place-items: center; }
.s-play svg { width: 32px; height: 32px; }
.s-play:active { background: var(--accent-press); }
.s-opts { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pill { border: 0; background: var(--fill); border-radius: 12px; padding: 9px 14px; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.pill.on { background: var(--accent-soft); color: var(--accent); }
.pill svg { width: 18px; height: 18px; }
.s-tags-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 10px; }
.s-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.s-tags .tag { font-size: 15px; padding: 6px 12px; border-radius: 10px; }
.s-tags .tag-input { font-size: 15px; padding: 6px 12px; width: 190px; border-radius: 10px; }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); background: var(--deep); color: var(--card); padding: 10px 16px; border-radius: 14px; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg, .toast { transition: none; } .playing .eq i { animation: none; } }
@media (max-width: 520px) {
  .row { grid-template-columns: 56px 1fr auto; gap: 12px; }
  .cover { width: 56px; height: 56px; }
  .row + .row::before, .r-bar { left: 80px; }
  .r-title { font-size: 16.5px; }
  .tabs { gap: 18px; }
  .tabs button { font-size: 16px; }
}

/* шапка с кнопкой настроек */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.top .round { width: 44px; height: 44px; }
.top .round svg { width: 20px; height: 20px; }
.r-sub .folder { color: var(--fg); opacity: .65; }
.r-sub .folder:hover { color: var(--accent); opacity: 1; text-decoration: underline; }
.chip.folder-chip { background: var(--accent-soft); color: var(--accent); }
.more { text-align: center; color: var(--muted); padding: 16px; font-size: 14px; }

/* окно «история на другом устройстве» */
dialog { border: 0; border-radius: 24px; padding: 0; background: var(--card); color: var(--fg); max-width: 440px; width: calc(100% - 32px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(14,16,20,.35); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { margin: 0; font-size: 22px; }
.dlg p { margin: 0; color: var(--muted); font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field .rowf { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 12px; background: var(--fill); padding: 0 12px; font: 14px ui-monospace, monospace; color: var(--fg); }
.dlg .pill { justify-content: center; }
.dlg .pill.primary { background: var(--accent); color: var(--on-accent); }

/* карточка «Вы остановились» */
.resume { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; width: 100%; margin-top: 22px; padding: 12px; border: 0; border-radius: 20px; background: var(--card); text-align: left; box-shadow: 0 1px 2px rgba(11,59,74,.06); }
.resume .cover { width: 56px; height: 56px; }
.resume-text { min-width: 0; }
.resume-label { font-size: 13px; color: var(--muted); }
.resume-title { font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.resume-meta { font-size: 14px; color: #13987a; font-variant-numeric: tabular-nums; }
.resume-bar { height: 3px; border-radius: 3px; background: var(--fill); margin-top: 8px; overflow: hidden; }
.resume-bar i { display: block; height: 100%; background: var(--green); width: 0; }
.resume + .actions { margin-top: 12px; }

/* «ещё N» у тегов записи и кнопка «Все теги» */
.tag.tag-more { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chip.all { background: var(--green-soft); color: #0f7a5c; }

/* шторка со всеми тегами */
.tags-sheet { min-height: 70%; }
.ts-title { margin: 8px 0 2px; font-size: 24px; font-weight: 700; }
.ts-sub { margin: 0; color: var(--muted); font-size: 14px; }
.tags-sheet .search { margin-top: 14px; }
.tag-list { list-style: none; margin: 10px 0 0; padding: 0; }
.tag-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.tag-list li:hover { color: var(--accent); }
.tag-list li.on { color: var(--accent); font-weight: 600; }
.tag-list li .n { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tag-list .hint { cursor: default; border: 0; }
body.tags-open .tags-sheet { transform: translate(-50%, 0); visibility: visible; }
body.tags-open #tagsBg { opacity: 1; pointer-events: auto; }

/* кнопка «Смотреть фильм» над «Продолжить» */
.featured { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; margin-top: 16px; border-radius: 16px; background: var(--grad-deep); color: var(--card); font-size: 17px; font-weight: 600; text-decoration: none; }
.featured svg { width: 18px; height: 18px; }
.featured:active { opacity: .85; }
.featured + .actions, .resume + .featured { margin-top: 12px; }
.tag { white-space: nowrap; line-height: 1.5; height: 24px; }
.s-tags .tag { height: auto; }

/* без чёрного: заголовок и иконки управления — тёмно-бирюзовые */
h1, .r-play, .m-btn, .s-btn, .round, .sheet-close { color: var(--deep); }

/* ---- шапка темы (как цветной блок в образце) ---- */
.hero { background: var(--grad-deep); color: #fff; border-radius: 22px; padding: 22px 22px 20px; }
.hero h1 { color: #fff; font-size: clamp(28px, 6vw, 40px); }
.hero .sub { color: rgba(255,255,255,.72); margin-top: 6px; }
.hero-label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 4px; }
.hero-label:empty { display: none; }
.hero + .resume, .hero + .featured { margin-top: 14px; }

/* ---- левая колонка: разделы и темы ---- */
.side { display: none; }
.p-label { display: none; }
.side-brand { font-weight: 800; font-size: 18px; color: var(--deep); padding: 20px 20px 12px; letter-spacing: -.01em; }
.side-nav { display: flex; flex-direction: column; padding: 0 10px; gap: 2px; }
.side-nav button { display: flex; justify-content: space-between; align-items: center; border: 0; background: none; border-radius: 12px; padding: 10px 12px; font-size: 15.5px; font-weight: 600; color: var(--fg); text-align: left; }
.side-nav button:hover { background: var(--fill); }
.side-nav button.active { background: var(--accent-soft); color: var(--accent-press); }
.side-nav .n, .side-tags .n { color: var(--muted); font-weight: 500; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.side-head { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 18px 22px 8px; border-top: 1px solid var(--line); margin-top: 12px; }
.side-search { position: relative; display: block; margin: 0 14px 8px; }
.side-search input { width: 100%; height: 40px; border: 0; border-bottom: 2px solid var(--line); background: none; padding: 0 30px 0 8px; font-size: 15px; outline: none; }
.side-search input:focus { border-color: var(--accent); }
.side-search svg { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--accent); }
.side-tags { list-style: none; margin: 0; padding: 0 0 12px; overflow-y: auto; flex: 1; min-height: 0; }
.side-tags button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 22px; font-size: 16px; text-align: left; color: var(--fg); }
.side-tags button:hover { background: #f6fafb; color: var(--accent-press); }
.side-tags button.on { background: var(--accent-soft); color: var(--accent-press); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.side-empty { padding: 14px 22px; color: var(--muted); font-size: 14px; }

/* ---- компьютер: две колонки, плеер сверху над записями ---- */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; max-width: 1180px; margin: 0 auto; padding: 24px; align-items: start; }
  .side { display: flex; flex-direction: column; position: sticky; top: 24px; max-height: calc(100vh - 48px); background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: 0 1px 2px rgba(11,59,74,.06); }
  .wrap { max-width: none; margin: 0; padding: 0 0 40px; }
  .mini, .sheet-bg { display: none !important; }
  #sheet, body.sheet-open #sheet { position: sticky; top: 24px; left: auto; bottom: auto; transform: none; visibility: visible; width: auto; max-height: none; overflow: visible; z-index: 10;
    border-radius: 22px; padding: 16px 20px 12px; margin-bottom: 16px; box-shadow: var(--shadow);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "now opts" "seek seek" "ctrl ctrl"; column-gap: 16px; }
  #sheet .grabber, #sheet .sheet-close, #sheet .s-cover, #sheet .s-tags-title, #sheet .s-tags { display: none; }
  .p-now { grid-area: now; min-width: 0; }
  .p-label { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  #sheet .s-title { text-align: left; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; }
  #sheet .s-sub { text-align: left; margin-top: 0; font-size: 14px; }
  #sheet .s-opts { grid-area: opts; margin: 0; align-self: center; }
  #sheet .seek-wrap { grid-area: seek; margin-top: 12px; }
  #sheet .s-controls { grid-area: ctrl; margin: 2px auto 0; max-width: 380px; width: 100%; }
  #sheet .s-play { width: 58px; height: 58px; }
  #sheet .s-play svg { width: 26px; height: 26px; }
  .tabs, .chips { display: none !important; }
  .hero { padding: 28px 30px 24px; }
}

.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-btn { flex: none; width: 40px; height: 40px; margin: -4px -4px 0 auto; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.hero-btn:hover { background: rgba(255,255,255,.24); }
.hero-btn svg { width: 19px; height: 19px; }
.hero-label:empty + .hero-btn { margin-top: -4px; }
