/* ============================================
   SparK — Design System v6
   Dark + Light Theme
   ============================================ */

/* --- DARK THEME (default) --- */

:root,
[data-theme="dark"] {
  --sky: #1e2a3a;
  --navy: #e2eaf4;
  --blue: #5ba3d9;
  --teal: #3ABCB1;
  --amber: #F5A623;
  --rose: #F26B6B;
  --green: #4CAF82;
  --soft: #1a1f26;
  --card: #222831;
  --border: #2e3744;
  --text: #dce6f0;
  --muted: #7a92aa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --font: 'Nunito', sans-serif;
  --font-serif: 'Lora', serif;
}

/* --- LIGHT THEME --- */
[data-theme="light"] {
  --sky: #e8f0f9;
  --navy: #1a2a3a;
  --blue: #2d7fc1;
  --teal: #1fa89e;
  --amber: #d4880d;
  --rose: #d94f4f;
  --green: #2e8a5e;
  --soft: #f0f4f8;
  --card: #ffffff;
  --border: #d0dce8;
  --text: #1a2535;
  --muted: #5a7590;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
}

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

body {
  background: var(--soft);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   NAV
   ============================================ */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-logo:hover { text-decoration: none; }

.nav-hex {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.nav-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.nav-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.nav-search-input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--soft);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.nav-search-input:focus {
  border-color: var(--blue);
  background: var(--card);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s;
  text-decoration: none;
}

.nav-link:hover { background: var(--sky); color: var(--blue); text-decoration: none; }
.nav-link.active { color: var(--blue); background: var(--sky); }

.nav-bell {
  position: relative;
  font-size: 1.1rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-bell:hover { background: var(--sky); text-decoration: none; }

.nav-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--rose);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 50px;
  min-width: 17px;
  text-align: center;
  line-height: 1.3;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.nav-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(91,163,217,0.4);
  text-decoration: none;
}

/* --- Theme toggle button --- */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
}

.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--sky);
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--sky); color: var(--text); }

/* --- Drawer overlay --- */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
}

.drawer-overlay.open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.drawer-close:hover { background: var(--sky); color: var(--text); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  padding: 9px 20px;
  border-radius: 50px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  box-shadow: 0 3px 12px rgba(91,163,217,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(91,163,217,0.35);
  color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 2px solid var(--border);
    padding: 7px 16px;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
}

.btn-ghost:hover {
    border-color: var(--rose);
    color: var(--rose);
    background: rgba(242, 107, 107, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(242, 107, 107, 0.12);
}

.btn-danger {
  background: transparent;
  color: var(--rose);
  border: 2px solid var(--border);
}

.btn-danger:hover {
  border-color: var(--rose);
  background: rgba(242,107,107,0.1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

/* ============================================
   3-COLUMN APP LAYOUT
   ============================================ */

.app-layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 24px;
  align-items: start;
}

.layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
}

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

/* ============================================
   LEFT SIDEBAR
   ============================================ */

.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 88px;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 0 4px;
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 4px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: var(--sky);
  color: var(--blue);
  text-decoration: none;
}

.sidebar-nav li a .icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.sidebar-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--sky);
  color: var(--blue);
  text-decoration: none;
  transition: all 0.15s;
}

.topic-pill:hover,
.topic-pill.active {
  background: var(--blue);
  color: white;
  text-decoration: none;
}

/* ============================================
   RIGHT SIDEBAR / WIDGETS
   ============================================ */

.right-sidebar {
  position: sticky;
  top: 88px;
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.widget-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.trending-item:last-child { border-bottom: none; }

.trending-num {
  font-size: 1rem;
  font-weight: 900;
  color: var(--border);
  min-width: 18px;
  padding-top: 2px;
}

.trending-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
  display: block;
}

.trending-title:hover { color: var(--blue); text-decoration: none; }

