*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #060a12;
  --bg-soft: #0a101c;
  --panel: rgba(13, 21, 36, .68);
  --panel-solid: #0c1422;
  --panel-2: rgba(17, 27, 46, .84);
  --line: rgba(148, 163, 184, .13);
  --line-strong: rgba(148, 163, 184, .24);
  --text: #eef4ff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --mint: #34e5c4;
  --cyan: #22d3ee;
  --blue: #4f8cff;
  --violet: #8b7cff;
  --grad: linear-gradient(115deg, #34e5c4 0%, #38bdf8 44%, #8b7cff 100%);
  --ok: #34d399;
  --danger: #fb7185;
  --warn: #fbbf24;
  --radius: 26px;
  --shadow: 0 40px 100px -40px rgba(0, 0, 0, .9);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  opacity: .5;
}

h1, h2, h3, p { margin: 0; }

button, input { font: inherit; }

button { color: inherit; }

svg { display: block; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .34;
  animation: drift 20s ease-in-out infinite alternate;
}

.orb-a {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, .8), transparent 65%);
}

.orb-b {
  width: 480px;
  height: 480px;
  top: -150px;
  right: -140px;
  background: radial-gradient(circle, rgba(139, 124, 255, .75), transparent 65%);
  animation-delay: -7s;
}

.orb-c {
  width: 520px;
  height: 520px;
  bottom: -280px;
  left: 35%;
  background: radial-gradient(circle, rgba(52, 229, 196, .5), transparent 65%);
  animation-delay: -13s;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .12), 0 0 14px rgba(52, 211, 153, .8);
  flex: none;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(52, 229, 196, .6);
  animation: ping 2.4s ease-out infinite;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--grad);
  color: #04121a;
  box-shadow: 0 18px 45px -16px rgba(34, 211, 238, .7);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 22px 50px -16px rgba(34, 211, 238, .85); }
.btn-primary:active { transform: translateY(0) scale(.99); }

.btn-secondary {
  background: rgba(255, 255, 255, .04);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover { background: rgba(255, 255, 255, .07); border-color: rgba(148, 163, 184, .36); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .07); border-color: var(--line-strong); }

.quiet-btn {
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s;
}

.quiet-btn:hover { color: var(--text); }
.quiet-btn:disabled { opacity: .45; cursor: default; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover { color: var(--text); }

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

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--grad);
  color: #04121a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -12px rgba(34, 211, 238, .8);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-mark-lg {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  margin: 0 auto 26px;
}

.brand-mark-lg svg { width: 34px; height: 34px; }

/* ---------- login ---------- */

.login-screen {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}

.login-card {
  width: min(440px, 100%);
  padding: 40px 36px 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(18, 29, 50, .82), rgba(8, 14, 25, .9));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(24px);
  text-align: center;
}

.login-card .eyebrow { justify-content: center; margin-bottom: 14px; }

.login-card h1 {
  font-size: clamp(38px, 9vw, 52px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 800;
  margin-bottom: 16px;
}

.login-copy {
  max-width: 310px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.pin-input {
  width: 100%;
  height: 66px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(3, 8, 16, .7);
  color: var(--text);
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .5em;
  text-indent: .5em;
  padding: 0 12px;
  transition: border-color .18s, box-shadow .18s;
}

.pin-input::placeholder { color: #3b4a60; letter-spacing: .4em; text-indent: .4em; }

.pin-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, .7);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .1);
}

.form-error {
  min-height: 21px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

#login-btn { width: 100%; margin-top: 6px; }

.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-card.is-error { animation: shake .38s ease; }

/* ---------- app chrome ---------- */

.app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100svh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 18, .72);
  backdrop-filter: blur(22px) saturate(140%);
}

.topbar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }

.brand-name { font-size: 15px; font-weight: 750; letter-spacing: -.02em; }

.brand-sub {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }

.host-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  max-width: 210px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(52, 211, 153, .045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

.host-chip #host-name { overflow: hidden; text-overflow: ellipsis; }
.host-chip .status-dot { width: 6px; height: 6px; }

.main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 0 24px 56px;
  flex: 1;
}

