/* ============================================================
   DRUMLINE DESIGNER — Main Stylesheet
   Theme: Warm yellows, dark text, depth & subtle animations
   ============================================================ */

:root {
  --yellow: #FFCC00;
  --yellow-dark: #E6B800;
  --yellow-light: #FFF3B0;
  --yellow-pale: #FFFBE6;
  --yellow-accent: #FFD633;
  --bg: #FFFFFEF7;
  --surface: #FFFDF0;
  --surface-2: #FFF9E0;
  --text-dark: #2D2400;
  --text-medium: #5C4A00;
  --text-subtle: #8A7730;
  --text-muted: #B09A40;
  --border: #E0D48A;
  --border-strong: #CCBB55;
  --error: #D32F2F;
  --error-bg: #FFF0F0;
  --success: #2E7D32;
  --success-bg: #F0FFF2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(45,36,0,0.1), 0 2px 4px rgba(45,36,0,0.06);
  --shadow-lg: 0 12px 32px rgba(45,36,0,0.14), 0 4px 8px rgba(45,36,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --navbar-h: 64px;
  --transition: 0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text-dark); line-height: 1.6; min-height: 100vh; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--yellow-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-dark); }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { color: var(--text-dark); line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--yellow);
  border-bottom: 2px solid var(--yellow-dark);
  box-shadow: 0 2px 12px rgba(45,36,0,0.12);
}

.navbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 16px; height: var(--navbar-h);
}

.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.navbar-logo { width: 36px; height: 36px; border-radius: 8px; }
.navbar-title {
  font-weight: 800; font-size: 1.1rem; color: var(--text-dark);
  letter-spacing: -0.02em; white-space: nowrap;
}
@media (max-width: 600px) { .navbar-title { display: none; } }

.navbar-search {
  flex: 1; max-width: 360px;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(45,36,0,0.15);
  border-radius: 24px;
  overflow: hidden;
  transition: all var(--transition);
}
.navbar-search:focus-within {
  background: white;
  border-color: var(--text-dark);
  box-shadow: 0 0 0 3px rgba(45,36,0,0.1);
}
.navbar-search-input {
  flex: 1; padding: 8px 16px; background: transparent;
  border: none; outline: none; font-size: 0.9rem; color: var(--text-dark);
}
.navbar-search-input::placeholder { color: var(--text-subtle); }
.navbar-search-btn {
  padding: 8px 14px; background: transparent; border: none;
  color: var(--text-medium); display: flex; align-items: center;
}
.navbar-search-btn:hover { color: var(--text-dark); }

.navbar-links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (max-width: 768px) { .navbar-links { display: none; } }

.nav-link {
  padding: 6px 12px; border-radius: 8px;
  color: var(--text-dark); font-weight: 500; font-size: 0.9rem;
  transition: background var(--transition);
}
.nav-link:hover, .nav-link.active { background: rgba(45,36,0,0.1); color: var(--text-dark); }

/* User menu dropdown */
.nav-user-menu { position: relative; }
.nav-avatar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px; border: none;
  background: rgba(45,36,0,0.1); border-radius: 24px;
  transition: background var(--transition);
}
.nav-avatar-btn:hover { background: rgba(45,36,0,0.18); }
.nav-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--text-dark); color: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.nav-chevron { color: var(--text-dark); transition: transform var(--transition); }
.nav-avatar-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  display: none; z-index: 200; overflow: hidden;
}
.nav-dropdown.open { display: block; animation: dropIn 0.15s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.nav-dropdown-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.nav-dropdown-name { display: block; font-weight: 600; color: var(--text-dark); font-size: 0.9rem; }
.nav-dropdown-username { display: block; color: var(--text-subtle); font-size: 0.8rem; }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-dark); font-size: 0.9rem;
  transition: background var(--transition);
}
.nav-dropdown-item:hover { background: var(--yellow-pale); color: var(--text-dark); }
.nav-dropdown-admin { color: var(--yellow-dark); font-weight: 600; }
.nav-dropdown-logout { color: var(--error); }
.nav-dropdown-logout:hover { background: var(--error-bg); }
.nav-dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

.navbar-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 8px; margin-left: auto;
}
.navbar-toggle span { width: 22px; height: 2px; background: var(--text-dark); border-radius: 2px; transition: all 0.3s; }
@media (max-width: 768px) { .navbar-toggle { display: flex; } }

