/* ==========================================================================
   Toesjablox Cloud
   ========================================================================== */

:root {
  --bg: #f6f7fc;
  --bg-2: #eef0fa;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --surface-3: #eef0f8;
  --ink: #111428;
  --ink-2: #2b3149;
  --muted: #6c7289;
  --muted-2: #98a0b8;
  --border: #e5e8f2;
  --border-strong: #d6daea;
  --accent: #4f6df5;
  --accent-2: #7b5cf4;
  --accent-3: #06b6d4;
  --accent-soft: #edf1ff;
  --accent-soft-2: #e2e8ff;
  --accent-ink: #3047b8;
  --ok: #0f9d6e;
  --ok-soft: #e6f8f1;
  --warn: #b7791f;
  --warn-soft: #fdf6e7;
  --danger: #d92d4f;
  --danger-soft: #fdecf0;
  --shadow-sm: 0 1px 2px rgba(17, 21, 40, 0.05);
  --shadow-md: 0 10px 30px rgba(17, 21, 40, 0.08);
  --shadow-lg: 0 30px 70px rgba(17, 21, 40, 0.18);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 560px at 6% -12%, #e9e7ff 0%, transparent 60%),
    radial-gradient(1000px 560px at 102% -4%, #e4f6ff 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
::selection { background: rgba(90, 86, 232, 0.22); }

.hidden { display: none !important; }

body.modal-open { overflow: hidden; }

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-orbs span {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.55;
}
.bg-orbs span:nth-child(1) {
  width: 460px;
  height: 460px;
  top: -160px;
  left: -120px;
  background: #d8d4ff;
}
.bg-orbs span:nth-child(2) {
  width: 420px;
  height: 420px;
  top: 8%;
  right: -160px;
  background: #d6f3ff;
}
.bg-orbs span:nth-child(3) {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: 32%;
  background: #ffe4f3;
  opacity: 0.4;
}

/* ============================= Buttons ============================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(90, 86, 232, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(90, 86, 232, 0.34); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn-block { width: 100%; }

.btn-secondary {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-3); box-shadow: none; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(217, 45, 79, 0.25);
}
.btn-danger:hover { background: #c02141; box-shadow: 0 10px 22px rgba(217, 45, 79, 0.3); }

.btn-lg { padding: 13px 22px; font-size: 15px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
  flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* ============================= Brand ============================= */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 7px 18px rgba(90, 86, 232, 0.32);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}
.brand-word em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
  margin-left: 1px;
}
.brand-light { color: #fff; }
.brand-light .brand-mark {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}
.brand-light .brand-word em { color: #d8d4ff; }

/* ============================= Auth ============================= */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  min-height: 100vh;
  padding: 14px;
  gap: 0;
}

.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 42px 52px 34px;
  border-radius: var(--radius-xl);
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(255, 255, 255, 0.22) 0%, transparent 55%),
    radial-gradient(700px 500px at 100% 108%, rgba(6, 182, 212, 0.38) 0%, transparent 55%),
    linear-gradient(145deg, #4f46e5 0%, #6438d8 48%, #7c3aed 100%);
  box-shadow: 0 28px 60px rgba(56, 42, 160, 0.28);
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 70%);
  pointer-events: none;
}
.auth-hero > * { position: relative; }

.hero-copy { max-width: 600px; margin-top: clamp(28px, 7vh, 88px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #efedff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #6ee7b7;
  box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.18);
}

