/* ═══════════════════════════════════════════════
   Dream Team Reads — Unified Stylesheet
   Dashboard (index.html) + Input form (add.html)
   ═══════════════════════════════════════════════ */


/* ── RESET & TOKENS ─────────────────────────── */

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

:root {
  /* Backgrounds */
  --bg: #f0f4fa;
  --white: #fff;
  --border: #dde4f0;

  /* Navy scale */
  --navy: #1a2f5e;
  --navy-mid: #2a4480;
  --navy-pale: #e4ebf8;

  /* Accents */
  --teal: #0891b2;
  --teal-light: #22d3ee;
  --coral: #e85d3a;
  --gold: #d4820a;
  --mint: #059669;

  /* Text */
  --text: #0f1e3d;
  --text-mid: #3a4f7a;
  --text-light: #6b7fa8;

  /* Misc */
  --shadow: rgba(26, 47, 94, 0.09);
}

.rating-star {
  color: #f59e0b;
  margin-right: 2px;
}

.book-title-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

.book-title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Mulish', sans-serif;
  min-height: 100vh;
}


/* ── HEADER ─────────────────────────────────── */

.site-header {
  background: linear-gradient(115deg,
      #0f1e3d 0%,
      #1a2f5e 30%,
      #2d2a6e 60%,
      #7b3a5a 85%,
      #c4512e 100%);
  color: #fff;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 81, 46, 0.2) 0%, transparent 70%);
  top: -80px;
  right: 60px;
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 58, 90, 0.25) 0%, transparent 70%);
  bottom: -60px;
  right: 320px;
  pointer-events: none;
}

.header-left h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
  color: #fff;
  position: relative;
  z-index: 1;
}

.header-left h1 em {
  font-style: italic;
}

.header-left p {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 7px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.update-tag,
.commit-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

@keyframes chargement-pulse {

  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.update-tag.loading {
  animation: chargement-pulse 1.4s ease-in-out infinite;
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 600;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 22px;
  border-radius: 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-refresh.loading {
  opacity: 0.6;
  pointer-events: none;
}


/* ── LAYOUT ─────────────────────────────────── */

main {
  padding: 32px 48px;
  max-width: 1140px;
  margin: 0 auto;
}

.sec {
  margin-bottom: 24px;
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label .sdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 6px var(--shadow);
}


/* ── STATS ──────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stat-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 1px 6px var(--shadow);
}

.stat-tile.dark {
  background: linear-gradient(135deg, #1a2f5e, #2d2a6e);
  border-color: transparent;
}

.sti-wrap {
  margin-bottom: 8px;
  display: flex;
}

.sti-wrap i {
  width: 20px;
  height: 20px;
  stroke-width: 2.2px;
}

.stl {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-tile.dark .stl {
  color: rgba(255, 255, 255, 0.5);
}

.stv {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.2px;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-tile.dark .stv {
  color: #fff;
}

.stv .u {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.45;
  letter-spacing: 0;
  margin-left: 2px;
}

.sts {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 0px;
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}

.stat-tile.dark .sts {
  color: rgba(255, 255, 255, 0.4);
}

.st-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 5px;
  border-radius: 99px;
  opacity: 0.8;
}

.stat-tile.dark .st-accent {
  opacity: 1;
}


/* ── DERNIÈRES LECTURES ─────────────────────── */

.dernieres-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.derniere-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 6px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.dc-stars {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.dc-cover-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

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

.dc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 3px;
  line-height: 1.3;
  padding-right: 75px;
}

.dc-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 600;
  margin-top: 4px;
}

.dc-meta>span:not(:last-child)::after {
  content: '·';
  margin-left: 6px;
  color: var(--border);
}

.dc-empty {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  padding: 12px 0;
  text-align: center;
}

.bcover {
  width: 76px;
  height: 106px;
  border-radius: 6px;
  background: var(--navy-pale);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.bcover.sm {
  width: 48px;
  height: 66px;
  font-size: 20px;
}

.rtag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0;
}

.bauthor {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bauthor .lucide {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  stroke-width: 3px !important;
}

.bmeta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 600;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.breview {
  font-size: 11px;
  color: var(--text-mid);
  line-height: 1.6;
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  margin-top: auto;
}

.btags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.btag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-mid);
  border: 1px solid var(--border);
}

/* legacy — kept for any future reuse */
.btitle-lg {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-book {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 6px var(--shadow);
  display: flex;
  gap: 10px;
}

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

.mini-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  margin-top: 5px;
}

.mini-author {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.mini-meta {
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 600;
}


/* ── READER CARDS ───────────────────────────── */

.readers-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.reader-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 6px var(--shadow);
}

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

.rc-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #0f1e3d;
}

