/* ##### .selma_app_wrap */
body:has(> .selma_app_wrap) { height:100vh; height:100dvh; min-height:0; overflow:hidden; }
body:has(> .selma_app_wrap) > .selma_app_wrap { height:100%; }
main#admin:has(.selma_app_wrap) { height:100vh; height:100dvh; min-height:0; padding:0; overflow:auto; box-sizing:border-box; }
main#admin:has(.selma_app_wrap) > .content { height:100%; min-height:0; margin:0; padding:60px 0; display:flex; flex-direction:column; }
main#sub02:has(.selma_app_wrap) > .container { display:flex; flex-direction:column; }
main#sub02 .selma_app_wrap { max-height:650px; height:auto; }
.selma_app_wrap { width:100%; height:100%; max-height:100%; min-height:0; display:flex; justify-content:center; }
@media (max-width:1024px) {
	main#admin:has(.selma_app_wrap) > .content { padding:0; }
	.selma_app_wrap { height:100vh; height:100dvh; }
	main#sub02 .selma_app_wrap { height:auto; }
}
@media (max-width:768px) {
	main.sub:has(.selma_app_wrap) > .container > h1, main.sub:has(.selma_app_wrap) > .container > .jw-page-head { display:none; }
	body:has(#selma_app) .p-help-button { display:none; }
}


/* ##### #selma_app */
main#sub02 .selma_app_wrap { margin-top:20px; }

#selma_app { --bg:#fff; --surface:#f7f8fa; --surface-2:#eef1f5; --line:#e9ebef; --text:#242830; --muted:#9097a2; --accent:#546bea; --accent-ink:#fff; position:relative; display:flex; flex-direction:column; width:100%; max-width:440px; height:100%; min-height:650px; overflow:hidden; box-sizing:border-box; border:1px solid #ccc; background:var(--bg); color:var(--text); border-radius:10px; }
body:has(> .selma_app_wrap) #selma_app, main#admin #selma_app { min-height:0; }
#selma_app *, #selma_app *::before, #selma_app *::after { box-sizing:border-box; }
#selma_app button { -webkit-tap-highlight-color:transparent; }
#selma_app > header { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; min-height:66px; flex:none; padding:calc(12px + env(safe-area-inset-top)) 20px 12px; }
#selma_app > header .selma-menu { --jwbutton-color:var(--text); --jwbutton-bg:transparent; width:42px; height:42px; margin-left:-8px; padding:0; border-radius:14px; }
#selma_app > header .ic-hamberg { --s:22px; --color:var(--text); }
#selma_app > header .logo { display:flex; align-items:center; gap:8px; color:var(--text); }
#selma_app > header .logo .material-symbols-outlined { color:var(--accent); font-size:22px; }
#selma_app > header .logo strong { font-size:14px; font-weight:700; }
#selma_app > header .selma-version { justify-self:end; padding:5px 8px; color:var(--muted); font-size:12px; }
#selma_app > main { display:flex; flex:1; flex-direction:column; min-height:0; padding:0 20px; overflow:hidden; }
#selma_app .selma-face-area { position:relative; display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; min-height:0; transition:flex .5s ease; }
#selma_app .selma-face { width:min(100%,320px); height:190px; flex:none; }
#selma_app .selma-face canvas { display:block; width:100%; height:100%; }
#selma_app .selma-welcome { margin:-6px 0 0; text-align:center; }
#selma_app .selma-welcome h1 { margin:0; color:var(--text); font-size:24px; font-weight:600; }
#selma_app .selma-welcome p { margin:10px 0 0; color:var(--muted); }
#selma_app .selma-ready { display:flex; align-items:center; gap:7px; margin-top:22px; color:var(--muted); font-size:12px; }
#selma_app .selma-ready::before { content:""; width:6px; height:6px; border-radius:50%; background:#74c99e; }
#selma_app .selma-result-close { --jwbutton-color:var(--muted); --jwbutton-bg:var(--surface); position:absolute; top:0; right:0; display:none; width:38px; height:38px; padding:0; border-radius:12px; }
#selma_app main.is-active .selma-result-close { display:inline-flex; }
#selma_app main.is-active .selma-face-area { flex:0 0 145px; }
#selma_app main.is-active .selma-face { height:145px; }
#selma_app main.is-active .selma-welcome, #selma_app main.is-active .selma-ready { display:none; }
#selma_app .p-chat-messages { display:none; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 0 14px; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
#selma_app main.is-active .p-chat-messages { display:block; }
#selma_app .p-chat-message-user { margin:0 0 15px; color:var(--muted); font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
#selma_app .p-chat-message-user::before { content:"나"; display:inline-grid; place-items:center; width:25px; height:25px; margin-right:8px; border-radius:9px; background:var(--surface-2); color:var(--text); }
#selma_app .selma-answer-label { display:flex; align-items:center; gap:7px; margin:0 0 8px; color:var(--accent); font-size:12px; font-weight:700; }
#selma_app .p-chat-message-assistant { margin:0 0 15px; padding:18px; border:1px solid var(--line); border-radius:20px; background:var(--surface); color:var(--text); overflow-wrap:anywhere; }
#selma_app .selma-sample-heading { display:block; margin-bottom:12px; font-size:16px; }
#selma_app .p-chat-message-assistant p { margin:0 0 10px; white-space:pre-wrap; }
#selma_app .p-chat-message-assistant p:last-child { margin-bottom:0; }
#selma_app .quick-button { display:flex; align-items:center; gap:7px; min-width:0; padding:10px 20px 0; }
#selma_app .quick-button #quick-prompt-buttons { display:flex; flex:1; min-width:0; min-height:40px; gap:7px; overflow-x:auto; margin:0; padding:2px 1px; list-style:none; scrollbar-width:none; }
#selma_app .quick-button #quick-prompt-buttons::-webkit-scrollbar { display:none; }
#selma_app .quick-button li { flex:none; }
#selma_app .quick-button .jw-button { --jwbutton-color:var(--text); --jwbutton-bg:var(--surface); gap:5px; min-height:36px; height:36px; padding:0 10px; border:1px solid var(--line); border-radius:12px; font-size:12px; white-space:nowrap; }
#selma_app .quick-button .material-symbols-outlined { display:block; width:16px; min-width:16px; height:16px; flex:0 0 16px; overflow:hidden; color:var(--accent); font-size:16px; }
#selma_app #selma-file-name { overflow:hidden; margin:8px 20px 0; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
#selma_app #selma-file-name:empty { display:none; }
#selma_app #selma-chat-form { display:flex; align-items:center; flex:none; gap:4px; margin:12px 20px calc(12px + env(safe-area-inset-bottom)); padding:6px; border:1px solid var(--line); border-radius:19px; background:#fff; }
#selma_app #selma-chat-form:focus-within { border-color:#aebbf4; }
#selma_app #selma-chat-form > .jw-button { --jwbutton-color:var(--muted); --jwbutton-bg:transparent; display:flex; align-items:center; justify-content:center; width:36px; height:42px; flex:0 0 36px; padding:0; border:0; border-radius:12px; box-shadow:none; }
#selma_app #selma-chat-form > #selma-chat-input { min-width:0; min-height:36px; max-height:72px; flex:1; overflow-y:auto; padding:9px 0; color:var(--text); outline:0; overflow-wrap:anywhere; white-space:pre-wrap; }
#selma_app #selma-chat-form > #selma-chat-input:empty::before { color:var(--muted); content:attr(data-placeholder); pointer-events:none; }
#selma_app #selma-chat-form > #selma-send-message { --jwbutton-color:var(--accent-ink); --jwbutton-bg:var(--accent); width:42px; flex-basis:42px; }
#selma_app #selma-chat-form .material-symbols-outlined { font-size:20px; }
#selma_app .selma-voice-icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#selma_app #selma-chat-form > .selma-voice.is-active { --jwbutton-color:#e65d65; --jwbutton-bg:#fff0f1; }
#selma_app .selma-panel-backdrop { position:absolute; z-index:9; inset:0; width:100%; height:100%; padding:0; border:0; border-radius:0; background:rgba(24,29,39,.35); }
#selma_app [hidden] { display:none; }
@media (max-height:680px) {
	#selma_app main.is-active .selma-face-area { flex-basis:105px; }
	#selma_app main.is-active .selma-face { height:105px; }
	#selma_app .selma-face { height:150px; }
	#selma_app .selma-ready { margin-top:12px; }
}
/* ##### #modal_options */
#modal_options { position:absolute; z-index:10; inset:0; right:auto; width:min(86%,350px); height:100%; display:flex; flex-direction:column; overflow:hidden; background:var(--bg); color:var(--text); transform:translateX(-100%); }
#modal_options.is-action { transform:translateX(0); animation:selma-menu-slide .25s ease; }
@keyframes selma-menu-slide {
	from { transform:translateX(-100%); }
	to { transform:translateX(0); }
}
#modal_options header { display:flex; align-items:center; justify-content:space-between; min-height:66px; flex:none; padding:0 20px; }
#modal_options header strong { font-size:18px; }
#modal_options .selma-menu-close { --jwbutton-color:var(--text); --jwbutton-bg:var(--surface); width:38px; height:38px; padding:0; border-radius:12px; }
#modal_options .selma-menu-body { display:flex; flex:1; flex-direction:column; min-height:0; overflow-y:auto; padding:0 20px calc(20px + env(safe-area-inset-bottom)); }
#modal_options .selma-profile { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:15px; border:1px solid var(--line); border-radius:17px; background:var(--surface); }
#modal_options .selma-profile-icon { display:grid; place-items:center; width:46px; height:46px; flex:none; border-radius:15px; background:#e8ecff; color:var(--accent); }
#modal_options .selma-profile > div { flex:1; min-width:0; }
#modal_options .selma-profile strong, #modal_options .selma-profile small { display:block; overflow-wrap:anywhere; }
#modal_options .selma-profile strong { font-size:16px; }
#modal_options .selma-profile small { margin-top:5px; color:var(--muted); font-size:12px; }
#modal_options .selma-profile-action { --jwbutton-color:var(--muted); --jwbutton-bg:var(--surface-2); font-size:12px; }
#modal_options .selma-login { display:grid; gap:8px; padding:15px; border:1px solid var(--line); border-radius:17px; background:var(--surface); }
#modal_options .selma-login input { width:100%; min-width:0; height:40px; padding:0 10px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); }
#modal_options .selma-login button { --jwbutton-color:var(--accent-ink); --jwbutton-bg:var(--accent); height:40px; border-radius:10px; }
#modal_options .options-login-status { width:100%; margin:0; color:#d5515a; font-size:12px; }
#modal_options .options-login-status:empty { display:none; }
#modal_options .selma-menu-label { margin:27px 0 10px; color:var(--muted); font-size:12px; font-weight:600; }
#modal_options .selma-menu-row { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:52px; border-bottom:1px solid var(--line); }
#modal_options .selma-menu-row > span:first-child { display:flex; align-items:center; gap:10px; }
#modal_options .selma-menu-row .material-symbols-outlined { color:var(--muted); font-size:18px; }
#modal_options .selma-menu-action { --jwbutton-color:var(--text); --jwbutton-bg:var(--surface); height:30px; border-radius:9px; font-size:12px; }
#modal_options .selma-menu-foot { margin:auto 0 0; padding-top:24px; color:var(--muted); font-size:12px; }
