body.app { background: var(--bg); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.appbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.searchbox { flex: 1; max-width: 560px; margin-inline: auto; }
.searchbox input { width: 100%; border-radius: 999px; padding: 9px 16px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font: inherit; }
.appnav { display: flex; gap: 16px; }
.appnav .link { color: var(--ink-2); text-decoration: none; font-weight: 500; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 58px); }
.side { padding: 16px 12px; border-inline-end: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 18px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; font: inherit; color: var(--ink); background: none; border: 0; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.nav-item:hover { background: var(--bg); }
.nav-item[aria-current="page"] { background: var(--brand-soft); font-weight: 650; }
.meter { padding: 0 6px; font-size: .85rem; color: var(--ink-2); }
.meter-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.meter .bar.warn > i { background: #e0902b; } .meter .bar.full > i { background: var(--danger); }
.usage-details { margin-top: 8px; }
.usage-details summary { cursor: pointer; color: var(--brand); }
.usage-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.usage-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.usage-list .ubar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.usage-list .ubar > i { display: block; height: 100%; background: var(--brand); }

.content { padding: 16px 22px 80px; min-width: 0; outline: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 1.15rem; font-weight: 650; }
.crumbs button { font: inherit; color: inherit; background: none; border: 0; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.crumbs button:hover:not([aria-current]) { background: var(--brand-soft); }
.crumbs span.sep { color: var(--ink-2); }
.tools, .tools-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.small-select { font: inherit; font-size: .88rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.seg { display: inline-flex; } .seg .btn { border-radius: 0; } .seg .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .seg .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-inline-start: -1px; }
.seg .btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }

.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; background: var(--brand-soft); border-radius: 12px; margin-bottom: 10px; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }

.dropzone { position: relative; border: 2px dashed transparent; border-radius: var(--radius); min-height: 240px; transition: var(--ease); }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.drophint { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; color: var(--brand); pointer-events: none; }

table.fl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.fl th { text-align: start; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 650; }
table.fl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.fl tr:last-child td { border-bottom: 0; }
table.fl tbody tr:hover { background: var(--bg); }
table.fl tr.sel { background: var(--brand-soft); }
table.fl tr.dropt { outline: 2px solid var(--brand); outline-offset: -2px; }
.nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nm .ic { font-size: 1.3rem; flex: none; }
.nm button.open { font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 2px 4px; cursor: pointer; text-align: start; overflow-wrap: anywhere; border-radius: 6px; }
.nm button.open:hover { text-decoration: underline; }
.num { color: var(--ink-2); white-space: nowrap; font-size: .9rem; }
.kebab { font-size: 1.2rem; line-height: 1; padding: 4px 10px; background: none; border: 0; cursor: pointer; border-radius: 8px; color: var(--ink-2); }
.kebab:hover { background: var(--line); color: var(--ink); }
.fav { color: #e0a82b; }
@media (max-width: 760px) { table.fl .hide-s { display: none; } }

.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 10px; text-align: center; }
.tile.sel { background: var(--brand-soft); border-color: var(--brand); }
.tile.dropt { outline: 2px solid var(--brand); }
.tile .ic { font-size: 2.6rem; display: block; margin-bottom: 6px; }
.tile .open { font: inherit; font-weight: 600; background: none; border: 0; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; display: block; width: 100%; }
.tile .num { display: block; margin-top: 2px; }
.tile .sel-box { position: absolute; top: 8px; inset-inline-start: 8px; }
.tile .kebab { position: absolute; top: 4px; inset-inline-end: 4px; }
.tile .thumb { display: block; background: var(--line); pointer-events: none; }
.tile img.thumb, .tile video.thumb { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }

.empty { text-align: center; padding: 60px 16px; color: var(--ink-2); }
.empty-title { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin: 0 0 6px; }

.uploads { position: fixed; inset-inline-end: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 30; max-height: 55vh; overflow: auto; padding: 12px; }
.uploads-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.uploads .files { margin: 0; }
.uploads .files li { grid-template-columns: 1fr auto; }
.uploads .err-text { color: var(--danger); font-size: .85rem; grid-column: 1 / -1; }
.uploads .row-actions { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; margin-top: 6px; }

.menu { position: fixed; z-index: 60; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.menu button { display: block; width: 100%; text-align: start; font: inherit; color: var(--ink); background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--brand-soft); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.toast { position: fixed; inset-inline-start: 50%; transform: translateX(-50%); bottom: 24px; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 70; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8, 18, 36, .55); }
dialog.wide { width: min(920px, calc(100vw - 32px)); }
dialog h2 { margin: 0 0 12px; font-size: 1.2rem; overflow-wrap: anywhere; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.picker { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.picker button { display: block; width: 100%; text-align: start; font: inherit; color: var(--ink); background: none; border: 0; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.picker button:hover { background: var(--bg); } .picker button[aria-selected="true"] { background: var(--brand-soft); font-weight: 650; }
.vlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.vlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.preview-head h2 { margin: 0; }
.preview-body { display: grid; place-items: center; min-height: 200px; max-height: 70vh; overflow: auto; }
.preview-body img, .preview-body video { max-width: 100%; max-height: 68vh; border-radius: 8px; }
.preview-body pre { align-self: start; justify-self: stretch; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; background: var(--bg); padding: 14px; border-radius: 10px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: flex-start; overflow-x: auto; padding: 8px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .side nav { display: flex; gap: 4px; align-items: center; } .nav-item { white-space: nowrap; width: auto; }
  .meter { display: none; }
  .appnav { display: none; }
  .content { padding: 12px 12px 90px; }
}

.btn.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; }

.share-list { display: grid; gap: 10px; margin-bottom: 14px; }
.share-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.share-row .linkbox input { font-size: .85rem; text-align: start; }
.share-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.share-form .radios { display: flex; gap: 16px; flex-wrap: wrap; }
.share-form .check { display: flex; align-items: center; gap: 8px; }
.crumbs.small { font-size: 1rem; margin: 6px 0 10px; }

.instructions { white-space: pre-line; }
.files li.failed { border-color: var(--danger); }
.files li.failed .meta { color: var(--danger); }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
dialog .f + .f { margin-top: 10px; }
.scope { display: block; margin: 0 0 10px; flex: none; } .scope select { width: 100%; min-width: 9rem; border-radius: var(--radius-sm); }
.scope[hidden] { display: none; }
form.inline input[type="email"], form.inline input[type="text"] { flex: 1 1 10rem; min-width: 0; }
#invite-form, #create-form, #rename-form { max-width: 520px; flex-wrap: wrap; }

/* Details dialog */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details dt { font-weight: 650; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .hash { font-size: .8rem; word-break: break-all; }
@media (max-width: 520px) { .details { grid-template-columns: 1fr; } .details dd { margin-bottom: 6px; } }
.imp-menu .imp-head { margin: 4px 12px 6px; font-size: .8rem; font-weight: 650; color: var(--ink-2); }
