/* Saved (data-viewpanel="library"), second pass (18 November 2026). The owner: the inner places have "muy poco diseño, muy poco cariño", improve them a lot.
   Loaded last (index.html), over the clean layer; tokens of the clean look only (--cl-*). views/library.js writes the sv- classes.

   What the page is now:
   - the switch Saved / Following as two pills, the chosen one soft lilac (no ink slab), each with its sign and its count;
   - an empty shelf is a soft lilac panel (19 November: the amber and rose went, one palette): a small drawn picture, the sentence in two parts (its first words in the serif),
     the bookmark shown where it is named, and one soft lilac way back to the briefing;
   - saved posts and the week's posts are cards with their picture, source and date, and a button that says what it does;
   - Following: the topics as chips with their week, the people as tiles with their face; its own lilac empty panel;
   - motion: the cards rise in one after another when the page opens or a tab is chosen; a hovered card lifts 2 px;
     nothing turns, nothing follows the pointer, and all of it is still when less motion is asked for. */

html [data-viewpanel="library"] .lb {
  --sv-amber: color-mix(in srgb, var(--cl-lilac) 78%, var(--cl-ink));
  --sv-amber-soft: color-mix(in srgb, var(--cl-lilac) 5%, var(--cl-surface));
  --sv-amber-tint: color-mix(in srgb, var(--cl-lilac) 14%, var(--cl-surface));
  --sv-amber-line: color-mix(in srgb, var(--cl-lilac) 26%, var(--cl-surface));
  --sv-rose-soft: var(--cl-hover);
  --sv-rose-line: var(--cl-line-3);
  --sv-lilac-fill: color-mix(in srgb, var(--cl-lilac) 14%, var(--cl-surface));
  --sv-lilac-soft: color-mix(in srgb, var(--cl-lilac) 6%, var(--cl-surface));
  --sv-lilac-line: color-mix(in srgb, var(--cl-lilac) 45%, transparent);
  --sv-lilac-ink: color-mix(in srgb, var(--cl-lilac) 66%, var(--cl-ink));
}

/* 1. The switch: two pills, the chosen one soft lilac. The sliding ink piece is not used: the chosen pill carries its own
      colour, so a page opened straight on Following is right from the first frame. ---------------------------------------- */
html #libTabs .tab-ind { display: none !important; }
html #libTabs.lb-tabs { gap: 8px; }
html #libTabs.lb-tabs [role="tab"] {
  gap: 8px; height: 44px; padding: 0 18px 0 15px; border: 1px solid var(--cl-line-2); background: var(--cl-surface);
  color: var(--cl-ink-2) !important;
  transition: color .28s var(--cl-out), border-color .28s var(--cl-out), background-color .28s var(--cl-out), scale .12s var(--cl-out);
}
html #libTabs.lb-tabs [role="tab"] > i { display: inline-block; font-size: 17px !important; color: var(--cl-ink-3); transition: color .28s var(--cl-out); }
html #libTabs.lb-tabs [role="tab"]:hover { border-color: var(--cl-line-3); background: var(--cl-surface); color: var(--cl-ink) !important; }
html #libTabs.lb-tabs [role="tab"]:active { scale: .97; }
html #libTabs.lb-tabs [role="tab"][aria-selected="true"] {
  border-color: var(--sv-lilac-line); background: var(--sv-lilac-fill); color: var(--sv-lilac-ink) !important;
}
html #libTabs.lb-tabs [role="tab"][aria-selected="true"] > i { color: var(--sv-lilac-ink); }
/* the count: quiet beside the word, lilac on the chosen pill, not shown when it is nought */
html #libTabs.lb-tabs [role="tab"] > span { display: inline-block !important; min-width: 0; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--cl-ink-4) !important; }
html #libTabs.lb-tabs [role="tab"][aria-selected="true"] > span { color: color-mix(in srgb, var(--cl-lilac) 80%, var(--cl-ink-3)) !important; }
html #libTabs.lb-tabs [role="tab"] > span[data-n="0"] { display: none !important; }
@media (max-width: 639.98px) {
  html #libTabs.lb-tabs [role="tab"] { justify-content: center; padding: 0 12px; }
}

/* 2. Sections: the serif title with a small sign in a soft circle, the quiet note on the right ------------------------------- */
html .sv-sec > header { align-items: center; margin-bottom: 16px; }
html .sv-sec h2 { display: inline-flex; align-items: center; gap: 12px; }
html .sv-sign {
  display: inline-grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sv-lilac-fill); color: var(--sv-lilac-ink); font-family: var(--cl-sans);
}
html .sv-sign > i { font-size: 17px; }
html #libSaved .sv-sign { background: var(--sv-amber-tint); color: var(--cl-ink-2); }
html .lb-empty + .sv-sec { margin-top: 20px; }