.trending-meta {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash {
  position: fixed;
  top: 5.0rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: v260px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.flash-error {
  background: rgba(242,107,107,0.12);
  border-color: var(--rose);
  color: var(--rose);
}

.flash-success {
  background: rgba(76,175,130,0.12);
  border-color: var(--green);
  color: var(--green);
}

/* ============================================
   FEED
   ============================================ */

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.feed-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
}

.feed-desc {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

.feed-tabs {
  display: flex;
  gap: 4px;
  background: var(--border);
  padding: 4px;
  border-radius: 50px;
  margin-bottom: 20px;
  width: fit-content;
}

.feed-tab {
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font);
}

.feed-tab:hover { color: var(--text); text-decoration: none; }

.feed-tab.active {
  background: var(--card);
  color: var(--blue);
  box-shadow: var(--shadow);
}

/* ============================================
   POST CARDS
   ============================================ */

.post-list { display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all 0.18s;
  display: flex;
  gap: 16px;
}

.post-card:hover {
  border-color: rgba(91,163,217,0.3);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
  padding-top: 2px;
}

.vote-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.1s;
  font-family: var(--font);
  font-weight: 700;
}

.vote-btn.up:hover { color: var(--blue); background: var(--sky); }
.vote-btn.down:hover { color: var(--rose); background: rgba(242,107,107,0.1); }
.vote-btn.voted-up { color: var(--blue); }
.vote-btn.voted-down { color: var(--rose); }

