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, .searchbox and .appnav: the restore browser's header (backup-browse.html) */
.appbar { display: flex; align-items: center; gap: 22px; padding: 14px 24px; 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: 22px; }
/* same link style as the site header (.nav a.link in app.css) */
.appnav .link { color: var(--body); text-decoration: none; font-weight: 600; font-size: .94rem; white-space: nowrap; }
.appnav .link:hover { color: var(--ink); }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 66px); }
.side { padding: 20px 14px; 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; font-weight: 600; font-size: .94rem; color: var(--body); background: none; border: 1px solid transparent; padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; transition: var(--ease); }
.nav-item:hover { background: var(--glass-hover); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--brand-soft); border-color: rgba(79, 163, 255, .25); color: var(--ink); }
.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; }

/* My Files: page heading with search, then the toolbar, then the folder path (drive.html) */
/* the sidebar fills the window below the header without making the page scroll */
body.files-page { display: flex; flex-direction: column; min-height: 100vh; }
body.files-page > header.nav { width: 100%; }
.files-page .shell { flex: 1; min-height: 0; }
.files-page .content { padding: 26px 32px 80px; }
.files-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 18px; }
.files-head .page-title { margin: 0; }
.files-head .searchbox { flex: 0 1 380px; margin: 0; }
.files-head .searchbox input { border-radius: 999px; padding: 11px 18px; }
.files-page .toolbar { gap: 10px 12px; margin-bottom: 14px; }
.files-page .view-tools { margin-inline-start: auto; }
.files-page .toolbar .small-select { padding: 11px 16px; font-size: .9rem; font-weight: 600; }
.files-page .crumbs { font-size: 1rem; margin: 0 0 12px; }
.files-page .crumbs[hidden] { display: none; }
.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 { width: auto; font: inherit; font-size: .88rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line-strong); }
.seg .btn { border: 0; background: transparent; color: var(--body); box-shadow: none; }
.seg .btn[aria-pressed="true"] { background: var(--brand); color: #fff; }

.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: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); 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 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; } }

/* File-type icons (drive.js fileIcon): a soft tile in the type's colour, like the site's .ic-tile */
.fi { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--brand); background: color-mix(in srgb, currentColor 14%, transparent); }
.fi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fi-thumb { flex: none; width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--line); }
.fi-folder { color: var(--amber); }
.fi-image, .fi-audio { color: var(--teal); }
.fi-pdf { color: var(--danger); }
.fi-archive, .fi-doc { color: var(--ink-2); }

/* Grid: a fixed picture box, the name under it on one line (full name in the tooltip) */
.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px 8px 12px; text-align: center; transition: var(--ease); }
.tile:hover { border-color: var(--line-strong); }
.tile.sel { background: var(--brand-soft); border-color: var(--brand); }
.tile.dropt { outline: 2px solid var(--brand); }
.tile .visual { display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 4px; border-radius: 10px; background: var(--glass); overflow: hidden; }
.tile .visual .fi { width: 60px; height: 60px; border-radius: 18px; }
.tile .visual .fi svg { width: 32px; height: 32px; }
.tile .thumb { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--line); pointer-events: none; }
.tile .open { font: inherit; font-weight: 600; font-size: .92rem; background: none; border: 0; color: var(--ink); cursor: pointer; display: block; width: 100%; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .open:hover { text-decoration: underline; }
.tile .num { display: block; font-size: .82rem; }
.tile .sel-box { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 1; }
.tile .kebab { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; background: color-mix(in srgb, var(--surface) 82%, transparent); }

.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; }
  .files-page .content { padding: 18px 16px 90px; }
  .files-head .searchbox { flex-basis: 100%; }
  .files-page .toolbar .btn:not(.small) { padding: 10px 14px; font-size: .86rem; }
  .files-page .view-tools { margin-inline-start: 0; }
  .grid-view { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

.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); }