/* 3. Empty places: a soft panel, a picture or a sign, the serif line, one plain sentence, one soft way on -------------------- */
html .lb-empty.sv-empty {
  position: relative; overflow: hidden; display: grid; justify-items: center; gap: 0; padding: 40px 28px 34px;
  border: 1px solid var(--sv-amber-line); border-radius: 24px; background: var(--sv-amber-soft); text-align: center;
}
html .lb-empty.sv-empty--follow { border-color: color-mix(in srgb, var(--cl-lilac) 26%, var(--cl-surface)); background: var(--sv-lilac-soft); }
html .sv-empty > p { display: grid; gap: 8px; max-width: 46ch; margin-top: 18px; }
html .sv-empty__title { font-family: var(--cl-serif); font-size: 26px; line-height: 1.2; letter-spacing: -.01em; color: var(--cl-ink); }
html .sv-empty__line { font-size: 16px; line-height: 1.55; color: var(--cl-ink-3); text-wrap: pretty; }
html .sv-empty .sv-go { margin-top: 24px; }
/* with the week's posts right below, the panel is one calm band on a wide screen: the picture, the words, the way on */
@media (min-width: 768px) {
  html .lb-empty.sv-empty--lead { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: start; column-gap: 26px; padding: 26px 30px 26px 26px; text-align: left; }
  html .sv-empty--lead > p { gap: 4px; margin-top: 0; }
  html .sv-empty--lead .sv-empty__title { font-size: 24px; }
  html .sv-empty--lead .sv-go { margin-top: 0; }
}
/* the bookmark, shown where the sentence names it */
html .sv-chip-mark {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 1px; border-radius: 7px; vertical-align: -4px;
  background: var(--cl-surface); box-shadow: inset 0 0 0 1px var(--sv-amber-line); color: var(--sv-amber);
}
html .sv-chip-mark > i { font-size: 13px; }
/* the drawn shelf: two sheets, the front one with its amber ribbon, which drops in once as the panel arrives */
html .sv-shelf { display: block; width: 96px; height: 76px; overflow: visible; }
html .sv-shelf__back { fill: var(--sv-amber-tint); stroke: var(--sv-amber-line); stroke-width: 1.2; }
html .sv-shelf__front { fill: var(--cl-surface); stroke: var(--sv-amber-line); stroke-width: 1.2; }
html .sv-shelf__text { fill: var(--cl-line-2); }
html .sv-shelf__mark { fill: var(--sv-amber); animation: sv-drop .7s var(--cl-spring) .32s both; }
/* the Following sign: a 48 px tinted circle */
html .sv-empty__sign {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--sv-lilac-fill); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cl-lilac) 30%, transparent); color: var(--sv-lilac-ink);
}
html .sv-empty__sign > i { font-size: 22px; }
/* a part of Following that is empty: one soft line with its way on */
html .lb-line.sv-line {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px dashed var(--cl-line-2); border-radius: 18px;
  background: color-mix(in srgb, var(--cl-surface) 70%, transparent); font-size: 15px; color: var(--cl-ink-3);
}
html .sv-line__sign { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--cl-surface-2); color: var(--cl-ink-3); }
html .sv-line__sign > i { font-size: 16px; }
html .sv-line .lb-link { color: var(--sv-lilac-ink); text-decoration-color: var(--sv-lilac-line); }

/* the soft lilac way on (it replaces the ink button of the clean pass) */
html .lb-empty .dx-btn.sv-go {
  gap: 10px; height: 46px; padding: 0 20px 0 11px; border: 1px solid color-mix(in srgb, var(--cl-lilac) 42%, transparent);
  background: color-mix(in srgb, var(--cl-lilac) 14%, var(--cl-surface)) !important;
  color: var(--sv-lilac-ink) !important; font-size: 15px; font-weight: 500; box-shadow: none !important;
  transition: border-color .25s var(--cl-out), box-shadow .35s var(--cl-spring), translate .35s var(--cl-spring), scale .12s var(--cl-out);
}
html .lb-empty .dx-btn.sv-go:hover {
  border-color: color-mix(in srgb, var(--cl-lilac) 62%, transparent); translate: 0 -1px;
  background: color-mix(in srgb, var(--cl-lilac) 20%, var(--cl-surface)) !important;
  box-shadow: var(--cl-shadow-1) !important;
}
html .lb-empty .dx-btn.sv-go:active { scale: .97; translate: none; }
html .sv-go__sign { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sv-lilac-ink); color: var(--cl-surface); }
html .sv-go__sign > i { font-size: 13px; }

