:root {
  color-scheme: dark;
  --bg: #080b14;
  --panel: #111624;
  --panel-2: #171d2e;
  --line: rgba(255,255,255,.1);
  --text: #f5f7fb;
  --muted: #9199aa;
  --accent: #ff6a3d;
  --accent-2: #ff9c61;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 85% 8%, rgba(255,106,61,.13), transparent 26rem), var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, a, label.upload-button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.noise { position: fixed; inset: 0; opacity: .025; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E"); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 42px; background: rgba(17,22,36,.9); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.brand-mark { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #1b0d08; font: 900 26px/1 Georgia, serif; box-shadow: 0 12px 35px rgba(255,106,61,.28); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; }
.eyebrow { margin: 28px 0 10px; color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-card h1 { margin: 0 0 9px; font: 600 34px/1.1 Georgia, serif; }
.muted, .setup-hint { color: var(--muted); line-height: 1.55; }
form label { display: grid; gap: 8px; margin-top: 18px; font-size: 13px; color: #c6cad4; }
input { width: 100%; border: 1px solid var(--line); background: #0b0f1a; color: var(--text); border-radius: 12px; padding: 13px 14px; outline: none; }
input:focus { border-color: rgba(255,156,97,.65); box-shadow: 0 0 0 3px rgba(255,106,61,.12); }
.primary, .secondary, .icon-button { border: 0; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); }
.primary { padding: 12px 18px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #1a0d08; font-weight: 800; box-shadow: 0 10px 28px rgba(255,106,61,.22); }
.primary:hover { filter: brightness(1.08); }
.secondary { padding: 10px 14px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; }
.wide { width: 100%; margin-top: 22px; }
.icon-button { width: 39px; height: 39px; background: transparent; border: 1px solid var(--line); font-size: 20px; }
.error { min-height: 18px; color: #ff8c84; font-size: 13px; }
.setup-hint { margin: 18px 0 0; font-size: 12px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(8,11,20,.76); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand b, .brand span { display: block; }
.brand b { font-family: Georgia, serif; font-size: 17px; }
.brand span { margin-top: 1px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.online { display: flex; align-items: center; gap: 7px; color: #aeb5c3; font-size: 12px; }
.online i { width: 7px; height: 7px; border-radius: 50%; background: #53d98b; box-shadow: 0 0 0 4px rgba(83,217,139,.12); }
.user { color: var(--muted); font-size: 13px; }
.hero { max-width: 1500px; margin: 0 auto; padding: 72px clamp(20px, 5vw, 72px) 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.hero .eyebrow { margin-top: 0; }
.hero h1 { margin: 0; font: 600 clamp(42px, 6vw, 86px)/.98 Georgia, serif; letter-spacing: -.035em; }
.hero h1 em { color: var(--accent-2); font-weight: 400; }
.hero p:not(.eyebrow) { max-width: 570px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.upload-button { min-width: 148px; padding: 14px 20px; white-space: nowrap; }
.workspace { max-width: 1500px; min-height: 420px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px) 72px; }
.toolbar { padding: 16px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumbs { display: flex; align-items: center; min-width: 0; overflow: auto; scrollbar-width: none; }
.crumb { border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; padding: 8px 4px; }
.crumb:last-child { color: var(--text); font-weight: 700; }
.crumb-separator { color: #485064; padding: 0 7px; }
.toolbar-actions { display: flex; gap: 9px; align-items: center; }
.search { width: min(290px, 28vw); display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding-left: 12px; }
.search input { border: 0; padding: 10px 10px 10px 0; background: transparent; box-shadow: none; }
.drop-zone { border: 1px dashed var(--accent); background: rgba(255,106,61,.08); border-radius: 20px; min-height: 210px; display: grid; place-content: center; text-align: center; gap: 7px; color: var(--accent-2); }
.drop-zone span { color: var(--muted); }
.upload-panel { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 28px; align-items: center; padding: 18px 20px; margin-bottom: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.upload-panel strong, .upload-panel span { display: block; }
.upload-panel span { color: var(--muted); margin-top: 4px; font-size: 12px; }
.progress { height: 7px; border-radius: 20px; background: #070a12; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.file-card { position: relative; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; transition: transform .18s, border-color .18s; }
.file-card:hover { transform: translateY(-2px); border-color: rgba(255,156,97,.35); }
.file-preview { height: 165px; display: grid; place-items: center; background: #0c101b; cursor: pointer; overflow: hidden; }
.file-preview img, .file-preview video { width: 100%; height: 100%; object-fit: cover; }
.file-preview video { pointer-events: none; }
.folder-icon, .generic-icon { font-size: 48px; filter: saturate(.8); }
.file-info { padding: 14px 46px 14px 14px; }
.file-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-info span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.more { position: absolute; right: 10px; bottom: 14px; width: 30px; height: 30px; }
.card-menu { position: absolute; right: 10px; bottom: 48px; z-index: 4; min-width: 145px; padding: 6px; background: #202638; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card-menu a, .card-menu button { width: 100%; display: block; border: 0; padding: 9px 10px; text-align: left; color: var(--text); background: transparent; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 13px; }
.card-menu a:hover, .card-menu button:hover { background: rgba(255,255,255,.07); }
.card-menu .danger { color: #ff9b93; }
.empty { min-height: 310px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty div { font-size: 38px; color: var(--accent-2); }
.empty h2 { color: var(--text); margin: 14px 0 4px; font: 600 26px Georgia, serif; }
.empty p { margin: 0; }
dialog { color: var(--text); background: #0b0f19; border: 1px solid var(--line); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.82); backdrop-filter: blur(8px); }
.preview-dialog { width: min(1180px, 94vw); height: min(820px, 92vh); padding: 0; border-radius: 20px; }
.preview-bar { min-height: 66px; padding: 12px 14px 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.preview-bar > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.preview-bar > div:first-child { display: block; }
.preview-bar strong, .preview-bar span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.preview-content { height: calc(100% - 66px); display: grid; place-items: center; padding: 18px; }
.preview-content img, .preview-content video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.preview-content audio { width: min(560px, 90%); }
.preview-content iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: white; }
.small-dialog { width: min(420px, 92vw); padding: 28px; border-radius: 20px; }
.small-dialog h2 { margin: 0; font: 600 26px Georgia, serif; }
.small-dialog form > div { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 30px); padding: 12px 16px; background: #f1f3f7; color: #171a22; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s; font-weight: 700; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .online, .user { display: none; }
  .hero { padding: 48px 18px 30px; display: block; }
  .hero h1 { font-size: clamp(41px, 13vw, 62px); }
  .upload-button { width: 100%; margin-top: 28px; }
  .workspace { padding: 0 14px 50px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr auto auto; }
  .search { width: auto; min-width: 0; }
  .secondary { padding-inline: 11px; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-preview { height: 130px; }
  .file-info { padding: 11px 38px 11px 11px; }
  .more { right: 7px; bottom: 10px; }
  .upload-panel { grid-template-columns: 1fr; gap: 12px; }
  .preview-bar .secondary { display: none; }
  .auth-card { padding: 30px 24px; }
}
@media (max-width: 380px) { .file-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
