/* Reel.Диск — палитра и логотип экосистемы Reel (как на megabitee.ru). Основа взята из Reel.Пасты. */
@font-face { font-family: 'Advaken Sans'; src: url(/ui/advaken-sans.otf) format('opentype'); font-display: swap; }
:root {
  --bg: #050a05; --bg-1: #0a110a; --bg-2: #0f180f; --bg-3: #152115;
  --bg-hover: rgba(226, 236, 223, .06);
  --line: rgba(143, 195, 31, .12); --line-strong: rgba(143, 195, 31, .22);
  --text: #e2ecdf; --text-2: #a9b8a4; --text-3: #6f8068;
  --green: #8fc31f; --green-bright: #a8dc3a; --green-dim: #46621a; --danger: #e25c50; --amber: #e0a83a;
  /* оттенок сервиса: второй тон свечения фона и плитки иконок файлов */
  --disk: #7a8cf5; --disk-bright: #a3b0ff; --disk-tint: rgba(122, 140, 245, .14);
  --radius-s: 6px; --radius: 10px; --radius-l: 16px;
  --font: "Space Grotesk", "Golos Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-logo: 'Advaken Sans', var(--font);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow-x: hidden;
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.glow { position: absolute; inset: 0 0 auto; height: 560px; pointer-events: none;
  background: radial-gradient(600px 380px at 18% 0%, rgba(143, 195, 31, .15), transparent 60%), radial-gradient(520px 340px at 88% 0%, rgba(122, 140, 245, .11), transparent 60%); }
.dim { color: var(--text-2); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── шапка ── */
.top { position: relative; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 16px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--bg) 0 22%, transparent 23%), conic-gradient(from 200deg, var(--green-bright), var(--green-dim), var(--green-bright));
  box-shadow: 0 0 18px rgba(143, 195, 31, .35); }
.brand-name, .logo { font-family: var(--font-logo); font-weight: 400; letter-spacing: .01em; color: var(--green); }
.brand-name { font-size: 18px; white-space: nowrap; }
.svc { color: var(--text); }
.top-nav { display: flex; gap: 2px; margin-left: 8px; }
.top-nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background-color .15s, color .15s; }
.top-nav a:hover { background: var(--bg-hover); color: var(--text); }
.top-nav a.on { background: rgba(143, 195, 31, .12); color: var(--green-bright); }
.top-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-user { display: flex; align-items: center; min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 12px 3px 3px; border-radius: 999px; background: rgba(0, 0, 0, .35); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.user-chip:hover { background: var(--bg-3); }
.user-chip .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }
.user-chip .pill { margin-left: 2px; flex: none; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--green), #4fa6a0); color: #0b1406; }
.avatar.photo { background: none; overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(143, 195, 31, .2); border-top-color: var(--green-bright); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── общие компоненты ── */
main { position: relative; z-index: 1; flex: 1; width: 100%; }
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 16px; animation: fade-up .4s var(--ease) both; }
@keyframes fade-up { 0% { opacity: 0; transform: translateY(8px); } }
h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sub { color: var(--text-2); font-size: 16px; max-width: 60ch; }
.kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.note, .meta { color: var(--text-3); font-size: 13px; }
.meta { margin-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background-color .16s var(--ease), box-shadow .16s; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--green); border-color: transparent; color: #0b1406; }
.btn-primary:hover { background: var(--green-bright); box-shadow: 0 6px 22px rgba(143, 195, 31, .3); }
.btn-primary:disabled:hover { background: var(--green); box-shadow: none; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-sm .ico { width: 17px; height: 17px; }
.btn.danger { color: var(--danger); border-color: rgba(226, 92, 80, .35); }
.btn.btn-danger { background: var(--danger); border-color: transparent; color: #1a0705; }
.btn.btn-danger:hover { background: #ee7166; }
.btn:focus-visible, .input:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); white-space: nowrap; }
.pill-prime { background: rgba(143, 195, 31, .16); color: var(--green-bright); }
.pill-warn { background: rgba(224, 168, 58, .16); color: var(--amber); }
.pill-bad { background: rgba(226, 92, 80, .16); color: #f08479; }
.pill-role { background: var(--disk-tint); color: var(--disk-bright); }
h1 .pill { vertical-align: middle; margin-left: 6px; letter-spacing: 0; }
.input { width: 100%; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--bg-1); }
.input::placeholder { color: var(--text-3); }
.link { color: var(--green-bright); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.icon-btn { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.bad:hover { background: rgba(226, 92, 80, .12); color: var(--danger); }
.icon-btn > span { display: none; }

/* мягкая тонированная плитка под иконку */
.tile { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--disk-tint); color: var(--disk-bright); }
.tile.green { background: rgba(143, 195, 31, .13); color: var(--green-bright); }
.tile.amber { background: rgba(224, 168, 58, .13); color: var(--amber); }
.tile.plain { background: var(--bg-3); color: var(--text-2); }
.tile.lg { width: 48px; height: 48px; border-radius: 14px; }
.tile.lg .ico { width: 24px; height: 24px; }
.tile.sm { width: 32px; height: 32px; border-radius: 10px; }
.tile.sm .ico { width: 17px; height: 17px; }

/* полоса заполнения */
.meter { height: 10px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.meter > i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--green-bright)); transition: width .4s var(--ease); }
.meter.zero > i { min-width: 0; }
.meter.warn > i { background: var(--amber); }
.meter.full > i { background: var(--danger); }
.meter.thin { height: 6px; }

