/*
Theme Name: MightyFirefly
Theme URI: https://mightyfirefly.com
Author: MightyFirefly
Description: A writing community platform for private writing groups. A small light in the forest.
Version: 1.0.116
License: GPL v2 or later
Text Domain: mightyfirefly
*/

/* ============================================================
   FONTS & ROOT VARIABLES
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Crimson+Pro:ital,wght@0,300;0,400;1,300;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

:root {
  /* Dark palette */
  --black:        #08090b;
  --deep:         #0d0f12;
  --void:         #111318;
  --surface:      #161920;
  --surface-2:    #1d2029;
  --border:       #252830;
  --border-light: #2e3240;
  --muted:        #4a5068;
  --text-dim:     #8891a8;
  --text:         #c8cfe0;
  --text-bright:  #e8ecf5;
  --white:        #f4f6fb;

  /* Firefly glow accent */
  --glow:         #c8ff00;
  --glow-soft:    #b8ef00;
  --glow-dim:     rgba(200, 255, 0, 0.12);
  --glow-trace:   rgba(200, 255, 0, 0.06);

  /* Warm amber accent */
  --amber:        #ffb84d;
  --amber-dim:    rgba(255, 184, 77, 0.15);

  /* Typography */
  --font-display: var(--mff-display-font, 'Plus Jakarta Sans', sans-serif);
  --font-nav:     var(--mff-nav-font, 'Space Mono', monospace);
  --font-sidebar: var(--mff-sidebar-font, 'Space Mono', monospace);
  --font-ui:      var(--mff-ui-font, 'Space Mono', monospace);
  --font-ui:      var(--mff-ui-font, 'Space Mono', monospace);
  --nav-transform:     var(--mff-nav-transform, uppercase);
  --sidebar-transform: var(--mff-sidebar-transform, uppercase);
  --font-mono:    'Space Mono', monospace;
  --mff-ui-size:  1;
  --font-body:    var(--mff-display-font, 'Crimson Pro', serif);

  /* Configurable sizes */
  --nav-size:     var(--mff-nav-size, 0.85rem);
  --body-size:    var(--mff-body-size, 1rem);
  --sidebar-size: var(--mff-sidebar-size, 0.92rem);
  /* Sidebar width scales with font size: base 240px at 0.72rem, grows/shrinks proportionally */
  --sidebar-width: var(--mff-sidebar-width, 240px);

  /* Spacing */
  --radius:       6px;
  --radius-lg:    12px;

  /* Transitions */
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
}

/* ============================================================
   LIGHT MODE — activated by data-theme="light" on <html>
   The landing page (body.home, body.landing) is always dark.
============================================================ */
html[data-theme="light"] {
  --black:        #f0f2f5;
  --deep:         #e8eaee;
  --void:         #dfe2e8;
  --surface:      #ffffff;
  --surface-2:    #f5f6f8;
  --border:       #d8dce6;
  --border-light: #c8cdd9;
  --muted:        #8993a8;
  --text-dim:     #5a6175;
  --text:         #2a2d38;
  --text-bright:  #111318;
  --white:        #111318;

  /* Keep the firefly glow accent — slightly deeper in light mode */
  --glow:         #7ab800;
  --glow-soft:    #6aaa00;
  --glow-dim:     rgba(100, 170, 0, 0.12);
  --glow-trace:   rgba(100, 170, 0, 0.06);

  --amber:        #c87800;
  --amber-dim:    rgba(200, 120, 0, 0.12);
}

html[data-theme="light"] body {
  background: var(--black);
}

/* Inputs / selects / textareas in light mode */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Code-like monospace elements */
html[data-theme="light"] .sidebar,
html[data-theme="light"] .dashboard-layout .sidebar {
  background: var(--surface-2);
  border-right-color: var(--border);
}

/* Review sidebar panel */
html[data-theme="light"] .review-sidebar {
  background: var(--surface-2);
  border-left-color: var(--border);
}

/* Manuscript area */
html[data-theme="light"] .manuscript-area {
  background: var(--surface);
}

/* Highlight colors in light mode */
html[data-theme="light"] .review-highlight {
  background: rgba(100,170,0,0.18);
  border-bottom-color: var(--glow);
}
html[data-theme="light"] .review-highlight--staged {
  background: rgba(100,170,0,0.25);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px !important;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  /* Prevent layout shift when content height changes (scrollbar appearing/disappearing) */
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size, 1.125rem);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: clip;
}

/* Prevent text selection on manuscript content — only when NOT in review mode */
.manuscript-content:not(.review-mode) {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Review mode: explicitly allow everything, kill any inheritance */
.manuscript-content.review-mode {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: default !important;
  pointer-events: auto !important;
  cursor: text !important;
}

.manuscript-content.review-mode * {
  user-select: text !important;
  -webkit-user-select: text !important;
  pointer-events: auto !important;
}

/* Double-spacing + line numbers in review mode */
.review-mode-wrap,
.manuscript-line-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.review-line-numbers,
.line-numbers {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: none;
  min-width: 2.5rem;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
}

.review-line-numbers span,
.line-numbers span {
  display: flex;
  align-items: flex-start;
  user-select: none !important;
  -webkit-user-select: none !important;
  overflow: hidden;
  flex-shrink: 0;
}

.manuscript-content.review-mode p,
.manuscript-content.review-mode li {
  line-height: 3.4 !important;
  margin-bottom: 0 !important;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--glow); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--glow-soft); }

/* ============================================================
   LAYOUT
============================================================ */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.container--narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--wide {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ============================================================
   HEADER & NAV
============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  padding: 0;
  transition: box-shadow 0.2s var(--ease);
}

.site-header.scrolled {
  box-shadow: 0 2px 28px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.035);
}
html[data-theme="light"] .site-header {
  background: var(--surface-2);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  padding: 0 2.5rem;
  width: 100%;
  position: relative;
}
.header-inner > nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-decoration: none;
}

.logo-wordmark {
  display: flex;
  align-items: baseline;
  line-height: 1;
}

.logo-mighty {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.logo-firefly {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--glow);
  letter-spacing: -0.01em;
}

.site-tagline {
  font-family: var(--font-nav);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: var(--nav-transform);
  display: block;
  margin-top: 1px;
}

/* ── Nav monogram logo (logo update) ───────────────────── */
.nav-logo-item {
  align-self: stretch;
  align-items: stretch !important;
  margin: 0;
  padding: 0;
}
.nav-logo-link {
  display: flex !important;
  align-items: center;
  height: 100%;
  padding: 0 36px 0 0 !important;
  line-height: 0;
  background: transparent !important;
  opacity: 0.9;
  transition: opacity 0.15s ease !important;
}
.nav-logo-link:hover { opacity: 1 !important; background: transparent !important; }
.nav-logo-svg { height: 100%; width: auto; display: block; }
.nav-logo-svg--light { display: none; }
html[data-theme="light"] .nav-logo-svg--dark  { display: none; }
html[data-theme="light"] .nav-logo-svg--light { display: block; }
html[data-theme="light"] .nav-menu { background: rgba(0,0,0,0.06); }

.nav-menu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  list-style: none;
  background: rgba(255,255,255,0.09);
  border-radius: 9999px;
  padding: 0 6px 0 0;
}

/* Edge: ensure all nav items are vertically centered and never shrink */
.nav-menu li {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-menu a {
  font-family: var(--font-nav);
  font-size: var(--nav-size, 14px) !important;
  letter-spacing: 0.1em;
  text-transform: var(--nav-transform);
  color: var(--text-dim);
  padding: 3px 13px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav-menu a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-menu a.active {
  color: var(--text-bright);
  background: none;
}

.nav-user {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── User chip — replaces the old avatar+name+logout combo ── */
.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 24px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  position: relative;
  font-family: inherit;
  text-decoration: none;
}

.nav-user-chip:hover,
.nav-user-chip.open {
  background: var(--surface);
  border-color: transparent;
}

.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--glow);
  flex-shrink: 0;
}

.nav-user-name {
  font-family: var(--font-nav);
  font-size: var(--nav-size, 14px);
  letter-spacing: 0.06em;
  text-transform: var(--nav-transform);
  color: var(--text-dim);
  transition: color 0.15s;
}

.nav-user-chip:hover .nav-user-name,
.nav-user-chip.open .nav-user-name {
  color: var(--text);
}

.nav-user-chevron {
  width: 12px;
  height: 12px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease), color 0.15s;
}

.nav-user-chip.open .nav-user-chevron {
  transform: rotate(180deg);
  color: var(--text-dim);
}

/* ── User dropdown panel ──────────────────────────────────── */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--deep);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(200,255,0,0.04);
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
  z-index: 200;
}

.nav-user-chip.open .nav-user-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.nav-dd-user-info {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.nav-dd-user-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-bright);
  font-weight: 500;
  display: block;
}

.nav-dd-user-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.nav-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-family: var(--font-nav);
  font-size: calc(var(--nav-size, 14px) * 0.92);
  letter-spacing: 0.06em;
  text-transform: var(--nav-transform);
  color: var(--text-dim);
  text-decoration: none;
  background: transparent;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.nav-user-dropdown a:hover {
  background: rgba(255,255,255,0.045);
  color: var(--text);
}

