:root {
  color-scheme: light;
  --ink: #27243f;
  --muted: #6d6982;
  --paper: #fbfafc;
  --surface: #ffffff;
  --surface-strong: #f3f0f5;
  --line: #ded9e5;
  --accent: #ef4d5e;
  --accent-dark: #c93549;
  --violet: #555489;
  --danger: #9f2f3f;
  --radius: 14px;
  --shadow: 0 22px 70px rgba(52, 42, 78, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(239, 77, 94, .09), transparent 28rem),
    linear-gradient(135deg, rgba(85, 84, 137, .055), transparent 42rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.topbar {
  width: min(1280px, calc(100% - 56px));
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--violet); font-weight: 800; }
.brand img { width: 154px; height: 36px; object-fit: contain; object-position: left center; }
.brand span { padding-left: 12px; border-left: 1px solid var(--line); font-size: .92rem; }
.text-button, .close-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.text-button:hover { color: var(--ink); }

main { width: min(1280px, calc(100% - 56px)); margin: 0 auto; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 860px; margin-bottom: 18px; font-size: clamp(2.6rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 8px; font-size: 1.18rem; line-height: 1.2; }
.kicker { margin-bottom: 14px; color: var(--accent-dark); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.login-view, .share-view { min-height: calc(100dvh - 72px); padding: clamp(48px, 9vw, 120px) 0 72px; }
.auth-panel, .state-panel, .terms-panel { width: min(720px, 100%); padding: clamp(28px, 5vw, 58px); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.auth-panel p, .state-panel p { max-width: 52ch; color: var(--muted); font-size: 1.05rem; }
.terms-panel h1 { margin-bottom: 32px; font-size: clamp(2.5rem, 6vw, 4.8rem); letter-spacing: -.04em; }
.terms-copy { max-width: 64ch; margin-bottom: 30px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.terms-copy h2 { margin-bottom: 12px; }
.terms-copy p { margin-bottom: 10px; color: var(--muted); }
.terms-copy p:last-child { margin-bottom: 0; }
.terms-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 1rem; line-height: 1.45; cursor: pointer; }
.terms-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.terms-data-note { max-width: 68ch; margin: -4px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.45; }
.state-symbol { display: grid; width: 54px; height: 54px; margin-bottom: 28px; place-items: center; border-radius: 50%; background: var(--surface-strong); color: var(--accent); font-size: 2rem; }

label { display: grid; gap: 8px; color: var(--ink); font-size: .9rem; font-weight: 750; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 13px 14px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(85,84,137,.14); }
form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { min-height: 1.4em; margin: 0; color: var(--danger) !important; font-size: .9rem !important; }
.trusted-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.trusted-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--violet); }
.trusted-name[hidden] { display: none; }
.trusted-note { margin: -8px 0 0; color: var(--muted); font-size: .8rem; }

.primary-button, .secondary-button, .preview-button, .download-button, .danger-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border-radius: 10px; padding: 11px 17px; border: 1px solid transparent; font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; white-space: nowrap; }
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button, .download-button { background: var(--surface); color: var(--violet); border-color: var(--line); }
.preview-button { background: var(--violet); color: #fff; border-color: var(--violet); }
.secondary-button:hover, .download-button:hover { border-color: var(--violet); background: #f8f6fa; }
.preview-button:hover { background: #444370; }
.danger-button { background: transparent; color: var(--danger); border-color: transparent; }
.primary-button:active, .secondary-button:active, .download-button:active, .danger-button:active { transform: translateY(1px); }

.share-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: start; padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.share-note { max-width: 64ch; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }
.client-logo { display: block; width: auto; max-width: 220px; height: 58px; margin-bottom: 24px; object-fit: contain; object-position: left center; }
.expiry { min-width: 150px; padding: 14px 0 0 24px; border-left: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.expiry strong { color: var(--ink); font-size: 1.05rem; }
.file-list { margin-top: 14px; }
.project-download-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding: 18px 20px; border-radius: 12px; background: var(--surface-strong); }
.project-download-bar > div { display: grid; gap: 4px; }
.project-download-bar strong { color: var(--ink); font-size: 1rem; }
.project-download-bar span { color: var(--muted); font-size: .86rem; }
.project-download { flex: 0 0 auto; min-height: 44px; padding: 10px 16px; }
.file-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.file-icon { display: grid; width: 50px; height: 58px; place-items: center; border-radius: 8px; background: var(--violet); color: #fff; font-size: .62rem; font-weight: 900; letter-spacing: .05em; overflow: hidden; }
.file-row:has(.file-cover) { grid-template-columns: 136px minmax(0, 1fr) auto; }
.file-cover { width: 128px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; background: var(--surface-strong); }
.file-copy h2 { overflow-wrap: anywhere; }
.file-copy p { margin: 0; color: var(--muted); font-size: .9rem; }
.file-actions { display: flex; gap: 8px; }
.folder-file-delete { border: 0; background: transparent; color: var(--danger); padding: 8px 4px; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.folder-file-delete:hover { color: #8f1e2a; }
.folder-file-delete:focus-visible { outline: 3px solid rgba(194,49,65,.2); outline-offset: 2px; border-radius: 6px; }
.folder-admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 18px 20px; border-radius: 12px; background: var(--surface-strong); }
.folder-admin-toolbar > div { display: grid; gap: 4px; }
.folder-admin-toolbar strong { color: var(--ink); }
.folder-admin-toolbar span { color: var(--muted); font-size: .86rem; }
.share-help { margin: 28px 0 0; color: var(--muted); font-size: .9rem; }
.folder-group { margin-top: 24px; border-top: 1px solid var(--line); }
.folder-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0 12px; }
.folder-title { display: flex; min-width: 0; align-items: center; gap: 14px; }
.folder-title h2 { margin: 0 0 3px; overflow-wrap: anywhere; font-size: 1.12rem; }
.folder-title p { margin: 0; color: var(--muted); font-size: .84rem; }
.folder-symbol { position: relative; display: inline-block; flex: 0 0 auto; width: 32px; height: 23px; border-radius: 4px; background: var(--violet); }
.folder-symbol::before { content: ''; position: absolute; left: 2px; top: -5px; width: 14px; height: 7px; border-radius: 4px 4px 0 0; background: var(--violet); }
.folder-download { min-height: 40px; padding: 8px 12px; font-size: .8rem; }
.nested-file { margin-left: 46px; }

.admin-view { padding: 36px 0 90px; }
.admin-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; margin-bottom: 28px; padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.82); box-shadow: 0 18px 60px rgba(52,42,78,.07); }
.admin-head h1 { max-width: none; margin-bottom: 14px; font-size: clamp(2.3rem, 4vw, 3.9rem); line-height: 1; letter-spacing: -.045em; }
.admin-head .kicker { margin-bottom: 10px; }
.admin-intro { max-width: 660px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.admin-head .primary-button { min-width: 178px; min-height: 52px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.project-list { overflow: hidden; padding: 0 28px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.88); }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; min-height: 112px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.project-row:has(.download-log:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
.project-row:has(.download-log:not([hidden])) .project-actions { justify-content: flex-start; }
.project-row:last-child { border-bottom: 0; }
.project-row p { margin: 0; color: var(--muted); font-size: .9rem; }
.project-row .consent-summary { margin-top: 6px; color: var(--violet); font-size: .8rem; font-weight: 700; }
.project-files, .project-access, .project-link, .project-brand { margin-top: 14px; }
.project-files summary, .project-access summary, .project-link summary, .project-brand summary { width: fit-content; color: var(--violet); font-size: .84rem; font-weight: 800; cursor: pointer; }
.project-file-list { display: grid; gap: 8px; margin-top: 12px; }
.project-file-item { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; padding: 12px; border-radius: 9px; background: var(--surface-strong); font-size: .82rem; cursor: grab; transition: opacity .16s ease, background .16s ease; }
.project-file-item.is-moving { opacity: .52; cursor: grabbing; }
.project-file-item span { min-width: 0; overflow-wrap: anywhere; }
.project-file-item small { color: var(--muted); }
.project-file-item .file-path { display: block; margin-bottom: 2px; color: var(--violet); font-weight: 750; }
.project-file-item button, .add-file-button { border: 0; background: transparent; font-weight: 800; cursor: pointer; }
.file-link-controls { display: flex; align-items: center; gap: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.file-link-controls a, .file-link-controls button { padding: 3px 0; color: var(--violet); font-size: .75rem; font-weight: 800; text-decoration: none; }
.file-link-controls a:hover, .file-link-controls button:hover { color: var(--accent-dark); }
.file-move-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; gap: 7px; }
.file-move-controls select { grid-column: 1 / -1; width: 100%; min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 9px; border-radius: 8px; font-size: .76rem; text-overflow: ellipsis; }
.file-move-controls button { min-width: 0; padding: 6px 4px; font-size: .75rem; line-height: 1.25; overflow-wrap: anywhere; }
.move-file-button { color: var(--violet); }
.copy-file-button { color: var(--accent-dark); }
.delete-file-button { color: var(--danger); }
.add-file-button { width: fit-content; padding: 7px 0; color: var(--violet); }
.material-actions-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 8px; padding: 18px; border-radius: 12px; background: #f3f0f5; }
.material-actions-copy { display: grid; gap: 3px; }
.material-actions-copy strong { color: var(--ink); font-size: .92rem; }
.material-actions-copy span { max-width: 44ch; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.upload-folder-choice { grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: .76rem; }
.upload-folder-choice select { min-height: 40px; padding: 7px 10px; font-size: .78rem; }
.material-actions-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.material-action { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-size: .78rem; font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.material-action span { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; font-size: .96rem; line-height: 1; }
.material-action-primary { background: var(--accent-dark); color: #fff; }
.material-action-primary span { background: rgba(255,255,255,.2); }
.material-action-primary:hover { background: #a92b3d; }
.material-action-folder { background: var(--violet); color: #fff; }
.material-action-folder span { background: rgba(255,255,255,.16); }
.material-action-folder:hover { background: #444370; }
.material-action-create { border-color: #b8b2c5; background: var(--surface); color: var(--violet); }
.material-action-create span { background: var(--surface-strong); }
.material-action-create:hover { border-color: var(--violet); background: #faf9fb; }
.material-action:active { transform: translateY(1px); }
.material-action:focus-visible { outline: 3px solid rgba(85,84,137,.22); outline-offset: 2px; }
.bulk-move-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; align-items: center; padding: 12px; border-radius: 10px; background: rgba(85,84,137,.08); }
.bulk-move-toolbar label { display: flex; align-items: center; gap: 8px; font-size: .78rem; cursor: pointer; }
.bulk-move-toolbar label input, .file-select input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--violet); }
.bulk-move-toolbar [data-bulk-count] { color: var(--muted); font-size: .72rem; text-align: right; }
.bulk-move-toolbar select { min-width: 0; min-height: 40px; padding: 7px 10px; font-size: .78rem; }
.bulk-move-toolbar .secondary-button { min-height: 40px; padding: 7px 12px; font-size: .78rem; }
.bulk-move-toolbar .secondary-button:disabled { opacity: .48; cursor: not-allowed; }
.file-select { display: flex; min-width: 0; align-items: flex-start; gap: 10px; cursor: pointer; }
.file-select > span { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.file-select small { font-weight: 400; }
.files-organized-note { padding: 13px 14px; border-radius: 9px; background: var(--surface-strong); color: var(--muted); font-size: .78rem; }
.admin-folder-list { display: grid; gap: 6px; padding: 10px 0 4px; }
.admin-folder-list > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px 10px; align-items: center; padding: 10px 9px; border-radius: 8px; color: var(--ink); transition: background .16s ease, box-shadow .16s ease; }
.admin-folder-list .folder-symbol { width: 22px; height: 16px; }
.admin-folder-list .folder-symbol::before { top: -4px; width: 10px; height: 5px; }
.admin-folder-list span:not(.folder-symbol) { display: grid; min-width: 0; overflow-wrap: anywhere; font-size: .8rem; }
.admin-folder-list span:not(.folder-symbol) strong { font-size: .8rem; }
.admin-folder-list span:not(.folder-symbol) small { color: var(--muted); font-size: .7rem; }
.admin-folder-list button, .admin-folder-list a { border: 0; background: transparent; color: var(--violet); font-size: .76rem; font-weight: 800; cursor: pointer; text-decoration: none; }
.admin-folder-actions { grid-column: 2; display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; }
.admin-folder-actions a:hover, .admin-folder-actions button:hover { color: var(--red); }
.folder-view-name { display: inline-flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 9px 13px; border-radius: 10px; background: rgba(85,84,137,.09); color: var(--violet); font-weight: 800; }
.folder-view-name .folder-symbol { width: 22px; height: 16px; flex: 0 0 auto; }
.file-view-name { display: inline-flex; max-width: min(680px, 100%); align-items: center; gap: 10px; margin: 14px 0 0; padding: 9px 13px; border-radius: 10px; background: rgba(85,84,137,.09); color: var(--violet); }
.file-view-name > span { display: grid; width: 34px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: var(--violet); color: #fff; font-size: .52rem; font-weight: 900; letter-spacing: .04em; }
.file-view-name strong { min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.admin-folder-target.is-drop-target, .root-folder-target.is-drop-target { background: rgba(85,84,137,.12); box-shadow: inset 0 0 0 2px var(--violet); }
.root-folder-target { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: .76rem; text-align: center; transition: background .16s ease, box-shadow .16s ease; }
.access-editor { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.access-editor input { width: min(300px, 100%); }
.access-editor .secondary-button, .access-editor .danger-button { min-height: 44px; padding: 9px 12px; font-size: .8rem; }
.access-mode { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); }
.access-mode p { margin: 0 0 10px; color: var(--muted); font-size: .86rem; }
.access-mode .secondary-button { min-height: 42px; padding: 8px 12px; font-size: .8rem; }
.access-mode button:disabled { opacity: .55; cursor: not-allowed; }
.direct-access-choice { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); cursor: pointer; }
.direct-access-choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.direct-access-choice span { display: grid; gap: 2px; }
.direct-access-choice small { color: var(--muted); line-height: 1.4; }
.link-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: .82rem; }
.link-editor input { width: min(260px, 100%); }
.link-editor .secondary-button { min-height: 44px; padding: 9px 12px; font-size: .8rem; }
.brand-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.brand-editor img { width: auto; max-width: 160px; height: 46px; object-fit: contain; }
.brand-editor .secondary-button { min-height: 44px; padding: 9px 12px; font-size: .8rem; }
.project-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 0; }
.project-actions .secondary-button, .project-actions .danger-button { min-height: 38px; padding: 8px 11px; font-size: .78rem; }
.download-log[hidden] { display: none; }
.download-log { width: 100%; min-width: 0; margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--surface-strong); overflow: hidden; }
.download-log-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.download-log-head > div { min-width: 0; }
.download-log-head h3 { margin: 0 0 4px; font-size: 1rem; }
.download-log-head p { max-width: 68ch; margin: 0; color: var(--muted); font-size: .75rem; }
.download-log-list { display: grid; width: 100%; min-width: 0; margin: 0; padding: 0; list-style: none; border-radius: 9px; background: var(--surface); overflow: hidden; }
.download-log-list li { display: grid; min-width: 0; gap: 7px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.download-log-list li:last-child { border-bottom: 0; }
.download-log-list .download-log-legacy { background: #f8f6fa; }
.download-log-list .download-log-legacy code { color: var(--muted); }
.download-log-event { display: grid; min-width: 0; gap: 3px; }
.download-log-event strong { overflow-wrap: anywhere; font-size: .8rem; }
.download-log-event span { color: var(--muted); font-size: .7rem; }
.download-log-meta { display: flex; min-width: 0; align-items: center; justify-content: flex-start; gap: 6px 14px; color: var(--muted); font-size: .7rem; flex-wrap: wrap; }
.download-log-meta > * { min-width: 0; overflow-wrap: anywhere; }
.download-log code { color: var(--violet); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; white-space: normal; }
.download-log-empty { padding: 24px; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: .8rem; text-align: center; }
.capacity-panel { position: sticky; top: 28px; display: grid; gap: 14px; padding: 30px; border-radius: 16px; background: var(--violet); color: #fff; box-shadow: 0 18px 44px rgba(52,42,78,.16); }
.capacity-panel p { margin: 0; color: #dedcf0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.capacity-panel strong { font-size: 1.45rem; line-height: 1.15; }
.capacity-panel span { color: #e7e5f3; font-size: .92rem; }
.capacity-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.capacity-track span { display: block; min-width: 8px; height: 100%; border-radius: inherit; background: var(--accent); }
.trusted-panel { grid-column: 2; display: grid; gap: 12px; padding: 22px; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px rgba(52,42,78,.09); }
.trusted-panel h2, .trusted-panel p { margin: 0; }
.trusted-panel p, .trusted-empty { color: var(--muted); font-size: .8rem; }
.trusted-list { display: grid; gap: 8px; }
.trusted-device { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.trusted-device div { min-width: 0; }
.trusted-device strong, .trusted-device small { display: block; overflow-wrap: anywhere; }
.trusted-device strong { font-size: .84rem; }
.trusted-device small { margin-top: 2px; color: var(--muted); font-size: .7rem; }
.trusted-device .danger-button { min-height: 34px; padding: 6px 8px; font-size: .72rem; }
.empty-state { padding: 42px 0; color: var(--muted); }

dialog { width: min(720px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 28px 100px rgba(30,24,48,.28); }
dialog::backdrop { background: rgba(39,36,63,.42); backdrop-filter: blur(7px); }
.compact-dialog { display: grid; gap: 18px; }
.copy-file-name { max-width: 48ch; margin: 6px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.copy-hint { margin: 0; color: var(--muted); font-size: .84rem; }
.dialog-shell { padding: clamp(24px, 5vw, 46px); overflow-y: auto; }
.dialog-head { display: flex; justify-content: space-between; gap: 18px; }
.dialog-head h2 { font-size: 2rem; }
.close-button { width: 42px; height: 42px; font-size: 1.8rem; }
.dropzone { padding: 24px; border: 1px dashed var(--violet); border-radius: var(--radius); background: #f8f6fa; cursor: pointer; }
.dropzone.is-dragging { border-color: var(--accent); background: rgba(239, 77, 94, .08); box-shadow: 0 0 0 3px rgba(239, 77, 94, .12); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone span { font-size: 1rem; }
.dropzone small { color: var(--muted); font-weight: 500; }
.folder-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 14px; padding: 17px 18px; border-radius: 10px; background: var(--surface-strong); cursor: pointer; }
.folder-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.folder-picker > span { grid-row: 1 / 3; display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; background: var(--surface); color: var(--violet); font-weight: 800; }
.folder-picker small { color: var(--muted); font-weight: 500; }
.upload-list { display: grid; gap: 10px; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface-strong); border-radius: 10px; font-size: .85rem; }
.upload-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item strong { color: var(--violet); }
.upload-status { position: fixed; z-index: 40; right: 22px; bottom: 22px; width: min(440px, calc(100% - 28px)); max-height: min(520px, calc(100dvh - 44px)); overflow: auto; padding: 18px; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px rgba(30,24,48,.2); }
.upload-status[hidden] { display: none; }
.upload-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.upload-status-head > div { display: grid; min-width: 0; gap: 3px; }
.upload-status-head strong { color: var(--ink); }
.upload-status-head span { overflow-wrap: anywhere; color: var(--muted); font-size: .8rem; }
.upload-status-percent { flex: 0 0 auto; color: var(--violet); font-size: 1.1rem; font-weight: 900; }
.upload-progress { height: 8px; margin: 14px 0; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.upload-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .18s ease-out; }
.upload-status .upload-list { max-height: 220px; overflow-y: auto; }
.upload-status p { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.upload-status.is-complete .upload-progress span { background: #27845a; }
.upload-status.is-error .upload-progress span { background: var(--danger); }
.upload-status.is-error p { color: var(--danger); font-weight: 700; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 340px; padding: 13px 16px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 820px) {
  .topbar, main { width: min(100% - 28px, 1280px); }
  .brand img { width: 132px; }
  .brand span { max-width: 112px; font-size: .78rem; line-height: 1.15; }
  .admin-head { grid-template-columns: 1fr; align-items: stretch; gap: 24px; }
  .admin-head .primary-button { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
  .capacity-panel { position: static; }
  .trusted-panel { grid-column: 1; }
  .project-row { grid-template-columns: 1fr; }
  .project-actions { justify-content: flex-start; }
  .download-log-list li { grid-template-columns: 1fr; gap: 7px; }
  .download-log-meta { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .share-head { grid-template-columns: 1fr; gap: 18px; }
  .expiry { padding: 0; border-left: 0; }
  .folder-head { align-items: flex-start; }
  .material-actions-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 2.55rem; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-view { padding-top: 18px; }
  .admin-head { padding: 24px 20px; }
  .admin-head h1 { font-size: 2.35rem; }
  .project-list { padding: 0 18px; }
  .file-row { grid-template-columns: 48px minmax(0, 1fr); }
  .file-row:has(.file-cover) { grid-template-columns: 92px minmax(0, 1fr); }
  .file-cover { width: 84px; }
  .file-icon { width: 42px; height: 50px; }
  .download-button { grid-column: 1 / -1; width: 100%; }
  .file-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .file-actions .download-button { grid-column: auto; }
  .folder-head { display: grid; grid-template-columns: 1fr; }
  .project-download-bar { align-items: stretch; flex-direction: column; }
  .project-download { width: 100%; }
  .folder-admin-toolbar { align-items: stretch; flex-direction: column; }
  .folder-admin-toolbar .primary-button { width: 100%; }
  .folder-download { width: 100%; }
  .nested-file { margin-left: 0; }
  .folder-picker { grid-template-columns: 1fr; }
  .folder-picker > span { grid-row: auto; }
  .admin-folder-list > div { grid-template-columns: 22px minmax(0, 1fr); }
  .admin-folder-list button, .admin-folder-list a { justify-self: start; padding: 4px 0; }
  .admin-folder-actions { grid-column: 2; justify-content: flex-start; }
  .material-actions-panel { padding: 16px; }
  .material-actions-buttons { display: grid; grid-template-columns: 1fr; }
  .bulk-move-toolbar { grid-template-columns: 1fr; }
  .bulk-move-toolbar [data-bulk-count] { text-align: left; }
  .material-action { width: 100%; }
  .project-file-item { grid-template-columns: 1fr; cursor: default; }
  .project-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .project-actions .danger-button { grid-column: 1 / -1; }
  .upload-status { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
