/* The Library window (library-window.mjs), laid out as Hiroshi drew it on 11.11.2026. It fills the screen under the
   top bar. No background is set here: the window keeps the site's own window colour (.window), and the tiles are
   lines only; Hiroshi makes the background himself. One size for every heading, so the windows' titles match. */
.public-scene .library-window{position:fixed;left:0;right:0;bottom:0;top:86px;z-index:25;width:auto;max-width:none;min-width:0;margin:0;border-radius:0;border-left:0;border-right:0;border-bottom:0;display:flex;flex-direction:column;font:400 14px/1.45 "Living Sans",system-ui,sans-serif;color:var(--ink);animation:none}
.library-window[hidden]{display:none!important}
/* The Library is the whole screen: the chat row at the bottom rests while it is open. */
.library-open>footer.site-credit{visibility:hidden}
.library-head{display:flex;align-items:center;gap:14px;padding:10px 18px;border-bottom:1px solid var(--border);flex:none}
.library-tabs{display:flex;gap:6px;flex-wrap:wrap}
.library-tab{min-height:44px;padding:8px 14px;border:1px solid transparent;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font:400 19px/1.25 "Living Sans",system-ui,sans-serif;cursor:pointer}
.library-tab[aria-selected=true]{color:var(--ink);border-bottom-color:var(--accent)}
.library-tab:is(:hover,:focus-visible){color:var(--ink);outline:none;border-bottom-color:#b9dae9}
.library-credits{margin-left:auto;display:flex;align-items:center;gap:8px;white-space:nowrap}
.library-circles{display:inline-flex;align-items:center}
.library-circles>i{display:block;width:13px;height:13px;margin-left:-4px;border:1.5px solid var(--accent);border-radius:50%}
.library-circles>i:first-child{margin-left:0}
.library-credit-count{font-weight:400;font-size:16px;color:var(--ink)}
.library-head>.close-window{flex:none;min-width:44px;min-height:44px;font-size:22px}
.library-middle{flex:1;min-height:0;display:grid;grid-template-columns:minmax(190px,250px) minmax(0,1fr);gap:0}
.library-window[data-reading=true] .library-middle{grid-template-columns:minmax(190px,250px) minmax(260px,1fr) minmax(0,1.4fr)}
.library-kinds{overflow:auto;padding:14px 10px 14px 18px;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:2px}
.library-group{margin:12px 0 2px;color:var(--ink);font-size:17px}
.library-group:first-child{margin-top:0}
.library-group{display:flex;align-items:center;gap:8px}
.library-group-mark{flex:none;width:22px;height:22px;display:block;object-fit:contain}
.library-kind{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:8px 10px;border:0;border-left:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font:inherit;font-size:15px;text-align:left;cursor:pointer}
.library-kind.in-group{padding-left:22px}
.library-kind[aria-current=true]{color:var(--ink);border-left-color:var(--accent)}
.library-kind:is(:hover,:focus-visible){color:var(--ink);outline:none;border-left-color:#b9dae9}
.library-main{min-width:0;overflow:auto;padding:16px 20px}
.public-scene .library-window .library-kind-title,.library-window .library-kind-title{margin:0 0 12px;letter-spacing:0;font:400 19px/1.25 "Living Sans",system-ui,sans-serif;color:var(--ink)}
.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.library-tile{display:flex;flex-direction:column;gap:6px;min-width:0;padding:8px;border:1px solid var(--border);border-radius:8px}
.library-preview{position:relative;aspect-ratio:4/3;display:grid;place-items:center;overflow:hidden;border:1px solid var(--border);border-radius:5px}
.library-preview>img{width:100%;height:100%;object-fit:cover;display:block}
.library-preview>svg{width:78%;height:78%;fill:none;stroke:var(--accent);stroke-width:.9;stroke-linejoin:round}
.library-preview>img[src$=".svg"]{object-fit:contain}
.library-preview-kind{color:var(--muted);font-size:13px;letter-spacing:.08em}
.library-sample-mark{padding:2px 7px;border:1px solid #e6c877;border-radius:3px;color:#e6c877;font-size:11px;letter-spacing:.08em;white-space:nowrap}
.library-preview>.library-sample-mark{position:absolute;top:6px;left:6px}
.library-sample-note{margin:0 0 12px;color:var(--muted)}
.library-name{font-weight:400;font-size:15px;color:var(--ink);overflow-wrap:anywhere}
.library-meta{color:var(--muted);font-size:13px;min-height:1.2em}
.library-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.library-action{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:6px 10px;border:1px solid var(--border);border-radius:5px;background:transparent;box-shadow:none;color:var(--ink);font:inherit;font-size:13px;text-decoration:none;cursor:pointer}
.library-action:is(:hover,:focus-visible){border-color:var(--accent);outline:none}
.library-action.is-waiting{color:var(--muted);border-style:dashed;cursor:help}
.library-ask{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--ink)}
/* Nothing kept yet: a box with an X (Hiroshi: „ще пазим кутийката с един хикс, че няма още“). */
.library-empty{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(260px,100%);padding:14px;color:var(--muted);text-align:center}
.library-empty-cross{position:relative;display:block;width:150px;aspect-ratio:4/3;border:1px dashed var(--muted);border-radius:8px;overflow:hidden}
.library-empty-cross::before,.library-empty-cross::after{content:'';position:absolute;left:50%;top:-25%;height:150%;border-left:1px dashed var(--muted)}
.library-empty-cross::before{transform:rotate(53.13deg)}
.library-empty-cross::after{transform:rotate(-53.13deg)}
.library-empty>p{margin:0;font-size:15px}
.library-loading{color:var(--muted)}
.library-search{display:flex;gap:8px;margin:0 0 10px}
.library-search>input{flex:1;min-width:0;min-height:40px;padding:8px 10px;border:1px solid var(--border);border-radius:5px;background:transparent;color:var(--ink);font:inherit}
.library-newest{margin:0 0 6px;color:var(--muted);font-size:13px}
.library-conversation-list{display:flex;flex-direction:column;gap:6px}
.library-conversation-open{display:flex;flex-direction:column;gap:2px;width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--border);border-left:2px solid transparent;border-radius:5px;background:transparent;box-shadow:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.library-conversation-open>strong{font-weight:400;font-size:15px}
.library-conversation-open>small{color:var(--muted);font-size:12px}
.library-conversation-open[aria-current=true],.library-conversation-open:is(:hover,:focus-visible){border-left-color:var(--accent);outline:none}
.library-reading{min-width:0;overflow:auto;padding:16px 22px;border-left:1px solid var(--border)}
.public-scene .library-window .library-reading>h3,.library-window .library-reading>h3{margin:0 0 10px;letter-spacing:0;font:400 19px/1.3 "Living Sans",system-ui,sans-serif}
.library-reading-text{margin-top:14px;white-space:pre-wrap;font-size:15px;line-height:1.7;overflow-wrap:anywhere}
/* The lower bar: the buttons at the left; at the far right, always, the credits and the plan. */
.library-foot{flex:none;display:flex;align-items:center;gap:12px;min-height:52px;padding:6px 18px;border-top:1px solid var(--border)}
.library-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.library-sort{display:inline-flex;align-items:center;gap:6px;color:var(--ink)}
.library-sort>select{min-height:36px;padding:6px 8px;border:1px solid var(--border);border-radius:5px;background:var(--panel);color:var(--ink);font:inherit}
.library-generate{min-height:36px;padding:6px 10px;border:1px dashed var(--border);border-radius:5px;background:transparent;box-shadow:none;color:var(--muted);font:inherit;cursor:help}
.library-generate:is(:hover,:focus-visible){color:var(--ink);border-color:var(--accent);outline:none}
.library-note{flex:1;min-width:0;margin:0;color:var(--muted);font-size:13px}
.library-foot-wallet{margin-left:auto;display:flex;align-items:center;gap:12px;white-space:nowrap}
.library-plan{color:var(--muted)}
/* The credits and the plan at the right end of the lower bar, on the three pages: one button with the three circles and
   „N кредита“ as in „Моята библиотека“, then the plan; a press opens „Кредити и абонамент“. No „+“ (Hiroshi, 11.11.2026,
   points 69 and 76: „Там да има само абонаментът и колко кредита има. Никакъв „+“.“). */
.site-wallet{display:flex;align-items:center;margin-left:4px;white-space:nowrap;color:#dcebf2}
.site-wallet-open{display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:0 6px;border:0;border-radius:2px;background:transparent;box-shadow:none;color:inherit;font:inherit;cursor:pointer}
.site-wallet-open[hidden]{display:none}
.site-wallet-open:is(:hover,:focus-visible){color:#e9f5fa;background:transparent;box-shadow:none;outline:none}
.site-wallet-open:focus-visible{outline:1px solid #b9dae9;outline-offset:2px}
/* The whole border is written here: on /sketch/ and /dance/ the Library's --accent is not set, and the circles would not show. */
.site-wallet .library-circles>i{width:11px;height:11px;border:1.5px solid #b9dae9}
.site-wallet-plan{color:#93aab7}
/* 0.1.17 (points 67, 77, 79): with the Library open its two words, „×“ and its tools stand in the site's lower bar and look as
   the other words of that bar do; the window has no row of its own above or below (library-window.mjs, inBar). The chosen
   library is lit and keeps the thin line under it; the other one is pale. */
.library-bar-words,.library-bar-tools{display:flex;align-items:center;gap:4px;min-width:0}
.library-bar-words[hidden],.library-bar-tools[hidden]{display:none}
.library-bar-words>.library-tabs{flex-wrap:nowrap;gap:4px}
.site-program-bar .library-bar-words .library-bar-tab{color:#93aab7}
.site-program-bar .library-bar-words .library-bar-tab:is(:hover,:focus-visible){color:#e9f5fa}
.site-program-bar .library-bar-words .library-bar-tab[aria-selected=true]{color:#e9f5fa}
.site-program-bar .library-bar-words .library-bar-tab[aria-selected=true]::after{opacity:1;transform:scaleX(1)}
.site-program-bar .library-bar-words .library-bar-close{margin-left:6px;padding:1px 7px;font-size:20px;line-height:1}
.site-program-bar .library-bar-words .library-bar-close::before,.site-program-bar .library-bar-words .library-bar-close::after{display:none}
.library-tools.in-bar{flex-wrap:nowrap;gap:4px}
.library-tools.in-bar .library-sort{gap:4px;padding:0 6px;color:#dcebf2}
.library-tools.in-bar .library-sort>select{min-height:26px;padding:2px 6px;border:1px solid #47687a;border-radius:3px;background:transparent;color:#dcebf2;color-scheme:dark;font:inherit}
.site-program-bar .library-bar-tools .library-bar-generate{cursor:help}
.library-window[data-in-bar=true] .library-foot{min-height:0}
.library-foot[hidden]{display:none}
@media(max-width:900px){
 .library-middle,.library-window[data-reading=true] .library-middle{grid-template-columns:1fr;grid-auto-rows:min-content;overflow:auto}
 .library-kinds{flex-direction:row;flex-wrap:wrap;align-items:center;border-right:0;border-bottom:1px solid var(--border);padding:8px 12px;overflow:visible}
 .library-group{margin:0 4px 0 8px}
 .library-kind,.library-kind.in-group{padding:6px 8px;border-left:0;border-bottom:2px solid transparent}
 .library-kind[aria-current=true]{border-bottom-color:var(--accent)}
 .library-main,.library-reading{overflow:visible;padding:12px}
 .library-reading{border-left:0;border-top:1px solid var(--border)}
 .library-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
 .library-head{padding:8px 12px;gap:8px}
 .library-tab{font-size:17px;padding:6px 8px}
 .library-foot{flex-wrap:wrap;padding:6px 12px}
 .library-note{flex-basis:100%;order:3}
}
