/* Theme reused from joseareche.com (styles.css): paper/ink/blue/teal/coral, Bricolage Grotesque + Manrope (self-hosted, OFL). */
@font-face{font-family:"Bricolage Grotesque";src:url(/chat/static/fonts/bricolage.woff2) format("woff2");font-weight:200 800;font-display:swap}
@font-face{font-family:"Manrope";src:url(/chat/static/fonts/manrope.woff2) format("woff2");font-weight:200 800;font-display:swap}
:root{--paper:#f4f5f2;--paper2:#e6e9e5;--ink:#12151b;--ink2:#20252d;--blue:#0078e6;--blue-soft:#6ec4ff;--blue-mist:#d6eeff;--teal:#00a49b;--coral:#ff6b4a;--line:rgba(18,21,27,.14);--muted:#5d6570;--white:#fff;
--serif:"Bricolage Grotesque","Manrope",Arial,sans-serif;--sans:"Manrope",Arial,sans-serif;--mono:ui-monospace,"IBM Plex Mono",Menlo,monospace;--r:16px}
*{box-sizing:border-box}html,body{height:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.55 var(--sans);-webkit-font-smoothing:antialiased}
h1,h2{font-family:var(--serif);letter-spacing:-.02em;margin:.2em 0}
.accent{color:var(--blue)}.muted{color:var(--muted)}.err{color:#c2412d;font-weight:600}
button,input,textarea{font:inherit;color:inherit}
.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:13px 18px;border-radius:999px;border:1px solid var(--line);text-decoration:none;font-weight:700;cursor:pointer;transition:.15s}
.btn-google{background:var(--white);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.06)}.btn-google:hover{border-color:var(--blue);box-shadow:0 4px 14px rgba(0,120,230,.15)}
.btn-primary{background:var(--ink);color:var(--paper);border-color:var(--ink)}.btn-primary:hover{background:var(--blue);border-color:var(--blue)}
.g-icon{width:20px;height:20px}

/* login */
.login-page{display:grid;place-items:center;padding:24px;background:radial-gradient(1200px 500px at 50% -10%,var(--blue-mist),transparent 70%),var(--paper)}
.login-card{width:100%;max-width:400px;background:var(--white);border:1px solid var(--line);border-radius:24px;padding:36px 32px;box-shadow:0 20px 60px rgba(18,21,27,.08);text-align:center}
.login-logo{width:96px;height:auto;margin-bottom:8px}
.login-card h1{font-size:1.9rem}.login-card .btn-google{margin:24px 0 8px}
.fallback{margin-top:16px;text-align:left;color:var(--muted);font-size:.92rem}.fallback summary{cursor:pointer;text-align:center}
.fallback label{display:block;margin:12px 0;font-weight:600;color:var(--ink2)}
.fallback input{width:100%;margin-top:6px;padding:11px 14px;border-radius:12px;border:1px solid var(--line);background:var(--paper)}
.fallback input:focus,.composer-box:focus-within{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-mist)}
.fine{font-size:.8rem;color:var(--muted);margin-top:22px}