/* 4. Cards: saved posts and the week's posts ---------------------------------------------------------------------------- */
html .lb-list.sv-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px;
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
html .sv-cards > .lb-row.sv-card {
  display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--cl-line-2); border-radius: 20px; background: var(--cl-surface);
  transition: border-color .3s var(--cl-out), translate .45s var(--cl-spring), box-shadow .45s var(--cl-spring);
}
html .sv-cards > .lb-row.sv-card::before { display: none; }
@media (hover: hover) {
  html .sv-cards > .lb-row.sv-card:hover { border-color: var(--cl-line-3); background: var(--cl-surface); translate: 0 -2px; box-shadow: var(--cl-shadow-2); }
  html .sv-cards > .lb-row.sv-card:hover .dx-cover img { scale: 1.03; }
}
html .sv-card .lb-row__open { position: relative; display: flex; flex: 1; flex-direction: column; gap: 0; padding: 8px 8px 0; border-radius: 19px; }
html .sv-card .dx-cover { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; }
html .sv-card .lb-row__text { padding: 14px 8px 0; }
html .sv-card .lb-row__title { font-size: 16.5px; line-height: 1.36; -webkit-line-clamp: 3; }
html .sv-card .lb-row__meta { gap: 2px 12px; margin-top: 8px; color: var(--cl-ink-4); }
html .sv-card .lb-row__meta > span:first-child { color: var(--cl-ink-3); }
/* a video or a spoken version: a small label on the picture */
html .sv-card .lb-kind {
  position: absolute; top: 16px; left: 16px; z-index: 1; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--cl-surface) 90%, transparent); box-shadow: var(--cl-shadow-1); color: var(--cl-ink); font-size: 13px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
html .sv-card .lb-kind > i { font-size: 14px; color: var(--cl-ink-2); }

/* the button at the foot of a card: Remove (quiet, a rose tint when pointed at) and Save (amber when pointed at) */
html .sv-card .lb-x.sv-x {
  align-self: flex-start; gap: 7px; height: 38px; margin: 12px 0 14px 16px; padding: 0 14px 0 11px; border: 1px solid var(--cl-line-2);
  border-radius: 999px; background: var(--cl-surface); box-shadow: none; color: var(--cl-ink-2); font-size: 14px; opacity: 1;
  transition: background-color .22s var(--cl-out), border-color .22s var(--cl-out), color .22s var(--cl-out), scale .12s var(--cl-out);
}
html .sv-card .lb-x.sv-x > i { font-size: 15px; color: var(--cl-ink-3); transition: color .22s var(--cl-out); }
html .sv-card .lb-x.sv-x:hover { border-color: var(--sv-rose-line); background: var(--sv-rose-soft); color: var(--cl-ink); }
html .sv-card .lb-x.sv-x:hover > i { color: var(--cl-ink); }
html .sv-card .lb-x.sv-x--save:hover { border-color: var(--sv-amber-line); background: var(--sv-amber-soft); }
html .sv-card .lb-x.sv-x--save:hover > i { color: var(--sv-amber); }
html .sv-card .lb-x.sv-x:active { scale: .97; }

/* the week's posts: a little smaller, three to a row */
html .sv-cards--start .lb-row__title { font-size: 16px; }

/* while the posts arrive: the same cards, in grey */
html .sv-cards > .lb-row--sk.sv-card { display: flex; flex-direction: column; gap: 14px; padding: 8px 8px 20px; }
html .sv-card .lb-sk--pic { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; }
html .sv-card .lb-sk__lines { padding: 0 8px; }

/* the chips of a kind: soft lilac when chosen */
html .lb-chips { gap: 8px; }
html .lb-chip { height: 38px; padding: 0 15px; border-color: var(--cl-line-2); background: var(--cl-surface); color: var(--cl-ink-2); font-size: 14.5px; transition: border-color .25s var(--cl-out), background-color .25s var(--cl-out), color .25s var(--cl-out); }
html .lb-chip:hover { border-color: var(--cl-line-3); color: var(--cl-ink); }
html .lb-chip small { font-size: 13px; color: var(--cl-ink-4); }
html .lb-chip[aria-pressed="true"] { border-color: var(--sv-lilac-line); background: var(--sv-lilac-fill); color: var(--sv-lilac-ink); }
html .lb-chip[aria-pressed="true"] small { color: color-mix(in srgb, var(--cl-lilac) 80%, var(--cl-ink-3)); }