.card { border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--bg-1); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 22px; background: var(--bg-3); border: 1px solid var(--line-strong); font-size: 14px; text-align: center; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); }
.toast.bad { border-color: rgba(226, 92, 80, .5); color: #f08479; }

/* ── гость ── */
.guest { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 7vh 0 4vh; }
.guest .logo { font-size: clamp(40px, 9vw, 72px); }
.guest h1:not(.logo) { font-size: clamp(22px, 3.4vw, 30px); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin: 10px 0 6px; text-align: left; }
.feature { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.feature div { display: flex; flex-direction: column; gap: 4px; }
.feature b { font-size: 15.5px; }
.feature span { color: var(--text-2); font-size: 13.5px; }

/* ── индикатор места ── */
.quota { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: linear-gradient(120deg, rgba(143, 195, 31, .07), rgba(122, 140, 245, .05) 70%), var(--bg-1); }
.quota-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.quota-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; }
.quota-used { font-size: 14px; color: var(--text-2); }
.quota-used b { font-size: 22px; letter-spacing: -.02em; color: var(--text); margin: 0 2px; }
.quota-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.quota-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-3); }
.quota-alert { font-size: 13.5px; color: #f08479; }
.quota-alert.warn { color: var(--amber); }

/* ── файлы: заголовок и инструменты ── */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-width: 0; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.crumbs a, .crumbs span.here { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--text-3); text-decoration: none; padding: 2px 6px; margin: 0 -6px; border-radius: 8px; transition: color .15s, background-color .15s; }
.crumbs a:hover { color: var(--text); background: var(--bg-hover); }
.crumbs .ico { width: 16px; height: 16px; color: var(--text-3); margin: 0 4px; }
.crumbs small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-3); margin-left: 8px; }
.bar-actions { display: flex; gap: 8px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.search .ico { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.search .input { height: 38px; padding: 0 14px 0 38px; border-radius: 999px; border-color: var(--line); font-size: 14px; }
.search .input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); cursor: pointer; }
.tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); }
.tabs-label { padding: 0 6px 0 10px; font-size: 12px; color: var(--text-3); }
.tab { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--bg-3); color: var(--green-bright); }
.tab .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.tab .ico.desc { transform: rotate(180deg); }

