/* The Library.
   Split from style.css (16 Nov 2026, C2): each page links css/base.css and its own sheets in <head>, in the order
   base, pattern, marketing, auth, make, library, settings, share, workspace; a rule that came later in style.css still
   comes later where both load. Its dark twin is css/library-dark.css (07_scripts/maintenance/site_dark_css.py).
   An !important left says why, on the line before its rule: what it must win over. */

/* --- Base main_right styles --- */

.library-page #main_right {
  height: auto;
  max-height: none;
  padding: 0 5.5%;
}

/* =======================
   LIBRARY STYLES
   ======================= */

#library_page_patternExportCanvas {
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  touch-action: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  aspect-ratio: 16/9;
}

.library_page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1.25rem;
}

/* !important: over #main_right div:not(.label):not(.su… */
.library_page-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-right: 0rem !important;
  padding-left: 0rem !important;
  /* Search, sort, Recently deleted and the view buttons go onto a second line when the window is narrow: at 768 px
     (a tablet held upright) they ran 60 px past the edge and the page scrolled sideways (UAT ACS-05, 30 Oct). */
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.library_page-view-toggle {
  display: flex;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 0.0625rem solid var(--White);
}

.library_page-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.library_page-loading-spinner {
  border: 0.25rem solid var(--Dusty-Gray);
  border-top: 0.25rem solid #333;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 1s linear infinite;
  margin: 1.5rem auto;
}

/* !important: over the New design's #library_page_patternList.library_p… */
.library_page-list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  overflow: visible !important;
  margin: 0 0.625rem 0 0;
}

/* !important: over #main_right div:not(.label):not(.su… (and more) */
.library_page-list-view .library_page-pattern-card-list {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border: 0.0625rem solid var(--White);
  border-radius: 0.5rem;
  background: var(--White);
  width: 100%;
  box-sizing: border-box;
  height: 3.125rem;
  padding-bottom: 0.125rem !important;
  padding-top: 0rem !important;
  position: relative;
  overflow: visible;
  margin-right: 0.625rem !important;
}

.library_page-list-view .library_page-pattern-card-items {
  width: 100%;
  height: 13.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.library_page-list-view .library_page-pattern-card button:hover {
  background: #1a4e96;
}

.library_page-list-view .library_page-pattern-card pre {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: #f4f6fa;
  border-radius: 0.375rem;
  font-size: 0.95em;
  color: #444;
  overflow-x: auto;
}

/* !important: over h2's !important (and more) */

.library_page-list-view .library_page-pattern-date {
  font-size: 0.875rem;
  color: var(--gray);
  font-weight: normal;
  font-family: var(--font-family-open-sans);
  margin-top: 0.125rem;
  text-align: center;
  width: 100%;
}

.library_page-pattern-card-list .library_page-pattern-date-container {
  flex: 1;
  text-align: center;
}

/* !important: over #main_right div:not(.label):not(.su… (and more) */

.library_page-grid-view .library_page-pattern-card {
  display: flex;
  flex-direction: column;
  border: 0.0625rem solid var(--White);
  border-radius: 1.25rem;
  background: var(--White);
  min-width: 0;
  min-height: 0;
}

.library_page-grid-view .library_page-pattern-card pre {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: #f4f6fa;
  border-radius: 0.375rem;
  font-size: 0.95em;
  color: #444;
  overflow-x: auto;
}

.library_page-grid-view .library_page-pattern-svg-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  height: 23.125rem;
  background: transparent;
  border-radius: 0.125rem;
  margin-bottom: 0rem;
  padding: 0.5rem; /* give SVG strokes breathing room */
  overflow: visible; /* avoid cutting pants/edges inside cell */
  box-sizing: border-box;
}

.library_page-grid-view .library_page-pattern-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  flex-direction: row;
  flex-wrap: wrap;
}

.library_page-grid-view .library_page-pattern-buttons-container {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: flex-start;
  margin-left: 0;
  /* Its own width: held to half the card, its six buttons ran over the pattern's name (UAT LIB-05, 30 Oct). */
  flex: 0 0 auto;
  max-width: 100%;
}

/* The name and date take the room left beside the buttons, or go under them when there isn't enough. */

