/* AMRA Drive — neutral glass design, dark & light. Brand: black + beige. */
:root {
  --bg: #0b0b0d; --text: #f2ede2; --muted: #9b9588; --accent: #d9c8a2; --accent-ink: #17140d;
  --glass: rgba(255,255,255,.055); --glass-hi: rgba(255,255,255,.09); --glass-b: rgba(255,255,255,.11);
  --strong: rgba(26,26,30,.88); --field: rgba(255,255,255,.06); --danger: #ff7b72; --ok: #8fd19e;
  --shadow: 0 18px 50px rgba(0,0,0,.45); --blob1: rgba(217,200,162,.20); --blob2: rgba(120,120,135,.22); --blob3: rgba(217,200,162,.10);
  --logo-filter: invert(1) brightness(1.15); --r: 20px; color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ece4d3; --text: #1b1915; --muted: #6f685b; --accent: #17150f; --accent-ink: #f6f0e3;
  --glass: rgba(255,255,255,.52); --glass-hi: rgba(255,255,255,.78); --glass-b: rgba(255,255,255,.75);
  --strong: rgba(250,246,238,.92); --field: rgba(255,255,255,.7); --danger: #c0392b; --ok: #2f7d46;
  --shadow: 0 18px 50px rgba(80,62,30,.18); --blob1: rgba(255,255,255,.9); --blob2: rgba(190,168,120,.45); --blob3: rgba(23,21,15,.10);
  --logo-filter: none; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; letter-spacing: -.01em; } h3 { font-size: 17px; }
code { background: var(--field); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; } .center-t { text-align: center; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* background glow */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs::before, .blobs::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); }
.blobs::before { width: 55vmax; height: 55vmax; left: -15vmax; top: -18vmax; background: radial-gradient(circle, var(--blob1), transparent 65%); animation: drift 26s ease-in-out infinite alternate; }
.blobs::after { width: 50vmax; height: 50vmax; right: -14vmax; bottom: -20vmax; background: radial-gradient(circle, var(--blob2), transparent 65%); animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(6vmax, 5vmax) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.glass { background: var(--glass); border: 1px solid var(--glass-b); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); box-shadow: var(--shadow); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--glass-b); background: var(--glass-hi); color: var(--text); padding: 10px 16px; border-radius: 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, opacity .15s; min-height: 42px; }
.btn:hover { background: var(--glass-b); } .btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; } .btn.primary:hover { opacity: .9; background: var(--accent); }
.btn.danger { color: var(--danger); } .btn.primary.danger, .modal-f .btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 11px; } .btn.big { padding: 18px; font-size: 17px; }
.btn.block { display: flex; width: 100%; } .btn.icon { padding: 0; width: 42px; flex: none; } .btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { background: transparent; border: 0; color: var(--text); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.icon-btn:hover { background: var(--glass-hi); } .icon-btn:disabled { opacity: .3; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; } .link:hover { color: var(--text); } .link:disabled { opacity: .5; cursor: default; text-decoration: none; }
input, select, textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--glass-b); border-radius: 13px; padding: 11px 14px; font: inherit; outline: none; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
select option { background: #1b1b1f; color: #f2ede2; } [data-theme="light"] select option { background: #fff; color: #1b1915; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; } label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; }
label.row { display: flex; align-items: center; gap: 8px; } label.row select { width: auto; }
.stack { display: grid; gap: 14px; } .row { display: flex; gap: 10px; align-items: center; } .row.between { justify-content: space-between; } .row.center { justify-content: center; } .row.wrap { flex-wrap: wrap; }
.alert { background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* logo / brand */
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; font-size: 17px; }
.logo-img { width: 38px; height: 38px; object-fit: contain; filter: var(--logo-filter); flex: none; }

/* auth + public pages */
.auth-body { min-height: 100dvh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
.auth-card { width: min(420px, 100%); border-radius: 28px; padding: 30px 28px; display: grid; gap: 18px; }
.auth-card.wide { width: min(560px, 100%); } .auth-card .brand { margin-bottom: 4px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 0; line-height: 1.6; }
.theme-fab { position: fixed; top: 14px; right: 14px; }
.pin { display: flex; gap: 8px; justify-content: space-between; cursor: text; }
.pin span { flex: 1; height: 58px; display: grid; place-items: center; font-size: 26px; font-weight: 700; background: var(--field); border: 1px solid var(--glass-b); border-radius: 14px; }
.pin span.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); } .pin span.fill { background: var(--glass-hi); }
.pin-hidden { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.share-file { display: flex; gap: 14px; align-items: center; min-width: 0; } .share-file > div { min-width: 0; } .share-file h1 { font-size: 19px; }
.share-prev { max-width: 100%; max-height: 50vh; border-radius: 14px; justify-self: center; } .share-pdf { width: 100%; height: 55vh; border: 0; border-radius: 14px; background: #fff; }
.share-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.share-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--field); min-width: 0; } .share-list li a:not(.btn) { display: flex; gap: 12px; align-items: center; text-decoration: none; min-width: 0; flex: 1; } .share-list li > .trunc { flex: 1; }
.ext { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 12px; font-size: 11px; font-weight: 800; letter-spacing: .04em; background: var(--glass-hi); color: var(--accent); flex: none; }
.ext.folder { color: var(--text); } .ext.big { min-width: 84px; height: 84px; font-size: 20px; border-radius: 22px; }

