:root {
  --bg: #f6f1e8;
  --surface: #fffdf8;
  --surface-2: #efe8db;
  --ink: #2a2420;
  --ink-2: #6f655b;
  --line: #e2d8c8;
  --accent: #a8502c;
  --accent-ink: #fff;
  --bar: #c9845e;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgb(60 40 20 / .06), 0 4px 14px rgb(60 40 20 / .06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1816;
    --surface: #24211e;
    --surface-2: #2e2a26;
    --ink: #ece5da;
    --ink-2: #a39888;
    --line: #3a3530;
    --accent: #e0895d;
    --accent-ink: #1a1816;
    --bar: #d0875f;
    --danger: #f2877f;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 14px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

button, select, input, textarea, .as-button {
  font: inherit;
  color: inherit;
}
button, .as-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
button:hover, .as-button:hover { border-color: var(--ink-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.07); }
button.danger, .link-btn.danger { color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.link-btn:hover { color: var(--ink); text-decoration: underline; }

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible, .book:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { resize: vertical; }

/* ---------- cabecera ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px max(16px, calc((100vw - 1100px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font-size: 24px; letter-spacing: -.01em; }
.tagline { color: var(--ink-2); font-family: var(--serif); font-style: italic; font-size: 14px; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs button { border: 0; background: none; color: var(--ink-2); }
.tabs button.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); white-space: nowrap;
}
.menu-pop button, .menu-pop .as-button { border: 0; text-align: left; }
.menu-pop button:hover, .menu-pop .as-button:hover { background: var(--surface-2); }

.sync-status { border: 0; background: none; color: var(--ink-2); font-size: 13px; padding: 6px 8px; }
.sync-status[data-state=error] { color: var(--danger); }
#dlg-sync form { width: min(520px, 100%); }
#sync-form .dlg-actions { flex-wrap: wrap; }
#sync-form .dlg-actions button { white-space: nowrap; }
#sync-form:not([data-connected="1"]) .if-connected { display: none; }
#sync-form .dlg-actions .danger { margin-right: auto; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar input[type=search] { flex: 1 1 240px; }
.toolbar select { width: auto; flex: 0 1 auto; }
#books-summary { margin: 0 0 16px; font-size: 13px; }

/* ---------- libros ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px 18px;
}
.book { cursor: pointer; border-radius: var(--radius); }
.book:hover > .cover, .book:hover .stack-covers > .cover:last-child { transform: translateY(-3px); box-shadow: 0 8px 22px rgb(60 40 20 / .18); }
.cover {
  position: relative; overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 4px 8px 8px 4px;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .18) 0, rgb(0 0 0 / 0) 7%, rgb(255 255 255 / .08) 9%, rgb(0 0 0 / 0) 12%),
    linear-gradient(160deg, hsl(var(--h) 38% 46%), hsl(calc(var(--h) + 25) 42% 30%));
  display: flex; align-items: flex-end;
  padding: 14px 12px 14px 18px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.cover-title {
  color: #fffaf0;
  font-family: var(--serif); font-size: 17px; line-height: 1.2;
  text-shadow: 0 1px 2px rgb(0 0 0 / .3);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.big { width: 150px; flex: none; }

.book-meta { padding-top: 10px; }
.book-meta h3 { font-size: 15px; line-height: 1.25; }
.author { margin: 2px 0 6px; color: var(--ink-2); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; font-size: 12px; }
.status, .lang, .qcount {
  padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2);
}
.status.s-reading { background: color-mix(in srgb, #3d8b5a 18%, transparent); color: color-mix(in srgb, #3d8b5a 80%, var(--ink)); }
.status.s-read { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.status.s-dropped { text-decoration: line-through; }
.lang { letter-spacing: .04em; border: 1px solid var(--line); background: none; }
.stars { color: #d49a2a; letter-spacing: 1px; margin: 4px 0 0; font-size: 13px; }
.stars .off { color: var(--line); }

.empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-2);
}
.empty-title { font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 0 0 6px; }
.empty button { margin: 6px 4px 0; }

/* ---------- diálogos ---------- */
dialog {
  border: 0; border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--ink);
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 20px 60px rgb(0 0 0 / .3);
}
dialog::backdrop { background: rgb(30 20 10 / .45); backdrop-filter: blur(2px); }
dialog > form, #detail, #movie-detail { padding: 24px; position: relative; }
dialog h2 { font-size: 24px; line-height: 1.2; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 18px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.form-grid label small { font-weight: 400; }
.span2 { grid-column: span 2; }
.date-field { display: flex; flex-direction: column; gap: 6px; }
.form-grid .date-field .toggle { flex-direction: row; font-size: 13px; white-space: normal; }
.date-field input[type=date]:disabled { opacity: .45; }
.undated-note { margin: -4px 0 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip { padding: 2px 10px; border-radius: 99px; font-size: 12px; background: var(--surface-2); border: 1px solid transparent; }
button.chip:hover { border-color: var(--ink-2); }

.close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; padding: 0; font-size: 22px; line-height: 1;
  border-radius: 50%; border: 0; background: var(--surface-2);
}
.detail-head { display: flex; gap: 20px; align-items: flex-start; } /* sin esto la portada se estira hasta la altura del texto */
.detail-head h2 { padding-right: 40px; }
.detail-head .author { font-size: 15px; }
.detail-head .badges, .detail-head .stars { margin-top: 8px; }
.detail-actions { display: flex; gap: 8px; margin-top: 14px; }
.notes {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 14px;
}
.section-title { margin: 26px 0 10px; font-size: 18px; }
.section-title .muted { font-family: var(--sans); font-size: 14px; font-weight: 400; }

.quote-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.quote-form .row { display: flex; gap: 8px; }
.quote-form .row input[name=page] { width: 100px; flex: none; }
.quote-form .row button { flex: none; }

/* ---------- citas ---------- */
.quote-list { display: flex; flex-direction: column; gap: 14px; }
.quote {
  margin: 0; padding: 18px 20px 14px 24px;
  background: var(--surface); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow);
}
#detail .quote { box-shadow: none; background: var(--bg); }
.quote-text { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.5; margin: 0; }
.quote-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.quote footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; }
.quote footer a { color: var(--ink); font-weight: 600; text-decoration: none; }
.quote footer a:hover { text-decoration: underline; }
.quote footer .link-btn:first-of-type { margin-left: auto; }