.navbar-mobile {
  display: none; flex-direction: column;
  background: var(--yellow-light); border-top: 1px solid var(--yellow-dark);
  padding: 12px 24px 20px;
}
.navbar-mobile.open { display: flex; }
.mobile-search { display: flex; gap: 8px; margin-bottom: 12px; }
.mobile-search-input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: white; }
.mobile-search-btn { padding: 10px 16px; background: var(--text-dark); color: var(--yellow); border: none; border-radius: var(--radius-sm); font-weight: 600; }
.mobile-nav-link {
  padding: 12px 4px; color: var(--text-dark); font-weight: 500;
  border-bottom: 1px solid rgba(45,36,0,0.08);
}
.mobile-nav-signup { color: var(--yellow-dark); font-weight: 700; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: all var(--transition); white-space: nowrap; line-height: 1;
}
.btn-primary {
  background: var(--yellow); color: var(--text-dark); border-color: var(--yellow);
  box-shadow: 0 2px 6px rgba(230,184,0,0.3);
}
.btn-primary:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); color: var(--text-dark); box-shadow: 0 4px 12px rgba(230,184,0,0.4); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text-dark); border-color: var(--yellow-dark);
}
.btn-outline:hover { background: var(--yellow-pale); color: var(--text-dark); }
.btn-ghost {
  background: transparent; color: var(--text-medium); border-color: transparent;
}
.btn-ghost:hover { background: var(--yellow-pale); color: var(--text-dark); border-color: var(--border); }
.btn-danger { background: var(--error); color: white; border-color: var(--error); }
.btn-danger:hover { background: #b71c1c; color: white; }
.btn-download {
  background: var(--surface); color: var(--text-dark); border-color: var(--border);
  width: 100%; justify-content: flex-start;
}
.btn-download:hover { background: var(--yellow-pale); border-color: var(--yellow-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-xs { padding: 4px 10px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ================================================================
   FLASH MESSAGES
   ================================================================ */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; margin: 16px auto; max-width: 1200px;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  border: 1.5px solid transparent; position: relative;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: #a5d6a7; }
.flash-error { background: var(--error-bg); color: var(--error); border-color: #ef9a9a; }
.flash-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.2rem; cursor: pointer; opacity: 0.6; color: inherit; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--text-medium); }
.form-label-link { float: right; font-weight: 400; color: var(--yellow-dark); font-size: 0.85rem; }
.form-hint { font-size: 0.8rem; color: var(--text-subtle); }
.form-optional { font-weight: 400; color: var(--text-subtle); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-input {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-dark); font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus {
  outline: none; border-color: var(--yellow-dark);
  box-shadow: 0 0 0 3px rgba(230,184,0,0.2);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-input-lg { font-size: 1.1rem; padding: 12px 16px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C4A00' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-file-input { padding: 8px; }

.form-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-sm); }

.form-checkbox-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 0.9rem; color: var(--text-medium);
}
.form-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--yellow-dark); }

.input-password-wrap { position: relative; }
.input-password-wrap .form-input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-subtle); padding: 0;
}
.toggle-password:hover { color: var(--text-dark); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; margin-bottom: 12px; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #ef9a9a; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #a5d6a7; }

/* Char counter */
.char-counter { font-size: 0.78rem; color: var(--text-subtle); }

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  position: relative; min-height: 65vh; max-height: 780px; display: flex; align-items: center;
  overflow: hidden;
}
@media (max-width: 768px) { .hero { min-height: 55vh; } }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform 0.5s ease;
}
.hero-bg-default {
  background: linear-gradient(135deg, #2D2400 0%, #5C4A00 40%, #E6B800 100%);
}
.hero::after { content: ''; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(45,36,0,0.65) 0%, rgba(45,36,0,0.45) 50%, rgba(45,36,0,0.7) 100%);
}
.hero-content {
  position: relative; z-index: 2; text-align: center;
  padding: 80px 24px 120px; width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.hero-title {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: clamp(2.8rem, 8vw, 6rem); font-weight: 700;
  color: var(--yellow); letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  margin-bottom: 16px;
  animation: heroFadeUp 0.8s ease forwards;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.4rem); color: rgba(255,243,176,0.9);
  max-width: 520px; margin-bottom: 40px;
  animation: heroFadeUp 0.8s 0.15s ease both;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Store badges */
.store-badges {
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
  animation: heroFadeUp 0.8s 0.3s ease both;
}
.store-badge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.store-badge-link { opacity: 1; transition: opacity var(--transition), transform var(--transition); }
.store-badge-link:hover { opacity: 0.9; transform: translateY(-2px); }
.store-badge-img { height: 52px; width: auto; }
.store-badge-disabled { filter: grayscale(1) opacity(0.5); }
.store-badge-coming { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.coming-soon-label { font-size: 0.75rem; color: rgba(255,243,176,0.7); font-style: italic; }

.hero-scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: rgba(255,243,176,0.6); animation: bounce 2s ease infinite;
}
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ================================================================
   SECTION STYLES
   ================================================================ */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); }

.section-header { margin-bottom: 32px; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--text-dark); }
.section-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 8px;
}
.badge-gold {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  color: var(--text-dark); box-shadow: 0 2px 8px rgba(230,184,0,0.3);
}
.section-footer { margin-top: 32px; text-align: center; }

/* ================================================================
   PIECE CARDS
   ================================================================ */
.piece-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.piece-grid-featured { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.piece-grid-browse { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.piece-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.piece-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--yellow-dark); }

