/* ============================================
   wAIno — Unified SPA Stylesheet
   Dark wine-nerd aesthetic. High contrast.
   Minimalist. No fluff.
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  /* Core palette */
  --bg:          #0a090c;
  --bg-elevated: #141216;
  --bg-hover:    #1c191f;
  --border:      #2a252e;
  --border-light:#3a3540;

  /* Text */
  --text:        #f0ece6;
  --text-muted:  #9e98a3;
  --text-dim:    #6a6470;

  /* Accent — warm coral/wine */
  --accent:      #d4634d;
  --accent-light:#e87e68;
  --accent-dark: #a84a38;

  /* Gold for ratings, upvotes */
  --gold:        #d4a843;
  --gold-light:  #e8c060;

  /* Functional */
  --success:     #5cb85c;
  --warning:     #d4a843;
  --error:       #c45a5a;

  /* Spacing scale */
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    16px;
  --space-lg:    24px;
  --space-xl:    40px;
  --space-2xl:   64px;

  /* Typography */
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-mono:   'SF Mono', Menlo, Monaco, 'Courier New', monospace;
  --radius:      12px;
  --radius-sm:   8px;

  /* Transitions */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast:   150ms;
  --duration-normal: 280ms;
  --duration-slow:   450ms;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* Selection */
::selection {
  background: rgba(212,99,77,0.35);
  color: var(--text);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
  background: transparent;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,99,77,0.25);
}

.btn-ghost {
  border-color: var(--border-light);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212,99,77,0.08);
}

.btn-follow {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn-follow:hover {
  background: rgba(212,99,77,0.12);
}
.btn-follow-active {
  border-color: var(--border-light);
  color: var(--text-muted);
  background: var(--bg-hover);
}
.btn-follow-active:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(196,90,90,0.1);
}

.btn-text {
  padding: 6px 8px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text:hover { color: var(--accent); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ---- Navigation ---- */
.main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: 56px;
  background: rgba(10,9,12,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: transform var(--duration-normal) var(--ease);
}

.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-logo {
  background: none;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: -0.5px;
  padding: 0;
  transition: opacity var(--duration-fast);
}
.nav-logo:hover { opacity: 0.75; }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-username {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  margin-right: 4px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all var(--duration-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- View System ---- */
.view {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease);
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.view > div:first-child { padding-top: 56px; } /* nav offset */

/* ---- Dashboard ---- */
.dashboard-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  background: radial-gradient(ellipse at 50% 10%, rgba(212,99,77,0.06) 0%, transparent 55%);
}

.dashboard-inner {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.dashboard-hero { margin-bottom: var(--space-2xl); }

.hero-logo {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 60px rgba(212,99,77,0.2);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  letter-spacing: 1px;
}

.hero-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: var(--space-lg);
  line-height: 1.7;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: var(--space-xl);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dash-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
  display: block; /* button reset */
  width: 100%;
  text-align: left;
  color: inherit;
}

.dash-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(212,99,77,0.15);
}

.dash-card:active {
  transform: translateY(-2px) scale(0.99);
  transition-duration: var(--duration-fast);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.85;
}

.dash-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.dash-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-md);
}

.card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}

/* Dashboard Footer */
.dashboard-footer {
  padding: var(--space-lg) 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.dashboard-footer a:hover { color: var(--accent); }

/* ---- Page Header (shared across views) ---- */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,9,12,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.page-header .back-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}
.page-header .back-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.page-header h2 {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-header-actions { display: flex; gap: var(--space-sm); }

/* ---- Page Body ---- */
.page-body {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

/* ---- Search ---- */
.search-bar-wrap {
  margin-bottom: var(--space-xl);
}

.search-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color var(--duration-fast);
}
.search-bar input:focus { outline: none; border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-dim); }

.search-filters {
  display: flex;
  gap: var(--space-sm);
}

.search-filters select,
.search-filters input {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.8rem;
}
.search-filters select:focus, .search-filters input:focus {
  outline: none; border-color: var(--accent);
}

.results-welcome {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}
.results-welcome h3 { color: var(--accent); margin-bottom: var(--space-sm); }
.results-welcome p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: var(--space-md); }

.results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Result Items */
.result-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: all var(--duration-fast) var(--ease);
  text-align: left;
}
.result-item:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.result-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.result-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}
.result-badge.knowledge { background: rgba(212,99,77,0.15); color: var(--accent); }
.result-badge.tasting { background: rgba(212,175,67,0.15); color: var(--gold); }

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.result-content {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.result-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.result-actions-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.upvote-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--duration-fast);
}
.upvote-btn:hover { border-color: var(--accent); color: var(--accent); }
.upvote-btn.upvoted {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,168,67,0.08);
}

/* Expandable text */
.result-content.expandable {
  cursor: pointer;
  position: relative;
}
.result-content.collapsed::after {
  content: '… Show more';
  color: var(--accent);
  margin-left: 4px;
  cursor: pointer;
  font-weight: 500;
}
.result-content.expanded::after { content: none; }

/* ---- Tasting Form ---- */
.tasting-form-wrap { margin-bottom: var(--space-xl); }

.form-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.form-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.form-group { margin-bottom: var(--space-md); }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group .req { color: var(--accent); }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--duration-fast);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

.form-group textarea { resize: vertical; min-height: 90px; }

/* Star Rating */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0;
}
.star-rating input { display: none; }
.star-rating label {
  font-size: 1.6rem;
  color: var(--border);
  cursor: pointer;
  transition: color var(--duration-fast);
  padding: 0 1px;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--gold); }

