/* Boxlane — стили интерфейса. Светлая и тёмная темы переключаются автоматически по настройкам системы. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --surface-3: #e6e8f0;
  --border: #e3e5ec;
  --text: #1b1d24;
  --text-2: #5d6170;
  --text-3: #8b8fa0;
  --accent: #5b5bd6;
  --accent-hover: #4b4bc4;
  --accent-soft: #ececfd;
  --accent-text: #ffffff;
  --danger: #d93b3b;
  --danger-soft: #fdecec;
  --success: #1f9d55;
  --warning: #c27c0e;
  --shadow: 0 1px 2px rgba(20, 22, 40, .06), 0 4px 16px rgba(20, 22, 40, .06);
  --shadow-lg: 0 10px 40px rgba(20, 22, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  --topbar: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1c23;
    --surface-2: #22252e;
    --surface-3: #2b2f3a;
    --border: #2c2f3a;
    --text: #eceef4;
    --text-2: #a7abb9;
    --text-3: #747888;
    --accent: #7c7cf0;
    --accent-hover: #8f8ff5;
    --accent-soft: #272a4a;
    --danger: #f06363;
    --danger-soft: #3a2125;
    --success: #3ec27a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Загрузка страницы --- */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3);
  border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Кнопки и поля --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline { background: var(--surface); border-color: var(--border); }
.btn.icon-only { width: 40px; padding: 0; }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.small.icon-only { width: 32px; padding: 0; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, select.input {
  height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); outline: none; width: 100%; font-size: 16px; /* 16px — чтобы iPhone не увеличивал страницу */
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dropdown { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; min-width: 150px; }
.dropdown .icon { color: var(--text-3); transition: transform .15s; }
.dropdown.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dropdown.open .icon { transform: rotate(180deg); }
.menu button.selected { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* --- Экран входа --- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px;
  padding: 32px 28px; box-shadow: var(--shadow); }
.auth-logo { color: var(--text); width: max-content; display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; font-size: 20px; }
.auth-logo img { width: 36px; height: 36px; border-radius: 9px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card p { margin: 0 0 22px; color: var(--text-2); }

/* --- Каркас приложения --- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: calc(16px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .badge { margin-left: auto; background: var(--accent); color: var(--accent-text); font-size: 12px;
  border-radius: 10px; padding: 0 7px; min-width: 20px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.usage { padding: 14px 12px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.usage-row .usage-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.usage-row .usage-label span:first-child { color: var(--text-2); }
.usage-row .usage-label span:last-child { font-weight: 600; white-space: nowrap; }
.lvl-warn { color: var(--warning) !important; font-weight: 700; }
.lvl-full { color: var(--danger) !important; font-weight: 700; }
.usage-hint { font-size: 12px; margin-top: 5px; }
.usage.alert-warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface-2)); }
.usage.alert-full { background: var(--danger-soft); }
.bar.full > div { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.menu-btn.has-alert { position: relative; }
.menu-btn.has-alert::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.notice.warn-warn { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.notice.warn-warn .icon { color: var(--warning); }
.notice.warn-full { background: var(--danger-soft); }
.notice.warn-full .icon { color: var(--danger); }
.usage .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
svg.icon.small-icon { width: 15px; height: 15px; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; min-width: 2px; }
.bar.warn > div { background: var(--warning); }
.bar.full > div { background: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 24px 10px; min-height: var(--topbar);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px; height: 40px; background: var(--surface); }
.content { padding: 8px 24px calc(100px + var(--safe-bottom)); flex: 1; }

/* --- Заголовок папки --- */
.folder-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1; min-width: 0; font-size: 20px; font-weight: 650; }
.crumbs a { color: var(--text-2); padding: 2px 6px; border-radius: 6px; max-width: 240px; }
.crumbs a:hover { background: var(--surface-2); color: var(--text); }
.crumbs .sep { color: var(--text-3); display: flex; }
.crumbs .sep .icon { width: 16px; height: 16px; }
.crumbs .current { padding: 2px 6px; color: var(--text); max-width: 100%; }
.shared-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  padding: 4px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.shared-pill .icon { width: 15px; height: 15px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --- Список файлов --- */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-head, .row { display: grid; grid-template-columns: 36px 44px minmax(0, 1fr) 110px 140px 44px; align-items: center; gap: 8px; padding: 0 10px; }
.list-head { height: 40px; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); user-select: none; }
.list-head button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit;
  text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; }
