:root {
  --bg: #0b0e14;
  --bg2: #10151f;
  --card: #151b27;
  --line: #232c3d;
  --text: #e6ecf5;
  --muted: #8b96ab;
  --teal: #22d3a5;
  --teal-dark: #0e5b50;
  --danger: #f87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #16202f 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.45;
}

/* Auth */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 16px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  text-align: center;
}
.logo { font-size: 26px; font-weight: 900; letter-spacing: .3px; }
.tagline { color: var(--muted); font-size: 14px; margin: 10px 0 22px; line-height: 1.5; }
.features {
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  justify-content: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin: 24px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
}
.switch { margin-top: 18px; font-size: 14px; color: var(--muted); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Forms */
input[type=text], input[type=email], input[type=password] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font-size: 15px;
}
input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(34,211,165,.18); }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--teal);
  background: var(--teal-dark);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  transition: background .15s, transform .05s;
}
button:hover, .btn:hover { background: #137a6b; text-decoration: none; color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-block {
  display: flex;
  width: 100%;
  margin-top: 6px;
}
a.btn-block { text-decoration: none; }
.btn-mini { padding: 8px 14px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--teal); }
.btn-ghost:hover { background: rgba(34,211,165,.12); color: var(--teal); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); padding: 6px 10px; }
.btn-danger:hover { background: rgba(248,113,113,.12); color: var(--danger); }

/* Flash */
.flash { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; text-align: left; border: 1px solid; overflow-wrap: anywhere; }
.flash-err { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.4); color: #fecaca; }

/* Dashboard */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(11,14,20,.8);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.top-inner { max-width: 980px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top-inner nav { display: flex; align-items: center; }
.top-inner nav a { margin-left: 18px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.top-inner nav a:hover { color: var(--teal); text-decoration: none; }

.dash { max-width: 980px; margin: 0 auto; padding: 28px 20px 80px; width: 100%; }
.greet { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.greet h1 { margin: 0 0 6px; font-size: 26px; overflow-wrap: anywhere; }
.greet p { margin: 0; }
.muted { color: var(--muted); }
.muted.small, .small { font-size: 12.5px; }
.small { color: var(--muted); }
.muted .block, .small.block { display: block; }
code { background: var(--bg2); padding: 2px 6px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); overflow-wrap: anywhere; }

.chip {
  background: rgba(34,211,165,.12);
  color: var(--teal);
  border: 1px solid rgba(34,211,165,.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  min-width: 0;
}
.card h2 { margin: 0 0 16px; font-size: 17px; overflow-wrap: anywhere; }
.ok-card { border-color: rgba(34,211,165,.5); }
#uppresult:empty { display: none; }
#uppresult .card:last-child { margin-bottom: 20px; }

.drop { position: relative; margin-bottom: 12px; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dlab {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 34px 16px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop:hover .dlab, .drop:focus-within .dlab { border-color: var(--teal); background: rgba(34,211,165,.05); }
.drop.drag .dlab { border-color: var(--teal); background: rgba(34,211,165,.12); box-shadow: inset 0 0 0 2px rgba(34,211,165,.3); }
.dlab .big { font-size: 40px; }
.dlab strong { overflow-wrap: anywhere; max-width: 100%; }

.progress-wrap { margin: 14px 0 4px; }
.progress-track {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e5b50, var(--teal));
  transition: width .25s ease;
  position: relative;
}
.progress-wrap.active .progress-fill {
  animation: vault-stripes 1.1s linear infinite;
  background-image: linear-gradient(45deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%, transparent);
  background-size: 28px 28px;
}
@keyframes vault-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 7px;
}
.progress-meta #progpct { color: var(--teal); font-weight: 800; }
.progress-err { margin-top: 8px; color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
button[disabled], .btn[disabled] { opacity: .55; cursor: not-allowed; }

.field-label { display: block; font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.share-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: stretch; }
.share-in { flex: 1 1 auto; min-width: 0; margin-bottom: 0 !important; text-overflow: ellipsis; }
.share-in.sm { font-size: 12px; padding: 8px 10px; }
.share-row .btn { white-space: nowrap; flex: 0 0 auto; }

.empty { padding: 10px 0 4px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.files { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.files th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.files td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.files tr:last-child td { border-bottom: none; }
.files td form { display: inline; margin: 0; }
.f-name { max-width: 260px; }
.fname { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.fname:hover { color: var(--teal); }
.nowrap { white-space: nowrap; }
.f-link { min-width: 280px; }
.f-del { white-space: nowrap; text-align: right; }

@media (max-width: 720px) {
  .dash { padding: 20px 14px 60px; }
  .card { padding: 16px; }
  .greet h1 { font-size: 22px; }
  .files { min-width: 0; }
  .files, .files tbody { display: block; }
  .files thead { display: none; }
  .files tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 12px; }
  .files td { display: block; border: none; padding: 6px 0; max-width: none; }
  .f-del { text-align: left; }
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
}
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .share-row { flex-wrap: wrap; }
  .share-row .share-in { flex: 1 1 100%; }
  .share-row .btn { flex: 1 1 auto; }
  .top-inner { padding: 12px 14px; }
}

/* Share page */
.share-card { max-width: 460px; padding-top: 44px; }
.fbig { font-size: 64px; margin: 8px 0; }
.share-card h1 { font-size: 20px; margin: 6px 0; word-break: break-word; }
.meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin: 8px 0 20px; }
.hosted { margin-top: 26px; opacity: .7; }