.nav-user-dropdown a.nav-dd-danger:hover {
  background: rgba(255,80,80,0.07);
  color: #f08080;
}

.nav-dd-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── Hamburger (mobile only) ─────────────────────────────── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--surface);
  border-color: var(--border-light);
  color: var(--text);
}

.hamburger-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Unread count bubbles on nav links ───────────────────── */
.nav-item-with-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
}
/* Extra right space on the anchor so the absolute bubble doesn't overlap text */
.nav-item-with-bubble > a {
  padding-right: 4px;
  position: relative;
}

/* Sidebar context: the <li> itself gets the class so <a> is full-width flex */
.sidebar-nav .nav-item-with-bubble {
  display: block;
}
.sidebar-nav .nav-item-with-bubble > a {
  position: relative;
}

.nav-unread-bubble {
  position: absolute;
  top: -0.5em;
  right: -0.75em;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--glow);
  color: #08090b;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(200,255,0,0.55), 0 0 0 2px var(--deep);
  animation: bubblePop 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
  z-index: 10;
}

@keyframes bubblePop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Sidebar context — bubble floats above-right of the text (not the full link width) */
.sidebar-nav li { position: relative; }
.sidebar-nav li a { position: relative; }
.sidebar-nav .nav-unread-bubble {
  position: relative;
  display: inline-flex;
  top: -6px;
  margin-left: 3px;
  vertical-align: middle;
  font-size: 0.5rem;
  min-width: 16px;
  height: 16px;
  animation: none;
  flex-shrink: 0;
}

html[data-theme="light"] .nav-unread-bubble {
  color: #fff;
  background: #7ab800;
  box-shadow: 0 0 8px rgba(122,184,0,0.45), 0 0 0 2px #fff;
}

.btn-logout {
  font-family: var(--font-nav);
  font-size: var(--nav-size, 14px) !important;
  letter-spacing: 0.1em;
  text-transform: var(--nav-transform);
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}

.btn-logout:hover {
  color: var(--text);
  border-color: var(--border-light);
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.site-main {
  flex: 1;
  padding-top: 64px;
}

/* ============================================================
   LANDING PAGE
============================================================ */
.landing-hero {
  position: relative;
  min-height: 100vh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 860px;
  width: 100%;
  padding: 0 2rem;
}

.hero-wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1;
  margin-bottom: 18px;
}

.hero-wordmark-mighty {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: #d0d0d0;
  letter-spacing: -0.01em;
}

.hero-wordmark-firefly {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: var(--glow);
  letter-spacing: -0.01em;
}

.hero-tagline-wrap {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--glow);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  margin-bottom: 3rem;
}

.hero-cursor {
  display: inline-block;
  width: 2px;
  height: 17px;
  background: var(--glow);
  margin-left: 2px;
  vertical-align: middle;
}

@keyframes mff-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-cursor.blinking { animation: mff-blink 1.1s step-end infinite; }

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  font-weight: 400;
  text-decoration: none;
}

.btn-primary {
  background: var(--glow);
  color: var(--black);
  border-color: var(--glow);
}

.btn-primary:hover {
  background: #d4ff33;
  border-color: #d4ff33;
  color: var(--black);
  box-shadow: 0 0 20px rgba(200,255,0,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--glow);
  color: var(--glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
  padding: 10px 16px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-danger {
  background: transparent;
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
  background: rgba(255,107,107,0.1);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* ============================================================
   AUTH FORMS
============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.auth-logo .tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.form-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.2s var(--ease);
}

.form-tab.active {
  background: var(--surface-2);
  color: var(--glow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease);
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--glow);
  box-shadow: 0 0 0 3px var(--glow-trace);
}

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

.form-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.form-error {
  color: #ff6b6b;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  margin-top: 0.75rem;
  padding: 10px 14px;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius);
}

.form-success {
  color: var(--glow);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  margin-top: 0.75rem;
  padding: 10px 14px;
  background: var(--glow-trace);
  border: 1px solid rgba(200,255,0,0.2);
  border-radius: var(--radius);
}

.form-submit {
  width: 100%;
  margin-top: 1.5rem;
  padding: 13px;
}

.form-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.form-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.form-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ============================================================
   DASHBOARD
============================================================ */
.dashboard-layout {
  display: grid;
  grid-template-columns: var(--mff-sidebar-width, 220px) 1fr;
  min-height: calc(100vh - 64px);
  align-items: stretch;
  width: 100%;
}

.dashboard-layout--no-sidebar {
  grid-template-columns: 1fr;
}
.dashboard-layout--no-sidebar .dashboard-main {
  grid-column: 1;
}

.sidebar {
  background: var(--deep);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0 0;
  position: fixed;
  top: 64px;
  left: 0;
  z-index: 50;
  height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: visible;
  width: var(--mff-sidebar-width, 240px);
  min-width: var(--mff-sidebar-width, 220px);
  max-width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.2s var(--ease);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
/* Mobile-only sidebar: hidden on desktop, slides in as drawer on mobile */
.sidebar--mobile-only { display: none !important; }
@media (max-width: 1024px) {
  .sidebar--mobile-only { display: flex !important; }
}

.sidebar-section {
  padding: 0 1rem;
}

.sidebar-section + .sidebar-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Group name header */
.group-badge {
  display: block;
  background: transparent;
  border: none;
  padding: 0 0.5rem 1.25rem;
  font-family: var(--font-sidebar);
  font-size: var(--sidebar-size, 15px);
  text-transform: var(--sidebar-transform);
  color: var(--text-bright);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-badge .dot { display: none; }

/* Section label */
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.5rem 0.6rem;
  display: block;
  opacity: 0.7;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: var(--font-sidebar);
  font-size: var(--sidebar-size, 15px) !important;
  letter-spacing: 0.01em;
  text-transform: var(--sidebar-transform);
  color: var(--text-dim);
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
  position: relative;
  overflow: hidden;
}

.sidebar-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.sidebar-nav li a:hover {
  background: rgba(255,255,255,0.045);
  color: var(--text);
}

.sidebar-nav li a.active {
  background: rgba(200,255,0,0.08);
  color: var(--glow);
}
.sidebar-nav li a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--glow);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav li a.active .nav-icon {
  opacity: 1;
}

.sidebar-nav li a .nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.12s;
}
.sidebar-nav li a:hover .nav-icon {
  opacity: 0.75;
}

/* ── Sidebar collapse toggle button ──────────────────────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-left: auto;
  margin-bottom: 0.75rem;
  float: right;
  margin-right: 8px;
}

.sidebar-collapse-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-dim);
}

.sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-new-btn a {
  white-space: nowrap;
}

/* ── Sidebar collapsed (icon-only) state ─────────────────── */
.sidebar.collapsed {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
}

.sidebar.collapsed .sidebar-collapse-btn {
  float: none;
  margin: 0 auto 0.75rem;
}

.sidebar.collapsed .sidebar-section {
  padding: 0 8px;
}

.sidebar.collapsed .sidebar-section + .sidebar-section {
  padding-top: 1rem;
}

.sidebar.collapsed .group-badge,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .nav-unread-bubble,
.sidebar.collapsed .sidebar-new-btn {
  display: none;
}

.sidebar.collapsed .sidebar-nav li a {
  justify-content: center;
  padding: 9px;
  gap: 0;
  border-radius: 8px;
}

.sidebar.collapsed .sidebar-nav li a .nav-icon {
  width: 17px;
  height: 17px;
  opacity: 0.55;
}

.sidebar.collapsed .sidebar-nav li a:hover .nav-icon {
  opacity: 0.9;
}

.sidebar.collapsed .sidebar-nav li a.active .nav-icon {
  opacity: 1;
}

/* Tooltip on collapsed icons */
.sidebar.collapsed .sidebar-nav li {
  position: relative;
}

.sidebar.collapsed .sidebar-nav li a[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.sidebar.collapsed .sidebar-nav li a[data-label]:hover::after {
  opacity: 1;
}

/* ── Sidebar footer (pinned user card) ───────────────────── */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  margin: auto 1rem 0;
  border-top: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  transition: background 0.15s;
  text-decoration: none;
  position: sticky;
  bottom: 0;
}

.sidebar-footer-body {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.sidebar-footer-body:hover .sidebar-footer-name {
  color: var(--text);
}

.sidebar-footer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--glow);
  flex-shrink: 0;
}

.sidebar-footer-info {
  min-width: 0;
  flex: 1;
}

.sidebar-footer-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.sidebar-footer-badge {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sidebar-footer-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
  text-decoration: none;
}

.sidebar-footer-settings:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}

.sidebar-footer-settings svg {
  width: 13px;
  height: 13px;
}

.sidebar.collapsed .sidebar-footer {
  margin: auto 0 0;
  padding: 10px 0;
  justify-content: center;
  border-radius: 0;
  border-top: 1px solid var(--border);
}

.sidebar.collapsed .sidebar-footer-info,
.sidebar.collapsed .sidebar-footer-settings {
  display: none;
}

