:root {
  --brand: #5b5bd6;
  --brand-2: #8a63f2;
  --brand-dark: #3e3fa8;
  --accent-blue: #3a8dde;
  --accent-pink: #c86bd8;
  --accent-red: #e5566a;
  --ink: #23243a;
  --muted: #6b6f87;
  --line: #e6e7f0;
  --bg: #f5f6fb;
  --card: #ffffff;
  --ok: #2fa86b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(40, 42, 110, .12);
  --nav: linear-gradient(90deg, #5b5bd6, #7d63e8);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
button, input { font: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; transition: transform .1s, box-shadow .2s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 16px rgba(91, 91, 214, .35); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(91, 91, 214, .45); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.85); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-white { background: #fff; color: var(--brand-dark); }
.btn-light { background: #eef0fb; color: var(--brand-dark); }
.btn-light:hover { background: #e2e5fa; }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- nav ---------- */
.nav {
  background: var(--nav); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.logo svg { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a { color: #fff; font-weight: 700; opacity: .92; }
.nav-links a:hover { opacity: 1; }
.nav-links .btn { padding: 7px 20px; }
.nav-links a.btn-white { color: var(--brand-dark); }

/* ---------- hero ---------- */
.hero {
  max-width: 1180px; margin: 0 auto; padding: 56px 20px 72px;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center;
}
.hero > * { min-width: 0; }
.hero-art { position: relative; aspect-ratio: 5 / 3.4; }
.hero h1 { font-size: clamp(26px, 4vw, 46px); line-height: 1.15; margin: 28px 0 8px; font-weight: 800; }
.hero h1 .c1 { color: var(--accent-blue); }
.hero h1 .c2 { color: var(--accent-pink); }
.hero h1 .c3 { color: var(--accent-red); }
.hero .sub { color: var(--muted); font-size: 14px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 18px; }
.hero-cta .btn { padding: 13px 26px; font-size: 16px; }
.hero-cta span { color: var(--muted); font-size: 14px; }
.guest-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px;
  background: #fff8e6; border: 1px solid #f5dc9c; color: #7a5a00; border-radius: 12px; padding: 10px 16px; font-size: 14px;
}
.guest-note a { font-weight: 800; }

.auth-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 30px; border-top: 5px solid; border-image: linear-gradient(90deg, var(--accent-pink), var(--brand), var(--accent-red)) 1;
}
.auth-card h2 { text-align: center; font-weight: 400; font-size: 34px; margin: 0 0 22px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin: -14px 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 91, 214, .15); }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 12px; }
.auth-switch { text-align: center; font-size: 14px; margin-top: 16px; color: var(--muted); }
.auth-switch a { font-weight: 700; cursor: pointer; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-card .btn-google { background: #fff; color: var(--ink); border: 1.5px solid var(--line); margin-top: 0; }
.auth-card .btn-google:hover { background: #f7f8fc; border-color: #d4d6e6; }
.form-error { color: var(--accent-red); font-size: 14px; min-height: 20px; margin: 4px 0 0; }
.check { display: block; font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.check input { vertical-align: -2px; margin: 0 6px 0 0; }

/* ---------- landing sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 64px 20px; }
.section h2 { font-size: 32px; text-align: center; margin: 0 0 10px; }
.section .lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 40px; }
.band { background: linear-gradient(120deg, #5b5bd6, #8a63f2 60%, #c86bd8); color: #fff; }
.band .lead { color: rgba(255,255,255,.85); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.feature .ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, #eef0fb, #f6eefb); color: var(--brand);
}
.feature h3 { margin: 0 0 6px; font-size: 19px; }
.feature p { margin: 0; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { background: rgba(255,255,255,.12); border-radius: var(--radius); padding: 26px; backdrop-filter: blur(4px); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: var(--brand); font-weight: 800; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; opacity: .9; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--card); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(40,42,110,.06); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--muted); margin: 10px 0 0; }

.footer { background: #23243a; color: #b9bbd0; padding: 36px 20px; text-align: center; font-size: 14px; }
.footer a { color: #fff; margin: 0 10px; }

/* ---------- app ---------- */
.app-nav .storage { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.meter { width: 160px; height: 8px; background: rgba(255,255,255,.3); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .4s; }
.user-btn { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.user-btn:hover { background: rgba(255,255,255,.28); }

.app-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }

.addbar {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; display: flex; gap: 10px; align-items: center;
}
.addbar .input { border-radius: 999px; padding-left: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b6f87' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E") no-repeat 16px center; }
.addbar .hint { font-size: 12px; color: var(--muted); padding: 6px 6px 0; }

.drop-overlay {
  position: fixed; inset: 0; background: rgba(91, 91, 214, .85); color: #fff; z-index: 50;
  display: none; place-items: center; font-size: 26px; font-weight: 800;
}
.drop-overlay.show { display: grid; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 22px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-head .spacer { flex: 1; }

.transfer { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.transfer:last-child { border-bottom: 0; }
.transfer .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer .meta { font-size: 12px; color: var(--muted); grid-column: 1; }
.transfer .meta.err { color: var(--accent-red); }
.transfer .upsell { grid-column: 1; font-size: 13px; font-weight: 800; }
.bar { grid-column: 1; height: 8px; background: #eceefa; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s; }
.bar.live > span { transition: none; } /* animated frame by frame */
.bar.indeterminate > span { width: 30% !important; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.transfer .x { grid-row: 1 / span 3; grid-column: 2; }

.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 700; }
.crumbs a { cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: #eef0fb; }
.crumbs .sep { color: var(--muted); }

.files { width: 100%; border-collapse: collapse; }
.files td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.files tr:last-child td { border-bottom: 0; }
.files tr:hover td { background: #fafaff; }
.files .fname { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.files .fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fname:hover span { color: var(--brand); }
.files .size { color: var(--muted); font-size: 13px; white-space: nowrap; width: 90px; text-align: right; }
.files .actions { width: 1%; white-space: nowrap; text-align: right; }
.ficon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ficon.folder { background: #fff3d6; color: #e0a316; }
.ficon.video { background: #e8f1fd; color: var(--accent-blue); }
.ficon.audio { background: #f6eafa; color: var(--accent-pink); }
.ficon.image { background: #e7f7ef; color: var(--ok); }
.ficon.file { background: #eef0f5; color: var(--muted); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: #eef0fb; color: var(--brand); }
.icon-btn.danger:hover { background: #fdebee; color: var(--accent-red); }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty svg { color: #c9cbe0; margin-bottom: 10px; }

/* ---------- modal / player ---------- */
.modal { position: fixed; inset: 0; background: rgba(18, 18, 36, .82); z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-box { background: #111; border-radius: 14px; overflow: hidden; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 10px; color: #fff; padding: 10px 14px; background: #1b1b2e; }
.modal-head .title { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .icon-btn { color: #ccc; }
.modal-head .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.modal-body { display: grid; place-items: center; min-height: 200px; overflow: auto; }
.modal-body video, .modal-body img { max-width: 100%; max-height: calc(100vh - 120px); display: block; }
.modal-body audio { width: min(600px, 90%); margin: 60px 0; }
.player-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700;
  background: rgba(0, 0, 0, .55); padding: 10px 18px; border-radius: 999px; pointer-events: none;
}
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-box { position: relative; }
.modal-body pre { color: #ddd; padding: 20px; margin: 0; white-space: pre-wrap; width: 100%; font-size: 13px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: #23243a; color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  transition: transform .3s; z-index: 70; max-width: calc(100% - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--accent-red); }

/* ---------- admin ---------- */
.admin-badge { background: rgba(255,255,255,.22); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .value { font-size: 26px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 700; }
.admin-search { width: 220px; padding: 7px 12px; }
.admin-check { margin: 0; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); }
.admin-table .sub { font-size: 12px; color: var(--muted); }
.admin-table td.size { text-align: left; width: auto; display: table-cell; }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.who-text { min-width: 0; }
.who-cell .email { font-weight: 700; word-break: break-all; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #eef0fb; color: var(--brand); font-weight: 800; object-fit: cover; }
.storage-cell { min-width: 150px; }
.storage-cell .bar { margin-top: 4px; }
.name-cell { font-weight: 700; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #eef0f5; color: var(--muted); vertical-align: 1px; }
.tag-admin { background: #ece9fd; color: var(--brand-dark); }
.tag.status-ready { background: #e7f7ef; color: var(--ok); }
.tag.status-downloading, .tag.status-metadata { background: #e8f1fd; color: var(--accent-blue); }
.tag.status-error { background: #fdebee; color: var(--accent-red); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .features, .steps { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
  .meter { width: 80px; }
  .storage .label, .user-btn .who { display: none; }
  .addbar { flex-wrap: wrap; }
  .addbar .input { flex-basis: 100%; }
  .addbar .btn { flex: 1; }
  .files .size { display: none; }
  .files td { padding: 10px 12px; }
  .logo span { display: none; }
  .panel-head { flex-wrap: wrap; }
  .admin-search { width: 100%; order: 3; }
  .hero { padding: 24px 16px 48px; gap: 28px; }
  .auth-card { padding: 26px 20px; }
  .section { padding: 48px 16px; }
}