.rc-link {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
  opacity: 0.5;
}

.rc-link:hover {
  opacity: 1;
}

.rc-rows {
  display: flex;
  flex-direction: column;
}

.rc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  padding: 4px 0;
}

.rc-row:last-child {
  border-bottom: none;
}

.rc-row strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.rc-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prow-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.pbar {
  height: 5px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}

.pbar-f {
  height: 100%;
  border-radius: 99px;
}


/* ── GENRE MULTIPLES ────────────────────────── */

.gm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 1px 6px var(--shadow);
}

.gm-col {
  padding: 18px;
  border-right: 1px solid var(--border);
}

.gm-col:last-child {
  border-right: none;
}

.gm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.gm-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0f1e3d;
}

.gm-cnt {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

.gr-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.gr-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-bar {
  flex: 2;
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}

.gr-fill {
  height: 100%;
  border-radius: 99px;
}

.gr-n {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  min-width: 14px;
  text-align: right;
}


/* ── ANALYSES ───────────────────────────────── */

.analyses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.ac-full {
  grid-column: span 3;
}

.acard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px var(--shadow);
  display: flex;
  flex-direction: column;
}

.acard-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
}

.donut-legend {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin-left: auto;
}

.dl-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-mid);
  min-width: 0;
}

.dl-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dl-pct {
  margin-left: auto;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.monthly-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 8px;
  flex-grow: 1;
  min-height: 120px;
}

.mbc {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 2px;
}

.mb-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--navy);
  min-height: 2px;
}

.mb-lbl {
  font-size: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
}

.mb-val {
  font-size: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text-mid);
}


/* ── FORMATS ────────────────────────────────── */

.hb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.hb-row:last-child {
  margin-bottom: 0;
}

.hb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  width: 100px;
  text-align: right;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hb-track {
  flex: 1;
  height: 18px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.hb-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
}

.hb-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 22px;
}


/* ── TOP LECTURES + LECTURES EN COMMUN ──────── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px var(--shadow);
}

.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.top-row:last-child {
  border-bottom: none;
}

.top-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  width: 22px;
  flex-shrink: 0;
}

.tcover {
  width: 34px;
  height: 46px;
  border-radius: 4px;
  background: var(--navy-pale);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

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

.top-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-author {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 3px;
}

.stars span {
  color: #f59e0b;
  font-size: 12px;
}

.sh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.sh-row:last-child {
  border-bottom: none;
}

.sh-cover {
  width: 34px;
  height: 46px;
  border-radius: 4px;
  background: var(--navy-pale);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

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

.sh-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sh-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid transparent;
}

.cname {
  padding: 3px 6px 3px 5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
}

.crate {
  padding: 3px 6px;
  background: #fff;
}

.cnone {
  padding: 3px 6px;
  background: #fff;
  color: var(--text-light);
  font-style: italic;
}


/* ── MOTS-CLÉS ──────────────────────────────── */

.kcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px var(--shadow);
}

.kcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  max-height: 175px;
  overflow: hidden;
}

.ktag {
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 99px;
  background: #fde8e0;
  color: #c4512e;
  cursor: default;
  transition: opacity 0.15s;
}

.ktag:hover {
  opacity: 0.7;
}


/* ── BUBBLES ────────────────────────────────── */

.bubble-wrap {
  position: relative;
}

.bubble-svg {
  width: 100%;
  overflow: visible;
  display: block;
}

.sz-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
}

.sz-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sz-circle {
  border-radius: 50%;
  background: var(--navy-pale);
  border: 1.5px solid #3d5fa0;
  flex-shrink: 0;
}


/* ── TOUTES LES LECTURES ────────────────────── */