.hero { padding: 76px 0 44px; max-width: 780px; }

.hero h1 {
  margin: 20px 0 22px;
  font-size: clamp(46px, 8.6vw, 86px);
  line-height: .96;
  letter-spacing: -.055em;
  font-weight: 800;
}

.hero-sub {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.upload-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 27, 46, .66), rgba(8, 14, 25, .72));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(18px);
}

.dropzone {
  position: relative;
  overflow: hidden;
  min-height: 272px;
  padding: 38px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1.5px dashed rgba(148, 163, 184, .26);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(34, 211, 238, .07), transparent 70%),
    rgba(3, 8, 16, .35);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-over {
  border-color: rgba(34, 211, 238, .55);
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(34, 211, 238, .12), transparent 72%),
    rgba(4, 10, 20, .55);
  transform: translateY(-2px);
  box-shadow: 0 24px 60px -35px rgba(34, 211, 238, .55);
}

.dropzone.is-over { border-style: solid; }

.drop-glow {
  position: absolute;
  width: 340px;
  height: 180px;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(52, 229, 196, .22), transparent 70%);
  filter: blur(20px);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}

.dropzone:hover .drop-glow,
.dropzone.is-over .drop-glow { opacity: 1; }

.drop-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(52, 229, 196, .22);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(52, 229, 196, .16), rgba(139, 124, 255, .1));
  color: var(--mint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px -18px rgba(34, 211, 238, .9);
  transition: transform .2s;
}

.dropzone:hover .drop-icon { transform: translateY(-3px); }
.drop-icon svg { width: 31px; height: 31px; }

.drop-title { font-size: 21px; font-weight: 700; letter-spacing: -.025em; }

.drop-sub { margin-top: 5px; color: var(--muted-2); font-size: 13.5px; }
.drop-sub span { color: var(--cyan); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 20px; }

.chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, .02);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .15em;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding: 15px 10px 3px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
}