/* ── список файлов ── */
.files { display: flex; flex-direction: column; }
.files-head, .frow { display: grid; grid-template-columns: minmax(0, 1fr) 104px 164px 140px; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; }
.files-head { padding-top: 10px; padding-bottom: 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.frow { position: relative; border-top: 1px solid var(--line); transition: background-color .15s; }
.frow:hover { background: var(--bg-2); }
.frow:last-child { border-radius: 0 0 var(--radius-l) var(--radius-l); }
.frow-open { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; text-decoration: none; cursor: pointer; border-radius: 12px; }
.frow-text { display: flex; flex-direction: column; min-width: 0; }
.frow-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow-open:hover .frow-name { color: var(--green-bright); }
.frow-sub { display: none; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow-sub.has-path { display: block; }
.sub-meta { display: none; }
.frow-size, .frow-date { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.frow-acts { display: flex; justify-content: flex-end; gap: 1px; }
.frow-more { display: none; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 20px; text-align: center; color: var(--text-2); }
.empty b { font-size: 16px; color: var(--text); }
.empty span { font-size: 14px; max-width: 46ch; overflow-wrap: anywhere; }

/* ── очередь загрузок ── */
.uploads { display: flex; flex-direction: column; padding: 6px 0; }
.up-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; }
.up-head b { font-size: 14px; }
.up-head .dim { flex: 1; min-width: 0; font-size: 13px; }
.up { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; align-items: center; gap: 2px 12px; padding: 6px 10px 8px 16px; }
.up-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-info { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.up .meter { grid-column: 1 / 3; }
.up .icon-btn { grid-row: 1 / 3; grid-column: 3; }
.up.done .up-info { color: var(--green-bright); }
/* ошибка занимает место полосы — под именем файла, во всю ширину */
.up.error .up-info { grid-column: 1 / 3; grid-row: 2; color: #f08479; white-space: normal; }
.up.error .up-name { grid-column: 1 / 3; }
.up.error .meter { display: none; }
.up-note { padding: 4px 16px 8px; font-size: 13px; color: var(--text-2); }

.drop { position: fixed; inset: 12px; z-index: 40; display: grid; place-items: center; border-radius: 24px; border: 2px dashed var(--green); background: rgba(5, 10, 5, .88); pointer-events: none; }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; font-size: 18px; font-weight: 600; }
.drop-in span { font-size: 14px; font-weight: 400; color: var(--text-2); overflow-wrap: anywhere; }

/* ── диалоги ── */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(2, 5, 2, .74); animation: fade .18s both; }
@keyframes fade { 0% { opacity: 0; } }
.modal { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--bg-2); box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.modal p { color: var(--text-2); font-size: 14.5px; overflow-wrap: anywhere; }
.modal p b { color: var(--text); }
.modal .warn-text { color: var(--amber); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.field-err { color: #f08479 !important; font-size: 13px !important; }
.pick { display: flex; flex-direction: column; gap: 2px; min-height: 80px; overflow-y: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-1); }
.pick-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.pick-item .ico { color: var(--text-3); width: 18px; height: 18px; }
.pick-item .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pick-item small { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pick-item:hover { background: var(--bg-hover); }
.pick-item.on { background: rgba(143, 195, 31, .14); }
.pick-item.on .ico, .pick-item.on .pick-name { color: var(--green-bright); }
.pick-item:disabled { cursor: default; opacity: .55; background: transparent; }

/* ── просмотр картинок ── */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(2, 5, 2, .93); animation: fade .18s both; }
.lb-top { display: flex; align-items: center; gap: 6px; padding: 12px 14px 12px 20px; }
.lb-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .icon-btn { color: var(--text-2); width: 38px; height: 38px; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 16px 20px; }
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 96px); min-height: 0; object-fit: contain; border-radius: 10px; }
.lb-stage img.loading { opacity: 0; }
.lb-stage .spinner { position: absolute; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; background: rgba(15, 24, 15, .8); color: var(--text); border: 1px solid var(--line); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }

/* ── уведомления ReelID ── */
.bell-wrap { position: relative; display: flex; }
.bell { position: relative; flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s; }
.bell:hover, .bell[aria-expanded="true"] { background: var(--bg-3); color: var(--text); }
.bell-count { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--green); color: #0b1406; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notes { position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; width: 384px; max-height: min(70vh, 560px); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--bg-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); overflow: hidden; animation: fade-up .22s var(--ease) both; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.notes-head b { font-size: 15px; }
.notes-all { height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--green-bright); font-size: 13px; font-weight: 600; cursor: pointer; }
.notes-all:hover { background: rgba(143, 195, 31, .12); }
.notes-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.n-item { position: relative; display: flex; align-items: flex-start; border-radius: 12px; transition: background-color .15s; }
.n-item:hover { background: var(--bg-hover); }
.n-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 11px; padding: 10px 2px 10px 10px; text-decoration: none; border-radius: 12px; }
.n-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.n-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.n-body { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.n-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.n-item.new .n-title::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--green-bright); vertical-align: middle; }
.n-item .icon-btn { width: 30px; height: 30px; margin: 8px 6px 0 0; }
.n-item .icon-btn .ico { width: 15px; height: 15px; }
.notes .empty { padding: 34px 20px; }

