html[data-chat-ui]{--chat-bg:#fff;--chat-side:#f9fbff;--chat-card:#fff;--chat-text:#26282d;--chat-muted:#6b7280;--chat-line:#e1e4eb;--chat-hover:#eef0f5;--chat-code:#f4f5f7;}
html[data-chat-theme=dark]{--chat-bg:#17191c;--chat-side:#202328;--chat-card:#25282e;--chat-text:#eceef2;--chat-muted:#b3bac6;--chat-line:#414751;--chat-hover:#343a44;--chat-code:#252a31;}
html[data-chat-theme=dark],html[data-chat-theme=dark] body{background:var(--chat-bg)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.wrap,.container_cont,.gpt_search_area,#chat,.ham_btn_area){background-color:var(--chat-bg)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.wide_side,.side_nav,.main_side_menu_area,.sidebar_layout){background:var(--chat-side)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.search_box,.search_area,.input-wrapper,.mypage_menu_box_area,.pj_menu,.pj_ctx,.history_search_box,.login_popup_area,.login_popup_content,.modal_cont001,.plan_pop,#upgrade_popup){background-color:var(--chat-card)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] :is(.search_input,#message,.history_search_box input,.mpopup_container input,.mpopup_container select){background-color:var(--chat-card)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] :is(.answer,.answer_area,.answer_area p,.answer_area li,.answer_area h1,.answer_area h2,.answer_area h3,.answer_area h4,.answer_area strong,.question,.gpt_tit,.main_title,.new_chat_tit,.his_txt,.side_menu,.date,.pj_head,.pj_name,.sidebar_account_id,.manage_area a,.history_search_status,.history_search_results,.login_popup_content label,.login_popup_content p){color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.question,.new_chat,.new_chat_btn,.new_page_btn,.history_select_mode,.history_bulk_actions){background-color:var(--chat-hover)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .answer_area :is(pre,code){background-color:var(--chat-code)!important;color:#e2e8f0!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .answer_area :is(table,th,td,blockquote,hr){border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .answer_area th{background:var(--chat-hover)!important;}
html[data-chat-theme=dark] .answer_area a{color:#a4b5ff;}
html[data-chat-theme=dark] :is(.history_search_results a:hover,.pj_menu button:hover,.manage_area a:hover,.tab:hover,.chat-recommendation:hover){background:var(--chat-hover)!important;}
html[data-chat-theme=dark] .mpopup_overlay{--settings-bg:var(--chat-card);--settings-text:var(--chat-text);--settings-muted:var(--chat-muted);--settings-line:var(--chat-line);--settings-hover:var(--chat-hover);}
html[data-chat-theme=dark] :is(.answer_review_cont button img,.ham_btn_area img,.new_chat_area>img){filter:brightness(0) invert(.85);}
html[data-chat-theme=dark] .answer_review_cont button.act img{filter:none;}
html[data-chat-theme=dark] :is(.chat-recommendations button,.chat-recommendations,.upgrade_btn,.search_box a){color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] ::placeholder{color:var(--chat-muted)!important;opacity:1;}
html[data-chat-theme=dark] :is(.service_tit,.service_s_tit,.custom-placeholder,.footer_btn,.modal_cont001 p,.modal_cont001 h2,.modal_cont001 h3,.modal_cont001 li,.modal_cont001 dt,.modal_cont001 dd,.modal_cont001 span){color:var(--chat-text)!important;}
html[data-chat-theme=dark] .login_popup_content :is(.login-container,.log_main,.signup-btn,.sns_line_wrap){background:var(--chat-card)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] .login_popup_content input{background:var(--chat-card)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .login_popup_content .find-info a{color:#a4b5ff!important;}
html[data-chat-theme=dark] .login_popup_content .login-btn{background:#3e53c5!important;color:#fff!important;}
html[data-chat-theme=dark] :is(.new_chat_btn p,.dipseekfx-btn-label,.manage_area a span){color:var(--chat-text)!important;}
html[data-chat-theme=dark] .qr_code_container{background:var(--chat-card)!important;}
html[data-chat-theme=dark] .qr_code_container p{color:var(--chat-text)!important;}
html[data-chat-theme=dark] .gpt_search_area .search_box .pro_btn{background:var(--chat-card)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .login_popup_content a{color:#a4b5ff!important;}
html[data-chat-theme=dark] :is(.new_chat_btn img,.pro_btn img){filter:brightness(0) invert(.85);}
html[data-chat-ui] .chat-prefs-open{display:flex;align-items:center;gap:8px;width:calc(100% - 24px);min-height:40px;margin:4px 12px;padding:8px 12px;border:1px solid var(--chat-line);border-radius:10px;background:var(--chat-card);color:var(--chat-text);font:inherit;cursor:pointer;}
html[data-chat-ui] .chat-theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border:0;padding:0;margin:12px 0 24px;min-width:0;}
html[data-chat-ui] .chat-theme-options legend{float:none;margin:0 0 12px;padding:0;font-size:14px;color:var(--settings-text);}
html[data-chat-ui] .chat-theme-options label{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;min-height:82px;padding:10px 4px;border:1px solid var(--settings-line);border-radius:12px;cursor:pointer;font-size:14px;overflow-wrap:anywhere;}
html[data-chat-ui] .chat-theme-options label:has(input:checked){background:var(--settings-hover);border-color:#7c8bde;}
html[data-chat-ui] .chat-theme-options input{position:absolute;width:1px;height:1px;opacity:0;}
html[data-chat-ui] .chat-theme-options label:has(input:focus-visible){outline:2px solid #7c8bde;outline-offset:2px;}
html[data-chat-ui] .chat-language-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--settings-line);padding:0 0 16px;font-size:14px;}
html[data-chat-ui] #chat_language{max-width:65%;border:1px solid var(--settings-line);border-radius:20px;padding:9px 12px;background:var(--settings-hover);color:var(--settings-text);font:inherit;}
html[data-chat-ui] .mpopup_tab{white-space:normal!important;overflow-wrap:anywhere;line-height:1.3;}
html[data-chat-ui] .mpopup_tabs{overflow-y:auto;}
html[data-chat-ui] .mpopup_row{gap:12px;}
html[data-chat-ui] .mpopup_row>div:first-child{flex-shrink:1;}
html[data-chat-ui] .mpopup_btn{white-space:normal;text-align:center;}
@media(max-width:640px){html[data-chat-ui] .chat-theme-options{gap:8px;}html[data-chat-ui] .mpopup_tabs{overflow-x:auto;overflow-y:hidden;}html[data-chat-ui] .mpopup_tab{min-width:72px!important;flex:0 0 auto!important;}html[data-chat-ui] .mpopup_content{padding-bottom:12px;}html[data-chat-ui] .mpopup_row .dis_flex_end2{flex-wrap:wrap;}}
@media(max-width:640px){html[data-chat-ui] .mpopup_api_row>.dis_flex_end2{flex:0 1 auto;min-width:0;max-width:75%!important;flex-wrap:wrap!important;}html[data-chat-ui] .mpopup_api_row .mpopup_btn{max-width:100%;box-sizing:border-box;}}
/* Chat dark mode: component surfaces, native controls and monochrome icons. */
html[data-chat-theme=dark] .wide_side .new_chat_area{background:transparent!important;}
html[data-chat-theme=dark] .wide_side .new_chat_btn{background:var(--chat-card)!important;color:var(--chat-text)!important;box-shadow:none;}
html[data-chat-theme=dark] .wide_side .new_chat_btn:hover{background:var(--chat-hover)!important;}
html[data-chat-theme=dark] .wide_side .new_chat_btn img{filter:brightness(0) invert(.88)!important;}
html[data-chat-theme=dark] .gpt_search_area .search_box #ai_attach_btn{color:var(--chat-text)!important;}
html[data-chat-theme=dark] .gpt_search_area .search_box #ai_attach_btn:hover{background:var(--chat-hover)!important;}
html[data-chat-theme=dark] :is(.edit_del_area,.history_search_results,.history_search_results button,.history_search_results a,.pj_box,.pj_box input[type=text],.pj_box textarea,.pj_btns button,.pj_list button){background-color:var(--chat-card)!important;color:var(--chat-text)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] :is(.edit_del_area button,.history_select_mode button,.history_bulk_actions button,.ds_icon,.history_search_btn,.hide_wide,.show_wide,.pj_editor h3,.pj_box label,.pj_editor_intro,.pj_editor_help,.pj_hint,.pj_ref_add,.upgrade_popup_dl dt,.upgrade_popup_dl dd){color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.edit_del_area button:hover,.pj_box .pj_btns button:hover,.pj_list button.cur,.history_checked){background:var(--chat-hover)!important;}
html[data-chat-theme=dark] .pj_box .pj_btns .pj_primary{background:#3e53c5!important;border-color:#758cff!important;color:#fff!important;}
html[data-chat-theme=dark] :is(.edit_del_area .del_btn,.pj_err,.pj_m_del){color:#ffa3a3!important;}
html[data-chat-theme=dark] :is(.chat_source_link,.chat_source_more,.ai_attach_chip,.question_files span,.pj_ref_chip){background:#293448!important;color:#dce6ff!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .chat_sources_web .chat_source_link{background:#203c3b!important;color:#b6eee6!important;}
html[data-chat-theme=dark] :is(.chat_sources_label,.ai_limit_desc){color:var(--chat-muted)!important;}
html[data-chat-theme=dark] :is(.ai_attach_chip button,.ai_limit_title,#scrollToBottom){color:var(--chat-text)!important;}
html[data-chat-theme=dark] :is(.ai_attach_chip button,#scrollToBottom){background:var(--chat-card)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .ai_limit_btn{background:#3e53c5!important;color:#fff!important;}
html[data-chat-theme=dark] .mpopup_plan_badge{color:var(--chat-text)!important;}
html[data-chat-theme=dark] .mpopup_plan_badge.is_pro{background:#303c58!important;color:#dce6ff!important;}
html[data-chat-theme=dark] .mpopup_btn.danger:hover{background:#4b272b!important;color:#ffd0d0!important;}
html[data-chat-theme=dark] :is(.dipseekfx-btn-label,.dipseekfx-btn-icon){color:#06210d!important;}
html[data-chat-theme=dark] .answer_area :is(.hljs-comment,.hljs-quote){color:#aeb8c6!important;}
html[data-chat-theme=dark] .answer_area :is(.hljs-keyword,.hljs-selector-tag,.hljs-literal){color:#d8b4fe!important;}
html[data-chat-theme=dark] .answer_area :is(.hljs-string,.hljs-attr,.hljs-regexp){color:#c3e88d!important;}
html[data-chat-theme=dark] .answer_area :is(.hljs-number,.hljs-variable,.hljs-title,.hljs-built_in){color:#b9dcff!important;}
/* Payment is a separate, existing light document. Do not inherit dark canvas/native controls. */
html[data-chat-ui] :is(iframe[src*="/subscription_plan.php"],iframe[src*="/subscription_plan_img.php"]){background:#fff!important;color-scheme:light!important;}
html[data-chat-theme=dark] :is(.modal_cont001:has(iframe[src*="subscription_plan"]),.plan_modal_frame,.subscription_modal_content){background:#fff!important;color:#262626!important;color-scheme:light;}
html[data-chat-theme=dark] .subscription_modal_overlay{background:rgba(0,0,0,.65)!important;}
html[data-chat-theme=dark] .subscription_modal_close{background:#fff!important;color:#262626!important;}
/* Consistent settings alignment and a reserved arrow gutter in every supported language. */
html[data-chat-ui] .mpopup_tab[data-tab=appearance]{gap:10px;}
html[data-chat-ui] .chat-theme-options{ text-align:left; }
html[data-chat-ui] .chat-theme-options legend{width:100%;text-align:left;margin-left:0;}
html[data-chat-ui] #chat_language{appearance:none;-webkit-appearance:none;min-width:116px;max-width:70%;box-sizing:border-box;padding:9px 34px 9px 14px;border:1px solid var(--settings-line);outline:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237c8799' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right 12px center;background-size:12px 12px;background-repeat:no-repeat;}
html[data-chat-ui] #chat_language:focus-visible{outline:2px solid #829aff;outline-offset:2px;}
html[data-chat-ui] .mpopup_api_label>div{color:#626b78!important;}
html[data-chat-ui] .mpopup_btn.danger{color:#b82e3a!important;}
html[data-chat-theme=dark] .mpopup_api_label>div{color:var(--settings-muted)!important;}
html[data-chat-theme=dark] .mpopup_overlay .mpopup_btn{background:var(--settings-bg)!important;color:var(--settings-text)!important;border-color:var(--settings-line)!important;}
html[data-chat-theme=dark] .mpopup_overlay .mpopup_btn.danger{color:#ffa3a3!important;}
html[data-chat-theme=dark] .answer_area div:has(>.code_copy_btn){background:var(--chat-code)!important;border-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .answer_area :is(.code_copy_btn,.code_copy_btn+div){background:var(--chat-hover)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] .answer_area :is(.py-string){color:#c3e88d!important;}
html[data-chat-theme=dark] .answer_area :is(.py-keyword){color:#d8b4fe!important;}
html[data-chat-theme=dark] .answer_area :is(.py-self){color:#b9dcff!important;}
html[data-chat-theme=dark] .red-alert{background:#923642!important;color:#fff!important;}
html[data-chat-theme=dark] .gpt_search_area .search_box #senddiv:not(.active){background-color:#465477!important;}
html[data-chat-theme=dark] .ds_icon:hover{background:var(--chat-hover)!important;color:var(--chat-text)!important;}
html[data-chat-theme=dark] .wide_side .blank{background:transparent!important;}
/* Mobile chat is an overlay layout; do not animate desktop sidebar offsets into it. */
.chat-mobile-viewport[data-chat-ui] .wrap.m_wrap{transition:none!important;}

/* Keep the mobile settings tab scrollbar on the dark settings surface. */
html[data-chat-theme=dark] .mpopup_tabs::-webkit-scrollbar,html[data-chat-theme=dark] .mpopup_tabs::-webkit-scrollbar-track{background:var(--chat-card)!important;}
html[data-chat-theme=dark] .mpopup_tabs::-webkit-scrollbar-thumb{background:var(--chat-muted)!important;}
/* The custom placeholder sits below the textarea; keep its existing transparent canvas. */
html[data-chat-theme=dark] .gpt_search_area #message{background-color:transparent!important;}
html[data-chat-theme=dark] :is(.wide_side,.side_nav){border-right-color:var(--chat-line)!important;}
html[data-chat-theme=dark] .subscription_modal_content .service_s_tit{color:#262626!important;}
html[data-chat-ui] .show_wide svg{width:24px;height:24px;}
html[data-chat-ui] .hide_wide svg{width:21px;height:21px;}
html[data-chat-ui] .side_nav .p_ico{color:var(--chat-muted);}
