/* The Animoso Library. On top of animoso.app's site.css (the same tokens, nav, buttons, glass, tags). */
.lib-word { color: var(--amber); }
.nav-wrap { position: relative; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lib-hero { padding: clamp(24px, 5vw, 56px) 0 18px; }
.lib-hero .wrap { display: grid; gap: 16px; max-width: 860px; margin-left: max(16px, (100% - 1160px) / 2); }
.lib-hero h1 { font-size: clamp(32px, 5vw, 58px); }
.lib-hero .lead { max-width: 60ch; }

/* in the app (?app=1): no website chrome, a compact top */
.app-only { display: none; }
html.in-app .app-only { display: inline; }
html.in-app .web-only { display: none !important; }
html.in-app .lib-hero { padding: 18px 0 6px; }
html.in-app .lib-hero h1 { font-size: clamp(24px, 3.4vw, 34px); }
html.in-app .lib-hero .kicker { display: none; }
html.in-app .lib-hero .lead { font-size: 15px; }
html.in-app .nav { padding: 8px 0; }

/* ---------- search and filters ---------- */
.filters-wrap { position: sticky; top: 76px; z-index: 10; padding: 6px 0 4px; }
html.in-app .filters-wrap { top: 60px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; border-radius: 18px;
  background: var(--card-solid); }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--bg-2); color: var(--soft); }
.search:focus-within { border-color: var(--amber); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.chips { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--edge); }
.chip { font: inherit; font-weight: 800; font-size: 14px; padding: 8px 12px; min-height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--soft); cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--amber-soft); color: var(--hl); }
.sel select { font: inherit; font-weight: 700; font-size: 14px; height: 44px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--edge);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23888' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  color: var(--ink); appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%; }
.count { margin: 8px 4px 0; min-height: 1.4em; }
@media (max-width: 640px) {
  .filters-wrap { position: static; }
  .search { flex-basis: 100%; }
  .chips { flex: 1 1 100%; justify-content: space-between; }
  .chip { flex: 1; }
  .sel { flex: 1 1 calc(50% - 5px); min-width: 0; } .sel select { width: 100%; }
}

/* ---------- sections and cards ---------- */
.lib-sec { padding: 26px 0 8px; }
.lib-sec[hidden] { display: none; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: clamp(24px, 3vw, 32px); }
.sec-note { margin: -6px 0 14px; max-width: 70ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid.packs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .grid.packs { grid-template-columns: 1fr; } }

.card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; min-width: 0; }
.card .pic { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden;
  background-color: #efece4;   /* pictures are often black line art: always shown on light paper */
  background-image: linear-gradient(45deg, rgba(0,0,0,.045) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.045) 75%),
                    linear-gradient(45deg, rgba(0,0,0,.045) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.045) 75%);
  background-size: 22px 22px; background-position: 0 0, 11px 11px; }
.card[data-kind="place"] .pic, .packs .card .pic { aspect-ratio: 16 / 9; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card[data-kind="place"] .pic img { object-fit: cover; padding: 0; }
.card .pic .none { color: #8d8a80; display: grid; gap: 6px; justify-items: center; font-size: 13px; font-weight: 700; }
.card .pic .none .i { width: 34px; height: 34px; }
.card .dim { position: absolute; top: 8px; left: 8px; }
.card .dim .tag { background: var(--card-solid); color: var(--ink); border: 1px solid var(--edge); }
.card .body { display: grid; gap: 7px; padding: 12px 14px 14px; align-content: start; flex: 1; }
.card h3 { font-size: 17px; overflow-wrap: anywhere; }
.card .by { font-size: 13px; color: var(--soft); overflow-wrap: anywhere; }
.card .by a { color: var(--soft); text-decoration-color: var(--edge); text-underline-offset: 3px; }
.card .by a:hover { color: var(--ink); }
.card .has { font-size: 13px; color: var(--faint); }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--faint); font-weight: 700; }
.lic { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; text-decoration: none;
  background: rgba(95, 224, 166, .13); color: var(--ok); }
.lic:hover { text-decoration: underline; }
.lic.own { background: var(--amber-soft); color: var(--hl); }
.lic .i { width: 13px; height: 13px; }
.card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.card .acts .btn { flex: 1 1 auto; min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: 9px 12px; font-size: 14px; border-radius: 10px; }
.card .acts .btn.done { background: rgba(95, 224, 166, .13); color: var(--ok); border-color: transparent; box-shadow: none; }
.card .acts .btn.fail { background: rgba(255, 110, 90, .14); color: #ff8a74; border-color: transparent; box-shadow: none; }
.card .bar { height: 4px; border-radius: 2px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.card .bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }
.card .msg { font-size: 12px; color: var(--soft); }
.card .how { font-size: 13px; color: var(--soft); padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--edge); }
@media (max-width: 520px) {
  .card .body { padding: 10px 10px 12px; gap: 6px; }
  .card h3 { font-size: 15px; }
  .card .acts .btn { flex-basis: 100%; padding: 9px 8px; font-size: 13px; gap: 6px; }
  .card .has { display: none; }
}
.empty { padding: 22px; text-align: center; color: var(--soft); margin: 20px 0; }
.foot { padding: 40px 0 50px; border-top: 1px solid var(--edge); margin-top: 50px; }
.foot .fine { font-size: 13px; color: var(--faint); max-width: 90ch; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 14px; background: var(--card-solid); border: 1px solid var(--edge); box-shadow: var(--shadow); font-size: 14px; font-weight: 700; }