.vote-count {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

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

.post-meta {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.post-topic {
  background: var(--sky);
  color: var(--blue);
  padding: 2px 10px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.72rem;
}

.post-author { color: var(--text); font-weight: 700; }
.post-time { color: var(--muted); font-weight: 500; }

.post-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.post-title:hover { color: var(--blue); text-decoration: none; }

.post-preview {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.55;
  font-weight: 500;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}

.reply-count {
  color: var(--muted);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.reply-count:hover {
  background: var(--sky);
  color: var(--blue);
  text-decoration: none;
}

/* ============================================
   FULL POST VIEW
   ============================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.post-full {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
}

.post-title-full {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.post-body-full {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
  margin-bottom: 20px;
}

[data-theme="light"] .post-body-full { color: #3a5068; }

.post-content { flex: 1; min-width: 0; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ============================================
   REPLIES
   ============================================ */

.replies-section { margin-top: 8px; }

.replies-heading {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compose-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.reply-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reply-form textarea,
.post-form textarea,
.post-form input,
.post-form select {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 16px;
  width: 100%;
  resize: vertical;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.reply-form textarea:focus,
.post-form textarea:focus,
.post-form input:focus,
.post-form select:focus {
  border-color: var(--blue);
  background: var(--card);
}

.reply-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
  display: flex;
  gap: 16px;
}

.reply-card:hover { border-color: rgba(91,163,217,0.25); }

.reply-body {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  flex: 1;
  min-width: 0;
}

[data-theme="light"] .reply-body { color: #3a5068; }

/* ============================================
   BBCODE PREVIEW TABS
   ============================================ */

.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}

.editor-tab {
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font);
  transition: color 0.15s;
}

.editor-tab:hover { color: var(--text); }
.editor-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.editor-pane { display: none; }
.editor-pane.active { display: block; }

.preview-pane {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-height: 120px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

[data-theme="light"] .preview-pane { color: #3a5068; }

.preview-pane:empty::before {
  content: 'Preview will appear here...';
  color: var(--border);
  font-style: italic;
}

/* ============================================
   CHARACTER COUNTER
   ============================================ */

.field-wrap { position: relative; }

.char-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  transition: color 0.15s;
}

.char-counter.warn { color: var(--amber); }
.char-counter.danger { color: var(--rose); }

/* ============================================
   FORMS
   ============================================ */

.form-page { max-width: 640px; }

.form-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.form-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.post-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-form label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 6px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: -6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.btn-submit {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 12px rgba(91,163,217,0.25);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(91,163,217,0.35);
}

.btn-cancel {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font);
}

.btn-cancel:hover {
  color: var(--text);
  border-color: var(--muted);
  text-decoration: none;
}

/* ============================================
   AUTH
   ============================================ */

.auth-form {
  max-width: 400px;
  margin: 60px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-form h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.auth-form .form-subtitle { margin-bottom: 28px; }

.auth-form input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.auth-form input:focus {
  border-color: var(--blue);
  background: var(--soft);
}

.auth-form .btn-submit {
  width: 100%;
  text-align: center;
  margin-top: 4px;
  justify-content: center;
}

.auth-form a {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form a:hover { color: var(--blue); }

/* ============================================
   PROFILE
   ============================================ */

.profile-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.profile-banner {
  height: 120px;
  background: linear-gradient(135deg, #1e3a52, #1a3d3b);
}

.profile-info {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  padding: 0 28px 24px;
  margin-top: -36px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border: 4px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.profile-details { flex: 1; padding-top: 40px; }

.profile-username {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.profile-bio {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.profile-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.profile-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-stat { text-align: center; }

.profile-stat-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.profile-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 40px;
}

.profile-sections { display: flex; flex-direction: column; gap: 24px; }

.section-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   FOLLOW BUTTONS
   ============================================ */

.btn-follow {
  padding: 8px 20px;
  border: 2px solid var(--blue);
  border-radius: 50px;
  color: var(--blue);
  background: transparent;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-follow:hover { background: var(--blue); color: white; }

.btn-unfollow {
  border-color: var(--border);
  color: var(--muted);
}

.btn-unfollow:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: transparent;
}

.btn-bookmark {
    background: none;
    border: 2px solid var(--border);
    color: var(--muted);
    padding: 7px 16px;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
}

.btn-bookmark:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--sky);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(91, 163, 217, 0.15);
}

.btn-bookmark.bookmarked {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--sky);
}

.btn-edit {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 50px;
  transition: all 0.15s;
  font-family: var(--font);
  text-decoration: none;
}

.btn-edit:hover {
  color: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
}

.btn-delete {
  background: none;
  border: 2px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete:hover { border-color: var(--rose); color: var(--rose); }

.btn-profile {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 50px;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font);
}

.btn-profile:hover {
  color: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
}

/* ============================================
   TOPICS
   ============================================ */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.topic-card {
  display: block;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.18s;
  text-decoration: none;
}

.topic-card:hover {
  border-color: rgba(91,163,217,0.3);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.topic-card-name {
  color: var(--text);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.topic-card-desc {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.45;
}

.topic-card-count {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 0;
}

.page-btn {
  color: var(--blue);
  border: 2px solid var(--blue);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s;
  font-family: var(--font);
}

.page-btn:hover {
  background: var(--blue);
  color: white;
  text-decoration: none;
}

.page-num {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   SEARCH
   ============================================ */

.search-header { margin-bottom: 24px; }

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

.search-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 16px;
  min-width: 200px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--blue); }

.search-tabs { display: flex; gap: 4px; }

.search-tab {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
  font-family: var(--font);
  text-decoration: none;
}

.search-tab:hover { color: var(--text); text-decoration: none; }

.search-tab.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--sky);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification-list { display: flex; flex-direction: column; gap: 10px; }

.notification-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
  color: var(--muted);
  text-decoration: none;
}

.notification-item:hover {
  border-color: rgba(91,163,217,0.2);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

.notification-item.unread {
  border-left: 4px solid var(--blue);
  color: var(--text);
}

.notification-type {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 52px;
  padding-top: 2px;
}

.notification-body { flex: 1; }

.notification-message {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.notification-time {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================
   SETTINGS
   ============================================ */

.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

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

.follow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}

.empty-state-icon {
  margin: 0 auto 20px;
  opacity: 0.35;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

.empty-state a { display: inline-block; margin-top: 4px; }

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  max-width: 320px;
  pointer-events: none;
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast-icon {
  width: 32px;
  height: 32px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.toast-title {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 2px;
  color: var(--text);
}

.toast-message {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================
   ERROR PAGES
   ============================================ */

.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.error-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -4px;
}

.error-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 10px;
}

.error-message {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 200px 1fr;
  }
  .right-sidebar { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .nav-search { display: none; }
  .hamburger { display: flex; }
  .theme-toggle .toggle-label { display: none; }
  .app-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .sidebar { display: none; }
  .layout { padding: 20px 14px; }
  .post-card { padding: 16px; }
  .post-full { flex-direction: column; padding: 20px; }
  .auth-form { margin: 28px auto; padding: 28px 20px; }
  .profile-info { flex-direction: column; align-items: flex-start; }
  .profile-actions { padding-top: 0; }
}
/* ============================================
   TOPNAV
   ============================================ */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.2s, color 0.2s;
  font-family: var(--font);
  gap: 16px;
}

.topnav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
}

.topnav .logo:hover { text-decoration: none; }

.topnav .logo-hex {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.topnav .nav-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topnav .nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s;
  text-decoration: none;
}

.topnav .nav-link:hover {
  background: var(--sky);
  color: var(--blue);
  text-decoration: none;
}

.topnav .nav-link.active {
  color: var(--blue);
  background: var(--sky);
}

.topnav .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav .search-bar {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.topnav .search-bar input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--soft);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.topnav .search-bar input:focus {
  border-color: var(--blue);
  background: var(--card);
}

.topnav .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.topnav .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.topnav .avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(91,163,217,0.4);
}

/* ------------------------
Modal
---------------------------*/
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card);
  color: var(--text, #eee);
  border-radius: 12px;
  padding: 30px 20px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal .field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal select,
.modal textarea,
.modal input[type="text"] {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #444);
  background-color: var(--input-bg, var(--bg-alt, #222));
  color: var(--text, #eee);
  font-size: 0.95rem;
  width: 100%;
  appearance: none;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  cursor: pointer;
  font-size: 1.25rem;
}

.bbcode-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
}

.bb-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 3px 7px;
  line-height: 1.4;
  transition: background 0.1s, border-color 0.1s;
}

.bb-btn:hover {
  background: var(--bg);
  border-color: var(--border);
}

.bb-btn:active {
  background: var(--border);
}

.bb-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* remove top radius on textarea when toolbar is above it */
.bbcode-toolbar + textarea,
.bbcode-toolbar + .field-wrap textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/***********************/
/*    Post Reactions   */
/***********************/

.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.post-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.post-reaction-total {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}
.reaction-strip {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px 6px;
}

.reaction-trigger {
    background: none;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 50px;
    line-height: 1;
    transition: transform 0.15s, opacity 0.15s;
    flex-shrink: 0;
    opacity: 0.5;
}

.reaction-trigger:hover {
    transform: scale(1.2);
    opacity: 1;
}

.reaction-trigger-pill {
    font-size: 1rem;
    opacity: 0.5;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--card);
    transition: opacity 0.15s;
    user-select: none;
}


.reaction-strip.has-reaction .reaction-trigger {
    opacity: 1;
}

.reaction-trigger.open {
    font-size: 0;
    opacity: 1;
}

.reaction-trigger.open::before {
    content: '›';
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blue);
}

.reaction-options {
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    padding-right: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
}

.reaction-options.open {
    max-width: 200px;
    opacity: 1;
    padding-right: 6px;
}

.reaction-btn {
    background: none;
    border: none;
    border-radius: 50px;
    padding: 3px 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    line-height: 1;
    opacity: 0.5;
}

.reaction-btn:hover {
    transform: scale(1.25);
    opacity: 1;
}

.reaction-btn.active {
    opacity: 1;
    background: rgba(91, 163, 217, 0.15);
}

/* when a reaction is selected, all buttons full opacity */
.reaction-strip.has-reaction .reaction-btn {
    opacity: 1;
}

.reaction-counts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 8px;
}

.reaction-count-pill {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 3px 10px;
    user-select: none;
    transition: all 0.15s;
    cursor: pointer;
    font-family: var(--font);
    line-height: 1;
}

.reaction-count-pill:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--sky);
}

