/* Chat's compact library uses shared option capsules, one panel, and quiet actions. */
.sticker-dialog{--sticker-track:var(--field-bg);--sticker-selected:var(--send-bg);--sticker-save:var(--send-bg);--sticker-save-text:var(--accent-fg);--sticker-selected-text:var(--accent-fg);box-sizing:border-box;width:min(560px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - var(--keyboard-offset,0px) - 32px);margin:auto auto 16px;padding:0;border:0;border-radius:18px;background:var(--panel-bg);color:var(--text);box-shadow:var(--panel-shadow);font:13px/1.75 var(--font-cn);backdrop-filter:blur(18px)}
.sticker-dialog::backdrop{background:rgba(0,0,0,.35)}
.sticker-dialog[open]{display:flex;flex-direction:column}
.sticker-dialog [hidden]{display:none!important}
.sticker-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--hairline);flex:none}
.sticker-head h2{margin:0;font:400 19px/1.5 var(--font-cn)}
.sticker-dialog button{font:12px/1.5 var(--font-cn);color:var(--sticker-selected-text);border:0;background:var(--sticker-selected);border-radius:10px;position:relative;min-height:30px;min-width:44px;padding:6px 10px;cursor:pointer}
.sticker-dialog button:disabled{opacity:.55;cursor:default}
.sticker-dialog button:focus-visible,.chat-sticker:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sticker-dialog button:active{filter:brightness(.92)}
.sticker-head button,.sticker-dialog .sticker-back{background:transparent;color:var(--text-soft);min-height:44px;padding:8px 0}
.sticker-body{padding:16px 18px 18px;overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--text-faint) transparent}
.sticker-tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:3px;width:190px;max-width:100%;background:var(--sticker-track);border-radius:13px}
.sticker-tabs button{background:transparent;color:var(--text-soft);min-height:30px;padding:6px 10px;border-radius:10px}
.sticker-tabs button[aria-pressed=true]{background:var(--sticker-selected);color:var(--sticker-selected-text);box-shadow:0 2px 9px rgba(10,14,4,.18)}
.sticker-actions{display:flex;flex-wrap:wrap;gap:14px 8px;margin:14px 0 8px}
.sticker-dialog .sticker-primary{background:var(--sticker-save);color:var(--sticker-save-text)}
.sticker-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 8px;min-height:80px;margin-top:8px}
.sticker-dialog .sticker-tile{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;min-width:0;padding:4px;background:transparent;border-radius:10px}
.sticker-tile img{width:100%;height:auto;aspect-ratio:1;object-fit:contain;pointer-events:none}
.sticker-tile span{font-size:11.5px;line-height:1.6;overflow-wrap:anywhere;max-width:100%;color:var(--text-soft)}
.sticker-status,.sticker-hint{font:12px/1.7 var(--font-cn);color:var(--text-soft);margin:12px 0 8px;overflow-wrap:anywhere}
.sticker-status:empty{display:none}
.sticker-hint{font-size:11.5px}
.sticker-dialog label{display:block;font:12px/1.7 var(--font-cn);color:var(--text-soft);margin-top:14px}
.sticker-dialog input,.sticker-dialog textarea{display:block;box-sizing:border-box;width:100%;border:1px solid var(--hairline);border-radius:10px;padding:9px 10px;margin-top:5px;background:transparent;color:var(--text);font:13px/1.75 var(--font-cn)}
.sticker-dialog textarea{resize:vertical;min-height:76px}
.sticker-large{display:block;max-width:100%;width:220px;height:220px;object-fit:contain;margin:10px auto 18px}
.sticker-save-image{-webkit-touch-callout:default;user-select:auto;-webkit-user-select:auto}
.sticker-name-row{display:flex;align-items:center;gap:8px;margin:10px 0 6px}
#stickerDetailName{min-width:0;font:400 19px/1.5 var(--font-cn);overflow-wrap:anywhere;margin:0}
#stickerDetailDescription{font:13px/1.75 var(--font-cn);color:var(--text-soft);overflow-wrap:anywhere;margin:0}
.sticker-works{display:flex;flex-direction:column;gap:0}
.sticker-works button{border-radius:0;background:transparent;color:var(--text);text-align:left;padding:12px 0;border-bottom:1px solid var(--hairline);font-size:13px}
.chat-sticker{display:inline-flex;max-width:100%;width:150px;height:150px;background:transparent;text-decoration:none;vertical-align:middle}
.chat-sticker img{display:block;width:100%;height:100%;object-fit:contain;-webkit-touch-callout:default}
.bubble.sticker-only,.human .bubble.sticker-only,.ai .bubble.sticker-only{background:transparent!important;box-shadow:none!important;border:0!important;padding:4px 6px!important}
.bubble.sticker-only::before,.bubble.sticker-only::after{display:none!important}
.bubble.sticker-only .meta{display:flex;justify-content:flex-end;padding-top:3px;color:var(--text-soft)}
html[data-theme=harbor] .sticker-dialog{--sticker-track:rgba(32,40,8,.48);--sticker-selected:#566343;--sticker-save:#9CA463;--sticker-save-text:#202808;--sticker-selected-text:#eef1df;background:rgba(22,31,18,.94);color:#eef1df}
html[data-theme=harbor] .sticker-dialog button{color:#eef1df}
html[data-theme=harbor] .sticker-dialog .sticker-primary{color:#202808}
@media(min-width:721px){.sticker-dialog{margin:auto;max-height:min(760px,92dvh)}}
@media(max-width:360px){.sticker-body{padding:12px}.sticker-head{padding-inline:12px}.sticker-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sticker-actions{gap:14px 6px}.sticker-dialog button{padding-inline:10px}}
@media(pointer:coarse){.sticker-dialog input,.sticker-dialog textarea{font-size:16px}.sticker-dialog button::after{content:"";position:absolute;inset:-7px 0}.sticker-dialog .sticker-tile::after,.sticker-head button::after,.sticker-dialog .sticker-back::after{inset:0}.sticker-tabs button::after{inset:-7px 0}}

.sticker-cell{min-width:0;text-align:center}
.sticker-cell .sticker-tile{width:100%}
.sticker-dialog #stickerRename{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;padding:0;background:transparent;color:var(--accent)}
.sticker-dialog #stickerRename svg{width:16px;height:16px}
.sticker-dialog #stickerRename::after{inset:0}
html[data-theme=harbor] .sticker-dialog #stickerRename{color:#9CA463}
html[data-theme=harbor] .sticker-dialog #stickerRename[aria-expanded=true]{color:#D97757}
