:root{color-scheme:light;--green:#146b54;--green-dark:#0e5140;--mint:#e8f3ec;--ink:#203b34;--muted:#5d6f66;--line:#e1e8e1;--paper:#f5f4ed;--white:#fff;--red:#9e3445;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none;font-size:14px}
*{box-sizing:border-box}body{margin:0;background:#e5ece6;color:var(--ink);overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:wait;opacity:.6}button,input,select,textarea{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #72b69d;outline-offset:2px}button{touch-action:manipulation}button svg{height:22px;width:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}button{border:0}[hidden]{display:none!important}h1,h2,h3,p{margin:0}img{object-fit:cover}button:active{transform:translateY(1px)}
.app{max-width:960px;margin:0 auto;height:100vh;height:100dvh;display:flex;flex-direction:column;background:var(--paper);box-shadow:0 0 70px #284e3110;overflow:hidden}
.group-header{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 16px;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0}.group-avatar{border-radius:14px}.group-heading h1{font-size:18px;letter-spacing:-.45px;line-height:1.3;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-heading p{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.icon-button{width:40px;height:40px;border-radius:12px;background:transparent;display:inline-flex;align-items:center;justify-content:center;font-size:20px}.icon-button:hover{background:var(--mint)}
.seat-strip{display:flex;gap:8px;overflow-x:auto;background:#fff;padding:13px 16px 12px;border-bottom:1px solid var(--line);flex-shrink:0;scrollbar-width:thin;scrollbar-color:#d2dfd4 transparent}.seat-card{min-width:84px;flex:1;max-width:126px;background:transparent;text-align:center;border-radius:12px;padding:3px 0 0}.seat-card:hover{background:#f3f7f1}.seat-avatar-wrap{position:relative;display:block;width:40px;height:40px;margin:auto auto 6px}.seat-avatar-wrap img{border-radius:14px;width:40px;height:40px}.presence-dot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;background:#49a66e;border:2px solid #fff;border-radius:50%}.presence-dot.offline{background:#a9b3ac}.seat-name{display:block;font-weight:650;font-size:12px;max-width:104px;margin:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.seat-role{display:block;width:max-content;max-width:112px;margin:4px auto 0;padding:3px 5px;border-radius:5px;color:#5d6f66;background:#f1f4ef;font-size:9px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.seat-card:first-child .seat-role{background:#e9f3e9;color:#3a794f}
.connection-notice{display:flex;align-items:center;gap:8px;text-align:left;background:#f0f4df;padding:9px 16px;font-size:10.5px;line-height:1.5;color:#727c43;flex-shrink:0;border-bottom:1px solid #e5e9cd}.connection-notice>span:nth-child(2){flex:1}.notice-dot{width:6px;height:6px;border-radius:50%;background:#a7ad61;flex-shrink:0}
.messages{flex:1;min-height:0;overflow:auto;padding:18px 22px 24px;overscroll-behavior:contain;scroll-behavior:smooth;background-image:radial-gradient(#d9dfd354 .7px,transparent .7px);background-size:18px 18px}.loading-state{padding:50px;text-align:center;color:var(--muted)}.empty-state{max-width:360px;margin:clamp(20px,8vh,100px) auto 20px;text-align:center}.empty-state>img{width:60px;height:60px;border-radius:20px;margin-bottom:18px;box-shadow:0 8px 24px #1d6e4c18}.empty-state .eyebrow{margin-bottom:8px;color:var(--green);font-size:10px;letter-spacing:1.8px}.empty-state h2{font-size:23px;line-height:1.3;letter-spacing:-.6px;font-weight:700}.empty-state>p:not(.eyebrow){color:var(--muted);font-size:12px;line-height:1.8;margin:12px 5px 20px}.suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.suggestions button{border:1px solid #dce4d8;background:#ffffffbd;border-radius:10px;font-size:11px;padding:10px 12px}.empty-note{font-size:10px!important;margin-top:22px!important;color:#5d6f66!important}.date-divider{text-align:center;margin:0 auto 20px;position:relative}.date-divider span{display:inline-block;background:#e8ecdf;color:#526257;font-size:10px;padding:5px 12px;border-radius:6px}
.message{display:flex;gap:8px;align-items:flex-start;margin:0 0 16px;max-width:86%;width:fit-content;min-width:0}.message-avatar{width:28px;height:28px;border-radius:10px;flex-shrink:0;margin-top:2px}.bubble{background:#fff;border-radius:0 13px 13px 13px;padding:9px 12px 11px;box-shadow:0 1px 2px #1b3c2710;min-width:100px;max-width:100%;overflow:hidden}.message-meta{display:flex;align-items:baseline;gap:6px;margin-bottom:6px;min-width:0;font-size:9px;color:#54655c;flex-wrap:wrap}.author-name{color:var(--green);font-size:11px;font-weight:750;overflow-wrap:anywhere}.author-role{font-size:9px}.message-meta time{margin-left:auto;font-size:9px;white-space:nowrap}.message-text{font-size:13px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;tab-size:2}.message-owner{margin-left:auto;flex-direction:row-reverse}.message-owner .bubble{background:#e0eddc;border-radius:13px 0 13px 13px}.message-owner .author-name{color:#38603a}.message-owner .message-meta{color:#3f5247}.final-label{display:table;font-size:10px;font-weight:700;background:var(--green);color:#fff;padding:5px 8px;margin:2px 0 8px;border-radius:5px}.message-final .bubble{border:1px solid #bfd6bd;background:#fcfffa}.provider-error{background:#fff0f1;border:1px solid #f4d2d7;border-left:3px solid #d87583;border-radius:6px;padding:8px 9px;color:#9b3c4b;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font-family:inherit;font-size:10.5px;line-height:1.6;margin:8px 0 0}.demo-label{display:table;border-radius:4px;padding:3px 6px;font-size:9px;font-weight:800;background:#fff0bc;color:#8c690c;margin-bottom:6px}.typing-status{font-size:11px;color:var(--muted);line-height:1.7;display:flex;gap:7px;align-items:center}.typing-status::before{content:"";height:5px;width:5px;flex-shrink:0;border-radius:50%;background:#82a88a;animation:pulse 1.2s ease-in-out infinite}.typing-status.waiting::before{animation:none;background:#c2aa64}.chat-image{display:block;max-width:100%;max-height:440px;width:auto;min-width:100px;height:auto;object-fit:contain;border-radius:8px;margin-top:8px;background:#ecf1e7;image-rendering:auto}.image-link{display:block}.image-link:focus-visible{outline:2px solid var(--green)}.attachment-link{display:flex;align-items:center;gap:9px;margin-top:8px;padding:9px 11px;border:1px solid #dbe4d3;border-radius:9px;background:#f2f6ee;color:var(--ink);text-decoration:none;max-width:100%}.attachment-link:hover{background:#e7f0e3}.attachment-link svg{width:17px;height:17px;flex-shrink:0;stroke:var(--green);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.attachment-link span{display:flex;flex-direction:column;min-width:0}.attachment-link strong{font-size:12px;overflow-wrap:anywhere}.attachment-link small{font-size:10px;color:#54655c}
.composer-area{padding:10px 18px max(9px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);flex-shrink:0;position:sticky;bottom:0}.action-chips{display:flex;gap:7px;margin-bottom:10px;overflow-x:auto;scrollbar-width:none}.action-chip{display:flex;align-items:center;justify-content:center;gap:5px;padding:7px 10px;background:#f2f5ed;border:1px solid #e6ecdf;border-radius:8px;font-size:10.5px;white-space:nowrap;min-height:34px;font-weight:550}.action-chip:hover{background:#e7f0e3}.action-chip svg{height:13px;width:13px;stroke-width:1.6}.composer{display:flex;align-items:flex-end;gap:9px}.composer textarea{border:1px solid #e1e7dc;border-radius:12px;background:#f7f8f2;padding:12px 13px;line-height:1.5;font-size:13px;color:var(--ink);resize:none;min-height:46px;max-height:130px;flex:1;min-width:0;outline-offset:0}.composer textarea::placeholder{color:#5f6f63}.send-button{background:var(--green);color:white;height:46px;width:46px;border-radius:13px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.send-button:hover{background:var(--green-dark)}.send-button svg{width:22px;height:22px}.composer-hint{text-align:center;font-size:9px;color:#5f6f63;margin-top:6px}.composer-hint span{padding:0 4px}
.settings-dialog{position:fixed;inset:0 0 0 auto;margin:0;height:100vh;height:100dvh;width:min(100%,520px);max-width:100%;max-height:100%;border:0;border-left:1px solid var(--line);padding:0;background:#fafbf7;color:var(--ink);overflow:auto;overscroll-behavior:contain;box-shadow:-20px 0 80px #153e2820}.settings-dialog::backdrop,.mention-dialog::backdrop{background:#19382b55;backdrop-filter:blur(2px)}.panel-header{position:sticky;top:0;background:#fafbf7f5;backdrop-filter:blur(8px);padding:20px 22px 16px;display:flex;align-items:center;justify-content:space-between;z-index:2;border-bottom:1px solid var(--line)}.eyebrow{font-size:9px;letter-spacing:1.7px;font-weight:750;color:var(--muted)}.panel-header h2{font-size:22px;letter-spacing:-.5px;margin-top:5px}.settings-section{padding:22px;border-bottom:1px solid var(--line)}.settings-section h3{font-size:14px;font-weight:750;margin-bottom:7px}.section-hint{color:var(--muted);font-size:11px;line-height:1.7;margin:0 0 17px}.settings-section label{display:block;font-size:11px;font-weight:650;margin-top:13px}.settings-section input:not([type=checkbox]),.settings-section select{display:block;width:100%;height:42px;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:13px;min-width:0}.settings-section input::placeholder,.settings-section textarea::placeholder{color:var(--muted)}.settings-section textarea{display:block;width:100%;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:13px;line-height:1.6;resize:vertical;min-width:0}.settings-section textarea.omp-textarea{font-size:12.5px}.identity-row{display:flex;align-items:center;gap:14px;margin-top:15px}.identity-row label{margin:0;flex:1;min-width:0}.avatar-upload{background:transparent;border-radius:12px;text-align:center;padding:0;flex-shrink:0}.avatar-upload img{display:block;border-radius:13px}.avatar-upload span{display:block;font-size:9px;color:var(--green);font-weight:650;margin-top:4px}.field-hint{display:block;font-size:10px;line-height:1.6;color:var(--muted);margin-top:8px}.key-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:15px;min-width:0}.key-row .field-hint{margin:0;overflow-wrap:anywhere}.text-button{background:none;padding:8px 0;font-size:10px;text-decoration:underline}.danger-text{color:var(--red)}.primary-button,.secondary-button,.danger-button{padding:11px 16px;min-height:42px;border-radius:9px;font-size:12px;font-weight:650}.primary-button{background:var(--green);color:white}.secondary-button{background:#edf3e7;border:1px solid #d8e5ce;color:#3c6c40}.danger-button{background:#fff0f0;color:#a64c58;border:1px solid #efdadb}.connection-result{border-radius:7px;padding:10px;font-size:11px;line-height:1.6;margin-top:12px;background:#edf5e8;color:#487145}.connection-result.error{background:#fff0f1;color:var(--red)}.model-list{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px;max-height:130px;overflow:auto}.model-tag{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;background:#e9eee3;padding:4px 6px;border-radius:4px;font-size:9px;overflow-wrap:anywhere;max-width:100%}.seat-settings{padding:14px 0;border-bottom:1px solid #e7ece1}.seat-settings:first-child{padding-top:0}.seat-settings:last-child{border:0;padding-bottom:0}.seat-settings-heading{display:flex;gap:12px;align-items:center}.seat-settings-heading>div{min-width:0;flex:1}.seat-code{display:inline-block;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:9px;color:#4f6a4c;background:#eaf0e3;padding:3px 5px;border-radius:4px;margin-right:6px}.seat-fixed-role{font-size:11px;color:#57685a}.seat-settings .seat-settings-heading label{margin-top:6px}.seat-settings .seat-settings-heading input{height:37px;margin-top:4px}.seat-settings>.model-label{margin-left:60px}.builtin-note{margin:10px 0 0 60px;font-size:10px;line-height:1.7;color:#3f6b3f;background:#eef4e7;padding:8px 10px;border-radius:6px}.model-status{display:block;margin:7px 0 0 60px;font-size:10px;line-height:1.6;color:#7a5c1a}.model-status[data-available=true]{color:#548254}.model-status[data-available=false]{color:#8a5a14}.seat-settings>.prompt-label{margin-left:60px}.seat-settings textarea{display:block;width:100%;min-height:76px;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:12.5px;line-height:1.6;resize:vertical}.seat-settings .field-hint{margin-left:60px}.model-test-row{display:flex;align-items:center;gap:10px;margin:10px 0 0 60px;flex-wrap:wrap}.model-test-row .secondary-button{min-height:36px;padding:8px 12px}.model-test-row .model-status{margin:0}.model-status.test-ok{color:#548254}.model-status.test-fail{color:var(--red)}.toggle-row{display:flex!important;align-items:center;justify-content:space-between;gap:18px;margin:18px 0!important;cursor:pointer}.toggle-row strong{display:block;font-size:12px;font-weight:650}.toggle-row small{display:block;color:var(--muted);font-size:10px;font-weight:400;line-height:1.7;margin-top:5px}.toggle-row input{appearance:none;flex-shrink:0;width:38px;height:23px;border-radius:20px;background:#ced7c8;position:relative;margin:0;cursor:pointer}.toggle-row input::after{content:"";position:absolute;width:17px;height:17px;top:3px;left:3px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #3332;transition:transform .15s}.toggle-row input:checked{background:var(--green)}.toggle-row input:checked::after{transform:translateX(15px)}.settings-save{padding:14px 22px max(14px,env(safe-area-inset-bottom));background:#fafbf7f5;border-top:1px solid var(--line);display:flex;gap:10px;align-items:center;justify-content:space-between;position:sticky;bottom:0;z-index:2;backdrop-filter:blur(8px)}.settings-save>span{font-size:10px;color:var(--green);line-height:1.5}.settings-save .primary-button{flex-shrink:0}.danger-section h3{color:#9b5960}
.mention-dialog{border:0;border-radius:18px;padding:18px;width:min(350px,calc(100% - 32px));background:#fafcf7;color:var(--ink);box-shadow:0 15px 70px #16372030;max-height:85dvh;overflow:auto}.mention-heading{display:flex;justify-content:space-between;align-items:center}.mention-heading h2{font-size:18px}.mention-dialog>p{font-size:11px;color:var(--muted);margin:0 0 12px}.mention-option{background:transparent;display:flex;gap:12px;align-items:center;border-radius:10px;width:100%;text-align:left;padding:9px 5px}.mention-option:hover{background:#edf3e8}.mention-option img{width:35px;height:35px;border-radius:11px}.mention-option strong{font-size:12px;display:block}.mention-option small{font-size:10px;color:var(--muted);display:block;margin-top:3px}.mention-option>span:last-child{margin-left:auto;font-size:10px;color:#5d6f66}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:calc(100% - 32px);width:max-content;padding:12px 18px;border-radius:10px;color:#fff;background:#294d3f;box-shadow:0 5px 20px #1233;font-size:12px;line-height:1.6;z-index:20;pointer-events:none}.toast.error{background:#9c4651}
@keyframes pulse{0%,100%{opacity:.3}50%{opacity:1}}
@media(min-width:700px){.group-header{padding:14px 24px;gap:13px}.group-heading h1{font-size:19px}.group-heading p{font-size:12px}.seat-strip{padding:15px 24px;gap:14px}.seat-card{min-width:90px}.seat-avatar-wrap,.seat-avatar-wrap img{width:44px;height:44px}.seat-name{font-size:12px}.seat-role{font-size:9px}.messages{padding:24px 38px 30px}.message{max-width:77%;margin-bottom:20px;gap:10px}.message-avatar{width:30px;height:30px}.bubble{padding:10px 14px 12px}.composer-area{padding:12px 28px max(10px,env(safe-area-inset-bottom))}.action-chips{margin-bottom:12px}.action-chip{font-size:11px;padding:7px 12px}.empty-state h2{font-size:26px}.message-text{font-size:13px}.connection-notice{padding:9px 24px;font-size:11px}}
@media(max-width:359px){.group-header{padding:10px;grid-template-columns:36px minmax(0,1fr) auto;gap:8px}.group-avatar{width:36px;height:36px;border-radius:12px}.group-heading h1{font-size:16px}.group-heading p{font-size:9px}.icon-button{width:34px;height:36px}.seat-strip{padding:10px;gap:5px}.messages{padding:16px 10px}.message{max-width:94%;gap:6px}.message-avatar{width:24px;height:24px;border-radius:8px}.bubble{padding:8px 10px}.message-meta{gap:4px}.author-role{font-size:8px}.composer-area{padding:8px 10px max(8px,env(safe-area-inset-bottom))}.action-chips{gap:5px}.action-chip{font-size:10px;padding:6px 8px}.composer textarea{font-size:12px;padding:11px}.empty-state h2{font-size:21px}.settings-section{padding:18px}.settings-save{padding-left:18px;padding-right:18px}.panel-header{padding:16px 18px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}}

/* --- Fitur chat: aksi pesan, reaksi, kutip, cari, unggah gambar --- */
.header-actions{display:flex;gap:2px;align-items:center}
.msg-actions{display:flex;gap:2px;margin-top:6px;opacity:0;transition:opacity .12s}
.message:hover .msg-actions,.message:focus-within .msg-actions{opacity:1}
.msg-action{width:26px;height:26px;border-radius:8px;background:transparent;font-size:12px;display:inline-flex;align-items:center;justify-content:center}
.msg-action:hover{background:var(--mint)}
.react-wrap{position:relative}
.emoji-picker{position:absolute;bottom:30px;left:0;display:flex;gap:2px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:4px;box-shadow:0 8px 30px #16372022;z-index:5}
.emoji-picker button{width:32px;height:32px;border-radius:8px;background:transparent;font-size:16px;display:inline-flex;align-items:center;justify-content:center}
.emoji-picker button:hover{background:var(--mint)}
.reaction-bar{display:flex;gap:4px;flex-wrap:wrap;margin-top:7px}
.reaction-pill{border:1px solid var(--line);background:#f4f7f0;border-radius:12px;padding:3px 8px;font-size:11px;line-height:1.4}
.reaction-pill.mine{border-color:var(--green);background:var(--mint);font-weight:650}
.quote-block{display:block;width:100%;text-align:left;border-left:3px solid var(--green);background:#f2f6ee;border-radius:6px;padding:6px 9px;margin:2px 0 7px;font-size:11px;line-height:1.6}
.quote-block strong{display:block;color:var(--green);font-size:10px}
.quote-block span{display:block;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere;max-height:60px;overflow:hidden}
.edited-label{font-size:9px;color:#a3ad9e;font-style:italic}
.search-bar{display:flex;align-items:center;gap:4px;padding:8px 16px;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0}
.search-bar input{flex:1;min-width:0;height:36px;border:1px solid #e1e7dc;border-radius:9px;background:#f7f8f2;padding:0 12px;font-size:12px;color:var(--ink)}
.search-count{font-size:11px;color:var(--muted);min-width:44px;text-align:center}
.search-mark{background:#ffe9a8;color:inherit;border-radius:3px;padding:0 2px}
.message.search-hit .bubble{outline:2px solid var(--green);outline-offset:2px}
.edit-area textarea{width:100%;border:1px solid #d8e2d2;border-radius:8px;background:#fbfcf8;padding:8px 10px;font:inherit;font-size:12.5px;line-height:1.6;color:var(--ink);resize:vertical;min-height:60px}
.edit-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}
.edit-actions .primary-button{min-height:32px;padding:6px 12px;font-size:11px}
.edit-actions .text-button{font-size:11px}
.reply-chip{display:flex;align-items:center;gap:8px;margin:0 0 8px;padding:7px 8px 7px 12px;border-left:3px solid var(--green);background:#f2f6ee;border-radius:8px;font-size:11px;color:var(--muted);line-height:1.5;min-width:0}
.reply-chip strong{color:var(--green)}
.reply-chip>span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-chip .icon-button{width:30px;height:30px;font-size:14px;flex-shrink:0}
.image-chip img{border-radius:7px;object-fit:cover;flex-shrink:0}

/* --- Mode gelap --- */
html.dark{color-scheme:dark;--green:#5fc4a0;--green-dark:#3da281;--mint:#24352c;--ink:#dce7df;--muted:#93a49a;--line:#2e3d34;--paper:#1b2620;--red:#e08a97}
html.dark body{background:#141d18}
html.dark .app{background:var(--paper);box-shadow:0 0 70px #00000066}
html.dark .group-header,html.dark .seat-strip,html.dark .composer-area,html.dark .search-bar{background:#212e27;border-color:var(--line)}
html.dark .icon-button:hover,html.dark .seat-card:hover{background:#2b3a31}
html.dark .seat-role{background:#2b3a31;color:#9fb0a5}
html.dark .seat-card:first-child .seat-role{background:#24352c;color:#7fc3a4}
html.dark .presence-dot{border-color:#212e27}
html.dark .connection-notice{background:#2b3324;color:#b9c47e;border-color:#3d4430}
html.dark .messages{background-image:radial-gradient(#ffffff0d .7px,transparent .7px)}
html.dark .bubble{background:#26332b;box-shadow:0 1px 2px #00000040}
html.dark .message-owner .bubble{background:#2b3d31}
html.dark .message-owner .author-name{color:#8fd0ae}
html.dark .date-divider span{background:#2b3a31;color:#93a49a}
html.dark .suggestions button{background:#26332b;border-color:#3a4a3f}
html.dark .typing-status{color:#8ba392}
html.dark .final-label{background:var(--green);color:#12211a}html.dark .primary-button{color:#12211a}
html.dark .demo-label{background:#463c1e;color:#e5c46a}
html.dark .provider-error{background:#3a272c;border-color:#5c3a42;border-left-color:#c76f7e;color:#e7a3ad}
html.dark .chat-image{background:#212e27}
html.dark .attachment-link{background:#26332b;border-color:#3a4a3f}
html.dark .attachment-link:hover{background:#2c3d33}
html.dark .attachment-link small{color:#93a396}
html.dark .action-chip{background:#2b3a31;border-color:#3a4a3f;color:var(--ink)}
html.dark .action-chip:hover{background:#33453a}
html.dark .composer textarea{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .composer textarea::placeholder{color:#7d8d82}
html.dark .settings-dialog,html.dark .settings-save,html.dark .panel-header{background:#1e2a24;color:var(--ink)}
html.dark .settings-section{border-color:#2e3d34}
html.dark .settings-section input:not([type=checkbox]),html.dark .settings-section select,html.dark .settings-section textarea,html.dark .search-bar input{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .connection-result{background:#24352c;color:#8fd0ae}
html.dark .connection-result.error{background:#3a272c;color:#e7a3ad}
html.dark .model-tag,html.dark .seat-code{background:#2b3a31;color:#9fb0a5}
html.dark .builtin-note{background:#24352c;color:#7fc3a4}
html.dark .secondary-button{background:#24352c;border-color:#3a4a3f;color:#8fd0ae}
html.dark .danger-button{background:#3a272c;color:#e7a3ad;border-color:#5c3a42}
html.dark .toast{background:#31544a}
html.dark .mention-dialog{background:#212e27;color:var(--ink)}
html.dark .mention-option:hover{background:#2b3a31}
html.dark .msg-action:hover{background:#2b3a31}
html.dark .emoji-picker{background:#26332b;border-color:#3a4a3f;box-shadow:0 8px 30px #00000066}
html.dark .emoji-picker button:hover{background:#33453a}
html.dark .reaction-pill{background:#2b3a31;border-color:#3a4a3f}
html.dark .reaction-pill.mine{background:#24352c;border-color:var(--green)}
html.dark .quote-block{background:#26332b;border-left-color:var(--green)}
html.dark .quote-block strong{color:#8fd0ae}
html.dark .reply-chip{background:#26332b}
html.dark .edit-area textarea{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .seat-settings textarea{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .search-mark{background:#5d4d1e;color:#f2e3b3}
html.dark button:focus-visible,html.dark input:focus-visible,html.dark select:focus-visible,html.dark textarea:focus-visible{outline-color:#3da281}
.provider-row{padding:14px 0;border-bottom:1px solid #e7ece1}.provider-row:first-child{padding-top:0}.provider-row:last-child{border:0;padding-bottom:0}.provider-info p{margin:0}.provider-info .field-hint{margin-top:4px}.provider-active{display:inline-block;font-size:9px;font-weight:750;color:#3f6b3f;background:#eaf0e3;padding:3px 6px;border-radius:4px;margin-left:6px}.provider-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.provider-actions .secondary-button{min-height:36px;padding:8px 12px}.provider-actions .text-button{padding:8px 0}.provider-row .model-list{margin-top:10px}.provider-test-results{margin-top:6px}.provider-test-results .model-status{margin:4px 0 0}.add-provider{margin-top:16px;padding-top:14px;border-top:1px solid #e7ece1}.add-provider h4{font-size:12px;font-weight:750;margin-bottom:4px}.provider-form-actions{display:flex;gap:12px;align-items:center;margin-top:14px;flex-wrap:wrap}
html.dark .provider-active{background:#24352c;color:#7fc3a4}

/* Fitur tambahan: ruang, pesan tersemat, voting, statistik, preset */
.room-bar{display:flex;gap:7px;overflow-x:auto;padding:9px 16px;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0;scrollbar-width:none}
.room-chip{padding:7px 12px;background:#f2f5ed;border:1px solid #e6ecdf;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap;color:var(--ink)}
.room-chip:hover{background:#e7f0e3}
.room-chip.active{background:var(--green);border-color:var(--green);color:#fff}
.room-chip.room-add{border-style:dashed;color:#4c6a4f}
.pinned-bar{display:flex;gap:7px;align-items:center;overflow-x:auto;padding:8px 16px;background:#f7f4e8;border-bottom:1px solid var(--line);flex-shrink:0;scrollbar-width:none}
.pinned-title{font-size:10px;font-weight:750;color:#8a7a3a;white-space:nowrap}
.pinned-item{padding:6px 10px;background:#fff;border:1px solid #e8e0c2;border-radius:8px;font-size:10.5px;white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis;color:var(--ink);text-align:left}
.pinned-item:hover{background:#fdf9ec}
.pin-label{font-size:10px}
.best-label{display:inline-block;margin-top:5px;padding:3px 8px;background:#fdf3d7;border:1px solid #eed88a;color:#8a6d1a;border-radius:6px;font-size:9.5px;font-weight:700}
.msg-action.pin-active{background:#fdf3d7}
.search-results{display:flex;flex-direction:column;max-height:220px;overflow:auto;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0}
.search-result{display:flex;gap:9px;align-items:baseline;padding:9px 16px;text-align:left;background:transparent;border-bottom:1px solid #eef1ea;font-size:11.5px;color:var(--ink)}
.search-result:hover{background:#f3f7f1}
.search-result-room{flex-shrink:0;padding:2px 7px;background:#e9f3e9;color:#3a794f;border-radius:5px;font-size:9px;font-weight:700}
.search-result-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-form{display:flex;flex-direction:column;gap:12px;margin-top:10px}
.room-form>label{font-size:11px;font-weight:650}
.room-form>label input{display:block;width:100%;height:40px;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:13px}
.room-seat-list{display:flex;flex-wrap:wrap;gap:6px 14px}
.room-seat-option{display:flex!important;align-items:center;gap:6px;font-size:11.5px;font-weight:550;margin:0!important;cursor:pointer}
.room-seat-option input{width:15px;height:15px;accent-color:var(--green)}
.room-seat-option small{color:var(--muted)}
.room-settings{padding:14px 0;border-bottom:1px solid #e7ece1}
.room-settings .room-seat-list{margin-top:10px}
.stats-table{border:1px solid #e7ece1;border-radius:9px;overflow:hidden;font-size:10.5px}
.stats-row{display:grid;grid-template-columns:1.6fr .6fr .7fr .5fr .7fr .6fr;gap:6px;padding:8px 11px;border-bottom:1px solid #eef1ea;align-items:center}
.stats-row:last-child{border-bottom:0}
.stats-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stats-head{background:#f2f5ed;font-weight:750;color:#5b6b5c}
html.dark .room-bar,html.dark .search-results{background:#212e27;border-color:var(--line)}
html.dark .room-chip{background:#2b3a31;border-color:#3a4a3f;color:var(--ink)}
html.dark .room-chip.active{background:var(--green);border-color:var(--green);color:#fff}
html.dark .room-chip.room-add{color:#9fc7a8}
html.dark .pinned-bar{background:#2c2a20;border-color:var(--line)}
html.dark .pinned-item{background:#33301f;border-color:#4a452c;color:var(--ink)}
html.dark .best-label{background:#3a3319;border-color:#6b5d24;color:#e8cf7a}
html.dark .search-result{border-color:#2e3d34}
html.dark .search-result:hover{background:#26332b}
html.dark .room-form>label input{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .stats-table{border-color:#2e3d34}
html.dark .stats-row{border-color:#2e3d34}
html.dark .stats-head{background:#26332b;color:#a9bfa9}

/* --- UI lebih smooth & responsif (26 Nov 2026) --- */
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
/* Animasi pesan masuk */
@keyframes msg-in{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}
.message{animation:msg-in .28s ease both}
/* Feedback tekan tombol */
button{transition:transform .12s ease,background-color .15s ease,border-color .15s ease,opacity .15s ease}
button:active{transform:scale(.97)}
.seat-card,.room-chip,.action-chip,.pinned-item,.search-result{transition:transform .12s ease,background-color .15s ease,border-color .15s ease}
.seat-card:active,.room-chip:active,.action-chip:active{transform:scale(.96)}
/* Dialog masuk halus */
@keyframes dialog-pop{from{opacity:0;transform:scale(.96) translateY(8px)}to{opacity:1;transform:none}}
@keyframes dialog-slide{from{transform:translateX(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes backdrop-in{from{opacity:0}to{opacity:1}}
.mention-dialog[open]{animation:dialog-pop .22s ease both}
.settings-dialog[open]{animation:dialog-slide .26s ease both}
.settings-dialog::backdrop,.mention-dialog::backdrop{animation:backdrop-in .22s ease both}
/* Toast masuk halus */
@keyframes toast-in{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
.toast:not([hidden]){animation:toast-in .25s ease both}
/* Titik mengetik melompat */
.typing-dots{display:inline-flex;gap:3px;align-items:center;flex-shrink:0}
.typing-dots i{width:5px;height:5px;border-radius:50%;background:#82a88a;animation:typing-bounce 1.1s ease-in-out infinite}
.typing-dots i:nth-child(2){animation-delay:.15s}
.typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes typing-bounce{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}
.typing-status::before{display:none}
.typing-status.waiting .typing-dots i{animation:none;background:#c2aa64;opacity:.8}
/* Target sentuh lebih besar */
.msg-action{width:38px;height:38px;font-size:14px}
@media(max-width:359px){.icon-button{width:38px;height:38px}}
/* Aksi pesan terlihat di perangkat sentuh */
@media(hover:none){.msg-actions{opacity:.6}}
/* Hover desktop */
@media(hover:hover){
  .seat-card:hover{transform:translateY(-1px)}
  .bubble{transition:box-shadow .18s ease}
  .message:hover .bubble{box-shadow:0 4px 16px #284e3114}
  .room-chip:hover{transform:translateY(-1px)}
  .action-chip:hover{transform:translateY(-1px)}
  .pinned-item:hover{transform:translateY(-1px)}
  .primary-button:hover,.send-button:hover{filter:brightness(1.06)}
}
/* Scroll-snap strip horizontal + scrollbar halus */
.seat-strip,.room-bar,.pinned-bar{scroll-snap-type:x proximity}
.seat-card,.room-chip,.pinned-item{scroll-snap-align:start}
.messages{scrollbar-width:thin;scrollbar-color:#c4d2bd transparent}
.messages::-webkit-scrollbar{width:8px}
.messages::-webkit-scrollbar-thumb{background:#c4d2bd;border-radius:8px}
.messages::-webkit-scrollbar-track{background:transparent}
html.dark .messages{scrollbar-color:#3a4a3f transparent}
html.dark .messages::-webkit-scrollbar-thumb{background:#3a4a3f}
/* Layar lebar */
@media(min-width:1100px){
  .app{max-width:1120px}
  .messages{padding:26px 56px 32px}
  .message{max-width:68%}
  .settings-dialog{width:min(100%,560px)}
}

/* Chip tool yang dipakai kursi gateway */
.tools-used{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.tool-chip{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:9.5px;background:#e9eee3;color:#4c6450;border:1px solid #d8e5ce;border-radius:20px;padding:3px 8px}
html.dark .tool-chip{background:#243528;color:#9db8a2;border-color:#33473a}

/* Banner persetujuan kode berbahaya */
.approval-banner{margin:10px 14px 0;padding:12px 14px;border:1px solid #e5c07b;background:#fff8e6;border-radius:12px;animation:msg-in .25s ease both}
.approval-title{font-size:12px;font-weight:650;color:#7a5a12;margin-bottom:8px}
.approval-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;line-height:1.6;background:#2b2118;color:#f5e6c8;border-radius:8px;padding:10px;max-height:180px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:10px}
.approval-actions{display:flex;gap:8px;justify-content:flex-end}
html.dark .approval-banner{background:#33290f;border-color:#6b5518}
html.dark .approval-title{color:#e8c97a}
.question-banner{border-color:#9db8e8;background:#eef4ff}
html.dark .question-banner{background:#16233c;border-color:#39548a}
.question-text{font-size:13px;margin:0 0 10px;white-space:pre-wrap}
.question-options{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.question-free{display:flex;gap:8px}
.question-free input{flex:1;min-width:0}

/* Utilitas jarak (pengganti inline style agar lolos CSP style-src-attr) */
.mt-10{margin-top:10px}
.mt-14{margin-top:14px}

/* Kontras mode gelap (WCAG >= 4.5) */
html.dark .room-chip.active{color:#10231b}
html.dark .message-meta{color:#9db8a8}
/* Meta pada bubble pemilik (latar #2b3d31) butuh warna lebih terang
   daripada meta kursi agar tetap >= 4.5:1 (axe: 4,36:1 sebelumnya). */
html.dark .message-owner .message-meta{color:#a8c4b2}
html.dark .composer-hint{color:#9db8a8}

/* Status kirim + kemajuan unggahan */
.send-button.sending{width:auto;padding:0 14px;gap:6px}
.send-label{font-size:12px;font-weight:600;white-space:nowrap}
.upload-progress{display:flex;align-items:center;gap:8px;padding:6px 2px;font-size:12px;color:var(--muted)}
.upload-progress-track{flex:1;height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.upload-progress-fill{height:100%;background:var(--green);border-radius:3px;transition:width .2s ease}

/* Picker skill multi-select */
.skill-picker{display:flex;flex-direction:column;gap:6px}
.skill-chips{display:flex;flex-wrap:wrap;gap:6px}
.skill-chip{display:inline-flex;align-items:center;gap:4px;background:var(--mint);color:var(--ink);border:1px solid var(--line);border-radius:999px;padding:3px 6px 3px 10px;font-size:12px;font-weight:600}
.skill-chip-remove{border:0;background:transparent;color:inherit;cursor:pointer;font-size:11px;line-height:1;padding:2px 4px;border-radius:999px}
.skill-results{display:flex;flex-direction:column;gap:4px;max-height:180px;overflow:auto}
.skill-result{display:flex;flex-direction:column;align-items:flex-start;gap:1px;text-align:left;background:var(--white);border:1px solid var(--line);border-radius:10px;padding:7px 10px;cursor:pointer;color:var(--ink)}
.skill-result small{color:var(--muted)}
.skill-empty{margin:2px 0;font-size:12px;color:var(--muted)}
html.dark .skill-result{background:#26332b}
.skill-source{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.mention-link{display:inline;padding:0 2px;margin:0 -1px;border:0;border-radius:5px;background:#e3f0e1;color:#256030;font:inherit;font-weight:650;cursor:pointer}
.mention-link:hover{background:#cfe6cb;text-decoration:underline}
html.dark .mention-link{background:#2b4030;color:#a8d8ae}
html.dark .mention-link:hover{background:#35523c}
.seat-info-head{display:flex;align-items:center;gap:12px;margin:4px 0 12px}
.seat-info-head .seat-avatar-wrap{margin:0}
.seat-info-head strong{display:block;font-size:16px}
.seat-info-head small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.seat-info-list{margin:0 0 12px;display:flex;flex-direction:column;gap:7px}
.seat-info-list>div{display:flex;justify-content:space-between;gap:14px;font-size:12px}
.seat-info-list dt{color:var(--muted)}
.seat-info-list dd{margin:0;font-weight:600;text-align:right;overflow-wrap:anywhere}
.seat-info-block{margin:0 0 12px}
.seat-info-block>span{display:block;font-size:11px;font-weight:650;color:var(--muted);margin-bottom:6px}
.seat-info-block p{margin:0;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.seat-info-chips{display:flex;flex-wrap:wrap;gap:5px}
.skill-chip-static{font-size:10px;font-weight:600;background:#e9f3e9;color:#3a794f;border-radius:20px;padding:3px 9px}
html.dark .skill-chip-static{background:#2b4030;color:#a8d8ae}
.seat-info-actions{display:flex;gap:9px;margin-top:4px}
.seat-info-actions .primary-button{flex:1}
.md-p{margin:0 0 8px}
.md-p:last-child{margin-bottom:0}
.md-h{margin:10px 0 6px;font-weight:750;line-height:1.35}
.md-h:first-child{margin-top:0}
.md-h1{font-size:19px}
.md-h2{font-size:17px}
.md-h3{font-size:15px}
.md-h4,.md-h5,.md-h6{font-size:13.5px}
.md-code{background:#eef2e8;border:1px solid var(--line);border-radius:9px;padding:10px 12px;margin:8px 0;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.55;white-space:pre}
html.dark .md-code{background:#1d2a22}
.md-inline-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.92em;background:#eef2e8;border-radius:5px;padding:1px 5px}
html.dark .md-inline-code{background:#2b4030}
.md-quote{border-left:3px solid #b9d3b2;margin:8px 0;padding:2px 0 2px 12px;color:#41523f}
html.dark .md-quote{color:#b7cbb4;border-left-color:#3f5c46}
.md-list{margin:6px 0 8px;padding-left:22px}
.md-list:last-child{margin-bottom:0}
.md-list li{margin:2px 0}
.md-hr{border:0;border-top:1px solid var(--line);margin:12px 0}
.message-text a{color:var(--green);text-decoration:underline;overflow-wrap:anywhere}
.md-code span{transition:color .15s ease}
.shj-syn-kwd{color:#c22e4a;font-weight:600}
.shj-syn-str{color:#1f7a3d}
.shj-syn-num,.shj-syn-bool,.shj-syn-esc{color:#0b5fa5}
.shj-syn-cmnt{color:#6b7a6d;font-style:italic}
.shj-syn-func,.shj-syn-section{color:#6d3fc0}
.shj-syn-class,.shj-syn-type{color:#b3540a}
.shj-syn-var{color:#243b2c}
.shj-syn-oper{color:#c22e4a}
.shj-syn-insert{color:#1f7a3d}
.shj-syn-deleted,.shj-syn-err{color:#b31d28}
html.dark .shj-syn-kwd{color:#ff8fa3}
html.dark .shj-syn-str{color:#a8dba8}
html.dark .shj-syn-num,html.dark .shj-syn-bool,html.dark .shj-syn-esc{color:#8ec9ff}
html.dark .shj-syn-cmnt{color:#93a89a}
html.dark .shj-syn-func,html.dark .shj-syn-section{color:#d3b8ff}
html.dark .shj-syn-class,html.dark .shj-syn-type{color:#ffb27a}
html.dark .shj-syn-var{color:#e6f0e4}
html.dark .shj-syn-oper{color:#ff8fa3}
html.dark .shj-syn-insert{color:#8fe3a0}
html.dark .shj-syn-deleted,html.dark .shj-syn-err{color:#ffa198}
.tools-details{margin:6px 0}
.tools-details summary{cursor:pointer;font-size:13px;color:var(--muted)}
.tools-checks{display:flex;flex-wrap:wrap;gap:4px 14px;margin:8px 0}
.tools-checks .check-label{display:flex;align-items:center;gap:6px;font-size:12.5px}
.tool-cards{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.tool-card{border:1px solid var(--line);border-radius:9px;padding:6px 10px;background:#f3f6ee}
html.dark .tool-card{background:#223128}
.tool-card summary{cursor:pointer;font-size:12.5px;font-weight:650}
.tool-card.tool-fail summary{color:var(--red)}
.tool-arg{font-size:12px;margin:6px 0;overflow-wrap:anywhere}
.tool-result{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11.5px;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0;max-height:220px;overflow:auto}
.schedule-dialog{width:min(440px,calc(100% - 32px))}
.schedule-dialog label{display:block;font-size:11px;font-weight:650;margin-top:12px}
.schedule-dialog textarea,.schedule-dialog input,.schedule-dialog select{display:block;width:100%;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:13px}
html.dark .schedule-dialog textarea,html.dark .schedule-dialog input,html.dark .schedule-dialog select{background:#2a3a31;border-color:#3c4f42}
.schedule-dialog .primary-button{margin-top:14px;width:100%}
.schedule-list-title{font-size:13px;margin:18px 0 8px}
.schedule-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.schedule-item{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:9px 12px}
.schedule-item>div{flex:1;min-width:0}
.schedule-item strong{display:block;font-size:12.5px;overflow-wrap:anywhere}
.schedule-item small{display:block;color:var(--muted);font-size:10.5px;margin-top:3px}
.schedule-item.disabled{opacity:.55}
.search-filters{padding:0 14px 10px}
.search-filters summary{cursor:pointer;font-size:11.5px;color:var(--muted)}
.search-filter-grid{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:end;margin-top:8px}
.search-filter-grid label{font-size:11px;font-weight:650;display:flex;flex-direction:column;gap:4px}
.search-filter-grid select,.search-filter-grid input[type=date]{height:34px;border:1px solid #dfe6da;border-radius:7px;padding:5px 8px;font-size:12px;background:#fff;color:var(--ink)}
html.dark .search-filter-grid select,html.dark .search-filter-grid input[type=date]{background:#2a3a31;border-color:#3c4f42}
.search-filter-grid .check-label{flex-direction:row;align-items:center;gap:6px}
.template-list{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:8px}
.template-item{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:9px 12px}
.template-item>div{flex:1;min-width:0}
.template-item strong{display:block;font-size:12.5px}
.template-item small{display:block;color:var(--muted);font-size:10.5px;margin-top:3px;overflow-wrap:anywhere}
.template-seat-picker{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.template-step{background:#edf3e7;border:1px solid #d8e5ce;border-radius:7px;padding:3px 8px;font-size:11px;margin:2px}
html.dark .template-step{background:#2a3a31;border-color:#3c4f42;color:var(--ink)}
.template-select{height:34px;border:1px solid #dfe6da;border-radius:8px;padding:5px 8px;font-size:12px;background:#fff;color:var(--ink);max-width:190px}
html.dark .template-select{background:#2a3a31;border-color:#3c4f42}
.room-chip-wrap{display:inline-flex;align-items:center;gap:2px}
.room-badge{display:inline-block;min-width:18px;text-align:center;background:#9e3445;color:#fff;border-radius:999px;font-size:10px;font-weight:700;padding:1px 5px;margin-left:6px;vertical-align:middle}
html.dark .room-badge{background:#e08a97;color:#1c1a1a}
.room-pin{background:none;border:none;font-size:11px;opacity:.45;padding:4px;cursor:pointer;border-radius:6px}
.room-pin:hover{opacity:1}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
.bubble p,.message-text{font-size:calc(13.5px * var(--font-scale,1))}
.composer textarea{font-size:calc(13.5px * var(--font-scale,1))}
.settings-section h3{font-size:calc(14px * var(--font-scale,1))}

/* Layar login PIN (fitur 31) */
.login-screen{min-height:100dvh;display:grid;place-items:center;padding:20px;background:var(--bg,#f4f6f8)}
.login-card{width:min(360px,100%);display:grid;gap:12px;padding:28px;border-radius:16px;background:var(--panel,#fff);box-shadow:0 12px 40px rgba(0,0,0,.12)}
.login-card h1{font-size:22px;margin:0}
.login-card p{margin:0;color:var(--muted,#5b6675);font-size:14px;line-height:1.6}
.login-card label{display:grid;gap:6px;font-size:13px;font-weight:600}
.login-card input{padding:10px 12px;border:1px solid var(--border,#d7dde5);border-radius:10px;font-size:15px}
html.dark .login-screen{background:#10151c}
html.dark .login-card{background:#1a222d;color:#e8edf3}
html.dark .login-card input{background:#121922;border-color:#334155;color:#e8edf3}
.tool-log-arg{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Mode kompak (fitur 36) */
html.density-compact .messages{padding-top:10px;padding-bottom:14px}
html.density-compact .message{margin-bottom:8px}
html.density-compact .bubble{padding:5px 9px 6px}
html.density-compact .message-text{font-size:12px;line-height:1.55}
html.density-compact .message-meta{margin-bottom:3px}

/* Badge kesehatan provider (fitur 6) */
.health-badge{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;vertical-align:middle}
.health-badge.ok{background:#e3f5e9;color:#146c2e}
.health-badge.fail{background:#fde7e7;color:#a11d1d}
html.dark .health-badge.ok{background:#12351f;color:#7ee2a0}
html.dark .health-badge.fail{background:#3d1717;color:#ff9c9c}
.skill-install{display:grid;gap:8px;margin:10px 0 14px;padding:12px;border:1px solid var(--border,#d7dde5);border-radius:12px}
.skill-install h4{margin:0;font-size:14px}
html.dark .skill-install{border-color:#334155}

/* Editor urutan bicara ruang (fitur 4) */
.seat-order-editor{margin-top:10px}
.seat-order-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.seat-order-add{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.order-chip{cursor:pointer;border:1px solid var(--border,#d7dde5)}
.order-add{font-size:12px;padding:4px 10px}

/* Form dialog debat + bagian fieldset (Keamanan, Log Audit Tool):
   samakan tampilan dengan .settings-section agar label bertumpuk
   dan kontrol ter-style (sebelumnya inline gaya bawaan browser). */
.settings-form fieldset{border:0;border-bottom:1px solid var(--line);padding:22px;margin:0;min-width:0}
.settings-form fieldset legend{font-size:14px;font-weight:750;padding:0;margin-bottom:7px}
.settings-form fieldset .hint{color:var(--muted);font-size:11px;line-height:1.7;margin:0 0 17px}
.settings-form fieldset label,.settings-form>label{display:block;font-size:11px;font-weight:650;margin-top:13px}
.settings-form fieldset input:not([type=checkbox]),.settings-form fieldset select,.settings-form fieldset textarea,.settings-form>label select,.settings-form>label textarea{display:block;width:100%;height:42px;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:13px;min-width:0}
.settings-form>label textarea,.settings-form fieldset textarea{height:auto;min-height:76px;line-height:1.6;resize:vertical}
.settings-form fieldset input::placeholder{color:#5f6f63}
.settings-form .settings-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:13px}
html.dark .settings-form fieldset input:not([type=checkbox]),html.dark .settings-form fieldset select,html.dark .settings-form fieldset textarea,html.dark .settings-form>label select,html.dark .settings-form>label textarea{background:#26332b;border-color:#3a4a3f;color:var(--ink)}

/* Batch 3: banner offline, petunjuk /slash, uji A/B, rating, koreksi, rantai, peserta, dokumen, ollama */
.offline-banner{background:#fdf3d8;color:#7a5b00;border:1px solid #e8d48a;border-radius:10px;padding:8px 12px;margin:8px 12px 0;font-size:12px}
html.dark .offline-banner{background:#3a3317;color:#f0d98a;border-color:#6b5f2a}
.slash-hints{display:flex;flex-direction:column;gap:4px;margin:0 12px 8px;padding:8px;border:1px solid var(--border,#d7dde5);border-radius:12px;background:var(--surface,#fff)}
html.dark .slash-hints{background:#26332b;border-color:#3a4a3f}
.slash-hint{display:flex;gap:10px;align-items:baseline;text-align:left;background:none;border:0;padding:6px 8px;border-radius:8px;cursor:pointer;color:inherit;font:inherit}
.slash-hint:hover{background:rgba(124,92,255,.12)}
.slash-hint span{color:var(--muted,#667);font-size:12px}
.ab-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}
@media (max-width:720px){.ab-pair{grid-template-columns:1fr}}
.ab-pair .message{min-width:0}
.ab-label{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#e8e4ff;color:#4b3bb8}
html.dark .ab-label{background:#2c2650;color:#c4bbff}
.chain-label{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#e3f5e9;color:#146c2e}
html.dark .chain-label{background:#12351f;color:#7ee2a0}
.ab-pick{margin-left:8px;padding:2px 10px;font-size:12px}
.rating-bar{display:flex;gap:6px;align-items:center;margin-top:6px}
.rating-button{background:none;border:1px solid transparent;border-radius:999px;padding:2px 8px;cursor:pointer;font-size:13px;opacity:.55}
.rating-button:hover{opacity:1}
.rating-button.active{opacity:1;border-color:var(--border,#d7dde5);background:rgba(124,92,255,.12)}
.original-text{margin-top:6px;font-size:12px}
.original-text summary{cursor:pointer;color:var(--muted,#667)}
.local-text{white-space:pre-wrap}
.participants-editor,.documents-editor{margin-top:10px}
.participant-add{display:flex;gap:8px;align-items:center;margin-top:6px}
.participant-add input{flex:1;min-width:0}
.document-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:4px 0}
.file-button{display:inline-block;cursor:pointer;margin-top:6px}
.chain-step{border:1px solid var(--border,#d7dde5);border-radius:12px;padding:10px;margin:8px 0}
html.dark .chain-step{border-color:#3a4a3f}
.chain-run{display:flex;gap:8px;align-items:center;margin-top:6px}
.chain-run input{flex:1;min-width:0}
.ollama-model-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:4px 0}

/* Indikator muatan dialog malas (chunk diunduh saat pertama dibuka) */
.dialog-loading{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#19382b33;backdrop-filter:blur(2px);z-index:60}
.dialog-loading-card{display:flex;align-items:center;gap:12px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:14px 20px;font-size:13px;font-weight:650;box-shadow:0 12px 40px #153e2833}
.dialog-loading .spinner{width:24px;height:24px;flex-shrink:0;border-radius:50%;border:3px solid var(--line);border-top-color:var(--green);animation:dialog-spin .7s linear infinite}
@keyframes dialog-spin{to{transform:rotate(360deg)}}

/* CATATAN: content-visibility:auto pada .message PERNAH dicoba
   (render awal lebih ringan) tetapi dicabut: membuka dialog modal
   dengan ribuan pesan jadi ~3 detik lebih lambat karena browser
   harus merender konten yang dilewati, dan tes visual jadi tidak
   deterministik. Kecepatan tema/render dijaga lewat pemakaian
   ulang objek pesan + cache parse Markdown di chat.svelte.ts. */

/* Panel kerja ruang (fitur omp): todo, checkpoint, goal/plan/vibe */
.work-panel{border-bottom:1px solid var(--line);background:#fbfcf8;flex-shrink:0}
.work-toggle{display:flex;align-items:center;gap:8px;width:100%;padding:7px 16px;background:none;border:0;font-size:11px;font-weight:700;color:var(--ink);cursor:pointer;text-align:left}
.work-badge{background:#e9eee3;border:1px solid #d8e5ce;color:#3c6c40;border-radius:10px;padding:2px 8px;font-size:9.5px;font-weight:700}
.work-badge.plan{background:#fdf3d7;border-color:#eed88a;color:#8a6d1a}
.work-badge.vibe{background:#e8e4f7;border-color:#cfc6ec;color:#5b4a9e}
.work-caret{margin-left:auto;color:var(--muted)}
.work-body{padding:4px 16px 12px;display:flex;flex-direction:column;gap:10px;max-height:320px;overflow:auto}
.work-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.work-label{font-size:10px;font-weight:750;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;min-width:110px}
.work-goal{font-size:12px;color:var(--ink);flex:1;min-width:120px}
.work-input{flex:1;min-width:140px;height:32px;background:#fff;border:1px solid #dfe6da;border-radius:7px;padding:6px 9px;color:var(--ink);font-size:12px}
.work-btn{background:#edf3e7;border:1px solid #d8e5ce;color:#3c6c40;border-radius:7px;padding:6px 11px;font-size:11px;font-weight:650;cursor:pointer}
.work-btn.ghost{background:none;border-color:transparent;color:var(--muted);text-decoration:underline}
.work-check{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--ink);cursor:pointer}
.work-section{display:flex;flex-direction:column;gap:5px}
.todo-row{display:flex;align-items:center;gap:8px;font-size:12px}
.todo-mark{background:none;border:0;font-size:14px;cursor:pointer;padding:2px 4px;color:var(--green)}
.todo-text{flex:1;min-width:0;color:var(--ink)}
.todo-text.done{text-decoration:line-through;color:var(--muted)}
.todo-select{height:26px;border:1px solid #dfe6da;border-radius:6px;background:#fff;font-size:10.5px;color:var(--ink)}
.todo-del{background:none;border:0;color:var(--muted);cursor:pointer;font-size:11px;padding:2px 4px}
.todo-add{display:flex;gap:8px;margin-top:4px}
/* Panel omp di Pengaturan */
.omp-textarea{display:block;width:100%;background:#fff;border:1px solid #dfe6da;border-radius:8px;padding:9px 11px;margin-top:6px;color:var(--ink);font-size:12.5px;line-height:1.6;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.omp-subtitle{font-size:12.5px;font-weight:750;margin:20px 0 6px;color:var(--ink)}
.policy-list{display:flex;flex-direction:column;gap:4px;max-height:280px;overflow:auto;border:1px solid #e7ece1;border-radius:8px;padding:8px}
.policy-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11.5px}
.policy-row code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;color:var(--ink)}
.policy-row select{height:28px;border:1px solid #dfe6da;border-radius:6px;background:#fff;font-size:11px;color:var(--ink);width:110px}
.memory-list{display:flex;flex-direction:column;gap:6px;max-height:240px;overflow:auto}
.memory-row{display:flex;align-items:flex-start;gap:10px;font-size:11.5px;border:1px solid #e7ece1;border-radius:8px;padding:8px 10px}
.memory-text{flex:1;min-width:0;color:var(--ink);line-height:1.5}
.memory-text small{color:var(--muted)}
html.dark .work-panel{background:#232f28;border-color:#2e3d34}
html.dark .work-input,html.dark .todo-select,html.dark .omp-textarea,html.dark .policy-row select{background:#26332b;border-color:#3a4a3f;color:var(--ink)}
html.dark .policy-list,html.dark .memory-row{border-color:#2e3d34}