.save-target { display: flex; align-items: center; gap: 8px; min-width: 0; }
.save-target svg { width: 16px; height: 16px; color: var(--mint); flex: none; }
.save-target strong {
  color: var(--muted);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.space { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- queue ---------- */

.queue-wrap { margin-top: 50px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.035em;
}

.count { color: var(--muted-2); font-weight: 600; font-size: 15px; }

.queue-actions { display: flex; align-items: center; gap: 16px; padding-bottom: 5px; }

.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.upload {
  display: flex;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  transition: border-color .2s, background .2s;
}

.file-badge {
  width: 46px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(148, 163, 184, .08);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-image { color: #f9a8d4; background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .18); }
.badge-video { color: #c4b5fd; background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .2); }
.badge-audio { color: #fcd34d; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .18); }
.badge-doc { color: #93c5fd; background: rgba(59, 130, 246, .11); border-color: rgba(59, 130, 246, .19); }
.badge-archive { color: #fdba74; background: rgba(249, 115, 22, .11); border-color: rgba(249, 115, 22, .19); }
.badge-code { color: #6ee7b7; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .18); }

.upload-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }

.upload-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.file-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  flex: none;
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .13);
}

.progress-bar {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width .25s linear;
}

.upload.is-uploading .progress-bar::after,
.upload.is-retrying .progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: shimmer 1.5s linear infinite;
}

.upload-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }

.status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.status .speed { color: var(--muted-2); }

.item-actions { display: flex; align-items: center; gap: 3px; flex: none; }

.item-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.item-btn:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.item-btn svg { width: 14px; height: 14px; }

.retry-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.done-check { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(52, 211, 153, .13); color: var(--ok); }
.done-check svg { width: 15px; height: 15px; }

.upload.is-done { border-color: rgba(52, 211, 153, .18); background: rgba(52, 211, 153, .035); }
.upload.is-done .progress-bar { background: var(--ok); }
.upload.is-done .status { color: var(--ok); }

.upload.is-error { border-color: rgba(251, 113, 133, .28); background: rgba(251, 113, 133, .035); }
.upload.is-error .progress-bar { background: var(--danger); }
.upload.is-error .status { color: var(--danger); }

.upload.is-paused .progress-bar { filter: saturate(.35); }
.upload.is-paused .status { color: var(--warn); }

.upload.is-retrying .status { color: var(--warn); }

/* ---------- steps + footer ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.step { padding: 4px 8px 0 0; }

.step-num { color: var(--cyan); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; }

.step h3 { margin: 11px 0 7px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }

.step p { color: var(--muted-2); font-size: 12.5px; line-height: 1.65; }

.footer {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px 24px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

.footer p { min-width: 0; }
.footer-links { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }

#app-badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- share modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 11, .72);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  padding: 30px 28px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, #101a2c, #080e19);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  text-align: center;
  animation: pop .25s cubic-bezier(.2, .8, .2, 1) both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.modal-close svg { width: 15px; height: 15px; }

.modal-card .eyebrow { justify-content: center; }

.modal-card h2 { margin: 9px 0 8px; font-size: 28px; font-weight: 750; letter-spacing: -.035em; }

.modal-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }

.qr-frame {
  width: 232px;
  max-width: 100%;
  margin: 22px auto;
  padding: 13px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px -25px rgba(34, 211, 238, .7);
}

.qr-frame canvas { width: 100%; height: auto; display: block; border-radius: 6px; }

.share-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(3, 8, 16, .55);
  text-align: left;
}

.share-url code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.share-url button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .09);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.share-url button:hover { background: rgba(255, 255, 255, .14); }

#share-native { width: 100%; margin-top: 10px; }

.modal-note { margin-top: 16px; color: var(--muted-2); font-size: 11px; line-height: 1.6; }
.modal-note strong { color: var(--muted); font-weight: 650; }

body.modal-open { overflow: hidden; }

/* ---------- toasts + network ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 21, 36, .96);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.4;
  animation: toast-in .25s ease both;
}

.toast.is-error { border-color: rgba(251, 113, 133, .4); color: #fecdd3; }
.toast.is-ok { border-color: rgba(52, 211, 153, .32); }
.toast svg { width: 16px; height: 16px; flex: none; color: var(--ok); }
.toast.is-error svg { color: var(--danger); }

.net-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: #fbbf24;
  color: #1c1403;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .topbar-inner { padding: 11px 16px; }
  .brand-sub { display: none; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .host-chip { max-width: 120px; height: 34px; padding: 0 10px; }
  .main { padding: 0 16px 44px; }
  .hero { padding: 50px 0 32px; }
  .hero h1 { font-size: clamp(43px, 12vw, 64px); margin: 16px 0 18px; }
  .hero-sub { font-size: 14.5px; }
  .upload-panel { padding: 10px; }
  .dropzone { min-height: 232px; padding: 30px 14px; }
  .drop-title { font-size: 19px; }
  .drop-icon { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 15px; }
  .drop-icon svg { width: 27px; height: 27px; }
  .chips { margin-top: 16px; }
  .panel-foot { padding: 13px 6px 4px; align-items: flex-start; flex-direction: column; gap: 6px; }
  .save-target strong { max-width: 200px; }
  .section-head { align-items: flex-start; }
  .section-head h2 { font-size: 24px; }
  .queue-actions { gap: 12px; padding-top: 18px; }
  .upload { padding: 13px; gap: 11px; }
  .file-badge { width: 40px; height: 46px; font-size: 8.5px; }
  .file-name { font-size: 13px; }
  .file-size { font-size: 10px; }
  .status { white-space: normal; line-height: 1.35; }
  .steps { grid-template-columns: 1fr; gap: 20px; margin-top: 42px; padding-top: 28px; }
  .step { padding-right: 0; }
  .footer { padding: 22px 16px calc(26px + env(safe-area-inset-bottom)); flex-direction: column; align-items: flex-start; }
  .modal-card { padding: 28px 20px 22px; }
}

@media (max-width: 390px) {
  .host-chip { max-width: 74px; font-size: 11px; }
  .hero h1 { font-size: 42px; }
  .chips .chip { font-size: 7.5px; letter-spacing: .1em; padding: 4px 7px; }
  .file-badge { display: none; }
  .upload { padding: 12px; }
}

/* ---------- motion ---------- */

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, 40px, 0) scale(1.08); }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(52, 229, 196, .55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 229, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 229, 196, 0); }
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.reveal { animation: rise .65s cubic-bezier(.2, .7, .2, 1) both; }
.hero .reveal:nth-child(1) { animation-delay: .02s; }
.hero .reveal:nth-child(2) { animation-delay: .08s; }
.hero .reveal:nth-child(3) { animation-delay: .16s; }
.upload-panel.reveal { animation-delay: .2s; }
.steps.reveal { animation-delay: .28s; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(4, 18, 26, .3);
  border-top-color: #04121a;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

button:disabled { opacity: .55; cursor: default; }

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

/* Messenger-inspired file chat */
:root {
  --bg: #dce6ed;
  --bg-soft: #edf3f7;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-2: #f4f8fb;
  --line: rgba(26, 54, 78, .12);
  --line-strong: rgba(26, 54, 78, .2);
  --text: #172b3a;
  --muted: #536c7d;
  --muted-2: #7890a0;
  --mint: #3390ec;
  --cyan: #3390ec;
  --blue: #3390ec;
  --violet: #5da5e8;
  --grad: linear-gradient(110deg, #3390ec, #55a9ed);
  --ok: #38a979;
  --shadow: 0 8px 24px rgba(31, 60, 82, .08);
}

body { background: #dce6ed; color: var(--text); }
body::after { opacity: .14; background-size: 34px 34px; }
.ambient { display: none; }
.app { min-height: 100svh; }
.topbar { background: #527da3; border: 0; color: #fff; box-shadow: 0 2px 8px rgba(22, 49, 70, .16); }
.topbar-inner { width: min(760px, 100%); padding: 10px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.brand-name { font-size: 16px; }
.brand-sub { color: rgba(255,255,255,.72); letter-spacing: .04em; text-transform: none; font-size: 11px; }
.host-chip { border: 0; background: rgba(255,255,255,.13); color: #fff; height: 34px; }
.host-chip .status-dot { background: #83e2a7; box-shadow: 0 0 0 3px rgba(131,226,167,.14); }
.icon-btn { color: #fff; border: 0; background: rgba(255,255,255,.13); border-radius: 50%; }
.main { width: min(760px, 100%); padding: 0 18px 18px; display: flex; flex-direction: column; }
.hero { order: 0; max-width: none; padding: 26px 2px 18px; }
.hero .eyebrow { font-size: 9px; letter-spacing: .16em; }
.hero h1 { margin: 10px 0 5px; font-size: clamp(25px, 6vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.hero-sub { font-size: 13px; line-height: 1.45; }
.upload-panel { order: 2; position: sticky; bottom: 0; z-index: 20; padding: 9px 0 calc(8px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: linear-gradient(180deg, rgba(220,230,237,.82), #dce6ed 24%); box-shadow: none; backdrop-filter: blur(12px); }
.dropzone { min-height: 64px; padding: 8px 10px; flex-direction: row; justify-content: flex-start; gap: 12px; border: 1px solid rgba(40,90,130,.13); border-radius: 24px; background: #fff; box-shadow: 0 2px 8px rgba(28,62,86,.1); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over { transform: none; border-color: rgba(51,144,236,.45); background: #fff; box-shadow: 0 3px 12px rgba(28,90,140,.13); }
.drop-glow, .chips { display: none; }
.drop-icon { width: 44px; height: 44px; margin: 0; border: 0; border-radius: 50%; background: #e5f3ff; color: #2886dd; box-shadow: none; }
.dropzone:hover .drop-icon { transform: none; }
.drop-icon svg { width: 23px; height: 23px; }
.compose-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; text-align: left; }
.drop-title { font-size: 14px; line-height: 1.3; font-weight: 650; }
.drop-sub { margin-top: 2px; font-size: 11px; color: #8295a3; }
.drop-sub span { color: #3390ec; }
.compose-action { padding: 8px 13px; border-radius: 18px; background: #3390ec; color: #fff; font-size: 12px; font-weight: 650; }
.panel-foot { margin-top: 7px; padding: 7px 10px 0; border: 0; color: #647d8e; font-size: 10.5px; }
.save-target svg { color: #338fe2; }
.save-target strong { color: #344f62; }
.queue-wrap { order: 1; min-height: 145px; margin-top: 2px; padding: 15px 0 10px; }
.section-head { align-items: center; margin-bottom: 10px; }
.section-head .eyebrow { color: #6c8595; font-size: 9px; letter-spacing: .15em; }
.section-head h2 { margin-top: 3px; font-size: 19px; color: #243e51; }
.queue-actions { padding: 0; }
.quiet-btn { color: #4a89bd; }
.queue { gap: 8px; align-items: flex-end; }
.upload { width: min(90%, 540px); padding: 11px 13px; gap: 10px; border: 0; border-radius: 16px 16px 4px 16px; background: #d7edfb; box-shadow: 0 1px 2px rgba(35,75,100,.09); backdrop-filter: none; }
.file-badge { width: 40px; height: 42px; color: #338bd5; background: rgba(255,255,255,.72); border: 0; border-radius: 11px; }
.upload-main { gap: 6px; }
.file-name { color: #183448; font-size: 13px; }
.file-size, .status { color: #607d8e; }
.progress-track { height: 4px; background: rgba(63,119,153,.18); }
.progress-bar { background: #3390ec; }
.upload-bottom { min-height: 19px; }
.item-btn { color: #5e8198; }
.item-btn:hover { color: #236d9e; background: rgba(255,255,255,.5); }
.retry-btn { border-color: rgba(51,144,236,.3); color: #287bb8; }
.upload.is-done { background: #d9f1e3; }
.upload.is-done .progress-bar { background: #35a873; }
.upload.is-done .status { color: #27875d; }
.upload.is-error { background: #fde5e6; }
.upload.is-error .status { color: #c44c58; }
.upload.is-paused .status, .upload.is-retrying .status { color: #a8792a; }
.done-check { background: rgba(53,168,115,.14); color: #279261; }
.steps, .footer { display: none; }
.net-banner { z-index: 40; background: #fff0c2; color: #73551d; }

@media (max-width: 760px) {
  .topbar-inner { padding: 9px 12px; }
  .brand-sub { display: block; }
  .brand-mark { width: 35px; height: 35px; }
  .host-chip { max-width: 132px; height: 32px; padding: 0 9px; font-size: 10px; }
  .main { padding: 0 12px 8px; }
  .hero { padding: 20px 4px 12px; }
  .hero h1 { font-size: 27px; margin: 8px 0 4px; }
  .hero-sub { font-size: 12px; }
  .upload-panel { padding-top: 7px; }
  .dropzone { min-height: 59px; padding: 7px 9px; gap: 10px; }
  .drop-icon { width: 40px; height: 40px; }
  .drop-title { font-size: 13px; }
  .drop-sub { font-size: 10px; }
  .compose-action { padding: 7px 11px; font-size: 11px; }
  .panel-foot { padding: 6px 7px 0; align-items: center; flex-direction: row; gap: 8px; font-size: 10px; }
  .save-target strong { max-width: 150px; }
  .queue-wrap { min-height: 130px; margin-top: 0; }
  .section-head h2 { font-size: 17px; }
  .queue-actions { gap: 10px; }
  .upload { width: 94%; padding: 10px; gap: 8px; }
  .file-badge { display: grid; width: 36px; height: 38px; font-size: 8px; }
  .file-name { font-size: 12px; }
  .file-size { font-size: 9px; }
  .status { font-size: 10px; white-space: nowrap; }
}



