/* ============================================================
   DataPoint Drive — стили
   ============================================================ */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f0f2f5; --hover: #eaedf1; --press: #e1e5ea;
  --border: #e3e6eb; --border-strong: #cfd4dc;
  --text: #15181d; --text-2: #565e6b; --text-3: #8a919c;
  --accent: #0e7c6b; --accent-hover: #0b6a5b; --accent-soft: #dcf2ec; --accent-text: #ffffff;
  --danger: #cf3434; --danger-soft: #fde9e9;
  --shadow-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.07);
  --shadow-2: 0 18px 48px rgba(16,24,40,.16), 0 2px 8px rgba(16,24,40,.08);
  --radius: 14px; --radius-sm: 10px;
  --k-doc: #2f6fde; --k-sheet: #1e9e57; --k-slides: #e3730b; --k-pdf: #d93a2b; --k-image: #8b5cf6;
  --k-video: #e0336e; --k-audio: #d99a06; --k-text: #5b6b7f; --k-archive: #8d6748; --k-other: #7b8494;
  --k-exe: #3b5bdb; --k-paf: #0c8599; --k-apk: #5c940d; --k-folder: #f2b437; --k-folder-dark: #d9962a;
  --page-canvas: #e9ebef;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1c2026; --hover: #232830; --press: #2a3039;
  --border: #262b33; --border-strong: #363c47;
  --text: #e8eaee; --text-2: #a3aab5; --text-3: #737b87;
  --accent: #2bb39b; --accent-hover: #3cc6ad; --accent-soft: rgba(43,179,155,.16); --accent-text: #04201b;
  --danger: #f06464; --danger-soft: rgba(240,100,100,.14);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 18px 48px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
  --page-canvas: #1b1e23;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #16191e; --surface-2: #1c2026; --hover: #232830; --press: #2a3039;
    --border: #262b33; --border-strong: #363c47;
    --text: #e8eaee; --text-2: #a3aab5; --text-3: #737b87;
    --accent: #2bb39b; --accent-hover: #3cc6ad; --accent-soft: rgba(43,179,155,.16); --accent-text: #04201b;
    --danger: #f06464; --danger-soft: rgba(240,100,100,.14);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 18px 48px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
    --page-canvas: #1b1e23;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 650; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--hover); }
.btn-block { width: 100%; height: 44px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- бренд ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,.28) 50%) top right / 12px 12px no-repeat,
    linear-gradient(145deg, var(--accent) 0%, #11a088 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand-lg { font-size: 20px; }
.brand-lg .brand-mark { width: 34px; height: 34px; }

/* ============================================================
   Раскладка приложения
   ============================================================ */
.app { display: grid; grid-template-columns: 256px 1fr; height: 100vh; height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px;
  border-right: 1px solid var(--border); background: var(--bg); min-height: 0;
}
.sidebar .brand { padding: 4px 8px 6px; }
.btn-create {
  height: 48px; justify-content: flex-start; padding: 0 18px; border-radius: 14px; font-size: 15px;
  background: var(--surface); box-shadow: var(--shadow-1); align-self: flex-start;
}
.btn-create svg.ic { color: var(--accent); width: 22px; height: 22px; stroke-width: 2.2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 0; background: transparent; color: var(--text-2); font-weight: 650; text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.storage { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.storage b { color: var(--text); font-size: 13.5px; display: block; margin-bottom: 8px; }
.meter { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 8px 0 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 12px 24px; }
.search {
  flex: 1; max-width: 720px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-3); border: 1px solid transparent;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.search:focus-within { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-1); }
.search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: 15px; min-width: 0; }
.topbar .icon-btn#themeBtn { margin-left: auto; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
}
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }

