.role-chat{margin:50px 0;padding:24px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.chat-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px}.chat-sidebar{border-right:1px solid var(--border);padding-right:20px}.chat-sidebar>button{width:100%}.chat-archive-filter{display:flex;gap:8px;margin:18px 0;color:var(--muted);font-size:13px}#chat-threads{display:grid;gap:10px}#chat-threads button{text-align:left;overflow-wrap:anywhere;white-space:normal}#chat-threads [aria-pressed=true]{border-color:var(--accent);color:var(--accent)}.chat-main{min-width:0}.chat-main h3{font-size:22px;margin:0 0 16px}.chat-main label{display:block;margin:16px 0 8px}.chat-main input,.chat-main textarea{width:100%;padding:12px;margin-top:8px;background:var(--field);border:1px solid var(--border);border-radius:10px;color:var(--text);font:inherit;resize:vertical}.chat-actions,.chat-send{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.chat-actions button{font-size:13px;padding:10px 14px}.chat-heading{display:flex;gap:16px;justify-content:space-between;flex-wrap:wrap;margin-bottom:20px}.chat-messages{max-height:550px;overflow-y:auto;display:flex;flex-direction:column;gap:14px;padding:4px}.chat-message{max-width:95%;padding:14px 18px;border:1px solid var(--border);border-radius:14px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.65}.chat-message.user{align-self:flex-end;background:var(--field)}.chat-message.assistant{align-self:flex-start}.chat-message strong{display:block;font-size:12px;color:var(--accent);margin-bottom:8px}.chat-message p{margin:0}.chat-send{justify-content:space-between;margin-top:16px}.chat-send span,#chat-service,#chat-notice{font-size:14px;color:var(--muted)}#faceswap-consent-label{display:flex;align-items:flex-start;gap:10px;margin-top:20px;font-size:14px;line-height:1.5}#faceswap-consent{width:18px;height:18px;flex-shrink:0}@media(max-width:760px){.role-chat{padding:16px}.chat-layout{grid-template-columns:1fr}.chat-sidebar{border-right:none;border-bottom:1px solid var(--border);padding:0 0 20px}.chat-messages{max-height:450px}.chat-message{max-width:100%}.chat-send{align-items:stretch;flex-direction:column}}

.chat-archive-filter input,#faceswap-consent{width:18px;height:18px;min-height:18px;padding:0;margin:0;flex:0 0 18px}.chat-archive-filter{align-items:center}.chat-main input:not([type=checkbox]){min-height:44px}


#character-catalog{margin:24px 0;padding:22px;border:1px solid #536a8a55;border-radius:22px;background:#132238}.character-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:20px 0}.character-card{padding:16px;border:1px solid #7da5c933;border-radius:18px;background:linear-gradient(145deg,#243049,#142337);display:flex;flex-direction:column;min-width:0}.character-card img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:12px}.character-card h4{margin:14px 0 8px;font-size:16px}.character-card p{font-size:13px;color:#b8c8dc;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.character-card>button{margin-top:auto}#chat-memory-dialog{width:min(620px,calc(100vw - 32px))}#chat-memory-text{width:100%;resize:vertical}.chat-sidebar #chat-catalog-open{width:100%;margin-bottom:12px}@media(max-width:1000px){.character-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:480px){.character-grid{grid-template-columns:1fr}#character-catalog{padding:16px}.character-card img{aspect-ratio:4/3}}