.sidebar.collapsed .sidebar-footer-avatar {
  width: 30px;
  height: 30px;
}

/* ── Sidebar backdrop (mobile drawer) ────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,0.55);
  z-index: 89;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible {
  display: block;
  animation: mffFadeIn 0.2s ease both;
}

/* Dashboard main */
.dashboard-main {
  grid-column: 2; /* sidebar is position:fixed (out of flow), so explicitly place content in col 2 */
  padding: 2.5rem 3rem;
  background: var(--black);
  overflow-y: auto;
  width: 100%;
  min-width: 0; /* prevents grid blowout */
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* ============================================================
   SUBMISSIONS FEED
============================================================ */
.submissions-grid {
  display: grid;
  gap: 1.5rem;
}

.submission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.submission-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: transparent;
  transition: background 0.2s var(--ease);
}

.submission-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.submission-card:hover::before {
  background: var(--glow);
}

.submission-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.author-avatar {
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.author-avatar-badge {
  background: none;
  border: none;
  width: auto;
  height: auto;
  border-radius: 0;
}
.writer-card-avatar-badge {
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  margin: 0 auto 0.75rem;
}

/* ── Submission card author link ─────────────────────────── */
.author-avatar-link {
  display: inline-block;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 50%;
  transition: opacity 0.15s;
}
.author-avatar-link:hover { opacity: 0.8; }
.author-avatar-badge-link { border-radius: 0; }
.author-name-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
  transition: color 0.15s;
}
.author-name-link:hover { color: var(--glow); }

/* ── Writer badge strip (on writer profile page) ──────────── */
.writer-badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.writer-badge-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-width: 240px;
  max-width: 340px;
}
.writer-badge-card:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.12);
}
.writer-badge-card-visual {
  flex-shrink: 0;
}
.writer-badge-card-info {
  flex: 1;
  min-width: 0;
}
.writer-badge-card-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
  opacity: 0.9;
}
.writer-badge-card-tier {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 8px;
}
.writer-badge-card-track {
  display: flex;
  gap: 4px;
  align-items: stretch;
}


.author-info {
  flex: 1;
}

.author-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 700;
}

.submission-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.submission-genre {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
}

.submission-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.submission-title a {
  color: inherit;
}

.submission-title a:hover {
  color: var(--glow);
}

.submission-excerpt {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.submission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.submission-stats {
  display: flex;
  gap: 1.5rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.submission-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================
   SUBMISSION SINGLE PAGE
============================================================ */
.submission-page {
  width: 100%;
  max-width: 100%;
  padding: 2.5rem 3rem;
  box-sizing: border-box;
}

.manuscript-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.manuscript-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.manuscript-byline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.manuscript-content {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text);
}

.manuscript-content p {
  margin-bottom: 1.5em;
}

/* Tab indentation — class-based so WordPress kses doesn't strip it */
.manuscript-content .mff-tab,
.mff-tab {
  display: inline-block;
  width: 2.5em;
}

.manuscript-content p.mff-indent,
p.mff-indent {
  text-indent: 2.5em;
}

/* Editor preview — same classes work inside the contenteditable */
#ms_editor .mff-tab {
  display: inline-block;
  width: 2.5em;
}
#ms_editor p.mff-indent {
  text-indent: 2.5em;
}

.manuscript-content h2,
.manuscript-content h3 {
  font-family: var(--font-display);
  color: var(--text-bright);
  margin: 2em 0 1em;
}

/* Highlighted text in review mode */
.review-highlight {
  background: rgba(200, 255, 0, 0.15);
  border-bottom: 2px solid var(--glow);
  cursor: pointer;
  border-radius: 2px;
  position: relative;
}

/* Temporary highlight while reviewer is typing */
.review-highlight--temp {
  background: rgba(200, 255, 0, 0.07);
  border-bottom: 2px dashed rgba(200, 255, 0, 0.4);
}

/* Review card body — quoted passage and suggestion lines */
.review-quoted-passage {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  border-left: 2px solid rgba(200,255,0,0.35);
  padding: 4px 0 4px 10px;
  margin: 6px 0 4px;
}

.review-suggestion {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding-left: 1.4em;
  position: relative;
  margin-bottom: 6px;
}

.review-dash {
  position: absolute;
  left: 0;
  color: var(--glow);
  opacity: 0.8;
}

.review-comment-line {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 2px 0;
}

.review-highlight:hover {
  background: rgba(200, 255, 0, 0.25);
}

/* ============================================================
   REVIEW PANEL
============================================================ */
.review-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  min-height: calc(100vh - 64px);
  width: 100%;
}

.review-sidebar {
  background: var(--deep);
  border-left: 1px solid var(--border);
  padding: 2rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-sidebar-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-bright);
  font-weight: 300;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.review-instruction {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  line-height: 1.6;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.selection-preview {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem;
  display: none;
}

.selection-preview.active {
  display: block;
}

.selection-preview-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.selection-preview-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--glow);
  font-style: italic;
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--glow-dim);
  border-left: 2px solid var(--glow);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.review-form .review-editor {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.8;
  min-height: 120px;
  max-height: 60vh;
  overflow-y: auto;
  outline: none;
  transition: border-color 0.2s var(--ease), min-height 0.2s var(--ease);
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

/* Grows to fit content — JS sets this after each insertion */
.review-form .review-editor.has-content {
  min-height: fit-content;
}

.review-form .review-editor:focus {
  border-color: var(--glow);
}

.review-form .review-editor .review-quote-line {
  font-style: italic;
  color: var(--text);
  display: block;
}

.review-form .review-editor .review-note-line {
  font-style: normal;
  color: var(--text-dim);
  display: block;
  padding-left: 1em;
}

/* Hidden real textarea — holds plain text for submission */
.review-form textarea#reviewCommentText {
  display: none;
}

/* Review comment cards */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.review-card .quoted-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--glow);
  font-style: italic;
  padding: 6px 12px;
  background: var(--glow-dim);
  border-left: 2px solid var(--glow);
  margin-bottom: 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

.review-card .review-comment-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

.review-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.review-card-meta .reviewer-name {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

.review-card-meta .review-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}

.review-own-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  padding-left: 0.75rem;
}