.reaction-count-pill.active {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(91, 163, 217, 0.15);
}


.reaction-popover-wrap {
    position: relative;
}

.reaction-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 5px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.reaction-popover.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.reaction-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-wrap: wrap;
}

.reaction-summary:hover .reaction-trigger-pill {
    opacity: 1;
}

.reaction-flame-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 3px 8px;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, border-color 0.15s;
    line-height: 1;
}

.reaction-flame-btn:hover {
    opacity: 1;
    border-color: var(--blue);
}

.reaction-sole-btn {
    background: rgba(91, 163, 217, 0.15);
    border: 1px solid var(--blue);
    border-radius: 50px;
    padding: 3px 8px;
    font-size: 1rem;
    cursor: pointer;
    opacity: 1;
    transition: all 0.15s;
    line-height: 1;
}

.reaction-sole-btn:hover {
    background: rgba(91, 163, 217, 0.25);
}

.reaction-add-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 50px;
    padding: 3px 8px;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.reaction-add-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--sky);
}
.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.has-tooltip:hover::after {
    opacity: 1;
}


/* ── Feedback trigger button ───────────────────────────── */
.feedback-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1099;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--teal, #1d9e75);
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: opacity 0.15s, transform 0.15s;
}

.feedback-trigger:hover { opacity: 0.9; transform: scale(1.04); }

