/* =========================================================
   SyncShare · 同频
   Shared visual system for login + workspace
   ========================================================= */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e5eaf2;
  --line-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #dbeafe;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --navy: #0b1426;
  --navy-soft: #111d33;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 16px 40px -20px rgba(15, 23, 42, 0.22), 0 3px 10px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 32px 80px -30px rgba(8, 16, 32, 0.5);
  --font-sans: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

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

.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
  vertical-align: 1px;
  flex: 0 0 auto;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 52%, #6d28d9 130%);
  border-color: rgba(29, 78, 216, 0.5);
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px -12px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: saturate(1.06);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(239, 68, 68, 0.8);
}

.btn-danger:hover {
  filter: saturate(1.08);
}

.btn-block {
  width: 100%;
}

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

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn.is-loading .btn-spinner {
  display: block;
}

.btn.is-loading .btn-arrow {
  display: none;
}

.btn.is-loading .btn-label {
  opacity: 0.9;
}

.text-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.text-btn:hover {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn.danger:hover {
  background: #fef2f2;
  color: var(--red);
}

.icon-btn--dark {
  color: #8ea1bc;
}

.icon-btn--dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-btn .ico {
  width: 18px;
  height: 18px;
}

/* ---------- Avatars ---------- */

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  user-select: none;
}

.avatar-text {
  font-size: 0.42em;
  line-height: 1;
}

.avatar-xxs {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 28px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 36px;
}

.avatar-md {
  width: 42px;
  height: 42px;
  font-size: 42px;
}

.av-0 {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}
.av-1 {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}
.av-2 {
  background: linear-gradient(135deg, #34d399, #059669);
}
.av-3 {
  background: linear-gradient(135deg, #fbbf24, #ea580c);
}
.av-4 {
  background: linear-gradient(135deg, #f472b6, #db2777);
}
.av-5 {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
}

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

.auth-page {
  min-height: 100vh;
  background: #f7f8fc;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  min-height: 100vh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 38px clamp(36px, 4.6vw, 74px) 30px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(90% 80% at 8% 0%, #172b4d 0%, transparent 55%),
    radial-gradient(75% 70% at 100% 100%, rgba(109, 40, 217, 0.35), transparent 60%),
    linear-gradient(150deg, #07111f 0%, #0b1729 48%, #101a30 100%);
}

.visual-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(circle at 34% 22%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 34% 22%, #000 0%, transparent 72%);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.orb-a {
  top: -150px;
  left: 8%;
  width: 390px;
  height: 390px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.34), transparent 66%);
}

.orb-b {
  right: -120px;
  bottom: 14%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28), transparent 68%);
}

.orb-c {
  top: 38%;
  right: 22%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 68%);
}

.visual-top,
.visual-copy,
.auth-preview,
.visual-foot {
  position: relative;
  z-index: 2;
}

.visual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}

.brand--light {
  color: #fff;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 42%, #7c3aed 100%);
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 9px 8px 8px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 16px 10px 9px 17px;
  border-radius: 4px;
  background: rgba(8, 18, 36, 0.92);
}

.brand-mark-inner {
  display: none;
}

.brand-type {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.brand-type small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  opacity: 0.58;
}

.brand-type--dark {
  color: var(--ink);
}

.brand-badge {
  padding: 7px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #c4d2e7;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
}