.library_page-grid-view .library_page-pattern-actions .library_page-pattern-title {
  overflow-wrap: anywhere;
}

.library_page-pattern-title-container {
  width: 100%;
  max-width: fit-content;
  flex-direction: column;
  align-content: flex-end;
  font-weight: bold;
  font-size: 1rem;
  font-family: var(--font-family-open-sans);
  margin-right: 1.25rem;
}

/* !important: over the New design's .library-page .library_page-pattern… */
.library_page-pattern-date {
  font-weight: normal;
  font-size: 0.875rem !important;
  font-family: var(--font-family-open-sans);
  color: var(--gray);
  margin-top: 0.125rem;
  text-align: right;
  width: 100%;
}

.library_page-grid-view .library_page-export-menu-btn {
  position: relative;
  z-index: 1;
}

/* !important: over the New design's #library_page_patternList.library_p… */

.library_page-popup-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.library_page-popup-buttons {
  display: flex;
  gap: 0.5rem;
  position: relative;
}

.library_page-svg-popup-content .library_page-export-menu-btn {
  position: relative;
  z-index: 1;
}

/* !important: over h1's !important */
.library_page-popup-title {
  font-size: 2rem !important;
  font-weight: bold;
  font-family: var(--font-family-roboto);
  color: var(--Black);
  margin: 0;
  padding-left: 1.25rem;
  font-weight: bolder;
}

.library_page-version-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  background: var(--Pure-Blue);
  color: var(--White);
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  font-size: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library_page-version-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--Box-Shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn var(--transition);
}

.library_page-version-history-header {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin-bottom: 1rem;
}

.library_page-version-history-header h2 {
  margin: 0;
  font-size: 1.4em;
}

.library_page-version-history-list {
  max-height: 60vh;
  overflow-y: auto;
}

.library_page-no-versions {
  color: var(--gray);
  text-align: center;
  padding: 1.5rem;
}

.library_page-svg-popup-content-svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
}

/* Library search, and what the list says when nothing matches or loading failed. */

.library_page-search:focus-visible,
.library_page-pattern-card:focus-visible {
  outline: 0.125rem solid var(--Pure-Blue);
  outline-offset: 0.125rem;
}

.library_page-no-match,
.library_page-load-failed {
  padding: 1.5rem 0;
  color: var(--Boulder);
}

/* (19 Nov 2026, Israa: "make sure there are no other spacing issues": Try again sat against the message, its 0.75rem
   lost to .btn-rounded's margin: 0 !important in css/base.css. !important: over that.) */
.library_page-load-failed .btn-rounded {
  display: inline-flex;
  margin-left: 0.75rem !important;
}

/* The Library's order, Recently deleted and its window (LIB-04, LIB-08), and the notice's Undo. */

.library_page-bin-btn {
  padding: 0.5rem 0.875rem;
  border: 0.09375rem solid var(--Pure-Blue);
  border-radius: 1.25rem;
  background: var(--White);
  color: var(--Pure-Blue);
  font-family: var(--font-family-open-sans);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

/* (height: as tall as its list, up to the window's: it kept .modal-content's 325 px (css/base.css), so two deleted
   patterns already scrolled, the last one cut off at the window's edge, on a laptop with room to spare. 19 Nov 2026.) */
.library_page-bin-content {
  width: min(40rem, calc(100vw - 2rem));
  height: auto;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-sizing: border-box;
}

.library_page-bin-note {
  margin: 0 0 1rem;
  color: var(--Boulder);
  font-size: 0.875rem;
}

.library_page-bin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "name restore forever" "when restore forever";
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 0.0625rem solid #e5e7eb;
  text-align: left;
}

.library_page-bin-name { grid-area: name; font-weight: 600; overflow-wrap: anywhere; }
.library_page-bin-when { grid-area: when; color: var(--Boulder); font-size: 0.8125rem; }
.library_page-bin-restore { grid-area: restore; }
.library_page-bin-forever { grid-area: forever; }

.library_page-notice-btn {
  margin-left: 0.5rem;
  padding: 0.2rem 0.7rem;
  border: 0.0625rem solid #fff;
  border-radius: 1rem;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .library_page-controls { flex-wrap: wrap; }
  .library_page-bin-row { grid-template-columns: 1fr auto; grid-template-areas: "name name" "when when" "restore forever"; }
}

