/* game-kit e133600: css/chat-lib.css — edit in game-kit and run tools/kit-sync.js */
/* game-kit: chat standard 1.3 (docs/standard-chat.md 13) — the story library (js/chat-library.js), the shared talk list rows (js/chat-list.js), talk tools
   (js/chat-talk.js), header icon buttons, photos with HTML overlays. Load AFTER css/kit.css and css/chat-skins.css. Colours are the skin tokens (--cx-* from --gfc-*). */

/* ---- header icon buttons (ChatUI.headerButton(label, fn, { icon })) ---- */
.cx-hbtn.cx-hicon { border: 0; padding: 4px 6px; opacity: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 0.85em; min-height: 36px; min-width: 36px; justify-content: center; }
.cx-hbtn svg, .cx-back svg { display: block; }
.cx-back { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0; position: relative; }
.cx-back .cx-badge { margin-left: 0; }
.cx-speedbtn { border: 1px solid currentColor; border-radius: 999px; padding: 3px 10px 3px 6px; }
.cx-speedbtn svg { width: 16px; height: 16px; }

/* ---- photos: an image with HTML text overlays (words are page text, never part of a generated picture) ---- */
.cx-photo { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: #333; container-type: inline-size; cursor: zoom-in; display: block; width: min(232px, 62vw); }
.cx-photo img { display: block; width: 100%; height: auto; max-height: none; object-fit: fill; }
.cx-photo .cx-ov { position: absolute; inset: 0; pointer-events: none; }
.cx-photo .cx-ot { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); white-space: pre; line-height: 1.15; font-size: calc(var(--s) * 1cqw); }
.cx-photo .cx-ot-left { transform: translate(0, -50%) rotate(var(--r, 0deg)); }
.cx-photo .cx-ob { position: absolute; }
.cx-ot-hand { font-family: "Yomogi", "Klee One", "Hiragino Maru Gothic ProN", cursive; }
.cx-ot-mono { font-family: "SFMono-Regular", "Consolas", "Menlo", monospace; letter-spacing: 0.02em; }
.cx-ot-sans { font-family: inherit; font-weight: 700; }
.cx-ot-serif { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.cx-ot-plate { font-family: inherit; font-weight: 700; letter-spacing: 0.06em; border-radius: 2px; }
.cx-dochtml { width: 100%; }
.cx-missing { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 12px; padding: 10px; text-align: center; }
.cx-media.cx-photo { max-width: none; }
.cx-viewer-body .cx-photo { width: min(92vw, 720px, calc((100vh - 160px) * var(--ar, 1.3))); max-width: 100%; cursor: default; }
.cx-end-photo { margin-bottom: 10px; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.cx-end-photo .cx-photo { width: 100%; border-radius: 12px; cursor: inherit; }
.cx-end-photo img { max-height: 280px; object-fit: cover; }
.cx-end-cap { display: block; margin-top: 5px; font-size: 0.78em; color: var(--cx-meta); line-height: 1.5; }
.cx-viewer-body .cx-end-cap { display: none; }

/* ---- talk tools: search bar, hits, reactions, message menu ---- */
.cx-tsearch { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--cx-panel, #fff); color: var(--cx-panel-ink, #1d2328); border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.cx-tsearch[hidden] { display: none; }
.cx-tsearch input { flex: 1; min-width: 0; border: 0; border-radius: 10px; padding: 7px 10px; background: color-mix(in srgb, currentColor 9%, transparent); color: inherit; font: inherit; outline: none; }
.cx-tcnt { font-size: 0.78em; color: var(--cx-meta); min-width: 3.4em; text-align: center; }
.cx-tsearch button { background: none; border: 0; color: inherit; border-radius: 50%; min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.cx-tsearch .cx-ttxt { border-radius: 999px; padding: 0 8px; font-size: 0.82em; }
.cx-hit { background-image: linear-gradient(rgba(255, 214, 0, 0.18), rgba(255, 214, 0, 0.18)); }
.cx-hit-cur .cx-bubble, .cx-hit-cur.cx-post { outline: 2px solid #f0a81c; outline-offset: 1px; }
.cx-rx { align-self: flex-end; margin-top: -6px; padding: 1px 7px; border-radius: 999px; background: var(--cx-panel, #fff); color: var(--cx-panel-ink, #1d2328); font-size: 0.78em; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); z-index: 1; }
.cx-out .cx-rx { align-self: flex-end; }
.cx-in .cx-rx { align-self: flex-start; }
.cx-bm-prev { display: flex; flex-direction: column; gap: 2px; padding: 4px 2px 10px; font-size: 0.9em; }
.cx-bm-prev span { color: var(--cx-meta); overflow-wrap: anywhere; }
.cx-reacts { display: flex; gap: 6px; padding-bottom: 10px; flex-wrap: wrap; }
.cx-reacts button { min-width: 44px; height: 44px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: transparent; color: inherit; font-size: 1.05em; }
.cx-reacts button.on { background: var(--cx-accent); border-color: var(--cx-accent); color: #fff; }
.cx-pact { display: flex; gap: 10px; margin: 10px 0 4px; }
.cx-pact button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 12px; background: transparent; color: inherit; font-size: 0.82em; }
.cx-you { font-style: normal; font-size: 0.72em; color: var(--cx-accent); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.cm-cues { margin-top: 8px; font-size: 0.92em; }
.cm-cues summary { cursor: pointer; padding: 6px 0; }
.cm-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cm-seg button { border: 1px solid var(--gf-border-strong, #3a4048); background: transparent; color: inherit; border-radius: 999px; padding: 6px 14px; min-height: 40px; font: inherit; }
.cm-seg button.on { background: var(--gf-accent, #7fb09d); border-color: var(--gf-accent, #7fb09d); color: var(--gf-accent-ink, #0e1512); }
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.cm-note { font-size: 0.82em; opacity: 0.7; line-height: 1.7; }

/* ---- sheet menus and notes ---- */
.cx-lib-menu { list-style: none; margin: 0; padding: 0; }
.cx-lib-menu li > button, .cx-lib-menu li > a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; border: 0; background: transparent; color: inherit; text-align: left; text-decoration: none; min-height: 48px; font: inherit; }
.cx-lib-menu li > button:hover, .cx-lib-menu li > a:hover { background: color-mix(in srgb, currentColor 7%, transparent); }
.cx-lib-menu .cx-av { width: 38px; height: 38px; flex: none; }
.cx-lib-mt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-lib-mt span { font-size: 0.8em; color: var(--cx-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-lib-menu small { color: var(--cx-meta); font-size: 0.74em; flex: none; }
.cx-lib-note { margin: 6px 0 10px; font-size: 0.88em; color: var(--cx-meta); line-height: 1.7; }
.cx-lib-btns2 { display: flex; gap: 10px; margin-top: 10px; }
.cx-lib-btns2 .cx-btn { flex: 1; }

/* ---- the list rows (ChatHome and the library) ---- */
.cx-h-li { list-style: none; }
.cx-h-li .cx-h-row { text-decoration: none; display: flex; }
a.cx-h-row { color: inherit; }
.cx-h-row .cx-h-main > b { font-size: 0.98em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-h-ic { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--cx-meta); }
.cx-h-prev { color: var(--cx-meta); font-size: 0.86em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.cx-h-main .cx-h-prev { white-space: normal; text-overflow: clip; }
.cx-h-prev.typing { color: var(--cx-accent); font-weight: 700; }
.cx-h-row.soon { opacity: 0.55; cursor: pointer; }
.cx-h-row.soon .cx-av { background: #9aa3ad; }
.cx-h-row.muted .cx-badge { background: #a3abb5; }
.cx-h-side small { font-size: 0.9em; }
.cx-h-prog { font-size: 0.82em; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.cx-h-prog.full { color: var(--cx-accent); border-color: var(--cx-accent); }
.cx-h-search, .cx-lib-search { margin: 6px 16px 8px; display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, currentColor 10%, transparent); border-radius: 10px; padding: 7px 10px; }
.cx-h-search input, .cx-lib-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: inherit; outline: none; }
.cx-lib-search svg { color: var(--cx-meta); flex: none; }
.cx-lib-menu .cx-h-av { flex: none; }

/* ---- the library (many stories) ---- */
.cx-libroot { height: 100%; }
.cx-lib { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--cx-panel, #fff); color: var(--cx-panel-ink, #1d2328); }
.cx-lib-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.cx-lib-head h1 { margin: 0; flex: 1; font-size: 1.45em; letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; }
.cx-lib-head .cx-badge { margin-left: 0; }
.cx-lib-head .cx-hbtn { color: inherit; position: relative; }
.cx-lib-btns { display: inline-flex; align-items: center; gap: 6px; }
.cx-lib-btns .cx-hbtn { border-color: color-mix(in srgb, currentColor 35%, transparent); }
.cx-lib-btns .cx-hicon { border: 0; }
.cx-dot { position: absolute; top: 2px; right: 0; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.cx-lib-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cx-lib-body[hidden] { display: none; }
.cx-lib-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cx-lib-tabs { display: flex; gap: 6px; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.cx-lib-tabs button { padding: 5px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); background: transparent; color: var(--cx-meta); font-size: 0.82em; white-space: nowrap; }
.cx-lib-tabs button.on { background: var(--cx-panel-ink, #1d2328); color: var(--cx-panel, #fff); border-color: var(--cx-panel-ink, #1d2328); }
.cx-lib-sec { margin: 0; padding: 12px 16px 4px; font-size: 0.78em; color: var(--cx-meta); font-weight: 700; }
.cx-lib .cx-h-list { overflow: visible; flex: none; }
.cx-lib .cx-h-row { padding: 9px 16px; border-bottom: 0; background: transparent; color: inherit; min-height: 52px; }
.cx-lib .cx-h-row:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
.cx-lib .cx-h-row .cx-h-av .cx-av { width: 50px; height: 50px; font-size: 1.1em; }
.cx-lib .cx-h-row .cx-h-av .cx-av img { width: 100%; height: 100%; object-fit: cover; }
.cx-lib-row-touch { -webkit-touch-callout: none; }
.cx-lib-foot { padding: 18px 16px 28px; font-size: 0.74em; color: var(--cx-meta); }
.cx-lib-foot a { color: inherit; }
.cx-empty.cx-lib-empty { padding: 30px 16px; text-align: center; }
.cx-lib-nav { flex: none; display: flex; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); background: var(--cx-panel, #fff); padding-bottom: env(safe-area-inset-bottom); }
.cx-lib-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; font-size: 0.7em; color: var(--cx-meta); background: none; border: 0; position: relative; min-height: 48px; }
.cx-lib-nav button.on { color: var(--cx-panel-ink, #1d2328); font-weight: 700; }
.cx-lib-nav .cx-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
.cx-lib-fsec { padding: 12px 16px 4px; font-size: 0.78em; color: var(--cx-meta); font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.cx-lib-fsec a { color: var(--cx-accent); text-decoration: none; font-weight: 700; white-space: nowrap; }
.cx-lib-frow { display: flex; width: 100%; align-items: center; gap: 12px; padding: 7px 16px; text-align: left; background: none; border: 0; color: inherit; font: inherit; min-height: 48px; }
.cx-lib-frow:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
.cx-lib-frow .cx-av { width: 42px; height: 42px; }
.cx-lib-frow .cx-h-main > b { font-size: 0.95em; }
.cx-lib-rhead { margin: 8px 12px 6px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, currentColor 7%, transparent); }
.cx-lib-rhead .cx-av { width: 54px; height: 54px; font-size: 1.3em; }
.cx-lib-rhead b { font-size: 1.05em; display: block; }
.cx-lib-rhead small { color: var(--cx-meta); font-size: 0.78em; }
.cx-lib-rec { margin: 0 12px 10px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius: 14px; padding: 10px 12px; }
.cx-lib-rec h3 { margin: 0 0 4px; font-size: 0.92em; display: flex; gap: 8px; align-items: center; }
.cx-lib-rec h3 a { color: inherit; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-lib-rec ul { list-style: none; margin: 0; padding: 0; }
.cx-lib-rec li { display: flex; gap: 8px; align-items: baseline; font-size: 0.85em; padding: 3px 0; border-top: 1px dashed color-mix(in srgb, currentColor 18%, transparent); }
.cx-lib-tag { flex: none; font-size: 0.7em; font-weight: 800; letter-spacing: 0.08em; border-radius: 4px; padding: 0 6px; color: #fff; background: #59616b; }
.cx-lib-rec li.lock { color: var(--cx-meta); }
.cx-lib-rec li.lock .cx-lib-tag { background: transparent; color: var(--cx-meta); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.cx-lib-toast { position: absolute; left: 50%; bottom: 70px; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; z-index: 20; background: rgba(20, 24, 30, 0.92); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 0.85em; transition: opacity 0.2s, transform 0.2s; max-width: 90%; text-align: center; }
.cx-lib-toast.on { opacity: 1; transform: translate(-50%, 0); }
.cx-lib .cx-sheet { z-index: 30; }
@media (prefers-reduced-motion: reduce) { .cx-lib-toast { transition: none; } }
.cx-cs-btn.other span { background: #59616b; }
.cx-cs-btn { min-width: 72px; }
.cx-lib .cx-badge, .cx-h-side .cx-badge { font-style: normal; }
.cx-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