.visual-copy {
  width: min(560px, 100%);
  margin-top: clamp(44px, 8vh, 92px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #7dd3fc;
}

.eyebrow-dot {
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

.visual-copy h1 {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(42px, 4.4vw, 66px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.visual-copy h1 span {
  display: inline-block;
}

.eyebrow--light + h1 {
  margin-top: 18px;
}

.text-gradient {
  background: linear-gradient(100deg, #7dd3fc 0%, #a5b4fc 46%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.visual-lead {
  max-width: 470px;
  margin-top: 22px;
  color: #a9bad2;
  font-size: 15px;
  line-height: 1.85;
}

.visual-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.visual-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #c4d2e7;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

.feature-icon .ico {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

/* Floating preview */

.auth-preview {
  width: min(420px, 92%);
  margin-top: auto;
  padding-top: 38px;
  align-self: flex-end;
  transform: rotate(-1.4deg);
}

.preview-window {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.965);
  box-shadow: 0 36px 80px -34px rgba(2, 6, 23, 0.85), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  color: var(--ink);
  animation: floatCard 7s ease-in-out infinite;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.preview-dots {
  display: inline-flex;
  gap: 4px;
}

.preview-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dbe2ec;
}

.preview-dots i:first-child {
  background: #fca5a5;
}
.preview-dots i:nth-child(2) {
  background: #fcd34d;
}
.preview-dots i:nth-child(3) {
  background: #86efac;
}

.preview-title {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.preview-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #047857;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  background: #d1fae5;
}

.preview-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

.preview-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eef2f7;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.preview-file + .preview-file {
  margin-top: 7px;
}

.preview-file-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
}

.preview-file-icon .ico {
  width: 17px;
  height: 17px;
}

.preview-file-icon--red {
  color: #dc2626;
  background: #fee2e2;
}
.preview-file-icon--blue {
  color: #0284c7;
  background: #e0f2fe;
}
.preview-file-icon--violet {
  color: #7c3aed;
  background: #ede9fe;
}

.preview-file-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.preview-file-text strong {
  overflow: hidden;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-file-text small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 9.5px;
}

.preview-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #10b981;
  background: #ecfdf5;
}

.preview-check .ico {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.preview-file--muted {
  opacity: 0.72;
}

.preview-toast {
  position: absolute;
  right: -22px;
  bottom: -22px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: #fff;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 40px -16px rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(10px);
  font-size: 10.5px;
  animation: floatToast 6s ease-in-out infinite;
}

.preview-toast-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16);
}

.preview-toast-icon .ico {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.preview-toast span:last-child {
  display: flex;
  flex-direction: column;
}

.preview-toast strong {
  font-size: 10.5px;
  font-weight: 650;
}

.preview-toast small {
  margin-top: 1px;
  color: #94a3b8;
  font-size: 9px;
}

.visual-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
  color: #5f7391;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.visual-foot-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #40546f;
}

/* Auth panel */

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 44px clamp(28px, 4vw, 64px) 30px;
  background: #fff;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-bottom: 28px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  margin-block: auto;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-kicker {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-heading h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.8vw, 34px);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.auth-sub {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid #edf1f7;
  border-radius: 13px;
  background: #f4f6fa;
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.7);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tabs[data-active="register"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-tab {
  position: relative;
  z-index: 1;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: color 0.2s ease;
}

.auth-tab.is-active {
  color: var(--ink);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-wrap input::placeholder {
  color: #a9b6c8;
}

.input-wrap input:hover {
  border-color: #cbd5e1;
}

.input-wrap input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-wrap input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 40px #fbfcfe inset;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #9aa9bd;
  pointer-events: none;
}

.input-action {
  position: absolute;
  right: 7px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
}

.input-action:hover {
  color: var(--ink-soft);
  background: #f1f5f9;
}

.input-action .ico {
  width: 17px;
  height: 17px;
}

.input-action .eye-off {
  display: none;
}

.input-action.is-visible .eye-on {
  display: none;
}

.input-action.is-visible .eye-off {
  display: block;
}

.auth-submit {
  position: relative;
  height: 50px;
  margin-top: 3px;
  border-radius: 13px;
  font-size: 14.5px;
}

.auth-submit .btn-arrow {
  position: absolute;
  right: 18px;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.auth-submit:hover .btn-arrow {
  transform: translateX(2px);
}

.form-switch {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.5;
  animation: shake 0.35s ease;
}

.form-alert .ico {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 13px 14px;
  border: 1px dashed #d5deeb;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafcff, #f6f9fd);
}

.demo-card-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.demo-card-copy strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.demo-card-copy span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.demo-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e3eaf4;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 11.5px;
  font-weight: 650;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.demo-chip small {
  margin-left: auto;
  color: #9aa9bd;
  font-size: 10px;
  font-weight: 500;
}

.demo-chip:hover {
  border-color: #b9cdf1;
  box-shadow: 0 4px 12px -6px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.demo-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.demo-dot--blue {
  background: #3b82f6;
}
.demo-dot--violet {
  background: #8b5cf6;
}

.auth-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  color: #9aa9bd;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

.auth-note .ico {
  width: 13px;
  height: 13px;
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 430px;
  margin-top: 34px;
  color: #a8b4c6;
  font-size: 10px;
}

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

.app-page {
  min-height: 100vh;
  background: var(--bg);
}

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

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  overflow: hidden;
  color: #e5edf8;
  background: radial-gradient(120% 55% at 0% 0%, rgba(37, 99, 235, 0.2), transparent 60%),
    linear-gradient(180deg, #0b1426 0%, #0a111f 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 25%;
  left: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.14), transparent 68%);
  pointer-events: none;
}

.sidebar-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 0;
}

.sidebar-close {
  display: none;
  color: #9fb0c8;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace-chip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.workspace-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
}

.workspace-icon .ico {
  width: 17px;
  height: 17px;
}

.workspace-chip p {
  font-size: 12.5px;
  font-weight: 650;
  color: #e8f0fb;
}

.workspace-chip span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: #7f93ad;
  font-size: 10px;
}

