/* AGI CHAT / Quiet Future — production visual layer */
:root{
 --bg:#f0f2ec;--sidebar:#fafaf6;--paper:#fffefa;--ink:#171b17;
 --muted:#81897e;--line:#e6eae1;--primary:#c3f56d;--lav:#ecf6da;
 --peach:#f1e9de;--sage:#e1efcf;--ease:cubic-bezier(.2,.8,.2,1);
}
html,body{color:var(--ink)}
body{background:#edf0e9;background-image:none}
button,input,textarea{font-family:inherit}
button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #78ac29;outline-offset:2px}
.workspace{background:#fafaf6;border:1px solid #e0e5da;border-radius:24px;box-shadow:0 24px 80px #23352018}
.sidebar{background:#fafaf6;border-right:1px solid var(--line)}
.main{background:#fffefa}
.brand{font-weight:850;letter-spacing:-1.7px;color:#171b17}
.brand-logo{background:#171b17;color:#c3f56d;border-radius:50%;box-shadow:none}
.wordmark-dot{color:#7aab2d;font-weight:350}
.side-caption,.section-label{color:#8b9488}
.section-label strong{background:#e8f5d3;color:#3c651b}
.search-wrap{background:#f2f4ef;border-color:#e8ece4;border-radius:22px}
.search-wrap:focus-within{border-color:#a7d35e}
.search-wrap input{color:#171b17}
.chat-item{border-radius:16px}
.chat-item:hover,.chat-item.selected{background:#edf4e4}
.chat-name{font-weight:690;color:#1b211b}
.chat-last{color:#879085}
.chat-time{color:#9ba298}
.unread{background:#b9ee63;color:#192414}
.avatar{border-radius:50%;background:#e0edcf;color:#3c5b30}
.avatar.peach{background:#f0e1d0;color:#805c40}
.avatar.sage{background:#dcead5;color:#3b7054}
.avatar.blue{background:#dae8ee;color:#416b7d}
.avatar.lilac{background:#e9e3eb;color:#675776}
.avatar.sun{background:#f1e6c7;color:#816c38}
.avatar.group{background:#e8e9e0;color:#59664e}
.side-bottom{background:#f0f2eb;border-radius:18px}
.main-header{background:#fffefa;border-bottom:1px solid var(--line)}
.header-title{font-weight:690;color:#171b17}
.header-sub{color:#788873}
.chat-wall{background:#f7f8f3}
.date-label{background:#eaeee6;color:#8b9488;font-weight:550}
.bubble{background:#fff;border:1px solid #e9ede5;border-radius:20px 20px 20px 6px;box-shadow:0 2px 9px #19291b08;color:#1b211b;font-size:14px;line-height:1.53;letter-spacing:0}
.mine .bubble{background:#daf9a4;color:#172112;border-color:#daf9a4;border-radius:20px 20px 6px 20px;box-shadow:none}
.message-meta,.mine .message-meta{color:#73836b;opacity:.9}
.delivery-status,.delivery-status.is-read{color:#5e9941}
.composer-area{background:#fffefa;border-top:1px solid #e9ece5}
.composer{background:#f3f5ef;border:1px solid #e8ece3;border-radius:24px;box-shadow:none}
.composer:focus-within{border-color:#a7d35e;box-shadow:0 0 0 3px #b8e87825}
.composer textarea{color:#171b17}
.send-btn{background:#c3f56d;color:#171b17;border-radius:50%;box-shadow:none}
.send-btn:hover{background:#b5e958}
.primary{background:#171b17;color:#fff;border-radius:17px;box-shadow:none}
.primary:hover{background:#333b32}
.secondary{background:#eaf5d8;color:#28451b;border-radius:17px}
.icon-btn{color:#5e6b59}
.icon-btn:hover,.icon-btn.active{background:#e8f4d9;color:#27481a}
.auth-layout{background:#f7f8f3;background-image:none}
.auth-card,.modal{background:#fffefa;border:1px solid #e6ebe1;box-shadow:0 20px 60px #1b291512}
.field-input{background:#f6f7f2;border-color:#e5eae0;border-radius:15px}
.field-input:focus{border-color:#a6d35d}
.invitation{background:#eff7e5;color:#344e27}
.push-onboarding,.push-card{background:#edf6e1;border-color:#d9e9c9;color:#273e23}
.push-onboarding-dot{background:#a6e65a;box-shadow:inset 0 0 0 7px #d5f5a7}
.push-onboarding small,.push-privacy{color:#6e8065}
.profile-editor{background:#f1f6e8}
.avatar-upload{background:#171b17}
.avatar-remove{background:#e7ebdf;color:#394a33}
.typing-indicator{background:#fffefa;border-color:#e3eadd;color:#607657}
@media(max-width:700px){
 html,body{background:#fafaf6}
 .workspace{border:0;border-radius:0;box-shadow:none}
 .sidebar{background:#fafaf6}
 .main{background:#f7f8f3}
 .side-head{padding-top:calc(15px + var(--safe-top,0px))}
 .brand{font-size:27px;letter-spacing:-1.4px}
 .brand-logo{width:37px;height:37px;font-size:23px}
 .side-actions .icon-btn{background:#eef1e9;color:#485645;border-radius:50%}
 .chat-item{min-height:76px;margin:0;border-radius:13px}
 .chat-item .avatar,.person .avatar{border-radius:50%}
 .chat-name{font-size:15px;font-weight:680}
 .side-bottom{background:#f0f2eb}
 .main-header{background:#fffefa;border-bottom:1px solid #e9ede5}
 .main-header .avatar{border-radius:50%}
 .chat-wall{background:#f7f8f3}
 .bubble{font-size:14px;line-height:1.5;padding:11px 14px 8px}
 .mine .bubble{border-radius:19px 19px 6px 19px}
 .composer-area{background:#fffefa}
 .composer{background:#f4f5f0;border-radius:25px}
 .send-btn{border-radius:50%}
 .auth-layout{background:#f7f8f3}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* AGI CHAT / iOS composer and cross-screen quality pass */
.composer{align-items:center;gap:5px;padding:6px 7px;border-radius:25px;min-height:52px}
.composer .icon-btn,.composer .emoji-toggle{height:42px;width:40px;min-width:40px;display:grid;place-items:center;align-self:center;flex-shrink:0;border-radius:50%;padding:0;line-height:1;color:#5c6958}
.composer .icon-btn svg{width:21px;height:21px;display:block}
.composer textarea,.composer textarea:focus,.composer textarea:focus-visible{
 appearance:none;-webkit-appearance:none;display:block;align-self:center;
 flex:1;min-width:0;width:100%;height:auto;min-height:28px;max-height:128px;
 padding:5px 2px;margin:0;border:0!important;border-radius:0!important;
 outline:none!important;box-shadow:none!important;background:transparent!important;
 font-size:16px;line-height:1.35;color:var(--ink);resize:none
}
.composer textarea::placeholder{color:#929b8e;opacity:1}
.composer .send-btn{height:42px;width:42px;min-width:42px;align-self:center;display:grid;place-items:center;padding:0}
.composer .send-btn svg{width:19px;height:19px}
.composer:focus-within{border-color:#a3d354;box-shadow:0 0 0 2px #a6d65d20}
.composer-hint{font-size:10px;color:#8c9488}
.theme-toggle{font-size:17px!important}
@media(max-width:700px){
 .composer-area{padding:8px 12px max(8px,var(--safe-bottom));}
 .composer-inner{width:100%}
 .composer{gap:3px;min-height:54px;padding:5px 6px}
 .composer .icon-btn,.composer .emoji-toggle{width:38px;min-width:38px;height:42px}
 .composer textarea{font-size:16px;min-height:29px;padding:5px 2px}
 .composer-hint{padding:5px 3px 0;min-height:0;font-size:9px}
 .composer-hint .privacy-mark{font-size:9px}
 .msg-row .avatar{border-radius:50%}
 .chat-wall{padding-bottom:14px}
}
@media(max-width:370px){
 .composer-area{padding-left:7px;padding-right:7px}
 .composer .icon-btn,.composer .emoji-toggle{width:34px;min-width:34px}
 .composer{gap:2px}
 .composer-hint{font-size:9px}
}
/* Theme tokens, independent of browser auto-inversion */
:root{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark;--bg:#111511;--sidebar:#171c17;--paper:#1b211b;--ink:#e9efe4;--muted:#9aa797;--line:#323c32;--primary:#b4e76a;--lav:#293b24;--peach:#352e29;--sage:#283d29}
html[data-theme="dark"] body{background:#101510;color:var(--ink)}
html[data-theme="dark"] .app,html[data-theme="dark"] .workspace{background:#1b211b;border-color:#303a30;box-shadow:none}
html[data-theme="dark"] .sidebar,html[data-theme="dark"] .main,html[data-theme="dark"] .main-header,html[data-theme="dark"] .composer-area{background:#171c17;color:var(--ink);border-color:#303a30}
html[data-theme="dark"] .brand,html[data-theme="dark"] .chat-name,html[data-theme="dark"] .header-title,html[data-theme="dark"] .profile-name{color:#ecf2e7}
html[data-theme="dark"] .brand-logo{background:#b4e76a;color:#192219}
html[data-theme="dark"] .side-caption,html[data-theme="dark"] .section-label,html[data-theme="dark"] .chat-last,html[data-theme="dark"] .chat-time,html[data-theme="dark"] .header-sub{color:#a0ad9c}
html[data-theme="dark"] .chat-item:hover,html[data-theme="dark"] .chat-item.selected,html[data-theme="dark"] .side-bottom,html[data-theme="dark"] .search-wrap{background:#273027;color:#e9efe4;border-color:#354235}
html[data-theme="dark"] .search-wrap input{color:#edf2e9}
html[data-theme="dark"] .chat-wall{background:#111711}
html[data-theme="dark"] .bubble{background:#273027;border-color:#364236;color:#edf2e9;box-shadow:none}
html[data-theme="dark"] .mine .bubble{background:#a5d76b;border-color:#a5d76b;color:#172415}
html[data-theme="dark"] .message-meta{color:#a3b19f}
html[data-theme="dark"] .mine .message-meta{color:#35552b}
html[data-theme="dark"] .date-label{background:#283228;color:#afbcaa}
html[data-theme="dark"] .composer{background:#283028;border-color:#3a4938}
html[data-theme="dark"] .composer textarea{color:#edf2e9!important}
html[data-theme="dark"] .composer textarea::placeholder{color:#a5b19f}
html[data-theme="dark"] .composer .icon-btn{color:#c5d1c0}
html[data-theme="dark"] .composer-hint,html[data-theme="dark"] .privacy-mark{color:#9da99a}
html[data-theme="dark"] .icon-btn{color:#c2cebd}
html[data-theme="dark"] .icon-btn:hover,html[data-theme="dark"] .icon-btn.active{background:#30402b;color:#c7f28b}
html[data-theme="dark"] .send-btn,html[data-theme="dark"] .unread{background:#b4e76a;color:#172415}
html[data-theme="dark"] .avatar{background:#354a32;color:#d7ebd0}
html[data-theme="dark"] .avatar.peach{background:#493d32;color:#f0d8c2}
html[data-theme="dark"] .avatar.sage{background:#304838;color:#c7e2ce}
html[data-theme="dark"] .avatar.blue{background:#30424c;color:#d4e7f0}
html[data-theme="dark"] .avatar.lilac{background:#40374a;color:#e0d5ee}
html[data-theme="dark"] .avatar.sun{background:#4a422d;color:#eadba7}
html[data-theme="dark"] .auth-layout{background:#111711}
html[data-theme="dark"] .auth-card,html[data-theme="dark"] .modal{background:#1d251d;border-color:#354135;color:#e9efe4}
html[data-theme="dark"] .auth-card h1,html[data-theme="dark"] .modal h2{color:#e9efe4}
html[data-theme="dark"] .field-input{background:#293229;border-color:#3d493d;color:#e9efe4}
html[data-theme="dark"] .invitation,html[data-theme="dark"] .profile-editor,html[data-theme="dark"] .push-card,html[data-theme="dark"] .push-onboarding,html[data-theme="dark"] .push-help{background:#293529;border-color:#3b4d39;color:#d9e9d5}
html[data-theme="dark"] .secondary{background:#344831;color:#d9f4ca}
html[data-theme="dark"] .primary{background:#b4e76a;color:#172415}
html[data-theme="dark"] .emoji-picker{background:#232c23;border-color:#3a483a;color:#e9efe4}
html[data-theme="dark"] .emoji-option:hover{background:#3a4a35}
html[data-theme="dark"] .typing-indicator{background:#273327;border-color:#3a483a;color:#d2e6ca}
html[data-theme="dark"] .modal-cover{background:#060a06ad}
html[data-theme="dark"] .reply-preview{background:#283628;color:#e9efe4}
@media(max-width:700px){
 html[data-theme="dark"] body,html[data-theme="dark"] .sidebar,html[data-theme="dark"] .main{background:#171c17}
 html[data-theme="dark"] .chat-wall{background:#111711}
 html[data-theme="dark"] .side-actions .icon-btn{background:#293329;color:#d2e0cc}
}

/* Minimal monochrome pixel Pac-Man typing indicator */
.typing-indicator{min-height:38px;gap:10px;padding:6px 11px;background:var(--paper);border:1px solid var(--line);border-radius:15px;box-shadow:0 5px 18px #1723180c;color:var(--muted);font-size:11px;font-weight:600}
.pixel-chomp{position:relative;display:block;width:59px;height:24px;flex:none;overflow:hidden;color:var(--ink)}
.pixel-chomp-body{position:absolute;left:2px;top:3px;width:18px;height:18px;background:currentColor;clip-path:polygon(22% 0,78% 0,78% 12%,100% 12%,100% 32%,65% 50%,100% 68%,100% 88%,78% 88%,78% 100%,22% 100%,22% 88%,0 88%,0 12%,22% 12%);animation:pixel-chomp-mouth .5s steps(1,end) infinite}
.pixel-chomp-crumbs{position:absolute;inset:0;display:block}
.pixel-chomp-crumbs i{position:absolute;top:10px;width:4px;height:4px;background:currentColor;animation:pixel-chomp-food 1.05s linear infinite}
.pixel-chomp-crumbs i:nth-child(1){left:48px;animation-delay:-.7s}
.pixel-chomp-crumbs i:nth-child(2){left:48px;animation-delay:-.35s}
.pixel-chomp-crumbs i:nth-child(3){left:48px;animation-delay:0s}
.typing-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@keyframes pixel-chomp-mouth{0%,49%{clip-path:polygon(22% 0,78% 0,78% 12%,100% 12%,100% 32%,65% 50%,100% 68%,100% 88%,78% 88%,78% 100%,22% 100%,22% 88%,0 88%,0 12%,22% 12%)}50%,100%{clip-path:polygon(22% 0,78% 0,78% 12%,100% 12%,100% 88%,78% 88%,78% 100%,22% 100%,22% 88%,0 88%,0 12%,22% 12%)}}
@keyframes pixel-chomp-food{0%{transform:translateX(0);opacity:0}12%{opacity:1}82%{opacity:1}100%{transform:translateX(-27px);opacity:0}}
html[data-theme="dark"] .typing-indicator{background:#222b22;border-color:#354135;color:#d2e1ce}
@media(max-width:700px){.typing-indicator{bottom:calc(102px + env(safe-area-inset-bottom,0px));max-width:calc(100% - 28px)}}
@media(prefers-reduced-motion:reduce){.pixel-chomp-body,.pixel-chomp-crumbs i{animation:none!important}.pixel-chomp-crumbs i{opacity:1}.pixel-chomp-crumbs i:nth-child(1){left:31px}.pixel-chomp-crumbs i:nth-child(2){left:40px}.pixel-chomp-crumbs i:nth-child(3){left:49px}}

/* Tiny integrated Pac-Man — 8px sprite, compact typing status */
.typing-indicator{gap:7px;min-height:31px;padding:5px 9px;border-radius:13px}
.pixel-chomp{width:31px;height:13px;flex:none}
.pixel-chomp-body{left:1px;top:2px;width:9px;height:9px;clip-path:circle(50% at 50% 50%);animation:pac-mini-mouth .5s steps(1,end) infinite}
.pixel-chomp-crumbs i{top:5px;width:2px;height:2px;animation:pac-mini-food 1.05s linear infinite}
.pixel-chomp-crumbs i:nth-child(1),.pixel-chomp-crumbs i:nth-child(2),.pixel-chomp-crumbs i:nth-child(3){left:28px}
@keyframes pac-mini-mouth{0%,49%{clip-path:polygon(50% 50%,100% 12%,92% 4%,75% 0,25% 0,8% 15%,0 40%,0 60%,8% 85%,25% 100%,75% 100%,92% 96%,100% 88%)}50%,100%{clip-path:circle(50% at 50% 50%)}}
@keyframes pac-mini-food{0%{transform:translateX(0);opacity:0}12%{opacity:1}82%{opacity:1}100%{transform:translateX(-16px);opacity:0}}
.typing-label{font-size:11px;font-weight:600}
/* Quoted messages: theme-aware, no white-on-lime or white-on-white */
.quoted-message,.theirs .quoted-message{
 display:flex;flex-direction:column;gap:3px;box-sizing:border-box;
 width:100%;max-width:100%;min-width:0;margin:0 0 9px;padding:9px 11px;
 border:0;border-left:3px solid #8bba56;border-radius:9px;
 background:#eef3e9;color:#243124;text-align:left;box-shadow:none
}
.quoted-message strong,.theirs .quoted-message strong{display:block;color:#365c2d;font-size:12px;line-height:1.35;font-weight:750;opacity:1}
.quoted-message span,.theirs .quoted-message span{display:block;width:100%;min-width:0;color:#4e5d4c;font-size:12px;line-height:1.45;opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mine .quoted-message{background:#c3e68e;color:#20351d;border-left-color:#628f3a}
.mine .quoted-message strong{color:#244b1e}
.mine .quoted-message span{color:#3a5533}
html[data-theme="dark"] .quoted-message,html[data-theme="dark"] .theirs .quoted-message{
 background:#344034;color:#edf3e8;border-left-color:#a2d46c
}
html[data-theme="dark"] .quoted-message strong,html[data-theme="dark"] .theirs .quoted-message strong{color:#d3eec3}
html[data-theme="dark"] .quoted-message span,html[data-theme="dark"] .theirs .quoted-message span{color:#c1d1ba}
html[data-theme="dark"] .mine .quoted-message{background:#b6d887;border-left-color:#5c8736;color:#1a3215}
html[data-theme="dark"] .mine .quoted-message strong{color:#264b1d}
html[data-theme="dark"] .mine .quoted-message span{color:#3c5834}
.reply-preview{background:#eff4e8;border-left-color:#84b94e;color:#243124}
.reply-copy b{color:#355b2c}
.reply-copy span{color:#586953}
html[data-theme="dark"] .reply-preview{background:#2b392b;border-left-color:#a2d46c;color:#e5f0df}
html[data-theme="dark"] .reply-copy b{color:#d3eec3}
html[data-theme="dark"] .reply-copy span{color:#c1d1ba}
@media(max-width:700px){.quoted-message{padding:8px 10px;margin-bottom:8px}}
@media(prefers-reduced-motion:reduce){.pixel-chomp-body{animation:none!important;clip-path:circle(50% at 50% 50%)}.pixel-chomp-crumbs i{animation:none!important;opacity:1}.pixel-chomp-crumbs i:nth-child(1){left:14px}.pixel-chomp-crumbs i:nth-child(2){left:21px}.pixel-chomp-crumbs i:nth-child(3){left:28px}}