/* ===== Chat v3 (2026-10-19): compact, collapsible sidebar. Tokens per redesign spec. ===== */
:root{--chat-primary:#0666f5;--chat-primary-soft:#eaf2ff;--chat-text:#16243d;--chat-muted:#5f6b82;--chat-surface:#fff;--chat-bg:#f8fafc;--chat-border:#e5eaf1;
--chat-sidebar-width:300px;--chat-rail-width:64px;--chat-header-height:60px;--chat-content-max-width:820px;--chat-radius:12px;--dur:180ms}
.sprite{position:absolute}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ic{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.chat-page{background:var(--chat-bg);color:var(--chat-text);font:400 14.5px/1.6 var(--sans);height:100dvh;overflow:hidden}
.chat-page :focus-visible:not(textarea){outline:2px solid var(--chat-primary);outline-offset:2px;border-radius:8px}
.app{display:flex;height:100dvh}
button{font:inherit;color:inherit}

/* rail */
.rail{width:var(--chat-rail-width);flex:none;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 0 calc(12px + env(safe-area-inset-bottom));background:var(--chat-surface);border-right:1px solid var(--chat-border);z-index:20}
.rail form{margin:0}
.rail-btn{position:relative;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:10px;background:none;color:var(--chat-muted);cursor:pointer}
.rail-btn:hover{background:var(--chat-bg);color:var(--chat-text)}.rail-btn.active{background:var(--chat-primary-soft);color:var(--chat-primary)}
.rail-btn::after{content:attr(data-tip);position:absolute;left:52px;top:50%;transform:translateY(-50%);white-space:nowrap;background:var(--chat-text);color:#fff;font-size:12px;padding:4px 8px;border-radius:6px;opacity:0;pointer-events:none;transition:opacity var(--dur)}
.rail-btn:hover::after,.rail-btn:focus-visible::after{opacity:1}
.rail-spacer{flex:1}
.rail-avatar,.brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--chat-text);color:#fff;font:700 12px var(--serif)}
.brand-mark.sm{width:28px;height:28px;font-size:11px}

/* sidebar panel */
.sidebar{width:var(--chat-sidebar-width);flex:none;display:flex;flex-direction:column;gap:12px;padding:12px;background:var(--chat-surface);border-right:1px solid var(--chat-border);overflow:hidden;transition:margin-left var(--dur) ease,transform var(--dur) ease}
.app.collapsed .sidebar{margin-left:calc(-1 * var(--chat-sidebar-width));visibility:hidden;transition:margin-left var(--dur) ease,visibility 0s var(--dur)}
.side-head{display:flex;align-items:center;justify-content:space-between;min-height:40px}
.brand{display:flex;align-items:center;gap:8px;font:700 15px var(--serif)}.accent{color:var(--chat-primary)}
.icon-btn{display:inline-grid;place-items:center;width:36px;height:36px;border:0;border-radius:8px;background:none;color:var(--chat-muted);cursor:pointer}
.icon-btn:hover{background:var(--chat-bg);color:var(--chat-text)}
.new-btn{display:flex;align-items:center;gap:8px;width:100%;height:40px;padding:0 12px;border:0;border-radius:10px;background:var(--chat-text);color:#fff;font-size:13.5px;font-weight:600;cursor:pointer}
.new-btn:hover{background:#0f1a2e}
.side-search{display:flex;align-items:center;gap:8px;height:36px;padding:0 10px;border:1px solid var(--chat-border);border-radius:10px;color:var(--chat-muted);background:var(--chat-bg)}
.side-search:focus-within{border-color:var(--chat-primary);background:#fff}
.side-search input{flex:1;min-width:0;border:0;outline:0;background:none;font-size:13px;color:var(--chat-text)}
.side-search input::-webkit-search-cancel-button{cursor:pointer}
kbd{font:600 10.5px var(--sans);color:var(--chat-muted);border:1px solid var(--chat-border);border-radius:5px;padding:1px 5px;background:#fff}
.convs{flex:1;min-height:0;overflow-y:auto;margin:0 -4px;padding:0 4px}
.group-label{margin:12px 8px 4px;font-size:11.5px;font-weight:700;letter-spacing:.04em;color:var(--chat-muted)}
.conv-list{list-style:none;margin:0;padding:0}
.conv{position:relative;display:flex;align-items:center;border-radius:8px}
.conv:hover{background:var(--chat-bg)}.conv.active{background:var(--chat-primary-soft)}
.conv-open{flex:1;min-width:0;display:flex;align-items:baseline;gap:8px;padding:7px 8px;border:0;background:none;text-align:left;cursor:pointer;border-radius:8px}
.conv-title{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;color:var(--chat-text)}
.conv.active .conv-title{font-weight:600}
.conv-date{font-size:11.5px;color:var(--chat-muted);flex:none}
.conv-more{width:28px;height:28px;margin-right:2px;opacity:0}.conv:hover .conv-more,.conv.active .conv-more,.conv-more:focus-visible,.conv-more[aria-expanded="true"]{opacity:1}
@media (hover:none){.conv-more{opacity:1}}
.conv-empty{font-size:12.5px;color:var(--chat-muted);margin:8px}
.side-foot{display:flex;flex-direction:column;gap:8px;padding-top:8px;border-top:1px solid var(--chat-border)}
.privacy{margin:0;font-size:11.5px;line-height:1.45;color:var(--chat-muted)}
.profile{display:flex;align-items:center;gap:8px}.profile-name{flex:1;font-size:13px;font-weight:600}.profile form{margin:0}
.ghost-btn{display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid var(--chat-border);border-radius:8px;background:#fff;font-size:12.5px;cursor:pointer}
.ghost-btn:hover{border-color:var(--chat-primary);color:var(--chat-primary)}
.ghost-btn .ic{width:15px;height:15px}
.pop{position:fixed;z-index:50;min-width:150px;padding:4px;background:#fff;border:1px solid var(--chat-border);border-radius:10px;box-shadow:0 8px 24px rgba(22,36,61,.12)}
.pop button{display:block;width:100%;text-align:left;padding:8px 10px;border:0;border-radius:6px;background:none;font-size:13px;cursor:pointer}
.pop button:hover,.pop button:focus-visible{background:var(--chat-bg)}.pop .danger{color:#c2412d}

/* main */
.main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}
.header{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:10px;height:var(--chat-header-height);padding:0 16px;background:rgba(248,250,252,.92);backdrop-filter:blur(8px);border-bottom:1px solid var(--chat-border)}
.head-ic{color:var(--chat-primary)}
.head-text{min-width:0;flex:1}.head-text h1{margin:0;font:600 15.5px/1.2 var(--sans);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.head-sub{margin:0;font-size:12px;color:var(--chat-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.head-actions{display:flex;align-items:center;gap:6px}
.badge{font-size:12px;font-weight:600;padding:3px 10px;border-radius:999px;background:#dff5f2;color:#00665f}
.mobile-only{display:none}
.scroller{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}
.thread{max-width:var(--chat-content-max-width);margin:0 auto;padding:24px 24px 16px;display:flex;flex-direction:column;gap:20px}

/* empty state */
.empty{padding:8vh 0 0;text-align:left}
.empty h2{margin:0 0 4px;font:700 22px var(--serif);letter-spacing:-.01em}.empty p{margin:0;font-size:14px}
.muted{color:var(--chat-muted)}
.suggestions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}
.sugg{padding:10px 12px;border:1px solid var(--chat-border);border-radius:10px;background:#fff;text-align:left;font-size:13.5px;cursor:pointer;color:var(--chat-text)}
.sugg:hover{border-color:var(--chat-primary);background:var(--chat-primary-soft)}

/* ChatMessage */
.msg{display:flex;flex-direction:column;min-width:0}
.msg.user{align-items:flex-end}
.msg.user .bubble{max-width:min(620px,85%);padding:9px 14px;border-radius:14px 14px 4px 14px;background:var(--chat-text);color:#fff;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14.5px;line-height:1.55}
.msg.bot .bubble{width:100%;padding:12px 16px;border:1px solid var(--chat-border);border-radius:var(--chat-radius);background:var(--chat-surface);overflow-wrap:anywhere;font-size:14.5px;line-height:1.62}
.msg.error .bubble{border-color:#f3c6bc;background:#fff6f3}
.bubble p{margin:.5em 0}.bubble>:first-child{margin-top:0}.bubble>:last-child{margin-bottom:0}
.bubble h3{font:700 15.5px var(--sans);margin:1em 0 .35em}.bubble h4{font:700 14.5px var(--sans);margin:.9em 0 .3em}
.bubble ul,.bubble ol{margin:.4em 0;padding-left:1.35em}.bubble li{margin:.2em 0}
.bubble code{font:.88em var(--mono);background:var(--chat-bg);border:1px solid var(--chat-border);padding:.05em .35em;border-radius:5px}
.bubble pre{margin:.6em 0;background:#0f1a2e;color:#e6ecf5;padding:10px 12px;border-radius:10px;overflow-x:auto;font-size:13px}
.bubble pre code{background:none;border:0;padding:0;color:inherit}
.bubble a{color:var(--chat-primary)}
.tbl{overflow-x:auto;margin:.6em 0}.bubble table{border-collapse:collapse;font-size:13.5px;min-width:100%}
.bubble th,.bubble td{border:1px solid var(--chat-border);padding:5px 9px;text-align:left;vertical-align:top}.bubble th{background:var(--chat-bg);font-weight:600}
.cite{display:inline-block;font:700 10.5px/1.5 var(--sans);color:var(--chat-primary);background:var(--chat-primary-soft);border-radius:5px;padding:0 4px;margin:0 1px;vertical-align:super}
.by{display:inline-block;font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:999px;margin-bottom:6px;background:var(--chat-primary-soft);color:var(--chat-primary)}
.by-memoria{background:#dff5f2;color:#00665f}.by-modelo-local{background:#efe9ff;color:#5b3fb5}
.msg-foot{display:flex;align-items:center;gap:8px;margin-top:6px;min-height:28px}
.meta{font-size:12px;color:var(--chat-muted)}
.act{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 8px;border:0;border-radius:6px;background:none;color:var(--chat-muted);font-size:12px;cursor:pointer}
.act:hover{background:var(--chat-bg);color:var(--chat-text)}.act .ic{width:14px;height:14px}
.retry{color:var(--chat-primary)}
.reason{color:var(--chat-muted);font-size:13px;font-style:italic}

/* MessageSources */
.sources{margin-top:10px;border-top:1px solid var(--chat-border);padding-top:6px}
.sources>summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:12.5px;font-weight:600;color:var(--chat-muted);padding:4px 0;list-style:none}
.sources>summary::-webkit-details-marker{display:none}
.sources>summary::before{content:"";width:6px;height:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform var(--dur)}
.sources[open]>summary::before{transform:rotate(45deg)}
.source-item{margin:6px 0;padding:8px 10px;border-radius:8px;background:var(--chat-bg)}
.source-title{font-size:13px;font-weight:600}.source-meta,.hit-meta{font-size:12px;color:var(--chat-muted);margin-top:1px}
.source-ex{font-size:12.5px;color:#334058;white-space:pre-wrap;margin-top:4px}
.hit{border-left:3px solid var(--teal);padding:2px 0 2px 10px;margin:10px 0}.hit-title{font-weight:600;font-size:13.5px}
.hit-body{font-size:13.5px;white-space:pre-wrap;color:#334058}
.typing{display:flex;gap:5px;padding:4px 0}.typing i{width:6px;height:6px;border-radius:50%;background:#9db8e8;animation:dot 1s infinite ease-in-out}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes dot{0%,80%,100%{transform:scale(.6);opacity:.5}40%{transform:scale(1);opacity:1}}

/* ChatComposer */
.composer{flex:none;width:100%;max-width:calc(var(--chat-content-max-width));margin:0 auto;padding:8px 24px calc(10px + env(safe-area-inset-bottom))}
.composer-box{background:#fff;border:1px solid var(--chat-border);border-radius:16px;padding:10px 10px 8px 14px;box-shadow:0 2px 10px rgba(22,36,61,.05)}
.composer-box:focus-within{border-color:#b8cdf3;box-shadow:0 0 0 3px var(--chat-primary-soft)}
.composer textarea{display:block;width:100%;border:0;outline:0;resize:none;background:none;font-size:14.5px;line-height:1.5;max-height:220px;padding:2px 0 6px;color:var(--chat-text)}
.composer-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.chips{display:flex;gap:4px;flex-wrap:wrap}
.chip{height:30px;padding:0 11px;border:1px solid var(--chat-border);border-radius:999px;background:#fff;font-size:12.5px;font-weight:500;color:#3d4a62;cursor:pointer}
.chip:hover{border-color:#b8cdf3}.chip.active{background:var(--chat-primary-soft);border-color:var(--chat-primary);color:var(--chat-primary);font-weight:600}
.proj-select{height:30px;max-width:180px;padding:0 8px;border:1px solid var(--chat-border);border-radius:999px;background:#fff;font-size:12.5px;color:#3d4a62;cursor:pointer}
.toggle{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 10px;border:1px solid var(--chat-border);border-radius:999px;font-size:12.5px;color:#3d4a62;cursor:pointer;user-select:none}
.toggle input{margin:0;accent-color:var(--teal)}.toggle:has(input:checked){background:#dff5f2;border-color:var(--teal);color:#00665f;font-weight:600}
.send{margin-left:auto;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:10px;background:var(--chat-primary);color:#fff;cursor:pointer}
.send:hover{background:#0556d0}.send:disabled{background:#e3e8f0;color:#9aa5b8;cursor:not-allowed}
.hint{display:flex;justify-content:space-between;gap:12px;margin:6px 4px 0;font-size:11.5px;color:var(--chat-muted)}
.session-cost{font-variant-numeric:tabular-nums}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:60;background:var(--chat-text);color:#fff;font-size:13px;padding:8px 14px;border-radius:8px}
.scrim{position:fixed;inset:0;z-index:30;background:rgba(22,36,61,.35)}

/* tablet: rail + overlay panel */
@media (max-width:1199px){
  .sidebar{position:fixed;top:0;bottom:0;left:var(--chat-rail-width);z-index:40;margin:0!important;box-shadow:0 10px 40px rgba(22,36,61,.16)}
  .app.collapsed .sidebar{transform:translateX(calc(-100% - var(--chat-rail-width)));margin:0}
}
/* mobile: drawer, no rail */
@media (max-width:767px){
  .rail{display:none}
  .sidebar{left:0;width:min(86vw,320px);padding-top:calc(12px + env(safe-area-inset-top))}
  .app.collapsed .sidebar{transform:translateX(-100%)}
  .mobile-only{display:inline-grid}.head-ic{display:none}
  .header{padding:0 8px;padding-top:env(safe-area-inset-top);height:calc(56px + env(safe-area-inset-top))}
  .icon-btn{width:44px;height:44px}
  .thread{padding:16px 14px 12px;gap:16px}
  .composer{padding:6px 10px calc(8px + env(safe-area-inset-bottom))}
  .composer textarea{font-size:16px}
  .msg.user .bubble{max-width:88%}.msg.bot .bubble{padding:10px 12px}
  .suggestions{grid-template-columns:1fr}.hint>span:first-child{display:none}
  .conv-open{padding:11px 8px}.chip,.proj-select,.toggle{height:34px}.send{width:40px;height:40px}
  body.drawer-open{overflow:hidden}
  .composer-box{position:relative;padding:8px 8px 8px 12px}
  .composer-bar{flex-wrap:wrap;padding-right:46px}
  .composer-bar::-webkit-scrollbar{display:none}
  .chips{flex:1 1 100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-46px}.chips::-webkit-scrollbar{display:none}.chip,.toggle,.proj-select{white-space:nowrap;flex:none}.proj-select{max-width:150px}kbd,.hide-sm{display:none}.proj-select{max-width:140px}
  .send{position:absolute;right:8px;bottom:8px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* ===== v3.1: match user mockup ===== */
.rail{padding-top:12px}.rail-avatar.top{margin-bottom:10px}
.rail-btn.active{background:var(--chat-primary-soft);color:var(--chat-primary)}
.brand{font:700 15px var(--sans);gap:4px}
.new-btn{height:44px;justify-content:center;background:var(--chat-primary);font-size:14px;border-radius:10px}
.new-btn:hover{background:#0556d0}
.conv-open{align-items:center}.conv-open .ic{width:15px;height:15px;color:var(--chat-muted)}
.conv.active .conv-open .ic{color:var(--chat-primary)}
.header{gap:10px}
.header h1{margin:0;font:600 15.5px/1 var(--sans);letter-spacing:0}
.head-sub{flex:1;min-width:0;padding-left:12px;margin-left:2px;border-left:1px solid var(--chat-border)}
.head-search{display:flex;align-items:center;gap:8px;height:36px;width:230px;padding:0 12px;border:1px solid var(--chat-border);border-radius:10px;background:#fff;color:var(--chat-muted);font-size:13px;cursor:pointer}
.head-search:hover{border-color:#b8cdf3}
.msg.bot{flex-direction:row;align-items:flex-start;gap:12px}
.msg-avatar{display:grid;place-items:center;width:32px;height:32px;flex:none;border-radius:50%;background:var(--chat-primary-soft);color:var(--chat-primary);font:700 12px var(--sans);margin-top:2px}
.bot-col{flex:1;min-width:0}
.msg.bot .bubble{box-shadow:0 1px 3px rgba(22,36,61,.04)}
.bubble-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.bubble-top .by{margin:0}
.icon-act{width:30px;height:30px;padding:0;justify-content:center}.icon-act .ic{width:16px;height:16px}
.msg-foot{margin-top:6px;padding-left:2px;min-height:0}
.sources{margin-top:12px;border:1px solid var(--chat-border);border-radius:10px;padding:0;overflow:hidden;background:#fff}
.sources>summary{display:flex;width:100%;padding:9px 12px;color:var(--chat-text);font-size:13px;background:var(--chat-bg)}
.sources>summary::before{display:none}
.sources>summary .ic{width:15px;height:15px;color:var(--chat-muted)}
.sources>summary .ic:last-child{margin-left:auto;transition:transform var(--dur)}.sources[open]>summary .ic:last-child{transform:rotate(180deg)}
.source-item{display:flex;align-items:flex-start;gap:12px;margin:0;padding:9px 12px;border-radius:0;background:#fff;border-top:1px solid var(--chat-border)}
.source-item>.ic{width:17px;height:17px;color:var(--chat-primary);margin-top:2px}
.source-body{flex:1;min-width:0}.source-title{font-weight:500;overflow-wrap:anywhere}
.source-ex{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.source-date{flex:none;font-size:12px;color:var(--chat-muted);white-space:nowrap}
.composer-box{padding:10px 10px 10px 16px;border-radius:16px}
.composer-row{display:flex;align-items:flex-end;gap:10px}
.composer-row textarea{flex:1;padding:8px 0}
.kbd-hint{flex:none;font-size:12px;color:var(--chat-muted);padding-bottom:10px}
.send{margin:0;width:40px;height:40px;border-radius:50%}
.composer-box .composer-bar{margin-top:8px;padding-top:2px}
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:8px}
.chip .ic{width:14px;height:14px}.proj-select,.toggle{border-radius:8px}
.hint{justify-content:flex-end;min-height:0;margin-top:4px}
@media (max-width:1199px){.head-search{width:auto}.head-search span{display:none}}
@media (max-width:767px){
  .kbd-hint,.head-sub,.head-ic{display:none}
  .composer-box{padding:8px 8px 8px 12px}.composer-bar{padding-right:0}
  .chips{margin-right:0}.send{position:static;width:40px;height:40px}
  .msg.bot{gap:0}.msg-avatar{display:none}
  .head-search{border:0;width:44px;height:44px;justify-content:center;padding:0;background:none}.head-actions{margin-left:auto}.chip .ic{display:none}.chip{padding:0 10px}
}
/* module entitlements: no Notas module -> hide notes-only controls (server also refuses them) */
.no-notes #rail-notes,.no-notes .mode[data-mode="search"],.no-notes .mode[data-mode="ingest"],.no-notes #project,.no-notes .toggle,.no-notes .sugg{display:none!important}
.toggle.uncensored:has(input:checked){background:#fdecec;border-color:#c0392b;color:#8e2a20}.toggle.off-mode{display:none}
.toggle[hidden]{display:none}
.attach{flex:none;width:36px;height:36px;border:0;background:transparent;border-radius:10px;color:#5b6780;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.attach:hover{background:#eef2f7}.attach[hidden]{display:none}
.att-tray{display:flex;gap:8px;padding:8px 10px 0}.att-tray[hidden]{display:none}
.att-chip{display:flex;align-items:center;gap:8px;border:1px solid var(--chat-border);border-radius:10px;padding:4px 6px 4px 4px;font-size:12.5px;max-width:100%}
.att-chip img{width:44px;height:44px;object-fit:cover;border-radius:6px}.att-chip.uploading{opacity:.55}.att-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px}
.att-x{border:0;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:#5b6780;padding:0 4px}
.composer.drop .composer-box{outline:2px dashed var(--teal);outline-offset:2px}
.img-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.img-card{margin:0;display:flex;flex-direction:column;gap:4px;max-width:min(420px,100%)}
.img-card img{display:block;max-width:100%;height:auto;border-radius:10px;border:1px solid var(--chat-border);background:#f4f6f9}
.img-grid.small .img-card{max-width:160px}.img-dl{align-self:flex-start;font-size:12.5px}
.chip[hidden]{display:none}
.bubble .interp{margin:.4rem 0 0;font-size:.78rem;color:var(--muted,#6b7280);font-style:italic}
.toggle.quality select{font:inherit;font-size:.8rem;border:1px solid var(--border,#d1d5db);border-radius:6px;background:transparent;padding:0 .2rem}