/* 5. Following: topics as chips with their week ------------------------------------------------------------------------- */
html .lb-topics { gap: 10px; }
html .lb-topic {
  border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); box-shadow: none;
  transition: border-color .25s var(--cl-out), translate .4s var(--cl-spring), box-shadow .4s var(--cl-spring);
}
@media (hover: hover) { html .lb-topic:hover { border-color: var(--cl-line-3); translate: 0 -1px; box-shadow: var(--cl-shadow-1); } }
html .lb-topic__open { gap: 12px; height: 46px; padding: 0 8px 0 18px; border-radius: 999px 0 0 999px; font-size: 15px; color: var(--cl-ink); }
html .lb-topic__open small { font-size: 13.5px; color: var(--cl-ink-4); }
html .lb-bars { gap: 2px; }
html .lb-bars i { background: var(--cl-line-2); }
html .lb-bars i.on { background: var(--cl-lilac); }
html .lb-topic__x { width: 42px; border-left: 1px solid var(--cl-line); border-radius: 0 999px 999px 0; color: var(--cl-ink-4); }
html .lb-topic__x:hover { background: var(--sv-rose-soft); color: var(--cl-ink); }

/* people as tiles: the face, the name, what they do and their week, the app's Follow button */
html .lb-list.sv-people {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px;
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
html .sv-people > .lb-person.sv-person {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 24px 18px 18px; border: 1px solid var(--cl-line-2);
  border-radius: 20px; background: var(--cl-surface); text-align: center;
  transition: border-color .3s var(--cl-out), translate .45s var(--cl-spring), box-shadow .45s var(--cl-spring);
}
html .sv-people > .lb-person.sv-person::before { display: none; }
@media (hover: hover) { html .sv-people > .lb-person.sv-person:hover { border-color: var(--cl-line-3); translate: 0 -2px; box-shadow: var(--cl-shadow-2); } }
html .sv-person .lb-face { width: 64px; height: 64px; box-shadow: 0 0 0 4px var(--cl-surface), 0 0 0 5px var(--cl-line-2); }
html .sv-person .lb-face > *, html .sv-person .lb-pic { width: 64px; height: 64px; }
html .sv-person .lb-face--none, html .sv-person .lb-ini { font-size: 18px; }
html .sv-person .lb-person__who { display: block; width: 100%; margin-top: 14px; }
html .sv-person .lb-person__who b { font-size: 17px; }
html .sv-person .lb-person__who span {
  display: -webkit-box; overflow: hidden; margin-top: 4px; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 14px; line-height: 1.45; color: var(--cl-ink-3); white-space: normal; text-wrap: pretty;
}
html .sv-person .lb-person__who { text-align: center; }
/* Follow as on the Clinicians page: a soft pill; following, it is lilac with the tick in a deep lilac round */
html .sv-person .follow-btn {
  height: 40px; min-width: 128px; gap: 8px; margin-top: 16px; padding: 0 16px 0 10px; border: 1px solid var(--cl-line-2); border-radius: 999px;
  background: var(--cl-surface); box-shadow: none; color: var(--cl-ink); font-size: 14.5px; font-weight: 400;
  transition: border-color .22s var(--cl-out), background-color .22s var(--cl-out), color .22s var(--cl-out), scale .12s var(--cl-out);
}
html .sv-person .follow-btn .fb-ic {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--cl-surface-2); color: var(--cl-ink-2);
  font-size: 12px !important; transition: background-color .22s var(--cl-out), color .22s var(--cl-out);
}
html .sv-person .follow-btn:hover { border-color: var(--sv-lilac-line); background: var(--sv-lilac-soft); color: var(--sv-lilac-ink); }
html .sv-person .follow-btn:hover .fb-ic { background: var(--sv-lilac-fill); color: var(--sv-lilac-ink); }
html .sv-person .follow-btn.is-following, html .sv-person .follow-btn[aria-pressed="true"],
html .sv-person .follow-btn.is-following:hover, html .sv-person .follow-btn[aria-pressed="true"]:hover { border-color: var(--sv-lilac-line); background: var(--sv-lilac-fill); color: var(--sv-lilac-ink); }
html .sv-person .follow-btn.is-following .fb-ic, html .sv-person .follow-btn[aria-pressed="true"] .fb-ic { background: var(--sv-lilac-ink); color: var(--cl-surface); }
html .sv-person .follow-btn:active { scale: .97; }

