/* ============================================================
   GeeDrops — Global Design System
   Dark mode default. Light mode via [data-theme="light"]
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg: #0b0c0f;
  --bg-elevated: #131419;
  --bg-card: #1a1c22;
  --bg-hover: #232631;
  --bg-input: #1a1c22;
  --border: #2a2d38;
  --border-subtle: #20222c;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --max-w: 1080px;
  --side-w: 240px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Sora', 'Inter', sans-serif;
  --transition: 220ms cubic-bezier(.4,.0,.2,1);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f4f4f5;
  --bg-input: #ffffff;
  --border: #e4e4e7;
  --border-subtle: #f1f1f4;
  --text: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
::placeholder { color: var(--text-tertiary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-block { display: flex; width: 100%; }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: var(--radius); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--transition);
}
.btn-secondary:hover { background: var(--border); }

.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-weight: 500; padding: 0; text-decoration: underline; }

/* ============================================================
   Landing view
   ============================================================ */
.landing-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.landing-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: blob-float 18s ease-in-out infinite;
}
.blob-a { width: 480px; height: 480px; background: #6366f1; top: -120px; left: -80px; animation-delay: 0s; }
.blob-b { width: 380px; height: 380px; background: #ec4899; bottom: -100px; right: -50px; animation-delay: -6s; }
.blob-c { width: 320px; height: 320px; background: #14b8a6; top: 40%; right: 30%; animation-delay: -12s; }

@keyframes blob-float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 6vw;
  position: relative;
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; font-family: var(--font-head); }
.brand-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 6vw 80px;
  position: relative;
  z-index: 2;
}
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease-out;
}
.hero-title {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.7s ease-out 0.1s backwards;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
  animation: fadeUp 0.7s ease-out 0.2s backwards;
}
.hero-actions { margin-bottom: 18px; animation: fadeUp 0.7s ease-out 0.3s backwards; }
.hero-fineprint { color: var(--text-tertiary); font-size: 13px; animation: fadeUp 0.7s ease-out 0.4s backwards; }

.hero-preview {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.7s ease-out 0.5s backwards;
}
.preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: floatUp 4s ease-in-out infinite;
}
.preview-card:nth-child(2) { animation-delay: 0.5s; }
.preview-card:nth-child(3) { animation-delay: 1s; }
.preview-icon { font-size: 28px; }
.preview-text { display: flex; flex-direction: column; }
.preview-text strong { font-size: 14px; font-weight: 600; }
.preview-text span { font-size: 12px; color: var(--text-tertiary); }

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

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

.landing-footer {
  padding: 24px 6vw;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 13px;
  justify-content: center;
}
.dot-sep { opacity: 0.5; }

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.modal-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.3s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 720px; max-height: 88vh; overflow-y: auto; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 20px;
  display: grid; place-items: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-card h2 { font-size: 24px; margin-bottom: 6px; }
.modal-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.modal-switch { color: var(--text-secondary); font-size: 13px; margin-top: 18px; text-align: center; }

@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  transition: border var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; }

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.input-prefix { padding: 0 12px; color: var(--text-tertiary); font-weight: 500; }
.input-wrap input { border: none; background: transparent; box-shadow: none; padding: 12px 14px 12px 0; }
.input-wrap input:focus { box-shadow: none; }

/* ============================================================
   Onboarding
   ============================================================ */
.onboarding-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 6vw;
  position: relative;
}
.onb-progress {
  width: 100%; max-width: 320px;
  margin-bottom: 32px;
}
.onb-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.onb-progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 14%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.onb-stack {
  width: 100%;
  max-width: 420px;
  position: relative;
  min-height: 460px;
}
.onb-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: stepIn 0.4s cubic-bezier(.4,0,.2,1);
}
.onb-step[hidden] { display: none; }
.onb-step .btn-primary, .onb-step .btn-ghost { margin-top: 12px; }
.onb-emoji {
  font-size: 40px;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid; place-items: center;
  margin-bottom: 18px;
  font-family: var(--font-head);
}
.onb-step h2 { font-size: 22px; margin-bottom: 8px; }
.onb-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; max-width: 320px; }
.onb-step input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 16px;
  margin-bottom: 8px;
  text-align: center;
}
.onb-step input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.onb-status { font-size: 13px; height: 18px; margin-bottom: 6px; }
.onb-status.ok { color: var(--success); }
.onb-status.bad { color: var(--danger); }
.onb-status.checking { color: var(--text-tertiary); }

.avatar-drop {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.avatar-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px dashed var(--border);
  display: grid; place-items: center;
  overflow: hidden;
  transition: border var(--transition), background var(--transition);
}
.avatar-circle:hover { border-color: var(--accent); background: var(--accent-soft); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { font-size: 36px; color: var(--text-tertiary); }
.avatar-hint { font-size: 13px; color: var(--text-secondary); }

.pw-meter {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.pw-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--danger);
  transition: width 0.3s ease, background 0.3s ease;
}
.pw-feedback { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; min-height: 16px; }

