:root {
  color-scheme: light;
  font: 15px/1.5 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  --text: #18243b;
  --page: #f4f6fb;
  --login-glow: #e4edff;
  --surface: #fff;
  --border: #e1e7f1;
  --hover-border: #beccea;
  --hover: #f6f8fd;
  --list-heading: #f6f8fc;
  --row-hover: #fafbfe;
  --muted: #586782;
  --placeholder: #64728c;
  --accent: #315bd6;
  --accent-strong: #2549b9;
  --accent-soft: #edf2ff;
  --primary: #315bd6;
  --primary-hover: #2549b9;
  --folder-icon: #96540d;
  --folder-background: #fff2dc;
  --notice-text: #254487;
  --notice-border: #cdd9f6;
  --danger-text: #98283c;
  --danger-background: #fff1f2;
  --danger-border: #f3cfd5;
  --share-text: #176648;
  --share-background: #e1f5ec;
  --expired-text: #84500c;
  --expired-background: #fff2dc;
  --backdrop: #12203e75;
  --shadow: 0 16px 36px #203b7310, 0 2px 6px #203b7308;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --text: #e6edf9;
    --page: #111722;
    --login-glow: #1b2c50;
    --surface: #1a2231;
    --border: #344159;
    --hover-border: #516584;
    --hover: #26344a;
    --list-heading: #212c3e;
    --row-hover: #202d41;
    --muted: #a8b7ce;
    --placeholder: #a1b0c8;
    --accent: #9ab6ff;
    --accent-strong: #b4c8ff;
    --accent-soft: #26395d;
    --primary: #315bd6;
    --primary-hover: #3a63d8;
    --folder-icon: #f5c47e;
    --folder-background: #3c3022;
    --notice-text: #b8ceff;
    --notice-border: #445f95;
    --danger-text: #ffabb8;
    --danger-background: #462633;
    --danger-border: #77414d;
    --share-text: #8fe1bb;
    --share-background: #203d36;
    --expired-text: #f5c47e;
    --expired-background: #3c3022;
    --backdrop: #070a12b3;
    --shadow: 0 16px 36px #0004, 0 2px 6px #0003;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, p { margin: 0; }
h1 { font-size: 21px; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
h2 { font-size: 25px; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
small, p { color: var(--muted); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner, main { width: min(100%, 1536px); margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand p { font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.brand-mark, .login-mark, .file-tile, .empty-mark {
  display: inline-grid; place-items: center; flex: none; color: var(--accent); background: var(--accent-soft); border-radius: 12px;
}
.brand-mark { width: 40px; height: 40px; color: white; background: linear-gradient(145deg, #4a79f7, #274ec5); box-shadow: 0 4px 10px #315bd630; }
main { padding-block: clamp(20px, 4vw, 48px); }
body:has(#manager[hidden]) {
  background: radial-gradient(ellipse at 50% 10%, var(--login-glow) 0, transparent 62%), var(--page);
}
body:has(#manager[hidden]) main { padding-top: clamp(48px, 12vh, 128px); }
#login {
  width: min(100%, 430px); margin-inline: auto; padding: clamp(24px, 6vw, 36px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
}
.login-mark { width: 48px; height: 48px; margin-bottom: 17px; }
#login label { display: block; margin: 24px 0 8px; font-size: 14px; font-weight: 650; }
#login input, #login button { width: 100%; min-height: 46px; }
#token-hint { margin-top: 6px; font-size: 13px; }
#login button { margin-top: 18px; }

button, input, select, summary { font: inherit; color: inherit; }
button, input, select {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 8px 13px;
}
button, summary { cursor: pointer; }
button { font-weight: 600; white-space: nowrap; }
button:hover, summary:hover { border-color: var(--hover-border); background-color: var(--hover); }
button:disabled { opacity: .5; cursor: default; }
button.primary { color: white; background: var(--primary); border-color: var(--primary); }
button.primary:hover { background: var(--primary-hover); }
input { min-width: 0; }
input::placeholder { color: var(--placeholder); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.row, .toolbar, #breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { justify-content: space-between; gap: 16px; }

#manager { display: grid; grid-template-columns: 168px minmax(0, 1fr) minmax(225px, 270px); gap: 24px; align-items: start; }
.sidebar {
  min-width: 0; max-height: 65dvh; overflow: auto; padding: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.sidebar h2 { padding: 4px 6px 8px; font-size: 14px; }
.folder-tree { list-style: none; margin: 0; padding: 0; }
.folder-tree .folder-tree { margin-left: 9px; padding-left: 6px; border-left: 1px solid var(--border); }
.tree-row { display: flex; align-items: stretch; border-radius: 8px; }
.sidebar button { text-align: left; border-color: transparent; }
.sidebar .tree-folder { flex: 1; min-width: 0; padding: 5px 6px; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.tree-row .tree-folder { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tree-folder-name { min-width: 0; }
#go-root { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 3px; }
.tree-folder[aria-current] { color: var(--accent-strong); background: var(--accent-soft); }
.sidebar .tree-toggle { width: 24px; flex: none; padding: 4px; text-align: center; color: var(--muted); }
.tree-toggle[aria-expanded="true"] { transform: rotate(90deg); }
.workspace { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(14px, 3vw, 26px); box-shadow: var(--shadow); }
.workspace-heading { margin-bottom: 22px; }
.workspace-heading button span { margin-right: 3px; }
#search { gap: 8px; }
.search-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0;
  padding-left: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 10px;
}
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-field input { width: 100%; padding-left: 0; border: 0; outline: none; background: transparent; }
#search input[name=tag] { width: min(145px, 100%); }
.list-toolbar { margin: 15px 0 9px; gap: 6px 12px; }
#breadcrumbs { flex: 1 1 160px; color: var(--muted); font-size: 13px; min-height: 31px; overflow-wrap: anywhere; }
.sort-control { display: inline-flex; gap: 7px; align-items: center; margin-left: auto; color: var(--muted); font-size: 13px; }
.sort-control select { padding: 5px 8px; color: var(--text); }
.view-switch { display: inline-flex; flex: none; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 9px; }
.view-switch button { padding: 4px 8px; border: 0; border-radius: 6px; font-size: 13px; }
.view-switch button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
#breadcrumbs button { border: 0; padding: 4px 7px; color: var(--accent-strong); white-space: normal; max-width: 100%; }
#drop-zone { min-height: 245px; border: 1px solid var(--border); border-radius: 13px; container-type: inline-size; }
#manager .upload-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.list-heading {
  display: flex; justify-content: space-between; padding: 10px 16px;
  background: var(--list-heading); border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0;
  color: var(--muted); font-size: 12px; font-weight: 650;
}
#entries { list-style: none; padding: 0; margin: 0; }
#entries li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 13px; min-height: 62px; }
#entries li + li { border-top: 1px solid var(--border); }
#entries li:hover { background: var(--row-hover); }
#entries .entry-located { background: var(--accent-soft); }
#entries .entry-openable { cursor: pointer; }
#entries li[draggable="true"] .entry-title, #entries li[draggable="true"] .file-tile { cursor: grab; }
#entries .drag-source { opacity: .55; }
#manager .move-target { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
#entries li:last-child { border-radius: 0 0 12px 12px; }
#entries.entries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; padding: 10px; }
#entries.entries-grid > li {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 8px;
  min-width: 0; padding: 8px 10px 12px; border: 1px solid var(--border); border-radius: 10px;
}
#entries.entries-grid .actions { order: -1; align-self: flex-end; }
#entries.entries-grid .file-tile { width: min(100%, 128px); height: 76px; flex: none; }
#entries.entries-grid .folder-tile .icon { width: 30px; height: 30px; }
#entries.entries-grid .entry-name { display: flex; flex: 1; flex-direction: column; align-items: center; width: 100%; text-align: center; }
#entries.entries-grid .entry-title { text-align: center; }
#entries.entries-grid .entry-meta { justify-content: center; width: 100%; margin-top: auto; padding-top: 6px; }
#entries.entries-grid .entry-meta time { order: 1; flex-basis: 100%; }
.file-tile { width: 48px; height: 38px; border-radius: 10px; }
.folder-tile { color: var(--folder-icon); background: var(--folder-background); }
.entry-title { border: 0; background: transparent; padding: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.entry-title:hover { color: var(--accent-strong); background: transparent; text-decoration: underline; }
.rename-editor { display: inline-flex; align-items: center; max-width: min(100%, 420px); border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); cursor: text; }
.rename-editor:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.rename-editor input { min-width: 4ch; field-sizing: content; border: 0; border-radius: 0; background: transparent; padding: 3px 0 3px 6px; outline: none; }
.rename-suffix { padding-right: 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.entry-meta time { color: var(--muted); font-size: 12px; }
.entry-kind, .list-column { display: none; }
.entry-title-wrap { min-width: 0; max-width: 100%; }
.entry-badges { display: contents; }
@container (min-width: 620px) {
  #entries-heading, #entries:not(.entries-grid) > li {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) 142px 62px 70px 94px;
    gap: 0 12px; padding-inline: 13px; align-items: center;
  }
  #entries-heading > :first-child { grid-column: span 2; }
  #entries-heading .list-column { display: block; }
  #entries-heading > :nth-child(4), #entries-heading > :last-child { text-align: right; }
  #entries:not(.entries-grid) :is(.entry-name, .entry-meta) { display: contents; }
  #entries:not(.entries-grid) .entry-title-wrap { grid-area: 1 / 2; align-self: end; }
  #entries:not(.entries-grid) .entry-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  #entries:not(.entries-grid) .entry-badges { grid-area: 2 / 2; display: flex; flex-wrap: wrap; gap: 4px 7px; align-self: start; min-width: 0; overflow-wrap: anywhere; }
  #entries:not(.entries-grid) .file-tile { grid-area: 1 / 1 / span 2; }
  #entries:not(.entries-grid) .entry-meta time { grid-area: 1 / 3 / span 2; }
  #entries:not(.entries-grid) .entry-kind { display: block; grid-area: 1 / 4 / span 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #entries:not(.entries-grid) .entry-size { grid-area: 1 / 5 / span 2; text-align: right; }
  #entries:not(.entries-grid) :is(.entry-kind, .entry-size) { color: var(--muted); font-size: 12px; }
  #entries:not(.entries-grid) .actions { grid-area: 1 / 6 / span 2; justify-self: end; }
}
.tag { padding: 2px 7px; border-radius: 20px; color: var(--accent-strong); background: var(--accent-soft); }
.sharing-badge { flex: none; padding: 1px 5px; border-radius: 6px; background: var(--list-heading); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sharing-badge.is-shared { color: var(--share-text); background: var(--share-background); }
.sharing-badge.is-expired { color: var(--expired-text); background: var(--expired-background); }
.tree-folder .sharing-badge { font-size: 10px; }
.actions { flex-wrap: nowrap; gap: 6px; }
.actions button, summary { font-size: 13px; }
.actions > button, summary { padding: 6px 10px; }
.actions details { position: relative; }
.actions summary { list-style: none; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background-color: var(--surface); }
.actions summary::-webkit-details-marker { display: none; }
.action-panel {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 2; min-width: 132px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 5px; box-shadow: var(--shadow);
}
.action-panel button { text-align: left; border: 0; padding: 7px 9px; }
.action-panel .danger { color: var(--danger-text); }
.action-panel .danger:hover { background: var(--danger-background); }
#empty { display: grid; justify-items: center; align-content: center; gap: 13px; min-height: 200px; padding: 20px; text-align: center; }
.empty-mark { width: 54px; height: 54px; border-radius: 16px; }
#pagination { justify-content: flex-end; margin-top: 16px; color: var(--muted); font-size: 13px; }
.notifications { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.notifications h2 { margin-bottom: 12px; font-size: 16px; }
#notices { display: grid; gap: 8px; max-height: 60dvh; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
#notices:not(:empty) + .no-notices { display: none; }
.no-notices { font-size: 13px; }
#notice, .notice { padding: 10px 12px; border: 1px solid var(--notice-border); border-radius: 10px; background: var(--accent-soft); color: var(--notice-text); white-space: pre-line; overflow-wrap: anywhere; }
#notice { max-width: 430px; margin: 14px auto 0; }
.notice { font-size: 13px; }
.links-list { list-style: none; margin: 0; padding: 0; }
.links-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.links-list li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.links-list small { display: block; margin-top: 3px; }
.link-file-path { border: 0; background: transparent; padding: 0; color: var(--accent-strong); text-align: left; white-space: normal; overflow-wrap: anywhere; }
.link-file-path:hover { background: transparent; text-decoration: underline; }
.links-actions a { padding: 8px 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.links-actions a:hover { border-color: var(--hover-border); background: var(--hover); }
#links-pagination { justify-content: flex-end; margin-top: 14px; }
#share-description { margin-top: 10px; }
.inbox-panel { max-width: 980px; margin: 22px auto; padding: clamp(16px, 4vw, 30px); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.inbox-panel a { color: var(--accent-strong); }
.inbox-panel :is(a, strong) { overflow-wrap: anywhere; }
#inbox-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 13px 16px; border: 1px dashed var(--hover-border); border-radius: 12px; background: var(--list-heading); }
#inbox-form.inbox-dragging { border-color: var(--accent); outline: 2px solid var(--accent); background: var(--accent-soft); }
#inbox-limit { margin-top: 3px; font-size: 13px; }
.inbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 20px 0 0; }
.inbox-grid li { min-width: 0; border-radius: 12px; padding: 5px 3px; text-align: center; }
.inbox-grid li:hover, .inbox-grid li:focus-within { background: var(--row-hover); }
.inbox-panel .inbox-tile { display: grid; justify-items: center; align-content: start; gap: 11px; width: 100%; min-height: 105px; border: 0; background: transparent; padding: 8px 5px 2px; color: var(--text); font-size: 13px; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.inbox-download { display: inline-block; margin: 4px 0; font-size: 12px; }
.inbox-grid:not(.inbox-list) li { display: flex; flex-direction: column; align-items: center; }
.inbox-panel .inbox-grid:not(.inbox-list) .inbox-tile { flex: 1; grid-template-rows: auto 1fr; }
.inbox-info { display: flex; flex-direction: column; align-self: stretch; min-width: 0; }
.inbox-name { font-weight: 600; }
.inbox-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; margin-top: auto; padding-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.inbox-grid:not(.inbox-list) .inbox-meta time { flex-basis: 100%; }
.inbox-list .inbox-meta { justify-content: flex-start; }
.inbox-list { display: block; border: 1px solid var(--border); border-radius: 12px; }
.inbox-list li { display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left; }
.inbox-list li + li { border-top: 1px solid var(--border); }
.inbox-panel .inbox-list .inbox-tile {
  display: grid; flex: 1; grid-template-columns: 48px minmax(0, 1fr);
  justify-items: start; align-items: center; align-content: center; min-width: 0; min-height: 56px;
  padding: 6px 0; text-align: left;
}
.inbox-list .inbox-art { height: 42px; }
.inbox-list .inbox-folder-icon { width: 36px; height: 28px; }
.inbox-list .inbox-file-art .file-symbol { width: 29px; height: 33px; padding-bottom: 4px; }
.inbox-list .inbox-file-art .file-symbol::before { width: 8px; height: 8px; }
.inbox-list .inbox-file-art .file-symbol > span { font-size: 8px; }
.inbox-list .inbox-download { flex: none; }
.inbox-kind, .inbox-list-heading { display: none; }
.inbox-list .inbox-kind { display: inline; }
@media (min-width: 680px) {
  .inbox-panel { --inbox-list-columns: 44px minmax(0, 1fr) 142px 70px 76px 42px; }
  .inbox-list-heading:has(+ .inbox-list > li), .inbox-list li {
    display: grid; grid-template-columns: var(--inbox-list-columns); gap: 8px; align-items: center;
  }
  .inbox-list-heading:has(+ .inbox-list > li) {
    margin-top: 20px; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 12px 12px 0 0; background: var(--list-heading); color: var(--muted); font-size: 12px;
  }
  .inbox-list-heading > :first-child { grid-column: span 2; }
  .inbox-list-heading > :nth-child(4) { text-align: right; }
  .inbox-list-heading > :last-child { text-align: center; }
  .inbox-list-heading:has(+ .inbox-list > li) + .inbox-list { margin-top: 0; border-top: 0; border-radius: 0 0 12px 12px; }
  .inbox-panel .inbox-list .inbox-tile {
    grid-column: 1 / 6; grid-template-columns: subgrid; column-gap: 8px; min-height: 44px; padding: 4px 0;
  }
  .inbox-list .inbox-art { grid-column: 1; height: 36px; }
  .inbox-list .inbox-info, .inbox-list .inbox-meta { display: contents; }
  .inbox-list :is(.inbox-name, .inbox-kind, .inbox-size, time) { grid-row: 1; min-width: 0; }
  .inbox-list .inbox-name { grid-column: 2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inbox-list .inbox-meta > * { color: var(--muted); font-size: 12px; }
  .inbox-list time { grid-column: 3; }
  .inbox-list .inbox-kind { grid-column: 4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inbox-list .inbox-size { grid-column: 5; justify-self: end; }
  .inbox-list .inbox-download { grid-column: 6; justify-self: center; }
}
.inbox-art { display: grid; place-items: center; width: 100%; height: 76px; }
.inbox-icon { position: relative; display: block; width: 56px; height: 44px; margin-top: 4px; }
.inbox-folder-icon { border-radius: 7px; background: linear-gradient(#78c9ff, #2d8ce5); box-shadow: inset 0 1px #ffffff75, 0 3px 5px #132a4733; }
.inbox-folder-icon::before { content: ""; position: absolute; top: -5px; left: 2px; width: 24px; height: 7px; border-radius: 5px 5px 0 0; background: #62b5f4; }
.inbox-file-art { display: grid; place-items: center; }
.file-symbol { --symbol-color: #475569; position: relative; display: grid; align-items: end; width: 29px; height: 33px; padding-bottom: 4px; border-radius: 4px; background: color-mix(in srgb, var(--symbol-color) 18%, white); clip-path: polygon(0 0, 72% 0, 100% 24%, 100% 100%, 0 100%); }
.file-symbol::before { content: ""; position: absolute; top: 0; right: 0; width: 8px; height: 8px; background: color-mix(in srgb, var(--symbol-color) 45%, white); }
.file-symbol > span { padding: 1px 2px; color: white; background: var(--symbol-color); font: 700 8px/1.4 system-ui, sans-serif; text-align: center; }
.inbox-file-art .file-symbol { width: 42px; height: 50px; padding-bottom: 6px; }
.inbox-file-art .file-symbol::before { width: 12px; height: 12px; }
.inbox-file-art .file-symbol > span { font-size: 10px; }
.file-symbol-pdf { --symbol-color: #ac293c; }
.file-symbol-document { --symbol-color: #2453a2; }
.file-symbol-sheet { --symbol-color: #196447; }
.file-symbol-slides { --symbol-color: #9a4518; }
.file-symbol-image { --symbol-color: #086375; }
.file-symbol-video { --symbol-color: #6240a2; }
.file-symbol-audio { --symbol-color: #963665; }
.file-symbol-archive { --symbol-color: #79511e; }
.file-symbol-code { --symbol-color: #31587b; }
.file-symbol-app { --symbol-color: #3448a3; }
.media-cover { position: relative; overflow: hidden; border-radius: 7px; background: var(--list-heading); }
.inbox-icon.media-cover { width: min(100%, 118px); height: 76px; }
.inbox-list .inbox-icon.media-cover { width: 48px; height: 36px; }
.media-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-cover { --play-size: 34px; --play-triangle: 12px; }
.file-tile.video-cover { --play-size: 22px; --play-triangle: 8px; }
.video-cover::before, .video-cover::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.video-cover::before { width: var(--play-size); height: var(--play-size); border-radius: 50%; background: #54575be8; }
.video-cover::after { width: var(--play-triangle); height: var(--play-triangle); background: white; clip-path: polygon(20% 0, 100% 50%, 20% 100%); }
#inbox-pagination { justify-content: flex-end; margin-top: 14px; }
#inbox-preview { width: fit-content; min-width: min(320px, 92vw); max-width: 94vw; }
#inbox-status { white-space: pre-line; overflow-wrap: anywhere; }
#inbox-status:not(:empty) { margin-top: 16px; }
#notice:empty { display: none; }
#notice.error, .notice.error { color: var(--danger-text); background: var(--danger-background); border-color: var(--danger-border); }

dialog { width: min(92vw, 490px); background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: 20px; padding: clamp(16px, 4vw, 27px); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--backdrop); }
dialog label { display: grid; gap: 6px; margin: 16px 0; font-weight: 600; }
.dialog-actions { justify-content: flex-end; margin-top: 23px; }
#preview-dialog { width: fit-content; min-width: min(320px, 92vw); max-width: 94vw; }
#preview-status:not(:empty) { margin-top: 12px; }
#preview-content :is(img, video, audio) { display: block; max-width: 100%; margin: 12px auto 0; }
#preview-content :is(img, video) { max-height: 75dvh; object-fit: contain; border-radius: 9px; }
#preview-content video { width: min(760px, 82vw); background: #000; }
#preview-content audio { width: min(440px, 80vw); }

.icon { display: inline-block; position: relative; width: 17px; height: 17px; flex: none; }
.icon-cloud { width: 21px; height: 9px; margin-top: 6px; border: 1.7px solid currentColor; border-radius: 8px; }
.icon-cloud::before { content: ""; position: absolute; width: 9px; height: 8px; left: 4px; top: -6px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 9px 9px 0 0; background: #3964df; }
.icon-lock { width: 16px; height: 13px; margin-top: 5px; border: 1.7px solid currentColor; border-radius: 4px; }
.icon-lock::before { content: ""; position: absolute; inset: -8px 2px auto; height: 6px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.icon-folder { width: 18px; height: 12px; margin-top: 3px; border: 1.6px solid currentColor; border-radius: 3px; }
.icon-folder::before { content: ""; position: absolute; width: 7px; height: 4px; left: -1.6px; top: -4.6px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.icon-search { width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 50%; margin-right: 3px; }
.icon-search::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: currentColor; right: -5px; bottom: -2px; transform: rotate(45deg); border-radius: 2px; }
.icon-settings { font-size: 18px; line-height: 17px; text-align: center; }

@media (max-width: 1060px) {
  #manager { grid-template-columns: 168px minmax(0, 1fr); }
  .notifications { grid-column: 2; }
}
@media (max-width: 720px) {
  #manager { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .notifications { grid-column: 1; }
  .sidebar { max-height: 28dvh; }
  .header-inner { min-height: 62px; }
  .workspace-heading { margin-bottom: 14px; }
}
@media (max-width: 420px) {
  .header-inner, main { padding-inline: 12px; }
  .workspace-heading { gap: 12px; }
  .workspace-heading h2 { width: 100%; }
  .search-field { flex-basis: 100%; }
  #search input[name=tag] { flex: 1; }
  #entries li { gap: 7px; padding-inline: 8px; }
  .file-tile { width: 38px; height: 33px; }
  .actions > button, summary { padding-inline: 7px; }
}