/* 6. Arrivals: the cards, chips and tiles of a pane that has just opened rise in a beat apart --------------------------- */
@keyframes sv-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes sv-drop { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }
html .sv-arrive > * { animation: sv-rise .55s var(--cl-spring) both; }
html .sv-arrive > :nth-child(2) { animation-delay: 45ms; }
html .sv-arrive > :nth-child(3) { animation-delay: 90ms; }
html .sv-arrive > :nth-child(4) { animation-delay: 135ms; }
html .sv-arrive > :nth-child(5) { animation-delay: 180ms; }
html .sv-arrive > :nth-child(6) { animation-delay: 225ms; }
html .sv-arrive > :nth-child(n+7) { animation-delay: 270ms; }

/* 7. Focus: the lilac ring on everything that can be pressed here ------------------------------------------------------- */
html [data-viewpanel="library"] :is(a, button, [role="tab"]):focus-visible { outline: 2px solid var(--cl-lilac) !important; outline-offset: 2px; }
html .sv-card .lb-row__open:focus-visible { outline-offset: -2px; }

/* 8. Phones and narrow windows ------------------------------------------------------------------------------------------ */
@media (max-width: 1023.98px) {
  html .lb-empty.sv-empty { padding: 34px 22px 28px; }
}
@media (max-width: 639.98px) {
  html .sv-sec > header { flex-wrap: wrap; align-items: baseline; row-gap: 4px; }
  html .sv-sec h2 { font-size: 22px; }
  html .sv-sign { width: 30px; height: 30px; }
  html .sv-sign > i { font-size: 15px; }
  html .sv-sec > header > span { width: 100%; padding-left: 42px; }
  html .sv-empty__title { font-size: 23px; }
  html .sv-empty__line { font-size: 15.5px; }
  /* a card is a row: the picture on the left, the words on the right, the button under the words */
  html .lb-list.sv-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html .sv-cards > .lb-row.sv-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 14px; padding: 12px; border-radius: 18px; }
  html .sv-card .lb-row__open { grid-column: 1 / -1; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 14px; padding: 0; border-radius: 12px; }
  html .sv-card .dx-cover { width: 92px; aspect-ratio: 1 / 1; border-radius: 12px; }
  html .sv-card .lb-row__text { padding: 1px 0 0; }
  html .sv-card .lb-row__title { font-size: 16px; }
  html .sv-card .lb-kind { position: static; height: auto; padding: 0; background: none; box-shadow: none; color: var(--cl-ink-3); font-size: inherit; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html .sv-card .lb-x.sv-x { grid-column: 2; justify-self: start; flex-direction: row; justify-content: flex-start; gap: 7px; min-width: 0; height: 38px; margin: 10px 0 0; padding: 0 14px 0 11px; border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); }
  html .sv-card .lb-x.sv-x > i { font-size: 15px; }
  html .sv-cards > .lb-row--sk.sv-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 12px; }
  html .sv-card .lb-sk--pic { width: 92px; aspect-ratio: 1 / 1; }
  html .sv-card .lb-sk__lines { padding: 6px 0 0; }
  /* people two to a row, the topics one under another when they are long */
  html .lb-list.sv-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html .sv-people > .lb-person.sv-person { padding: 20px 12px 14px; }
  html .sv-person .lb-face, html .sv-person .lb-face > *, html .sv-person .lb-pic { width: 56px; height: 56px; }
  html .sv-person .lb-person__who b { font-size: 16px; }
  html .sv-person .follow-btn { width: 100%; min-width: 0; justify-content: center; }
  html .lb-topic { max-width: 100%; }
  html .lb-topic__open { min-width: 0; padding-left: 16px; }
}

/* 9. Less motion: everything here is still ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html .sv-arrive > *, html .sv-shelf__mark { animation: none !important; }
  html .sv-card, html .sv-person, html .lb-topic, html .sv-go, html #libTabs [role="tab"] { transition: none !important; translate: none !important; }
}
html.a11y-reduce-motion .sv-arrive > *, html.a11y-reduce-motion .sv-shelf__mark { animation: none !important; }
html.a11y-reduce-motion .sv-card, html.a11y-reduce-motion .sv-person, html.a11y-reduce-motion .lb-topic, html.a11y-reduce-motion .sv-go, html.a11y-reduce-motion #libTabs [role="tab"] { transition: none !important; translate: none !important; }

/* Following on a phone (19 November 2026): a topic and its week wrap inside the chip instead of widening the page */
@media (max-width: 639.98px) {
  html .lb-topic { white-space: normal; max-width: 100%; }
  html .lb-topic__open { flex: 1 1 auto; flex-wrap: wrap; height: auto; min-height: 46px; padding-block: 8px; row-gap: 2px; min-width: 0; }
}