.content { flex: 1; overflow: auto; padding: 4px 24px 40px; min-height: 0; }
.content-head { position: sticky; top: -4px; z-index: 5; background: var(--bg); padding: 8px 0 14px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
.title-row h1 small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 8px; letter-spacing: 0; }
.head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  appearance: none; font-weight: 600; font-size: 13px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.toggle { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.toggle button { width: 38px; height: 34px; border: 0; background: transparent; color: var(--text-3); display: grid; place-items: center; }
.toggle button.on { background: var(--accent-soft); color: var(--accent); }
.toggle svg.ic { width: 18px; height: 18px; }
.chips { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; flex: none;
  border: 1px solid var(--border); background: var(--surface); font-weight: 650; font-size: 13px; color: var(--text-2);
}
.chip:hover { background: var(--hover); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip i { width: 8px; height: 8px; border-radius: 3px; }

/* ---------- сетка файлов ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  transition: box-shadow .18s, border-color .18s, transform .18s;
  animation: rise .35s cubic-bezier(.2,.8,.2,1) both;
}
.card:hover { box-shadow: var(--shadow-2); border-color: transparent; transform: translateY(-2px); }
.card-thumb {
  position: relative; height: 136px; display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--kc) 9%, var(--surface-2));
}
.card-thumb img.th { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.card-thumb img.th.ok { opacity: 1; }
.card-thumb .badge-play {
  position: absolute; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
}
.card-thumb .badge-play svg.ic { fill: #fff; stroke: none; width: 18px; height: 18px; margin-left: 2px; }
.card-body { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; }
.card-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 12px; color: var(--text-3); padding: 0 12px 11px; margin-top: -6px; display: flex; gap: 6px; align-items: center; }
.card-meta svg.ic { width: 14px; height: 14px; }
.card .icon-btn { width: 32px; height: 32px; }
.fi { flex: none; display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px 100px 44px; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover); }
.row.head { min-height: 40px; cursor: default; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.row.head:hover { background: none; }
.row .name { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 650; }
.row .name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .cell { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shared-mark { color: var(--text-3); display: inline-flex; }
.shared-mark svg.ic { width: 15px; height: 15px; }

.empty { display: grid; place-items: center; text-align: center; padding: 72px 20px; color: var(--text-2); }
.empty h3 { margin: 18px 0 6px; color: var(--text); font-size: 18px; }
.empty-art {
  width: 120px; height: 96px; margin: 0 auto; border-radius: 18px; position: relative;
  background: linear-gradient(160deg, var(--accent-soft), transparent);
}
.empty-art::before, .empty-art::after {
  content: ""; position: absolute; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-2);
}
.empty-art::before { width: 52px; height: 64px; left: 22px; top: 18px; transform: rotate(-8deg); border-top: 6px solid var(--k-doc); }
.empty-art::after { width: 52px; height: 64px; left: 50px; top: 12px; transform: rotate(7deg); border-top: 6px solid var(--k-sheet); }
.skeleton { height: 190px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- меню ---------- */
.menu {
  position: fixed; z-index: 3000; min-width: 220px; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2);
  animation: pop .14s ease-out;
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border: 0;
  border-radius: 8px; background: transparent; text-align: left; font-weight: 600;
}
.menu button:hover { background: var(--hover); }
.menu button svg.ic { width: 18px; height: 18px; color: var(--text-2); }
.menu button.danger { color: var(--danger); }
.menu button.danger svg.ic { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu .menu-head { padding: 10px 12px 12px; }
.menu .menu-head b { display: block; font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- модальные окна ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 4000; background: rgba(10,12,16,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 16px; animation: fade .15s;
}
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-2); animation: pop .18s ease-out;
}
.modal.wide { width: min(560px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 4px 22px; }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.modal-body { padding: 12px 22px 8px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }
@keyframes fade { from { opacity: 0; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input, .field input {
  height: 42px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { color: var(--text-3); font-size: 12.5px; margin: -4px 0 16px; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin-bottom: 18px; }
.seg-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--text-2); font-weight: 700; font-size: 13.5px;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg-btn svg.ic { width: 17px; height: 17px; }

/* шаринг */
.share-row { display: flex; gap: 8px; }
.share-row .input { flex: 1; min-width: 0; }
.switch-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.switch-line div { flex: 1; }
.switch-line small { display: block; color: var(--text-3); font-size: 12px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.qr-box { display: grid; place-items: center; gap: 14px; padding: 8px 0 6px; }
.qr-box .qr { padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--border); }
.qr-box .qr img, .qr-box .qr canvas { display: block; width: 208px; height: 208px; }
.id-input {
  letter-spacing: .5em; font-size: 22px !important; font-weight: 800; text-align: center; height: 52px !important;
  font-variant-numeric: tabular-nums;
}
.lookup { min-height: 22px; font-size: 13px; color: var(--text-2); margin: -6px 0 12px; display: flex; align-items: center; gap: 8px; }
.lookup.ok { color: var(--accent); }
.lookup.bad { color: var(--danger); }
.people { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.people h4 { margin: 10px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-radius: 10px; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who small { color: var(--text-3); font-variant-numeric: tabular-nums; }
.person .select { height: 32px; }
.id-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .06em;
}
.big-id { font-size: 40px; font-weight: 800; letter-spacing: .14em; text-align: center; color: var(--accent); font-variant-numeric: tabular-nums; margin: 6px 0 4px; }

/* ---------- загрузки ---------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 3500; display: none; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); backdrop-filter: blur(2px);
}
.drop-overlay.on { display: grid; }
.drop-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 48px; border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow-2); border: 2px dashed var(--accent);
}
.drop-box svg.ic { width: 36px; height: 36px; color: var(--accent); }
.drop-box small { color: var(--text-3); }
.uploads {
  position: fixed; right: 20px; bottom: 20px; z-index: 1900; width: min(380px, calc(100vw - 24px));
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--border); overflow: hidden;
}
.up-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 16px; background: var(--surface-2); font-weight: 700; }
.up-head span { flex: 1; }
.up-list { max-height: 300px; overflow: auto; }
.up-list.min { display: none; }
.up-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 10px 10px 14px; border-top: 1px solid var(--border); }
.up-item .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-item .st { grid-column: 2; font-size: 12px; color: var(--text-3); }
.up-item .bar { grid-column: 2; height: 4px; border-radius: 9px; background: var(--border); overflow: hidden; }
.up-item .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up-item.done .bar i { background: var(--k-sheet); }
.up-item.err .st { color: var(--danger); }
.up-item .fi { grid-row: span 3; }
.up-item .icon-btn { grid-row: span 3; width: 30px; height: 30px; }

/* ---------- тосты ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; padding: 12px 18px; border-radius: 12px; background: #1d2127; color: #f3f4f6; font-weight: 600;
  box-shadow: var(--shadow-2); animation: rise .2s; max-width: min(520px, calc(100vw - 32px));
}
.toast.err { background: #a52a2a; }

/* ============================================================
   Просмотрщик
   ============================================================ */
.viewer { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; animation: fade .15s; background: var(--bg); }
.viewer.media { background: #0b0c0f; color: #eef0f3; --text-2: #b5bcc6; --hover: rgba(255,255,255,.08); }
.v-top { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px; flex: none; border-bottom: 1px solid var(--border); background: var(--surface); }
.viewer.media .v-top { background: transparent; border-color: rgba(255,255,255,.06); }
.viewer.media .v-top .icon-btn { color: #d4d8de; }
.viewer.media .v-top .btn { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.viewer.media .v-top .btn:hover { background: rgba(255,255,255,.14); }
.v-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.v-title .t { min-width: 0; }
.v-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-title small { display: block; font-size: 12px; color: var(--text-3); }
.viewer.media .v-title small { color: #8f97a3; }
.v-title small.dirty { color: var(--k-audio); }
.v-actions { display: flex; align-items: center; gap: 6px; }
.v-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.v-center { flex: 1; display: grid; place-items: center; padding: 24px; text-align: center; min-height: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(127,127,127,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.v-stage { flex: 1; overflow: hidden; display: grid; place-items: center; touch-action: none; user-select: none; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; cursor: zoom-in; }
.v-stage.zoomed img { cursor: grab; }
.zoom-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; pointer-events: none; }

.media-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 0 12px; }
.v-video {
  width: 100%; height: 100%; max-height: calc(100dvh - 72px); background: #000; outline: none;
  /* держим видео на отдельном GPU-слое — плавная прокрутка и перемотка */
  transform: translateZ(0); will-change: transform; backface-visibility: hidden;
}
.prep {
  width: min(440px, calc(100% - 32px)); padding: 26px; border-radius: 18px; text-align: left;
  background: #16181d; border: 1px solid rgba(255,255,255,.07);
}
.prep h4 { margin: 0 0 4px; font-size: 16px; color: #fff; }
.prep p { margin: 0 0 16px; color: #9ba3ae; font-size: 13px; }
.prep .meter { background: rgba(255,255,255,.1); height: 8px; }
.prep .meter i { transition: width .5s; }
.prep .row2 { display: flex; justify-content: space-between; font-size: 12px; color: #9ba3ae; }
.gpu-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(43,179,155,.15); color: #4fd1b8; }

.audio-card { width: min(480px, calc(100% - 32px)); padding: 32px; border-radius: 22px; background: #16181d; text-align: center; }
.audio-card .disc {
  width: 132px; height: 132px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #16181d 18%, transparent 19%), conic-gradient(from 0deg, var(--k-audio), #f6c453, var(--k-video), var(--k-audio));
  animation: spin 7s linear infinite; animation-play-state: paused;
}
.audio-card .disc.playing { animation-play-state: running; }
.audio-card b { display: block; font-size: 17px; margin-bottom: 18px; color: #fff; word-break: break-word; }
.audio-card audio { width: 100%; }

.pdf-frame { flex: 1; width: 100%; border: 0; background: #2a2d33; }
.pdf-pages { flex: 1; overflow: auto; padding: 16px 12px 40px; display: flex; flex-direction: column; align-items: center; gap: 12px; background: #2a2d33; }
.pdf-pages .pg { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); width: 100%; max-width: 1000px; }
.pdf-pages canvas { display: block; width: 100%; height: auto; }

.dl-card { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dl-card b { font-size: 17px; word-break: break-word; }

/* ---------- редактор документов ---------- */
.doc-tools {
  display: flex; align-items: center; gap: 2px; padding: 6px 10px; flex: none; overflow-x: auto; scrollbar-width: thin;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.doc-tools .sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; flex: none; }
.tb {
  min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; position: relative;
}
.tb:hover { background: var(--hover); color: var(--text); }
.tb.on { background: var(--accent-soft); color: var(--accent); }
.tb svg.ic { width: 18px; height: 18px; }
.tb input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tb .sw { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 2px; }
.doc-tools .select { height: 32px; font-size: 13px; flex: none; }
.doc-frame { flex: 1; width: 100%; border: 0; background: var(--page-canvas); }

/* ---------- таблицы ---------- */
.sheet { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.sheet-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex: none; }
.sheet-ref { width: 74px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.fx-label { font-style: italic; font-weight: 700; color: var(--text-3); padding: 0 4px; font-family: Georgia, serif; }
.sheet-fx { flex: 1; height: 30px; border: 1px solid var(--border); border-radius: 7px; padding: 0 10px; background: var(--surface); outline: none; font-family: var(--mono); font-size: 13px; }
.sheet-fx:focus { border-color: var(--accent); }
.sheet-scroll { flex: 1; overflow: auto; min-height: 0; outline: none; position: relative; }
table.grid-t { border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
.grid-t th, .grid-t td {
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: 26px; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 104px; max-width: 104px; min-width: 104px;
}
.grid-t thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: 12px; text-align: center; }
.grid-t tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: 12px; text-align: center; width: 50px; min-width: 50px; max-width: 50px; }
.grid-t thead th.corner { left: 0; z-index: 3; width: 50px; min-width: 50px; max-width: 50px; }
.grid-t td { background: var(--surface); cursor: cell; }
.grid-t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-t td.fx { color: var(--accent); font-style: italic; }
.grid-t td.sel { outline: 2px solid var(--accent); outline-offset: -2px; position: relative; z-index: 1; }
.grid-t td.edit { outline: 2px solid var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.15); overflow: visible; background: var(--surface); white-space: pre; z-index: 2; position: relative; }
.grid-t th.hl { background: var(--accent-soft); color: var(--accent); }
.sheet-tabs { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-top: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; flex: none; }
.sheet-tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; font-weight: 650; font-size: 13px; color: var(--text-2); flex: none; }
.sheet-tabs button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
.sheet-note { font-size: 12px; color: var(--text-3); padding: 0 10px; margin-left: auto; flex: none; }
.more-rows { margin: 10px 60px 30px; }

/* ---------- редактор кода ---------- */
.code-host { flex: 1; min-height: 0; }
.code-host .CodeMirror { height: 100%; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; background: var(--surface); color: var(--text); }
.code-host .CodeMirror-gutters { background: var(--surface-2); border-right: 1px solid var(--border); }
.code-host textarea.plain { width: 100%; height: 100%; border: 0; outline: none; resize: none; padding: 16px; font: 13.5px/1.55 var(--mono); background: var(--surface); color: var(--text); }

/* ============================================================
   Вход / регистрация
   ============================================================ */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden;
  background: #0d1f1c; color: #e6f2ef;
}
.auth-hero::before {
  content: ""; position: absolute; width: 620px; height: 620px; right: -220px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43,179,155,.35), transparent 65%);
}
.auth-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(120deg, #000, transparent 70%);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand { color: #fff; margin-bottom: 28px; }
.auth-hero h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 0; max-width: 560px; }
.auth-hero p { font-size: 16px; color: #a9c4be; max-width: 500px; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; color: #cfe3de; font-weight: 600; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points .dot { width: 10px; height: 10px; border-radius: 3px; }
.k-video { background: var(--k-video); } .k-doc { background: var(--k-doc); } .k-sheet { background: var(--k-sheet); }
.auth-card-wrap { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 20px; }
.alert { padding: 11px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 650; margin-bottom: 14px; }
.auth-card .seg-btn { text-decoration: none; }

/* ---------- публичная страница ---------- */
.share-page { display: flex; flex-direction: column; min-height: 100dvh; }
.share-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.share-main { flex: 1; display: grid; place-items: center; padding: 20px; }
.share-card { width: min(440px, 100%); padding: 32px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-2); text-align: center; }
.share-card h1 { font-size: 20px; margin: 18px 0 6px; word-break: break-word; }
.share-card .acts { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.share-thumb { width: 100%; height: 200px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.share-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Мобильная версия
   ============================================================ */
.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 1500; background: var(--surface);
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-2);
  }
  .sidebar.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; z-index: 1400; background: rgba(0,0,0,.4); }
  .topbar { padding: 10px 12px; }
  .content { padding: 0 12px 90px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card-thumb { height: 108px; }
  .row { grid-template-columns: minmax(0,1fr) 44px; }
  .row .cell { display: none; }
  .v-top .btn .lbl { display: none; }
  .v-top .btn { width: 38px; padding: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 24px 28px; }
  .auth-hero .brand { margin-bottom: 10px; }
  .auth-points { display: none; }
  .title-row h1 { font-size: 19px; }
}
.sheet-sink { position: absolute; left: 0; top: 0; width: 24px; height: 24px; opacity: 0; padding: 0; border: 0; resize: none; pointer-events: none; z-index: 0; font-size: 16px; }
.search { min-width: 0; }

/* ============================================================
   Зона загрузки в списке файлов
   ============================================================ */
.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong); color: var(--text-2); cursor: pointer; background: transparent;
  transition: border-color .15s, background .15s, padding .2s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone svg.ic { width: 26px; height: 26px; color: var(--accent); flex: none; }
.dropzone span { flex: 1; }
.dropzone b { color: var(--text); }
.dropzone small { color: var(--text-3); white-space: nowrap; }
body.dragging .dropzone { border-color: var(--accent); background: var(--accent-soft); padding: 34px 18px; }
body.dragging .files { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--radius); }
.drop-overlay { background: color-mix(in srgb, var(--accent) 10%, transparent); }
@media (pointer: coarse) { .dropzone small { display: none; } }

/* ============================================================
   Видеоплеер
   ============================================================ */
.media-stage { padding: 0 16px 16px; }
.player {
  position: relative; width: 100%; height: 100%; max-height: calc(100dvh - 76px); background: #000; border-radius: 16px; overflow: hidden;
  outline: none; user-select: none; -webkit-user-select: none; color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.45);
  --pa: #2bd4b4;
}
.player.fs { border-radius: 0; max-height: none; }
.pl-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000;
  /* отдельный GPU-слой: браузер декодирует H.264 видеокартой и не перерисовывает кадр при показе панели */
  transform: translateZ(0); will-change: transform; backface-visibility: hidden;
}
.pl-shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(180deg, rgba(0,0,0,.55) 0, transparent 18%, transparent 62%, rgba(0,0,0,.78) 100%); opacity: 1; transition: opacity .35s; }
.player.playing.idle { cursor: none; }
.player.playing.idle .pl-shade, .player.playing.idle .pl-bar, .player.playing.idle .pl-top { opacity: 0; pointer-events: none; }
.pl-top { position: absolute; left: 0; right: 0; top: 0; padding: 18px 22px; font-size: 16px; display: none; transition: opacity .35s; }
.player.fs .pl-top { display: block; }
.pl-big {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: rgba(20,22,26,.55); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 10px 30px rgba(0,0,0,.35); transition: transform .2s, opacity .25s, background .2s;
}
.pl-big svg.ic { width: 34px; height: 34px; fill: #fff; stroke: none; margin-left: 5px; }
.pl-big:hover { transform: scale(1.06); background: var(--pa); color: #04201b; }
.pl-big:hover svg.ic { fill: #04201b; }
.player.playing .pl-big, .player.preparing .pl-big { opacity: 0; pointer-events: none; transform: scale(.85); }
.pl-spin { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
.pl-spin .spinner { width: 54px; height: 54px; border-width: 4px; border-color: rgba(255,255,255,.18); border-top-color: var(--pa); }
.player.loading.playing .pl-spin { display: grid; }
.pl-flash {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; background: rgba(15,17,20,.62); backdrop-filter: blur(8px); font-weight: 800; font-size: 18px;
  opacity: 0; pointer-events: none;
}
.pl-flash svg.ic { width: 26px; height: 26px; }
.pl-flash.go { animation: plflash .7s ease-out; }
@keyframes plflash { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; } }
.pl-pill {
  position: absolute; top: 16px; right: 16px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(15,17,20,.7); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;
}
.pl-over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,6,8,.72); backdrop-filter: blur(6px); z-index: 4; }

.pl-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px 10px; transition: opacity .35s; z-index: 3; }
.pl-seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.pl-rail { position: relative; width: 100%; height: 4px; border-radius: 99px; background: rgba(255,255,255,.22); transition: height .15s; }
.pl-seek:hover .pl-rail, .player.tipping .pl-rail { height: 6px; }
.pl-buf, .pl-fill, .pl-hover { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; width: 0; }
.pl-buf { background: rgba(255,255,255,.35); }
.pl-hover { background: rgba(255,255,255,.22); }
.pl-fill { background: var(--pa); box-shadow: 0 0 12px rgba(43,212,180,.5); }
.pl-knob {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(43,212,180,.35), 0 2px 6px rgba(0,0,0,.4); transform: scale(0); transition: transform .15s;
}
.pl-seek:hover .pl-knob, .player.tipping .pl-knob { transform: scale(1); }
.pl-tip {
  position: absolute; bottom: 26px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.player.tipping .pl-tip { display: flex; }
.pl-thumb { display: none; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 8px 24px rgba(0,0,0,.5); background-color: #111; background-repeat: no-repeat; }
.pl-tip span { padding: 3px 8px; border-radius: 6px; background: rgba(15,17,20,.85); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-row { display: flex; align-items: center; gap: 2px; height: 46px; }
.pl-btn, .pl-chip {
  height: 40px; min-width: 40px; border: 0; border-radius: 10px; background: transparent; color: #fff; display: inline-grid; place-items: center;
  transition: background .15s, transform .1s;
}
.pl-btn:hover, .pl-chip:hover { background: rgba(255,255,255,.14); }
.pl-btn:active { transform: scale(.92); }
.pl-btn svg.ic { width: 24px; height: 24px; stroke-width: 1.9; }
.pl-btn[data-a="play"] svg.ic { fill: #fff; stroke: none; }
.pl-chip { display: inline-flex; gap: 6px; padding: 0 10px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.pl-chip b { font-size: 10px; padding: 2px 4px; border-radius: 4px; background: var(--pa); color: #04201b; letter-spacing: .04em; }
.pl-vol { display: flex; align-items: center; }
.pl-vol input {
  width: 0; opacity: 0; transition: width .2s, opacity .2s; appearance: none; height: 4px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255,255,255,.25) var(--v, 100%));
}
.pl-vol:hover input, .pl-vol input:focus { width: 84px; opacity: 1; margin: 0 8px 0 2px; }
.pl-vol input::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.pl-vol input::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.pl-time { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 10px; white-space: nowrap; color: #f1f3f5; }
.pl-time i { font-style: normal; color: #9aa3ad; margin: 0 2px; }
.pl-sp { flex: 1; }
.pl-menu {
  position: absolute; right: 14px; bottom: 74px; z-index: 5; min-width: 232px; max-height: calc(100% - 100px); overflow: auto; padding: 6px;
  border-radius: 14px; background: rgba(22,24,29,.94); backdrop-filter: blur(16px); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 18px 40px rgba(0,0,0,.5);
  animation: pop .14s ease-out;
}
.pl-mh { padding: 8px 12px 6px; font-size: 12px; font-weight: 800; color: #8f97a3; text-transform: uppercase; letter-spacing: .06em; }
.pl-mi {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border: 0;
  border-radius: 9px; background: transparent; color: #eef0f3; font-weight: 700; font-size: 14px; text-align: left;
}
.pl-mi:hover { background: rgba(255,255,255,.08); }
.pl-mi.on { color: var(--pa); }
.pl-mi svg.ic { width: 18px; height: 18px; color: var(--pa); }
.pl-mi em { font-style: normal; font-weight: 600; color: #8f97a3; font-size: 12.5px; margin-left: 4px; }
.pl-mi sup { font-size: 9px; font-weight: 800; color: var(--pa); margin-left: 3px; }
.pl-mi small { font-size: 12px; color: #8f97a3; font-weight: 600; }
.pl-mnote { padding: 8px 12px 6px; font-size: 11.5px; color: #7c8591; line-height: 1.4; border-top: 1px solid rgba(255,255,255,.07); margin-top: 4px; }
@media (max-width: 860px) {
  .media-stage { padding: 0; }
  .player { border-radius: 0; max-height: calc(100dvh - 60px); }
  .pl-btn[data-a="back"], .pl-btn[data-a="fwd"], .pl-btn[data-a="pip"], .pl-vol input { display: none; }
  .pl-bar { padding: 0 8px 4px; }
  .pl-time { font-size: 12.5px; padding: 0 4px; }
  .pl-big { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
}

/* ============================================================
   Документы (DOCX в браузере)
   ============================================================ */
.doc-scroll { flex: 1; overflow: auto; background: var(--page-canvas); }
.doc-host .docx-wrapper { background: transparent !important; padding: 28px 16px 80px !important; }
.doc-host section.docx {
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 10px 30px rgba(0,0,0,.08) !important; margin: 0 auto 24px !important; color: #111;
}
.doc-host [contenteditable] { outline: none; caret-color: #0e7c6b; }
.doc-host [contenteditable]:focus-within { outline: none; }
.doc-host section.docx > header, .doc-host section.docx > footer { opacity: .75; transition: opacity .15s; }
.doc-host section.docx > header:focus, .doc-host section.docx > footer:focus { opacity: 1; outline: 1px dashed #9aa3ad; outline-offset: 4px; }
.doc-host ::selection { background: #bfe6dc; }
@media (max-width: 860px) {
  .doc-host .docx-wrapper { padding: 8px 0 60px !important; }
  .doc-host section.docx { zoom: .5; }
}

/* ============================================================
   Редактор презентаций
   ============================================================ */
.sl-tools .btn-sm { margin-right: 4px; }
.sl-main { flex: 1; min-height: 0; display: flex; }
.sl-list { width: 212px; flex: none; overflow-y: auto; padding: 14px 12px 20px 8px; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.sl-th { position: relative; display: flex; gap: 8px; cursor: pointer; align-items: flex-start; }
.sl-th .sl-num { width: 18px; text-align: right; font-size: 12px; font-weight: 700; color: var(--text-3); padding-top: 2px; flex: none; }
.sl-th-in { position: relative; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); background: #fff; pointer-events: none; }
.sl-th.on .sl-th-in { box-shadow: 0 0 0 2.5px var(--accent); }
.sl-th.on .sl-num { color: var(--accent); }
.sl-th.drop .sl-th-in { box-shadow: 0 -4px 0 0 var(--accent), 0 0 0 1px var(--border); }
.sl-th:hover:not(.on) .sl-th-in { box-shadow: 0 0 0 1.5px var(--border-strong); }
.sl-add { margin-left: 26px; height: 36px; border-radius: 8px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--text-2); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sl-add:hover { border-color: var(--accent); color: var(--accent); }
.sl-add svg.ic { width: 16px; height: 16px; }
.sl-stage { flex: 1; min-width: 0; display: grid; place-items: center; background: var(--page-canvas); overflow: hidden; }
.sl-frame { position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 18px 40px rgba(0,0,0,.12); background: #fff; }
.sl-slide { position: absolute; left: 0; top: 0; overflow: hidden; background: #fff; color: #111; font-family: Calibri, Carlito, Arial, sans-serif; line-height: 1.12; }
.sl-el { position: absolute; transform-origin: center; }
.sl-el img { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; }
.sl-shape { position: absolute; inset: 0; pointer-events: none; }
.sl-tx { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; word-wrap: break-word; outline: none; }
.sl-tx p, .sl-tx li, .sl-tx div { margin: 0; }
.sl-tx ul, .sl-tx ol { margin: 0; padding-left: 1.2em; }
.sl-el.editing .sl-tx { cursor: text; overflow: visible; }
.sl-frame .sl-el { cursor: move; }
.sl-sel { position: absolute; pointer-events: none; box-shadow: 0 0 0 calc(2px * var(--inv, 1)) var(--accent); z-index: 50; }
.sl-sel.editing { box-shadow: 0 0 0 calc(1.5px * var(--inv, 1)) var(--accent); }
.sl-sel i {
  position: absolute; width: calc(11px * var(--inv, 1)); height: calc(11px * var(--inv, 1)); margin: calc(-5.5px * var(--inv, 1)) 0 0 calc(-5.5px * var(--inv, 1));
  background: #fff; border: calc(2px * var(--inv, 1)) solid var(--accent); border-radius: 50%; pointer-events: auto;
}
.sl-sel.editing i { display: none; }
.sl-sel .h-nw { left: 0; top: 0; cursor: nwse-resize; } .sl-sel .h-n { left: 50%; top: 0; cursor: ns-resize; }
.sl-sel .h-ne { left: 100%; top: 0; cursor: nesw-resize; } .sl-sel .h-e { left: 100%; top: 50%; cursor: ew-resize; }
.sl-sel .h-se { left: 100%; top: 100%; cursor: nwse-resize; } .sl-sel .h-s { left: 50%; top: 100%; cursor: ns-resize; }
.sl-sel .h-sw { left: 0; top: 100%; cursor: nesw-resize; } .sl-sel .h-w { left: 0; top: 50%; cursor: ew-resize; }
.sl-guide { position: absolute; z-index: 49; pointer-events: none; background: #e0336e; }
.sl-guide.x { top: 0; bottom: 0; width: calc(1px * var(--inv, 1)); }
.sl-guide.y { left: 0; right: 0; height: calc(1px * var(--inv, 1)); }
.sl-present { position: fixed; inset: 0; z-index: 6000; background: #000; cursor: pointer; overflow: hidden; outline: none; }
.sl-present .sl-slide { box-shadow: none; }
.sl-pcount { position: absolute; right: 18px; bottom: 14px; color: rgba(255,255,255,.55); font-weight: 700; font-size: 13px; z-index: 2; }
.sl-pclose { position: absolute; right: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; opacity: .0; transition: opacity .2s; }
.sl-present:hover .sl-pclose { opacity: 1; }
@media (max-width: 860px) {
  .sl-main { flex-direction: column-reverse; }
  .sl-list { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--border); padding: 10px; height: 118px; }
  .sl-th { flex: none; } .sl-th .sl-num { display: none; } .sl-add { margin: 0; width: 90px; flex: none; }
}
.v-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .v-actions .btn { width: 38px; padding: 0; } .v-actions { gap: 4px; } }
.spinner.sm{width:16px;height:16px;border-width:2px;display:inline-block;vertical-align:-3px;margin-right:10px;border-color:rgba(255,255,255,.25);border-top-color:#fff}
.diag { display: grid; gap: 1px; border-radius: 10px; overflow: hidden; background: var(--border); }
.diag div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 8px 12px; background: var(--surface); font-size: 13px; }
.diag b { color: var(--text-2); font-weight: 700; }
.diag span { word-break: break-all; font-family: var(--mono); font-size: 12.5px; }
.diag-log { max-height: 180px; overflow: auto; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font: 11.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.dropzone small a { color: var(--accent); font-weight: 700; }

/* ============================================================
   Папки, выделение, перемещение
   ============================================================ */
.title-row h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.crumb { font: inherit; font-weight: 800; letter-spacing: -.02em; color: var(--text-3); background: none; border: 0; padding: 4px 8px; border-radius: 8px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.crumb:hover { background: var(--hover); color: var(--text); }
.crumb.cur { color: var(--text); padding-left: 8px; }
.crumb:first-child { padding-left: 0; }
button.crumb:first-child:hover { padding-left: 8px; margin-left: -8px; }
.crumb-sep { color: var(--text-3); display: inline-flex; }
.crumb-sep svg.ic { width: 16px; height: 16px; }
.crumb.drop-hot { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.sect { font-size: 12.5px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 4px 2px 10px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 12px; margin-bottom: 22px; }
.fcard {
  position: relative; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 6px 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: box-shadow .15s, border-color .15s, background .15s;
  animation: rise .3s cubic-bezier(.2,.8,.2,1) both;
}
.fcard:hover { box-shadow: var(--shadow-1); border-color: var(--border-strong); }
.fcard .fic { display: flex; flex: none; }
.fc-t { flex: 1; min-width: 0; }
.fc-m { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .icon-btn { width: 32px; height: 32px; }
.fcard.drop-hot, .row.drop-hot { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* флажок выделения */
.ck {
  position: absolute; z-index: 3; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong); padding: 0;
  background: var(--surface); color: transparent; display: grid; place-items: center; opacity: 0; transition: opacity .12s, background .12s, border-color .12s;
}
.ck svg.ic { width: 15px; height: 15px; stroke-width: 3; }
.card .ck { left: 10px; top: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.fcard .ck { left: 17px; top: 50%; margin-top: -12px; }
.fcard .fic { transition: opacity .12s; }
.fcard:hover .fic, .fcard.selected .fic, body.selecting .fcard .fic { opacity: 0; }
.row .ck { position: static; flex: none; opacity: .0; width: 20px; height: 20px; border-radius: 6px; }
.card:hover .ck, .fcard:hover .ck, .row:hover .ck, body.selecting .ck { opacity: 1; }
.selected .ck { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); transform: none; }
.fcard.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.row.selected { background: var(--accent-soft); }
.row .name .nm { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .name small.path { color: var(--text-3); font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 40%; }
@media (pointer: coarse) { .row .ck { display: none; } body.selecting .row .ck { display: grid; } .card .ck, .fcard .ck { opacity: 0; } .fcard:hover .fic { opacity: 1; } body.selecting .card .ck, body.selecting .fcard .ck, .selected .ck { opacity: 1; } body.selecting .fcard .fic { opacity: 0; } }

.chips.selbar {
  align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 14px; background: var(--accent-soft); overflow: visible; flex-wrap: wrap;
  animation: pop .15s ease-out;
}
.selbar .selcount { color: var(--accent); }
.selbar .selsize { font-size: 13px; }
.selbar .btn { background: var(--surface); }
.btn-danger-soft { color: var(--danger) !important; }
.btn-danger-soft:hover { background: var(--danger-soft) !important; }
.ckbox { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--accent); background: var(--surface); color: transparent; display: grid; place-items: center; padding: 0; }
.ckbox svg.ic { width: 15px; height: 15px; stroke-width: 3; }
.ckbox.on { background: var(--accent); color: #fff; }
@media (max-width: 860px) { .selbar .lbl, .selbar .selsize { display: none; } .selbar .btn { width: 38px; padding: 0; } }

.drag-ghost { position: fixed; top: -100px; left: -100px; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-2); }
.drop-overlay.to-folder { background: transparent; backdrop-filter: none; }
.drop-overlay.to-folder .drop-box { display: none; }

/* дерево папок в «Переместить» */
.tree { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.tree-row { display: flex; align-items: center; gap: 8px; height: 38px; padding-right: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.tree-row:hover { background: var(--hover); }
.tree-row.sel { background: var(--accent-soft); color: var(--accent); }
.tree-row.off { opacity: .4; cursor: not-allowed; }
.tree-row svg.ic { width: 18px; height: 18px; color: var(--k-folder-dark); }
.tree-row .tw { width: 18px; display: inline-flex; transform: rotate(180deg); transition: transform .15s; color: var(--text-3); }
.tree-row .tw svg.ic { color: var(--text-3); width: 14px; height: 14px; }
.tree-row.open .tw { transform: rotate(270deg); }
.tree-row .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-row.root { font-weight: 800; }
.tree-label { padding: 12px 10px 4px; font-size: 12px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

/* программы и APK */
.hash-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.hash-box code.hash { font: 11.5px/1.4 var(--mono); color: #9ba3ae; word-break: break-all; max-width: 520px; }

/* публичная папка */
.share-main.share-folder { display: block; place-items: initial; padding: 8px 20px 40px; }
.sf-wrap { max-width: 1000px; margin: 0 auto; }
.sf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 16px; }
.sf-crumbs { display: flex; align-items: center; flex: 1; min-width: 0; font-size: 20px; }
.sf-row { grid-template-columns: minmax(0,1fr) 160px 120px 44px; }
@media (max-width: 860px) { .sf-row { grid-template-columns: minmax(0,1fr) 44px; } }
