/* Диск StickWorks */

#app { display: grid; grid-template-rows: 64px 1fr; height: 100vh; height: 100dvh; }

/* ── верхняя панель ── */
.top {
  display: flex; align-items: center; gap: 14px; padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.02em; padding: 0 6px; }
.logo svg { color: var(--accent); width: 26px; height: 26px; }
.logo small { font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.search { position: relative; flex: 1; max-width: 640px; margin: 0 auto 0 12px; }
.search svg { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.search input { width: 100%; height: 42px; padding: 0 40px 0 44px; border-radius: 999px; border: 1px solid transparent; background: var(--surface-2); outline: none; }
.search input:focus { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.search .clear { position: absolute; right: 4px; top: 1px; display: none; }
.search.has .clear { display: grid; }

/* ── каркас ── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 0; }
.side { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.create { margin: 2px 0 12px 4px; height: 52px; padding: 0 24px; font-size: 15px; box-shadow: var(--shadow); align-self: flex-start; }
.nav { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 16px; border-radius: 999px; text-decoration: none; color: var(--text); border: 0; background: transparent; width: 100%; text-align: left; }
.nav:hover { background: var(--surface-2); }
.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav.drop { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.meter { margin: auto 8px 8px; padding-top: 16px; }
.meter .bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.meter .bar i.ok { background: var(--ok); }
.meter small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }

.main { background: var(--surface); border-radius: 18px 0 0 0; border: 1px solid var(--line); border-right: 0; border-bottom: 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.head { display: flex; align-items: center; gap: 8px; padding: 10px 16px 6px 20px; min-height: 60px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; font-size: 20px; letter-spacing: -.01em; }
.crumbs button { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; }
.crumbs button:hover { background: var(--surface-2); color: var(--text); }
.crumbs button.cur { color: var(--text); font-weight: 600; cursor: default; }
.crumbs button.drop { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.crumbs svg { color: var(--muted); width: 16px; height: 16px; }
.head .tools { display: flex; align-items: center; gap: 2px; }

.sel-bar { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; background: var(--accent-soft); border-radius: 999px; padding: 4px 8px 4px 6px; min-width: 0; }
.sel-bar b { padding: 0 10px; font-weight: 600; white-space: nowrap; }
.sel-bar .icon-btn { color: var(--text); width: 36px; height: 36px; }
.sel-bar .icon-btn:hover { background: var(--surface); }

.note { margin: 0 20px 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.body { flex: 1; overflow: auto; padding: 0 12px 24px; min-height: 0; position: relative; }

/* ── список ── */
.lh, .row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 120px 170px 44px; align-items: center; gap: 8px; padding: 0 8px; }
.lh { position: sticky; top: 0; z-index: 2; background: var(--surface); height: 40px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.lh button { border: 0; background: transparent; text-align: left; padding: 0; color: inherit; display: flex; align-items: center; gap: 4px; }
.lh button:hover { color: var(--text); }
.row { height: 52px; border-bottom: 1px solid var(--line); cursor: default; user-select: none; position: relative; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--accent-soft); }
.row.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.row .ic { display: grid; place-items: center; color: var(--muted); }
.row .nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm .st { color: #e8a700; width: 16px; height: 16px; fill: currentColor; }
.row .nm .sh { color: var(--muted); width: 16px; height: 16px; }
.row .meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.row .more { opacity: 0; }
.row:hover .more, .row.sel .more { opacity: 1; }
.row .nm .txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row .nm .txt .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm .sub { display: none; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm .st, .row .nm .sh { flex: none; }
.row .chk { display: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); background: transparent; padding: 0; place-items: center; color: var(--on-accent); }
.row .chk svg { width: 14px; height: 14px; stroke-width: 3; }
.row.sel .chk { background: var(--accent); border-color: var(--accent); }
.row:hover .chk, .row.sel .chk, .body.selmode .chk { display: grid; }
.row:hover .ic-i, .row.sel .ic-i, .body.selmode .ic-i { display: none; }.tint-folder { color: #8a7f6e; }
.tint-image { color: #2f9e6a; } .tint-video { color: #d6472f; } .tint-audio { color: #b05bd1; }
.tint-pdf { color: #e03c3c; } .tint-text { color: #4f7fd6; } .tint-archive { color: #c28a1e; } .tint-code { color: #3aa0b5; }

/* ── сетка ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; padding: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; cursor: default; user-select: none; position: relative; }
.card:hover { border-color: var(--muted); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-soft); }
.card.drop { outline: 2px dashed var(--accent); }
.card .thumb { height: 120px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb svg { width: 44px; height: 44px; stroke-width: 1.4; }
.card.folder .thumb { height: 64px; background: transparent; }
.card.folder { display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px; height: 56px; }
.card.folder .thumb { width: 28px; height: auto; }
.card.folder .thumb svg { width: 24px; height: 24px; }
.card .cap { padding: 10px 12px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.card.folder .cap { padding: 0; flex: 1; }
.card .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.card .more { position: absolute; top: 6px; right: 6px; background: var(--surface); box-shadow: var(--shadow); width: 32px; height: 32px; opacity: 0; }
.card.folder .more { position: static; box-shadow: none; background: transparent; }
.card:hover .more, .card.sel .more { opacity: 1; }
.card .stars { position: absolute; top: 8px; left: 8px; color: #e8a700; }

.empty { display: grid; place-items: center; text-align: center; padding: 72px 16px; color: var(--muted); gap: 10px; }
.empty svg { width: 64px; height: 64px; stroke-width: 1.2; opacity: .6; }
.empty h3 { margin: 6px 0 0; color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 340px; }

/* ── меню ── */
.menu { position: fixed; z-index: 150; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease-out; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; height: 38px; padding: 0 12px; border: 0; background: transparent; border-radius: 8px; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--accent); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu svg { color: var(--muted); }
.menu button.danger svg { color: var(--accent); }

/* ── загрузка ── */
.drop-veil { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 3px dashed var(--accent); margin: 8px; border-radius: 20px; pointer-events: none; font-size: 22px; font-weight: 600; color: var(--accent); backdrop-filter: blur(2px); }
.drop-veil.on { display: grid; }
.uploads { position: fixed; right: 20px; bottom: 20px; z-index: 120; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.uploads.fresh { animation: pop .22s var(--ease); }
.uploads header { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; background: var(--surface-2); font-weight: 600; }
.uploads header span { flex: 1; }
.uploads ul { list-style: none; margin: 0; padding: 4px 0; max-height: 280px; overflow: auto; }
.uploads li { padding: 8px 16px; display: grid; gap: 6px; }
.uploads li .t { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.uploads li .t span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads li .t em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.uploads .bar { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.uploads .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.uploads li.done .bar i { background: var(--ok); }
.uploads li.err .t em { color: var(--accent); }

/* ── просмотр ── */
.viewer { position: fixed; inset: 0; z-index: 110; background: rgba(8, 6, 4, .92); display: grid; grid-template-rows: 60px 1fr; animation: fade .15s; color: #f0ece6; }
.viewer header { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; }
.viewer header h3 { flex: 1; margin: 0; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer header .icon-btn { color: #f0ece6; }
.viewer header .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.viewer .stage { display: grid; place-items: center; min-height: 0; padding: 0 64px 20px; position: relative; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.viewer .stage iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; }
.viewer .stage pre { width: min(900px, 100%); max-height: 100%; overflow: auto; margin: 0; padding: 18px; border-radius: 10px; background: #1b1918; font: 13px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.viewer .stage .na { text-align: center; display: grid; gap: 14px; justify-items: center; }
.viewer .stage .na svg { width: 72px; height: 72px; stroke-width: 1.2; opacity: .7; }
.viewer .stage audio { width: min(520px, 100%); }
.viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: rgba(255, 255, 255, .12); color: #fff; }
.viewer .nav-btn:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.viewer .nav-btn.l { left: 8px; } .viewer .nav-btn.r { right: 8px; }

/* ── окна: поделиться, версии, перенос ── */
.dialog.wide { width: min(560px, 100%); }
.linkbox { display: flex; gap: 8px; margin: 6px 0; }
.linkbox input { flex: 1; font-family: var(--mono); font-size: 13px; }
.ver, .pick-row, .share-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.share-row { flex-wrap: wrap; }
.ver span { flex: 1; min-width: 0; }
.share-row > span { flex: 1 1 280px; min-width: 0; }
.ver small, .share-row small { color: var(--muted); display: block; }
.ver b { color: var(--ok); font-size: 12px; }
.pick { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pick-row { cursor: pointer; border-bottom: 1px solid var(--line); }
.pick-row:hover { background: var(--surface-2); }
.pick-row.sel { background: var(--accent-soft); }
.pick-row.dim { opacity: .4; pointer-events: none; }
.pick-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.pick-top button { border: 0; background: transparent; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.pick-top button:hover { background: var(--surface-2); color: var(--text); }

/* ── вход и публичная ссылка ── */
.gate { display: grid; place-items: center; height: 100%; padding: 24px; }
.gate .box { text-align: center; max-width: 380px; display: grid; gap: 14px; justify-items: center; }
.gate svg.big { width: 72px; height: 72px; color: var(--accent); stroke-width: 1.3; }
.gate h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.gate p { margin: 0; color: var(--muted); }
.pub { max-width: 920px; margin: 0 auto; padding: 24px 16px; width: 100%; }
.pub .file-card { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 56px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.pub .file-card svg { width: 72px; height: 72px; stroke-width: 1.2; }
.pub .file-card h2 { margin: 0; word-break: break-word; }
.pub .acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pub-wrap { overflow: auto; height: 100%; }
.pub .listbox { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; margin-top: 12px; }

/* ── телефон ── */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; gap: 6px; padding: 8px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
  .create { margin: 0; height: 42px; padding: 0 16px; flex: none; box-shadow: none; }
  .nav { width: auto; flex: none; gap: 8px; padding: 0 14px; height: 38px; }
  .meter { display: none; }
  .main { border-radius: 0; border-left: 0; }
  .lh, .row { grid-template-columns: 32px minmax(0, 1fr) 44px; }
  .lh .c-size, .lh .c-date, .row .meta { display: none; }
  .row .nm .sub { display: block; }
  .row { height: 60px; }
  .row .more { opacity: 1; }
  .card .more { opacity: 1; }
  .logo small { display: none; }
  .crumbs { font-size: 17px; }
  .viewer .stage { padding: 0 8px 12px; }
  .viewer .nav-btn { display: none; }
  .top { gap: 6px; }
}
@media (max-width: 520px) {
  .top .tools-top .hide-sm { display: none; }
  .uploads { right: 8px; bottom: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 6px; }
  .card .thumb { height: 96px; }
}

/* ═══ премиум-слой Диска: стекло, плитки значков, свечение (как у сайта и настроек Антона) ═══ */
.body { scrollbar-gutter: stable; }
.top { background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); }
.logo { font-family: var(--display); font-weight: 800; }
.logo svg { filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--red) 45%, transparent)); }
.tools-top { display: flex; align-items: center; gap: 8px; }
.icon-btn.glass { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hi); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.icon-btn.glass:hover { background: var(--surface); }

.search input { background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hi); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.search input:focus { background: var(--surface); border-color: color-mix(in srgb, var(--red) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent); }

.nav { border-radius: 14px; transition: background .2s, box-shadow .2s, color .2s; }
.nav svg { transition: transform .25s var(--ease); }
.nav:hover svg { transform: scale(1.1); }
.nav.on { background: color-mix(in srgb, var(--red) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 24%, transparent), inset 0 1px 0 var(--hi); }
.create { box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .22); }
.meter .bar i { background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 60%, #ffb347)); box-shadow: 0 0 10px -2px var(--red); transition: width .6s var(--ease); }
.meter .bar i.ok { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 60%, #9be3b9)); box-shadow: none; }

.main { border-radius: 22px 0 0 0; box-shadow: var(--shadow); background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.crumbs { font-family: var(--display); }
.crumbs button { font-weight: 700; border-radius: 12px; }
.lh { background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* значки файлов — плитки со стеклянным бликом */
.row .ic-i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 13%, transparent); box-shadow: inset 0 1px 0 var(--hi); }
.row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.row.sel { background: color-mix(in srgb, var(--red) 9%, transparent); box-shadow: inset 3px 0 0 var(--red); }
.row .chk { border-radius: 8px; border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.row.sel .chk { background: linear-gradient(180deg, color-mix(in srgb, var(--red) 85%, #fff), var(--red)); box-shadow: var(--glow); }
.card { border-radius: 18px; box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card.sel { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); box-shadow: 0 0 0 2px var(--accent-soft), var(--glow); }
.card .thumb { background: linear-gradient(145deg, color-mix(in srgb, currentColor 12%, var(--surface-2)), var(--surface-2)); }
.card .thumb svg { filter: drop-shadow(0 8px 14px color-mix(in srgb, currentColor 35%, transparent)); }
.card .more { background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px var(--line); }

/* панель выделения — стеклянная плашка с красным тоном */
.sel-bar { background: color-mix(in srgb, var(--red) 9%, var(--glass)); border: 1px solid color-mix(in srgb, var(--red) 22%, transparent); border-radius: 18px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 var(--hi); }
.sel-bar .icon-btn { background: color-mix(in srgb, var(--surface) 55%, transparent); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hi); }
.sel-bar .icon-btn:hover { background: var(--surface); }

/* контекстное меню: стекло, значки на плитках */
.menu { background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(20px); backdrop-filter: saturate(160%) blur(20px); border-color: var(--line-strong); border-radius: 16px; padding: 7px; }
.menu button { border-radius: 11px; }
.menu button svg { width: 28px; height: 28px; padding: 5px; border-radius: 9px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted); }
.menu button:hover svg { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.menu button.danger svg { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }

/* панель загрузок и окна */
.uploads { background: var(--glass); border-color: var(--line-strong); -webkit-backdrop-filter: saturate(160%) blur(20px); backdrop-filter: saturate(160%) blur(20px); }
.uploads header { background: color-mix(in srgb, var(--surface-2) 70%, transparent); font-family: var(--display); font-weight: 800; }
.uploads .bar i { background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 60%, #ffb347)); box-shadow: 0 0 10px -2px var(--red); }
.uploads li.done .bar i { background: var(--ok); box-shadow: none; }
.dialog { background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface)); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-lg); }
.dialog .btn svg { width: 18px; height: 18px; }
.linkbox input { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

.empty svg { color: var(--red); opacity: .75; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--red) 28%, transparent)); }
.empty h3 { font-family: var(--display); font-weight: 800; }
.gate svg.big { filter: drop-shadow(0 14px 32px color-mix(in srgb, var(--red) 45%, transparent)); }
.gate h1, .pub .file-card h2 { font-family: var(--display); font-weight: 800; }
.viewer header .icon-btn { background: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }

/* превью картинок */
.thumb.has-pic{background:var(--surface-2)}
.thumb.has-pic img{display:block;width:100%;height:100%;object-fit:cover;animation:pop .2s var(--ease)}
.ic-i.has-pic{overflow:hidden;padding:0}
.ic-i.has-pic img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}

/* ═══ плавность: единая кривая, появление списка волной, мягкие окна ═══ */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.4, .64, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(18px) scale(.965); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { transform: translateY(-104%); } to { transform: none; } }
@keyframes fadeOut { to { opacity: 0; } }
.row.in, .card.in { animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 26ms); }
.row, .card { transition: background .22s var(--ease-out), border-color .22s var(--ease-out), box-shadow .3s var(--ease-out), transform .3s var(--ease-out); }
.card:hover { transform: translateY(-3px); box-shadow: var(--p-elev-2, 0 18px 40px -18px rgba(0, 0, 0, .55)), 0 0 0 1px color-mix(in srgb, var(--red) 28%, transparent); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.card:active { transform: translateY(-1px) scale(.99); }
.card .thumb img, .ic-i img { transition: transform .6s var(--ease-out); }
.card:hover .thumb img { transform: scale(1.06); }
.row .more, .card .more { transition: opacity .2s var(--ease-out), background .2s; }
.row .chk { transition: background .2s, border-color .2s, transform .2s var(--spring); }
.row .chk:active { transform: scale(.85); }
.overlay { animation: fade .28s var(--ease-out); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog { animation: dlgIn .42s var(--ease-out); }
.menu { transform-origin: top left; animation: menuIn .2s var(--ease-out); }
.menu button { transition: background .15s, transform .2s var(--ease-out); }
.menu button:hover { transform: translateX(2px); }
.toast { animation: toastIn .4s var(--ease-out); }
.uploads.fresh { animation: dlgIn .45s var(--ease-out); }
.bar i { transition: width .5s var(--ease-out); }
.nav { transition: background .25s var(--ease-out), color .2s, box-shadow .25s var(--ease-out), transform .25s var(--ease-out); }
.nav:hover { transform: translateX(3px); }
.btn:active, .icon-btn:active { transform: scale(.96); }
.main .head { animation: rise .5s var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .row.in, .card.in { animation: none; } }

/* ═══ профиль: кнопка-аватар и окно ═══ */
.ava-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer; transition: transform .25s var(--spring), filter .25s; }
.ava-btn:hover { transform: scale(1.06); filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--red) 45%, transparent)); }
.ava-btn:active { transform: scale(.94); }
.ava { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; font: 700 15px/1 var(--display); color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--red) 92%, #fff 8%), color-mix(in srgb, var(--red) 70%, #000));
  box-shadow: 0 0 0 2px var(--bg, #0b0b0c), 0 0 0 3px color-mix(in srgb, var(--red) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.lg { width: 52px; height: 52px; font-size: 22px; }
.popwrap { position: fixed; inset: 0; z-index: 160; }
.pop-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .0); }
.pop { position: absolute; top: 62px; right: 18px; width: 300px; padding: 10px; border-radius: 20px; transform-origin: top right;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 0 0 1px color-mix(in srgb, var(--red) 10%, transparent), inset 0 1px 0 var(--hi);
  animation: popIn .34s var(--ease-out); }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.94); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.popwrap.out .pop { animation: popOut .18s ease-in forwards; }
@keyframes popOut { to { opacity: 0; transform: translateY(-6px) scale(.96); } }
.pop-me { display: flex; align-items: center; gap: 14px; padding: 10px 10px 14px; }
.pop-me div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pop-me b { font-family: var(--display); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-me small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-row, .pop-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--text); border-radius: 12px; font: inherit; text-decoration: none; text-align: left; cursor: pointer; transition: background .18s var(--ease-out), transform .2s var(--ease-out); }
.pop-row { justify-content: space-between; cursor: default; }
.pop-row span { display: flex; align-items: center; gap: 12px; }
.pop-item:hover { background: color-mix(in srgb, var(--red) 10%, transparent); transform: translateX(2px); }
.pop svg.i { color: var(--muted); width: 20px; height: 20px; }
.pop-item:hover svg.i { color: var(--red); }
.pop-item.danger, .pop-item.danger svg.i { color: var(--red); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 6px; }
@media (max-width: 720px) {
  .popwrap .pop-scrim { background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s var(--ease-out); }
  .popwrap.out .pop-scrim { animation: fadeOut .2s forwards; }
  .pop { top: 0; left: 0; right: 0; width: auto; max-height: 52vh; overflow: auto; border-radius: 0 0 26px 26px; padding: calc(10px + env(safe-area-inset-top)) 14px 16px; transform-origin: top center; animation: sheetIn .45s var(--ease-out); }
  .popwrap.out .pop { animation: sheetOut .22s ease-in forwards; }
  .pop-me { padding-top: 14px; }
  .pop-row, .pop-item { min-height: 50px; }
}
@keyframes sheetOut { to { transform: translateY(-104%); } }
