:root {
  --white: #ffffff;
  --paper: #f4f7fb;
  --ink: #0e2240;
  --muted: #5c6f88;
  --line: #dae2ec;
  --line-strong: #bccadb;
  --blue: #0a4da2;
  --blue-dark: #083e84;
  --blue-tint: #e9f0fa;
  --red: #b3261e;
  --red-tint: #fbeceb;
  --green: #1d6b43;
  --green-tint: #e7f4ed;
  --r: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 15px/1.45 var(--font);
}
body.no-scroll { overflow: hidden; }

a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin-top: 1.6em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch; gap: 28px;
  height: 56px; padding: 0 24px;
  background: var(--blue); color: var(--white);
}
.brand {
  display: flex; align-items: center;
  color: var(--white); text-decoration: none;
  font-weight: 700; font-size: 17px;
}
.nav { display: flex; gap: 2px; }
.nav a {
  display: flex; align-items: center; padding: 0 14px;
  color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--white); }
.me { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.me-name { color: var(--white); text-decoration: none; font-weight: 500; }
.me-name:hover { text-decoration: underline; }
.me-club { color: rgba(255, 255, 255, .7); }
.me form { margin: 0; }
.top button.link { color: rgba(255, 255, 255, .78); }
.top button.link:hover { color: var(--white); text-decoration: underline; }

.main { padding: 18px 24px 96px; max-width: 1640px; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--white); color: var(--blue);
  font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--blue-tint); border-color: var(--blue); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.danger:hover:not(:disabled) { background: var(--red-tint); border-color: var(--red); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.danger-solid:hover:not(:disabled) { background: #8f1d17; border-color: #8f1d17; color: var(--white); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--blue); background: var(--blue-tint); border-color: transparent; }
.btn.icon { width: 34px; padding: 0; }
.btn.wide { width: 100%; min-height: 40px; font-size: 15px; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
input, select {
  font: 15px/1.3 var(--font); color: var(--ink); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 8px 10px; min-height: 38px;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.narrow { max-width: 380px; }

.alert { padding: 10px 14px; border-radius: var(--r); margin: 0 0 16px; border-left: 3px solid; }
.alert.error { background: var(--red-tint); color: var(--red); }
.alert.ok { background: var(--green-tint); color: var(--green); }

body[data-page="login"] { background: var(--paper); }
body[data-page="login"] .main { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { flex: none; height: 56px; display: flex; align-items: center; padding: 0 24px; background: var(--blue); }
.auth-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 80px; }
.auth-card {
  width: min(420px, 100%); padding: 40px 40px 36px;
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r);
}
.auth-logo { display: block; max-width: 200px; max-height: 88px; width: auto; height: auto; margin: 0 auto 28px; }
.auth-title { margin: 0; text-align: center; font-size: 26px; font-weight: 700; }
.auth-sub { margin: 6px 0 28px; text-align: center; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.auth-field input { min-height: 46px; font-size: 16px; padding: 10px 12px; }
.auth-submit { min-height: 46px; font-size: 16px; font-weight: 600; margin-top: 6px; }
.auth-card .alert { margin: 0 0 20px; }
.auth-note { margin: 20px 0 0; max-width: 420px; text-align: center; font-size: 13px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.side {
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  margin: -18px 0 0 -24px; padding: 14px 8px 0 12px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--paper);
}
.side-tree { flex: 1; overflow: auto; padding-bottom: 12px; }
.side .tree-row { border-radius: var(--r); }
.side .tree-row small { display: none; }
.side-trash {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.side-trash:hover { border-color: var(--blue); color: var(--blue); }
.side-trash-text { display: flex; flex-direction: column; }
.side-trash small { display: none; font-size: 12px; font-weight: 400; color: var(--muted); }
.dragging .side-trash { border: 2px dashed var(--red); padding: 11px; }
.dragging .side-trash small { display: block; }
.side-trash.drop-hot { background: var(--red-tint); border: 2px solid var(--red); color: var(--red); outline: none; }
.side-trash.drop-hot .ico { background: var(--red); }
.dragging .side .tree-row[data-drop] { outline: 1px dashed transparent; }
.side .tree-row.drop-hot { background: var(--blue); color: var(--white); outline: none; }
.side .tree-row.drop-hot .ico { background: var(--white); }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 19px; flex: 1; min-width: 0; }
.crumb { padding: 2px 6px; border-radius: var(--r); color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--blue); background: var(--blue-tint); }
.crumb.current { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.crumb-sep { color: var(--line-strong); padding: 0 2px; }
.view-tools { display: flex; gap: 8px; align-items: center; }
.sort select { min-height: 34px; padding: 4px 8px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.seg-btn { border: 0; background: var(--white); color: var(--muted); width: 36px; height: 32px; cursor: pointer; font-size: 16px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn[aria-pressed="true"] { background: var(--blue); color: var(--white); }

.actions {
  position: sticky; top: 56px; z-index: 10;
  display: flex; align-items: center; min-height: 54px;
  margin: 8px -24px 16px; padding: 9px 24px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.actions-main, .actions-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sel-count { font-weight: 600; color: var(--blue); margin-right: 8px; }

.grid.view-grid {
  display: grid; gap: 16px 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.item {
  position: relative; min-width: 0;
  cursor: default; user-select: none; -webkit-user-select: none;
  content-visibility: auto; contain-intrinsic-size: auto 200px;
}
.item.drop-hot, .crumb.drop-hot { outline: 2px dashed var(--blue); outline-offset: 2px; background: var(--blue-tint); }

.view-grid .item.folder {
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; row-gap: 2px;
  min-height: 60px; padding: 10px 40px 10px 58px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
  contain-intrinsic-size: auto 60px;
}
.view-grid .item.folder:hover { border-color: var(--line-strong); background: var(--paper); }
.view-grid .item.folder.selected { border-color: var(--blue); background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--blue); }
.view-grid .item.folder .ico { position: absolute; left: 14px; top: 50%; width: 32px; height: 32px; margin-top: -16px; }
.grid-label { grid-column: 1 / -1; margin: 10px 0 -6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.grid-label:first-child { margin-top: 0; }
.share-body .grid-label { margin: 20px 0 10px; }
.share-body .share-head + .grid-label { margin-top: 0; }
.share-folders .item.folder { padding-right: 14px; }
.view-grid .item.folder .club { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-grid .item.file { display: flex; flex-direction: column; padding: 4px; border-radius: var(--r); }
.view-grid .item.file:hover { background: var(--paper); }
.view-grid .item.file.selected { background: var(--blue-tint); box-shadow: inset 0 0 0 2px var(--blue); }
.view-grid .col-size, .view-grid .col-date { display: none; }

.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.view-grid .item.folder .name {
  font-weight: 500; white-space: normal; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.view-grid .item.file .name { padding: 7px 2px 2px; color: var(--ink); }

.thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); border-radius: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); text-align: center; padding: 8px; }
.ph.failed { color: var(--red); background: var(--red-tint); }
.ph.processing {
  background: linear-gradient(90deg, var(--paper) 0 40%, var(--blue-tint) 50%, var(--paper) 60% 100%) 0 0 / 250% 100%;
  animation: sweep 1.4s linear infinite;
}
@keyframes sweep { to { background-position: -150% 0; } }

.ico { display: inline-block; width: 22px; height: 22px; background: var(--muted); flex: none;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico-folder {
  -webkit-mask: none; mask: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230a4da2' d='M2.5 6A1.5 1.5 0 0 1 4 4.5h5.1c.4 0 .8.2 1.1.4l1.6 1.6H20A1.5 1.5 0 0 1 21.5 8v2h-19z'/%3E%3Cpath fill='%234a86d6' d='M2.5 9.5h19v9A1.5 1.5 0 0 1 20 20H4a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-home {
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5 3 10.2V20a1 1 0 0 0 1 1h5.5v-6h5v6H20a1 1 0 0 0 1-1v-9.8z'/%3E%3C/svg%3E");
  background: var(--blue);
}
.tree-row.on .ico-home { background: var(--white); }
.ico-trash {
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3h6l1 2h4v2H4V5h4zM5.5 8.5h13l-1 11.6a1.5 1.5 0 0 1-1.5 1.4H8a1.5 1.5 0 0 1-1.5-1.4z'/%3E%3C/svg%3E");
}
.ico-file {
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5A1.5 1.5 0 0 1 5.5 4h13A1.5 1.5 0 0 1 20 5.5v13a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18.5zM6 17h12l-4-5.5-3 4-2-2.5z'/%3E%3C/svg%3E");
}

.check {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  width: 22px; height: 22px; padding: 0; border-radius: 3px;
  border: 2px solid var(--white); background: rgba(14, 34, 64, .35);
  cursor: pointer; opacity: 0;
}
.view-grid .item.folder .check { top: 50%; left: auto; right: 10px; margin-top: -11px; border-color: var(--line-strong); background: var(--white); }
.item:hover .check, .has-sel .check, .item:focus-within .check { opacity: 1; }
.item.selected .check,
.view-grid .item.folder.selected .check,
.view-list .item.selected .check { background: var(--blue); border-color: var(--blue); opacity: 1; }
.item.selected .check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@media (pointer: coarse) { .check { opacity: 1; } }

.grid.view-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.view-list .list-head, .view-list .item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 150px 40px; align-items: center; gap: 14px;
  padding: 6px 10px;
}
.view-list .list-head { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 8px; font-weight: 500; }
.view-list .item { border-bottom: 1px solid var(--line); contain-intrinsic-size: auto 50px; }
.view-list .item:hover { background: var(--paper); }
.view-list .item.selected { background: var(--blue-tint); box-shadow: inset 3px 0 0 var(--blue); }
.view-list .thumb { width: 44px; height: 34px; aspect-ratio: auto; }
.view-list .ph { font-size: 0; }
.view-list .item.folder .ico { justify-self: center; }
.view-list .club { display: none; }
.view-list .col-size, .view-list .col-date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-list .check { position: relative; top: auto; left: auto; grid-column: 5; justify-self: end; border-color: var(--line-strong); background: var(--white); }

.empty { padding: 56px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.empty p { max-width: 46ch; margin: 0 auto; }

.ctx {
  position: fixed; z-index: 50; min-width: 200px; padding: 4px 0;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(14, 34, 64, .14);
}
.ctx button {
  display: block; width: 100%; text-align: left; padding: 8px 14px;
  border: 0; background: none; color: var(--ink); font: 14px var(--font); cursor: pointer;
}
.ctx button:hover, .ctx button:focus-visible { background: var(--blue-tint); color: var(--blue); outline: none; }
.ctx button.danger { color: var(--red); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; }
.ctx button.danger:hover { background: var(--red-tint); color: var(--red); }

.drop-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  display: grid; place-items: center;
  background: rgba(233, 240, 250, .82);
  border: 3px dashed var(--blue);
}
.drop-overlay p { background: var(--blue); color: var(--white); padding: 14px 22px; border-radius: var(--r); font-weight: 600; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: var(--r); max-width: min(560px, 92vw); font-size: 14px; }
.toast.error { background: var(--red); }
.toast { display: flex; align-items: center; gap: 16px; }
.toast-act {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: #9cc2ff; font: 600 14px var(--font);
}
.toast-act:hover { color: var(--white); text-decoration: underline; }

.uploads {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: min(380px, calc(100vw - 48px)); padding: 14px 16px;
  background: var(--white); border: 1px solid var(--line-strong); border-top: 3px solid var(--blue); border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(14, 34, 64, .14);
}
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.progress { height: 6px; background: var(--blue-tint); overflow: hidden; border-radius: 3px; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s linear; }
.up-sub { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.up-errors { list-style: none; margin: 8px 0 0; padding: 0; max-height: 160px; overflow: auto; font-size: 13px; }
.up-errors li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); color: var(--red); }
.up-err-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#up-retry { margin-top: 10px; }

.viewer { position: fixed; inset: 0; z-index: 70; background: #0a1a33; color: #e6edf7; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.viewer-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.viewer-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-info, .viewer-count { font-size: 13px; color: #9fb3cf; font-variant-numeric: tabular-nums; }
.viewer .btn { background: transparent; color: #e6edf7; border-color: rgba(255, 255, 255, .25); }
.viewer .btn:hover { background: rgba(255, 255, 255, .1); border-color: var(--white); color: var(--white); }
.viewer-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 16px 72px; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 72px; border: 0; border-radius: var(--r);
  background: rgba(255, 255, 255, .06); color: var(--white); font-size: 34px; cursor: pointer;
}
.viewer-nav:hover:not(:disabled) { background: var(--blue); }
.viewer-nav:disabled { opacity: .2; cursor: default; }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }

.dlg {
  border: 1px solid var(--line-strong); border-top: 3px solid var(--blue);
  padding: 22px; border-radius: var(--r); width: min(440px, 92vw);
  background: var(--white); color: var(--ink);
  box-shadow: 0 12px 32px rgba(14, 34, 64, .18);
}
.dlg-wide { width: min(560px, 94vw); }
.dlg::backdrop { background: rgba(14, 34, 64, .45); }
.dlg form { display: flex; flex-direction: column; gap: 14px; }
.dlg-title { margin: 0; font-size: 18px; }
.dlg-text { margin: 0; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.tree { max-height: 50vh; min-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 4px; }
.tree-row {
  display: flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 4px 10px 4px 4px; border-radius: 3px;
  color: var(--ink); font-size: 14px; cursor: pointer; user-select: none;
}
.tree-row .ico { width: 20px; height: 20px; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tree-row small { color: var(--muted); margin-left: auto; padding-left: 8px; white-space: nowrap; font-size: 12px; }
.tree-row:hover { background: var(--blue-tint); }
.tree-row.on, .tree-row.on:hover { background: var(--blue); color: var(--white); }
.tree-row.on .ico { background: var(--white); }
.tree-row.on small { color: rgba(255, 255, 255, .85); }
.tree-row.off { color: var(--muted); opacity: .5; cursor: not-allowed; }
.tree-row.off:hover { background: none; }
.tree-row.root { font-weight: 500; }
.tw, .tw-gap { flex: none; width: 22px; height: 22px; }
.tw {
  border: 0; padding: 0; border-radius: 3px; background: none; cursor: pointer; position: relative; color: inherit;
}
.tw::before {
  content: ""; position: absolute; left: 8px; top: 7px;
  border: solid currentColor; border-width: 0 2px 2px 0; width: 5px; height: 5px;
  transform: rotate(-45deg); opacity: .7;
}
.tw.open::before { left: 7px; top: 6px; transform: rotate(45deg); }
.tw:hover { background: rgba(10, 77, 162, .12); }
.tree-row.on .tw:hover { background: rgba(255, 255, 255, .2); }
.tree-empty { color: var(--muted); font-size: 14px; padding: 10px; margin: 0; }

.shared { font-size: 12px; color: var(--blue); font-weight: 500; }
.view-grid .item.folder .shared { line-height: 1.3; }
.view-list .shared { display: none; }
.access-list { display: flex; flex-direction: column; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--paper); color: var(--ink); font-size: 14px; cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--blue-tint); }
.check-row input { min-height: 0; width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.access-warn { margin: -6px 0 0; padding: 8px 12px; font-size: 13px; color: var(--ink); background: var(--blue-tint); border-left: 3px solid var(--blue); }
.access-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.access-head .btn { min-height: 28px; padding: 0 8px; font-size: 13px; color: var(--blue); }
.access-inh, .access-nested { padding: 12px 14px; background: var(--paper); border-radius: var(--r); }
.access-nested-list { margin: 0; padding-left: 18px; font-size: 14px; max-height: 160px; overflow: auto; }
.access-nested-list li { margin: 2px 0; }
.access-nested-list span { color: var(--muted); }
.access-inh-title { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.access-inherited { margin: 0; padding-left: 18px; font-size: 14px; }
.access-inherited li { margin: 2px 0; }
.access-inherited span { color: var(--muted); }

body[data-page="share"] .main { max-width: none; padding: 0; }
.share { min-height: 100vh; display: flex; flex-direction: column; }
.share-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 24px; background: var(--blue); }
.share-top-note { color: rgba(255, 255, 255, .8); font-size: 13px; }
.share-body { flex: 1; width: 100%; max-width: 1640px; margin: 0 auto; padding: 24px 24px 64px; }
.share-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.share-logo { max-width: 120px; max-height: 56px; width: auto; height: auto; }
.share-title { flex: 1; min-width: 240px; }
.share-title .crumbs { font-size: 22px; margin-left: -6px; }
.share-title .crumb:last-child { color: var(--ink); font-weight: 600; }
.share-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.share-head .btn.primary { min-height: 42px; padding: 0 20px; font-size: 15px; }
.share-folders { margin-bottom: 8px; }
a.item.folder { color: var(--ink); text-decoration: none; cursor: pointer; }
.share-open { display: block; border-radius: 2px; }
.share-open:focus-visible { outline-offset: 0; }
.share-file-row { display: flex; align-items: center; gap: 6px; padding: 7px 2px 2px; min-width: 0; }
.share-file-row .name { flex: 1; min-width: 0; }
.share-dl { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); }
.share-dl .ico { width: 18px; height: 18px; background: var(--blue); }
.share-dl:hover { background: var(--blue-tint); }
.ico-download {
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v9.2l3.3-3.3 1.4 1.4L12 16l-5.7-5.7 1.4-1.4 3.3 3.3zM4 18h16v2H4z'/%3E%3C/svg%3E");
}
.share-new { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 10px; align-items: end; }
.share-result { padding: 12px 14px; background: var(--blue-tint); border-left: 3px solid var(--blue); border-radius: var(--r); }
.share-result-title { display: block; font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.share-copy { display: flex; gap: 8px; }
.share-copy input { flex: 1; min-width: 0; font-size: 14px; background: var(--white); }
.share-active { padding: 12px 14px; background: var(--paper); border-radius: var(--r); }
.share-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.share-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.share-row:first-child { border-top: 0; }
.share-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-row-main small { color: var(--muted); font-size: 12px; }
.share-row .btn { min-height: 30px; }
.panel-note { margin: 0 0 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 20px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.tabs a:hover { color: var(--blue); }
.tabs a[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tab-count { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--paper); color: var(--muted); }
.tabs a[aria-selected="true"] .tab-count { background: var(--blue-tint); color: var(--blue); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--green-tint); color: var(--green); }
.badge.off { background: var(--paper); color: var(--muted); }

.page-head { margin: 8px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.trash { list-style: none; margin: 0; padding: 0; }
.trash-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 220px auto; gap: 16px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.trash-row:hover { background: var(--paper); }
.trash-thumb { width: 56px; height: 42px; overflow: hidden; background: var(--paper); display: grid; place-items: center; border-radius: 2px; }
.trash-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trash-name, .trash-date { display: flex; flex-direction: column; min-width: 0; }
.trash-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.trash-name small, .trash-date small { color: var(--muted); font-size: 12px; }
.trash-date { font-size: 13px; }
.trash-actions { display: flex; gap: 8px; }

.panel { padding: 4px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel:last-child { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; }
.stats div { padding: 14px 16px; background: var(--paper); border-left: 3px solid var(--blue); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 22px; font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.props { display: grid; gap: 10px; margin: 0; }
.props div { display: grid; grid-template-columns: 120px 1fr; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 2px solid var(--line); background: var(--paper); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--paper); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-off td { color: var(--muted); }
.row-form { display: flex; gap: 6px; margin: 0; }
.row-form input { width: 150px; min-height: 32px; padding: 4px 8px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }

body.guest[data-page="error"] { background: var(--paper); }
body.guest[data-page="error"] .main { max-width: none; padding: 0; }
.error-wrap { min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; padding: 48px 16px 96px; }
.error-page { width: min(520px, 100%); text-align: center; }
body.guest .error-page { padding: 40px 36px 36px; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r); }
.error-code { font-size: 56px; font-weight: 700; color: var(--blue); margin: 0 0 12px; line-height: 1; }
.error-title { font-size: 19px; font-weight: 600; line-height: 1.35; margin: 0 0 12px; }
.error-hint { margin: 0; color: var(--muted); }
.error-page .btn { margin-top: 8px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
}

@media (max-width: 480px) {
  .auth-body { justify-content: flex-start; padding: 24px 0 40px; }
  .auth-card { padding: 28px 20px; border-left: 0; border-right: 0; border-radius: 0; }
  .auth-note { padding: 0 20px; }
}

@media (max-width: 640px) {
  .share-new { grid-template-columns: 1fr; }
  .share-top-note { display: none; }
  .share-body { padding: 16px 12px 48px; }
}

@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 12px; }
  .brand, .me-club { display: none; }
  .nav a { padding: 0 10px; }
  .main { padding: 12px 12px 96px; }
  .actions { margin: 6px -12px 12px; padding: 8px 12px; }
  .grid.view-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 8px; }
  .view-list .list-head, .view-list .item { grid-template-columns: 44px minmax(0, 1fr) 40px; }
  .view-list .col-size, .view-list .col-date, .view-list .list-head span:nth-child(n+3) { display: none; }
  .view-list .check { grid-column: 3; }
  .trash-row { grid-template-columns: 48px minmax(0, 1fr); }
  .trash-date, .trash-actions { grid-column: 2; }
  .viewer-stage { padding: 0 0 12px; }
  .viewer-nav, #viewer-download { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body[data-page="folder"] .main { max-width: none; }

.tree-row.on .ico-folder,
.side .tree-row.drop-hot .ico-folder { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' fill-opacity='.7' d='M2.5 6A1.5 1.5 0 0 1 4 4.5h5.1c.4 0 .8.2 1.1.4l1.6 1.6H20A1.5 1.5 0 0 1 21.5 8v2h-19z'/%3E%3Cpath fill='%23ffffff' d='M2.5 9.5h19v9A1.5 1.5 0 0 1 20 20H4a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.view-list .item.folder .ico { width: 28px; height: 28px; }