.feedback-trigger-icon { font-size: 1rem; }
 
/* ── Overlay ───────────────────────────────────────────── */
.feedback-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.feedback-overlay.open {
  display: block;
  opacity: 1;
}
 
/* ── Panel ─────────────────────────────────────────────── */
.feedback-panel {
  position: fixed;
  bottom: 84px;      /* sits just above the trigger button */
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: 80vh;
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  font-family: 'Nunito', sans-serif;
}
.feedback-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
 
/* ── Header ────────────────────────────────────────────── */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fp-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.fp-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.fp-close:hover { background: var(--hover, rgba(255,255,255,0.06)); color: var(--text); }
 
/* ── Body ──────────────────────────────────────────────── */
.fp-body {
  overflow-y: auto;
  max-height: calc(80vh - 60px); /* 60px accounts for the header */
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fp-sub {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}
 
/* ── Rating rows ───────────────────────────────────────── */
.fp-ratings {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}
.fp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.fp-row:last-child { border-bottom: none; }
.fp-row:hover { background: var(--hover, rgba(255,255,255,0.03)); }
.fp-row-labels { flex: 1; min-width: 0; }
.fp-row-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-row-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1px;
  font-weight: 500;
}
.fp-stars { display: flex; gap: 3px; flex-shrink: 0; }
.fp-star {
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: transform 0.1s;
}
.fp-star:hover { transform: scale(1.2); }
.fp-star svg { width: 18px; height: 18px; display: block; }
 
/* ── Text field ────────────────────────────────────────── */
.fp-field { display: flex; flex-direction: column; gap: 7px; }
.fp-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.fp-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
  resize: vertical;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  padding: 10px 12px;
  background: var(--bg, #12121f);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  color: var(--text);
  transition: border-color 0.15s;
}
.fp-textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.fp-textarea::placeholder { color: var(--muted); }
 
/* ── Error ─────────────────────────────────────────────── */
.fp-error {
  font-size: 0.8rem;
  color: var(--rose, #e24b4a);
  margin: -8px 0 0;
  display: none;
  font-weight: 600;
}
 
/* ── Actions ───────────────────────────────────────────── */
.fp-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 4px;
}
.fp-btn-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  padding: 9px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fp-btn-cancel:hover { background: var(--hover, rgba(255,255,255,0.05)); border-color: var(--muted); color: var(--text); }
.fp-btn-submit {
  background: var(--teal, #1d9e75);
  border: none;
  border-radius: var(--radius-sm, 8px);
  padding: 9px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.fp-btn-submit:hover { opacity: 0.88; }
.fp-btn-submit:active { transform: scale(0.97); }
.fp-btn-submit:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
 
/* ── Success state ─────────────────────────────────────── */
.fp-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.fp-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(29,158,117,0.18);
  color: var(--teal, #1d9e75);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.fp-success-title { font-size: 1.1rem; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.fp-success-sub { font-size: 0.85rem; color: var(--muted); margin: 0; font-weight: 500; }
 
/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .feedback-panel { width: 100%; border-left: none; }
}