:root {
  --navy: #1a3a6b; --navy-dark: #0f2347; --navy-light: #2a5298;
  --cyan: #00b4d8; --cyan-light: #e0f7fc; --cyan-mid: #0096b7;
  --green: #16a34a; --green-lt: #dcfce7;
  --amber: #d97706; --amber-lt: #fef3c7;
  --red: #dc2626; --red-lt: #fee2e2;
  --purple: #7c3aed; --purple-lt: #ede9fe;
  --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
  --gray-400: #94a3b8; --gray-500: #64748b; --gray-600: #475569;
  --gray-700: #334155; --gray-900: #0f172a; --white: #ffffff;
  --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sh: 0 4px 20px rgba(26,58,107,.09);
  --sh-lg: 0 8px 40px rgba(26,58,107,.15);
  --font: 'Sora', sans-serif;
  --prose: 'Lora', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); line-height: 1.75; font-size: 17px; }
a { text-decoration: none; color: inherit; }

/* ── FILTER BAR ── */
.filter-bar { background: var(--white); border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 90; }
.filter-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.filter-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--gray-500); }
.filter-btn { padding: 8px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-600); cursor: pointer; transition: all .2s; font-family: var(--font); }
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.filter-right { display: flex; align-items: center; gap: 10px; }
.sort-select { font-size: 14px; font-weight: 600; color: var(--gray-600); border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 14px; background: var(--white); cursor: pointer; font-family: var(--font); }
.results-count { font-size: 14px; color: var(--gray-500); }
.results-count strong { color: var(--navy); }

/* ── ESSAY LIST LAYOUT ── */
.essays-layout { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.essays-col { min-width: 0; }

/* ── ESSAY CARD ── */
.essay-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh); margin-bottom: 14px; transition: all .22s; display: block; cursor: pointer; }
.essay-card:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--sh-lg); }
.essay-card-inner { padding: 20px 22px; display: flex; gap: 16px; align-items: flex-start; }
.essay-num { font-size: 12px; font-weight: 800; color: var(--gray-300); flex-shrink: 0; width: 26px; text-align: right; margin-top: 2px; }
.essay-main { flex: 1; min-width: 0; }
.essay-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.topic-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--cyan-light); color: var(--cyan-mid); }
.meta-pill { font-size: 11px; color: var(--gray-400); display: flex; align-items: center; gap: 3px; }
.model-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--amber-lt); color: var(--amber); }
.essay-question { font-size: 15px; font-weight: 600; color: var(--gray-800); line-height: 1.72; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.essay-snippet { font-family: var(--prose); font-size: 14.5px; color: var(--gray-500); line-height: 1.78; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.essay-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.essay-scores { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band-chip { font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 8px; display: flex; align-items: center; gap: 4px; }
.band-50 { background: var(--red-lt);    color: #b91c1c; }
.band-60 { background: var(--amber-lt);  color: #92400e; }
.band-65 { background: #fef9c3;          color: #854d0e; }
.band-70 { background: #dcfce7;          color: #15803d; }
.band-75 { background: #dbeafe;          color: #1d4ed8; }
.band-80 { background: #ede9fe;          color: #5b21b6; }
.btn-read { font-size: 14px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1.5px solid var(--navy); border-radius: 6px; transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.essay-card:hover .btn-read { background: var(--navy); color: white; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 0 0; }
.page-btn { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-600); transition: all .2s; font-family: var(--font); user-select: none; }
.page-btn:hover:not(.disabled):not(.ellipsis) { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.page-btn.disabled { opacity: .4; cursor: default; }
.page-btn.ellipsis { border: none; cursor: default; width: auto; padding: 0 6px; color: var(--gray-400); }

/* ── STATE MESSAGES ── */
.state-message { text-align: center; padding: 60px 24px; font-size: 16px; color: var(--gray-500); background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r-lg); }
.state-message.error { color: var(--red); }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .essays-layout { padding: 24px 16px 48px; }
}