.row { min-height: 56px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row.selected { background: var(--accent-soft); }
.row .thumb, .tile .thumb { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); overflow: hidden; position: relative; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.row .name .ellipsis { min-width: 0; }
.row .name .line { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.row, .tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.menu button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row .shared-icon { color: var(--accent); display: flex; }
.row .shared-icon .icon { width: 16px; height: 16px; }
.row .meta { color: var(--text-2); font-size: 14px; white-space: nowrap; }
.row .sub { display: none; }
.sel-box { display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .1s; }
.row:hover .sel-box, .row.selected .sel-box, .selecting .sel-box { opacity: 1; }
.sel-box input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.ic-folder { color: #e3a008; }
.ic-image { color: #2d9cdb; }
.ic-video { color: #e0457b; }
.ic-audio { color: #9b51e0; }
.ic-archive { color: #b7791f; }
.ic-pdf { color: #e5484d; }
.ic-doc { color: #3e7bfa; }
.ic-sheet { color: #1f9d55; }
.ic-code { color: #6b7280; }

/* --- Сетка (плитки) --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  cursor: pointer; position: relative; transition: transform .1s; }
.tile:active { transform: scale(.98); }
.tile.selected { outline: 3px solid var(--accent); }
.tile .thumb { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .icon { width: 44px; height: 44px; stroke-width: 1.4; }
.tile .tile-name { padding: 8px 10px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tile .sel-box { position: absolute; top: 8px; left: 8px; background: var(--surface); border-radius: 6px; padding: 3px; }
.tile:hover .sel-box, .tile.selected .sel-box { opacity: 1; }
.tile .more { position: absolute; top: 6px; right: 6px; background: var(--surface); background: color-mix(in srgb, var(--surface) 85%, transparent);
  opacity: 0; transition: opacity .1s; }
.tile:hover .more { opacity: 1; }

.empty { text-align: center; padding: 64px 16px; color: var(--text-2); }
.empty .icon { width: 56px; height: 56px; stroke-width: 1.2; color: var(--text-3); margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 18px; }

/* --- Панель выбора --- */
.selbar { position: sticky; top: calc(var(--topbar) + var(--safe-top)); z-index: 15; display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-text); border-radius: var(--radius); padding: 8px 10px 8px 16px;
  margin-bottom: 12px; box-shadow: var(--shadow); }
.selbar .btn { background: rgba(255,255,255,.16); color: inherit; }
.selbar .btn:hover { background: rgba(255,255,255,.26); }

/* --- Перетаскивание файлов --- */
.drop-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; pointer-events: none;
  background: rgba(91, 91, 214, .14); }
.drop-overlay.show { display: grid; }
.drop-overlay div { background: var(--surface); padding: 22px 30px; border-radius: 16px; box-shadow: var(--shadow-lg);
  border: 2px dashed var(--accent); font-weight: 600; display: flex; gap: 12px; align-items: center; }

/* --- Плавающая кнопка (телефон) --- */
.fab { display: none; position: fixed; right: 18px; bottom: calc(18px + var(--safe-bottom)); z-index: 30;
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-text);
  box-shadow: var(--shadow-lg); cursor: pointer; place-items: center; }
.fab .icon { width: 26px; height: 26px; stroke-width: 2.2; }

/* --- Всплывающие меню и окна --- */
.menu { position: fixed; z-index: 120; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); padding: 6px; min-width: 210px; animation: pop .12s ease-out; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-size: 15px; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 20, .45); display: grid; place-items: center;
  padding: 16px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 440px;
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .15s ease-out; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-body { padding: 10px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-size: 14px; }

/* --- Выбор папки (переместить) --- */
.picker-path { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 600; }
.picker-list { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 300px; overflow-y: auto; }
.picker-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0;
  border-bottom: 1px solid var(--border); background: none; cursor: pointer; text-align: left; }
.picker-list button:last-child { border-bottom: 0; }
.picker-list button:hover { background: var(--surface-2); }
.picker-list .disabled { opacity: .4; pointer-events: none; }
.picker-empty { padding: 18px; text-align: center; color: var(--text-3); }

/* --- Уведомления --- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-bottom)); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #24262f; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 14px; animation: pop .15s ease-out; pointer-events: auto; }
.toast.error { background: var(--danger); }

/* --- Панель загрузок --- */
.upanel { position: fixed; right: 20px; bottom: calc(20px + var(--safe-bottom)); z-index: 40; width: 380px; max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.upanel-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; cursor: pointer; user-select: none; }
.upanel-head .title { font-weight: 600; flex: 1; min-width: 0; }
.upanel-head .sub { font-size: 13px; color: var(--text-2); }
.upanel .bar { margin: 0 16px 12px; }
.upanel-list { max-height: 300px; overflow-y: auto; border-top: 1px solid var(--border); }
.uitem { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.uitem:last-child { border-bottom: 0; }
.uitem .info { flex: 1; min-width: 0; }
.uitem .info .n { font-size: 14px; font-weight: 500; }
.uitem .info .s { font-size: 12px; color: var(--text-2); }
.uitem .bar { margin: 6px 0 0; height: 4px; }
.uitem .state-done { color: var(--success); }
.uitem .state-error { color: var(--danger); }

/* --- Просмотр картинок и видео --- */
.viewer { position: fixed; inset: 0; z-index: 150; background: rgba(5, 6, 10, .94); display: flex; flex-direction: column;
  animation: fade .15s; color: #fff; }
.viewer-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 10px 18px; }
.viewer-top .title { flex: 1; min-width: 0; font-weight: 500; }
.viewer-top .btn { background: rgba(255,255,255,.1); color: #fff; }
.viewer-top .btn:hover { background: rgba(255,255,255,.2); }
.viewer-body { flex: 1; min-height: 0; display: flex; }
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; touch-action: pan-y pinch-zoom; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.viewer-stage .other { text-align: center; }
.viewer-stage .other { padding: 16px; }
.viewer-stage .other .icon { width: 64px; height: 64px; stroke-width: 1.2; margin-bottom: 14px; }
.viewer-stage .other .muted-light { color: rgba(255,255,255,.6); margin-top: 4px; }
.viewer-stage .other-actions { margin-top: 18px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.viewer-nav:hover { background: rgba(255,255,255,.22); }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }
.viewer-bottom { padding: 8px 18px calc(14px + var(--safe-bottom)); font-size: 13px; color: rgba(255,255,255,.65); text-align: center; }

/* --- Карточки (админка, настройки) --- */
.page-title { font-size: 22px; font-weight: 700; margin: 8px 0 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 17px; margin: 0 0 14px; }
.card-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.card-row .field { margin-bottom: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
  font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.green { background: var(--surface-2); background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.quota-edit { display: flex; gap: 6px; align-items: center; }
.quota-edit .input { width: 90px; height: 34px; font-size: 14px; padding: 0 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat .k { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.stat .v { font-size: 22px; font-weight: 700; }
.stat .bar { margin-top: 10px; }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); margin-bottom: 14px; flex-wrap: wrap; }
.notice .icon { color: var(--accent); }

/* --- Публичная страница --- */
.public-top { display: flex; align-items: center; gap: 12px; padding: calc(14px + var(--safe-top)) 24px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.public-top .brand { padding: 0; }
.public-account { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.brand-mini { display: flex; flex: none; }
.brand-mini img { width: 30px; height: 30px; border-radius: 8px; }
.public-wrap { max-width: 1100px; margin: 0 auto; padding: 16px 24px calc(60px + var(--safe-bottom)); }

/* --- Телефон --- */
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 110; transform: translateX(-105%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-shade { position: fixed; inset: 0; z-index: 105; background: rgba(10,12,20,.4); animation: fade .15s; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .desktop-only { display: none; }
  .content { padding: 4px 12px calc(110px + var(--safe-bottom)); }
  .fab { display: grid; }
  .crumbs { font-size: 18px; }
  .crumbs a { max-width: 120px; }
  .list-head { display: none; }
  .row { grid-template-columns: 44px minmax(0, 1fr) 40px; padding: 0 6px 0 12px; min-height: 62px; }
  .row .sel-box, .row .meta { display: none; }
  .selecting .row { grid-template-columns: 30px 44px minmax(0, 1fr) 40px; }
  .selecting .row .sel-box { display: flex; }
  .row .sub { display: block; font-size: 12px; color: var(--text-2); font-weight: 400; }
  .row .name { flex-direction: column; align-items: flex-start; gap: 0; }
  .row .name .line { display: flex; align-items: center; gap: 6px; max-width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .tile .more { opacity: 1; }
  .tile .sel-box { opacity: 0; }
  .selecting .tile .sel-box { opacity: 1; }
  .upanel { right: 12px; left: 12px; width: auto; bottom: calc(88px + var(--safe-bottom)); }
  .viewer-nav { display: none; }
  .modal-backdrop-sheet { align-items: end; padding: 0; }
  .modal-backdrop-sheet .modal { border-radius: 18px 18px 0 0; max-width: none; padding-bottom: var(--safe-bottom); }
  .public-top, .public-wrap { padding-left: 12px; padding-right: 12px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 861px) {
  .sidebar-shade { display: none; }
  .hide-desktop { display: none !important; }
}