.onb-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ============================================================
   App shell
   ============================================================ */
.app-view {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 24px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
}
.sidebar-brand .brand-mark { width: 32px; height: 32px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--transition), color var(--transition);
  position: relative;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  min-width: 18px;
  text-align: center;
}
.btn-share-sidebar {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  justify-content: center;
}
.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--border); }
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  cursor: pointer;
  transition: background var(--transition);
}
.theme-toggle:hover { background: var(--border); }

.main-area {
  padding: 28px 32px 100px;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
}

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head .subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* ============================================================
   Home page
   ============================================================ */
.greeting { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.greeting .name { color: var(--accent); }

.hero-share {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: transform var(--transition);
}
.hero-share:hover { transform: translateY(-2px); }
.hero-share-title { font-size: 26px; font-weight: 700; }
.hero-share-sub { font-size: 14px; opacity: 0.85; }
.hero-share-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  backdrop-filter: blur(8px);
  transition: background var(--transition);
}
.hero-share-btn:hover { background: rgba(255,255,255,0.3); }

.section { margin-bottom: 36px; }
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Card grids */
.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border var(--transition), transform var(--transition);
  cursor: pointer;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
}
.list-item:hover { background: var(--bg-hover); }
.list-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--text-secondary);
  overflow: hidden;
  flex-shrink: 0;
}
.list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.list-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-text strong { font-size: 14px; font-weight: 600; }
.list-text span { font-size: 12px; color: var(--text-tertiary); }

