/* drops: dark UI. --c is the accent: violet by default, the file type's color on download pages. */
/* fonts are preloaded in base.html and shown only once loaded (block), so text never changes face while loading */
@font-face { font-family: Onest; src: url(fonts/onest-latin.woff2) format('woff2'); font-weight: 100 900; font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Onest; src: url(fonts/onest-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: block; unicode-range: U+0400-045F, U+0490-0491, U+2116; }
@font-face { font-family: Unbounded; src: url(fonts/unbounded-latin.woff2) format('woff2'); font-weight: 200 900; font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Unbounded; src: url(fonts/unbounded-cyrillic.woff2) format('woff2'); font-weight: 200 900; font-display: block; unicode-range: U+0400-045F, U+0490-0491, U+2116; }
:root {
  --bg: #07070c;
  --card: rgba(20, 20, 31, .82);
  --line: rgba(255, 255, 255, .08);
  --line-hi: rgba(255, 255, 255, .16);
  --text: #f1f0fa;
  --muted: #8e8da7;
  --grad: linear-gradient(135deg, #a78bfa, #8b5cf6 45%, #38bdf8);
  --danger: #fb7185;
  --c: #8b5cf6;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', var(--font);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42rem 30rem at 12% -8%, color-mix(in srgb, var(--c) 32%, transparent), transparent 70%),
    radial-gradient(38rem 26rem at 100% 4%, rgba(56, 189, 248, .12), transparent 70%),
    radial-gradient(46rem 30rem at 60% 112%, rgba(236, 72, 153, .11), transparent 70%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 75%);
}
::selection { background: rgba(139, 92, 246, .45); }
:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; }
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.muted { color: var(--muted); margin: 0; }
.err { color: var(--danger); margin: 0; font-size: 14px; }
.err:empty { display: none; }
.cap, .links label { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* --- building blocks --- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)), var(--card);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 60px -30px rgba(0, 0, 0, .75);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); color: var(--text);
  font: 600 14px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.btn:hover { background: rgba(255, 255, 255, .1); border-color: var(--line-hi); }