/* ---------- estadísticas ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi, .card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; }
.kpi-v { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi-l { color: var(--ink-2); font-size: 13px; }
.card { padding: 18px 20px; }
.card h3 { font-size: 17px; margin-bottom: 14px; }
.card.wide { margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.vbars { display: flex; align-items: stretch; gap: 6px; height: 220px; }
.vbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.vbar-fill {
  width: 100%; max-width: 46px; min-height: 2px;
  background: var(--bar); border-radius: 4px 4px 0 0;
  transition: height .4s ease;
}
.vbar:hover .vbar-fill { background: var(--accent); }
.vbar-v { font-size: 11px; color: var(--ink-2); margin-bottom: 3px; white-space: nowrap; }
.vbar-l { font-size: 12px; color: var(--ink-2); margin-top: 6px; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 4px; }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-l::first-letter { text-transform: uppercase; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--bar); border-radius: 99px; }
.hbar-v { color: var(--ink-2); font-size: 12px; white-space: nowrap; }

.lang-stack { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; gap: 2px; }
.lang-stack span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .05em; }

/* ---------- registro de lectura ---------- */
.progress { height: 4px; margin-top: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress.big { height: 8px; margin: 4px 0 4px; }
.session-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; align-items: end; margin: 10px 0 12px; }
.session-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.sessions { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); }
.sessions li { display: flex; gap: 12px; align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sessions .s-date { min-width: 110px; text-transform: capitalize; }
.sessions b { font-weight: 600; margin-left: auto; }
.sessions .link-btn { font-size: 18px; line-height: 1; }

/* barras apiladas: registrado + estimado */
.vbar-fill.est { min-height: 0; background: color-mix(in srgb, var(--bar) 35%, transparent); border-radius: 4px 4px 0 0; }
.vbar-fill.est + .vbar-fill { border-radius: 0; }
.vbar-fill.est[style*="height:0%"] + .vbar-fill { border-radius: 4px 4px 0 0; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 12px 0 0; font-size: 12px; color: var(--ink-2); }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--bar); }
.legend .sw.est { background: color-mix(in srgb, var(--bar) 35%, transparent); margin-left: 6px; }

