#chatDialog{color-scheme:light;--paper:#f0e5c9;--ink:#3a3024;--muted:#715e44;--line:#beab85;--olive:#53633f;--cl-ivory:#f6e8c8;--cl-gold-highlight:#b19456;font-family:"Segoe UI",Arial,sans-serif;color:var(--ink);background:#343c2b}
#chatDialog *{box-sizing:border-box}
#chatDialog [hidden]{display:none!important}
#chatDialog h1,#chatDialog p{margin:0}
#chatDialog button,#chatDialog textarea{font:inherit;color:inherit}
#chatDialog button{cursor:pointer;touch-action:manipulation}
#chatDialog button:disabled{cursor:not-allowed;opacity:.52}
#chatDialog button:focus-visible,#chatDialog textarea:focus-visible,#chatDialog [tabindex="0"]:focus-visible{outline:2px solid #486371;outline-offset:-2px}
#chatDialog .cl-icon{width:24px;height:24px}
#chatDialog .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#chatDialog .chat-tab-unread{width:8px;height:8px}
#chatDialog{width:min(1040px,calc(100vw - 24px));height:min(790px,calc(100dvh - 24px));max-width:none;max-height:none;margin:auto;padding:7px;border:2px solid #60402b;border-radius:0;background:#783e31;color:var(--ink);box-shadow:inset 0 0 0 2px #d8b57a,0 12px 48px #171a1680;overflow:hidden}
#chatDialog::backdrop{background:#20291f65;backdrop-filter:blur(3px)}
#chatDialog>.modal-card.chat-card{width:100%;height:100%;max-height:none;padding:0;display:flex;flex-direction:column;gap:0;border:1px solid #c6a66b;border-radius:0;background:var(--paper);box-shadow:inset 0 0 0 2px #f6edcf}
#chatDialog .chat-header{flex:none;justify-content:initial;min-height:86px;gap:14px;padding:12px 20px;border-bottom:1px solid #c6ad7d;background:linear-gradient(100deg,#e1cca1,#f2e7ca 62%,#e8d7b4)}
#chatDialog .chat-heading-icon{width:54px;height:54px}
#chatDialog .chat-heading{min-width:0}
#chatDialog .chat-eyebrow{font:10px "Segoe UI",sans-serif;letter-spacing:1.7px;color:#7b5731}
#chatDialog .chat-header h1{font:34px/1.2 Georgia,serif;margin-top:3px}
#chatDialog .connection{margin-left:auto;display:flex;align-items:center;gap:7px;font-size:11px;color:#57633e}
#chatDialog .connection i{height:6px;width:6px;border-radius:50%;background:#677b45}
#chatDialog .connection[data-state="reconnecting"],#chatDialog .connection[data-state="failed"]{color:#8b4d30}
#chatDialog .connection[data-state="reconnecting"] i,#chatDialog .connection[data-state="failed"] i{background:#a97532}
#chatDialog .chat-window-actions{gap:4px}
#chatDialog .chat-window-actions .modal-close,#chatDialog .chat-window-actions .chat-minimize-btn{position:static;width:44px;height:44px;border:0;border-left:1px solid #c5ad80;border-radius:0;background:transparent;box-shadow:none;color:#73503a;font:28px Georgia,serif}
#chatDialog .chat-window-actions button:hover{background:#d2bc922e}
#chatDialog .channel-bar{display:flex;flex:none;align-items:center;justify-content:space-between;gap:15px;padding:0 22px;border-bottom:1px solid var(--line);background:#e6d8b7}
#chatDialog .chat-tabs{display:flex;gap:0}
#chatDialog .chat-tabs button{position:relative;min-height:51px;min-width:123px;padding:0 22px;border:0;border-bottom:3px solid transparent;border-radius:0;background:none;box-shadow:none;color:#786245;font:18px Georgia,serif;letter-spacing:0;text-transform:none}
#chatDialog .chat-tabs button.active{border-color:#53633f;background:linear-gradient(#778b4b10,#75834720);color:#435430;box-shadow:none}
#chatDialog .channel-bar>p{font:13px Georgia,serif;color:#766143;text-align:right}
#chatDialog .chat-history{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;border:0;border-radius:0;background:linear-gradient(100deg,#f7efd8,#eee1c2);box-shadow:none;overflow:hidden}
#chatDialog .history-heading{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;min-height:34px;padding:0 28px;color:#86704e;border-bottom:1px solid #c5b18b70;font-size:10px;letter-spacing:1.1px}
#chatDialog .history-heading>span:last-child{font:italic 12px Georgia,serif;letter-spacing:0}
#chatDialog .history-stage{position:relative;flex:1;min-height:0;overflow:hidden}
#chatDialog .chat-message-list{height:100%;padding:8px 22px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a08b60 #e7d9b9;scrollbar-gutter:stable}
#chatDialog .chat-message{padding:13px 14px;border:0;border-bottom:1px solid #c2b08b70;border-left:3px solid transparent}
#chatDialog .chat-message.is-own{background:#72824e0e;border-left-color:#7c8857}
#chatDialog .chat-message .chat-message-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 18px;white-space:normal;margin:0;font:14px/1.55 "Segoe UI",sans-serif;overflow-wrap:anywhere}
#chatDialog .chat-message-sender{grid-column:1;grid-row:1;justify-self:start;min-height:24px;max-width:100%;font:600 14px/1.35 Georgia,serif;color:#765034;padding:0;border:0;text-align:left}
#chatDialog .chat-message.is-own .chat-message-sender{color:#526339}
#chatDialog .chat-message-colon{display:none}
#chatDialog .chat-message-text{grid-column:1/-1;grid-row:2;white-space:pre-wrap;color:#3a3024}
#chatDialog .chat-message time{grid-column:2;grid-row:1;align-self:center;margin:0;font:11px "Segoe UI",sans-serif;font-variant-numeric:tabular-nums;color:#8a7657}
#chatDialog .chat-empty-state{font:18px/1.5 Georgia,serif;color:#7b6548;width:min(80%,420px)}
#chatDialog .history-footer{display:flex;flex:none;align-items:center;gap:12px;min-height:45px;padding:0 28px;border-top:1px solid #c2ad8166;background:#e9dcbd99}
#chatDialog .chat-load-older{position:static;transform:none;min-height:44px;padding:0;background:transparent;box-shadow:none;border:0;border-radius:0;color:#705238;font:13px Georgia,serif;text-decoration:underline;text-decoration-color:#b29b73;text-underline-offset:4px}
#chatDialog .history-footer>span{margin-left:auto;font:italic 12px Georgia,serif;color:#8a7555}
#chatDialog .chat-new-messages{min-height:44px;bottom:7px;border:1px solid #8c4735;border-radius:2px;background:linear-gradient(#955640,#743e31);box-shadow:0 3px 8px #68513940;color:#fff0ce;font:14px Georgia,serif;padding:8px 17px}
#chatDialog .composer-panel{flex:none;padding:14px 26px 12px;border-top:1px solid #ba9f72;background:linear-gradient(#e6d6b3,#d9c59d);box-shadow:inset 0 2px #f5e7c5}
#chatDialog .chat-composer{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:12px;align-items:end}
#chatDialog .compose-field{min-width:0}
#chatDialog .compose-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;gap:12px}
#chatDialog .compose-label label{font:14px Georgia,serif;color:#765435}
#chatDialog .compose-label small{font-size:10px;font-variant-numeric:tabular-nums;color:#7a684b}
#chatDialog .compose-label small.over-limit{color:#873e32}
#chatDialog .chat-composer textarea{display:block;width:100%;height:60px;min-height:60px;max-height:60px;resize:none;border:1px solid #b49a6c;border-radius:2px;padding:10px 13px;background:#f8efd8;box-shadow:inset 0 2px 3px #765a2710;font:14px/1.4 "Segoe UI",sans-serif;color:#3a3024}
#chatDialog .chat-composer .primary-btn{min-height:60px;padding:8px 14px;border:1px solid #6c392d;border-radius:2px;background:linear-gradient(#945840,#753f32);box-shadow:inset 0 0 0 2px #b885584d;color:#fff0ce;font:18px Georgia,serif}
#chatDialog .chat-composer .primary-btn:hover:not(:disabled){filter:brightness(1.1)}
#chatDialog .chat-composer .primary-btn:disabled{background:linear-gradient(#9e8e71,#8c7c61);border-color:#8e7b5c;color:#f3e6c8;opacity:.7}
#chatDialog .composer-footnote{display:flex;justify-content:space-between;gap:10px;margin-top:7px;color:#806b49;font-size:10px}
#chatDialog .chat-status{font:12px/1.25 "Segoe UI",sans-serif;color:#745630;margin:6px 0 0}
#chatDialog .chat-status[data-tone="error"]{color:#853d30}
@media(max-width:900px) and (orientation:landscape){
#chatDialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);padding:4px}
#chatDialog>.modal-card.chat-card{height:100%;max-height:none;padding:0;display:flex;gap:0}
#chatDialog .chat-header{min-height:55px;padding:5px 13px;gap:9px}
#chatDialog .chat-heading-icon{width:36px;height:36px}
#chatDialog .chat-eyebrow{font-size:8px;letter-spacing:1.2px}
#chatDialog .chat-header h1{font-size:24px;margin-top:1px}
#chatDialog .chat-window-actions .modal-close,#chatDialog .chat-window-actions .chat-minimize-btn{width:44px;height:44px}
#chatDialog .connection{font-size:10px}
#chatDialog .channel-bar{padding:0 15px}
#chatDialog .chat-tabs button{min-height:44px;min-width:93px;padding:0 17px;font-size:16px}
#chatDialog .channel-bar>p{font-size:11px}
#chatDialog .history-heading{min-height:24px;padding:0 20px;font-size:8px}
#chatDialog .history-heading>span:last-child{font-size:10px}
#chatDialog .chat-message-list{padding:2px 12px}
#chatDialog .chat-message{padding:6px 8px}
#chatDialog .chat-message .chat-message-line{gap:2px 10px;font-size:12px;line-height:1.4}
#chatDialog .chat-message-sender{font-size:13px;min-height:24px}
#chatDialog .chat-message time{font-size:10px}
#chatDialog .history-footer{padding:0 18px;min-height:32px}
#chatDialog .chat-load-older{min-height:32px;font-size:11px}
#chatDialog .history-footer>span{font-size:10px}
#chatDialog .composer-panel{padding:6px 17px}
#chatDialog .compose-label{margin-bottom:3px}
#chatDialog .compose-label label{font-size:11px}
#chatDialog .compose-label small{font-size:9px}
#chatDialog .chat-composer{grid-template-columns:minmax(0,1fr) 88px;gap:8px}
#chatDialog .chat-composer textarea{height:44px;min-height:44px;max-height:44px;padding:7px 9px;font-size:12px}
#chatDialog .chat-composer .primary-btn{min-height:44px;font-size:16px}
#chatDialog .composer-footnote{margin-top:4px;font-size:8px}
#chatDialog .chat-status{font-size:10px;margin-top:4px}
#chatDialog .chat-empty-state{font-size:15px}
#chatDialog .chat-new-messages{min-height:36px;font-size:12px}
}
@media(max-width:900px) and (orientation:landscape){
#chatDialog .chat-message .chat-message-line{grid-template-columns:126px minmax(0,1fr) 48px;gap:10px;align-items:start}
#chatDialog .chat-message-sender{align-self:start}
#chatDialog .chat-message-text{grid-column:2;grid-row:1}
#chatDialog .chat-message time{grid-column:3;align-self:start;padding-top:4px}
#chatDialog .chat-message{padding-block:7px}
#chatDialog .history-heading{display:none}
#chatDialog .history-footer>span{font-size:10px}
#chatDialog .composer-footnote .newline-hint{display:none}
}
@media(max-width:650px) and (orientation:landscape){
#chatDialog .chat-header{padding:3px 9px;gap:6px;min-height:50px}
#chatDialog .chat-header h1{font-size:22px}
#chatDialog .chat-heading-icon{width:32px;height:32px}
#chatDialog .chat-eyebrow{font-size:7px}
#chatDialog .connection{gap:4px;font-size:9px}
#chatDialog .chat-window-actions{gap:0}
#chatDialog .channel-bar{padding:0 9px;gap:7px}
#chatDialog .chat-tabs button{min-width:76px;padding:0 12px;font-size:15px}
#chatDialog .channel-bar>p{max-width:180px;font-size:10px}
#chatDialog .chat-message-list{padding:2px 8px}
#chatDialog .chat-message{padding:5px 6px}
#chatDialog .chat-message .chat-message-line{font-size:12px;grid-template-columns:92px minmax(0,1fr) 46px;gap:7px}
#chatDialog .chat-message-sender{font-size:12px}
#chatDialog .history-footer{padding:0 12px}
#chatDialog .history-footer>span{display:none}
#chatDialog .composer-panel{padding:5px 12px}
#chatDialog .composer-footnote{font-size:8px}
#chatDialog .newline-hint{display:none}
}
#chatDialog .chat-header{min-height:64px; padding:7px 18px; gap:10px;}
#chatDialog .chat-heading-icon{width:40px; height:40px;}
#chatDialog .chat-header h1{font-size:28px; line-height:1.1; margin-top:1px;}
#chatDialog .chat-eyebrow{font-size:8px; letter-spacing:1.3px;}
#chatDialog .channel-bar{padding-inline:18px; gap:12px;}
#chatDialog .chat-tabs button{min-height:44px; min-width:100px; padding-inline:18px; font-size:17px;}
#chatDialog .chat-tools{display:flex; align-items:center; gap:17px; min-width:0;}
#chatDialog .chat-tools>p{color:#766143; font:12px Georgia,serif;}
#chatDialog .history-heading{display:none;}
#chatDialog .chat-message-list{padding:3px 16px;}
#chatDialog .chat-message{padding:7px 10px;}
#chatDialog .chat-message .chat-message-line{grid-template-columns:145px minmax(0,1fr) 60px; gap:12px; align-items:start; font-size:14px; line-height:1.4;}
#chatDialog .chat-message-sender{grid-column:1; grid-row:1; align-self:start; font-size:14px; min-height:24px; line-height:1.4;}
#chatDialog .chat-message-text{grid-column:2; grid-row:1;}
#chatDialog .chat-message time{grid-column:3; grid-row:1; align-self:start; padding-top:3px; text-align:right;}
#chatDialog .chat-message.is-translated .chat-message-text{color:#415332;}
#chatDialog .chat-message.is-translated .chat-message-text::after{content:" ▪"; color:#85925d; font-size:10px;}
#chatDialog .history-footer{min-height:32px; padding-inline:22px; gap:8px;}
#chatDialog .chat-load-older{min-height:32px; font-size:12px;}
#chatDialog .history-footer>span{font-size:11px;}
#chatDialog #chatTranslationStatus[data-state="error"]{color:#8b3d32; font-style:normal;}
#chatDialog #chatTranslationRetry{min-width:44px; text-align:center;}
#chatDialog .composer-panel{padding:7px 20px;}
#chatDialog .chat-composer{grid-template-columns:minmax(0,1fr) 92px; gap:10px;}
#chatDialog .compose-label{margin-bottom:4px;}
#chatDialog .compose-label label{font-size:12px;}
#chatDialog .chat-composer textarea{height:44px; min-height:44px; max-height:44px; padding:7px 11px; font-size:13px;}
#chatDialog .chat-composer .primary-btn{min-height:44px; font-size:17px;}
#chatDialog .composer-footnote{margin-top:4px; font-size:9px;}
@media(max-width:900px) and (orientation:landscape){
#chatDialog .chat-header{min-height:50px; padding:3px 11px; gap:8px;}
#chatDialog .chat-heading-icon{width:32px; height:32px;}
#chatDialog .chat-header h1{font-size:23px;}
#chatDialog .chat-eyebrow{display:none;}
#chatDialog .channel-bar{padding:0 12px;}
#chatDialog .chat-tabs button{min-height:44px; min-width:83px; padding-inline:14px; font-size:15px;}
#chatDialog .chat-tools>p{display:none;}
#chatDialog .chat-message-list{padding:2px 10px;}
#chatDialog .chat-message{padding:5px 7px;}
#chatDialog .chat-message .chat-message-line{grid-template-columns:119px minmax(0,1fr) 47px; gap:9px; font-size:12px;}
#chatDialog .chat-message-sender{font-size:13px;}
#chatDialog .history-footer{padding-inline:17px;}
#chatDialog .history-footer>span{font-size:10px; display:inline;}
#chatDialog .composer-panel{padding:5px 14px;}
#chatDialog .compose-label{margin-bottom:2px;}
#chatDialog .compose-label label{font-size:10px;}
#chatDialog .chat-composer{grid-template-columns:minmax(0,1fr) 82px; gap:8px;}
#chatDialog .chat-composer textarea{font-size:12px;}
#chatDialog .composer-footnote{font-size:8px; margin-top:3px;}
}
@media(max-width:650px) and (orientation:landscape){
#chatDialog .chat-header{padding-inline:8px; gap:6px;}
#chatDialog .chat-header h1{font-size:22px;}
#chatDialog .chat-heading-icon{width:29px; height:29px;}
#chatDialog .channel-bar{padding-inline:9px; gap:5px;}
#chatDialog .chat-tabs button{min-width:68px; padding-inline:10px;}
#chatDialog .chat-message-list{padding-inline:7px;}
#chatDialog .chat-message{padding:4px 5px;}
#chatDialog .chat-message .chat-message-line{grid-template-columns:88px minmax(0,1fr) 45px; gap:6px;}
#chatDialog .chat-message-sender{font-size:12px;}
#chatDialog .composer-panel{padding-inline:11px;}
#chatDialog .history-footer{padding-inline:13px;}
#chatDialog .history-footer>span{font-size:9px;}
}