/* ── админ: память сервера ── */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.privacy { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 13.5px; color: var(--text-2); }
.adm { display: flex; flex-direction: column; gap: 16px; }
.adm-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.panel { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; min-width: 0; }
.panel.wide { grid-column: span 4; }
.panel.half { grid-column: span 3; }
.panel.third { grid-column: span 2; }
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; color: var(--text-2); }
.hero b { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stack { display: flex; gap: 2px; height: 14px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.stack > i { display: block; height: 100%; min-width: 3px; border-radius: 3px; }
.stack > i.s-disk { background: var(--disk); }
.stack > i.s-other { background: var(--green); }
.stack > i.s-free { flex: 1; min-width: 0; background: transparent; }
.stack > i.s-reserve { background: repeating-linear-gradient(135deg, rgba(226, 236, 223, .34) 0 2px, transparent 2px 6px); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin: 0; }
.legend div { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13.5px; }
.legend dt { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend dd { margin: 0; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 3px; background: var(--bg-3); }
.sw.s-disk { background: var(--disk); }
.sw.s-other { background: var(--green); }
.sw.s-free { box-shadow: inset 0 0 0 1px var(--text-3); }
.sw.s-reserve { background: repeating-linear-gradient(135deg, rgba(226, 236, 223, .5) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--text-3); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stats dt { font-size: 12.5px; color: var(--text-3); }
.stats dd { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats.one { grid-template-columns: 1fr; }

.users-head, .urow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 90px; align-items: center; gap: 16px; padding: 10px 18px; }
.users-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.users-head span:last-child, .urow-files { text-align: right; }
.urow { border-top: 1px solid var(--line); }
.urow-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.urow-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow-who .dim { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 2; }
.urow-use { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.urow-use span { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.urow-use span b { color: var(--text); font-weight: 600; }
.urow-files { font-size: 14px; font-variant-numeric: tabular-nums; }
.urow-files small { display: none; }
.panel-title { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 6px; }
.panel-title h2 { font-size: 17px; }

.foot { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; color: var(--text-3); font-size: 12px; font-family: var(--font-mono); text-align: center; }
.foot nav { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--text-2); }

@media (max-width: 900px) {
  .panel.wide, .panel.half, .panel.third { grid-column: span 6; }
}
@media (max-width: 720px) {
  .top { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .top-nav { order: 3; width: 100%; margin: 0 -6px; overflow-x: auto; }
  /* логотип, колокольчик и чип — в одну строку: имя в чипе сжимается, а не переносит шапку */
  .top-side { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
  .user-chip .user-name { max-width: 11ch; }
  .user-chip .pill-role { display: none; }
  .bell-wrap { position: static; }
  .page { padding: 14px 16px 32px; gap: 14px; }
  .features { grid-template-columns: 1fr; }
  .feature { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
  .feature div { display: flex; flex-direction: column; gap: 2px; }

  .quota { padding: 14px; gap: 12px; align-items: flex-start; }
  .quota .tile.lg { width: 40px; height: 40px; border-radius: 12px; }
  .quota-used b { font-size: 19px; }
  .crumbs { font-size: 19px; }
  .bar-actions { width: 100%; }
  .bar-actions .btn { flex: 1; }
  .tools { gap: 8px; }
  .search { flex-basis: 100%; }
  .tabs { width: 100%; }
  .tabs .tab { flex: 1; justify-content: center; }

  /* в строке остаются имя и «ещё»: размер и дата уходят под имя, действия — в выпадающее меню */
  .files-head { display: none; }
  .frow { grid-template-columns: minmax(0, 1fr) 34px; padding: 8px 6px 8px 12px; gap: 6px; }
  .frow:first-child, .files-head + .frow { border-top: 0; }
  .frow-size, .frow-date { display: none; }
  .frow-sub, .sub-meta { display: block; }
  .sub-meta { display: inline; }
  .frow-more { display: inline-grid; }
  .frow-acts { display: none; position: absolute; right: 8px; top: calc(100% - 6px); z-index: 6; flex-direction: column; gap: 2px; min-width: 210px; padding: 6px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--bg-3); box-shadow: 0 18px 44px rgba(0, 0, 0, .6); }
  .frow.menu-open { z-index: 7; }
  .frow.menu-open .frow-acts { display: flex; }
  .frow.menu-up .frow-acts { top: auto; bottom: calc(100% - 6px); }
  .frow-acts .icon-btn { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border-radius: 11px; color: var(--text); font-size: 14.5px; font-weight: 500; }
  .frow-acts .icon-btn > span { display: inline; }
  .frow-acts .icon-btn.bad { color: #f08479; }

  .up { padding-left: 12px; }
  .up-head { padding-left: 12px; }
  .modal { padding: 18px; }
  .lb-nav.prev { left: 8px; }
  .lb-nav.next { right: 8px; }

  .notes { top: 56px; left: 10px; right: 10px; width: auto; max-height: calc(100dvh - 72px); } /* во всю ширину шапки, под строкой с колокольчиком */

  .adm-grid { gap: 12px; }
  .panel, .panel.third { grid-column: span 6; padding: 16px; }
  .hero b { font-size: 26px; }
  .legend { grid-template-columns: 1fr; }
  .users-head { display: none; }
  .urow { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .urow-who { flex-wrap: wrap; gap: 2px 8px; }
  .urow-files { grid-row: 1; grid-column: 2; font-size: 13px; color: var(--text-2); }
  .urow-files small { display: inline; font-size: inherit; }
  .urow-use { grid-column: 1 / 3; }
  .panel-title { padding: 14px 14px 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