/* The next page of the library, under the cards in either view. */
.library_page-show-more {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
  margin: 1rem auto 2rem;
}

/* List view: the title takes a fixed share of the row, so the dates line up (they moved with the title's length). */
.library_page-list-view .library_page-pattern-card-list .library_page-pattern-title-container {
  flex: 0 0 40%;
  max-width: 40%;
  overflow: hidden;
}

.library_page-list-view .library_page-pattern-card-list .library_page-pattern-title {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =======================
   TRIAL BANNER STYLES
   ======================= */

/* Trial Expired / Ending Soon Banner */
/* While the trial banner shows (websocket_utils watchTrialBanner), what sits at the bottom moves up above it. */
body.library-page.trial-banner-shown { padding-bottom: var(--trial-banner-height, 0px); }

/* =======================
   MEDIA QUERIES
   ======================= */

/* 768px and below: Tablets/large phones */
@media (max-width: 768px) {
  .library_page-svg-popup-content {
    width: 95vw;
    height: 90vh;
    padding: 0.5rem;
  }

}

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

/* ---- Version history (version_history.js, history_drawer.js; 13 Nov 2026) ----
   Saves grouped by day with what each changed, the autosaves before each folded under it, a small picture, one main
   action (Open or Restore) and the rest under "⋯". The same list in the Library's window and the workspace's drawer. */
.library_page-version-history-header {
  flex-direction: column;
  align-items: center;
}
.vh-row.vh-busy {
  opacity: 0.55;
  pointer-events: none;
}
#library_page-version-history-content .library_page-version-history-list {
  min-width: min(44rem, calc(100vw - 4rem));
  max-height: calc(100% - 5rem);
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
}

/* ---- What was left from the redesign review (13 Nov 2026, evening: "fix what is left") ---- */

/* Library: two cards a row on a tablet (a 400 px card left one a row at 820 px); its buttons say what they do on hover
   or focus, are 44 px on a touch screen, and Delete is under ⋯ at the end of the row. */
.library_page-pattern-buttons-container > button[data-label],
.library_page-more-btn { position: relative; }
.library_page-pattern-buttons-container > button[data-label]::after,
.library_page-more-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: #000646;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 20;
}
.library_page-pattern-buttons-container > button[data-label]:is(:hover, :focus-visible)::after,
.library_page-more-btn:is(:hover, :focus-visible)[aria-expanded="false"]::after { opacity: 1; }
.library_page-more { position: relative; display: inline-flex; margin-left: 0.5rem; }
.library_page-grid-view .library_page-pattern-card .library_page-more-menu button,
.library_page-list-view .library_page-pattern-card .library_page-more-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0 10px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: #FFFFFF;
  color: #B3261E;
  font-size: 0.9375rem;
  text-align: left;
}

/* ---- Phones (13 Nov 2026, Israa): Make a pattern takes photos of the drawings and keeps them for later
   (script/make/phone_drawings.js); the Library is for looking, downloading and sharing, with no editing. ---- */