.btn-review-action {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-review-action:hover {
  border-color: var(--glow);
  color: var(--glow);
}

.btn-review-action--danger:hover {
  border-color: #e05555;
  color: #e05555;
}

.review-inline-edit {
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-inline-textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 100px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.review-inline-textarea:focus {
  border-color: var(--glow);
}

.review-inline-edit .btn-review-action {
  align-self: flex-start;
}

/* Persistent review highlights (existing reviews shown on load) */
.review-highlight--existing {
  background: rgba(200, 255, 0, 0.13);
  border-bottom: 2px solid rgba(200, 255, 0, 0.45);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  display: inline;
  transition: background 0.15s;
}
.review-highlight--existing:hover {
  background: rgba(200, 255, 0, 0.25);
}
/* Slot-colored highlights override the default glow */
.review-highlight[data-reviewer-slot="1"].review-highlight--existing { background: rgba(255,184,77,0.18);  border-bottom-color: #ffb84d; }
.review-highlight[data-reviewer-slot="2"].review-highlight--existing { background: rgba(100,180,255,0.18); border-bottom-color: #64b4ff; }
.review-highlight[data-reviewer-slot="3"].review-highlight--existing { background: rgba(255,120,140,0.18); border-bottom-color: #ff789c; }
.review-highlight[data-reviewer-slot="4"].review-highlight--existing { background: rgba(80,220,160,0.18);  border-bottom-color: #50dca0; }
.review-highlight[data-reviewer-slot="5"].review-highlight--existing { background: rgba(180,140,255,0.18); border-bottom-color: #b48cff; }
.review-highlight[data-reviewer-slot="6"].review-highlight--existing { background: rgba(255,160,80,0.18);  border-bottom-color: #ffa050; }
.review-highlight[data-reviewer-slot="7"].review-highlight--existing { background: rgba(60,200,200,0.18);  border-bottom-color: #3cc8c8; }
.review-highlight[data-reviewer-slot="8"].review-highlight--existing { background: rgba(220,190,60,0.18);  border-bottom-color: #dcbe3c; }
.review-highlight--pulse {
  animation: hl-pulse 0.6s ease 2;
}
@keyframes hl-pulse {
  0%   { background: rgba(200,255,0,0.13); }
  50%  { background: rgba(200,255,0,0.4); }
  100% { background: rgba(200,255,0,0.13); }
}

/* Tooltip: use fixed positioning via JS, not CSS absolute, to escape overflow clipping */
.review-hl-tooltip {
  display: none;
  position: fixed;
  background: var(--deep);
  border: 1px solid var(--glow);
  color: var(--text);
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.97rem;
  line-height: 1.55;
  padding: 6px 12px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 9999;
  white-space: normal;
  width: max-content;
  max-width: 340px;
}

/* ── Author accordion view ──────────────────────────────────── */
.accordion-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.review-accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.accordion-trigger-row {
  display: flex;
  align-items: center;
}
.accordion-trigger-row .accordion-trigger {
  flex: 1;
}
.review-accordion-item.accordion-open {
  border-color: var(--border-light);  /* overridden by slot classes below */
}
.accordion-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  min-width: 0;
}
.accordion-trigger:hover { background: var(--deep); }
.accordion-open .accordion-trigger { background: var(--deep); }
.btn-print-review {
  flex-shrink: 0;
  margin-right: 0.6rem;
}
.accordion-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.accordion-name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
}
.accordion-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.accordion-age { color: var(--muted); opacity: 0.6; }
.accordion-chevron {
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
  margin-left: 2px;
}
.accordion-open .accordion-chevron { transform: rotate(90deg); color: var(--glow); }
.accordion-body {
  padding: 1rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.accordion-body[hidden] { display: none; }

/* ── Submission card NEW badge ──────────────────────────────── */
.submission-card-wrap { position: relative; }
.submission-new-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--glow);
  color: #05080a;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 12px;
  border-radius: 20px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 2;
}
.submission-card--new {
  border-color: rgba(200,255,0,0.25);
}
.submission-card--flagged {
  border-color: rgba(255,160,80,0.35);
}

/* ── Flagged badge — softer amber, same shape as new badge ── */
.submission-flagged-badge {
  position: absolute;
  top: -9px;
  left: 12px;
  background: #1a0c02;
  color: #ffa050;
  border: 1px solid rgba(255,160,80,0.55);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 12px;
  border-radius: 20px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 2;
}

/* ── Flag button ─────────────────────────────────────────── */
.btn-flag {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-flag:hover {
  color: #ffa050;
  border-color: rgba(255,160,80,0.5);
}
.btn-flag--active {
  color: #ffa050;
  border-color: rgba(255,160,80,0.55);
  background: rgba(255,160,80,0.07);
}
.btn-flag--active:hover {
  color: var(--text-dim);
  border-color: var(--border);
  background: transparent;
}
html[data-theme="light"] .btn-flag { color: var(--text-dim); }
html[data-theme="light"] .btn-flag--active { color: #c06820; border-color: rgba(192,104,32,0.5); background: rgba(192,104,32,0.07); }
html[data-theme="light"] .submission-flagged-badge { background: #fff; color: #c06820; border-color: rgba(192,104,32,0.5); }

/* ── My Work — new-review badge on collection rows ─────────── */
.mywork-new-review-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: #1a1240;
  color: #a78bfa;
  border: 1px solid rgba(167,139,250,0.5);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 12px;
  border-radius: 20px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 2;
}
.submission-card--has-new-review {
  border-color: rgba(167,139,250,0.3);
}

/* ── New Reviews notification section (dashboard home) ──────── */
.new-reviews-section {
  background: var(--surface);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 2.5rem;
}
.new-reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.new-reviews-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 7px;
}
.new-reviews-count {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--muted);
}
.new-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.new-review-card {
  background: var(--bg);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 8px;
  padding: 1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}
.new-review-card:hover { border-color: rgba(167,139,250,0.45); }
.new-review-card-inner { flex: 1; }
.new-review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}
.new-review-badge-pill {
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid rgba(167,139,250,0.35);
}
.new-review-time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}
.new-review-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-bright);
  margin: 0 0 0.35rem;
  line-height: 1.3;
}
.new-review-reviewers {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}
.new-review-cta {
  align-self: flex-start;
  font-size: 0.68rem;
  padding: 6px 14px;
  background: transparent;
  color: #a78bfa;
  border-color: rgba(167,139,250,0.4);
}
.new-review-cta:hover {
  background: rgba(167,139,250,0.1);
  border-color: rgba(167,139,250,0.7);
  color: #c4b5fd;
}

/* Light mode overrides */
html[data-theme="light"] .mywork-new-review-badge { background: #fff; color: #7c3aed; border-color: rgba(124,58,237,0.4); }
html[data-theme="light"] .submission-card--has-new-review { border-color: rgba(124,58,237,0.25); }
html[data-theme="light"] .new-reviews-section { border-color: rgba(124,58,237,0.2); }
html[data-theme="light"] .new-reviews-title { color: #7c3aed; }
html[data-theme="light"] .new-review-card { border-color: rgba(124,58,237,0.15); }
html[data-theme="light"] .new-review-card:hover { border-color: rgba(124,58,237,0.4); }
html[data-theme="light"] .new-review-badge-pill { background: rgba(124,58,237,0.08); color: #7c3aed; border-color: rgba(124,58,237,0.25); }
html[data-theme="light"] .new-review-cta { color: #7c3aed; border-color: rgba(124,58,237,0.35); }
html[data-theme="light"] .new-review-cta:hover { background: rgba(124,58,237,0.07); }

/* ── Staged highlight collection (reviewer input) ───────────── */
.staged-highlights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.75rem;
}
.staged-hl-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--glow);
  border-radius: var(--radius);
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.staged-hl-card:hover { border-color: var(--glow); }
.staged-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 5px;
  line-height: 1.4;
}
.staged-line {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-left: 6px;
  font-style: normal;
}
.staged-comment-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 4px 7px;
  box-sizing: border-box;
}
.staged-comment-input:focus { outline: none; border-color: var(--glow); }
.staged-remove {
  position: absolute;
  top: 6px; right: 6px;
  background: none; border: none;
  color: var(--muted); font-size: 1rem; cursor: pointer;
  line-height: 1; padding: 2px 4px;
  border-radius: 3px; transition: color 0.12s, background 0.12s;
}
.staged-remove:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

.review-general-wrap {
  margin-top: 0.5rem;
}
.review-general-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.review-general-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 10px;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
}
.review-general-textarea:focus { outline: none; border-color: var(--glow); }
.review-submit-row {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
  align-items: center;
}

/* ── Submitted session view (reviewer & author) ─────────────── */
.session-hl-item {
  padding: 0.55rem 0.75rem;
  border-left: 2px solid rgba(200,255,0,0.3);
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: border-color 0.15s, background 0.15s;
}
.session-hl-item:hover { border-left-color: var(--glow); background: var(--surface); }
/* Slot-colored left bars on session items */
.reviewer-slot-1 .session-hl-item { border-left-color: #ffb84d; }
.reviewer-slot-2 .session-hl-item { border-left-color: #64b4ff; }
.reviewer-slot-3 .session-hl-item { border-left-color: #ff789c; }
.reviewer-slot-4 .session-hl-item { border-left-color: #50dca0; }
.reviewer-slot-5 .session-hl-item { border-left-color: #b48cff; }
.reviewer-slot-6 .session-hl-item { border-left-color: #ffa050; }
.reviewer-slot-7 .session-hl-item { border-left-color: #3cc8c8; }
.reviewer-slot-8 .session-hl-item { border-left-color: #dcbe3c; }
.reviewer-slot-1 .session-hl-item:hover { border-left-color: #ffb84d; background: rgba(255,184,77,0.07); }
.reviewer-slot-2 .session-hl-item:hover { border-left-color: #64b4ff; background: rgba(100,180,255,0.07); }
.reviewer-slot-3 .session-hl-item:hover { border-left-color: #ff789c; background: rgba(255,120,140,0.07); }
.reviewer-slot-4 .session-hl-item:hover { border-left-color: #50dca0; background: rgba(80,220,160,0.07); }
.reviewer-slot-5 .session-hl-item:hover { border-left-color: #b48cff; background: rgba(180,140,255,0.07); }
.reviewer-slot-6 .session-hl-item:hover { border-left-color: #ffa050; background: rgba(255,160,80,0.07); }
.reviewer-slot-7 .session-hl-item:hover { border-left-color: #3cc8c8; background: rgba(60,200,200,0.07); }
.reviewer-slot-8 .session-hl-item:hover { border-left-color: #dcbe3c; background: rgba(220,190,60,0.07); }
.session-hl-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.session-hl-line {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  font-style: normal;
  margin-left: 5px;
}
.session-hl-comment {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 3px;
}
.session-general-comment {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.session-general-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ============================================================
   MFF MODAL
============================================================ */
.mff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,9,11,0.82);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}
.mff-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.mff-modal {
  background: var(--deep);
  border: 1px solid var(--border-light);
  border-radius: calc(var(--radius) * 2);
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 60px rgba(200,255,0,0.07), 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(12px);
  transition: transform 0.2s var(--ease);
}
.mff-modal-overlay.active .mff-modal {
  transform: translateY(0);
}
.mff-modal-icon {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}
.mff-modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}
.mff-modal-body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}
.mff-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.75rem;
}
.mff-modal-msg {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}
.mff-modal-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.mff-modal-btn:hover {
  border-color: var(--text-dim);
  color: var(--text-bright);
}
.mff-modal-btn--confirm {
  background: var(--glow-dim);
  border-color: var(--glow);
  color: var(--glow);
}
.mff-modal-btn--confirm:hover {
  background: var(--glow);
  color: var(--void);
}
.mff-modal-btn--danger {
  background: rgba(220,60,60,0.12);
  border-color: rgba(220,60,60,0.5);
  color: #f87171;
}
.mff-modal-btn--danger:hover {
  background: rgba(220,60,60,0.25);
  border-color: #f87171;
  color: #fff;
}
.mff-modal-btn--secondary {
  background: rgba(200,255,0,0.06);
  border-color: rgba(200,255,0,0.2);
  color: var(--text-dim);
}
.mff-modal-btn--secondary:hover {
  border-color: var(--glow);
  color: var(--glow);
}

/* ============================================================
   NAV — DROPDOWN MENUS (Community + Submissions)
============================================================ */
.nav-has-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-nav);
  font-size: var(--nav-size, 14px);
  letter-spacing: 0.1em;
  text-transform: var(--nav-transform);
  color: var(--text-dim);
  padding: 5px 13px;
  border-radius: 9999px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
  position: relative;
}

.nav-trigger-firefly {
  position: absolute;
  top: -7px;
  right: 18px;
  width: 24px;
  height: 27px;
  pointer-events: none;
  animation: firefly-pulse 2.8s ease-in-out infinite;
}
html[data-theme="light"] .nav-trigger-firefly {
  animation: firefly-pulse-light 2.8s ease-in-out infinite;
}

@keyframes firefly-pulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 3px rgba(200,255,0,0.6)); }
  50%       { opacity: 0.65; filter: drop-shadow(0 0 1px rgba(200,255,0,0.2)); }
}
@keyframes firefly-pulse-light {
  0%, 100% { opacity: 1;    filter: drop-shadow(0 0 2px rgba(0,0,0,0.7)) drop-shadow(0 0 8px rgba(0,0,0,0.35)); }
  50%       { opacity: 0.75; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5)) drop-shadow(0 0 5px rgba(0,0,0,0.25)); }
}

.nav-has-dropdown:hover .nav-dropdown-trigger {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-trigger-chevron {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  transition: transform 0.18s var(--ease);
  opacity: 0.6;
}

.nav-has-dropdown:hover .nav-trigger-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 252px;
  padding-top: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  z-index: 200;
}

.nav-has-dropdown:hover .nav-dropdown-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.nav-dd-panel-inner {
  background: var(--deep);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(200,255,0,0.05);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.nav-dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  transition: background 0.12s;
}

/* Needs higher specificity to override .nav-menu a { border-radius: 9999px } */
.nav-has-dropdown .nav-dd-item {
  border-radius: 3px;
}

.nav-dd-item:hover {
  background: var(--surface);
}

.nav-dd-item-icon {
  display: none;
}

.nav-dd-item-icon svg {
  width: 15px;
  height: 15px;
}

.nav-dd-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nav-dd-item-title {
  font-family: var(--font-nav);
  font-size: calc(var(--nav-size, 14px) * 0.92);
  letter-spacing: 0.05em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-dd-item-desc {
  font-family: var(--font-body);
  font-size: 0.71rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Unread bubbles inside dropdown items — inline, not absolute */
.nav-dd-item .nav-unread-bubble {
  position: relative;
  top: -2px;
  right: auto;
  margin-left: 0;
  animation: none;
  box-shadow: 0 0 6px rgba(200,255,0,0.45), 0 0 0 1px var(--deep);
}

/* ============================================================
   NAV — WRITERS DROPDOWN
============================================================ */
.nav-writers-item {
  position: relative;
}

.nav-writers-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 260px;
  padding-top: 10px; /* visual gap, but still part of hover zone */
  background: transparent;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.nav-writers-dropdown.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.writers-dd-inner {
  padding: 1rem;
  background: var(--deep);
  border: 1px solid var(--border-light);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(200,255,0,0.05);
}
.writers-dd-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
}
.writers-dd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.writers-dd-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 6px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.12s;
}
.writers-dd-entry:hover {
  background: var(--surface);
}
.writers-dd-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--glow);
}
.writers-dd-name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
}
.writers-dd-count {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}
.writers-dd-loading,
.writers-dd-empty {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  padding: 4px 8px;
}

/* ============================================================
   WRITERS LIST PAGE
============================================================ */
.writers-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.writers-header {
  margin-bottom: 3rem;
}
.writers-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.writers-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.writers-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.writer-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s var(--ease), background 0.15s;
}
.writer-card:hover {
  border-color: var(--glow);
  background: var(--deep);
}
.writer-card-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100px;
}

.writer-card-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--glow);
  font-weight: 600;
}
.writer-card-info {
  flex: 1;
  min-width: 0;
}
.writer-card-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 2px;
}
.writer-card-stats {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.writer-card-latest {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.writer-card-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-left: 6px;
}
.writer-card-arrow {
  font-family: var(--font-mono);
  color: var(--muted);
  transition: color 0.15s, transform 0.15s;
}
.writer-card:hover .writer-card-arrow {
  color: var(--glow);
  transform: translateX(4px);
}

/* ============================================================
   WRITER PROFILE PAGE
============================================================ */
.writer-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.writer-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.writer-avatar-lg {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--glow);
  font-weight: 600;
}
.writer-avatar-badge {
  background: none;
  border: none;
  width: auto;
  height: auto;
}
.writer-hero-info {
  flex: 1;
  min-width: 0;
}
.writer-hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.1;
  margin-bottom: 0.6rem;
}
.writer-hero-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.writer-meta-dot { color: var(--border-light); }
.writer-back-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-left: auto;
}
.writer-back-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* Tabs */
.writer-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.writer-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.writer-tab.active, .writer-tab:hover {
  color: var(--text-bright);
}
.writer-tab.active {
  border-bottom-color: var(--glow);
  color: var(--glow);
}