.hero-copy h1 {
  margin: 22px 0 18px;
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 760;
  color: #fff;
}
.hero-copy h1 span {
  background: linear-gradient(100deg, #c7d2fe 0%, #f0abfc 48%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  max-width: 480px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15.5px;
  line-height: 1.65;
}

.hero-features {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 470px;
}
.hero-features li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex: none;
  backdrop-filter: blur(6px);
}
.feature-icon svg { width: 19px; height: 19px; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-features strong {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  color: #fff;
  margin-bottom: 2px;
}
.hero-features small {
  display: block;
  font-size: 12.8px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

.hero-demos {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-top: auto;
  padding: 46px 0 14px;
  min-height: 150px;
}
.demo-card {
  width: 198px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px rgba(23, 12, 74, 0.28);
  overflow: hidden;
}
.demo-photo { transform: rotate(-4deg); }
.demo-video { transform: translateY(26px) rotate(3.5deg); margin-left: -24px; z-index: 2; }
.demo-thumb {
  height: 92px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
}
.demo-photo .demo-thumb { background: linear-gradient(135deg, #f472b6, #a78bfa 60%, #60a5fa); }
.demo-video .demo-thumb { background: linear-gradient(135deg, #22d3ee, #818cf8 65%, #c084fc); }
.demo-thumb svg { width: 34px; height: 34px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.demo-meta { padding: 10px 12px 11px; }
.demo-meta strong { display: block; font-size: 12.5px; font-weight: 650; color: #fff; }
.demo-meta span { display: block; font-size: 10.5px; color: rgba(255, 255, 255, 0.6); margin-top: 1px; }
.demo-share {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 244px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 44px rgba(23, 12, 74, 0.3);
  transform: rotate(-1.5deg);
  color: var(--ink);
}
.demo-share-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.demo-share-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-share strong { display: block; font-size: 12px; }
.demo-share small { display: block; font-size: 10.5px; color: var(--muted); }
.demo-check {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  flex: none;
}
.demo-check svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.hero-foot {
  margin: 18px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.48);
}

.auth-side {
  display: grid;
  place-items: center;
  padding: 34px 24px;
}

.auth-card {
  width: min(448px, 100%);
  padding: 34px 34px 26px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 60px rgba(31, 32, 68, 0.13), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
}
.auth-card-brand { display: none; margin-bottom: 22px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-3);
  margin-bottom: 26px;
}
.auth-tabs button {
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 21, 40, 0.09);
}

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 25px;
  letter-spacing: -0.03em;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 15px;
}
.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(90, 86, 232, 0.12);
}
.field-hint { color: var(--muted-2); font-size: 11.5px; }

.form-error {
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid #f6c9d4;
  color: #a31836;
  font-size: 12.8px;
  line-height: 1.45;
}

.auth-form .btn-block { margin-top: 6px; padding: 12px; font-size: 14.5px; }
.btn-arrow { transition: transform 0.18s ease; }
.auth-form .btn-block:hover .btn-arrow { transform: translateX(3px); }

.switch-hint {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.8px;
}
.auth-legal {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}
.auth-legal strong { color: var(--muted); }

/* ============================= App shell ============================= */

.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 16px;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  z-index: 40;
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.upload-cta { margin: 2px 2px 0; padding: 11px; font-size: 13.5px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  margin: 6px 12px 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.nav-label-spaced { margin-top: 18px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  transition: stroke 0.15s ease;
}
.nav-item > span:nth-child(2) { flex: 1; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item:hover svg { stroke: var(--ink-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.nav-item.active svg { stroke: var(--accent); }
.nav-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  text-align: center;
}
.nav-item.active .nav-count { background: rgba(90, 86, 232, 0.14); color: var(--accent-ink); }

.storage-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background:
    radial-gradient(300px 150px at 110% -20%, rgba(124, 92, 245, 0.16), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--border);
}
.storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.storage-head > span:last-child { color: var(--muted); font-weight: 600; }
.meter {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.storage-line { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.storage-line strong { color: var(--ink-2); font-weight: 650; }
.storage-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 0;
  font-size: 10.5px;
  color: var(--muted-2);
}
.storage-note svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--border);
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex: none;
  text-transform: uppercase;
}
.user-meta { min-width: 0; flex: 1; }
.user-meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(17, 21, 40, 0.4);
  backdrop-filter: blur(2px);
}

/* ============================= Main ============================= */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 78px;
  padding: 0 32px;
  background: rgba(245, 246, 251, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-tools { display: flex; align-items: center; gap: 10px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 234px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90, 86, 232, 0.1); }
.search svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(15, 157, 110, 0.14);
  flex: none;
}
.sync-pill.syncing .sync-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.16); animation: pulse 1.2s ease infinite; }
.sync-pill.error .sync-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(217, 45, 79, 0.14); }