/* The Library on a phone: look, download and share (Share opens the export window in share mode); no editing. */
/* !important: over the display of a rule loaded later */
.library_page-share-btn { display: none !important; }
/* !important: over .hide-mobile's !important */
html.phone-library .library_page-share-btn { display: inline-flex !important; align-items: center; justify-content: center; }
html.phone-library .library_page-pattern-buttons-container > button { min-width: 48px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
/* The Library's line icons one size (a phone rule made bare svgs larger): 16 px, 20 px on a phone's bigger buttons. */
/* !important: over the inline width a script sets (and more) */
.library_page-pattern-buttons-container svg,
.library_page-popup-buttons svg { width: 16px !important; height: 16px !important; flex: none; }
/* !important: over #userProfileBtn (and more) */
html.phone-library .library_page-pattern-buttons-container svg { width: 20px !important; height: 20px !important; }

/* ==== The style system (13 Nov 2026, Israa: "do all the other recommendations"): the canvas's Style boards made the
   site's. The tokens are on :root (--ds-*), and the headings, buttons and fields are set where they are defined; here
   the body's type, placeholders, the sizes that had their own, one kind of tab, switches, Legal's text. ==== */

/* The Library card's buttons (13 Nov 2026, the style system): line icons in the ink on white, and one blue, Edit in
   the workspace; they were six blue squares with white pictures. ⋯ matches them. */
/* !important: over .library_page-grid-view .library_pa… (and more) */
.library_page-pattern-card .library_page-pattern-buttons-container > button,
.library_page-grid-view .library_page-pattern-card .library_page-more-btn,
.library_page-list-view .library_page-pattern-card .library_page-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 36px;
  padding: 0 !important;
  background: var(--ds-surface) !important;
  color: var(--ds-ink) !important;
  border: 1px solid var(--ds-line-strong) !important;
  border-radius: 8px !important;
}
/* !important: over .library_page-list-view .library_pa… (and more) */
.library_page-pattern-card .library_page-pattern-buttons-container > .library_page-open-in-workspace-btn {
  background: var(--ds-brand) !important;
  border-color: var(--ds-brand) !important;
  color: #FFFFFF !important;
}
/* !important: over .library_page-pattern-card .library…'s !important */
.library_page-pattern-card .library_page-pattern-buttons-container > .library_page-open-in-workspace-btn:hover {
  background: var(--ds-brand-hover) !important;
  border-color: var(--ds-brand-hover) !important;
  color: #FFFFFF !important;
}
/* The details window's buttons: their icon beside the words. */
.library_page-popup-buttons .btn-rounded { display: inline-flex; align-items: center; gap: 8px; }

/* ===== Account and Library round, 15 Nov 2026 (site account helper) ===== */
/* The Library's filters (M38): Show (all, recent, starred, a folder, a tag), Garment, Size, Edited, the folder's own
   buttons, Clear filters, and how many patterns are shown. */
