#series-view { --ink:var(--color-text); --muted:var(--color-text-secondary); --line:var(--color-border); --soft:var(--color-background); --surface:var(--color-surface); color:var(--ink); background:var(--soft); font-family:var(--font-body); }
#series-view [hidden] { display:none !important; }
html:has(#series-view.is-active),body:has(#series-view.is-active) { min-width:0; background:var(--color-background); }
.app-shell:has(#series-view.is-active) { height:auto; min-height:100dvh; overflow:visible; }
.ser-page { min-width:0; color:var(--ink); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.ser-page h1 { margin:0; font-family:var(--font-head); font-size:var(--type-page-size); line-height:var(--type-page-line); font-weight:var(--weight-bold); letter-spacing:var(--tracking-page); }
.ser-page h2 { margin:0 0 12px; font-family:var(--font-head); font-size:var(--type-section-size); line-height:var(--type-section-line); font-weight:var(--weight-semibold); }
.ser-page p { margin:8px 0; overflow-wrap:anywhere; }
.ser-page button,.ser-page input,.ser-page select,.ser-page textarea { font-family:inherit; font-size:var(--type-body-size); line-height:var(--type-body-line); }
#series-view :is(.series-facet-chip, .series-facet-trigger, .series-sort, .series-sort select, select.ds-field, .catalog-select) {
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line);
}
.ser-muted { color:var(--muted); }

/* Overview uses the same composition as Books and Authors. */
.series-shell { container-type:inline-size; container-name:series-page; min-width:0; padding-bottom:32px; }
.series-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:28px; }
.series-heading { display:flex; align-items:center; gap:28px; flex:1 1 auto; min-width:0; flex-wrap:wrap; }
.series-heading h1 { margin:0; flex:0 0 auto; }
#series-count {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
/* Status tabs: канон в controls.css. Здесь только раскладка в шапке. */
.series-statuses {
  flex:1 1 auto;
  margin-top:24px;
  margin-bottom:4px;
}
.series-filters { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:24px; }
.series-facets { display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-width:0; flex:1 1 auto; }
.series-facet { position:relative; min-width:0; max-width:100%; }
.series-facet-chip { display:flex; align-items:center; }
.series-facet-trigger { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.series-facet-trigger svg { width:16px; height:16px; flex-shrink:0; margin-left:2px; color:var(--color-text-secondary); }
.series-badge { padding:0; border-radius:0; background:transparent; color:inherit; font-size:inherit; line-height:inherit; }
.series-popover { position:absolute; left:0; right:auto; top:calc(100% + 8px); z-index:25; width:min(380px,calc(100vw - 32px)); padding:16px; max-height:calc(100dvh - 160px); overflow:auto; border:0; border-radius:var(--radius-layer); background:var(--surface); box-shadow:var(--ui-popup-shadow, var(--shadow-raised)); }
.series-option-search-wrap { display:flex; align-items:center; gap:10px; }
.series-option-search-wrap svg { width:20px; height:20px; flex-shrink:0; fill:none; stroke:var(--muted); stroke-width:1.75; }
.series-option-search { min-width:0; width:100%; }
.series-options { max-height:360px; overflow-y:auto; margin-top:8px; overscroll-behavior:contain; }
.series-option { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px; border-radius:var(--radius-sm); color:var(--ink); font-size:var(--type-body-size); line-height:var(--type-body-line); cursor:pointer; }
.series-option input { width:18px; height:18px; margin:1px 0; accent-color:var(--ink); }
.series-option-count { color:var(--muted); }
.series-option.is-selected,.series-option:hover { background:var(--soft); }
.series-option-group + .series-option-group { border-top:1px solid var(--line); margin-top:12px; padding-top:12px; }
.series-options-empty { margin:12px 0 0; color:var(--muted); }
.series-popover-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); color:var(--muted); font-size:var(--type-caption-size); line-height:var(--type-caption-line); }
.series-heat-chips { display:flex; flex-wrap:wrap; gap:8px; }
.series-selection { display:flex; align-items:center; gap:12px; margin-bottom:16px; color:var(--muted); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.series-selected { display:flex; flex:1; flex-wrap:wrap; gap:8px; min-width:0; }
.series-selected-chip { display:flex; align-items:center; gap:10px; text-align:left; }
.series-selected-chip svg { width:16px; height:16px; flex-shrink:0; fill:currentColor; stroke:none; color:var(--muted); }
.series-sort-wrap { display:flex; align-items:center; min-height:var(--type-page-line); flex:0 0 auto; min-width:0; max-width:100%; margin-left:auto; padding-left:0; border-left:0; }
/* Look: dropdown canon в controls.css. Здесь только раскладка. */
.series-sort {
  display:flex; align-items:center; gap:8px; min-width:0; max-width:100%; box-sizing:border-box;
  cursor:pointer; font-weight:500;
}
.series-sort svg { width:16px; height:16px; flex-shrink:0; color:var(--color-text-secondary); }
.series-sort #series-sort {
  min-width:0; width:auto; max-width:100%; height:auto; min-height:0;
  border:0; border-radius:0; background-color:transparent; background-image:none; box-shadow:none; color:inherit;
  appearance:none; -webkit-appearance:none; cursor:pointer;
}
.series-sort #series-sort:hover,
.series-sort #series-sort:focus,
.series-sort #series-sort:focus-visible { border:0; border-color:transparent; box-shadow:none; outline:none; }
.ser-results { display:grid; gap:16px; padding-top:0; }
.ser-overview-card { position:relative; min-width:0; overflow:hidden; padding:20px; border:0; border-radius:var(--radius-panel); background:var(--color-surface); cursor:pointer; box-shadow:var(--shadow-card, 0 4px 16px rgba(0,0,0,.04)); transition:box-shadow .18s ease; content-visibility:auto; contain-intrinsic-size:auto 220px; }
.ser-overview-card:has(.library-card-menu-toggle) { overflow:visible; }
.ser-overview-card .ser-world-preview { position:relative; overflow:visible; }
.ser-world-preview-identity {
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-width:0;
  gap:0;
}
.ser-overview-card .ser-world-preview-head:has(.library-card-menu-toggle) {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  width:100%;
}
.ser-overview-card .ser-world-preview-head > .library-card-menu-toggle,
.ser-overview-card .ser-world-preview-head > .library-card-menu-toggle.ds-icon-btn,
.ser-overview-card .ser-world-preview-head > .library-card-menu-toggle.ds-icon-btn--surface {
  position:static;
  top:auto;
  right:auto;
  bottom:auto;
  left:auto;
  z-index:4;
  flex:0 0 28px;
  align-self:flex-start;
  margin:0;
}
.ser-overview-card .ser-world-preview-head:has(.library-card-menu-toggle) .ser-world-preview-identity,
.ser-overview-card .ser-world-preview-head:has(.library-card-menu-toggle) .ser-world-preview-title {
  flex:1 1 auto;
  min-width:0;
}
.ser-overview-card:hover { box-shadow:var(--shadow-raised, 0 6px 20px rgba(0,0,0,.10)); }
.ser-overview-card:focus-visible { outline: var(--focus-ring); outline-offset:3px; }
.ser-overview-stats { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 0; max-width:100%; margin:0; padding:0; border:0; background:transparent; color:var(--muted); font-family:var(--font-body); font-size:var(--type-caption-size); line-height:var(--type-caption-line); }
.ser-overview-stat { display:inline; min-width:0; padding:0; white-space:nowrap; }
.ser-overview-stat-sep { display:inline; margin:0 6px; color:var(--muted); }
.ser-title { color:inherit; font-family:var(--font-head); font-size:var(--type-panel-size); line-height:var(--type-panel-line); font-weight:var(--weight-semibold); text-decoration:none; overflow-wrap:break-word; }
a.ser-title:hover { text-decoration:underline; text-underline-offset:3px; }
.ser-overview-card .ser-title { cursor:inherit; }
.ser-overview-rail { --ser-cover-h:192px; --ser-card-pad:12px; --ser-card-height:calc(var(--ser-cover-h) + var(--ser-card-pad) * 2); display:flex; align-items:flex-start; gap:12px; max-width:100%; height:auto; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scroll-snap-type:x proximity; padding:2px 24px 8px 2px; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.ser-world-preview { flex:0 0 320px; width:320px; height:var(--ser-card-height); min-height:var(--ser-card-height); padding:0; border:0; border-radius:0; background:transparent; scroll-snap-align:start; display:flex; flex-direction:column; overflow:hidden; }
.ser-world-preview-body { display:flex; flex-direction:column; flex:1; min-height:0; gap:0; padding:2px 12px 2px 2px; }
.ser-world-preview-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; min-width:0; flex:0 0 auto; }
.ser-world-preview-head .ser-world-preview-title { flex:1 1 auto; min-width:0; }
.ser-world-preview-head .ser-progress { flex:0 0 auto; margin:0; align-self:flex-start; }
/* Keep preview stack spacing self-contained — not only under `.ser-page`
   (add-from-catalog borrows `#series-view`; default h2/p margins otherwise break the stack). */