.list-stack { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================
   Share composer
   ============================================================ */
.composer {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: stretch; justify-content: flex-end;
}
.composer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.composer-panel {
  position: relative;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.composer-back, .composer-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: grid; place-items: center;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.composer-back:hover, .composer-close:hover { background: var(--border); color: var(--text); }
.composer-head h2 { font-size: 17px; font-weight: 600; }
.composer-body { flex: 1; overflow-y: auto; padding: 24px 20px; }
.composer-stage[hidden] { display: none; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.type-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.type-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.type-emoji { font-size: 30px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 18px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-emoji { font-size: 36px; margin-bottom: 8px; }
.drop-title { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.drop-sub { font-size: 12px; color: var(--text-tertiary); }

.file-previews { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.file-prev {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.file-prev-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 20px;
}
.file-prev-thumb img, .file-prev-thumb video { width: 100%; height: 100%; object-fit: cover; }
.file-prev-info { flex: 1; min-width: 0; }
.file-prev-info strong { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-prev-info span { font-size: 11px; color: var(--text-tertiary); }
.file-prev-progress { width: 100%; height: 3px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.file-prev-progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.3s ease; }
.file-prev-remove {
  background: transparent;
  color: var(--text-tertiary);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
}
.file-prev-remove:hover { background: var(--bg-hover); color: var(--danger); }

.dest-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dest-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
  position: relative;
}
.dest-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.dest-emoji { font-size: 28px; margin-bottom: 4px; }
.dest-card > span:nth-child(2) { font-weight: 600; font-size: 16px; }
.dest-card small { font-size: 12px; color: var(--text-tertiary); }
.composer-question { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

.search-bar {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.search-bar input { width: 100%; background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; }

.person-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.person-list .list-item.selected { background: var(--accent-soft); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip button {
  background: none; border: none; color: inherit;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 14px;
}
.chip button:hover { background: rgba(0,0,0,0.1); }

.btn-send { font-size: 16px; padding: 14px; }

/* ============================================================
   Shares page
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: color var(--transition), border var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.share-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.share-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.share-card-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.share-card-meta strong { font-size: 14px; font-weight: 600; }
.share-card-meta span { font-size: 12px; color: var(--text-tertiary); }

.status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-pill.accepted { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-pill.declined { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-pill.public { background: var(--accent-soft); color: var(--accent); }

.share-preview { margin: 12px 0; }
.share-text { padding: 12px; background: var(--bg-hover); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; }
.share-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.share-file {
  aspect-ratio: 1;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid; place-items: center;
  position: relative;
  font-size: 32px;
}
.share-file img, .share-file video { width: 100%; height: 100%; object-fit: cover; }

.share-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   Chat
   ============================================================ */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 100px);
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.conv-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.conv-search { padding: 12px; border-bottom: 1px solid var(--border); }
.conv-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
}
.conv-item {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.conv-item:hover, .conv-item.active { background: var(--bg-hover); }
.conv-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.conv-text strong { font-size: 13px; font-weight: 600; }
.conv-text span { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

.chat-panel { display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-head .list-text strong { font-size: 14px; }
.chat-head .presence { font-size: 12px; color: var(--text-tertiary); }
.chat-head .presence.online::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--bg-hover); }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 14px;
  word-wrap: break-word;
}
.msg-row.mine .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  border-bottom-right-radius: 4px;
}
.msg-row:not(.mine) .msg-bubble { border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; text-align: right; }
.msg-image { max-width: 240px; border-radius: 8px; display: block; }
.msg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.05);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.msg-row.mine .msg-file { background: rgba(255,255,255,0.2); color: #fff; }
.typing-indicator {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 12px;
}
.typing-indicator span { animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.chat-composer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-composer button.attach {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: grid; place-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.chat-composer input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
}
.chat-composer button.send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* ============================================================
   Bottom nav (mobile)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 8px 12px env(safe-area-inset-bottom, 12px);
  z-index: 50;
  justify-content: space-around;
  align-items: center;
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  color: var(--text-tertiary);
  position: relative;
}
.bn-item.active { color: var(--accent); }
.bn-item .badge {
  position: absolute;
  top: 2px; right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  border-radius: 999px;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
}
.bn-share-btn {
  width: 48px; height: 48px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   Empty states
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}
.empty-state h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* ============================================================
   Skeletons
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { height: 80px; margin-bottom: 12px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease-out;
  max-width: 90vw;
  pointer-events: auto;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Offline banner
   ============================================================ */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--warning);
  color: #1a1a1a;
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
}
.offline-banner .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #1a1a1a;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ============================================================
   App loader
   ============================================================ */
.app-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: grid; place-items: center;
  z-index: 500;
  transition: opacity 0.3s ease;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-icon {
  color: var(--accent);
  animation: floatUp 2s ease-in-out infinite;
}

/* ============================================================
   Profile
   ============================================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-hover);
  display: grid; place-items: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-secondary);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-info h2 { font-size: 22px; font-weight: 700; }
.profile-info .username { color: var(--text-secondary); font-size: 14px; }
.profile-info .bio { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Reaction
   ============================================================ */
.reactions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.reaction-chip:hover { background: var(--bg-input); }
.reaction-chip.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Comments
   ============================================================ */
.comments-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--bg-hover); flex-shrink: 0; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; }
.comment-meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-tertiary); }
.comment-meta strong { color: var(--text); font-size: 13px; }
.comment-text { font-size: 14px; margin-top: 2px; }
.comment-input { display: flex; gap: 8px; margin-top: 12px; }
.comment-input input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .app-view { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .main-area { padding: 16px 16px 100px; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .composer-panel { max-width: 100%; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 80px); }
  .conv-list { display: none; }
  .conv-list.mobile-open { display: block; position: absolute; inset: 0; z-index: 10; background: var(--bg-elevated); }
  .hero-title { font-size: 44px; }
  .preview-card { padding: 12px 14px; }
  .profile-header { flex-direction: column; text-align: center; }
  .tabs { padding-bottom: 4px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root { --side-w: 200px; }
  .main-area { padding: 24px; }
}

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

/* ============================================================
   Chat — replies, reactions, read receipts, action sheet
   ============================================================ */
.msg-reply {
  border-left: 2px solid var(--accent);
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
}
.msg-row.mine .msg-reply {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  border-left-color: rgba(255,255,255,0.6);
}
.msg-reactions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
  justify-content: flex-end;
}
.msg-reactions .reaction-chip {
  padding: 2px 6px;
  font-size: 11px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
}
.msg-row.mine .msg-reactions .reaction-chip { background: rgba(255,255,255,0.25); }
.msg-row:not(.mine) .msg-reactions .reaction-chip { background: var(--bg-hover); }
.msg-reactions .reaction-chip.mine { box-shadow: 0 0 0 2px var(--accent) inset; }
.msg-read {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-left: 4px;
}
.msg-row:not(.mine) .msg-read { color: var(--text-tertiary); }

.typing-indicator {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 12px;
  align-self: flex-start;
}
.typing-indicator span:nth-child(2) {
  display: inline-block;
  animation: typing 1.4s infinite;
}
@keyframes typing {
  0%, 20% { opacity: 0.3; }
  50% { opacity: 1; }
  80%, 100% { opacity: 0.3; }
}

.chat-reply-preview {
  padding: 8px 14px;
  background: var(--bg-hover);
  border-top: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: 0;
}

.reaction-pick {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 22px;
  transition: all var(--transition);
  cursor: pointer;
}
.reaction-pick:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--accent-soft);
}

/* Mobile: make chat composer safe-area aware */
.chat-composer {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Print */
@media print {
  .sidebar, .bottom-nav, .composer, .modal { display: none; }
}