/* Google supplies these attribution badges; preserve their artwork. */
.chat-google-attribution[hidden]{display:none!important}
.chat-google-attribution{display:inline-flex;align-items:center;flex-shrink:0}
.chat-google-attribution img{display:block;width:auto;height:16px}
#chatDialog .history-footer{flex-wrap:wrap;gap:4px 10px}

/* Approved pre-ledger mini preview: exact original 72% brown background. */
#quickChat{display:flex;flex-direction:column;height:64px;min-height:64px;max-height:64px;padding:3.2px 8.32px;border:1px solid rgba(198,154,69,.72);border-radius:6px;opacity:1;background:linear-gradient(180deg,rgba(49,33,23,.72),rgba(22,16,12,.72)),repeating-linear-gradient(90deg,rgba(232,216,176,.045) 0 1px,transparent 1px 7px);box-shadow:inset 0 0 0 1px rgba(236,220,179,.08),0 12px 26px rgba(0,0,0,.38);backdrop-filter:none;color:#f7ebcf;cursor:default;overflow:hidden}
#quickChat .quick-chat-heading{align-items:center;margin-bottom:4px}#quickChat .quick-chat-heading button{border:0;background:none;padding:2px 0;color:#eadfc7;font:11px Georgia,serif;min-height:28px;cursor:pointer}
#quickChat .quick-chat-messages{gap:5px}#quickChat .mini-row{min-width:0}#quickChat .mini-row p{font:12px/1.3 "Segoe UI",sans-serif}#quickChat .mini-row strong{font:600 12px Georgia,serif}
:is(#chatDialog,#quickChat) .message-tools{display:flex;align-items:center;flex-wrap:wrap;gap:3px 9px;min-height:28px}
#chatDialog .message-tools{margin-left:150px}
:is(#chatDialog,#quickChat) .per-message-translate{min-height:28px;padding:2px 1px;border:0;background:none;color:#546444;font:12px "Segoe UI",sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
:is(#chatDialog,#quickChat) .per-message-translate:disabled{cursor:wait;opacity:.7;text-decoration:none}
:is(#chatDialog,#quickChat) .message-error{font:11px/1.3 "Segoe UI",sans-serif;color:#894032}
#quickChat .per-message-translate{font-size:10px;color:#f0dcad}#quickChat .message-error{font-size:10px;color:#ffd2b4}#quickChat .chat-google-attribution img{height:12px;background:#eee7d8;padding:1px;border-radius:1px}
@media(max-width:900px) and (orientation:landscape){#chatDialog .message-tools{margin-left:106px}#chatDialog .per-message-translate{font-size:11px}#quickChat .mini-row p,#quickChat .mini-row strong{font-size:11px}}
@media(max-width:650px) and (orientation:landscape){#chatDialog .message-tools{margin-left:94px}}

/* Approved original sizing and burgundy controls. */
#chatToggleBtn.resource-pill{border:2px solid #997643;color:#f2e2bf!important;background:linear-gradient(180deg,#72363a,#542728)!important;box-shadow:inset 0 1px 0 rgba(255,248,232,.16),0 4px 9px rgba(47,33,19,.34)!important}
#quickChat .quick-chat-heading{flex:none;height:15px;min-height:15px;margin:0 0 1.6px;padding:0 0 1.28px}
#quickChat .quick-chat-heading strong{font-size:9.92px;letter-spacing:.8px}
#quickChat .quick-chat-heading button{font:600 10px/1 Georgia,serif;min-height:0;height:14px;padding:0}
#quickChat .quick-chat-messages{display:flex;flex-direction:column;gap:2.24px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#b69a6470 transparent;overscroll-behavior:contain}
#quickChat .mini-row{flex:none}#quickChat .mini-row p,#quickChat .mini-row strong{font-size:10.88px;line-height:12px}
#quickChat .message-tools{gap:3px 6px;flex-wrap:nowrap}
#activeItemEffectsStack{height:auto!important}
@media(orientation:landscape) and (max-height:600px){
 #activeItemEffectsStack{top:calc(50% - 3px)!important}
 #activeItemEffectsStack.compact{--effect-badge-size:min(50px,calc((100dvh - 172px)/3));--effect-icon-size:var(--effect-badge-size)}
 #activeItemEffectsStack.dense{--effect-badge-size:min(46px,calc((100dvh - 173px)/4));--effect-icon-size:var(--effect-badge-size)}
}