/* Tab panels */
.writer-tab-panel { display: none; }
.writer-tab-panel.active { display: block; }

/* Works list */
.writer-works-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.writer-work-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.writer-work-card:hover {
  border-color: var(--glow);
  background: var(--deep);
}
.writer-work-main { flex: 1; min-width: 0; }
.writer-work-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.collection-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.2);
  border-radius: 3px;
  padding: 1px 7px;
  margin-bottom: 6px;
}
.writer-work-excerpt {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.writer-work-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Collections tab */
.writer-collections-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.writer-collection-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
/* ── Collection header row (My Work + Writer page) ─────────── */
.collection-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.collection-rename-btn:hover { color: var(--glow) !important; }
.collection-rename-save:hover { background: rgba(200,255,0,0.08) !important; }

.writer-collection-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.writer-col-rename-btn:hover { opacity: 1 !important; color: var(--glow) !important; }

.writer-collection-header {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.writer-collection-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.writer-collection-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.writer-collection-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.writer-collection-parts {
  display: flex;
  flex-direction: column;
}
.writer-sortable-owner {
  min-height: 60px; /* always hittable even when empty */
}
.writer-collection-part-row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
}
.writer-collection-part-row .writer-collection-part {
  border-top: none;
  flex: 1;
}
.writer-col-delete-btn:hover,
.writer-col-rename-btn:hover,
.writer-move-btn:hover { opacity: 1 !important; color: var(--glow) !important; }

/* ── Drag handles and drop zones ──────────────────────────────── */
.drag-handle {
  color: var(--muted);
  cursor: grab;
  flex-shrink: 0;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}
.drag-handle:hover { opacity: 1; color: var(--glow); }
.sortable-wrap.is-dragging, .writer-draggable.is-dragging { opacity: 0.35; }
.sortable-submissions {
  min-height: 56px; /* stays droppable even after last item is dragged out */
}
#standaloneDropZone .sortable-submissions.drop-target {
  opacity: 1 !important;
  border-color: var(--glow) !important;
  background: rgba(200,255,0,0.03);
}
.sortable-submissions.drop-target,
.writer-sortable-owner.drop-target {
  outline: 2px dashed var(--glow);
  outline-offset: 4px;
  border-radius: 6px;
}
.collection-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 1.5px dashed var(--border-light);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 0.5rem;
  pointer-events: none; /* the list itself handles drop */
}
.sortable-submissions.drop-target .collection-drop-zone,
.writer-sortable-owner.drop-target .collection-drop-zone {
  border-color: var(--glow);
  color: var(--glow);
  opacity: 1;
}

.writer-collection-part {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
}
.writer-collection-part:first-child { border-top: none; }
.writer-collection-part:hover { background: var(--surface); }
.part-num {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--glow);
  width: 1.5rem;
  text-align: right;
}
.part-title {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
}
.part-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}

/* Author byline link */
.author-byline-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.author-byline-link:hover .author-avatar {
  border-color: var(--glow);
  background: var(--glow-dim);
}

/* ============================================================
   ADMIN PANELS
============================================================ */
.admin-page {
  padding: 3rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Edge: <td style="display:flex"> breaks table layout. Use a wrapper div instead. */
.data-table .td-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--surface);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.status-badge.pending {
  background: rgba(255,184,77,0.1);
  border: 1px solid rgba(255,184,77,0.3);
  color: var(--amber);
}

.status-badge.approved {
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.2);
  color: var(--glow);
}

.status-badge.rejected {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2);
  color: #ff6b6b;
}