.ab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ftab {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ftab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.ftab:hover:not(.active) {
  border-color: var(--navy);
  color: var(--navy);
}

.mfilter-wrap {
  background: var(--white);
  border: 1.5px solid var(--border);
  padding: 4px 12px;
  border-radius: 99px;
  transition: all 0.2s;
}

.mfilter-wrap:hover {
  border-color: var(--navy);
}

.m-select {
  border: none;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
  display: block;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.blist {
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
}

.blist::-webkit-scrollbar {
  width: 5px;
}

.blist::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 99px;
}

.blist::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

.blist::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.brow {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brow:last-child {
  border-bottom: none;
}

.bstripe {
  width: 3px;
  align-self: stretch;
  border-radius: 99px;
  margin-right: 12px;
  flex-shrink: 0;
}

.brow-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.brow-cover {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  background: var(--navy-pale);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

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

.brow-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brow-meta {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 1px;
}

.brow-meta .gtext {
  color: var(--teal);
}

.brow-review {
  font-size: 11px;
  color: var(--text-mid);
  font-style: italic;
  margin-top: 3px;
  /*white-space: nowrap;*/
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.brow-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mbadge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 99px;
}

.bstar {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.blist-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  padding: 10px 0;
}


/* ── TOOLTIP ────────────────────────────────── */

.tooltip {
  position: fixed;
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px;
  line-height: 1.6;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}


/* ── LOADING & ERROR ────────────────────────── */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-light);
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--navy-mid);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-box {
  background: #fff1ee;
  border: 1.5px solid #fca5a5;
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 580px;
  margin: 40px auto;
  font-family: 'Space Grotesk', sans-serif;
}

.error-box h3 {
  color: var(--coral);
  margin-bottom: 8px;
}

.error-box p {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.6;
}

.error-box code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}


/* ── ANIMATIONS ─────────────────────────────── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade {
  animation: fadeUp 0.4s ease both;
}


/* ── FOOTER ─────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 16px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  max-width: 1140px;
  margin: 0 auto;
}


/* ═══════════════════════════════════════════════
   ADD.HTML — Input form
   Reuses tokens, .card, .two-col, .pbar, .ftab,
   .mbadge, .ktag, .spinner, .fade from above.
   ═══════════════════════════════════════════════ */

/* ── Form page layout ── */
.form-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

/* ── Form header (reuses .site-header gradient) ── */
.form-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 40%, #1a0f2e 100%);
  border: 1px solid rgba(42, 68, 128, 0.2);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.form-header::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 68, 128, 0.15) 0%, transparent 70%);
  top: -50px;
  right: -20px;
  pointer-events: none;
}

.form-header-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal-light);
  opacity: 0.8;
  margin-bottom: 6px;
}

.form-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.5px;
}

.form-header h1 em {
  font-style: italic;
  color: var(--teal-light);
}

.form-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 5px;
}

/* ── Form back button ── */
.form-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.15s;
  position: relative;
  z-index: 1;
}

/* ── Form section label (lighter version of .section-label) ── */
.form-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-label .sdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Form group spacing ── */
.form-group {
  margin-bottom: 20px;
}

/* ── Field label ── */
.field-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.field-label .req {
  color: var(--coral);
}

/* ── Inputs ── */
input[type="text"],
input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Mulish', sans-serif;
  font-size: 15px;
  padding: 11px 13px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

input:focus,
textarea:focus {
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px var(--navy-pale);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-light);
}

textarea {
  resize: none;
  min-height: 80px;
  line-height: 1.5;
}

/* ── Reader picker ── */
.reader-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.reader-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 4px var(--shadow);
}

.reader-btn:active {
  transform: scale(0.96);
}

.reader-btn.active {
  border-color: var(--reader-color);
  background: color-mix(in srgb, var(--reader-color) 8%, var(--white));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--reader-color) 15%, transparent);
}

.reader-emoji {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

.reader-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  transition: color 0.15s;
}

.reader-btn.active .reader-name {
  color: var(--reader-color);
}

/* ── Genre/format chips (reuses .ftab logic, different sizing) ── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.chip:active {
  transform: scale(0.95);
}

.chip.active {
  background: color-mix(in srgb, var(--chip-color, var(--coral)) 10%, var(--white));
  border-color: var(--chip-color, var(--coral));
  color: var(--chip-color, var(--coral));
}

/* ── Fini toggle ── */
.fini-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s;
  box-shadow: 0 1px 4px var(--shadow);
}