/* calendario de días leídos */
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat { display: inline-flex; flex-direction: column; gap: 4px; }
.heat-months, .heat-grid { display: flex; gap: 3px; }
.heat-months span { width: 13px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: visible; }
.heat-week { display: flex; flex-direction: column; gap: 3px; }
.heat i, .legend i { display: block; width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); }
.heat i.out { visibility: hidden; }
.heat i.future { opacity: .4; }
.heat i.l1, .legend i.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heat i.l2, .legend i.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heat i.l3, .legend i.l3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-2)); }
.heat i.l4, .legend i.l4 { background: var(--accent); }
.heat i.est, .legend i.est { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---------- sagas ---------- */
.series { margin: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.series a { color: inherit; text-decoration: none; }
.series a:hover { text-decoration: underline; }
.stack-covers { position: relative; aspect-ratio: 2 / 3; margin: 12px 12px 0 0; }
.stack-covers > .cover { position: absolute; inset: 0; }
.stack-covers .behind-1 { transform: translate(6px, -6px) rotate(2.5deg); filter: brightness(.82); }
.stack-covers .behind-2 { transform: translate(12px, -12px) rotate(5deg); filter: brightness(.68); }
.stack-covers .behind .cover-title { visibility: hidden; }
.book.stack:hover .stack-covers .behind-1 { transform: translate(9px, -8px) rotate(4deg); }
.book.stack:hover .stack-covers .behind-2 { transform: translate(17px, -14px) rotate(8deg); }
.stack-covers.big { width: 150px; flex: none; margin: 14px 18px 0 0; }

.saga-list { list-style: none; margin: 22px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.saga-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
}
.saga-list li:hover, .saga-list li:focus-visible { background: var(--surface-2); outline: none; }
.cover.mini { width: 38px; flex: none; padding: 0; border-radius: 2px 4px 4px 2px; box-shadow: none; }
.cover.mini .cover-title { display: none; }
.saga-num { font-family: var(--serif); font-size: 20px; color: var(--ink-2); min-width: 22px; text-align: center; }
.saga-book { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.saga-book b { font-weight: 600; }
.saga-list .stars { margin: 0; white-space: nowrap; }

.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.toggle input { width: auto; accent-color: var(--accent); }
.hbars li.clickable { cursor: pointer; border-radius: 6px; }
.hbars li.clickable:hover .hbar-l { text-decoration: underline; }
.card h3 .muted { font-family: var(--sans); font-weight: 400; margin-left: 6px; }

/* ---------- películas ---------- */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; }
.segmented button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; color: var(--ink-2); white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.segmented .count { font-size: 12px; opacity: .7; font-weight: 400; margin-left: 2px; }

.cover.poster {
  border-radius: 6px;
  background:
    radial-gradient(120% 70% at 50% 0%, hsl(var(--h) 45% 42%), transparent 70%),
    linear-gradient(180deg, hsl(calc(var(--h) + 30) 30% 22%), hsl(var(--h) 35% 10%));
  padding: 14px;
}
.cover.poster .cover-title { display: flex; flex-direction: column; gap: 2px; }
.cover.poster .cover-title small { font-family: var(--sans); font-size: 12px; opacity: .75; letter-spacing: .08em; }

/* 10 estrellas con relleno parcial: la capa dorada se recorta al --v / 10 del ancho */
.stars10 { position: relative; display: inline-block; font-size: 12px; line-height: 1; white-space: nowrap; color: var(--line); vertical-align: middle; }
.stars10::before { content: '★★★★★★★★★★'; }
.stars10::after {
  content: '★★★★★★★★★★'; position: absolute; left: 0; top: 0;
  width: calc(var(--v, 0) * 10%); overflow: hidden; color: #d49a2a;
}
.stars10.big { font-size: 26px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.stars10.big:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.movie-rating { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; }
.movie-rating b { font-weight: 600; }

.rating-field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-2); }
.rating-input { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rating-input input[name=rating] { width: 84px; }
.rating-num { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1; margin-left: 4px; }
.detail-rating { margin-top: 12px; gap: 6px; }
.hint { margin: 4px 0 0; }
#movie-form[data-status=want] .if-watched { display: none; }

.status.s-watched { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.status.s-want { background: color-mix(in srgb, #4a6fa5 18%, transparent); color: color-mix(in srgb, #4a6fa5 85%, var(--ink)); }
.notes-edit { font-size: 15px; line-height: 1.55; background: var(--bg); }
.summary-box { margin-top: 22px; padding: 12px 16px; background: var(--bg); border-radius: var(--radius); }
.summary-box summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.summary-box summary h3 { margin: 0; font-size: 18px; }
.summary-box summary::after { content: '▸'; margin-left: auto; color: var(--ink-2); }
.summary-box[open] summary::after { content: '▾'; }
.summary-box summary::-webkit-details-marker { display: none; }
.summary-box summary { list-style: none; }
.summary-text { margin-top: 10px; font-size: 15px; line-height: 1.6; }
.summary-text p { margin: 0 0 10px; }
#notes-status { margin: 6px 0 0; }

/* ---------- estadísticas de películas ---------- */
.diary { list-style: none; margin: 0; padding: 0; }
.diary li {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px;
}
.diary li:last-child { border-bottom: 0; }
.diary li:hover, .diary li:focus-visible { background: var(--surface-2); outline: none; }
.diary .d-day { font-family: var(--serif); font-size: 18px; color: var(--ink-2); text-align: center; }
.diary .d-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.diary .d-title b { font-weight: 600; }
.diary .d-title .muted { font-size: 12px; margin-left: 4px; }
.diary .d-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.diary.numbered { counter-reset: top; }
.diary.numbered li { counter-increment: top; }
.diary.numbered .d-day { visibility: hidden; position: relative; }
.diary.numbered .d-day::before { content: counter(top); visibility: visible; position: absolute; inset: 0; }
.diary.ranking .d-title .muted { display: none; }
.diary-month { margin: 18px 0 4px; font-family: var(--serif); font-size: 15px; font-weight: 600; }
.diary-month:first-of-type { margin-top: 0; }
.diary-month .muted { font-family: var(--sans); font-size: 13px; font-weight: 400; margin-left: 4px; }
.saga-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }

/* ---------- series ---------- */
#show-form[data-status=want] .if-watching,
#show-form[data-status=want] .if-started,
#show-form[data-status=want] .if-finished,
#show-form[data-status=watching] .if-finished,
#show-form[data-status=dropped] .if-finished,
#show-form[data-status=finished] .if-watching { display: none; }
.status.s-watching { background: color-mix(in srgb, #3d8b5a 18%, transparent); color: color-mix(in srgb, #3d8b5a 80%, var(--ink)); }
.status.s-finished { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ep-btn { padding: 0 8px; font-size: 12px; border-radius: 99px; line-height: 1.6; }
.show-progress { margin-top: 12px; padding: 12px 14px; background: var(--bg); border-radius: var(--radius); }
.sp-now { display: flex; align-items: flex-end; gap: 22px; }
.sp-now > span:not(.muted) { display: flex; flex-direction: column; }
.sp-now small { font-size: 12px; color: var(--ink-2); }
.sp-now b { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.show-progress .progress.big { margin-top: 10px; }
.season-picker { display: block; margin-top: 10px; }
.season-picker select { width: auto; max-width: 100%; font-weight: 600; }
.season-poster { display: block; margin-top: 10px; }
.season-poster input { margin-top: 4px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
#show-detail { padding: 24px; position: relative; }

/* ---------- videojuegos ---------- */
#game-form[data-status=want] .if-started,
#game-form[data-status=want] .if-finished,
#game-form[data-status=playing] .if-finished,
#game-form[data-status=dropped] .if-finished { display: none; }
.status.s-playing { background: color-mix(in srgb, #3d8b5a 18%, transparent); color: color-mix(in srgb, #3d8b5a 80%, var(--ink)); }
#game-detail { padding: 24px; position: relative; }
#game-notes-status { margin: 6px 0 0; }

/* ---------- móvil ---------- */
@media (max-width: 640px) {
  .top { gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .tabs button { flex: 1 0 auto; padding: 6px 7px; font-size: 14px; }
  .brand { margin-right: auto; }
  .tagline { display: none; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .detail-head { flex-direction: column; }
  .cover.big, .stack-covers.big { width: 120px; }
  .stars10.big { font-size: 24px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1 1 auto; padding: 5px 6px; font-size: 14px; }
  .segmented .count { display: none; }
  .saga-list .saga-rating .stars10 { display: none; }
  .diary .d-rating .stars10 { display: none; }
  .quote-form .row { flex-wrap: wrap; }
  .quote-form .row input[name=note] { flex: 1 1 100%; order: -1; }
  .vbars { gap: 3px; }
  .vbar-v { display: none; }
  .session-form { grid-template-columns: 1fr 1fr; }
  .session-form label:first-child { grid-column: span 2; }
  .session-form button { grid-column: span 2; }
  dialog > form, #detail, #movie-detail, #show-detail, #game-detail { padding: 18px; }
}