/* ============================================================
   NOTIFICATIONS / ALERTS
============================================================ */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.notice-info {
  background: rgba(100, 160, 255, 0.08);
  border: 1px solid rgba(100,160,255,0.2);
  color: #82aaff;
}

.notice-success {
  background: var(--glow-dim);
  border: 1px solid rgba(200,255,0,0.2);
  color: var(--glow);
}

.notice-warning {
  background: var(--amber-dim);
  border: 1px solid rgba(255,184,77,0.3);
  color: var(--amber);
}

.notice-error {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2);
  color: #ff6b6b;
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  background: var(--deep);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

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

/* Large screens — give the dashboard content more breathing room */
@media (min-width: 1600px) {
  .dashboard-main { padding: 2.5rem 4rem; }
  .submission-page { padding: 2.5rem 4rem; }
  .header-inner { padding: 0 3rem; }
}

/* Tablets and smaller laptops */
/* ── Toggle Switch (Community Awards feature toggle) ─────────── */
.mff-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}
.mff-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.mff-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  transition: background 0.2s, border-color 0.2s;
}
.mff-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.mff-toggle-switch input:checked + .mff-toggle-slider {
  background: rgba(200,255,0,0.15);
  border-color: rgba(200,255,0,0.4);
}
.mff-toggle-switch input:checked + .mff-toggle-slider::before {
  transform: translateX(20px);
  background: var(--glow);
}