.fini-toggle.active {
  border-color: rgba(5, 150, 105, 0.4);
  background: rgba(5, 150, 105, 0.04);
}

.fini-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-pill {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-pill::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fini-toggle.active .toggle-pill {
  background: var(--mint);
}

.fini-toggle.active .toggle-pill::after {
  transform: translateX(18px);
}

.dates-area {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.dates-area.open {
  max-height: 120px;
}

/* ── Star rating ── */
.star-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  box-shadow: 0 1px 4px var(--shadow);
}

.star-btn {
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
  opacity: 0.2;
  filter: grayscale(1);
  user-select: none;
}

.star-btn.on {
  opacity: 1;
  filter: none;
}

.star-btn:active {
  transform: scale(0.85);
}

.half-toggle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.half-toggle.active {
  background: rgba(212, 130, 10, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

.star-display {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-left: auto;
}

/* ── Tags input ── */
.tags-wrap {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 46px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px var(--shadow);
}

.tags-wrap:focus-within {
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px var(--navy-pale);
}

/* tag chips reuse .btag but with a remove button */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fde8e0;
  border: 1px solid rgba(196, 81, 46, 0.25);
  border-radius: 99px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #c4512e;
  white-space: nowrap;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 13px;
  line-height: 1;
}

.tag-remove:hover {
  opacity: 1;
}

.tag-input {
  border: none !important;
  background: transparent !important;
  padding: 3px 0 !important;
  font-size: 13px !important;
  min-width: 80px;
  flex: 1;
  outline: none;
  color: var(--text);
}

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

/* tag suggestions reuse .btag */
.tag-sug {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tag-sug:hover,
.tag-sug:active {
  border-color: var(--navy);
  color: var(--navy);
}

/* ── Pages progress hint ── */
.pages-hint {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy) 100%);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-submit.loading .btn-text {
  opacity: 0;
}

.btn-submit.loading .btn-spinner {
  display: block;
}

/* reuses .spinner from above */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  position: absolute;
}

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--mint);
}

.toast.error {
  background: var(--coral);
}


/* ── Duplicate warning banner (add.html) ────────── */

.dupe-banner {
  display: none;
  background: #fffbeb;
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  gap: 10px;
  align-items: flex-start;
}

.dupe-banner.visible {
  display: flex;
}

.dupe-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.dupe-text {
  flex: 1;
  min-width: 0;
}

.dupe-text strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}

.dupe-text span {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}

.dupe-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dupe-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: 1.5px solid;
}

.dupe-btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

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

.dupe-btn:active {
  transform: scale(0.96);
}

/* Submit button edit-mode variant */
.btn-submit.edit-mode {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}


/* ── RESPONSIVE / MOBILE ────────────────────── */

@media (max-width: 992px) {
  .readers-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-tile:nth-child(4),
  .stat-tile:nth-child(5) {
    grid-column: span 1;
  }

  .site-header {
    padding: 0 32px;
  }

  main {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .site-header {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 24px;
    text-align: center;
  }

  .header-meta {
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
  }

  .header-left h1 {
    font-size: 28px;
  }

  .header-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-right .btn-refresh {
    flex: 1;
    min-width: 140px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  main {
    padding: 24px 16px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-tile:last-child {
    grid-column: span 2;
  }

  .dernieres-grid,
  .gm-grid,
  .two-col,
  .analyses-grid {
    grid-template-columns: 1fr;
  }

  .readers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ac-full {
    grid-column: span 1;
  }

  .gm-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .gm-col:last-child {
    border-bottom: none;
  }

  .donut-wrap {
    flex-direction: column;
    gap: 16px;
  }

  .donut-legend {
    margin-left: 0;
    align-items: center;
  }

  footer {
    padding: 24px 16px;
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .ab-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .mfilter-wrap {
    text-align: center;
  }

  .sz-legend {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {

  .stats-row,
  .readers-grid {
    grid-template-columns: 1fr;
  }

  .stat-tile:last-child {
    grid-column: span 1;
  }
}