@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

:root {
  --bg-0: #07070f;
  --bg-1: #0d0d1c;
  --bg-2: #13132a;
  --bg-3: #1b1b36;
  --bg-hover: #22223f;
  --bg-active: #282845;
  --accent: #7c5cfc;
  --accent-hover: #9478ff;
  --accent-dim: rgba(124, 92, 252, 0.12);
  --accent-dim2: rgba(124, 92, 252, 0.22);
  --accent-glow: rgba(124, 92, 252, 0.35);
  --text-1: #f0f0fd;
  --text-2: #9090bb;
  --text-3: #55556e;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(124, 92, 252, 0.3);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --yellow: #fbbf24;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Poppins', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, textarea { font-family: var(--font); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

::selection { background: var(--accent-dim2); }

/* ── Utilities ────────────────────────────────────────────────────────────── */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); border-color: var(--border-accent); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-1); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Inputs ───────────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: var(--text-3); }

/* ── Modal ────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  transform: scale(0.96) translateY(8px);
  transition: var(--transition);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-desc {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: toastIn 0.2s ease forwards;
  max-width: 300px;
}
.toast.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.25); }
.toast.error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
.toast.info { background: var(--accent-dim); color: var(--accent-hover); border: 1px solid var(--border-accent); }

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

/* ══════════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  overflow: hidden;
  position: relative;
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -100px; left: -100px;
  animation: blobFloat 12s ease-in-out infinite alternate;
}
.blob-2 {
  width: 400px; height: 400px;
  background: #4ecdc4;
  bottom: -50px; right: -80px;
  animation: blobFloat 15s ease-in-out infinite alternate-reverse;
}
.blob-3 {
  width: 300px; height: 300px;
  background: #ff6b6b;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: blobFloat 18s ease-in-out infinite alternate;
}

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 20px) scale(1.05); }
}

.login-card {
  position: relative;
  background: rgba(13, 13, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

.login-logo {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  position: relative;
}

.input-group .input {
  padding-right: 44px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  font-size: 16px;
}
.input-toggle:hover { color: var(--text-2); }

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}
.btn-login:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

.login-error {
  color: var(--red);
  font-size: 12px;
  text-align: center;
  padding: 8px 12px;
  background: var(--red-dim);
  border-radius: var(--radius-sm);
  display: none;
}
.login-error.show { display: block; }

/* ══════════════════════════════════════════════════════════════════════════════
   APPS PAGE
   ══════════════════════════════════════════════════════════════════════════════ */

.apps-page {
  min-height: 100vh;
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.topbar-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

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

.apps-main {
  flex: 1;
  padding: 48px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.apps-header {
  margin-bottom: 40px;
}
.apps-header h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-1) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.apps-header p { color: var(--text-2); font-size: 15px; }

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

.app-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-dim);
  opacity: 0;
  transition: var(--transition);
}
.app-card:hover::before { opacity: 1; }
.app-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.app-card:active { transform: translateY(0); }

.app-card-coming {
  opacity: 0.45;
  cursor: not-allowed;
}
.app-card-coming:hover { transform: none; }
.app-card-coming::before { display: none; }

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
}

.app-card-name {
  font-weight: 600;
  font-size: 15px;
}
.app-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.badge-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════════════════════
   NOTES APP
   ══════════════════════════════════════════════════════════════════════════════ */

.notes-layout {
  display: grid;
  grid-template-columns: 220px 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Projects Sidebar */

.sidebar-projects {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}

.back-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 18px;
  flex-shrink: 0;
}
.back-btn:hover { background: var(--bg-hover); color: var(--text-1); }

.sidebar-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-dim);
  border: none;
  color: var(--accent-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  flex-shrink: 0;
  font-weight: 600;
}
.sidebar-add-btn:hover { background: var(--accent-dim2); }

.projects-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  group: true;
}
.project-item:hover { background: var(--bg-hover); }
.project-item.active { background: var(--bg-active); }

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}

.project-delete-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: var(--transition);
  flex-shrink: 0;
}
.project-item:hover .project-delete-btn { opacity: 1; }
.project-delete-btn:hover { background: var(--red-dim); color: var(--red); }

.projects-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
  font-size: 12px;
}

/* Notes Sidebar */