@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    grid-column: 1; /* reset — only one column on mobile */
  }

  /* Sidebar becomes a slide-in drawer on mobile */
  .sidebar {
    position: fixed !important;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    width: var(--mff-sidebar-width, 240px) !important;
    min-width: 220px !important;
    max-width: 280px !important;
    z-index: 90;
    transform: translateX(-110%);
    transition: transform 0.28s var(--ease);
    display: flex !important;
    flex-direction: column;
  }

  .sidebar.drawer-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }

  /* Show hamburger, hide nav-menu items on mobile */
  .hamburger-btn {
    display: flex;
  }

  .nav-menu {
    display: none;
  }

  .dashboard-main {
    padding: 2rem;
  }

  .submission-page {
    padding: 2rem;
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .review-sidebar {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* Phones */
@media (max-width: 640px) {
  .header-inner { padding: 0 1.25rem; }
  .dashboard-main { padding: 1.25rem; }
  .submission-page { padding: 1.25rem; }
  .auth-card { padding: 2rem 1.25rem; }
  .hero-wordmark-mighty, .hero-wordmark-firefly { font-size: 2.8rem; }
  .container { padding: 0 1.25rem; }
  .container--wide { padding: 0 1.25rem; }
  .submissions-grid { gap: 1rem; }
  .submission-card { padding: 1.25rem; }
}

/* ============================================================
   UTILITY
============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-glow { color: var(--glow); }

/* ============================================================
   THEME TOGGLE SWITCH
============================================================ */
.mff-toggle { cursor: pointer; }
.mff-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 999px;
  transition: background 0.25s var(--ease);
}
.mff-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.mff-toggle input:checked + .mff-toggle-slider { background: var(--glow-dim); border: 1px solid var(--glow); }
.mff-toggle input:checked + .mff-toggle-slider::before { transform: translateX(20px); background: var(--glow); }

/* ============================================================
   BADGES
============================================================ */
.mff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
  flex-shrink: 0;
}
.mff-badge svg {
  display: block;
  filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--badge-color, #c8ff00) 30%, transparent));
  transition: filter 0.2s var(--ease), transform 0.2s var(--ease);
}
a .mff-badge:hover svg,
.mff-badge:hover svg {
  filter: drop-shadow(0 4px 16px color-mix(in srgb, var(--badge-color, #c8ff00) 60%, transparent));
  transform: translateY(-2px) scale(1.05);
}

/* ============================================================
   PER-REVIEWER HIGHLIGHT PALETTE
   8 muted slots keyed by data-reviewer-slot attribute
============================================================ */
/* Slot 1 – amber */
.review-highlight[data-reviewer-slot="1"] { background: rgba(255,184,77,0.18); border-bottom-color: #ffb84d; }
.review-highlight[data-reviewer-slot="1"]:hover { background: rgba(255,184,77,0.28); }
/* Slot 2 – sky blue */
.review-highlight[data-reviewer-slot="2"] { background: rgba(100,180,255,0.18); border-bottom-color: #64b4ff; }
.review-highlight[data-reviewer-slot="2"]:hover { background: rgba(100,180,255,0.28); }
/* Slot 3 – rose */
.review-highlight[data-reviewer-slot="3"] { background: rgba(255,120,140,0.18); border-bottom-color: #ff789c; }
.review-highlight[data-reviewer-slot="3"]:hover { background: rgba(255,120,140,0.28); }
/* Slot 4 – mint */
.review-highlight[data-reviewer-slot="4"] { background: rgba(80,220,160,0.18); border-bottom-color: #50dca0; }
.review-highlight[data-reviewer-slot="4"]:hover { background: rgba(80,220,160,0.28); }
/* Slot 5 – lavender */
.review-highlight[data-reviewer-slot="5"] { background: rgba(180,140,255,0.18); border-bottom-color: #b48cff; }
.review-highlight[data-reviewer-slot="5"]:hover { background: rgba(180,140,255,0.28); }
/* Slot 6 – peach */
.review-highlight[data-reviewer-slot="6"] { background: rgba(255,160,80,0.18); border-bottom-color: #ffa050; }
.review-highlight[data-reviewer-slot="6"]:hover { background: rgba(255,160,80,0.28); }
/* Slot 7 – teal */
.review-highlight[data-reviewer-slot="7"] { background: rgba(60,200,200,0.18); border-bottom-color: #3cc8c8; }
.review-highlight[data-reviewer-slot="7"]:hover { background: rgba(60,200,200,0.28); }
/* Slot 8 – gold */
.review-highlight[data-reviewer-slot="8"] { background: rgba(220,190,60,0.18); border-bottom-color: #dcbe3c; }
.review-highlight[data-reviewer-slot="8"]:hover { background: rgba(220,190,60,0.28); }

/* Per-slot: card border, avatar circle, open-state highlight */
/* Slot 1 – amber */
.reviewer-slot-1 { --slot-color: #ffb84d; --slot-dim: rgba(255,184,77,0.15); }
/* Slot 2 – sky blue */
.reviewer-slot-2 { --slot-color: #64b4ff; --slot-dim: rgba(100,180,255,0.15); }
/* Slot 3 – rose */
.reviewer-slot-3 { --slot-color: #ff789c; --slot-dim: rgba(255,120,140,0.15); }
/* Slot 4 – mint */
.reviewer-slot-4 { --slot-color: #50dca0; --slot-dim: rgba(80,220,160,0.15); }
/* Slot 5 – lavender */
.reviewer-slot-5 { --slot-color: #b48cff; --slot-dim: rgba(180,140,255,0.15); }
/* Slot 6 – peach */
.reviewer-slot-6 { --slot-color: #ffa050; --slot-dim: rgba(255,160,80,0.15); }
/* Slot 7 – teal */
.reviewer-slot-7 { --slot-color: #3cc8c8; --slot-dim: rgba(60,200,200,0.15); }
/* Slot 8 – gold */
.reviewer-slot-8 { --slot-color: #dcbe3c; --slot-dim: rgba(220,190,60,0.15); }

/* Card border uses slot color at rest */
.reviewer-slot-1, .reviewer-slot-2, .reviewer-slot-3, .reviewer-slot-4,
.reviewer-slot-5, .reviewer-slot-6, .reviewer-slot-7, .reviewer-slot-8 {
  border-color: var(--slot-dim);
}
/* Stronger border when open */
.reviewer-slot-1.accordion-open, .reviewer-slot-2.accordion-open,
.reviewer-slot-3.accordion-open, .reviewer-slot-4.accordion-open,
.reviewer-slot-5.accordion-open, .reviewer-slot-6.accordion-open,
.reviewer-slot-7.accordion-open, .reviewer-slot-8.accordion-open {
  border-color: var(--slot-color);
}
/* Avatar uses slot color */
.reviewer-slot-1 .accordion-avatar, .reviewer-slot-2 .accordion-avatar,
.reviewer-slot-3 .accordion-avatar, .reviewer-slot-4 .accordion-avatar,
.reviewer-slot-5 .accordion-avatar, .reviewer-slot-6 .accordion-avatar,
.reviewer-slot-7 .accordion-avatar, .reviewer-slot-8 .accordion-avatar {
  background: var(--slot-dim);
  border-color: var(--slot-color);
  color: var(--slot-color);
}

/* ============================================================
   COMMUNITY POSTS
============================================================ */
.community-page { padding: 2rem 2.5rem; }

/* Compose bar */
.community-compose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.community-compose-bar { display:flex; align-items:center; gap:12px; cursor:pointer; }
.community-compose-placeholder {
  flex:1; font-family:var(--font-mono); font-size:0.78rem; color:var(--muted);
  padding:0.5rem; border-radius:var(--radius);
  border:1px solid var(--border); cursor:pointer;
  transition:border-color 0.15s;
}
.community-compose-placeholder:hover { border-color:var(--border-light); }
.community-editor {
  min-height:120px; border:1px solid var(--border); border-radius:var(--radius);
  padding:0.75rem; outline:none; color:var(--text); font-family:var(--font-body);
  font-size:1rem; line-height:1.7; margin-bottom:0.75rem;
  transition:border-color 0.15s;
}
.community-editor:empty::before { content:attr(data-placeholder); color:var(--muted); }
.community-editor:focus { border-color:var(--border-light); }
.community-editor img { max-width:100%; border-radius:var(--radius); margin:0.5rem 0; }

/* Toolbar */
.community-compose-toolbar {
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:8px; border-top:1px solid var(--border); padding-top:0.75rem;
}
.compose-toolbar-left { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.cp-tool-btn {
  background:transparent; border:1px solid transparent; border-radius:4px;
  color:var(--text-dim); font-size:0.8rem; padding:3px 8px; cursor:pointer;
  font-family:var(--font-mono); transition:all 0.12s;
}
.cp-tool-btn:hover { background:var(--surface-2); border-color:var(--border); color:var(--text); }
.cp-tool-sep { width:1px; height:16px; background:var(--border); margin:0 4px; }
.cp-attach-label { cursor:pointer; }
.compose-toolbar-right { display:flex; gap:8px; }

/* Post cards */
.community-feed { display:flex; flex-direction:column; gap:1.25rem; }
.community-post-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:1.25rem 1.5rem;
  transition:border-color 0.15s;
  cursor: pointer;
  user-select: none;
}
.community-post-card:has(.cp-expand-btn[aria-expanded="true"]) { cursor: default; user-select: auto; }
.community-post-card:hover { border-color:var(--border-light); }
.community-post--group-pin { border-color:var(--border); }
.community-post--personal-pin { border-color:var(--muted); }
.community-post--new { border-color:rgba(200,255,0,0.25); }
.community-post--new-comments { border-color:rgba(255,160,80,0.3); }

/* ── Community "New" badge (mirrors submission-new-badge style) ── */
.community-post-card { position: relative; }
.cp-new-badge {
  position: absolute;
  top: -9px;
  right: 14px;
  background: var(--glow);
  color: #05080a;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 3px 12px;
  border-radius: 20px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 2;
}
.cp-new-comments-badge {
  background: #1a0c02;
  color: #ffa050;
  border: 1px solid rgba(255,160,80,0.55);
  right: auto;
  left: 14px;
}

/* Pin banner */
.cp-pin-banner {
  font-family:var(--font-mono); font-size:0.65rem; color:var(--glow);
  letter-spacing:0.05em; margin-bottom:0.75rem; display:flex; align-items:center; gap:6px;
}
.cp-pin-banner--personal { color:var(--muted); }
.cp-pin-icon { font-size:0.75rem; }

.community-post-header {
  display:flex; align-items:center; gap:10px; margin-bottom:0.75rem;
}
.community-post-title {
  font-family:var(--font-display); font-weight:600; font-size:1.35rem;
  color:var(--text-bright); margin-bottom:0.5rem; line-height:1.3;
  letter-spacing: -0.01em;
}
.community-post-body {
  font-family:var(--font-body); font-size:1rem; color:var(--text);
  line-height:1.7; margin-bottom:1rem;
}
.community-post-body img { max-width:100%; border-radius:var(--radius); margin:0.5rem 0; }
.community-post-body ul, .community-post-body ol { padding-left:1.5rem; margin:0.5rem 0; }

/* Attachment chip */
.cp-attachment {
  margin-bottom:1rem;
}
.cp-attachment-link {
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius); padding:6px 12px;
  font-family:var(--font-mono); font-size:0.68rem; color:var(--text-dim);
  text-decoration:none; transition:all 0.15s;
}
.cp-attachment-link:hover { border-color:var(--glow); color:var(--glow); }

/* Action buttons */
.btn-icon-sm {
  background:transparent; border:1px solid transparent; border-radius:4px;
  color:var(--muted); font-size:0.7rem; padding:4px 6px; cursor:pointer;
  font-family:var(--font-mono); transition:all 0.12s;
  display:inline-flex; align-items:center; justify-content:center;
}
.btn-icon-sm:hover { background:var(--surface-2); border-color:var(--border); color:var(--text-dim); }
.btn-icon-sm.active { color:var(--glow); border-color:rgba(200,255,0,0.3); }
/* Pin button: grey tack by default, red when pinned */
.btn-cp-pin .cp-tack-icon { transition: stroke 0.15s, fill 0.15s; }
.btn-cp-pin:hover .cp-tack-icon { stroke: #c8a0a0; }
.btn-cp-pin.cp-pin-active .cp-tack-icon { stroke: #e05555; fill: #e05555; }
/* Group pin is visually larger/heavier */
.btn-cp-pin--group { padding: 5px 7px; }

/* ── MFF sleek tooltip ───────────────────────────────────── */
.mff-tooltip-wrap { position: relative; }
.mff-tooltip {
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  background: #1a1d27;
  color: #c8d0e0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid #2a2d3a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}
.mff-tooltip-wrap:hover .mff-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Comments */
.cp-comments-section { border-top:1px solid var(--border); padding-top:0.75rem; margin-top:0.75rem; }
.cp-comments-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 6px;
}
.cp-comments-body { margin-top:0.75rem; display:none; }
.cp-comment {
  padding:0.6rem 0; border-bottom:1px solid var(--border);
}
.cp-comment:last-of-type { border-bottom:none; }
.cp-comment-header {
  display:flex; align-items:center; gap:8px; margin-bottom:3px;
  font-family:var(--font-mono); font-size:0.65rem; color:var(--muted);
}
.cp-comment-author { color:var(--text-bright); font-size:0.7rem; }
.cp-comment-body { font-family:var(--font-body); font-size:0.9rem; color:var(--text); line-height:1.6; }
.cp-comment-action {
  background:transparent; border:none; cursor:pointer;
  font-family:var(--font-mono); font-size:0.6rem; color:var(--muted); padding:2px 5px;
  border-radius:3px; transition:color 0.12s;
}
.cp-comment-action:hover { color:var(--glow); }
.cp-new-comment {
  display:flex; gap:8px; margin-top:0.75rem; align-items:center;
}
.cp-comment-input {
  flex:1; background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius); padding:7px 12px;
  font-family:var(--font-mono); font-size:0.72rem; color:var(--text);
  outline:none; transition:border-color 0.15s;
}
.cp-comment-input:focus { border-color:var(--border-light); }
.cp-view-all-comments {
  display: block;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 6px 0 2px;
  letter-spacing: 0.04em;
  transition: color 0.12s;
  text-align: left;
}
.cp-view-all-comments:hover { color: var(--text-dim); }

/* ── Community Post Expiry Bar ─────────────────────────────── */
.cp-expiry-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.7;
  margin-bottom: 0.75rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  gap: 8px;
}
.cp-expiry-bar.cp-expiry-urgent {
  color: var(--amber);
  opacity: 1;
  border: none;
  background: none;
}
.cp-expiry-bar strong { color: var(--text-dim); font-weight: 400; }
.cp-expiry-bar.cp-expiry-urgent strong { color: var(--amber); }
.cp-expiry-maxed {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  font-style: italic;
}
.btn-cp-extend {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 1px 7px;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-cp-extend:hover { border-color: var(--glow); color: var(--glow); }
.btn-cp-extend:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   COMMUNITY PAGE HEADER & NEW POST BUTTON
============================================================ */
.community-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.community-page-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2rem;
  color: var(--text-bright);
  margin: 0 0 0.2rem;
  line-height: 1.2;
}
.community-page-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}
.community-new-btn {
  flex-shrink: 0;
  margin-top: 0.4rem;
  text-decoration: none;
  font-size: 0.9rem !important;
  letter-spacing: 0.06em !important;
  padding: 12px 32px !important;
}

/* cp-actions flex */
.cp-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Download label on attachment */
.cp-attachment-dl {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-left: auto;
  padding-left: 10px;
}

/* Comment reply indent */
.cp-comment--reply { margin-left: 2rem; border-left: 2px solid rgba(255,255,255,0.07); padding-left: 0.75rem; }

/* cp-comment-btns */
.cp-comment-btns {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* Comments count/chevron cursor */
.cp-comments-toggle { cursor: pointer; }
.cp-comment-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.cp-comments-chevron {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 6px;
}

/* ============================================================
   COMMUNITY NEW POST PAGE
============================================================ */
.cp-new-page-wrapper {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
}
.cp-new-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.cp-back-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.cp-back-link:hover { color: var(--text); }
.cp-new-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.6rem;
  color: var(--text-bright);
  margin: 0;
}

/* Title input */
.cp-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-bright);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  padding: 0.4rem 0 0.5rem;
  outline: none;
  margin-bottom: 0;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cp-title-input:focus { border-bottom-color: var(--border-light); }
.cp-title-input::placeholder { color: var(--muted); }
.cp-field-block { margin-bottom: 0; }
#cpNewForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* Editor toolbar */
.cp-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 10px;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.tb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.1s;
  padding: 0;
  flex-shrink: 0;
}
.tb-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.tb-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.tb-select {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.tb-select:focus { border-color: var(--border-light); }

/* Editor body */
.cp-editor-body {
  min-height: clamp(320px, calc(100vh - 340px), 1200px);
  flex: 1 1 auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  padding: 1.25rem 1.5rem;
  outline: none;
  word-break: break-word;
  overflow-y: auto;
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
}
.cp-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.cp-editor-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 0.5rem 0;
}
.cp-editor-body blockquote {
  border-left: 3px solid var(--border-light);
  margin: 0.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Bottom bar */
.cp-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.85rem 1.25rem;
}
.cp-attach-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cp-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.cp-attach-btn:hover { border-color: var(--glow); color: var(--glow); }
.cp-attach-status {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--glow);
}
.cp-attach-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}
.cp-submit-zone {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Community post body truncation ───────────────────────── */
.community-post-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.community-post-body.cp-body-collapsed {
  max-height: 180px;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.cp-expand-btn {
  display: block;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 4px 0 8px;
  letter-spacing: 0.05em;
  transition: color 0.12s;
}
.cp-expand-btn:hover { color: var(--text-dim); }

/* ============================================================
   MOBILE NAV OVERLAY
============================================================ */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(4,4,0,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-overlay.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: novFadeIn 0.18s ease;
}
@keyframes novFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
html[data-theme="light"] .nav-overlay {
    background: rgba(240,240,224,0.97);
}
/* Only relevant at mobile; never show on desktop */
@media (min-width: 1025px) { .nav-overlay { display: none !important; } }

.nav-overlay-panel {
    width: min(460px, calc(100vw - 2rem));
    padding: 4.5rem 0 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.nav-overlay-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-overlay-close:hover { background: rgba(255,255,255,0.14); color: var(--text-bright); }
html[data-theme="light"] .nav-overlay-close { background: rgba(0,0,0,0.07); }
html[data-theme="light"] .nav-overlay-close:hover { background: rgba(0,0,0,0.13); }
.nav-overlay-close svg { width: 18px; height: 18px; }

/* ── Overlay search ── */
.nov-search-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nov-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    padding: 13px 16px;
    transition: border-color 0.15s;
}
.nov-search-wrap:focus-within { border-color: rgba(212,224,0,0.4); }
html[data-theme="light"] .nov-search-wrap {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.15);
}
html[data-theme="light"] .nov-search-wrap:focus-within { border-color: rgba(0,80,0,0.35); }
.nov-search-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.nov-search-input {
    flex: 1;
    background: transparent !important;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 1rem;
}
.nov-search-input::placeholder { color: var(--muted); }
.nov-results {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.nov-results:empty { display: none; }
html[data-theme="light"] .nov-results { background: rgba(0,0,0,0.04); }
.nov-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.1s;
}
.nov-result:last-of-type { border-bottom: none; }
.nov-result:hover { background: rgba(255,255,255,0.07); color: var(--text-bright); }
html[data-theme="light"] .nov-result:hover { background: rgba(0,0,0,0.06); }
.nov-result-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nov-result-type {
    font-size: 0.64rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    margin-left: 10px;
}
.nov-result-all {
    display: block;
    padding: 10px 16px;
    color: var(--glow);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.04em;
    transition: background 0.1s;
}
.nov-result-all:hover { background: rgba(212,224,0,0.06); color: var(--glow); }
.nov-empty {
    padding: 12px 16px;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

/* ── Overlay nav links ── */
.nov-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nov-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-nav);
    font-size: 1rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: background 0.14s, color 0.14s;
}
.nov-link:hover { background: rgba(255,255,255,0.07); color: var(--text-bright); }
html[data-theme="light"] .nov-link:hover { background: rgba(0,0,0,0.06); }
.nov-link svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); transition: color 0.14s; }
.nov-link:hover svg { color: var(--text-dim); }
.nov-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--glow);
    color: var(--black);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 4px;
}

/* ============================================================
   NAV SEARCH BAR
============================================================ */
.nav-search-item {
    position: relative;
    display: flex;
    align-items: center;
    align-self: stretch;
    padding: 0;
    flex-shrink: 0;
}
.nav-search-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 0 8px 0 8px;
    gap: 6px;
    height: 30px;
    transition: background 0.15s, border-color 0.15s;
}
.nav-search-wrap:focus-within {
    background: rgba(255,255,255,0.12);
    border-color: rgba(212,224,0,0.4);
}
html[data-theme="light"] .nav-search-wrap {
    background: transparent;
    border-color: rgba(0,0,0,0.2);
}
html[data-theme="light"] .nav-search-wrap:focus-within {
    background: transparent;
    border-color: rgba(0,80,0,0.4);
}
.nav-search-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--muted);
    pointer-events: none;
}
.nav-search-input {
    background: transparent !important;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    width: 150px;
    min-width: 80px;
    padding: 0;
    letter-spacing: 0.01em;
}
.nav-search-input::placeholder { color: var(--muted); }
/* Kill browser autofill white background */
.nav-search-input:-webkit-autofill,
.nav-search-input:-webkit-autofill:hover,
.nav-search-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    box-shadow: 0 0 0px 1000px transparent inset !important;
    background-color: transparent !important;
    -webkit-text-fill-color: var(--text-bright) !important;
    transition: background-color 9999s ease-in-out 0s;
}
.nav-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    z-index: 200;
    overflow: hidden;
}
.nav-search-dropdown.visible { display: block; }
.nav-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-dim);
    transition: background 0.1s;
    cursor: pointer;
}
.nav-search-result:hover,
.nav-search-result.active {
    background: rgba(255,255,255,0.06);
    color: var(--text-bright);
}
html[data-theme="light"] .nav-search-result:hover,
html[data-theme="light"] .nav-search-result.active {
    background: rgba(0,0,0,0.05);
}
.nav-search-result-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--muted);
    display: flex;
    align-items: center;
}
.nav-search-result-icon svg { width: 16px; height: 16px; }
.nav-search-result-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nav-search-result-label {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-search-result-excerpt {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-search-empty {
    padding: 14px 16px;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--muted);
}
.nav-search-all {
    display: block;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: var(--glow);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: background 0.1s;
}
.nav-search-all:hover { background: rgba(212,224,0,0.06); }

/* ============================================================
   SEARCH RESULTS PAGE
============================================================ */
.search-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}
.search-page-header {
    margin-bottom: 2.5rem;
}
.search-page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-bright);
    margin: 0 0 1.5rem;
}
.search-page-form { width: 100%; }
.search-page-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px 0 14px;
    height: 48px;
    transition: border-color 0.15s;
}
.search-page-input-wrap:focus-within { border-color: rgba(212,224,0,0.4); }
.search-page-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--muted);
}
.search-page-input {
    flex: 1;
    background: transparent !important;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 0.95rem;
}
.search-page-input:-webkit-autofill,
.search-page-input:-webkit-autofill:hover,
.search-page-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    box-shadow: 0 0 0px 1000px transparent inset !important;
    background-color: transparent !important;
    -webkit-text-fill-color: var(--text-bright) !important;
    transition: background-color 9999s ease-in-out 0s;
}
.search-page-input::placeholder { color: var(--muted); }
.search-page-submit {
    background: var(--glow-dim);
    border: 1px solid rgba(212,224,0,0.25);
    border-radius: calc(var(--radius) - 2px);
    color: var(--glow);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.search-page-submit:hover { background: rgba(212,224,0,0.15); }
.search-page-summary {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 1rem;
}
.search-page-summary strong { color: var(--text-dim); }
.search-page-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.search-filter-pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-decoration: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.search-filter-pill:hover { color: var(--text-bright); border-color: rgba(255,255,255,0.25); }
.search-filter-pill.active {
    background: var(--glow-dim);
    border-color: rgba(212,224,0,0.3);
    color: var(--glow);
}
.search-filter-count {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border-radius: 9999px;
    padding: 0 5px;
    font-size: 0.6rem;
    vertical-align: middle;
    margin-left: 2px;
}
.search-filter-pill.active .search-filter-count {
    background: rgba(212,224,0,0.2);
}
.search-results-group { margin-bottom: 2.5rem; }
.search-group-heading {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.search-result-item:hover {
    background: var(--surface-2);
    border-color: var(--border);
}
.search-result-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.search-result-type-dot--member     { background: #7eb8f7; }
.search-result-type-dot--collection { background: #f7c87e; }
.search-result-type-dot--manuscript { background: var(--glow); }
.search-result-type-dot--community  { background: #b87ef7; }
.search-result-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.search-result-label {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-excerpt {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.search-result-arrow {
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.12s, color 0.12s;
}
.search-result-item:hover .search-result-arrow {
    color: var(--glow);
    transform: translateX(3px);
}
.search-page-empty {
    padding: 3rem 0;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.9rem;
}
.search-page-empty strong { color: var(--text-dim); }
.search-page-empty-hint {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}
.search-page-hint {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--muted);
}