.workspace-chip .live-dot {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.14);
}

.side-nav {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.nav-label {
  padding: 0 10px;
  margin-bottom: 8px;
  color: #5f7390;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 41px;
  padding: 0 11px;
  margin-top: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #96a8c1;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #dbe7f5;
}

.nav-item.is-active {
  border-color: rgba(96, 165, 250, 0.18);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.09));
  color: #fff;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  color: #7188a6;
}

.nav-item.is-active .nav-icon {
  color: #7dd3fc;
}

.nav-icon .ico {
  width: 17px;
  height: 17px;
}

.nav-text {
  flex: 1;
}

.nav-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #8ea3be;
  background: rgba(255, 255, 255, 0.065);
  font-size: 10.5px;
  font-weight: 650;
  text-align: center;
}

.nav-item.is-active .nav-count {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.25);
}

.online-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.online-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.online-head .nav-label {
  margin-bottom: 0;
}

.online-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  font-size: 10px;
  font-weight: 700;
}

.online-list {
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #2b3c56 transparent;
}

.online-list::-webkit-scrollbar {
  width: 5px;
}

.online-list::-webkit-scrollbar-thumb {
  background: #2b3c56;
  border-radius: 4px;
}

.online-empty {
  padding: 10px 9px;
  color: #647a96;
  font-size: 11px;
}

.online-person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  transition: background 0.18s ease;
}

.online-person:hover {
  background: rgba(255, 255, 255, 0.045);
}

.online-avatar {
  overflow: visible;
}

.status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border: 2px solid #0b1426;
  border-radius: 50%;
  background: #10b981;
}

.sidebar .avatar-text {
  font-size: 0.42em;
}

.online-person-text {
  min-width: 0;
  flex: 1;
}

.online-name {
  overflow: hidden;
  color: #d5e2f1;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.online-handle {
  overflow: hidden;
  margin-top: 1px;
  color: #667e9c;
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.online-self {
  color: #6ee7b7;
  font-size: 9px;
}

.sidebar-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 3px;
}

.user-card-text {
  min-width: 0;
  flex: 1;
}

.user-card-text p {
  overflow: hidden;
  color: #e8f0fb;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-card-text span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: #667e9c;
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Topbar ---------- */

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  height: 78px;
  padding: 0 clamp(20px, 2.8vw, 40px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(244, 246, 251, 0.82);
  backdrop-filter: blur(18px) saturate(1.2);
}

.mobile-menu-btn {
  display: none;
}

.topbar-title {
  min-width: 132px;
}

.topbar-title p {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.09em;
}

.topbar-title h2 {
  margin-top: 1px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(360px, 32vw);
  height: 42px;
  margin-left: auto;
}

.topbar-search > .ico {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #8ea0b8;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 100%;
  padding: 0 58px 0 40px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.topbar-search input::placeholder {
  color: #a6b4c7;
}

.topbar-search input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), var(--shadow-sm);
}