.library_page-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 18px;
}
.library_page-filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; color: #303850; }
.library_page-filter-label { font-weight: 600; }
.library_page-filter-select {
  min-height: 40px;
  max-width: 16rem;
  padding: 0 10px;
  border: 1px solid #C5C9D6;
  border-radius: 8px;
  background: #FFFFFF;
  color: #000646;
  font: inherit;
  font-size: 0.9375rem;
}
.library_page-filter-select:focus-visible { outline: 3px solid #A8B8FF; outline-offset: 1px; }
.library_page-filter-select:disabled { opacity: 0.6; }
.library_page-filters .library_page-filter-btn { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }
.library_page-result-line { flex-basis: 100%; margin: 2px 0 0; color: #4B5162; font-size: 0.875rem; }
@media (pointer: coarse) {
  .library_page-filter-select, .library_page-filters .library_page-filter-btn { min-height: 44px; }
}
/* A card's star, its garment and size, folder and tags. */
.library_page-star-btn[aria-pressed="true"] { color: #8A5A00; }
.library_page-star-btn[aria-pressed="true"] svg { fill: #F2B705; stroke: #8A5A00; }
.library_page-pattern-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 2px;
  color: #4B5162;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.library_page-pattern-facts:empty { display: none; }
.library_page-pattern-folder { display: inline-flex; align-items: center; gap: 4px; }
/* !important: over .pattern-sheet-wrap svg.pattern-she… (and more) */
.library_page-pattern-folder svg { width: 14px !important; height: 14px !important; aspect-ratio: auto; flex: none; margin: 0; }
.library_page-pattern-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.library_page-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: #EEF1FF;
  color: #1A2A8F;
  font-size: 0.75rem;
}
/* Move to folder and Tags windows (app_dialog.js askWith). */
.app-dialog-choices { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.app-dialog-choices legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.app-dialog-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.app-dialog-tags li.app-dialog-tags-none { padding: 2px 0; background: transparent; color: #4B5162; }
.app-dialog-tag-remove { min-width: 28px; min-height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; }
.app-dialog-tag-remove:focus-visible { outline: 2px solid #1A2A8F; }
.app-dialog-tag-add { display: flex; gap: 8px; align-items: center; }
.app-dialog-tag-add .app-dialog-input { flex: 1; margin: 0; }
/* Recently deleted (M39): a picture of each, when it was deleted and last edited, and Restore all. */
.library_page-bin-row {
  grid-template-columns: 96px 1fr auto auto;
  grid-template-areas: "picture words restore forever";
}
.library_page-bin-picture { grid-area: picture; width: 96px; height: 66px; border: 1px solid #E3E3EA; border-radius: 6px; background: #FFFFFF; overflow: hidden; }
/* !important: over .pattern-sheet-wrap svg.pattern-she… */
.library_page-bin-picture svg { width: 100% !important; height: 100% !important; aspect-ratio: auto; }
.library_page-bin-words { grid-area: words; min-width: 0; }
.library_page-bin-edited { color: #4B5162; font-size: 0.8125rem; }
/* (!important: over .btn-rounded's margin: 0 in css/base.css, which put Restore all against the list's top line.
   19 Nov 2026, Israa: "make sure there are no other spacing issues". This sheet comes after base.css.) */
.library_page-bin-all { margin: 0 0 8px !important; }
@media (max-width: 640px) {
  .library_page-bin-row { grid-template-columns: 72px 1fr; grid-template-areas: "picture words" "restore forever"; }
  .library_page-bin-picture { width: 72px; height: 50px; }
}
/* The pattern's window on a phone: the width of the screen, its buttons wrapping (B-LB1: it was 1,000 px wide). */
/* !important: over .library_page-pattern-buttons-conta…'s !important (and more) */
html.phone-library #library_page-svg-popup-content {
  width: calc(100vw - 16px) !important;
  max-width: calc(100vw - 16px) !important;
  padding: 12px !important;
}
html.phone-library .library_page-popup-header { flex-wrap: wrap; gap: 8px; }
html.phone-library .library_page-popup-buttons { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
html.phone-library .library_page-popup-buttons .btn-rounded { min-height: 44px; }
/* !important: over #userProfileBtn */
html.phone-library .library_page-svg-popup-content-svg-container { max-width: 100% !important; }

/* ---- Content pages, the landing's real example, Pricing's promises (15 Nov 2026: M7, M33, M34, M44, M45) ----
   News and its articles, Made with Mildbury, Status, Security and the Accessibility statement (content-page.js) share
   these: a plain head (eyebrow, title, one line) and a 52rem reading column. Colours are written out so that
   07_scripts/maintenance/site_dark_css.py gives each its dark twin. */
/* A card's garment, size, folder and tags line up with its name and date (right, in the grid), in plain weight. */
.library_page-grid-view .library_page-pattern-facts { justify-content: flex-end; }
.library_page-pattern-facts { font-weight: 400; }
.library_page-share-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #EEF1FF; color: #1A2A8F; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.library_page-share-badge[data-new="true"] { background: #1A2A8F; color: #ffffff; }

/* "Continue where you left off" (16 Nov 2026, script/library/library_continue.js): this tab's pattern in progress, above the list,
   with a small picture of its pieces, the workspace's words for its state, Continue and Save to Library. */
.lib-continue {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #c9d3ff;
  border-radius: 14px;
  background: #f4f6ff;
  color: #000646;
}
.lib-continue-pic { width: 112px; height: 80px; border-radius: 10px; background: #ffffff; color: #4a5868; display: flex; align-items: center; justify-content: center; }
.lib-continue-pic svg { display: block; width: 112px; height: 80px; }
.lib-continue-pic-empty::before { content: ""; width: 34px; height: 44px; border: 2px solid #9aa3b8; border-radius: 4px 4px 10px 10px; }
.lib-continue-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lib-continue-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em; color: #4a5868; }
.lib-continue-name { font-size: 1.125rem; font-weight: 600; color: #000646; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-continue-state { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: #8a4b00; }
.lib-continue-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #b45309; }
.lib-continue-actions { display: flex; gap: 8px; justify-content: flex-end; }
.lib-continue-actions .btn-rounded { white-space: nowrap; }
@media (max-width: 600px) {
  .lib-continue { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .lib-continue-pic, .lib-continue-pic svg { width: 72px; height: 52px; }
  .lib-continue-actions { grid-column: 1 / -1; justify-content: stretch; }
  .lib-continue-actions .btn-rounded { flex: 1 1 0; min-height: 44px; }
}
/* The Library pattern open in this tab, with nothing new: its own card says so. */
.library_page-pattern-card[data-open-here] { position: relative; }
.lib-open-here {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 10px;
  border: 1px solid #c9d3ff;
  border-radius: 999px;
  background: #eef1ff;
  color: #1a2a8f;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
/* In the list, under the pattern's name (over the picture's corner in the grid). */
.library_page-pattern-card-list .lib-open-here { position: static; display: inline-block; align-self: flex-start; margin-top: 4px; }
/* The Team section (20 Nov 2026, the team workspace: script/library/team_library.js): the patterns shared with a team,
   in place of the account's own list (and the controls that work that list) while it is shown. Both designs. */
/* !important: over the list's own display rules (both designs). */
html.team-lib-on #library_page_patternList,
html.team-lib-on .lib-continue,
html.team-lib-on .library_page-controls > :is(input, select, .library_page-view-toggle, #library_page_importBtn) { display: none !important; }
.team-lib[hidden] { display: none; }
.team-lib { margin: 0 0 24px; }
.team-lib:focus { outline: none; }
.team-lib-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: #000646; }
.team-lib-sub { margin: 4px 0 16px; color: #4b5162; font-size: 0.875rem; line-height: 1.5; }
.team-lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.team-lib-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid #e3e3ea; border-radius: 12px; background: #ffffff; }
.team-lib-pic { width: 96px; height: 66px; border-radius: 8px; background: #f4f5f8; color: #1a1f36; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.team-lib-pic svg { display: block; }
.team-lib-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-lib-name { font-size: 1rem; font-weight: 600; color: #000646; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-lib-meta { font-size: 0.8125rem; color: #4b5162; }
.team-lib-status:empty { display: none; }
.team-lib-editing { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #fff4e5; color: #8a4b00; font-size: 0.75rem; font-weight: 600; }
.team-lib-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.team-lib-btn { min-height: 44px; white-space: nowrap; }
.team-lib-empty { color: #4b5162; }
/* A row's status and its comments, unfolded under it (20 Nov 2026, helper E: script/library/team_comments_row.js). */
.team-lib-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.team-lib-badge { padding: 2px 10px; border-radius: 999px; background: #eef0f6; color: #000646; font-size: 0.75rem; font-weight: 600; }
.team-lib-status[data-kind="review"] .team-lib-badge { background: #fff4e5; color: #8a4b00; }
.team-lib-status[data-kind="approved"] .team-lib-badge { background: #e7f4ea; color: #1e6b34; }
.team-lib-status[data-kind="changed"] .team-lib-badge { background: #fdecea; color: #b3261e; }
.team-lib-count { color: #4b5162; font-size: 0.75rem; }
.team-lib-comments { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid #e3e3ea; color: #2b3550; font-size: 0.875rem; line-height: 1.45; }
.team-lib-comments p { margin: 0; }
.team-lib-c-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.team-lib-c { padding: 8px 10px; border-radius: 8px; background: #f4f5f8; }
.team-lib-c-meta, .team-lib-c-empty, .team-lib-c--resolved .team-lib-c-text { color: #4b5162; font-size: 0.8125rem; }
.team-lib-c-text { color: #000646; white-space: pre-wrap; overflow-wrap: anywhere; }
.team-lib-c-log summary { display: flex; align-items: center; min-height: 44px; color: #000646; font-weight: 600; cursor: pointer; }
.team-lib-c-log ol { margin: 0; padding-left: 18px; font-size: 0.8125rem; }
@media (max-width: 640px) {
  .team-lib-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .team-lib-pic { width: 72px; height: 50px; }
  .team-lib-actions { grid-column: 1 / -1; justify-content: stretch; }
  .team-lib-actions .team-lib-btn { flex: 1 1 0; }
}
/* A student's assignment work (20 Nov 2026, script/library/class_tags.js): "Class work: Bodice block · Submitted". */
.lib-class-tag { display: inline-block; max-width: calc(100% - 16px); margin-top: 4px; padding: 2px 8px; border-radius: 8px; background: #e8eeff; color: #1a2a8f; font-size: 0.75rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
