:root {
  --bg: #f5f5f8;
  --bg-glow: rgba(124, 92, 255, 0.10);
  --card: #ffffff;
  --card-2: #f7f7fa;
  --text: #15151b;
  --muted: #6c6c7a;
  --faint: #9b9baa;
  --border: #e4e4ec;
  --border-strong: #d2d2de;
  --accent: #6d4dff;
  --accent-2: #9b7bff;
  --accent-soft: rgba(109, 77, 255, 0.10);
  --accent-text: #ffffff;
  --danger: #d6345b;
  --danger-soft: rgba(214, 52, 91, 0.10);
  --ok: #17a673;
  --warn: #d99500;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 8px 24px rgba(20, 20, 40, 0.06);
  --t-image: #2f9e6e;
  --t-video: #d9480f;
  --t-audio: #c2255c;
  --t-doc: #1c7ed6;
  --t-archive: #9c6b00;
  --t-other: #6c6c7a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c11;
    --bg-glow: rgba(124, 92, 255, 0.16);
    --card: #15151c;
    --card-2: #1b1b24;
    --text: #ececf2;
    --muted: #a0a0b0;
    --faint: #6e6e7e;
    --border: #262631;
    --border-strong: #34343f;
    --accent: #8466ff;
    --accent-2: #a98fff;
    --accent-soft: rgba(132, 102, 255, 0.14);
    --danger: #ff5c80;
    --danger-soft: rgba(255, 92, 128, 0.12);
    --ok: #3ccf91;
    --warn: #f2b33d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
    --t-image: #4fd19a;
    --t-video: #ff8a4c;
    --t-audio: #ff6b9d;
    --t-doc: #5aa9ff;
    --t-archive: #e0b341;
    --t-other: #a0a0b0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c11; --bg-glow: rgba(124, 92, 255, 0.16); --card: #15151c; --card-2: #1b1b24;
  --text: #ececf2; --muted: #a0a0b0; --faint: #6e6e7e; --border: #262631; --border-strong: #34343f;
  --accent: #8466ff; --accent-2: #a98fff; --accent-soft: rgba(132, 102, 255, 0.14);
  --danger: #ff5c80; --danger-soft: rgba(255, 92, 128, 0.12); --ok: #3ccf91; --warn: #f2b33d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
  --t-image: #4fd19a; --t-video: #ff8a4c; --t-audio: #ff6b9d; --t-doc: #5aa9ff; --t-archive: #e0b341; --t-other: #a0a0b0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- header ---------- */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.logo svg.i { width: 17px; height: 17px; stroke-width: 2.4; }
.account { display: flex; align-items: center; gap: 8px; }
.user-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase;
}
.user-pill .uname { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.btn:hover { border-color: var(--border-strong); background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.confirm { background: var(--danger); color: #fff; width: auto; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 600; }

/* ---------- hero / drop zone ---------- */
.hero { text-align: center; margin-bottom: 18px; }
.hero h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); }

.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 250px; padding: 32px 20px; border-radius: 20px; text-align: center; cursor: pointer;
  background: var(--card); border: 1.5px dashed var(--border-strong); box-shadow: var(--shadow);
  transition: border-color .2s, background .2s, transform .2s;
}
.drop:hover { border-color: var(--accent); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop-icon {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); transition: transform .25s;
}
.drop-icon svg.i { width: 28px; height: 28px; }
.drop:hover .drop-icon, .drop.over .drop-icon { transform: translateY(-4px); }
.drop strong { font-size: 18px; letter-spacing: -0.01em; }
.drop .hint { color: var(--muted); font-size: 14px; }
.drop .hint kbd {
  font: inherit; font-size: 12px; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--card-2);
}
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; font-weight: 500;
}
.chip svg.i { width: 14px; height: 14px; }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.warn { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.chip button { all: unset; cursor: pointer; text-decoration: underline; font-weight: 600; }

/* ---------- storage ---------- */
.storage { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 0 4px; font-size: 13px; color: var(--muted); }
.storage .bar { flex: 1; }
.storage strong { color: var(--text); font-weight: 600; }
.bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar > div.warn { background: var(--warn); }
.bar > div.full { background: var(--danger); }

/* ---------- file rows ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 4px 10px; }
.section-head h2 { font-size: 15px; margin: 0; letter-spacing: -0.01em; }
.list { display: flex; flex-direction: column; gap: 8px; }
#current:not(:empty) { margin-top: 16px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.tile {
  width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center;
  color: var(--tc, var(--t-other)); background: color-mix(in srgb, var(--tc, var(--t-other)) 13%, transparent);
  overflow: hidden; position: relative;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile svg.i { width: 20px; height: 20px; }
.item .body { flex: 1; min-width: 0; }
.item .name { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.name:hover { color: var(--accent); }
.item .meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; display: flex; gap: 6px; flex-wrap: wrap; }
.item .meta .dot::before { content: "·"; margin-right: 6px; }
.item .meta .soon { color: var(--warn); }
.item .actions { display: flex; gap: 2px; align-items: center; }
.item .bar { margin-top: 7px; height: 4px; }
.item .error { color: var(--danger); }
.item.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.linkbox {
  display: flex; align-items: center; gap: 6px; margin-top: 7px; padding: 3px 3px 3px 10px;
  border-radius: 9px; background: var(--card-2); border: 1px solid var(--border);
}
.linkbox input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.empty {
  text-align: center; color: var(--muted); padding: 26px 16px; border: 1px dashed var(--border);
  border-radius: 14px; font-size: 14px;
}

/* ---------- auth dialog ---------- */
dialog {
  width: min(380px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
dialog::backdrop { background: rgba(8, 8, 14, 0.55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.auth { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth h3 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.auth .sub { margin: -6px 0 4px; color: var(--muted); font-size: 13.5px; }
.auth label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.auth input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
.auth input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth .btn.primary { height: 40px; margin-top: 4px; }
.auth .error { color: var(--danger); font-size: 13px; min-height: 0; }
.auth .switch { text-align: center; font-size: 13.5px; color: var(--muted); }
.auth .switch button { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; }
.dialog-close { position: absolute; top: 12px; right: 12px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 550; box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
.toast svg.i { width: 16px; height: 16px; }

footer { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 48px; }

/* ---------- view page ---------- */
.view main { max-width: 960px; }
.stage {
  display: grid; place-items: center; min-height: 240px; padding: 12px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
}
.stage img, .stage video { display: block; max-width: 100%; max-height: 72vh; border-radius: 12px; }
.stage video { background: #000; width: 100%; }
.stage.audio { padding: 36px 24px; gap: 18px; }
.stage audio { width: min(560px, 100%); }
.big-tile { width: 96px; height: 96px; border-radius: 26px; }
.big-tile svg.i { width: 42px; height: 42px; stroke-width: 1.6; }
.file-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 0 4px; }
.file-info .title { min-width: 0; flex: 1; }
.file-info h1 { font-size: 20px; margin: 0; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.file-info .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- homepage ---------- */
/* Signed out: the homepage. Signed in: just the uploader and your files. */
.signed-in .marketing { display: none !important; }
:root:not(.signed-in) .app-only { display: none !important; }
.app-only { padding: 20px 0 6px; text-align: left; }
.app-only h1 { font-size: 28px; }
main.wide { max-width: 1080px; }
.home header { margin-bottom: 8px; }
.nav { display: flex; gap: 26px; font-size: 14.5px; font-weight: 500; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, #ff7eb6); -webkit-background-clip: text; background-clip: text; color: transparent; }

.narrow { max-width: 720px; margin: 0 auto; }
.home-hero { padding: 36px 0 10px; margin-bottom: 26px; }
.home-hero h1 { font-size: 50px; line-height: 1.05; letter-spacing: -0.04em; margin: 16px auto 14px; font-weight: 800; max-width: 680px; }
.home-hero .lead { font-size: 17.5px; color: var(--muted); margin: 0 auto; max-width: 540px; }
.showcase { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; padding-top: 88px; }
.showcase-copy h2 { font-size: 34px; letter-spacing: -0.03em; margin: 0 0 12px; line-height: 1.1; }
.showcase-copy p { color: var(--muted); font-size: 16.5px; margin: 0; }

/* Generic chat mock showing what an embed looks like. */
.chat {
  background: #1e1f24; color: #e6e6ea; border-radius: 18px; padding: 0 0 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(20, 10, 60, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 14.5px; transform: rotate(-1deg);
}
.chat-top { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-weight: 600; color: #f2f2f5; }
.chat-top .hash { color: #8a8b93; margin-right: 6px; font-weight: 500; }
.msg { display: flex; gap: 12px; padding: 12px 16px 2px; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #111; }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-head span { color: #8a8b93; font-size: 12px; }
.msg-link { color: #7cb4ff; margin-top: 2px; overflow-wrap: anywhere; }
.embed-video { margin-top: 8px; border-radius: 10px; overflow: hidden; max-width: 380px; background: #000; }
.embed-video .cover {
  aspect-ratio: 16 / 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(135deg, #2a1f5c, #7c5cff); color: #fff;
}
.embed-video .note { font-size: 46px; line-height: 1; }
.embed-video .track { font-weight: 600; font-size: 14px; opacity: .9; }
.player { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #111; font-size: 11.5px; color: #c8c8d0; }
.player .play { width: 0; height: 0; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.player .scrub { flex: 1; height: 4px; background: #3a3a42; border-radius: 2px; }
.player .scrub div { width: 33%; height: 100%; background: #fff; border-radius: 2px; }

.block { padding: 56px 0 8px; }
.block-head { text-align: center; max-width: 620px; margin: 0 auto 30px; }
.block-head h2 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 8px; }
.block-head p { margin: 0; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.feature h3 { margin: 14px 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.f-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent);
}
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: none; }
.steps li { padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); }
.steps h3 { margin: 14px 0 6px; font-size: 16px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.step-n {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin: 0 auto; }
.plan { position: relative; display: flex; flex-direction: column; padding: 26px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan h3 { margin: 0; font-size: 19px; }
.plan > p { margin: 4px 0 16px; font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.plan li svg.i { width: 16px; height: 16px; color: var(--ok); stroke-width: 2.5; }
.plan-tag { position: absolute; top: 22px; right: 22px; }
.faq { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.cta-band {
  margin-top: 64px; padding: 48px 24px; border-radius: 24px; text-align: center;
  background: radial-gradient(600px 200px at 50% 0%, var(--accent-soft), transparent), var(--card);
  border: 1px solid var(--border);
}
.cta-band h2 { font-size: 30px; letter-spacing: -0.03em; margin: 0 0 6px; }
.cta-band p { color: var(--muted); margin: 0 0 22px; }
.home footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left; }
.small-brand { font-size: 14px; color: var(--muted); }
.small-brand .logo { width: 22px; height: 22px; border-radius: 7px; box-shadow: none; }
.small-brand .logo svg.i { width: 13px; height: 13px; }

@media (max-width: 900px) {
  .home-hero h1 { font-size: 42px; }
  .showcase { grid-template-columns: 1fr; gap: 28px; padding-top: 64px; text-align: center; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .chat { transform: none; }
}
@media (max-width: 680px) {
  .nav { display: none; }
}

@media (max-width: 560px) {
  .home-hero { padding-top: 16px; }
  .home-hero h1 { font-size: 33px; }
  .home-hero .lead { font-size: 16px; }
  .showcase-copy h2 { font-size: 26px; }
  .features, .steps, .plans { grid-template-columns: 1fr; }
  .block-head h2, .cta-band h2 { font-size: 26px; }
  .account .btn.ghost { display: none; }
  .hero h1 { font-size: 25px; }
  .drop { min-height: 210px; }
  .user-pill .uname { display: none; }
  .item { flex-wrap: wrap; }
  .item .body { flex-basis: calc(100% - 60px); }
  .item .actions { margin-left: 56px; }
  .file-info .actions { width: 100%; }
  .file-info .actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