.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 32px 70px;
}

/* ============================= Stats ============================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex: none;
}
.stat-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-indigo { background: var(--accent-soft); color: var(--accent); }
.icon-cyan { background: #e0f7fc; color: #0891b2; }
.icon-pink { background: #fde8f5; color: #db2777; }
.icon-green { background: var(--ok-soft); color: var(--ok); }
.stat-card > div:last-child { min-width: 0; }
.stat-label {
  margin: 0 0 1px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-detail {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================= Files ============================= */

.files-section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.section-head h2 {
  margin: 0 0 2px;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.section-head p { margin: 0; font-size: 12px; color: var(--muted); }
.section-meta { display: flex; align-items: center; gap: 8px; }
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.sort-chip svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: 18px;
  background:
    radial-gradient(500px 160px at 50% -60%, rgba(90, 86, 232, 0.08), transparent 70%),
    rgba(255, 255, 255, 0.55);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  margin-bottom: 22px;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}
.dropzone-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  flex: none;
  box-shadow: var(--shadow-sm);
}
.dropzone-icon svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropzone-copy { flex: 1; min-width: 0; }
.dropzone-copy p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.dropzone-copy p strong { font-weight: 650; }
.dropzone-copy > span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.dropzone-btn { flex: none; }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 16px;
}