.ser-world-preview-title,
.ser-page h2.ser-world-preview-title {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  margin:0;
  flex:0 0 auto;
  min-width:0;
  max-height:calc(2 * var(--type-section-line));
  font-family:var(--font-head);
  font-size:var(--type-section-size);
  line-height:var(--type-section-line);
  font-weight:var(--weight-bold);
  overflow-wrap:normal;
  word-break:normal;
  hyphens:none;
}
.ser-world-preview-authors,
.ser-page p.ser-world-preview-authors {
  flex:0 0 auto;
  margin:4px 0 0;
  color:var(--muted);
  font-family:var(--font-body);
  font-size:var(--type-caption-size);
  line-height:var(--type-caption-line);
}
.ser-world-preview .ser-overview-stats { flex:0 0 auto; margin-top:8px; }
.ser-world-preview-copy-slot { flex:1 1 auto; min-height:0; margin-top:8px; overflow:hidden; }
.ser-world-preview-copy { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:8; overflow:hidden; margin:0 !important; max-height:100%; color:var(--ink); font-family:var(--font-body); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.ser-world-preview-copy strong { font-weight:var(--weight-semibold); }
@supports (height: round(down, 100%, 1px)) {
  .ser-world-preview-copy { height:round(down, 100%, var(--type-body-line)); max-height:round(down, 100%, var(--type-body-line)); }
}
.ser-overview-eyebrow,.ser-overview-role { margin:0 !important; color:var(--muted); font-size:var(--type-micro-size); line-height:var(--type-micro-line); font-weight:var(--weight-bold); letter-spacing:var(--tracking-label); text-transform:uppercase; }
.ser-overview-book { --ser-cover-h:192px; --ser-card-pad:12px; position:relative; flex:0 0 360px; width:360px; height:auto; min-width:0; display:flex; scroll-snap-align:start; align-self:flex-start; }
.ser-overview-book-button { display:grid; grid-template-columns:128px minmax(0,1fr); gap:14px; align-items:start; width:100%; height:auto; padding:var(--ser-card-pad); border:0; border-radius:var(--radius-panel); background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05); }
.ser-overview-book-button:hover { box-shadow:0 3px 10px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.06); }
.ser-overview-book-button:focus-visible { outline: var(--focus-ring); outline-offset:3px; }
.ser-overview-cover { position:relative; display:grid; place-items:center; align-self:start; width:128px; height:var(--ser-cover-h); flex:0 0 auto; overflow:hidden; border-radius:var(--radius-field); background:var(--soft); border:0; }
.ser-overview-cover img { width:100%; height:100%; object-fit:cover; }
/* Empty cover + status — cover-empty.css */
.ser-overview-number { position:absolute; top:6px; left:6px; z-index:1; min-width:24px; padding:3px 6px; border-radius:var(--radius-pill); background:rgba(255,255,255,.92); color:#1f1f1f; font-size:var(--type-micro-size); line-height:var(--type-micro-line); font-weight:var(--weight-bold); text-align:center; box-shadow:0 1px 3px rgba(0,0,0,.14); }
.ser-overview-book-copy { display:flex; flex-direction:column; min-width:0; min-height:0; height:var(--ser-cover-h); overflow:hidden; }
.ser-overview-book-head { display:flex; align-items:flex-start; gap:8px; min-width:0; flex:0 0 auto; }
.ser-overview-book-title { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; flex:1; min-width:0; margin:0; font-family:var(--font-body); font-size:var(--type-body-size); line-height:var(--type-body-line); font-weight:var(--weight-semibold); }
.ser-overview-status { position:absolute; top:6px; right:6px; z-index:2; box-sizing:border-box; display:grid; place-items:center; width:28px; height:28px; border:0; border-radius:var(--radius-round); background:var(--color-status-surface, #FFFFFF); color:var(--color-status-icon, #fff); pointer-events:none; box-shadow:0 1px 4px rgba(0,0,0,.12); }
.ser-overview-status .icon { width:14px; height:14px; display:block; fill:currentColor; }
.ser-overview-book.is-read .ser-overview-status .icon { transform:translate(1px,-1px); }
/* Facts row styles live in Дизайн-система/book-facts.css (shared with medium cards). */
.ser-overview-book-author {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}
.ser-overview-book-author:empty,
.ser-overview-number:empty,
.ser-overview-book-translation:empty { display: none; }
.ser-overview-book-facts { margin-top:8px; overflow:hidden; flex:0 0 auto; }
.ser-overview-book-author + .ser-overview-book-facts { margin-top: 6px; }
.ser-overview-book-translation { display:block; margin-top:2px; color:var(--muted); font-size:var(--type-micro-size); line-height:var(--type-micro-line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:0 0 auto; }
.ser-overview-book-blurb-slot { flex:1 1 auto; min-height:0; margin-top:10px; overflow:hidden; }
.ser-overview-book-blurb { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:8; overflow:hidden; margin:0; max-height:100%; color:var(--muted); font-family:var(--font-body); font-size:var(--type-caption-size); line-height:var(--type-caption-line); }
@supports (height: round(down, 100%, 1px)) {
  .ser-overview-book-blurb { height:round(down, 100%, var(--type-caption-line)); max-height:round(down, 100%, var(--type-caption-line)); }
}
.ser-overview-book.is-declined { opacity:.42; }
.ser-overview-book.is-future .ser-overview-cover img,
.ser-overview-book.is-future .ser-overview-cover.is-missing .ser-overview-cover-fallback { opacity:.66; filter:grayscale(.55); }
.ser-empty { padding:24px; border:1px solid var(--line); border-radius:var(--radius-panel); background:var(--surface); }
.ser-empty--add { display:grid; gap:16px; justify-items:start; }
.ser-empty--add .ds-btn { margin:0; }
.series-memory-drawer .ser-review-excerpt { margin:0 0 8px; color:var(--text); }
.series-memory-drawer .ser-review-link { margin:0 0 16px; }

/* Series detail keeps its trajectory and editing tools. */
.ser-badges { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:12px 0; }
.ser-field { display:grid; gap:8px; min-width:0; }
.ser-field input,.ser-field select,.ser-field textarea { width:100%; min-width:0; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); box-sizing:border-box; }
.ser-field textarea { min-height:88px; resize:vertical; }
.ser-description,.ser-excerpt { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.ser-portrait { border-top:1px solid var(--line); padding-top:12px; }
.ser-portrait:empty { display:none; }
.ser-rating { font-weight:var(--weight-semibold); }
.ser-updates { margin-top:12px; }
.ser-track { list-style:none; padding:0; margin:32px 0; }
.ser-book { display:grid; grid-template-columns:88px minmax(0,1fr); gap:24px; padding:24px 0; border-bottom:1px solid var(--line); }
.ser-cover { width:88px; aspect-ratio:2/3; background:var(--soft); display:grid; place-items:center; align-self:start; font-size:var(--type-caption-size); text-align:center; }
.ser-cover img { width:100%; height:100%; object-fit:cover; }
.ser-book-title { border:0; background:none; color:var(--ink); text-align:left; padding:0; cursor:pointer; font-family:var(--font-head); font-size:var(--type-section-size); line-height:var(--type-section-line); font-weight:var(--weight-medium); }
.ser-memory { margin:0; }
.ser-text { white-space:pre-wrap; }
.ser-form { display:grid; gap:16px; max-width:760px; }
.ser-choice { display:flex; align-items:center; gap:8px; }
.ser-error { padding:16px; border:1px solid var(--ink); }

/* Series detail — same composition as author detail. */
.ser-detail-shell { min-width:0; padding-bottom:32px; }
.ser-detail-layout { min-height:0; display:grid; grid-template-columns:minmax(280px,1fr) minmax(0,2fr); gap:16px; align-items:start; }
.ser-detail-profile { min-height:0; padding:24px; display:flex; flex-direction:column; gap:16px; border-radius:var(--radius-panel); background:var(--surface); border:1px solid var(--line); }
.ser-detail-profile-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ser-detail-description-skeleton { display:grid; gap:8px; }
.ser-detail-description-skeleton > span { height:12px; border-radius:6px; background:var(--soft); }
.ser-detail-description-skeleton > span:last-child { width:65%; }
.ser-detail-identity { min-width:0; flex:1; display:flex; flex-direction:column; gap:12px; }
.ser-detail-identity h1 { margin:0; font-family:var(--font-head); font-size:var(--type-display-size); line-height:36px; font-weight:var(--weight-bold); letter-spacing:var(--tracking-panel); overflow-wrap:break-word; }
.ser-progress {
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  justify-content: center;
}
.ser-detail-authors {
  margin:6px 0 0;
  color:var(--muted);
  font-family:var(--font-body);
  font-size:var(--type-body-size);
  line-height:var(--type-body-line);
  font-weight:var(--weight-regular);
}
.ser-detail-author { color:inherit; text-decoration:none; cursor:pointer; }
.ser-detail-author:hover,
.ser-detail-author:focus-visible { color:var(--ink); outline:none; }
.ser-detail-actions { position:relative; flex:0 0 auto; }
.ser-detail-actions > summary { list-style:none; }
.ser-detail-actions > summary::-webkit-details-marker { display:none; }
.ser-detail-menu { display:grid; place-items:center; width:36px; height:36px; border:0; border-radius:var(--radius-round); background:var(--surface, var(--color-surface)); color:var(--ink, var(--color-text)); box-shadow:var(--shadow-selected); cursor:pointer; }
.ser-detail-menu svg { width:var(--ds-icon-glyph-size, 22px); height:var(--ds-icon-glyph-size, 22px); fill:currentColor; }
.ser-detail-menu:hover:not(:disabled) { background:var(--color-surface); box-shadow:var(--shadow-control-hover); color:var(--ink, var(--color-text)); }
.ser-detail-menu:focus-visible { outline: var(--focus-ring); outline-offset:3px; }
.ser-detail-menu-list { position:absolute; right:0; top:calc(100% + 8px); z-index:5; display:grid; min-width:236px; width:236px; padding:8px; border:0; border-radius:var(--radius-field); background:var(--surface); box-shadow:var(--ui-popup-shadow, var(--shadow-raised)); }
.ser-detail-actions:not([open]) .ser-detail-menu-list { display:none; }
.ser-detail-menu-item {
  display:flex; align-items:center; gap:10px; width:100%; min-height:40px;
  padding:8px 10px; border:0; border-radius:var(--radius-field);
  background:transparent; color:var(--ink); font:inherit; text-align:left; cursor:pointer;
}
.ser-detail-menu-item:hover { background:var(--soft); }
.ser-detail-menu-item:focus-visible { outline: var(--focus-ring); outline-offset:-2px; }
.ser-detail-menu-item.is-danger { color:var(--color-danger, #a32929); }
.ser-detail-menu-item img,
.ser-detail-menu-item svg,
.ser-detail-menu-item .rm-icon {
  flex:0 0 18px;
  width:18px;
  height:18px;
  color:inherit;
  fill:currentColor;
  opacity:.72;
}
.ser-detail-meta-row {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:8px;
  margin:0;
}
.ser-detail-scores { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0; }
/* Progress sits in the same pill row as year / GR — no separate strip. */
#series-view .ser-detail-progress {
  margin: 0;
  flex: 0 0 auto;
}
#series-view .ser-detail-summary {
  display: none !important;
}
.ser-detail-score { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:var(--radius-pill); background:var(--soft); color:var(--ink); font-size:var(--type-caption-size); line-height:var(--type-caption-line); font-weight:var(--weight-semibold); white-space:nowrap; }
.ser-detail-score svg,
.ser-detail-score .rm-icon {
  width:15px;
  height:15px;
  flex-shrink:0;
  color:inherit;
  fill:currentColor;
}
.ser-detail-tags { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.ser-detail-tags li {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  max-width:100%;
  height:auto;
  padding:6px 12px;
  border:1px solid var(--color-tag-border);
  border-radius:var(--radius-pill);
  background:var(--color-surface);
  box-shadow:var(--shadow-tag);
  color:var(--muted);
  font-size:var(--type-caption-size);
  line-height:var(--type-caption-line);
  font-weight:var(--weight-regular);
  white-space:normal;
  overflow-wrap:anywhere;
}
.ser-detail-about { margin:0 !important; color:var(--ink); font-size:var(--type-body-size); line-height:var(--type-body-line); white-space:pre-wrap; }
.ser-detail-about strong { font-weight:var(--weight-semibold); }
.ser-world-relations { display:grid; gap:8px; margin-top:6px; padding-top:14px; border-top:1px solid var(--line); }
.ser-world-relations h2 { margin:0; font-family:var(--font-head); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.ser-world-relation .ser-title { font-family:var(--font-body); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.ser-world-relation p { margin:2px 0 0; font-size:var(--type-caption-size); line-height:var(--type-caption-line); }
.ser-detail-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; padding:14px 8px; border-radius:var(--radius-layer); background:var(--soft); }
.ser-detail-summary-stat { position:relative; display:flex; align-items:center; justify-content:center; gap:10px; min-width:0; padding:4px 10px; text-align:center; }
.ser-detail-summary-stat + .ser-detail-summary-stat::before { content:""; position:absolute; left:0; top:4px; bottom:4px; width:1px; background:var(--line); }
.ser-detail-summary-stat svg,
.ser-detail-summary-stat .rm-icon { display:none; }
.ser-detail-summary-copy { display:flex; flex-direction:column; align-items:center; gap:2px; min-width:0; text-align:center; }
.ser-detail-summary-copy strong { color:var(--ink); font-size:var(--type-body-size); line-height:var(--type-body-line); }
.ser-detail-summary-copy > span { color:var(--muted); font-size:var(--type-micro-size); line-height:var(--type-micro-line); text-transform:uppercase; }
.ser-detail-filters-fold {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.ser-detail-filters-fold[hidden] {
  display: none !important;
}
.ser-detail-filters-trigger {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
  min-height: 28px;
  padding: 0;
  list-style: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-weight: var(--weight-medium);
}
.ser-detail-filters-trigger::-webkit-details-marker {
  display: none;
}
.ser-detail-filters-trigger > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}
.ser-detail-filters-trigger svg,
.ser-detail-filters-trigger .rm-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  color: inherit;
  fill: currentColor;
  transition: transform 0.15s;
}
.ser-detail-filters-fold[open] > .ser-detail-filters-trigger {
  color: var(--ink);
}
.ser-detail-filters-fold[open] > .ser-detail-filters-trigger svg,
.ser-detail-filters-fold[open] > .ser-detail-filters-trigger .rm-icon {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .ser-detail-filters-trigger svg,
  .ser-detail-filters-trigger .rm-icon {
    transition: none;
  }
}
:is(#series-view, #collections-view, #author-view) .ser-detail-filters-fold .author-filters,
:is(#series-view, #collections-view, #author-view) .ser-detail-filters-fold #author-quick-filters .author-filters {
  margin: 0;
  padding: 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#author-view .author-filters-fold #author-quick-filters {
  margin: 0;
}
#author-view .author-filters-fold #author-quick-filters .author-filters {
  padding: 10px 0 0;
}
#author-view .author-filters-fold #author-quick-filters .col-detail-filters {
  padding: 0;
  gap: 16px;
}
/* Tablet/phone: flush filter chips with «Фильтры»; half the previous gap under the trigger. */
@media (max-width: 1199px) {
  :is(#series-view, #collections-view, #author-view, .entity-detail-compact, .q-public-detail)
    .ser-detail-filters-fold
    .author-filters,
  :is(#series-view, #collections-view, #author-view, .entity-detail-compact, .q-public-detail)
    .ser-detail-filters-fold
    #author-quick-filters
    .author-filters,
  #author-view .author-filters-fold #author-quick-filters .author-filters {
    /* Half of the former ~24px gap under «Фильтры». */
    padding: 12px 0 0;
  }
  :is(#series-view, #collections-view, #author-view, .entity-detail-compact, .q-public-detail)
    .ser-detail-filters-fold
    .col-detail-filters,
  :is(#series-view, #collections-view, #author-view, .entity-detail-compact, .q-public-detail)
    .ser-detail-filters-fold
    .author-filter-desktop,
  #author-view .author-filters-fold #author-quick-filters .col-detail-filters {
    padding: 0;
    gap: 12px;
    border: 0;
    background: transparent;
  }
  :is(#series-view, #collections-view, #author-view, .entity-detail-compact, .q-public-detail)
    .ser-detail-filters-fold
    .col-detail-filter-label,
  #author-view .author-filters-fold .col-detail-filter-label {
    padding-top: 0;
  }
}
@media (max-width: 1199px) {
  /* Tags stay compact-header-only; description stays in the profile card. */
  #series-view.entity-detail-compact .ser-detail-tags { display: none !important; }
  #series-view.entity-detail-compact .ser-detail-about {
    display: block;
    margin: 0;
  }
}
.ser-detail-memory { padding:18px; border:0; border-radius:var(--radius-panel); background:var(--color-background); }
.ser-detail-memory h2 { margin-bottom:8px; }
.ser-detail-memory .ser-portrait { border:0; padding:0; }
.ser-detail-books { min-height:0; padding:0; display:flex; flex-direction:column; gap:12px; background:transparent; border:0; border-radius:0; box-shadow:none; }
.ser-detail-books-stack { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; padding:0; list-style:none; }
.ser-detail-books-stack .ser-overview-book { flex:none; width:auto; min-width:0; height:auto; align-self:stretch; }
.ser-detail-books-stack .ser-overview-book.is-full-description .ser-overview-book-copy { height:auto; min-height:var(--ser-cover-h); overflow:visible; }
.ser-detail-books-stack .ser-overview-book.is-full-description .ser-overview-book-blurb-slot { flex:0 0 auto; overflow:visible; }
.ser-detail-books-stack .ser-overview-book.is-full-description .ser-overview-book-blurb {
  display:block;
  -webkit-line-clamp:unset;
  -webkit-box-orient:initial;
  overflow:visible;
  max-height:none;
  height:auto;
}
@supports (height: round(down, 100%, 1px)) {
  .ser-detail-books-stack .ser-overview-book.is-full-description .ser-overview-book-blurb {
    height:auto;
    max-height:none;
  }
}
/* Same back-row rhythm as book/author/collection detail shells. */
.ser-detail-page {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}
@media (max-width: 1199px) {
  .ser-detail-page { gap: 6px; }
}
.ser-detail-top {
  display: flex;
  align-items: center;
  min-height: 28px;
}

@container series-page (max-width:903px) {
  .series-header { flex-wrap:wrap; gap:20px; }
  .series-sort-wrap { margin-left:auto; padding-left:0; border-left:0; }
  .series-facet { position:static; }
  .series-filters { position:relative; }
  .series-popover { left:0; right:auto; width:min(360px,calc(100vw - 64px)); }
  .ser-world-preview { flex-basis:280px; width:280px; }
}
@media(max-width:1024px) {
  .ser-detail-layout { grid-template-columns:1fr; }
}
@media(max-width:700px) {
  .ser-detail-books-stack { grid-template-columns:1fr; }
}
@media(max-width:767px) {
  /* Title+author stay in identity; keep a real head row when + is present. */
  .ser-world-preview-head:not(:has(.library-card-menu-toggle)) { display: contents; }
  .ser-world-preview-head:not(:has(.library-card-menu-toggle)) .ser-world-preview-identity { display: contents; }
  .ser-world-preview-head:has(.library-card-menu-toggle) {
    display: flex;
    order: 1;
    width: 100%;
  }
  .ser-world-preview-identity { order: 1; }
  .ser-world-preview-title { order: 1; }
  .ser-world-preview-authors { order: 2; }
  /* Keep + on the right (same as tablet): identity order:1 must not pull ahead of the toggle. */
  .ser-world-preview-head:has(.library-card-menu-toggle) > .ser-world-preview-identity {
    order: 0;
  }
  .ser-world-preview-head:has(.library-card-menu-toggle) > .library-card-menu-toggle,
  .ser-world-preview-head:has(.library-card-menu-toggle) > .library-card-menu-toggle.ds-icon-btn,
  .ser-world-preview-head:has(.library-card-menu-toggle) > .library-card-menu-toggle.ds-icon-btn--surface {
    order: 1;
    margin-left: auto;
  }
  .ser-world-preview-head .ser-progress,
  .ser-world-preview-body > .ser-progress {
    order: 3;
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 6px 0 0;
  }
  .ser-world-preview-copy-slot { order: 4; }
  .ser-world-preview-more { order: 5; }
}
@media(max-width:600px) {
  #series-view .series-statuses .ds-segment-bar-item { min-width:0; white-space:nowrap; border:0; }
  #series-view .series-statuses .ds-segment-bar-item:nth-child(n) { border:0; }
  .ser-overview-card { padding:14px; }
  .ser-overview-rail { --ser-cover-h:144px; --ser-card-pad:10px; margin-right:-14px; padding-right:42px; }
  .ser-world-preview { flex-basis:260px; width:260px; }
  .ser-overview-book { --ser-cover-h:144px; --ser-card-pad:10px; flex-basis:min(320px,88vw); width:min(320px,88vw); }
  .ser-overview-book-button { grid-template-columns:96px minmax(0,1fr); gap:10px; }
  .ser-overview-cover { width:96px; }
  .ser-book { grid-template-columns:64px minmax(0,1fr); gap:16px; }
  .ser-cover { width:64px; }
  .ser-memory { padding:16px; }
}