.sidebar-notes {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-search .input {
  padding: 7px 10px;
  font-size: 12px;
  background: var(--bg-2);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.note-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.note-item:hover { background: var(--bg-hover); }
.note-item.active { background: var(--bg-active); border-color: var(--border-accent); }

.note-item-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.note-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.note-item-date {
  font-size: 11px;
  color: var(--text-3);
}

.note-shared-badge {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  font-size: 11px;
}

.notes-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}
.notes-placeholder-icon { font-size: 32px; opacity: 0.4; }

/* Editor Panel */

.editor-panel {
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
}
.editor-empty-icon { font-size: 48px; opacity: 0.3; }
.editor-empty-text { font-size: 15px; font-weight: 500; }
.editor-empty-sub { font-size: 12px; color: var(--text-3); }

.editor-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.save-status {
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.save-status.saved { color: var(--text-3); }
.save-status.saving { color: var(--yellow); }
.save-status.error { color: var(--red); }

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.save-status.saving .save-dot { animation: pulse 1s infinite; }

.editor-actions { display: flex; align-items: center; gap: 6px; }

.editor-title-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-1);
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font);
  padding: 20px 24px 12px;
  outline: none;
  flex-shrink: 0;
}
.editor-title-input::placeholder { color: var(--text-3); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  width: 30px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: var(--transition);
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.toolbar-btn.active { background: var(--accent-dim); color: var(--accent-hover); }

.toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.note-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 40px;
  outline: none;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-1);
  caret-color: var(--accent-hover);
}
.note-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  pointer-events: none;
}
.note-content h1 { font-size: 22px; font-weight: 700; margin: 20px 0 8px; }
.note-content h2 { font-size: 18px; font-weight: 600; margin: 16px 0 6px; }
.note-content h3 { font-size: 15px; font-weight: 600; margin: 14px 0 4px; }
.note-content p { margin-bottom: 4px; }
.note-content ul, .note-content ol { padding-left: 24px; margin: 6px 0; }
.note-content li { margin-bottom: 2px; }
.note-content strong { font-weight: 600; color: var(--text-1); }
.note-content em { color: var(--text-2); }
.note-content code {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent-hover);
}
.note-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 10px 0;
  overflow-x: auto;
}
.note-content pre code { background: none; border: none; padding: 0; font-size: 13px; color: var(--text-1); }
.note-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 8px 0;
  color: var(--text-2);
}
.note-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.note-content a { color: var(--accent-hover); text-decoration: underline; }

/* Share modal specifics */

.share-link-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.share-link-row .input { font-size: 12px; font-family: monospace; }

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* Context menu */

.ctx-menu {
  position: fixed;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  z-index: 500;
  min-width: 160px;
  box-shadow: var(--shadow);
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-1);
}
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: var(--red-dim); }

/* ══════════════════════════════════════════════════════════════════════════════
   SHARE PAGE
   ══════════════════════════════════════════════════════════════════════════════ */

.share-page {
  min-height: 100vh;
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
}

.share-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
}

.share-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.share-brand-logo {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.share-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.share-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.share-content {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  width: 100%;
}

.share-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.share-project-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  border: 1px solid var(--border-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.share-date {
  font-size: 12px;
  color: var(--text-3);
}

.share-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--text-1) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.share-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-2);
}
.share-body h1 { font-size: 24px; font-weight: 700; color: var(--text-1); margin: 24px 0 10px; }
.share-body h2 { font-size: 20px; font-weight: 600; color: var(--text-1); margin: 20px 0 8px; }
.share-body h3 { font-size: 16px; font-weight: 600; color: var(--text-1); margin: 16px 0 6px; }
.share-body p { margin-bottom: 12px; }
.share-body ul, .share-body ol { padding-left: 24px; margin: 10px 0; }
.share-body li { margin-bottom: 4px; }
.share-body strong { color: var(--text-1); font-weight: 600; }
.share-body code {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent-hover);
}
.share-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 14px 0;
  overflow-x: auto;
}
.share-body pre code { background: none; border: none; padding: 0; color: var(--text-1); }
.share-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--text-3);
}
.share-body hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.share-body a { color: var(--accent-hover); }

.share-error {
  text-align: center;
  padding: 80px 32px;
}
.share-error-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.share-error h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.share-error p { color: var(--text-2); font-size: 14px; }

.share-loading {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-3);
}

/* ── Color picker ──────────────────────────────────────────────────────────── */

.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.color-swatch:hover, .color-swatch.selected { border-color: var(--text-1); transform: scale(1.15); }

/* ── Attachments ──────────────────────────────────────────────────────────── */

.attachments-section {
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
  flex-shrink: 0;
}

.attachments-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.attachments-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex: 1;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 12px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-hover);
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.attachment-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-2);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.attachment-item:hover { border-color: var(--border-accent); transform: scale(1.02); }

.attachment-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--bg-3);
}

.play-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.video-name {
  font-size: 10px;
  color: var(--text-2);
  text-align: center;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.attachment-delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  line-height: 1;
}
.attachment-item:hover .attachment-delete-btn { opacity: 1; }
.attachment-delete-btn:hover { background: var(--red); }

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-filename {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: transform 0.3s ease;
  user-select: none;
}
.lightbox-img.zoomed {
  cursor: zoom-out;
  transform: scale(2);
}

.lightbox-video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  outline: none;
}

/* Share page attachments */

.share-attachments {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.share-attachments-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

.share-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.share-attachment-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-2);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.share-attachment-item:hover { border-color: var(--border-accent); transform: scale(1.02); }

/* ── Animations ───────────────────────────────────────────────────────────── */

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

.fade-in { animation: fadeIn 0.25s ease forwards; }