.piece-card-visual { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--yellow-pale); }
.piece-card-thumb { width: 100%; height: 100%; }
.piece-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.piece-card:hover .piece-card-thumb img { transform: scale(1.04); }
.piece-card-no-preview {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-subtle);
}
.badge-editors-choice-small {
  position: absolute; top: 8px; right: 8px;
  background: var(--yellow); color: var(--text-dark);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.piece-card-info { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.piece-card-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.piece-card-composer { font-size: 0.82rem; color: var(--text-medium); }
.piece-card-uploader { font-size: 0.78rem; color: var(--text-subtle); }
.piece-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.piece-card-instruments { font-size: 0.75rem; color: var(--text-medium); background: var(--yellow-pale); padding: 2px 8px; border-radius: 20px; }
.piece-card-rating { display: flex; align-items: center; gap: 2px; }
.star { color: var(--border-strong); font-size: 0.75rem; }
.star-filled { color: var(--yellow-dark); }
.piece-card-rating-count { font-size: 0.7rem; color: var(--text-subtle); margin-left: 2px; }
.piece-card-stats { display: flex; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.piece-card-stats span { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-subtle); }

/* ================================================================
   BLOG CARDS
   ================================================================ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.blog-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.blog-card-hero { aspect-ratio: 16/9; overflow: hidden; }
.blog-card-hero img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.blog-card:hover .blog-card-hero img { transform: scale(1.04); }
.blog-card-hero-placeholder { background: linear-gradient(135deg, var(--yellow-pale), var(--yellow-light)); }
.blog-card-body { padding: 16px; }
.blog-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.blog-card-meta { font-size: 0.8rem; color: var(--text-subtle); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-page { background: linear-gradient(135deg, var(--text-dark) 0%, #4A3C00 100%); }
.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-container { width: 100%; max-width: 440px; }
.auth-container-wide { max-width: 560px; }
.auth-logo-link { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.auth-title { text-align: center; color: var(--yellow); font-size: 1.8rem; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--yellow-light); opacity: 0.8; margin-bottom: 28px; font-size: 0.95rem; }
.auth-form {
  background: rgba(255,255,255,0.97); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-switch { text-align: center; color: var(--yellow-light); margin-top: 16px; font-size: 0.9rem; }
.auth-switch a { color: var(--yellow); font-weight: 600; }
.auth-legal { font-size: 0.78rem; color: var(--text-subtle); line-height: 1.5; }
.auth-legal a { color: var(--yellow-dark); }

/* ================================================================
   SETUP PAGE
   ================================================================ */
.setup-page { background: linear-gradient(135deg, #1a1500 0%, #3D3000 100%); }
.setup-header { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 24px; }
.setup-step-indicator { display: flex; align-items: center; gap: 8px; }
.setup-step {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,243,176,0.3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: rgba(255,243,176,0.5);
  transition: all var(--transition);
}
.setup-step.active { background: var(--yellow); border-color: var(--yellow); color: var(--text-dark); }
.setup-step.done { background: var(--yellow-dark); border-color: var(--yellow-dark); color: white; }
.setup-step-line { width: 40px; height: 2px; background: rgba(255,243,176,0.2); }

/* ================================================================
   PAGE MAIN (Static pages)
   ================================================================ */
.page-main { padding: 60px 0; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 8px; }
.page-subtitle { color: var(--text-medium); margin-bottom: 32px; font-size: 1.05rem; }

.prose-page {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 600px) { .prose-page { padding: 20px; } }

/* prose-bare: same typography but no card background */
.prose-bare { }

.prose-page h1, .prose-bare h1 { font-size: 2rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--yellow-light); }
.prose-page h2, .prose-bare h2 { font-size: 1.4rem; margin: 32px 0 12px; color: var(--text-dark); }
.prose-page h3, .prose-bare h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.prose-page p, .prose-bare p { color: var(--text-medium); line-height: 1.8; margin-bottom: 16px; }
.prose-page ul, .prose-bare ul, .prose-page ol, .prose-bare ol { padding-left: 24px; margin-bottom: 16px; }
.prose-page li, .prose-bare li { color: var(--text-medium); margin-bottom: 6px; line-height: 1.7; }
.prose-page a, .prose-bare a { color: var(--yellow-dark); border-bottom: 1px solid transparent; }
.prose-page a:hover, .prose-bare a:hover { border-bottom-color: var(--yellow-dark); }
.prose-page strong, .prose-bare strong { color: var(--text-dark); }
.prose-page em, .prose-bare em { color: var(--text-medium); }
.prose-page blockquote, .prose-bare blockquote { border-left: 4px solid var(--yellow); padding-left: 16px; margin: 16px 0; color: var(--text-subtle); font-style: italic; }
.prose-page code, .prose-bare code { background: var(--yellow-pale); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.prose-page pre, .prose-bare pre { background: var(--text-dark); color: var(--yellow-light); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; margin: 16px 0; }
.prose-page img, .prose-bare img { border-radius: var(--radius-sm); margin: 16px 0; box-shadow: var(--shadow); }

/* ================================================================
   BROWSE PAGE
   ================================================================ */
.browse-main { padding: 40px 0; }
.browse-header { margin-bottom: 40px; }
.browse-title { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 20px; }
.browse-filters { display: flex; flex-direction: column; gap: 16px; }
.filter-search-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-search-wrap {
  position: relative; flex: 1; min-width: 240px;
}
.filter-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.filter-search-input {
  width: 100%; padding: 11px 16px 11px 44px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 0.95rem; color: var(--text-dark);
}
.filter-search-input:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(230,184,0,0.2); }
.filter-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 0.82rem; font-weight: 600; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-select {
  padding: 9px 40px 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 0.9rem;
  color: var(--text-dark); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C4A00' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}
.filter-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-checkbox-label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1.5px solid var(--border);
  border-radius: 20px; cursor: pointer; font-size: 0.85rem;
  color: var(--text-medium); background: var(--surface);
  transition: all var(--transition);
}
.filter-checkbox-label:has(input:checked) { background: var(--yellow-light); border-color: var(--yellow-dark); color: var(--text-dark); }
.filter-checkbox-label input { display: none; }
.filter-checkbox-custom { display: none; }

.browse-section { margin-bottom: 48px; }
.browse-section-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.browse-section-title { font-size: 1.4rem; color: var(--text-dark); }

/* User results */
.user-results { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.user-result-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); text-decoration: none; transition: all var(--transition);
}
.user-result-card:hover { border-color: var(--yellow-dark); background: var(--yellow-pale); }
.user-result-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.user-result-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--yellow); color: var(--text-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.user-result-name { display: block; font-weight: 600; color: var(--text-dark); font-size: 0.9rem; }
.user-result-username { display: block; font-size: 0.8rem; color: var(--text-subtle); }

/* ================================================================
   PIECE DETAIL PAGE
   ================================================================ */
.piece-main { padding-top: 24px; }
.piece-layout {
  display: grid; grid-template-columns: 380px 1fr;
  gap: 32px; max-width: 1400px; margin: 0 auto; padding: 0 24px;
  align-items: start;
}
@media (max-width: 960px) { .piece-layout { grid-template-columns: 1fr; } }

.piece-info-panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 28px; position: sticky; top: 80px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 960px) { .piece-info-panel { position: static; order: 2; } }

.piece-title { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 16px; color: var(--text-dark); }

.piece-uploader {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.piece-uploader-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.piece-uploader-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--yellow); color: var(--text-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
}
.piece-uploader-label { display: block; font-size: 0.75rem; color: var(--text-subtle); }
.piece-uploader-name { font-weight: 600; color: var(--text-dark); font-size: 0.9rem; }

.piece-meta-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.piece-meta-item { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.piece-meta-label { color: var(--text-subtle); font-weight: 500; min-width: 80px; display: flex; align-items: center; gap: 6px; }
.piece-description { font-size: 0.9rem; color: var(--text-medium); line-height: 1.7; padding: 12px; background: var(--yellow-pale); border-radius: var(--radius-sm); margin-bottom: 16px; }

/* Difficulty badges */
.difficulty-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.difficulty-1 { background: #E8F5E9; color: #2E7D32; }
.difficulty-2 { background: #F1F8E9; color: #558B2F; }
.difficulty-3 { background: var(--yellow-pale); color: var(--text-dark); }
.difficulty-4 { background: #FFF3E0; color: #E65100; }
.difficulty-5 { background: #FCE4EC; color: #B71C1C; }

/* Rating */
.piece-rating-section { padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.rating-display { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.star-rating { display: flex; gap: 4px; }
.star-btn {
  font-size: 1.4rem; background: none; border: none; color: var(--border-strong);
  transition: color var(--transition), transform var(--transition);
  padding: 2px; line-height: 1;
}
.star-btn:hover, .star-btn.filled { color: var(--yellow-dark); }
.star-btn:hover { transform: scale(1.2); }
.rating-text { font-size: 0.85rem; color: var(--text-medium); }
.rating-text strong { font-size: 1.1rem; color: var(--text-dark); }
.rating-login-hint, .rating-yours { font-size: 0.8rem; color: var(--text-subtle); margin-top: 6px; }
.rating-login-hint a { color: var(--yellow-dark); }

/* Downloads */
.piece-downloads { margin-top: 16px; }
.downloads-title { font-size: 0.9rem; font-weight: 600; color: var(--text-medium); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.download-buttons { display: flex; flex-direction: column; gap: 8px; }
.piece-downloads-locked { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--yellow-pale); border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-medium); margin-top: 16px; }
.piece-downloads-locked a { color: var(--yellow-dark); font-weight: 600; }

/* Player panel */
.piece-player-panel { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 960px) { .piece-player-panel { order: 1; } }

.player-container {
  background: var(--text-dark); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}

.sheet-viewer { position: relative; background: #1a1500; }
.sheet-pages { overflow: hidden; }
.sheet-page { position: relative; display: none; }
.sheet-page.active { display: block; }
.sheet-page img { width: 100%; }
.playhead-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sheet-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 10px; background: rgba(0,0,0,0.5);
}
.sheet-nav-btn {
  background: rgba(255,204,0,0.1); border: 1px solid rgba(255,204,0,0.2);
  color: var(--yellow-light); border-radius: 8px; padding: 6px;
  transition: background var(--transition);
}
.sheet-nav-btn:hover { background: rgba(255,204,0,0.2); }
.sheet-page-indicator { color: var(--yellow-light); font-size: 0.85rem; font-weight: 500; }
.sheet-placeholder { padding: 60px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: rgba(255,243,176,0.4); font-size: 0.9rem; }

/* Audio player */
.audio-player {
  padding: 16px 20px;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
}
.player-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.player-btn {
  background: none; border: none; color: var(--yellow); padding: 8px;
  border-radius: 50%; transition: background var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.player-btn:hover { background: rgba(255,204,0,0.15); transform: scale(1.1); }
.player-play { background: rgba(255,204,0,0.15); width: 48px; height: 48px; }
.player-play:hover { background: rgba(255,204,0,0.3); }

.player-timeline { display: flex; align-items: center; gap: 10px; }
.player-time { font-size: 0.78rem; font-weight: 600; color: var(--yellow-light); min-width: 36px; font-variant-numeric: tabular-nums; }
.timeline-bar { flex: 1; height: 4px; background: rgba(255,243,176,0.2); border-radius: 2px; position: relative; cursor: pointer; }
.timeline-bar:hover .timeline-thumb { opacity: 1; }
.timeline-progress { height: 100%; background: var(--yellow); border-radius: 2px; pointer-events: none; transition: width 0.1s linear; }
.timeline-thumb {
  position: absolute; top: 50%; right: 0; width: 12px; height: 12px;
  background: var(--yellow); border-radius: 50%;
  transform: translate(50%, -50%); opacity: 0; transition: opacity var(--transition);
  pointer-events: none;
}

.player-volume { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.player-volume svg { color: var(--yellow-light); flex-shrink: 0; }
.volume-slider {
  flex: 1; max-width: 100px; accent-color: var(--yellow);
  appearance: none; height: 3px; background: rgba(255,243,176,0.2);
  border-radius: 2px; outline: none; cursor: pointer;
}

/* Engagement row */
.piece-engagement {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.editors-choice-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  color: var(--text-dark); padding: 6px 14px; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700; width: fit-content;
  box-shadow: 0 2px 8px rgba(230,184,0,0.35);
}
.engagement-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.like-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1.5px solid var(--border); border-radius: 24px;
  padding: 8px 16px; color: var(--text-medium); font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition);
}
.like-btn:hover, .like-btn.liked { background: #FDE8E8; border-color: #E91E63; color: #E91E63; }
.like-btn.liked svg { fill: #E91E63; stroke: #E91E63; }
.engage-views { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-subtle); }
.share-buttons { display: flex; gap: 8px; margin-left: auto; }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: none; transition: all var(--transition); text-decoration: none;
}
.share-facebook { background: #1877F2; color: white; }
.share-facebook:hover { background: #1565C0; }
.share-x { background: #000; color: white; }
.share-x:hover { background: #333; }
.share-reddit { background: #FF4500; color: white; }
.share-reddit:hover { background: #dd3c00; }
.share-copy { background: var(--surface); border: 1.5px solid var(--border); color: var(--text-medium); }
.share-copy:hover { background: var(--yellow-pale); border-color: var(--yellow-dark); }

/* Comments */
.comments-section { padding: 40px 0; }
.comments-title { font-size: 1.4rem; margin-bottom: 24px; }
.comments-login-hint { color: var(--text-subtle); font-size: 0.9rem; margin-bottom: 16px; }
.comments-login-hint a { color: var(--yellow-dark); font-weight: 600; }
.no-comments { color: var(--text-subtle); font-style: italic; text-align: center; padding: 24px 0; }

.comment-form { display: flex; gap: 12px; margin-bottom: 32px; }
.comment-form-inner { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.comment-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  font-size: 0.9rem; color: var(--text-dark); resize: vertical; min-height: 80px;
}
.comment-textarea:focus { outline: none; border-color: var(--yellow-dark); box-shadow: 0 0 0 3px rgba(230,184,0,0.2); }
.comment-textarea-sm { min-height: 60px; }
.comment-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar-sm { width: 28px; height: 28px; }
.comment-avatar-placeholder { background: var(--yellow); color: var(--text-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.comment-avatar-deleted { background: var(--border); color: var(--text-subtle); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.comment-meta { display: flex; flex-direction: column; gap: 2px; }
.comment-username { font-weight: 600; color: var(--text-dark); font-size: 0.88rem; }
.comment-username.comment-deleted { color: var(--text-subtle); font-style: italic; }
.comment-time { font-size: 0.75rem; color: var(--text-subtle); }
.comment-text { font-size: 0.9rem; color: var(--text-medium); line-height: 1.6; }
.comment-deleted-text { color: var(--text-muted); font-style: italic; }
.comment-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.comment-like-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-subtle); font-size: 0.8rem; padding: 0;
  transition: color var(--transition);
}
.comment-like-btn:hover, .comment-like-btn.liked { color: #E91E63; }
.comment-like-btn.liked svg { fill: #E91E63; stroke: #E91E63; }
.comment-action-btn { background: none; border: none; font-size: 0.8rem; color: var(--text-subtle); padding: 0; transition: color var(--transition); }
.comment-action-btn:hover { color: var(--text-dark); }
.report-btn:hover { color: var(--error); }
.delete-btn:hover { color: var(--error); }
.reply-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.replies { margin-left: 40px; margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--yellow-light); }
.inline-form { display: inline; }

/* ================================================================
   USER PROFILE
   ================================================================ */
.profile-main { padding: 48px 0; }
.profile-header { display: flex; align-items: flex-start; gap: 28px; margin-bottom: 48px; padding-bottom: 32px; border-bottom: 2px solid var(--yellow-light); flex-wrap: wrap; }
.profile-avatar-lg { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--yellow); box-shadow: var(--shadow); }
.profile-avatar-placeholder { background: var(--yellow); color: var(--text-dark); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; }
.profile-name { font-size: 1.8rem; margin-bottom: 4px; }
.profile-username { color: var(--text-subtle); font-size: 1rem; margin-bottom: 8px; }
.profile-bio { color: var(--text-medium); font-size: 0.95rem; line-height: 1.6; max-width: 500px; margin-bottom: 8px; }
.profile-joined { font-size: 0.82rem; color: var(--text-subtle); margin-bottom: 12px; }
.profile-section-title { font-size: 1.3rem; margin-bottom: 20px; }

/* ================================================================
   SETTINGS PAGE
   ================================================================ */
.settings-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.settings-section-title { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.settings-desc { font-size: 0.88rem; color: var(--text-medium); margin-bottom: 16px; line-height: 1.5; }
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-restriction { font-size: 0.85rem; color: var(--error); background: var(--error-bg); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.settings-badge-pending { display: inline-block; padding: 2px 8px; background: #FFF3CD; color: #856404; border-radius: 20px; font-size: 0.75rem; }

.settings-avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.settings-avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.settings-avatar-placeholder { background: var(--yellow); color: var(--text-dark); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; }
.settings-avatar-form { display: flex; flex-direction: column; gap: 8px; }
.settings-avatar-actions { display: flex; flex-direction: column; gap: 8px; }

/* ================================================================
   ADMIN PAGES
   ================================================================ */
.admin-main { padding: 32px 0; }
.admin-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.admin-title { font-size: 1.8rem; }
.admin-subtitle { color: var(--text-medium); }
.admin-back { color: var(--text-subtle); font-size: 0.88rem; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.admin-back:hover { color: var(--text-dark); }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm);
}
.stat-card-warning { border-color: #F59E0B; background: #FFFBEB; }
.stat-icon { color: var(--yellow-dark); }
.stat-number { display: block; font-size: 1.8rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-label { display: block; font-size: 0.78rem; color: var(--text-subtle); margin-top: 2px; }

.admin-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 40px; }
.admin-nav-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text-dark); text-align: center;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.admin-nav-card:hover { border-color: var(--yellow-dark); background: var(--yellow-pale); color: var(--text-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-nav-card svg { color: var(--yellow-dark); }
.admin-nav-card span { font-size: 0.88rem; font-weight: 600; }
.admin-nav-card-warning { border-color: #F59E0B; background: #FFFBEB; }

.admin-section-title { font-size: 1.1rem; margin-bottom: 16px; }
.admin-recent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .admin-recent-grid { grid-template-columns: 1fr; } }

.admin-table-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); padding: 0; margin-bottom: 24px; }
.admin-table-card > .btn { margin: 12px 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { padding: 12px 16px; text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.05em; background: var(--yellow-pale); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-medium); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--yellow-pale); }
.admin-table a { color: var(--yellow-dark); font-weight: 500; }
.admin-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-inactive { opacity: 0.55; }
.row-flagged td { background: rgba(245,158,11,0.06); }
.comment-cell { max-width: 280px; }

.role-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.role-admin { background: var(--yellow-light); color: var(--text-dark); }
.role-user { background: var(--surface-2); color: var(--text-medium); }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-active, .status-published { background: #E8F5E9; color: #2E7D32; }
.status-inactive, .status-draft { background: #F5F5F5; color: #757575; }
.badge-reports { background: #FFF3E0; color: #E65100; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-recommended { background: #E3F2FD; color: #1565C0; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

.admin-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
@media (max-width: 800px) { .admin-settings-grid { grid-template-columns: 1fr; } }
.admin-footer-links { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-preview-img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 8px; max-height: 200px; object-fit: cover; }
.hero-preview-label { font-size: 0.8rem; color: var(--text-subtle); margin-bottom: 16px; }
.hero-upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .hero-upload-options { grid-template-columns: 1fr; } }
.hero-upload-tab h3 { font-size: 0.9rem; margin-bottom: 12px; color: var(--text-medium); }

/* Gallery */
.gallery-upload-form { display: flex; flex-direction: column; gap: 12px; }
.gallery-upload-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--yellow-pale);
}
.gallery-upload-drop:hover { border-color: var(--yellow-dark); background: var(--yellow-light); }
.gallery-upload-drop p { color: var(--text-medium); font-size: 0.9rem; margin-top: 8px; }
.gallery-upload-drop input[type="file"] { display: none; }
.upload-link { color: var(--yellow-dark); font-weight: 600; cursor: pointer; }

.admin-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 24px; }
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: var(--yellow-pale); }
.gallery-item-img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  opacity: 0; transition: opacity var(--transition);
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-name { font-size: 0.7rem; color: white; text-align: center; padding: 0 8px; }
.gallery-badge-processed { background: var(--yellow); color: var(--text-dark); font-size: 0.65rem; padding: 2px 6px; border-radius: 20px; font-weight: 700; }
.gallery-copy-btn, .gallery-delete-btn {
  background: rgba(255,255,255,0.2); border: none; color: white;
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.gallery-copy-btn:hover { background: rgba(255,255,255,0.4); }
.gallery-delete-btn:hover { background: rgba(220,0,0,0.6); }

/* Blog edit */
.blog-edit-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .blog-edit-layout { grid-template-columns: 1fr; } }
.blog-edit-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }

/* Gallery Modal */
.gallery-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gallery-modal-inner {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 800px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
.gallery-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.gallery-modal-header h3 { font-size: 1.1rem; }
.gallery-modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-subtle); padding: 4px; }
.gallery-modal-close:hover { color: var(--text-dark); }
.gallery-modal-upload { padding: 12px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.gallery-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 16px; overflow-y: auto; flex: 1; }
.gallery-modal-item { border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: all var(--transition); }
.gallery-modal-item:hover { border-color: var(--yellow-dark); transform: scale(1.03); }
.gallery-modal-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* User cell */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-cell-avatar-placeholder { background: var(--yellow); color: var(--text-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.78rem; }
.user-cell-name { display: block; font-weight: 500; color: var(--text-dark); }
.user-cell small { display: block; color: var(--text-subtle); font-size: 0.75rem; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  background: var(--text-dark);
  color: var(--yellow-light); margin-top: 80px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 60px 24px 40px;
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 48px; align-items: start;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr; gap: 32px; } }

.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { width: 48px; height: 48px; border-radius: 12px; }
.footer-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--yellow); }
.footer-tagline { font-size: 0.85rem; color: rgba(255,243,176,0.6); line-height: 1.5; }

.footer-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 640px) { .footer-links-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--yellow); font-weight: 700; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 0.85rem; color: rgba(255,243,176,0.6); padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--yellow); }

.footer-newsletter h4 { font-size: 0.9rem; color: var(--yellow); font-weight: 700; margin-bottom: 12px; }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-input { flex: 1; min-width: 200px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid rgba(255,243,176,0.2); background: rgba(255,255,255,0.05); color: var(--yellow-light); font-size: 0.88rem; }
.newsletter-input::placeholder { color: rgba(255,243,176,0.4); }
.newsletter-input:focus { outline: none; border-color: var(--yellow); }

.footer-bottom {
  border-top: 1px solid rgba(255,243,176,0.1); padding: 20px 24px;
  text-align: center; font-size: 0.78rem; color: rgba(255,243,176,0.4);
  max-width: 1200px; margin: 0 auto;
}

/* ================================================================
   ERROR PAGES
   ================================================================ */
.error-main { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.error-content { text-align: center; max-width: 500px; }
.error-number { font-size: clamp(5rem, 15vw, 9rem); font-weight: 900; color: var(--yellow); line-height: 1; letter-spacing: -0.05em; text-shadow: 0 4px 20px rgba(255,204,0,0.3); }
.error-title { font-size: 1.6rem; margin-bottom: 12px; }
.error-desc { color: var(--text-medium); margin-bottom: 28px; font-size: 1rem; line-height: 1.6; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================================================================
   BLOG PAGES
   ================================================================ */
.blog-page-header { margin-bottom: 40px; }
.blog-list { display: flex; flex-direction: column; gap: 24px; }
.blog-list-item {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.blog-list-item:hover { border-color: var(--yellow-dark); box-shadow: var(--shadow); transform: translateX(4px); }
@media (max-width: 640px) { .blog-list-item { grid-template-columns: 1fr; } }
.blog-list-hero { overflow: hidden; }
.blog-list-hero img { width: 100%; height: 100%; object-fit: cover; min-height: 180px; transition: transform 0.3s; }
.blog-list-item:hover .blog-list-hero img { transform: scale(1.04); }
.blog-list-hero-placeholder { background: linear-gradient(135deg, var(--yellow-pale), var(--yellow-light)); min-height: 180px; }
.blog-list-body { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.blog-list-title { font-size: 1.3rem; color: var(--text-dark); margin-bottom: 8px; }
.blog-list-meta { font-size: 0.82rem; color: var(--text-subtle); display: flex; align-items: center; gap: 6px; }

/* ================================================================
   BLOG POST PAGE
   ================================================================ */
.blog-post-main { padding: 0 0 80px; }

/* Hero banner */
.blog-post-hero {
  position: relative; height: 52vh; min-height: 320px; max-height: 540px; overflow: hidden;
}
.blog-post-hero img { width: 100%; height: 100%; object-fit: cover; }
.blog-post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(45,36,0,0.3) 0%, rgba(255,254,247,1) 100%);
}
.blog-post-hero-title-wrap {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 0 0;
}

/* No-hero header */
.blog-post-noHero-header {
  background: linear-gradient(135deg, var(--yellow-pale) 0%, var(--surface) 100%);
  border-bottom: 2px solid var(--yellow-light);
  padding: 56px 0 40px;
}

/* Article area */
.blog-post-body {
  max-width: 780px; margin: 0 auto; padding: 0 24px;
}
.blog-post-title-area { padding: 40px 0 20px; }
.blog-post-title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.2;
  color: var(--text-dark); margin-bottom: 14px;
}
.blog-post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  color: var(--text-subtle); font-size: 0.88rem;
}
.blog-post-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.blog-post-content {
  padding: 8px 0 32px; line-height: 1.85;
  font-size: 1.05rem;
}
.blog-post-divider {
  border: none; border-top: 1.5px solid var(--border); margin: 40px 0 0;
}

/* Engagement strip */
.blog-engagement {
  max-width: 780px; margin: 0 auto; padding: 24px 24px 0;
}
.blog-engagement-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Recent posts strip below article */
.blog-post-recent {
  background: var(--surface-2); border-top: 1.5px solid var(--border); padding: 48px 0;
  margin-top: 64px;
}
.blog-post-recent-title {
  font-size: 1.2rem; margin-bottom: 24px; color: var(--text-dark);
}
.blog-post-recent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}

/* Sidebar retained for future use but hidden in post view */
.sidebar-widget { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; position: sticky; top: 80px; box-shadow: var(--shadow-sm); }
.sidebar-title { font-size: 1rem; margin-bottom: 16px; color: var(--text-dark); }
.sidebar-post-list { display: flex; flex-direction: column; gap: 16px; list-style: none; padding: 0; }
.sidebar-post-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-dark); font-size: 0.88rem; font-weight: 500; }
.sidebar-post-link:hover { color: var(--yellow-dark); }
.sidebar-post-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sidebar-post-date { display: block; font-size: 0.75rem; color: var(--text-subtle); margin-top: 2px; }

/* ================================================================
   GALLERY PICKER MODAL (admin settings)
   ================================================================ */
.gallery-hero-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px;
  max-height: 320px; overflow-y: auto; margin-top: 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px;
  background: var(--bg);
}
.gallery-hero-picker-item {
  position: relative; cursor: pointer; border-radius: 6px; overflow: hidden;
  aspect-ratio: 1; border: 2.5px solid transparent; transition: border-color var(--transition), transform var(--transition);
}
.gallery-hero-picker-item:hover { border-color: var(--yellow-dark); transform: scale(1.02); }
.gallery-hero-picker-item.selected { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,204,0,0.35); }
.gallery-hero-picker-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-hero-picker-item .gallery-item-check {
  display: none; position: absolute; top: 4px; right: 4px;
  background: var(--yellow); border-radius: 50%; width: 20px; height: 20px;
  align-items: center; justify-content: center;
}
.gallery-hero-picker-item.selected .gallery-item-check { display: flex; }
.gallery-picker-empty { text-align: center; color: var(--text-subtle); font-size: 0.88rem; padding: 20px; }
.gallery-picker-name { font-size: 0.7rem; color: var(--text-subtle); text-align: center; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 24px; text-align: center; }
.empty-state h2, .empty-state h3 { color: var(--text-dark); }
.empty-state p { color: var(--text-subtle); max-width: 400px; }
.empty-icon { color: var(--text-subtle); opacity: 0.3; }
.section-empty { padding: 80px 0; }

/* ================================================================
   RESPONSIVE TWEAKS
   ================================================================ */
@media (max-width: 480px) {
  .piece-grid, .piece-grid-browse { grid-template-columns: 1fr 1fr; gap: 12px; }
  .blog-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 60px 20px 80px; }
}