/* app shell */
body.app { overflow: hidden; }
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 16px; padding: 16px; height: 100dvh; }
.side { border-radius: 26px; padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.side .brand { padding: 2px 6px; }
.nav { display: grid; gap: 4px; flex: 1; align-content: start; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; text-decoration: none; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
.nav a:hover { background: var(--glass-hi); color: var(--text); } .nav a.on { background: var(--glass-hi); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); } .nav a.drop-hot { outline: 2px dashed var(--accent); }
.side-foot { display: grid; gap: 10px; border-top: 1px solid var(--glass-b); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; } .who { display: grid; min-width: 0; flex: 1; } .who b, .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who small { color: var(--muted); font-size: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; flex: none; } .avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.scrim { display: none; }
.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
.top { border-radius: 20px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; } .search span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; } .search input { padding-left: 42px; border-radius: 14px; background: var(--field); }
.seg { display: flex; background: var(--field); border-radius: 13px; padding: 3px; border: 1px solid var(--glass-b); } .seg button { border: 0; background: transparent; color: var(--muted); width: 38px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; } .seg button.on { background: var(--accent); color: var(--accent-ink); }
.content { flex: 1; overflow: auto; padding: 4px 4px 100px; min-height: 0; scrollbar-width: thin; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; font-size: 18px; font-weight: 700; min-height: 40px; }
.crumb { text-decoration: none; padding: 4px 10px; border-radius: 10px; color: var(--muted); } .crumb:hover { background: var(--glass-hi); color: var(--text); } .crumb.last { color: var(--text); } .crumb.drop-hot { outline: 2px dashed var(--accent); }
.sep { color: var(--muted); opacity: .6; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--glass); border: 1px solid var(--glass-b); color: var(--text); padding: 6px 12px; border-radius: 999px; font: 600 13px inherit; cursor: pointer; }
.chip:hover { background: var(--glass-hi); }
.sect { margin: 22px 4px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.fab { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); display: none; place-items: center; cursor: pointer; z-index: 20; }