.file-card {
  position: relative;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: cardIn 0.35s ease both;
}
.file-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.file-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.file-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.file-thumb.kind-image { background: linear-gradient(135deg, #ece9ff, #f7edff); }
.file-thumb.kind-video { background: linear-gradient(135deg, #e0f2fe, #ede9fe); }
.file-thumb.kind-audio { background: linear-gradient(135deg, #fce7f3, #f3e8ff); }
.file-thumb.kind-document { background: linear-gradient(135deg, #e0f7fa, #e0e7ff); }
.file-thumb.kind-other { background: linear-gradient(135deg, #eef1f7, #e7eaf3); }

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.file-card:hover .file-thumb img { transform: scale(1.035); }
.thumb-glyph {
  color: #8b90b8;
  opacity: 0.9;
}
.thumb-glyph svg { width: 42px; height: 42px; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.kind-image .thumb-glyph { color: #8b7cf6; }
.kind-video .thumb-glyph { color: #6d8fd8; }
.kind-audio .thumb-glyph { color: #d478b4; }
.kind-document .thumb-glyph { color: #4f9bb5; }
.kind-other .thumb-glyph { color: #8b93a8; }

.file-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 15, 32, 0.1) 0%, transparent 30%, transparent 72%, rgba(12, 15, 32, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.file-card:hover .file-thumb::after { opacity: 1; }

.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(17, 21, 40, 0.1);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.status-badge svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.status-badge.status-synced { color: var(--ok); }
.status-badge.status-syncing { color: var(--warn); }
.status-badge.status-error { color: var(--danger); }
.status-spinner {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1.6px solid rgba(183, 121, 31, 0.25);
  border-top-color: var(--warn);
  animation: spin 0.8s linear infinite;
}

.shared-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(17, 21, 40, 0.62);
  color: #fff;
  font-size: 9.5px;
  font-weight: 650;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.shared-tag svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.file-actions {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 3;
}
.file-card:hover .file-actions, .file-card:focus-within .file-actions { opacity: 1; transform: none; }
.action-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-2);
  box-shadow: 0 2px 6px rgba(17, 21, 40, 0.12);
  backdrop-filter: blur(8px);
  transition: background 0.12s ease, color 0.12s ease;
}
.action-btn:hover { background: #fff; color: var(--accent); }
.action-btn[data-act="delete"]:hover { color: var(--danger); }
.action-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.file-info { padding: 10px 12px 12px; }
.file-name {
  margin: 0;
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}
.file-meta {
  margin: 0;
  font-size: 10.8px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-shared-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}
.file-shared-mini svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.empty {
  margin-top: 6px;
  padding: 56px 24px;
  border-radius: 20px;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-icon svg { width: 27px; height: 27px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty h3 { margin: 0 0 5px; font-size: 16.5px; letter-spacing: -0.02em; }
.empty p { margin: 0 auto 18px; max-width: 360px; font-size: 12.8px; color: var(--muted); line-height: 1.55; }

/* ============================= Uploads ============================= */

.upload-tray {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: min(370px, calc(100vw - 32px));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  overflow: hidden;
  animation: trayIn 0.25s ease;
}
.upload-tray > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
}
.upload-tray > header strong { display: block; font-size: 13px; }
.upload-tray > header span { display: block; font-size: 10.5px; color: var(--muted); }
.upload-list { max-height: 300px; overflow-y: auto; padding: 8px; }
.upload-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
}
.upload-row:hover { background: var(--surface-2); }
.upload-file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.upload-file-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.upload-file-meta { min-width: 0; }
.upload-file-meta strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}
.upload-progress .meter { height: 4px; flex: 1; background: var(--surface-3); }
.upload-progress .meter > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.upload-progress .upload-bar.error { background: var(--danger); }
.upload-percent { font-size: 9.5px; font-weight: 650; color: var(--muted); flex: none; }
.upload-state {
  font-size: 9.5px;
  font-weight: 650;
  color: var(--muted);
}
.upload-end { display: flex; align-items: center; gap: 3px; }
.upload-state.done { color: var(--ok); }
.upload-state.failed { color: var(--danger); }
.upload-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
}
.upload-remove:hover { background: var(--surface-3); color: var(--ink); }
.upload-remove svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(90, 86, 232, 0.14);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.drag-card {
  padding: 36px 56px;
  border-radius: 26px;
  background: #fff;
  border: 2px dashed var(--accent);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: popIn 0.2s ease;
}
.drag-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}
.drag-icon svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drag-card h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.02em; }
.drag-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ============================= Modals ============================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 40, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease;
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 40px 100px rgba(15, 18, 40, 0.34);
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
.modal-close:hover { background: #fff; }

.preview-card { max-width: 940px; overflow: hidden; }
.preview-stage {
  display: grid;
  place-items: center;
  min-height: 260px;
  max-height: 64vh;
  padding: 26px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(124, 92, 245, 0.18), transparent 70%),
    #0c0e1a;
  overflow: auto;
}
.preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.preview-stage video {
  display: block;
  width: 100%;
  max-height: 58vh;
  border-radius: 10px;
  background: #000;
}
.preview-stage iframe {
  width: 100%;
  height: 58vh;
  border: 0;
  border-radius: 10px;
  background: #fff;
}
.preview-stage audio { width: min(460px, 100%); }
.preview-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px;
  color: #cfd2e6;
}
.preview-audio .thumb-glyph { color: #a5a9ff; }
.preview-audio .thumb-glyph svg { width: 56px; height: 56px; }
.preview-audio p {
  margin: 0;
  font-size: 13px;
  color: #aeb2cc;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-text {
  width: 100%;
  max-height: 54vh;
  overflow: auto;
  margin: 0;
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #dfe2f2;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-no {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px;
  color: #aeb2cc;
}
.preview-no .thumb-glyph { color: #8b90c8; }
.preview-no .thumb-glyph svg { width: 62px; height: 62px; }
.preview-no p { margin: 0; font-size: 13px; color: #aeb2cc; max-width: 90%; text-align: center; }

.preview-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
}
.preview-title { min-width: 0; }
.preview-title h3 {
  margin: 0 0 2px;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-title p { margin: 0; font-size: 11.5px; color: var(--muted); }
.preview-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.preview-actions .btn { padding: 8px 14px; font-size: 12.5px; }
.preview-foot {
  margin: 0;
  padding: 0 22px 18px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.modal-card.share-card { max-width: 520px; padding: 32px 30px 26px; overflow: visible; }
.share-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}
.share-badge svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-card h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.03em; }
.share-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
}
.switch-copy { min-width: 0; }
.switch-copy strong { display: block; font-size: 12.8px; }
.switch-copy small { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); }
.switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.18s ease;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 21, 40, 0.25);
  transition: transform 0.18s ease;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(90, 86, 232, 0.2); }

.share-link-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.share-link-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
  outline: none;
}
.share-link-row input:focus { border-color: var(--accent); background: #fff; }
.share-link-row input:disabled { color: var(--muted-2); }
.share-link-row .btn { padding: 0 18px; height: 42px; font-size: 12.5px; }
.share-status {
  min-height: 18px;
  margin: 7px 2px 0;
  font-size: 11px;
  color: var(--muted);
}
.share-status.ok { color: var(--ok); }
.share-status.err { color: var(--danger); }

.share-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 6px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11.2px;
  line-height: 1.5;
}
.share-note svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; margin-top: 1px; }
.share-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.share-footer .btn { font-size: 12px; padding: 8px 13px; }

.confirm-card { max-width: 400px; padding: 30px; text-align: center; }
.confirm-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
}
.confirm-badge svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-card h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.02em; }
.confirm-card p { margin: 0 auto 22px; max-width: 300px; font-size: 12.8px; color: var(--muted); line-height: 1.55; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* ============================= Toasts ============================= */

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(17, 21, 40, 0.94);
  color: #fff;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: 0 14px 34px rgba(17, 21, 40, 0.3);
  backdrop-filter: blur(8px);
  animation: toastIn 0.24s ease;
}
.toast svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.toast.success svg { color: #6ee7b7; }
.toast.error svg { color: #fda4af; }

/* ============================= Share page ============================= */

.share-body { min-height: 100vh; }
.share-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 30px 20px;
}
.share-brand { margin-bottom: 2px; }
.share-card {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  width: min(980px, 100%);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 34px 80px rgba(31, 32, 68, 0.16);
  overflow: hidden;
}
.share-preview {
  display: grid;
  place-items: center;
  min-height: 460px;
  max-height: 72vh;
  padding: 24px;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(124, 92, 245, 0.2), transparent 70%),
    #0c0e1a;
  overflow: hidden;
}
.share-preview img {
  display: block;
  max-width: 100%;
  max-height: 66vh;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.share-preview video {
  display: block;
  width: 100%;
  max-height: 66vh;
  border-radius: 8px;
  background: #000;
}
.share-preview iframe {
  width: 100%;
  height: 64vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}
.share-preview audio { width: min(440px, 100%); }
.share-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  color: #c9cce4;
}
.share-audio p {
  margin: 0;
  max-width: 90%;
  font-size: 13px;
  color: #aeb2cc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-file-glyph {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5a9ff;
}
.share-file-glyph svg { width: 42px; height: 42px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.share-preview.no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #aeb2cc;
}
.share-preview.no-preview p {
  margin: 0;
  font-size: 13px;
  color: #aeb2cc;
  max-width: 90%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-text {
  width: 100%;
  height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 22px;
  color: #dfe2f2;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.share-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 36px;
  min-width: 0;
}
.share-kicker {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.share-details h1 {
  margin: 0 0 6px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.share-meta { margin: 0 0 24px; font-size: 12.5px; color: var(--muted); }
.share-actions { display: flex; flex-direction: column; gap: 9px; }
.share-actions .btn { width: 100%; }
.share-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.share-perks span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.8px;
  color: var(--muted);
}
.share-perks svg { width: 13px; height: 13px; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.share-foot { margin: 0; font-size: 11.5px; color: var(--muted-2); }
.share-foot a { color: var(--muted); font-weight: 600; }
.share-foot a:hover { color: var(--accent); }

.share-loading { grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr); }
.skeleton-stage {
  min-height: 460px;
  border-radius: 0;
  background: #121420;
}
.skeleton-lines { padding: 38px 36px; display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-3);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}
.skeleton-line.lg { height: 28px; width: 85%; }
.skeleton-line.sm { height: 14px; width: 55%; margin-bottom: 10px; }
.skeleton-btn { height: 46px; width: 100%; border-radius: 999px; margin-top: 12px; }
.skeleton-stage::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }

.share-error {
  display: block;
  max-width: 460px;
  padding: 44px 36px;
  text-align: center;
}
.share-error-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 17px;
  background: var(--danger-soft);
  color: var(--danger);
}
.share-error-badge svg { width: 27px; height: 27px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-error h1 { margin: 0 0 8px; font-size: 23px; letter-spacing: -0.03em; }
.share-error p { margin: 0 auto 22px; max-width: 330px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* share page toast */
.share-body .toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 300;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(17, 21, 40, 0.94);
  color: #fff;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: 0 14px 34px rgba(17, 21, 40, 0.3);
  animation: toastIn 0.24s ease;
}

/* ============================= Utilities ============================= */

.only-mobile { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes trayIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* ============================= Responsive ============================= */

@media (max-width: 1240px) {
  .hero-demos { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .auth-hero { display: none; }
  .auth-side { min-height: 100vh; padding: 26px 18px; }
  .auth-card { box-shadow: 0 24px 60px rgba(31, 32, 68, 0.12); background: rgba(255, 255, 255, 0.94); }
  .auth-card-brand { display: inline-flex; }

  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    height: 100vh;
    transform: translateX(-104%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: #fff;
    box-shadow: 0 30px 80px rgba(17, 21, 40, 0.28);
    z-index: 120;
  }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-flex; }
  .sidebar-head .only-mobile { display: inline-flex; }
  .topbar { padding: 0 18px; height: 72px; gap: 12px; }
  .content { padding: 20px 18px 60px; }
  .sync-pill { display: none; }
}

@media (max-width: 760px) {
  .search { display: none; }
  .topbar-tools .btn span { display: none; }
  .topbar-tools .btn { padding: 10px 12px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-value { font-size: 16px; }
  .stat-detail { font-size: 10px; }
  .dropzone-btn { display: none; }
  .dropzone-inner { padding: 13px 15px; gap: 11px; }
  .dropzone-copy > span { display: none; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .file-actions { opacity: 1; transform: none; }
  .preview-info { flex-direction: column; align-items: flex-start; gap: 12px; }
  .preview-actions { width: 100%; }
  .preview-actions .btn { flex: 1; }
  .share-card, .share-loading { grid-template-columns: 1fr; }
  .share-preview { min-height: 300px; max-height: 54vh; }
  .share-preview iframe { height: 50vh; }
  .share-details { padding: 26px 24px; }
  .share-details h1 { font-size: 21px; }
  .share-loading .skeleton-stage { min-height: 280px; }
  .share-error { padding: 36px 24px; }
  .share-footer { flex-wrap: wrap; }
  .share-footer .btn { flex: 1; }
}

@media (max-width: 520px) {
  .auth-side { padding: 16px 12px; }
  .auth-card { padding: 26px 22px 20px; border-radius: 22px; }
  .auth-tabs { margin-bottom: 22px; }
  .stat-card { padding: 11px; gap: 9px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-icon svg { width: 17px; height: 17px; }
  .stat-label { font-size: 9px; }
  .stat-value { font-size: 14.5px; }
  .stat-detail { display: none; }
  .content { padding: 16px 14px 56px; }
  .topbar { padding: 0 14px; height: 66px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .section-head { align-items: flex-start; }
  .sort-chip { display: none; }
  .file-thumb { aspect-ratio: 1 / 1; }
  .file-grid { gap: 10px; }
  .file-info { padding: 9px 10px 10px; }
  .file-name { font-size: 11.8px; }
  .file-meta { font-size: 10px; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); border-radius: 20px; }
  .preview-stage { padding: 12px; }
  .share-card { padding: 26px 20px 22px; }
  .share-link-row { flex-direction: column; }
  .share-link-row .btn { height: 40px; }
  .upload-tray { right: 12px; bottom: 12px; }
  .share-page { padding: 20px 12px; gap: 18px; }
  .share-details { padding: 22px 20px; }
  .share-body .share-card { border-radius: 22px; }
}

@media (hover: none) {
  .file-actions { opacity: 1; transform: none; }
}

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