.topbar-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  position: absolute;
  right: 34px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--muted);
}

.search-clear:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.search-clear .ico {
  width: 13px;
  height: 13px;
}

.search-kbd {
  position: absolute;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  color: #94a3b8;
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #d1fae5;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.sync-pill[data-state="online"] .sync-dot {
  animation: pulseDot 2.2s ease-out infinite;
}

.sync-pill[data-state="connecting"] {
  border-color: #fde68a;
  color: #b45309;
  background: #fffbeb;
}

.sync-pill[data-state="offline"] {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.btn-upload-top {
  height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 13px;
}

/* ---------- Page ---------- */

.page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px clamp(20px, 2.8vw, 40px) 50px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-head h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.page-lead {
  max-width: 620px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.header-members {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 3px;
}

.avatar-stack {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.avatar-stack .avatar {
  width: 34px;
  height: 34px;
  margin-left: -9px;
  border: 2.5px solid var(--bg);
  font-size: 34px;
  box-shadow: none;
}

.avatar-stack .avatar-stack-more {
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: 2.5px solid var(--bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.header-members-text {
  display: flex;
  flex-direction: column;
}

.header-members-text strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.header-members-text span {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 10.5px;
}

/* ---------- Stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #d8e2ef;
  box-shadow: 0 14px 32px -22px rgba(15, 23, 42, 0.28);
}

.stat-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
}

.stat-icon .ico {
  width: 20px;
  height: 20px;
}

.stat-icon--blue {
  color: #2563eb;
  background: #eff6ff;
}
.stat-icon--violet {
  color: #7c3aed;
  background: #f5f3ff;
}
.stat-icon--green {
  color: #059669;
  background: #ecfdf5;
}
.stat-icon--amber {
  color: #d97706;
  background: #fffbeb;
}

.stat-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 5px;
  min-width: 0;
}

.stat-copy p {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

.stat-copy strong {
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.stat-copy span {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.stat-spark {
  position: absolute;
  top: -34px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.07), transparent 68%);
}

/* ---------- Content grid ---------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.content-main {
  min-width: 0;
}

.content-aside {
  min-width: 0;
}

/* ---------- Dropzone ---------- */

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1.5px dashed #c4d5ee;
  border-radius: 19px;
  background: linear-gradient(112deg, #eff6ff 0%, #f8faff 48%, #f6f3ff 100%);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dropzone:hover {
  border-color: #93b4e8;
  background: linear-gradient(112deg, #eaf3ff 0%, #f7faff 48%, #f3efff 100%);
  box-shadow: 0 16px 36px -28px rgba(37, 99, 235, 0.5);
}

.dropzone.is-dragging {
  border-color: var(--brand);
  background: linear-gradient(112deg, #dbeafe 0%, #eff6ff 48%, #ede9fe 100%);
  transform: scale(1.004);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 20px 46px -26px rgba(37, 99, 235, 0.55);
}

.drop-rings {
  position: absolute;
  right: -46px;
  top: 50%;
  width: 180px;
  height: 180px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.1);
  pointer-events: none;
}

.drop-rings i {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.drop-rings i:last-child {
  inset: 58px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06), transparent 70%);
}

.drop-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1 55%, #8b5cf6);
  box-shadow: 0 14px 26px -14px rgba(59, 130, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.drop-icon .ico {
  width: 23px;
  height: 23px;
  stroke-width: 2;
}

.drop-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.drop-copy p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.drop-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.drop-sep {
  color: var(--muted-2);
  font-size: 11.5px;
}

.drop-browse {
  font-size: 13.5px;
}

.drop-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.drop-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid rgba(16, 185, 129, 0.14);
  border-radius: 999px;
  color: #047857;
  background: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.drop-badge .live-dot {
  width: 5px;
  height: 5px;
}

/* ---------- Upload progress ---------- */

.upload-progress {
  margin-top: 12px;
  padding: 14px 16px 15px;
  border: 1px solid #dbeafe;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.3s ease both;
}

.upload-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-file-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #2563eb;
  background: #eff6ff;
}

.upload-file-icon .ico {
  width: 17px;
  height: 17px;
}

.upload-copy {
  min-width: 0;
  flex: 1;
}

.upload-copy p {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.upload-percent {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #7c3aed);
  transition: width 0.18s ease;
}

.queue-note {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10px;
}

/* ---------- Panels ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.files-panel {
  margin-top: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  transition: border-color 0.18s ease;
}

.select-wrap:hover {
  border-color: var(--line-strong);
}

.select-wrap > .ico:first-child {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.select-wrap select {
  height: 100%;
  padding: 0 28px 0 29px;
  border: 0;
  outline: none;
  appearance: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 8px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

/* ---------- File list ---------- */

.file-columns,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px 82px 72px 70px;
  gap: 10px;
  align-items: center;
}

.file-columns {
  padding: 9px 20px;
  border-top: 1px solid #f0f3f8;
  border-bottom: 1px solid #f0f3f8;
  background: #fafbfd;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.file-columns span:last-child {
  text-align: right;
}

.file-list {
  min-height: 120px;
}

.file-row {
  position: relative;
  padding: 12px 20px;
  border-bottom: 1px solid #f2f5f9;
  transition: background 0.16s ease;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: #fbfcfe;
}

.file-primary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.file-type-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #475569;
  background: #f1f5f9;
}

.file-type-icon .ico {
  width: 19px;
  height: 19px;
}

.file-type-icon--image {
  color: #0284c7;
  background: #e0f2fe;
}
.file-type-icon--doc {
  color: #dc2626;
  background: #fee2e2;
}
.file-type-icon--media {
  color: #7c3aed;
  background: #ede9fe;
}
.file-type-icon--archive {
  color: #b45309;
  background: #fef3c7;
}
.file-type-icon--other {
  color: #475569;
  background: #f1f5f9;
}

.file-text {
  min-width: 0;
}

.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-sub {
  overflow: hidden;
  margin-top: 2px;
  color: #96a5b8;
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.owner-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.self-tag {
  display: none;
  padding: 1px 5px;
  border-radius: 4px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 8.5px;
  font-weight: 700;
}

.file-row.is-mine .self-tag {
  display: inline-block;
}

.file-time {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.file-actions .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #8fa0b5;
}

.file-actions .icon-btn .ico {
  width: 15px;
  height: 15px;
}

.file-actions .download-btn:hover {
  color: var(--brand);
  background: #eff6ff;
}

.file-actions .delete-btn:hover {
  color: var(--red);
  background: #fef2f2;
}

.file-row.is-new {
  animation: rowIn 0.45s ease both;
  background: #f6faff;
}

/* skeletons */

.file-skeleton {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f2f5f9;
}

.file-skeleton span {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e8eef6 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.file-skeleton span:nth-child(1) {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.file-skeleton span:nth-child(2) {
  flex: 1;
  max-width: 220px;
}
.file-skeleton span:nth-child(3) {
  width: 88px;
}
.file-skeleton span:nth-child(4) {
  width: 52px;
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 24px 50px;
  text-align: center;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #e6edf7;
  border-radius: 16px;
  color: #94a3b8;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

.empty-icon .ico {
  width: 23px;
  height: 23px;
}

.empty-title {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.empty-copy {
  max-width: 330px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.65;
}

/* ---------- Chat ---------- */

.chat-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.chat-head {
  padding-bottom: 10px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 300px;
  overflow-y: auto;
  padding: 4px 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: #d7e0ec transparent;
}

.chat-list::-webkit-scrollbar {
  width: 5px;
}

.chat-list::-webkit-scrollbar-thumb {
  background: #d7e0ec;
  border-radius: 4px;
}

.chat-empty {
  margin: auto;
  padding: 30px 10px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-avatar {
  flex: none;
  margin-top: 1px;
}

.chat-body {
  min-width: 0;
  flex: 1;
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-time {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.chat-text {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 4px 12px 12px 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-item.is-self .chat-text {
  border-radius: 12px 4px 12px 12px;
  background: #e8f0ff;
  color: #1e3a8a;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}

.chat-input-wrap {
  display: block;
  flex: 1;
  min-width: 0;
}

.chat-input-wrap textarea {
  display: block;
  width: 100%;
  max-height: 96px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.chat-input-wrap textarea:focus {
  border-color: #93b4e8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input-wrap textarea::placeholder {
  color: var(--muted-2);
}

.chat-send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.chat-send .ico {
  width: 15px;
  height: 15px;
}

.chat-send:hover {
  transform: translateY(-1px);
}

.chat-send:active {
  transform: translateY(0);
}

.chat-send:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

/* ---------- Activity ---------- */

.activity-panel {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.live-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2.2s ease-out infinite;
}

.activity-list {
  max-height: 468px;
  overflow-y: auto;
  padding: 2px 18px 8px;
  scrollbar-width: thin;
  scrollbar-color: #d7e0ec transparent;
}

.activity-list::-webkit-scrollbar {
  width: 5px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: #d7e0ec;
  border-radius: 4px;
}

.activity-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px 0;
}

.activity-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -1px;
  width: 1px;
  background: #eef2f7;
}

.activity-item.is-new {
  animation: activityIn 0.4s ease both;
}

.activity-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #2563eb;
  background: #eff6ff;
}

.activity-icon .ico {
  width: 14px;
  height: 14px;
}

.activity-icon--created {
  color: #059669;
  background: #ecfdf5;
}
.activity-icon--downloaded {
  color: #2563eb;
  background: #eff6ff;
}
.activity-icon--deleted {
  color: #dc2626;
  background: #fef2f2;
}

.activity-body {
  min-width: 0;
  padding-top: 1px;
}

.activity-text {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
  word-break: break-word;
}

.activity-text strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.activity-file {
  color: #334155;
  font-weight: 600;
}

.activity-time {
  display: block;
  margin-top: 2px;
  color: #a6b4c7;
  font-size: 9px;
}

.activity-empty {
  padding: 30px 8px 34px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.activity-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px 12px;
  border-top: 1px solid #f1f4f9;
  color: #a0aec0;
  font-size: 9px;
}

.activity-foot .ico {
  width: 12px;
  height: 12px;
  color: #10b981;
}

.tip-card {
  display: flex;
  gap: 11px;
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid #e4e8f8;
  border-radius: 16px;
  background: linear-gradient(130deg, #f5f3ff, #f8faff 60%, #eff6ff);
}

.tip-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #7c3aed;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.tip-icon .ico {
  width: 16px;
  height: 16px;
}

.tip-card strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.tip-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.tip-card kbd {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid #d8dfe9;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-family: inherit;
  font-size: 8.5px;
  line-height: 1;
}

.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid #e9eef5;
  color: #9aa9bd;
  font-size: 9.5px;
}

.page-foot span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.page-foot .live-dot {
  width: 5px;
  height: 5px;
}

/* ---------- Dialog ---------- */

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.confirm-dialog[open] {
  animation: dialogIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.confirm-dialog::backdrop {
  background: rgba(8, 16, 32, 0.48);
  backdrop-filter: blur(4px);
}

.dialog-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: #dc2626;
  background: #fef2f2;
}

.dialog-icon .ico {
  width: 20px;
  height: 20px;
}

.confirm-dialog h3 {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.dialog-text {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}

.dialog-text strong {
  color: var(--ink-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.dialog-actions .btn {
  height: 40px;
  font-size: 12.5px;
}

/* ---------- Toasts ---------- */

.toast-host {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 12px 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: #eaf2fc;
  background: rgba(11, 20, 38, 0.96);
  box-shadow: 0 18px 46px -16px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: toastIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-leaving {
  animation: toastOut 0.25s ease both;
}

.toast-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

.toast-icon .ico {
  width: 15px;
  height: 15px;
}

.toast--success .toast-icon {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

.toast--error .toast-icon {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.toast--file .toast-icon {
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.17);
}

.toast-copy {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}

.toast-copy strong {
  display: block;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 650;
}

.toast-copy span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #a4b4ca;
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.toast-close {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7c8ea8;
}

.toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.toast-close .ico {
  width: 12px;
  height: 12px;
}

/* ---------- Sidebar scrim ---------- */

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 16, 32, 0.45);
  backdrop-filter: blur(2px);
}

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

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

  .stat-card {
    min-height: 82px;
  }
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .content-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .chat-panel {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .activity-panel {
    position: static;
  }

  .activity-list {
    max-height: 360px;
  }

  .tip-card {
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 34px 28px 26px;
  }

  .mobile-brand {
    display: flex;
  }

  .auth-card {
    margin-block: auto;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    width: 268px;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 24px 0 60px -30px rgba(2, 6, 23, 0.7);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid;
  }

  .mobile-menu-btn {
    display: inline-grid;
    flex: 0 0 auto;
    border-color: var(--line);
    background: #fff;
  }

  .topbar {
    height: 70px;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-search {
    width: min(360px, 36vw);
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .topbar-title {
    flex: 1;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .topbar-search {
    order: 5;
    width: 100%;
    height: 40px;
    margin-left: 0;
  }

  .search-kbd {
    display: none;
  }

  .search-clear {
    right: 10px;
  }

  .btn-upload-top {
    width: 40px;
    padding: 0;
  }

  .btn-upload-top span {
    display: none;
  }

  .page {
    padding: 22px 16px 36px;
  }

  .page-head {
    align-items: flex-start;
  }

  .header-members {
    display: none;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .page-lead {
    font-size: 12px;
  }

  .stats-grid {
    gap: 10px;
    margin-top: 18px;
  }

  .stat-card {
    min-height: 76px;
    padding: 12px 13px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .stat-icon .ico {
    width: 18px;
    height: 18px;
  }

  .stat-copy strong {
    font-size: 19px;
  }

  .content-aside {
    grid-template-columns: 1fr;
  }

  .dropzone {
    flex-wrap: wrap;
    padding: 18px;
    gap: 13px;
  }

  .drop-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .drop-badge {
    display: none;
  }

  .drop-copy {
    flex: 1;
    min-width: 180px;
  }

  .drop-copy p {
    font-size: 12.5px;
  }

  .drop-copy strong {
    font-size: 14px;
  }

  .drop-hint {
    font-size: 10px;
  }

  .file-columns {
    display: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 12px 14px;
  }

  .file-owner,
  .file-time {
    display: none;
  }

  .file-size {
    font-size: 10px;
  }

  .file-actions {
    gap: 0;
  }

  .files-panel {
    margin-top: 14px;
  }

  .panel-head {
    padding: 15px 15px 12px;
  }

  .panel-tools .select-wrap select {
    padding-right: 25px;
  }

  .activity-list {
    max-height: 310px;
  }

  .page-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .toast-host {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 560px) {
  .auth-panel {
    padding: 26px 18px 22px;
  }

  .auth-panel .mobile-brand {
    margin-bottom: 22px;
  }

  .auth-heading {
    margin-bottom: 20px;
  }

  .auth-heading h2 {
    font-size: 27px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .demo-chips {
    grid-template-columns: 1fr;
  }

  .demo-card-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .auth-foot {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    margin-top: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-copy span {
    display: none;
  }

  .file-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .file-name {
    font-size: 12px;
  }

  .file-size {
    display: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .upload-percent {
    display: none;
  }

  .page-head h1 {
    font-size: 27px;
  }

  .confirm-dialog {
    padding: 20px;
  }
}

/* =========================================================
   Motion
   ========================================================= */

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

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

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-7px) rotate(0.35deg);
  }
}

@keyframes floatToast {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
    background: #eff6ff;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    background: transparent;
  }
}

@keyframes activityIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

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