.btn:active { transform: translateY(1px); }
/* gradient buttons: crisp edge + inner highlight, nothing bleeding outside the button */
.btn.primary, .bubble {
  border: 1px solid rgba(255, 255, 255, .14); color: #fff; background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .18);
}
.btn.primary:hover { filter: brightness(1.1); border-color: rgba(255, 255, 255, .22); }
.btn.big { height: 52px; width: 100%; border-radius: 14px; font-size: 16px; }
.btn.big .i { width: 20px; height: 20px; }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn.ghost, .acts .btn { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover, .acts .btn:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn.danger:hover { color: var(--danger); border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); }
.btn.done, .chip.done { color: #4ade80; }
.input, .field {
  border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input { width: 100%; height: 46px; padding: 0 14px; font: 15px var(--font); }
.input::placeholder, .field input::placeholder { color: #66657d; }
.input:focus, .field:focus-within { outline: 0; border-color: rgba(139, 92, 246, .65); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.field { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; }
.field > .i { width: 16px; height: 16px; color: var(--muted); }
.field input {
  flex: 1; min-width: 0; padding: 8px 6px; border: 0; outline: 0; background: none;
  color: var(--text); font: 13px var(--mono); text-overflow: ellipsis;
}
.field input[type=search] { font: 14px var(--font); }
textarea, .field input, .slug, .chip { font-variant-ligatures: none; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px var(--display); letter-spacing: -.02em; }
.logo img { width: 30px; height: 30px; }
.logo em, .code404 { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slug span, .name, .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo.big { font-size: 28px; justify-content: center; }
.logo.big img { width: 40px; height: 40px; }
.logo.small { font-size: 14px; color: var(--muted); transition: color .2s; } /* color, not opacity: opacity makes text blink */
a.logo.small:hover { color: var(--text); }
.logo.small img { width: 20px; height: 20px; }

/* file type icon (Fluent Emoji 3D) with an extension badge */
.kicon { position: relative; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; }
.kicon img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.kicon b {
  position: absolute; right: -6px; bottom: -3px; padding: 3px 5px; border-radius: 6px;
  background: var(--c); color: #fff; font: 700 9px/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  text-box: trim-both cap alphabetic; /* centers capitals exactly where supported */
  box-shadow: 0 0 0 2px #15151f;
}
.kicon.xl { width: 128px; height: 128px; filter: drop-shadow(0 16px 28px color-mix(in srgb, var(--c) 40%, transparent)); }
.kicon.xl b { right: -10px; bottom: 4px; padding: 5px 10px; border-radius: 9px; font-size: 14px; box-shadow: 0 0 0 3px #17171f; }

/* --- download page --- */
.center {
  min-height: 100vh; min-height: 100dvh; padding: 32px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
.dl { position: relative; overflow: hidden; width: min(460px, 100%); padding: 40px 28px 28px; text-align: center; }
.dl::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 50% at 50% 0%, color-mix(in srgb, var(--c) 28%, transparent), transparent 75%);
}
.dl > * { position: relative; }
.dl .kicon.xl { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.fname { margin: 22px 0 10px; font: 600 23px/1.3 var(--font); letter-spacing: -.01em; overflow-wrap: anywhere; }
.fmeta { margin: 0 0 26px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; }
.tag {
  padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  color: color-mix(in srgb, var(--c) 55%, white);
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.links { display: grid; gap: 8px; margin-top: 24px; text-align: left; }
.links label { margin-top: 6px; }
.code404 { font: 700 76px/1 var(--display); letter-spacing: -.04em; }

/* --- login --- */
.login { width: min(380px, 100%); padding: 34px 28px 28px; display: grid; gap: 12px; text-align: center; }
.login .muted { margin-bottom: 8px; }
.login .btn { margin-top: 6px; }

/* --- dashboard --- */
.wrap { width: min(1060px, 100% - 32px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0; }
.menu { display: flex; align-items: center; gap: 2px; }
.menu form { margin: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-bottom: 16px; }
.upload { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.zone, .panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 178px; margin: 0; padding: 22px; border-radius: 16px; text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, .14);
  background: radial-gradient(70% 90% at 50% 0%, rgba(139, 92, 246, .12), transparent 70%);
}
.zone { cursor: pointer; transition: border-color .2s, background-color .2s; }
.zone:hover, .zone.over { border-color: rgba(139, 92, 246, .75); background-color: rgba(139, 92, 246, .07); }
.zone.over .bubble { transform: translateY(-4px) scale(1.06); }
.bubble { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; border-radius: 17px; transition: transform .2s; }
.bubble .i { width: 26px; height: 26px; }
.zone b, .panel b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.zone small, .panel small { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
/* the chosen file: link field + «Загрузить»; while uploading (.busy) the bar instead */
.panel { border-color: rgba(139, 92, 246, .5); }
.panel .slug { width: min(100%, 420px); margin-top: 8px; text-align: left; }
.panel .slug input::placeholder { color: #7f7e98; } /* the suggested link: a bit dimmer than typed text, brighter than hints */
.panel .actions { justify-content: center; margin-top: 8px; }
.panel.busy .slug, .panel.busy #go, .panel:not(.busy) .bar, .panel:not(.busy) .hint { display: none; }
.panel .hint { font-size: 12.5px; }
.bar, .meter { display: block; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar { width: 100%; max-width: 360px; margin-top: 8px; }
.bar i { transition: width .3s linear; } /* glides between the server's readings */
.bar.wait i { background: linear-gradient(90deg, #8b5cf6, #38bdf8, #8b5cf6) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; } /* sent, waiting for the server */
@keyframes shimmer { to { background-position: -200% 0; } }
.bar i, .meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--grad); transition: width .2s; }
.slug { padding: 0 0 0 14px; font: 13.5px var(--mono); }
.slug span { color: var(--muted); max-width: 55%; }
.slug input { padding: 13px 14px 13px 1px; font: inherit; }
.storage { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.num { font: 600 30px/1.1 var(--display); letter-spacing: -.03em; }
.num small { font: 500 14px var(--font); letter-spacing: 0; color: var(--muted); }
.meter { height: 10px; }
.meter i { min-width: 8px; }
.meter.warn i { background: linear-gradient(90deg, #f59e0b, #f43f5e); }
.stats { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13.5px; }
.stats b { color: var(--text); font-weight: 600; }
.mine { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }

.files { padding: 8px; margin-bottom: 40px; }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 8px; }
.files-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 600 16px var(--display); letter-spacing: -.01em; }
.count { padding: 1px 9px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--muted); font: 600 12px var(--font); }
.search { width: min(240px, 50%); padding: 0 4px 0 10px; color: var(--muted); }
.search input { padding: 7px 6px; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 10px 12px; border-radius: 14px; transition: background .15s;
}
.row:hover { background: rgba(255, 255, 255, .035); }
.row.new { animation: flash 2.6s ease-out; }
@keyframes flash { from { background: rgba(139, 92, 246, .28); } }
.meta { min-width: 0; display: grid; }
.name { font-weight: 600; text-decoration: none; transition: color .15s; }
.name:hover { color: #c4b5fd; }
.sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; color: var(--muted); font-size: 13px; }
.sub .i { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.tail { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 230px; height: 32px; padding: 0 11px;
  border-radius: 9px; border: 1px solid rgba(139, 92, 246, .28); background: rgba(139, 92, 246, .12);
  color: #c4b5fd; font: 500 13px var(--mono); cursor: pointer; transition: background .15s, border-color .15s;
}
.chip:hover { background: rgba(139, 92, 246, .2); border-color: rgba(139, 92, 246, .5); }
.chip .i { width: 14px; height: 14px; }
.acts { display: flex; gap: 2px; }
.empty { margin: 0; padding: 48px 16px 56px; text-align: center; color: var(--muted); }

/* --- dialogs, toast --- */
dialog {
  width: min(560px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--line-hi); border-radius: 22px; background: #11111a; color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9);
}
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(4, 4, 9, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg { display: grid; gap: 12px; padding: 22px; }
.dlg h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; font: 600 17px var(--display); letter-spacing: -.01em; }
.dlg h3 .i { color: #a78bfa; }
.dlg h3 .btn { margin-left: auto; margin-right: -8px; }
.dlg h3 .btn .i { color: inherit; }
.dlg .muted { font-size: 14px; }
.keyline { margin: 0; font-size: 14px; color: var(--muted); }
.keyline b { color: var(--text); }
.keybox { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(139, 92, 246, .08); border: 1px solid rgba(139, 92, 246, .3); }
textarea {
  width: 100%; min-height: 200px; padding: 12px; resize: vertical; border-radius: 12px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: #cfcde3; font: 12px/1.55 var(--mono);
}
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10; width: max-content; max-width: calc(100% - 32px); padding: 11px 18px;
  border-radius: 13px; background: #1b1b29; border: 1px solid var(--line-hi); color: var(--text); font-weight: 500;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .85); opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px); transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(251, 113, 133, .5); color: #fecdd3; }

@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .zone { min-height: 150px; }
}
@media (max-width: 600px) {
  .top { padding: 16px 0; }
  .menu .btn span { display: none; }
  .menu .btn { width: 40px; padding: 0; }
  .row { grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; padding: 12px 8px; }
  .row .kicon { width: 40px; height: 40px; }
  .tail { grid-column: 2; justify-content: space-between; }
  .chip { max-width: 50%; }
  .files-head { flex-wrap: wrap; }
  .search { width: 100%; order: 2; }
  .dl { padding: 34px 18px 20px; }
  .kicon.xl { width: 108px; height: 108px; }
  .fname { font-size: 20px; }
  .actions .btn { flex: 1; }
}
@media (pointer: coarse) { /* iOS zooms into inputs with smaller text */
  .input, .field input, .field input[type=search] { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