/* items */
.items.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.items.grid:not(.files) { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.item { position: relative; background: var(--glass); border: 1px solid var(--glass-b); border-radius: 18px; cursor: pointer; transition: transform .14s, background .15s, border-color .15s; min-width: 0; outline: none; user-select: none; -webkit-user-select: none; }
.item:hover, .item:focus-visible { background: var(--glass-hi); transform: translateY(-2px); } .item:focus-visible { border-color: var(--accent); }
.item.dragging { opacity: .4; } .item.drop-hot { border-color: var(--accent); background: var(--glass-b); transform: scale(1.02); }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .m1, .item .m2, .item .m3 { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .dots { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; } .item .dots:hover { background: var(--glass-b); color: var(--text); }
.item .thumb { position: relative; display: grid; place-items: center; overflow: hidden; }
.item .badge-lock { position: absolute; right: -2px; bottom: -2px; background: var(--accent); color: var(--accent-ink); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.item.folder .thumb { color: var(--accent); }
.grid .item.folder { display: flex; align-items: center; gap: 12px; padding: 12px 44px 12px 14px; }
.grid .item.folder .thumb { width: 44px; height: 44px; flex: none; } .grid .item.folder .name { flex: 1; } .grid .item.folder .m1, .grid .item.folder .m2, .grid .item.folder .m3 { display: none; }
.grid .item.file { display: flex; flex-direction: column; padding: 10px; }
.grid .item.file .thumb { height: 116px; border-radius: 12px; background: var(--field); margin-bottom: 10px; } .grid .item.file .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.grid .item.file .thumb .ext { min-width: 56px; height: 56px; font-size: 13px; border-radius: 16px; }
.grid .item.file .name { padding-right: 30px; } .grid .item.file .m2 { display: none; } .grid .item.file .dots { top: auto; bottom: 4px; }
.grid .item.head { display: none; }
.items.list { display: flex; flex-direction: column; gap: 4px; }
.list .item { display: grid; grid-template-columns: 44px minmax(0,1fr) 160px 120px 88px 40px; align-items: center; gap: 12px; padding: 7px 8px 7px 10px; border-radius: 14px; }
.list .item:hover { transform: none; } .list .item .dots { position: static; }
.list .item .thumb { width: 38px; height: 38px; border-radius: 11px; background: var(--field); } .list .item .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.list .item .thumb .ext { min-width: 0; width: 100%; height: 100%; font-size: 10px; border-radius: 0; background: transparent; }
.list .item .m3 { text-align: right; }
.list .item.head { background: transparent; border-color: transparent; cursor: default; box-shadow: none; padding-top: 0; padding-bottom: 0; } .list .item.head > * { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; } .list .item.head:hover { background: transparent; }
.k-pdf .ext { color: #ff8f86; } .k-doc .ext { color: #7fb4ff; } .k-xls .ext { color: #86d9a0; } .k-ppt .ext { color: #ffb067; } .k-zip .ext { color: #c1a6ff; } .k-vid .ext, .k-aud .ext { color: #ff9ad0; }
.empty { text-align: center; padding: 48px 20px; border-radius: 26px; display: grid; gap: 14px; justify-items: center; border-style: dashed; border-width: 2px; } .empty .ic { color: var(--accent); }

/* drag overlay, uploads, toasts, menus */
.drop-overlay { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(4px); } .drop-overlay.on { display: grid; }
.drop-overlay .glass { padding: 36px 48px; border-radius: 32px; text-align: center; border: 2px dashed var(--accent); display: grid; gap: 6px; justify-items: center; } .drop-overlay .ic, .drop-overlay #dropIc { color: var(--accent); } .drop-overlay p { margin: 0; color: var(--muted); }
.uploads { position: fixed; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 28px)); max-height: 56vh; border-radius: 22px; z-index: 50; overflow: hidden; display: flex; flex-direction: column; background: var(--strong); }
.uploads.min .upl { display: none; } .up-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--glass-b); }
.upl { list-style: none; margin: 0; padding: 8px 14px 12px; display: grid; gap: 12px; overflow: auto; }
.upl li { display: grid; gap: 4px; } .upl small { color: var(--muted); font-size: 12px; } .upl li.ok small { color: var(--ok); } .upl li.bad small { color: var(--danger); }
.bar { height: 6px; border-radius: 99px; background: var(--field); overflow: hidden; } .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; justify-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { padding: 11px 18px; border-radius: 14px; background: var(--strong); font-weight: 600; font-size: 14px; animation: pop .25s; } .toast.err { color: var(--danger); } .toast.ok { color: var(--ok); } .toast.out { opacity: 0; transition: opacity .3s; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.ctx { position: fixed; z-index: 90; min-width: 210px; padding: 6px; border-radius: 16px; background: var(--strong); display: grid; }
.ctx button { display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 10px 12px; border-radius: 10px; cursor: pointer; } .ctx button:hover { background: var(--glass-hi); } .ctx button.danger { color: var(--danger); } .ctx hr { border: 0; border-top: 1px solid var(--glass-b); margin: 5px 4px; width: calc(100% - 8px); }

/* modals */
.modal-ov { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .16s; } .modal-ov.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: min(88dvh, 860px); display: flex; flex-direction: column; border-radius: 26px; background: var(--strong); animation: rise .2s; } .modal.small { width: min(420px, 100%); } .modal.wide { width: min(680px, 100%); }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 8px; padding: 14px 12px 6px 22px; } .modal-h h3 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-b { padding: 8px 22px 18px; overflow: auto; } .modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
.qr { width: 232px; max-width: 70vw; margin: 0 auto; padding: 8px; background: #fff; border-radius: 20px; } .qr svg { display: block; width: 100%; height: auto; }
.link-card { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--field); border: 1px solid var(--glass-b); } .link-card.dead { opacity: .55; }
.perm-list { display: grid; gap: 6px; max-height: 44vh; overflow: auto; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: var(--field); } .perm-row[hidden] { display: none; } .perm-row select { width: 138px; flex: none; min-height: 38px; padding: 6px 10px; } .perm-row.off { opacity: .5; } .perm-row .btn { flex: none; }
.modal.preview { width: min(1100px, 100%); max-height: 94dvh; } .modal.preview .modal-h { position: absolute; right: 6px; top: 6px; padding: 0; z-index: 2; } .modal.preview .modal-b { padding: 10px; }
.pv-wrap { display: grid; gap: 8px; } .pv-bar { display: flex; align-items: center; gap: 6px; padding-right: 48px; font-weight: 600; min-height: 44px; }
.pv { height: min(72dvh, 760px); display: grid; place-items: center; border-radius: 16px; overflow: hidden; background: var(--field); }
.pv img, .pv video { max-width: 100%; max-height: 100%; object-fit: contain; } .pv iframe { width: 100%; height: 100%; border: 0; background: #fff; } .pv audio { width: 80%; }
.pv pre { margin: 0; padding: 18px; width: 100%; height: 100%; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; align-self: start; }
.nopv { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 20px; } .nopv p { margin: 0; }

/* responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: max(10px, env(safe-area-inset-top)) 10px 10px; gap: 10px; }
  .side { position: fixed; z-index: 70; left: 10px; top: 10px; bottom: 10px; width: min(300px, 86vw); transform: translateX(-120%); transition: transform .25s; background: var(--strong); }
  .shell.open .side { transform: none; } .scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.4); display: none; } .shell.open .scrim { display: block; }
  .menu-btn { display: inline-flex; } .fab { display: grid; } #newBtn { display: none; }
  .list .item { grid-template-columns: 42px minmax(0,1fr) 120px 84px 40px; } .list .item .m2 { display: none; }
}
@media (max-width: 600px) {
  .items.grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 10px; } .items.grid:not(.files) { grid-template-columns: 1fr 1fr; }
  .grid .item.file .thumb { height: 96px; }
  .list .item { grid-template-columns: 40px minmax(0,1fr) 70px 38px; gap: 8px; } .list .item .m1 { display: none; }
  .auth-card { padding: 26px 20px; border-radius: 24px; } .form-grid { grid-template-columns: 1fr; }
  .crumbs { font-size: 16px; } .modal { border-radius: 22px; } .modal-h { padding-left: 18px; } .modal-b { padding: 8px 18px 16px; } .modal-f { padding: 10px 18px 18px; }
  .uploads { left: 10px; right: 10px; width: auto; bottom: 86px; } .toasts { bottom: 90px; }
  .perm-row select { width: 112px; } .pv { height: 66dvh; } .pin span { height: 52px; font-size: 22px; }
}
@media (hover: none) { .item:hover { transform: none; } }