/* Toggle switch */
.check-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
}
.check-toggle input { display: none; }
.check-slider {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background var(--duration-fast);
  flex-shrink: 0;
}
.check-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease);
}
.check-toggle input:checked ~ .check-slider {
  background: rgba(212,99,77,0.5);
}
.check-toggle input:checked ~ .check-slider::before {
  transform: translateX(18px);
  background: var(--accent);
}

/* ---- Social ---- */
.social-body { max-width: 640px; }

.feed-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Composer */
.composer-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.composer-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.composer-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.composer-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.composer-card textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--duration-fast);
}
.composer-card textarea:focus { outline: none; border-color: var(--accent); }
.composer-card textarea::placeholder { color: var(--text-dim); }

.composer-tools {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.file-label:hover { border-color: var(--accent); color: var(--accent); }

.composer-tools select,
.composer-tools input[type="text"] {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  min-width: 100px;
}

.image-preview {
  margin-top: var(--space-sm);
}
.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Feed Posts */
.feed { display: flex; flex-direction: column; gap: var(--space-md); }

.post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: border-color var(--duration-fast);
  text-align: left;
}
.post-card:hover { border-color: var(--border-light); }

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.post-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-author-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.post-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.post-content {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-image {
  margin-bottom: var(--space-sm);
}
.post-image img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.post-tasting-link {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.post-tasting-link:hover { border-color: var(--accent); }
.post-tasting-link strong { color: var(--text); }

.post-hashtags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}
.post-hashtag {
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
}
.post-hashtag::before { content: '#'; }
.post-hashtag:hover { text-decoration: underline; }

.post-actions {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.post-action-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  transition: color var(--duration-fast);
}
.post-action-btn:hover { color: var(--text); }
.post-action-btn.liked { color: #e06c75; }

/* ---- Profile ---- */
.profile-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--border);
  margin: 0 auto var(--space-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-card .bio {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.profile-meta {
  margin-top: var(--space-md);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.profile-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.profile-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(212,99,77,0.05);
}

/* Archive */
.archive-search-wrap { margin-bottom: var(--space-lg); }
.archive-search-wrap input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
}
.archive-search-wrap input:focus { outline: none; border-color: var(--accent); }

/* ---- Modals ---- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease);
}
.modal.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
  transform: scale(0.96);
  transition: transform var(--duration-normal) var(--ease);
}
.modal.active .modal-box { transform: scale(1); }

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}
.modal-close:hover {
  background: var(--accent);
  color: var(--bg);
}

.modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

.auth-form .form-group { margin-bottom: var(--space-md); }
.form-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-lg);
}

.form-error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 0;
}

.info-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.info-body strong { color: var(--text); }

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn var(--duration-normal) var(--ease) forwards;
  pointer-events: auto;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.toast.success { border-color: rgba(92,184,92,0.3); }
.toast.error   { border-color: rgba(196,90,90,0.3); }
.toast.warning { border-color: rgba(212,168,67,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast.out {
  animation: toastOut var(--duration-fast) var(--ease) forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---- Empty / Loading States ---- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}
.loading-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .page-header { height: 52px; }
  .view > div:first-child { padding-top: 52px; }

  .nav-links { display: none; }
  .nav-logo { font-size: 1rem; }

  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: rgba(10,9,12,0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 4px 0 12px;
    z-index: 499;
  }
  .nav-links.open .nav-link {
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    border-radius: 0;
  }

  .hero-logo { font-size: 3.5rem; }
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; max-width: 280px; margin: 0 auto; }

  .card-grid { grid-template-columns: 1fr; }
  .dash-card { text-align: center; }
  .dash-card p { max-width: 260px; margin-left: auto; margin-right: auto; }

  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  .composer-tools { flex-wrap: wrap; }
  .composer-tools select { flex: 1; min-width: 120px; }

  #toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: 16px;
  }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .page-body { padding: var(--space-md) var(--space-sm) var(--space-xl); }
  .result-item { padding: var(--space-md); }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Focus ring for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Skeleton Loading States ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 70%; margin-bottom: 12px; }
.skeleton-badge { height: 18px; width: 80px; }
.skeleton-meta { height: 12px; width: 50%; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Staggered Entrance ---- */
.stagger-in > * {
  opacity: 0;
  transform: translateY(12px);
  animation: staggerIn var(--duration-normal) var(--ease) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 60ms; }
.stagger-in > *:nth-child(3) { animation-delay: 120ms; }
.stagger-in > *:nth-child(4) { animation-delay: 180ms; }
.stagger-in > *:nth-child(5) { animation-delay: 240ms; }
.stagger-in > *:nth-child(6) { animation-delay: 300ms; }
.stagger-in > *:nth-child(7) { animation-delay: 360ms; }
.stagger-in > *:nth-child(8) { animation-delay: 420ms; }
.stagger-in > *:nth-child(9) { animation-delay: 480ms; }
.stagger-in > *:nth-child(10) { animation-delay: 540ms; }

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

/* ---- Notification Bell ---- */
.nav-notify {
  position: relative;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.notify-badge {
  position: absolute;
  top: -2px; right: -4px;
  background: var(--error);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
  animation: badgePop var(--duration-fast) var(--ease);
}
@keyframes badgePop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---- Notification Panel ---- */
.notification-panel {
  position: fixed;
  top: 56px; right: 16px;
  width: 320px;
  max-height: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 600;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: panelIn var(--duration-normal) var(--ease);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.notification-header h4 { font-size: 0.9rem; font-weight: 600; }
.notification-list {
  overflow-y: auto;
  padding: var(--space-sm) 0;
}
.notification-item {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { border-left: 3px solid var(--accent); }
.notification-item .notify-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
