:root {
  color-scheme: dark;
  --bg: #081711; --surface: #10251d; --surface2: #173329; --surface3: #203b31;
  --line: rgba(255,255,255,.09); --text: #effbf3; --muted: #a5bcb0;
  --brand: #8ce5a2; --brand-dark:#145b38; --gold:#f0c978;
  --shadow: 0 24px 70px rgba(0,0,0,.3);
  font-family: Inter, 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; min-height:100vh; background: radial-gradient(ellipse at 80% -10%, rgba(28,117,73,.25),transparent 42%), #081711; color:var(--text); }
button, input, select, textarea { font:inherit; }
button { cursor:pointer; }
button:disabled { opacity:.48; cursor:not-allowed; }
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:3px solid #d8f39b; outline-offset:2px; }
button, input, select, textarea { -webkit-tap-highlight-color:transparent; }
svg { flex-shrink:0; }
.boot { min-height:100vh; display:grid; place-content:center; text-align:center; color:var(--muted); gap:8px; }
.boot img { width:110px; margin:auto; filter:drop-shadow(0 0 20px #30b46f40); }
.toast { position:fixed; z-index:100; right:20px; top:20px; max-width:min(430px,calc(100vw - 40px)); border:1px solid #558b6d; background:#173b2c; padding:13px 17px; border-radius:15px; box-shadow:var(--shadow); color:#e5ffed; opacity:0; pointer-events:none; transform:translateY(-10px); transition:.22s ease; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.error { border-color:#a86c66; background:#432421; }
.logo { display:flex; gap:10px; align-items:center; color:var(--text); font-weight:850; font-size:21px; letter-spacing:-.7px; }
.logo img { width:45px; height:45px; object-fit:contain; }
.logo small { font-size:10px; display:block; font-weight:650; letter-spacing:2px; text-transform:uppercase; color:var(--muted); }
.icon { width:20px; height:20px; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; fill:none; }
.glass { background:rgba(22,47,34,.64); border:1px solid rgba(199,246,204,.12); box-shadow:0 18px 50px #0002; backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); }
.card { background:linear-gradient(146deg,rgba(32,61,47,.75),rgba(18,39,30,.75)); border:1px solid var(--line); border-radius:24px; padding:23px; }
.card h3 { font-size:17px; margin:0 0 10px; letter-spacing:-.35px; }
.muted { color:var(--muted); }
.tiny { font-size:12px; }
.eyebrow { color:var(--brand); letter-spacing:2px; font-size:11px; font-weight:800; text-transform:uppercase; }
.tag { display:inline-flex; align-items:center; padding:6px 11px; border:1px solid #83db993d; color:#a8efb9; border-radius:99px; background:#2c664538; font-weight:750; font-size:11px; letter-spacing:.3px; }
.tag.gold { color:var(--gold); background:#78602e33; border-color:#d6ad4e47; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:47px; padding:12px 18px; border-radius:13px; border:1px solid transparent; font-weight:750; line-height:1.1; background:none; color:var(--text); transition:transform .18s,filter .18s,background .18s; }
.btn:hover:not(:disabled) { filter:brightness(1.08); transform:translateY(-1px); }
.btn.primary { background:linear-gradient(115deg,#9cedaa,#5abb82); color:#0b321a; box-shadow:0 9px 28px #4db16c36; }
.btn.outline { border-color:var(--line); background:rgba(255,255,255,.035); }
.btn.soft { background:#264d39; color:#bbf0c5; }
.btn.danger { color:#ffb1a5; background:#5e302a66; }
.btn.small { font-size:12px; padding:8px 12px; min-height:37px; border-radius:11px; }
.btn.icon-btn { min-width:44px; padding:10px; }
.btn.full { width:100%; }
.field { display:grid; gap:8px; margin-bottom:15px; }
.field label { font-size:12px; color:#d5e9dc; font-weight:700; }
.input { width:100%; min-height:47px; border:1px solid #ffffff1a; border-radius:12px; background:#07191090; color:var(--text); padding:11px 14px; outline:none; }
.input::placeholder { color:#80988b; }
.input:focus { border-color:#88dba6; box-shadow:0 0 0 3px #82c9961b; }
textarea.input { min-height:95px; resize:vertical; }
select.input { appearance:auto; }
.checkrow { display:flex; align-items:flex-start; gap:10px; color:var(--muted); font-size:12px; line-height:1.55; margin:18px 0; }
.checkrow input { width:18px; height:18px; accent-color:#79cc90; margin:1px 0 0; flex-shrink:0; }
.tabs { display:flex; background:#06160fa3; padding:5px; border:1px solid var(--line); border-radius:13px; gap:5px; margin:22px 0; }
.tabs button { flex:1; color:var(--muted); border:0; padding:12px; border-radius:9px; background:transparent; font-weight:800; }
.tabs button.active { color:#e9fff0; background:#234a37; box-shadow:0 5px 14px #0003; }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.05fr) minmax(460px,.95fr); }
.auth-art { padding:45px clamp(30px,5vw,90px); position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:space-between; min-height:800px; background:radial-gradient(ellipse at 46% 43%,#1c5e3875,transparent 47%),radial-gradient(ellipse at 80% 75%,#82612926,transparent 42%); }
.auth-art:after { content:''; position:absolute; inset:0; background-image:linear-gradient(#ffffff07 1px,transparent 1px),linear-gradient(90deg,#ffffff07 1px,transparent 1px); background-size:46px 46px; mask-image:linear-gradient(to bottom,transparent,#0008); pointer-events:none; }
.auth-copy { z-index:1; max-width:560px; }
.auth-copy h1 { font-size:clamp(43px,5vw,76px); font-weight:850; line-height:1.03; letter-spacing:-3px; margin:20px 0; }
.auth-copy h1 em { color:var(--brand); font-style:normal; }
.auth-copy p { font-size:16px; line-height:1.8; max-width:450px; color:#bfd1c3; }
.auth-brand-mark { display:block; width:min(75%,460px); margin:20px auto 30px; filter:drop-shadow(0 30px 70px #2eab5c52); animation:float 7s ease-in-out infinite; }
@keyframes float { 50% { transform:translateY(-12px) rotate(1deg); } }
.auth-features { position:relative; display:flex; gap:10px; flex-wrap:wrap; z-index:1; }
.auth-features span { padding:12px 17px; border-radius:15px; border:1px solid #c8ffc322; background:#ffffff08; backdrop-filter:blur(9px); font-size:13px; color:#c9e4d1; }
.auth-right { min-height:100vh; display:grid; place-content:center; padding:42px 24px; }
.auth-panel { width:min(100%,470px); padding:clamp(26px,3.1vw,45px); border-radius:28px; }
.auth-panel h2 { margin:0; font-size:31px; letter-spacing:-1px; }
.auth-panel .subtitle { margin:9px 0 0; color:var(--muted); font-size:14px; }
.auth-panel .divider-text { display:flex; align-items:center; gap:15px; color:var(--muted); font-size:12px; margin:18px 0; }
.divider-text::before,.divider-text::after { content:''; height:1px; flex:1; background:var(--line); }
.auth-foot { text-align:center; margin-top:20px; font-size:12px; color:var(--muted); line-height:1.7; }
.auth-mobile-logo { display:none; }
.app-shell { display:grid; grid-template-columns:260px 1fr; min-height:100vh; }
.sidebar { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; padding:25px 16px; border-right:1px solid var(--line); background:#0c1d17df; }
.sidebar .logo { padding:0 12px 26px; }
.nav-label { font-size:10px; font-weight:800; color:#668e79; letter-spacing:1.9px; text-transform:uppercase; padding:16px 16px 9px; }
.nav-link { width:100%; color:#afc7b7; display:flex; align-items:center; gap:13px; text-align:left; min-height:47px; font-size:14px; border:0; background:transparent; padding:0 14px; border-radius:12px; margin:3px 0; font-weight:650; text-decoration:none; }
.nav-link:hover { background:#ffffff0a; color:white; text-decoration:none; }
.nav-link.active { background:linear-gradient(100deg,#204e36,#1b3b2e); color:#b6ffc5; box-shadow:inset 0 0 0 1px #5cbb8052; }
.nav-link .icon { width:19px;height:19px; }
.nav-link small { margin-left:auto; color:var(--gold); font-size:10px; }
.sidebar-profile { margin-top:auto; border-radius:17px; padding:12px; display:flex; gap:11px; align-items:center; border:1px solid var(--line); background:#ffffff06; }
.avatar { width:43px;height:43px; border-radius:14px; display:grid; place-content:center; flex-shrink:0; font-weight:850; color:#113b22; background:linear-gradient(135deg,#d0f8a4,#5ec985); }
.avatar.large { width:68px;height:68px;border-radius:21px; font-size:22px; }
.avatar-txt { min-width:0; }
.avatar-txt strong { font-size:12px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.avatar-txt small { color:var(--muted); font-size:11px; }
.main { min-width:0; }
.topbar { min-height:91px; padding:20px clamp(22px,4vw,52px); border-bottom:1px solid var(--line); display:flex; gap:16px; align-items:center; justify-content:space-between; }
.topbar .heading { font-weight:850; font-size:24px; letter-spacing:-.8px; }
.topbar .heading small { font-size:12px; color:var(--muted); display:block; font-weight:500; letter-spacing:0; margin-top:3px; }
.top-right { display:flex; align-items:center; gap:11px; }
.content { padding:32px clamp(20px,4vw,52px) 80px; max-width:1550px; margin:auto; }
.page-heading { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:25px; gap:12px; }
.page-heading h1 { margin:5px 0 8px; font-size:clamp(26px,3vw,34px); letter-spacing:-1.3px; }
.page-heading p { color:var(--muted); margin:0; line-height:1.5; font-size:14px; }
.grid { display:grid; gap:18px; }
.grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stat { display:flex; gap:13px; align-items:center; }
.stat .stat-icon { width:46px;height:46px;border-radius:15px; background:#315841; color:#b8ffcd; display:grid; place-content:center; }
.stat strong { font-size:27px; letter-spacing:-1px; display:block; }
.stat small { color:var(--muted); font-size:12px; }
.welcome { min-height:240px; display:flex; align-items:center; justify-content:space-between; background:radial-gradient(circle at 88% 50%,#3696615b,transparent 34%),linear-gradient(113deg,#18452f,#0f261d); overflow:hidden; }
.welcome h2 { font-size:clamp(26px,3vw,41px); letter-spacing:-1.5px; margin:12px 0; }
.welcome p { color:#b9ddc6; max-width:460px; line-height:1.65; font-size:14px; }
.welcome img { width:225px; height:225px; object-fit:contain; margin:-20px 25px; filter:drop-shadow(0 15px 30px #0005); }
.section-title { font-size:17px; letter-spacing:-.4px; margin:30px 0 15px; }
.quick-item { display:flex; align-items:center; gap:13px; border-radius:14px; padding:14px; color:var(--text); background:#ffffff05; border:1px solid var(--line); cursor:pointer; width:100%; text-align:left; }
.quick-item .icon { color:#a9edba; }
.quick-item:hover { background:#ffffff0b; }
.quick-item span { font-size:13px; }
.quick-item .arrow { margin-left:auto; color:var(--muted); }
.lock { padding:38px; text-align:center; display:grid; justify-items:center; gap:12px; }
.lock .icon { width:36px;height:36px; color:var(--gold); }
.lock h2 { margin:0; }
.lock p { max-width:440px; margin:0 auto; line-height:1.65; color:var(--muted); }
.blur-preview { filter:blur(4px); opacity:.5; pointer-events:none; user-select:none; }
.messages { display:flex; flex-direction:column; gap:15px; max-height:48vh; min-height:285px; overflow:auto; padding:5px 5px 18px; scrollbar-width:thin; }
.chat-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:18px; }
.chat-rooms { padding:20px; }
.chat-room { padding:14px; background:#1e4f3392; border-radius:14px; display:flex; align-items:center; gap:12px; }
.chat-room .room-icon { width:40px;height:40px;border-radius:14px;display:grid;place-content:center;background:#70cb8788; }
.chat-main { display:flex;flex-direction:column; min-height:65vh; }
.chat-header { display:flex; align-items:center; gap:12px; padding-bottom:18px; border-bottom:1px solid var(--line); margin-bottom:17px; }
.chat-message { display:flex; gap:10px; max-width:78%; }
.chat-message.mine { align-self:flex-end; flex-direction:row-reverse; }
.chat-message .bubble { background:#1b3b2c; border:1px solid #ffffff14; padding:12px 14px; border-radius:5px 16px 16px 16px; }
.chat-message.mine .bubble { border-radius:16px 5px 16px 16px; background:#2a6242; }
.chat-message .bubble p { white-space:pre-wrap; overflow-wrap:anywhere; margin:5px 0; font-size:13px; line-height:1.55; }
.chat-message .bubble small { font-size:10px; color:#a8cbb4; }
.chat-message .bubble strong { font-size:12px; color:#baf1c9; }
.online { display:inline-block; width:9px;height:9px; border-radius:50%;background:#55d983;box-shadow:0 0 0 3px #59ca7833; }
.online.off { background:#79857d; box-shadow:none; }
.reacts { display:flex;gap:5px; flex-wrap:wrap; margin-top:8px; }
.react { background:#ffffff0b; border:1px solid #ffffff13; border-radius:15px; color:#d1efe0; font-size:13px; padding:3px 7px; }
.chat-compose { display:flex;align-items:center;gap:10px;margin-top:auto;padding-top:18px;border-top:1px solid var(--line); }
.chat-compose .input { flex:1; }
.list { display:grid; gap:12px; }
.note { background:#ffffff06; border:1px solid var(--line); padding:17px; border-radius:16px; }
.note h3 { margin:8px 0; }
.note p { white-space:pre-wrap; overflow-wrap:anywhere; color:#cadbd0; font-size:13px; line-height:1.7; }
.note small { color:var(--muted); }
.tools { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.tools .input { max-width:250px; }
.plan-card { position:relative; display:flex; flex-direction:column; gap:13px; }
.plan-card.highlight { border-color:#8be79a72; background:linear-gradient(150deg,#21583d,#11281f); }
.plan-price { font-size:35px; letter-spacing:-1.4px; font-weight:850; }
.plan-price small { font-size:12px; font-weight:500; color:var(--muted); }
.plan-card ul { padding-left:19px; color:#bad2c1; font-size:13px; line-height:2.1; flex:1; }
.banner { height:150px; border-radius:19px; background:linear-gradient(115deg,#174f34,#69c786); position:relative; }
.banner.emerald { background:linear-gradient(115deg,#08584c,#73ddc2); }
.banner.violet { background:linear-gradient(115deg,#3b2b68,#a58be1); }
.banner.sunset { background:linear-gradient(115deg,#8a4836,#ecbc6e); }
.profile-head { display:flex;align-items:flex-end; gap:17px; margin-top:-38px; margin-left:20px; position:relative; }
.profile-head .avatar { border:4px solid #163124; }
.profile-head h2 { margin:0 0 7px; }
.badge-line { margin:16px 0;display:flex; gap:8px; flex-wrap:wrap; }
.owner-table { width:100%; border-collapse:collapse; font-size:12px; }
.owner-table th,.owner-table td { padding:12px 10px;text-align:left;border-bottom:1px solid var(--line); }
.owner-table th { color:#9ab7a3;font-weight:700;text-transform:uppercase;letter-spacing:.5px;font-size:10px; }
.owner-table td { overflow-wrap:anywhere; }
.owner-table select { max-width:120px; min-width:95px; padding:6px; font-size:11px; min-height:35px; }
.table-scroll { overflow-x:auto; }
.empty { text-align:center; padding:38px; color:var(--muted); border:1px dashed #ffffff20; border-radius:16px; font-size:13px; }
.inline-note { padding:13px 15px; border:1px solid #e2c17848; background:#876b2830; color:#eedda0; border-radius:13px; font-size:12px; line-height:1.5; }
.legal { max-width:780px; margin:50px auto; padding:0 24px 60px; }
.legal h1 {font-size:clamp(30px,5vw,47px); letter-spacing:-1.4px;}
.legal h2 { margin-top:35px; font-size:20px; }
.legal p,.legal li { color:#bed1c4; font-size:14px; line-height:1.9; }
.legal .logo { margin-bottom:30px; }
.mobile-nav { display:none; }
.menu-button { display:none; }
.form-row { display:grid;grid-template-columns:1fr 1fr;gap:14px; }
.footer { color:#678573; font-size:11px; margin-top:50px; }
@media (max-width:1100px) {
  .auth-shell { grid-template-columns:.8fr 1fr; }
  .auth-art { padding:32px; }
  .auth-copy h1 { font-size:44px; }
  .auth-brand-mark { width:80%; }
  .chat-layout { grid-template-columns:1fr; }
  .chat-rooms { display:none; }
  .grid.three { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:800px) {
  .auth-shell { display:block; }
  .auth-art { display:none; }
  .auth-right { padding:25px 18px 50px; min-height:100svh; }
  .auth-mobile-logo { display:flex; justify-content:center; margin:0 0 30px; }
  .auth-panel { padding:26px; }
  .app-shell { display:block; }
  .sidebar { display:none; }
  .topbar { min-height:78px; padding:17px 20px; }
  .topbar .heading { font-size:21px; }
  .topbar .heading small { font-size:11px; }
  .top-right .upgrade { display:none; }
  .content { padding:23px 18px calc(116px + env(safe-area-inset-bottom)); }
  .mobile-nav { display:flex; position:fixed; z-index:60; bottom:calc(13px + env(safe-area-inset-bottom)); left:12px; right:12px; min-height:66px; border-radius:24px; align-items:center; justify-content:space-around; padding:7px; background:rgba(17,47,31,.86); border:1px solid #d0ffd12c; box-shadow:0 10px 45px #0009; backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px); }
  .mobile-nav a { display:grid; place-items:center; gap:4px; width:20%; color:#a5c8ae; font-size:9px; font-weight:650; text-decoration:none; border-radius:15px; padding:8px 3px; }
  .mobile-nav a.active { color:#b5ffbf; background:#69c98225; }
  .mobile-nav a .icon { width:21px; height:21px; }
  .menu-button { display:inline-flex; }
  .mobile-drawer { position:fixed; z-index:80; top:0; bottom:0; right:0; width:min(325px,87vw); padding:20px 15px; background:#11251b; border-left:1px solid var(--line); box-shadow:0 0 0 120vw #0009; overflow:auto; }
  .mobile-drawer .logo { padding:5px 10px 20px; }
  .grid.three,.grid.two { grid-template-columns:1fr; }
  .welcome img { width:140px;height:140px; margin-right:-28px; }
  .welcome { padding:20px; min-height:200px; }
  .welcome h2 { font-size:25px; }
  .chat-main { min-height:72svh; }
  .chat-message { max-width:92%; }
}
@media(max-width:480px) {
  .form-row { grid-template-columns:1fr; gap:0; }
  .auth-panel { padding:23px; }
  .auth-panel h2 { font-size:26px; }
  .page-heading { align-items:flex-start; }
  .page-heading .btn { font-size:11px; padding:9px; }
  .card { padding:18px; border-radius:20px; }
  .welcome img { width:113px; height:113px; }
  .welcome p { font-size:12px; }
  .tools .input { max-width:100%; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; scroll-behavior:auto!important;transition:none!important; } }

/* Leaf Box v1 feature modules ------------------------------------------------ */
.sr-only { position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important; }
.spread { display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap; }
.push-right { margin-left:auto; }
.top-gap { margin-top:20px; }
.extra-sections { margin-top:24px; }
.stack { display:grid;gap:12px; }
.button-row { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px; }
.scroll-list { max-height:310px;overflow:auto; }
.room-entry { display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line); }
.room-entry:last-child { border-bottom:0; }
.room-entry strong,.room-entry small { display:block;line-height:1.5; }
.room-entry small { font-size:11px;color:var(--muted);overflow-wrap:anywhere; }
.room-entry .btn { flex-shrink:0; }
.notice-item { padding:13px 0;border-bottom:1px solid var(--line); }
.notice-item:last-child { border-bottom:0; }
.notice-item.is-new { border-left:2px solid var(--brand);padding-left:10px; }
.notice-item strong,.notice-item small { display:block; }
.notice-item p { margin:6px 0;line-height:1.5;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere; }
.notice-item .muted { color:var(--muted);font-size:11px; }
.online-dot { display:inline-block;flex-shrink:0;width:9px;height:9px;background:#55e783;border:2px solid #1b3b2b;border-radius:50%;vertical-align:middle; }
.online-dot.is-offline { background:#8a9b90; }
.count-pill { border-radius:99px;background:#73d295;color:#092113;padding:4px 7px;font-weight:800;font-size:10px;flex-shrink:0; }
.enhanced-chat { grid-template-columns:minmax(220px,290px) minmax(0,1fr); }
.chat-room-list { display:grid;gap:8px;margin:13px 0 20px;max-height:400px;overflow:auto; }
.conversation-item { display:flex;align-items:center;gap:11px;width:100%;border:1px solid transparent;background:transparent;color:var(--text);padding:10px;border-radius:14px;text-align:left;min-height:62px; }
.conversation-item:hover,.conversation-item.active { border-color:#68ca8d45;background:#2c6c4538; }
.conversation-item .avatar { width:38px;height:38px;font-size:10px; }
.conversation-copy { flex:1;min-width:0; }
.conversation-copy strong { display:block;font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden; }
.conversation-copy small { display:block;font-size:11px;color:var(--muted);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-top:4px; }
.compact-form { padding-top:12px;border-top:1px solid var(--line); }
.compact-form h4 { margin:0; }
.people-picker { max-height:180px;overflow:auto;display:grid;gap:6px; }
.person-choice { display:flex;align-items:center;gap:10px;padding:8px;background:#102e1f;border:1px solid var(--line);border-radius:10px;font-size:12px;min-height:44px; }
.person-choice input { width:16px;height:16px;accent-color:var(--brand); }
.person-choice small { display:block;color:var(--muted); }
.enhanced-composer { display:flex;align-items:center;gap:8px;flex-wrap:nowrap; }
.enhanced-composer>.input { min-width:0;flex:1; }
.upload-btn { display:grid;place-content:center;width:45px;height:45px;border:1px solid var(--line);border-radius:12px;cursor:pointer;flex-shrink:0; }
.message-image { max-width:min(100%,280px);max-height:320px;display:block;object-fit:contain;border-radius:12px;margin:8px 0; }
.message-actions { display:flex;align-items:center;gap:3px;margin-top:6px; }
.message-actions button { border:0;background:#ffffff0b;border-radius:8px;color:var(--text);padding:5px 7px;cursor:pointer;min-width:30px;min-height:30px;display:grid;place-content:center; }
.message-actions button:hover { background:#ffffff26; }
.message-actions .icon { width:14px;height:14px; }
.reactions { display:flex;gap:4px;flex-wrap:wrap; }
.gif-picker { border:1px solid var(--line);padding:10px;margin:6px 0;border-radius:14px; }
.gif-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:8px;max-height:150px;overflow-y:auto;margin-top:10px; }
.gif-grid button { padding:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;cursor:pointer;background:#183b27; }
.gif-grid img { width:100%;height:80px;object-fit:cover;display:block; }
.calendar-grid { display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:15px; }
.calendar-grid b { text-align:center;font-size:10px;color:var(--muted);padding:5px; }
.calendar-day { min-width:0;aspect-ratio:1;border-radius:10px;border:1px solid transparent;color:var(--text);background:#ffffff08;position:relative;cursor:pointer;font-size:12px; }
.calendar-day:hover,.calendar-day.selected { background:#3b8056;border-color:#98e9ae; }
.calendar-day i { width:5px;height:5px;border-radius:50%;background:var(--gold);position:absolute;bottom:4px;left:calc(50% - 2.5px); }
.profile-pictures { display:flex;gap:10px;align-items:center;min-height:110px; }
.preview-avatar { width:72px;height:72px;object-fit:cover;border-radius:22px; }
.preview-banner { flex:1;min-width:0;max-width:200px;height:90px;object-fit:cover;border-radius:15px; }
.payment-qr { max-width:180px;width:100%;padding:8px;background:white;border-radius:13px;display:block;margin:10px 0; }
.assistant-layout { grid-template-columns:minmax(230px,310px) minmax(0,1fr);align-items:stretch; }
.model-option { display:flex;gap:12px;align-items:center;width:100%;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--text);text-align:left;cursor:pointer;padding:12px 8px;min-height:54px; }
.model-option:hover,.model-option.active { background:#315d4366;border-color:#75d39452; }
.model-option:disabled { opacity:.55;cursor:not-allowed;filter:blur(.5px); }
.model-option span { min-width:0;flex:1;font-weight:700;font-size:13px; }
.model-option small { display:block;color:var(--muted);font-size:11px;overflow-wrap:anywhere; }
.ai-conversation { display:flex;flex-direction:column;min-height:580px; }
.ai-messages { flex:1;max-height:500px;min-height:260px; }
.ai-messages .bubble { max-width:100%;overflow-wrap:anywhere; }
.ai-conversation .message-composer { display:flex;gap:8px;align-items:end; }
.ai-conversation .message-composer textarea { min-height:65px; }
.room-empty { display:grid;place-items:center;text-align:center;padding:45px 20px;gap:5px; }
.room-empty>.icon { width:50px;height:50px;color:var(--brand); }
.room-empty h2 { margin:10px 0 0;font-size:20px; }
.room-empty p { max-width:330px;line-height:1.6; }
.room-active { display:grid;justify-items:center;text-align:center;gap:10px;padding:20px 0; }
.room-active h2 { margin:2px 0 0; }
.room-icon-large { display:grid;place-content:center;width:90px;height:90px;border-radius:50%;background:#3e815d88;box-shadow:0 0 0 13px #2f684939;animation:room-pulse 3s ease-in-out infinite; }
.room-icon-large .icon { width:40px;height:40px; }
.room-members { display:flex;gap:6px;flex-wrap:wrap;justify-content:center;padding:12px; }
.permission-tag { margin:0 6px 8px 0;font-size:10px; }
.feature-checkboxes { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:12px 0; }
.feature-checkboxes label { display:flex;align-items:center;gap:8px;padding:8px;border-radius:10px;border:1px solid var(--line);font-size:12px; }
.feature-checkboxes input { accent-color:var(--brand); }
.review-image { display:block;max-width:200px;max-height:150px;object-fit:contain;margin:10px 0;border-radius:10px; }
@keyframes room-pulse { 50% { box-shadow:0 0 0 19px #2f68491c; } }
@media(max-width:1040px) { .enhanced-chat { grid-template-columns:210px minmax(0,1fr); } .assistant-layout{grid-template-columns:minmax(175px,240px) minmax(0,1fr)} }
@media(max-width:740px) {
 .enhanced-chat,.assistant-layout { grid-template-columns:minmax(0,1fr); }
 .enhanced-chat .chat-rooms { padding:14px; }
 .chat-room-list { display:flex;overflow:auto;max-height:none;margin:10px 0; }
 .conversation-item { min-width:155px;width:auto;max-width:190px;flex-shrink:0; }
 .chat-main { min-height:530px; }
 .enhanced-composer { flex-wrap:wrap; }
 .enhanced-composer>.input { flex-basis:100%; }
 .enhanced-composer>.btn,.enhanced-composer>.upload-btn { flex:1; }
 .ai-conversation { min-height:540px; }
 .feature-checkboxes { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .room-entry { flex-wrap:wrap; }
 .room-entry .btn { max-width:100%; }
 .extra-sections { margin-top:18px; }
}
@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after { animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important; }
}

.kick-btn {border:0;background:transparent;color:#ffcfcf;padding:3px 7px;border-radius:7px;font-size:16px;cursor:pointer;} .kick-btn:hover,.kick-btn:focus-visible{background:#8b3232;outline:2px solid #fdd;}

/* Extended mobile accessibility and live status layouts */
.status-feed {display:flex;flex-wrap:wrap;gap:12px;margin-top:12px;}
.status-post {display:flex;align-items:center;gap:10px;flex:1 1 220px;background:rgba(255,255,255,.035);border:1px solid var(--line);padding:11px;border-radius:16px;}
.status-avatar {width:42px;height:42px;object-fit:cover;border-radius:50%;}
.status-post strong {font-size:13px;display:flex;align-items:center;gap:5px;}
.status-post p {margin:5px 0 0;line-height:1.45;font-size:12px;}
@media(max-width:740px) {
 .btn,.btn.small,.role-select,.icon-btn { min-height:44px; }
 .mobile-nav a {min-height:54px;}
 .model-option,.conversation-item,.room-entry button {min-height:46px;}
 input,select,textarea {font-size:16px;}
}

.policy-body {line-height:1.7;white-space:normal;} .policy-body p{white-space:pre-wrap;overflow-wrap:anywhere;} .policy-editor{min-height:145px;line-height:1.6;resize:vertical;}

/* Premium feature preview: blurred affordance, never protected data. */
.locked-preview { position:relative; isolation:isolate; min-height:320px; display:grid; place-items:center; }
.locked-teaser { position:absolute; inset:14px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; overflow:hidden; }
.locked-teaser>.card {min-height:165px;}
.locked-overlay { position:relative; z-index:1; width:min(100%,510px); background:rgba(10,27,20,.92); backdrop-filter:blur(14px); box-shadow:0 14px 60px #0009; }
.skeleton-line { height:14px; margin:25px 0 0; border-radius:8px; background:linear-gradient(90deg,#376747,#28583a); }
.skeleton-line.short { width:60%;margin-top:15px;}
@media(max-width:540px) { .locked-teaser{grid-template-columns:1fr;} .locked-overlay{margin:12px;max-width:calc(100% - 24px);} }

/* Leaf Box Generation 01 — Uiverse-inspired microinteractions, original adapted CSS. */
:root { --g01-neon: #a5f5b9; --g01-glass: rgba(16,45,30,.7); }
.auth-panel.glass { box-shadow:0 32px 95px #0007,inset 0 1px 0 #eefff016; }
.auth-panel .subtitle {max-width:340px;line-height:1.45;}
.auth-features {display:none;}
.auth-copy h1 em,.page-heading h1 em,.welcome h2 em {font-family:Georgia,'Times New Roman',serif;font-weight:550;font-style:italic;letter-spacing:-.06em;}
.auth-panel h2,.page-heading h1,.heading,.welcome h2 {font-family:Inter,system-ui,-apple-system,Arial,sans-serif;}
.auth-panel .field {margin-bottom:12px;}
.auth-panel .auth-foot {margin-top:14px;}
.auth-panel .tabs {margin:16px 0;}
.auth-panel .divider-text {margin:12px 0;}
.input {transition:border-color .18s ease,box-shadow .22s ease,background-color .18s ease;background:linear-gradient(145deg,#0c2219de,#081b15ba);}
.input:hover {border-color:#83db9968;}
.input:focus-visible {border-color:#8ff5af;box-shadow:0 0 0 3px #46b36a29,0 5px 28px #237f4d24;}
.checkrow input {accent-color:#b7ffce;cursor:pointer;}
.checkrow input:focus-visible {outline:2px solid #acf6c6;outline-offset:3px;}
.card {transition:border-color .22s ease,box-shadow .25s ease;}
.card:hover {border-color:#b9ffca30;}
.btn:not(:disabled):active {transform:translateY(1px) scale(.98);}
.btn.primary {box-shadow:inset 0 1px 0 #ffffff3b,0 8px 26px #27a2572b;}
.btn.primary:hover {filter:brightness(1.09);box-shadow:inset 0 1px 0 #ffffff5c,0 10px 30px #27a25755;}
.btn:disabled {cursor:not-allowed;opacity:.55;}
.token-badge {white-space:nowrap;flex-direction:row!important;gap:6px;vertical-align:middle;max-width:max-content;}
.token-glyph {display:inline-grid;place-content:center;width:22px;height:22px;border-radius:8px;font-size:16px;line-height:1;color:#dbffec;text-shadow:0 1px 1px #000,0 -1px 2px #def9f0;background:linear-gradient(145deg,#347854,#15452f);box-shadow:inset 0 1px 1px #ffffff78,inset 0 -3px 2px #0007,0 2px 4px #0004;transform:rotate(-5deg);}
.tag.gold .token-glyph {background:linear-gradient(145deg,#e2bb55,#916a18);color:#fff6c3;}
.badge-line {display:flex;flex-direction:row;gap:7px;flex-wrap:wrap;align-items:center;}
.owner-table td .tag,.room-entry .tag {display:inline-flex;vertical-align:middle;white-space:nowrap;}
.owner-table td {vertical-align:middle;}
.owner-table .role-select {min-width:125px;max-width:170px;}
.chat-message[data-message-hold] {user-select:none;-webkit-user-select:none;cursor:context-menu;touch-action:pan-y;}
.chat-message[data-message-hold] p {user-select:text;-webkit-user-select:text;}
.message-actions.expanded {margin-top:10px;flex-wrap:wrap;gap:5px;background:#152d23;border:1px solid #75b98855;padding:8px;border-radius:12px;animation:fade-in .18s ease;}
.message-actions.expanded button {min-height:39px;padding:7px 10px;display:inline-flex;gap:6px;align-items:center;}
.message-image {max-width:min(100%,300px);max-height:290px;object-fit:contain;border-radius:12px;display:block;margin-top:8px;}
.attachment-link {display:inline-flex;gap:9px;align-items:center;border:1px solid #7ebf9245;border-radius:12px;padding:9px 12px;margin:10px 0;color:#b9f0cc;overflow-wrap:anywhere;}
.note-attachment {display:block;width:min(100%,420px);max-height:280px;object-fit:contain;border:1px solid #ffffff20;border-radius:12px;}
.ai-history-entry {display:flex;align-items:center;border-bottom:1px solid #ffffff12;gap:4px;}
.ai-history-entry .model-option {min-width:0;flex:1;}
.ai-history-entry .btn {flex-shrink:0;}
.ai-compose-actions {display:flex;align-items:center;gap:9px;flex-wrap:wrap;}
.ai-compose-actions .btn {min-height:44px;}
.ai-composer {flex-wrap:wrap;}
.ai-composer textarea {flex:1 1 100%;width:100%;}
.press-to-talk {touch-action:manipulation;user-select:none;}
.press-to-talk.listening {border-color:#e17171;background:#4b262b;color:#fff;}
.ai-attachment-link {display:inline-flex;margin-top:8px;max-width:100%;overflow-wrap:anywhere;color:inherit;text-decoration:underline;text-underline-offset:3px;}
.livekit-video-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));width:100%;gap:12px;margin:14px 0;}
.video-participant {border:1px solid #87cf9750;background:#0c1813;border-radius:15px;overflow:hidden;display:grid;}
.video-participant video {width:100%;height:160px;object-fit:cover;background:#081510;}
.video-participant span {color:#d7f7e2;font-size:12px;padding:7px;}
.chatlog-entries {max-height:420px;overflow:auto;}
@keyframes fade-in {from {opacity:0;transform:translateY(7px);}to {opacity:1;transform:translateY(0);}}
@media(max-width:800px) {
 .mobile-drawer {left:0!important;right:auto!important;border-left:0!important;border-right:1px solid var(--line);animation:drawer-slide-in .25s cubic-bezier(.2,.9,.2,1);}
 .top-right .menu-button {margin-left:auto;order:9;}
 .chat-rooms {display:block!important;}
 .chat-room-list {display:flex;}
 .enhanced-chat .chat-rooms {padding:12px!important;}
 .message-actions.expanded button {min-height:44px;}
 .auth-panel {padding:20px 18px;}
 .auth-mobile-logo {margin-bottom:12px;}
}
@keyframes drawer-slide-in {from {transform:translateX(-105%);opacity:.7;}to {transform:translateX(0);opacity:1;}}
@media(prefers-reduced-motion:reduce) {.mobile-drawer,.message-actions.expanded {animation:none!important;}}

/* --------------------------------------------------------------------------
   Leaf Box G02 — premium glass system, accessible overlays and file workflows
   All additions are CSS-only; no existing backend styles or tokens are removed.
   -------------------------------------------------------------------------- */
:root {
  --lb-text:#effff4; --lb-sheen:rgba(232,255,233,.14);
  --lb-ease:cubic-bezier(.22,1,.36,1);
  --lb-glass:linear-gradient(143deg,rgba(39,78,54,.73),rgba(10,29,21,.84));
  --lb-outline:rgba(211,253,222,.14);
}
body {
  background:
    radial-gradient(ellipse 650px 450px at 88% -10%,rgba(53,155,92,.16),transparent 72%),
    radial-gradient(ellipse 650px 530px at -20% 75%,rgba(165,135,61,.11),transparent 73%),
    #081711;
  background-attachment:fixed;
}
body::before {content:"";pointer-events:none;position:fixed;z-index:-1;inset:0;background-image:linear-gradient(120deg,transparent 46%,rgba(179,239,187,.025) 50%,transparent 54%);background-size:460px 460px;}
.card,.auth-panel.glass,.glass {backdrop-filter:blur(22px) saturate(1.16);-webkit-backdrop-filter:blur(22px) saturate(1.16);}
.card {background:var(--lb-glass);border:1px solid var(--lb-outline);box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 16px 44px #00000018;}
.card:hover {box-shadow:inset 0 1px 0 rgba(255,255,255,.09),0 20px 54px #0000002a;}
.btn,.input,.tag,.nav-link,.mobile-nav a,.model-option,.conversation-item {transition:transform .24s var(--lb-ease),border-color .2s ease,background-color .2s ease,box-shadow .24s ease,filter .22s ease;}
.btn.primary {background:linear-gradient(112deg,#d0f9b0 0%,#92edb0 48%,#55c58a 100%);color:#103822;border:1px solid rgba(255,255,255,.36);}
.btn.primary:hover {box-shadow:0 10px 36px #43c78055,inset 0 1px 0 #fff8;}
.input {background:rgba(6,22,14,.64);border-radius:15px;min-width:0;}
.input:focus {background:#09291a;border-color:#9af0b7;box-shadow:0 0 0 4px #6be49b24;}
.logo span {letter-spacing:-.7px;}
.auth-copy h1 em,.welcome h2,.brand-script {font-family:Georgia,'Palatino Linotype','Apple Chancery',serif;font-weight:600;}
.auth-copy h1 em {font-style:italic;}
.page-heading h1,.topbar .heading {font-weight:800;letter-spacing:-.055em;}
.sidebar {background:linear-gradient(170deg,rgba(15,45,28,.97),rgba(9,24,17,.97));border-right:1px solid var(--lb-outline);}
.topbar {background:rgba(11,32,21,.52);backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px);position:relative;z-index:10;}
.nav-link.active {border:1px solid #71df9766;box-shadow:inset 0 1px 0 #d1fbd022,0 9px 22px #051c1040;}
.mobile-nav {backdrop-filter:blur(24px) saturate(1.4);-webkit-backdrop-filter:blur(24px) saturate(1.4);}
.plan-card.highlight {background:linear-gradient(145deg,#306a49aa,#133221dd);}

/* Prevent overly narrow flex/grid items from forcing character-by-character text. */
.main,.content,.grid>* ,.card,.room-entry,.notice-item,.status-post,.conversation-copy,.model-option span,.owner-table,.chat-message,.bubble,.ai-history-entry,.top-right,.page-heading > * {min-width:0;}
.btn,.tag,.token-badge,.token-glyph,.room-entry .tag,.role-select,.nav-link,.mobile-nav a {writing-mode:horizontal-tb;text-orientation:mixed;white-space:normal;word-break:normal;overflow-wrap:normal;}
.tag,.token-badge {display:inline-flex!important;flex-direction:row!important;align-items:center!important;gap:7px;white-space:nowrap!important;max-width:100%;}
.tag .token-glyph {flex:0 0 auto;}
.btn {max-width:100%;white-space:normal;text-align:center;line-height:1.3;}
.owner-table {width:100%;overflow-x:auto;}
.owner-table table,table {min-width:min(100%,570px);}
.owner-table td,.owner-table th {white-space:normal;word-break:normal;}
.room-entry,.spread,.topbar,.page-heading {flex-wrap:wrap;}
.chat-message .bubble {overflow-wrap:anywhere;word-break:normal;}
.chat-link {color:#bdffbb;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;}
.chat-link:focus-visible {outline:2px solid #bdffbb;}

/* Modal dialog: native browser top-layer focus handling with branded UI. */
.lb-dialog {box-sizing:border-box;border:1px solid rgba(198,255,207,.26);border-radius:28px;width:min(460px,calc(100vw - 24px));max-height:min(87svh,820px);padding:0;color:var(--text);background:linear-gradient(145deg,rgba(37,78,53,.96),rgba(12,32,22,.97));box-shadow:inset 0 1px 0 #ecfff51a,0 35px 140px #000c;backdrop-filter:blur(28px) saturate(1.25);-webkit-backdrop-filter:blur(28px) saturate(1.25);overflow:auto;animation:lb-dialog-rise .32s var(--lb-ease);}
.lb-dialog::backdrop {background:rgba(2,12,8,.73);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);animation:lb-fade-in .18s ease;}
.lb-dialog-content {padding:clamp(20px,4vw,32px);}
.lb-dialog-heading {display:flex;gap:15px;align-items:flex-start;margin-bottom:17px;}
.lb-dialog-heading h2 {font-size:clamp(21px,2.5vw,27px);margin:0 0 7px;line-height:1.1;letter-spacing:-.75px;}
.lb-dialog-heading p {margin:0;line-height:1.65;font-size:13px;color:#bfd7c7;}
.lb-dialog-emblem {width:54px;height:54px;flex:0 0 54px;border:1px solid rgba(194,250,207,.25);background:linear-gradient(135deg,#396f4c,#173f2e);border-radius:19px;display:grid;place-content:center;color:#c9ffd8;box-shadow:inset 0 1px 0 #ffffffe0,0 10px 29px #0b201e80;font-size:23px;}
.lb-dialog-emblem.danger,.lb-dialog-emblem.warning {background:linear-gradient(135deg,#794d32,#422921);color:#ffd9b7;border-color:#eeaa7b67;}
.lb-modal-icon {width:25px;height:25px;}
.lb-modal-field {display:grid;gap:9px;margin:18px 0;}
.lb-modal-field label {font-size:12px;color:#cdebd7;font-weight:750;}
.lb-modal-field textarea {min-height:100px;}
.lb-dialog-footer {display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:25px;}
.lb-dialog-footer .btn {min-width:107px;min-height:46px;}
.lb-dialog-body {max-height:45vh;overflow:auto;}
.lb-notification-item {padding:13px 4px;border-bottom:1px solid rgba(255,255,255,.11);}
.lb-notification-item.unread {border-left:3px solid #9bedb4;padding-left:12px;}
.lb-notification-item p {font-size:13px;line-height:1.6;margin:0 0 5px;white-space:pre-wrap;overflow-wrap:anywhere;}
.lb-notification-item small {color:var(--muted);font-size:11px;}

/* Toast stack: one toast per action, no accidental loss of concurrent messages. */
.lb-toast-stack {position:fixed;right:max(15px,env(safe-area-inset-right));top:max(16px,env(safe-area-inset-top));width:min(410px,calc(100vw - 30px));display:flex;flex-direction:column;align-items:stretch;gap:10px;z-index:5000;pointer-events:none;}
.lb-toast,.lb-upload-toast {display:flex;align-items:center;gap:12px;background:linear-gradient(130deg,rgba(26,66,45,.97),rgba(13,35,24,.98));border:1px solid #93d4a64a;border-radius:18px;padding:12px 14px;box-shadow:0 17px 55px #0008,inset 0 1px 0 #ffffff18;color:#e7ffef;pointer-events:auto;animation:lb-toast-enter .3s var(--lb-ease);}
.lb-toast.error {border-color:#d5928470;background:linear-gradient(130deg,#56352f,#2e1e1c);color:#ffddd4;}
.lb-toast.info {border-color:#8aaec06b;background:linear-gradient(130deg,#1a4351,#102932);}
.lb-toast.leaving {opacity:0;transform:translateX(26px);transition:opacity .2s,transform .2s;}
.lb-toast-emblem {flex:0 0 35px;height:35px;display:grid;place-content:center;border-radius:13px;background:rgba(255,255,255,.09);}
.lb-toast-emblem .lb-modal-icon {width:20px;height:20px;}
.lb-toast-copy {font-size:13px;line-height:1.45;min-width:0;flex:1;overflow-wrap:anywhere;}
.lb-toast-dismiss {border:0;background:transparent;color:#d5ebdb;padding:6px;display:grid;place-content:center;flex:0 0 auto;border-radius:9px;}
.lb-toast-dismiss .lb-modal-icon {width:15px;height:15px;}
.lb-toast-dismiss:hover {background:#ffffff18;}
.lb-upload-toast {flex-direction:column;align-items:stretch;gap:11px;}
.lb-upload-label {display:flex;gap:12px;align-items:center;min-width:0;font-size:12px;overflow-wrap:anywhere;}
.lb-upload-label .lb-modal-icon {width:20px;height:20px;flex-shrink:0;}
.lb-upload-meter {width:100%;height:7px;accent-color:#83e69e;border-radius:99px;overflow:hidden;}
.lb-attachment-preview {display:inline-flex;gap:12px;align-items:center;max-width:100%;min-height:50px;border-radius:15px;border:1px solid rgba(156,229,176,.28);background:rgba(22,61,39,.45);margin:10px 0;padding:9px 13px;color:#c8f7d8;font-size:12px;overflow-wrap:anywhere;animation:lb-fade-in .18s ease;}
.lb-attachment-preview img {width:58px;height:53px;object-fit:cover;border-radius:9px;border:1px solid #ffffff20;}
.lb-attachment-preview span {min-width:0;overflow-wrap:anywhere;}
.update-form {display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.update-form input {flex:1 1 210px;}
.update-form button {flex:0 0 auto;}
.message-image {width:auto;max-width:min(100%,340px);height:auto;border-radius:15px;border:1px solid #ffffff1b;}
.message-actions.expanded {background:linear-gradient(135deg,#24543c,#122f23);border-color:#8be5a468;}
.chat-room-list {min-width:0;}

/* Image cropper with zoom and drag, optimized for portrait phones. */
.lb-crop-dialog {width:min(640px,calc(100vw - 22px));}
.crop-stage {border-radius:20px;overflow:hidden;background:repeating-conic-gradient(#234936 0% 25%,#193d2b 0% 50%) 50%/25px 25px;display:grid;place-items:center;border:1px solid #ffffff27;touch-action:none;}
.crop-stage canvas {display:block;width:100%;height:auto;object-fit:contain;cursor:grab;touch-action:none;}
.crop-stage canvas:active {cursor:grabbing;}
.crop-zoom-label {display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;margin-top:20px;color:#dcf9e5;}
.lb-crop-dialog input[type=range] {width:100%;height:40px;accent-color:#92ebad;cursor:pointer;}

/* Responsiveness, touch ergonomics and deliberately lightweight animation. */
@keyframes lb-dialog-rise {from {opacity:0;transform:translateY(17px) scale(.965);filter:blur(5px)}to {opacity:1;transform:translateY(0) scale(1);filter:blur(0)}}
@keyframes lb-fade-in {from {opacity:0}to {opacity:1}}
@keyframes lb-toast-enter {from {opacity:0;transform:translate3d(20px,-10px,0)}to {opacity:1;transform:translate3d(0,0,0)}}
@media(max-width:800px){
 .topbar {justify-content:flex-start;flex-wrap:nowrap;gap:11px;padding:13px 16px;}
 .topbar .menu-button {display:inline-flex;flex:0 0 44px;order:-2;margin:0;}
 .topbar .heading {flex:1;min-width:0;font-size:clamp(17px,5vw,23px);}
 .top-right {margin-left:auto;gap:6px;flex:0 0 auto;}
 .top-right .upgrade {display:none;}
 .top-right>.btn {padding:9px;min-width:42px;}
 .mobile-drawer {left:0!important;right:auto!important;max-width:calc(100vw - 30px);border-radius:0 24px 24px 0;background:rgba(12,39,25,.96);animation:drawer-slide-in .28s var(--lb-ease);}
 .page-heading {flex-direction:column;align-items:flex-start;}
 .lb-toast-stack {left:12px;right:12px;top:auto;bottom:calc(84px + env(safe-area-inset-bottom));width:auto;}
 .lb-dialog-footer {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
 .lb-dialog-footer .btn {width:100%;min-width:0;}
 .chat-layout,.enhanced-chat {max-width:100%;min-width:0;}
 .enhanced-chat .chat-rooms,.enhanced-chat .chat-main {min-width:0;}
 .chat-message,.bubble,.message-actions.expanded {max-width:100%;}
 .message-actions.expanded {gap:7px;}
 .message-actions.expanded button {flex:1 0 auto;}
 .content {padding-bottom:calc(125px + env(safe-area-inset-bottom));}
}
@media(max-width:480px){
 .lb-dialog-content {padding:20px 17px;}
 .lb-dialog-heading {gap:10px;}
 .lb-dialog-emblem {width:42px;height:42px;flex-basis:42px;border-radius:15px;}
 .lb-dialog-heading h2 {font-size:22px;}
 .update-form button {width:100%;}
 .profile-pictures {max-width:100%;}
 .owner-table {overflow:auto;}
}
@media(prefers-reduced-motion:reduce){
 .lb-dialog,.lb-dialog::backdrop,.lb-toast,.lb-attachment-preview,.mobile-drawer {animation:none!important;transition:none!important;}
}

/* Generation 03: horizontal, responsive social updates and generous touch targets. */
.update-form {display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.update-form textarea {flex:1 1 100%;min-height:84px;resize:vertical}
.update-form input[type=file] {flex:1 1 220px;min-width:0;max-width:100%}
.status-post,.notice-item,.room-entry,.ai-history-entry {min-width:0;overflow-wrap:anywhere}
.status-post .post-body {min-width:0;flex:1}
.feed-media {display:block;max-width:min(100%,580px);max-height:340px;width:auto;height:auto;object-fit:contain;border-radius:16px;margin:10px 0;background:rgba(30,38,36,.07)}
.message-actions.expanded {display:flex;flex-wrap:wrap;max-height:190px;overflow-y:auto;overscroll-behavior:contain;gap:4px}
.message-actions.expanded button {min-width:34px;min-height:34px}
@media (max-width:640px) {.feed-media{max-width:100%}.update-form .btn{width:100%}}

.lb-attachment-preview video {display:block;max-width:100%;max-height:240px;border-radius:12px;margin:6px 0}

/* G04 — single coherent flagship layer; existing components/API contracts remain. */
:root {
  --lb-ink:#f1fff4;
  --lb-muted:#a7c4b2;
  --lb-outline:rgba(194,249,208,.17);
  --lb-depth:0 16px 48px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.07);
  --lb-spring:cubic-bezier(.2,1,.35,1);
}
html {scroll-padding-top:28px;}
body {font-family:'Segoe UI Variable','Manrope','Inter',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  color:var(--lb-ink);font-optical-sizing:auto;line-height:1.52;}
body::after {content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background:radial-gradient(circle at 8% 10%,rgba(97,199,127,.09),transparent 30%),
             radial-gradient(circle at 84% 80%,rgba(208,176,98,.07),transparent 34%);}
h1,h2,h3,h4 {text-wrap:balance;}
.page-heading h1 {font-size:clamp(29px,3.3vw,43px);font-weight:830;line-height:1.12;}
.page-heading p {max-width:770px;font-size:14px;line-height:1.75;}
.card {border-radius:25px;contain:layout style;box-shadow:var(--lb-depth);}
.card h3 {font-weight:770;letter-spacing:-.028em;}
.content {width:100%;max-width:1550px;min-width:0;animation:g04-in .4s var(--lb-spring);}
.card,.btn,.input,.model-option,.conversation-item {transition:transform .24s var(--lb-spring),border-color .18s ease,box-shadow .25s ease,background-color .2s ease;}
.btn {border-radius:15px;min-height:45px;}
.btn:active:not(:disabled),.model-option:active,.conversation-item:active {transform:scale(.977);}
.btn.primary {background:linear-gradient(125deg,#d6f9bb 0%,#9debb6 48%,#60c991 100%);color:#103a26;
  box-shadow:inset 0 1px 0 #fff9,0 8px 20px rgba(70,175,101,.18);}
.btn:focus-visible,.nav-link:focus-visible,.mobile-nav a:focus-visible,.panel-link:focus-visible {outline:3px solid #c3f1a4;outline-offset:3px;}
.btn.icon-btn {border-radius:15px;}
.topbar {border-bottom-color:rgba(226,255,229,.09);}
.sidebar {width:100%;}
.sidebar .nav-link {font-weight:660;}
.sidebar .nav-link.active {background:linear-gradient(100deg,rgba(89,183,115,.21),rgba(44,104,72,.12));}
.mobile-nav a.active {box-shadow:inset 0 1px 0 #c9f9c13c;}
.token-badge,.tag {max-width:100%;white-space:nowrap!important;}
.owner-table th,.owner-table td {min-width:105px;}
.owner-table td:first-child {min-width:170px;}
input, textarea, select, button {letter-spacing:normal;}
.input {border-radius:15px;min-width:0;}
.avatar {position:relative;overflow:hidden;isolation:isolate;border:1px solid rgba(208,255,213,.18);box-shadow:inset 0 2px 3px #ffffff25;}
.avatar > span {position:relative;z-index:0;}
.avatar > img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;border-radius:inherit;}
.avatar.large {overflow:hidden;}
.sidebar-profile .avatar {border-radius:15px;}
.chat-layout.enhanced-chat {min-height:min(70vh,780px);gap:17px;grid-template-columns:minmax(210px,270px) minmax(0,1fr);}
.enhanced-chat .chat-rooms,.enhanced-chat .chat-main {border-radius:25px;min-width:0;}
.enhanced-chat .chat-main {overflow:hidden;}
.enhanced-chat .messages {flex:1;max-height:min(66vh,680px);min-height:320px;scrollbar-gutter:stable;overscroll-behavior:contain;}
.chat-message {max-width:min(82%,680px);}
.chat-message.mine {margin-left:auto;}
.chat-message .bubble {border:1px solid rgba(208,252,221,.09);border-radius:6px 19px 19px 19px;
  box-shadow:0 9px 19px rgba(0,0,0,.1);background:rgba(37,83,56,.66);}
.chat-message.mine .bubble {background:linear-gradient(133deg,#286849,#215a42);border-color:rgba(201,255,217,.17);border-radius:19px 6px 19px 19px;}
.chat-message.pending .bubble {opacity:.76;border-style:dashed;}
.chat-message.pending .bubble::after {content:'Sending…';display:block;font-size:10px;color:#bce1c5;padding-top:6px;}
.chat-message .bubble p {font-size:14px;line-height:1.65;}
.message-image {display:block;max-width:min(100%,430px);max-height:430px;object-fit:contain;border-radius:14px;}
.conversation-item.active {background:linear-gradient(130deg,rgba(98,191,126,.20),rgba(73,153,101,.09));box-shadow:inset 0 0 0 1px rgba(146,227,164,.19);}
.message-composer {border-radius:17px;padding:12px;background:rgba(14,43,27,.45);border:1px solid rgba(196,240,208,.11);}
.message-composer .input {flex:1;}
.ai-conversation .ai-messages {max-height:min(64vh,680px);min-height:310px;}
.ai-streaming {white-space:pre-wrap;overflow-wrap:anywhere;}
.ai-streaming::after {content:'▍';color:#aef9b1;animation:g04-caret .8s steps(2,start) infinite;}
.panel-layout {display:grid;grid-template-columns:minmax(190px,235px) minmax(0,1fr);align-items:start;gap:18px;}
.panel-nav {display:flex;flex-direction:column;gap:6px;position:sticky;top:20px;padding:13px;border-radius:24px;
  background:linear-gradient(150deg,rgba(35,79,51,.69),rgba(13,37,25,.79));border:1px solid var(--lb-outline);box-shadow:var(--lb-depth);}
.panel-link {display:flex;align-items:center;gap:11px;min-height:47px;padding:10px 13px;border-radius:14px;
  text-decoration:none;color:#c4daca;font-weight:690;font-size:13px;line-height:1.3;}
.panel-link .icon {width:19px;height:19px;}
.panel-link:hover {color:white;background:rgba(201,250,214,.08);text-decoration:none;}
.panel-link.active {color:#e4ffec;background:linear-gradient(110deg,rgba(103,202,128,.27),rgba(54,130,85,.15));
  box-shadow:inset 0 0 0 1px rgba(170,237,178,.32);}
.panel-content {min-width:0;display:flex;flex-direction:column;gap:15px;}
.panel-results {min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:17px;}
.panel-results > .grid {min-width:0;}
.panel-results > .card,.panel-results > section.card {margin:0;}
.panel-results .table-scroll {max-width:100%;overflow-x:auto;}
.panel-results .owner-table {min-width:610px;}
.panel-search {position:relative;display:flex;align-items:center;gap:8px;}
.panel-search > .icon {position:absolute;left:16px;color:#badac5;width:20px;height:20px;pointer-events:none;}
.panel-search .input {padding-left:47px;background:rgba(11,37,23,.72);height:53px;}
.panel-empty {min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;}
.panel-empty .icon {width:37px;height:37px;color:#a6ddae;}
.panel-results [hidden],.panel-results .card[hidden],#panelSearchEmpty[hidden] {display:none!important;}
.card:has(.owner-table) {overflow:hidden;}
.page-heading,.grid,.form-row,.tools,.spread {min-width:0;}
@keyframes g04-in {from{opacity:.45;transform:translate3d(0,11px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes g04-caret {50%{opacity:0}}
@media(max-width:1180px){
  .panel-layout {grid-template-columns:1fr;}
  .panel-nav {position:relative;top:auto;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;overscroll-behavior-inline:contain;}
  .panel-link {white-space:nowrap;flex:0 0 auto;}
}
@media(max-width:850px){
  .chat-layout.enhanced-chat {grid-template-columns:minmax(0,1fr);}
  .enhanced-chat .chat-rooms {display:block!important;padding:11px!important;}
  .chat-room-list {display:flex;flex-direction:row;overflow-x:auto;gap:7px;scrollbar-width:thin;}
  .chat-room-list .conversation-item {min-width:176px;max-width:235px;flex:0 0 auto;}
  .enhanced-chat .messages {max-height:min(55svh,550px);min-height:270px;}
  .sidebar {display:none;}
  .panel-nav {padding:8px;border-radius:18px;}
  .panel-results .owner-table {min-width:565px;}
  .content {padding-inline:clamp(13px,3vw,22px);}
  .card {padding:clamp(15px,3vw,23px);border-radius:21px;}
}
@media(max-width:560px){
  .panel-link {min-height:43px;padding:9px 10px;font-size:12px;}
  .page-heading h1 {font-size:clamp(27px,8vw,37px);}
  .chat-message {max-width:93%;}
  .messages {gap:10px;}
  .chat-message .avatar {width:34px;height:34px;border-radius:12px;font-size:11px;}
  .chat-message .bubble {padding:10px 11px;}
  .message-composer {padding:9px;}
  .message-composer .btn {min-width:42px;padding:9px 11px;}
  .mobile-nav {border-radius:22px;}
  .grid.two,.grid.three,.form-row {grid-template-columns:minmax(0,1fr);}
}
@media(prefers-reduced-motion:reduce){
  .content,.ai-streaming::after {animation:none!important;}
  .btn,.card,.panel-link,.nav-link,.conversation-item {transition:none!important;}
}

/* Phase 2: directly editable profile surfaces and autosave feedback */
.profile-cover{position:relative;background-position:center;background-size:cover;min-height:170px;}
.profile-avatar-edit{position:relative;border:0;padding:0;background:transparent;border-radius:50%;cursor:pointer;flex-shrink:0;}
.profile-avatar-edit .avatar{pointer-events:none;}
.media-edit{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:#163b2eeb;color:#f3fff5;border:1px solid #ffffff60;border-radius:999px;padding:7px 11px;font:inherit;font-size:12px;cursor:pointer;box-shadow:0 3px 15px #0005;}
.media-edit .icon{width:15px;height:15px;}
.cover-edit{position:absolute;right:14px;bottom:14px;z-index:1;}
.avatar-edit{position:absolute;right:-5px;bottom:0;padding:7px;}
.profile-avatar-edit:focus-visible,.cover-edit:focus-visible{outline:3px solid #8dffb5;outline-offset:3px;}
.media-edit:disabled{opacity:.55;cursor:not-allowed;}
.lb-upload-detail{font-size:12px;color:#bde8c9;font-variant-numeric:tabular-nums;}
.save-failed{color:#fbb4a6!important;}
@media(max-width:640px){.profile-cover{min-height:140px}.cover-edit{right:9px;bottom:9px}.profile-avatar-edit .avatar{max-width:90px;max-height:90px}}

/* Phase 3: stable panel navigation, keyboard focus and reduced layout shifting */
.sidebar {overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
.panel-nav {overscroll-behavior:contain;}
.panel-content {min-width:0;}
.panel-link:focus-visible,.nav-link:focus-visible,.mobile-nav a:focus-visible {outline:2px solid var(--accent,#75c89b);outline-offset:3px;}
@media (prefers-reduced-motion:reduce) {.panel-link,.nav-link,.mobile-nav a {transition:none!important;}}

/* Phase 2: accessible cancellation and avatar fallback */
.avatar > img[hidden]{display:none!important;}
.lb-upload-cancel{margin-top:8px;min-height:38px;padding:6px 12px;border:1px solid #9ce5be;border-radius:9px;background:transparent;color:inherit;cursor:pointer;}
.lb-upload-cancel:focus-visible{outline:2px solid #a6f5bf;outline-offset:3px;}
.lb-upload-cancel:disabled{opacity:.55;cursor:wait;}
.lb-upload-cancel[hidden]{display:none!important;}

/* Phase 4 — server-authoritative member availability and accessible status controls. */
.presence-indicator {display:inline-block;flex-shrink:0;width:11px;height:11px;border:2px solid #183e2b;border-radius:50%;vertical-align:middle;margin-right:3px;background:#89978d;box-sizing:border-box;}
.presence-indicator.presence-online {background:#55e783;box-shadow:0 0 0 2px #55e78326;}
.presence-indicator.presence-idle {background:#f5c466;box-shadow:0 0 0 2px #f5c46626;}
.presence-indicator.presence-dnd {background:#ee7474;box-shadow:0 0 0 2px #ee747426;}
.presence-indicator.presence-offline {background:#8a9b90;box-shadow:none;}
.sidebar-profile .presence-indicator {width:10px;height:10px;}
#presenceMode {min-height:48px;cursor:pointer;}
#presenceMode:disabled {opacity:.65;cursor:wait;}
#presenceHelp {display:block;margin-top:5px;font-size:12px;line-height:1.5;}
#presenceSummary {display:flex;align-items:center;gap:5px;flex-wrap:wrap;font-size:13px;}
@media (prefers-reduced-motion:reduce) {.presence-indicator {transition:none;}}

/* Phase 5 chat usability: bounded search, quoted replies, reaction rosters. */
.lb-chat-search{display:flex;gap:8px;align-items:center;padding:10px 12px;flex-wrap:wrap;border-bottom:1px solid var(--border,rgba(150,180,160,.17))}
.lb-chat-search .input{flex:1;min-width:130px;max-width:100%;width:auto}
.lb-load-older{display:block;margin:6px auto 18px;min-height:40px}
.lb-reply-quote{display:grid;gap:4px;border-left:3px solid #75c6a4;padding:6px 10px;margin:8px 0;background:rgba(107,175,145,.09);border-radius:4px;font-size:.82rem;overflow-wrap:anywhere}
.lb-reply-quote span{opacity:.8;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lb-reply-compose{display:flex;align-items:center;justify-content:space-between;padding:9px 14px;gap:12px;background:rgba(107,175,145,.11);border-top:1px solid rgba(107,175,145,.35);font-size:.84rem}
.lb-reply-compose span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-reply-compose button{border:1px solid currentColor;border-radius:8px;background:transparent;color:inherit;min-width:42px;min-height:42px;font-size:1.25rem;cursor:pointer}
.lb-reaction-chip,.lb-reaction-remove{border:1px solid rgba(143,180,158,.38);background:rgba(112,149,126,.11);border-radius:20px;color:inherit;min-height:36px;padding:3px 10px;cursor:pointer}
.lb-reaction-chip.mine{border-color:#79cfac;background:rgba(94,174,138,.17)}
.lb-reaction-remove{padding:3px 8px;min-width:36px;margin-inline-start:-4px}
.lb-reaction-roster{margin:8px 0;padding-left:20px;max-height:250px;overflow:auto;line-height:1.9}
@media(max-width:600px){.lb-chat-search .input{flex-basis:100%}.lb-chat-search button{flex:1}.lb-reply-compose{font-size:.76rem}}
/* Phase 7 — model-policy controls. */
.ai-composer > .field { width:100%;min-width:0; }
.ai-composer > .field select { width:100%;min-height:44px; }
.owner-panel textarea.input { width:100%;max-width:100%;resize:vertical; }
@media (max-width:640px) {
  .ai-composer > .field, .ai-composer > .field select { min-width:0;width:100%; }
}

/* Phase 9: responsive four-tab navigation with an accessible More destination sheet. */
.mobile-more-sheet,.mobile-more-backdrop { display:none; }
.billing-pending { margin:14px 0 20px;border-color:var(--line); }
.billing-history .room-entry { flex-wrap:wrap; }
.billing-form .field { max-width:560px; }
.billing-form [hidden],.billing-upi[hidden],.billing-reference[hidden] { display:none!important; }
.pricing-grid .plan-card { display:flex;flex-direction:column;min-width:0; }
.pricing-grid .plan-card ul { flex:1; }
.pricing-grid .plan-card .btn { align-self:flex-start; }
@media(max-width:800px){
  .mobile-nav { z-index:80; }
  .mobile-nav a,.mobile-nav .more-tab { width:20%;min-height:48px; }
  .mobile-nav .more-tab { display:grid;place-items:center;gap:4px;padding:8px 3px;border:0;border-radius:15px;background:transparent;color:#a5c8ae;font-size:9px;font-weight:650;font-family:inherit;cursor:pointer; }
  .mobile-nav .more-tab.active { color:#b5ffbf;background:#69c98225; }
  .mobile-nav .more-tab .icon { width:21px;height:21px; }
  .mobile-more-backdrop { display:block;position:fixed;inset:0;z-index:61;border:0;background:#0008;cursor:pointer; }
  .mobile-more-sheet { display:block;position:fixed;z-index:70;left:12px;right:12px;bottom:calc(91px + env(safe-area-inset-bottom));background:#112b1f;border:1px solid var(--line);border-radius:23px;padding:15px;max-height:min(68vh,540px);overflow-y:auto;overscroll-behavior:contain;box-shadow:0 18px 50px #000a; }
  .mobile-more-heading { display:flex;align-items:center;justify-content:space-between;margin:0 0 12px;gap:10px;padding:0 2px; }
  .mobile-more-sheet nav { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  .mobile-more-sheet .more-link { display:flex;align-items:center;gap:9px;padding:13px 10px;min-height:48px;border:1px solid var(--line);border-radius:12px;color:var(--text);background:#ffffff08;font-size:12px;font-weight:650;text-decoration:none; }
  .mobile-more-sheet .more-link.active { border-color:#80cf99;background:#346645; }
  .mobile-more-sheet .more-link .icon { width:19px;height:19px;flex-shrink:0; }
}
@media(max-width:360px){ .mobile-more-sheet nav { grid-template-columns:1fr; } }

/* Phase 10: touch-first permission onboarding, accessible at phone and tablet widths. */
.device-setup-backdrop { position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));background:rgba(2,11,7,.86);overflow-y:auto;overscroll-behavior:contain; }
.device-setup-dialog { width:min(100%,480px);max-height:calc(100dvh - 30px);overflow-y:auto;overscroll-behavior:contain;padding:clamp(20px,5vw,32px);border:1px solid #7bba8a74;border-radius:28px;background:#132d21;color:var(--text);box-shadow:0 30px 95px #000b;display:flex;flex-direction:column;gap:14px; }
.device-setup-dialog h2 {font-size:clamp(22px,5vw,30px);line-height:1.2;margin:0;}
.device-setup-dialog p {line-height:1.55;margin:0;}
.device-setup-dialog small {font-size:12px;line-height:1.5;}
.device-setup-top {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}
.device-setup-top .eyebrow {letter-spacing:.09em;}
.device-setup-steps {display:flex;gap:8px;}
.device-setup-dot {height:5px;background:#496c57;flex:1;border-radius:10px;}
.device-setup-dot.current {background:#c0f4aa;}
.device-setup-spotlight {width:116px;height:116px;align-self:center;display:grid;place-items:center;border:2px solid #b6ffc7;border-radius:50%;box-shadow:0 0 0 10px #78d99527,0 0 0 23px #78d99510,0 0 55px #5ed78975;margin:12px 0;}
.device-setup-spotlight span {font-size:46px;line-height:1;}
.device-setup-detail {color:#c2d7ca;font-size:13px;}
.device-setup-result {min-height:46px;padding:12px 14px;background:#0b2116;border:1px solid #9defa82f;border-radius:13px;font-size:13px;}
.device-setup-actions {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch;}
.device-setup-actions .btn {min-height:48px;white-space:normal;}
.device-test-picker {position:fixed!important;left:-9999px!important;top:0!important;width:1px!important;height:1px!important;opacity:0!important;}
body:has(.device-setup-backdrop) {overflow:hidden;}
/* Do not force horizontally scrolling content/forms off the device viewport. */
.app-shell,.main,.content,.card,.page-heading,.grid,.assistant-layout,.enhanced-chat,.topbar {min-width:0;}
.card,.page-heading,.topbar,.device-setup-dialog {overflow-wrap:anywhere;}
.input,textarea,select {max-width:100%;}
@media (max-width:800px) {
  .content {padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right));}
  .mobile-nav {left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));}
  .mobile-nav a,.mobile-nav button {min-width:44px;min-height:48px;}
}
@media (max-width:420px) {
  .device-setup-backdrop {align-items:end;padding:0;}
  .device-setup-dialog {width:100%;max-height:calc(100dvh - env(safe-area-inset-top) - 8px);border-radius:24px 24px 0 0;padding:20px 18px calc(18px + env(safe-area-inset-bottom));}
  .device-setup-spotlight {width:88px;height:88px;margin:6px 0;}
  .device-setup-spotlight span {font-size:36px;}
  .device-setup-actions {grid-template-columns:1fr;}
  .device-setup-actions .btn {width:100%;}
  .topbar {gap:8px;}
  .topbar .heading {font-size:clamp(17px,4.9vw,23px);}
  .top-right {gap:5px;}
  .top-right .upgrade {max-width:100px;padding:8px 6px;}
  .pricing-grid,.assistant-layout {grid-template-columns:minmax(0,1fr);}
}
@media (prefers-reduced-motion:reduce) {
  .device-setup-dialog,.device-setup-spotlight {animation:none!important;transition:none!important;}
}
@media (prefers-contrast:more) {
  .device-setup-dialog,.device-setup-result {border-color:#e2ffe5;}
  .device-setup-dialog .muted {color:#def4e3;}
}
/* Keyboard accessibility and true touch target sizes. */
.skip-link {position:fixed;z-index:11000;top:8px;left:8px;transform:translateY(-180%);padding:12px 18px;background:#e2ffe1;color:#082113;border-radius:10px;font-weight:800;}
.skip-link:focus {transform:translateY(0);outline:3px solid #e2ffe1;outline-offset:2px;}
#mainContent:focus {outline:none;}
@media(pointer:coarse){.btn.small,.kick-btn,.lb-toast-dismiss,.lb-upload-cancel,.mobile-more-sheet .more-link {min-height:44px;min-width:44px;}}
@media(max-width:800px){.mobile-more-sheet {bottom:calc(91px + env(safe-area-inset-bottom));} }

/* Phase 11 — cohesive controls and typography; no external icon or font runtime. */
:root {
  --lb-text-soft:#c0d6c8;
  --lb-border-strong:rgba(190,247,201,.27);
  --lb-control-radius:14px;
  --lb-focus:#e0f5af;
}
html {text-size-adjust:100%;-webkit-text-size-adjust:100%;}
body {font-family:Inter,'Segoe UI Variable','Segoe UI',Roboto,system-ui,-apple-system,sans-serif;line-height:1.55;}
button,input,textarea,select {font-family:inherit;}
h1,h2,h3,h4,.topbar .heading {line-height:1.2;letter-spacing:-.025em;}
p,li {line-height:1.6;overflow-wrap:break-word;}
.muted,.tiny.muted {color:var(--lb-text-soft);}
.input,.btn,.nav-link,.more-link,.mobile-nav a,.mobile-nav button {border-radius:var(--lb-control-radius);}
.input {border-color:var(--lb-border-strong);}
.btn.outline {border-color:var(--lb-border-strong);}
.btn:disabled,.input:disabled {cursor:not-allowed;filter:saturate(.7);}
.icon,.lb-modal-icon {stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.lb-toast,.lb-upload-toast {min-width:0;max-width:100%;}
.lb-toast-label,.lb-upload-label,.lb-upload-detail {overflow-wrap:anywhere;min-width:0;}
.lb-upload-label span {min-width:0;overflow-wrap:anywhere;}
.lb-upload-meter {display:block;width:100%;max-width:100%;min-height:9px;}
.lb-upload-cancel {align-self:flex-end;min-height:44px;padding-inline:16px;}
.lb-toast-dismiss {min-height:44px;min-width:44px;}
.lb-toast-emblem,.lb-modal-emblem {flex-shrink:0;}
.card,.chat-main,.assistant-layout,.panel-content,.panel-results,.lb-dialog-content,.lb-notification-item {min-width:0;}
.card img,.card video,.chat-message img,.message-image {max-width:100%;}
.card a,.chat-message a,.panel-content a {overflow-wrap:anywhere;}
.table-scroll {max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;}
textarea,input:not([type='checkbox']) {min-width:0;}
:where(button,a,input,select,textarea,[tabindex]):focus-visible {outline:3px solid var(--lb-focus);outline-offset:3px;}
:where(.topbar .heading):focus {outline:none;}
@media (max-width:800px) {
  .page-heading h1 {font-size:clamp(24px,6vw,34px);}
  .card {padding:clamp(14px,4vw,22px);border-radius:19px;}
  .topbar {min-height:66px;}
  .content {padding-top:22px;}
  .mobile-nav {gap:2px;}
  .mobile-nav a,.mobile-nav button {min-width:0;flex:1 1 0;}
  .mobile-nav .icon,.mobile-nav button .icon {width:21px;height:21px;}
  .lb-toast-stack {max-height:calc(100dvh - 120px);overflow-y:auto;overscroll-behavior:contain;}
}
@media(max-width:359px) {
  .topbar {padding-inline:10px;}
  .content {padding-inline:12px;}
  .mobile-nav {left:5px;right:5px;padding:5px;}
  .mobile-nav a,.mobile-nav button {font-size:9px;padding-inline:1px;}
  .lb-dialog-footer {grid-template-columns:minmax(0,1fr);}
  .lb-dialog-footer .btn {width:100%;}
}
@media (prefers-reduced-motion:reduce) {
  .content,.lb-toast,.lb-upload-toast {animation:none!important;transition:none!important;}
}
@media(prefers-contrast:more) {
  .btn.outline,.input,.card,.lb-toast,.lb-upload-toast {border-color:#d9f6df;}
  .muted,.tiny.muted {color:#e4f5e8;}
}

/* Final Fix: user-scoped Assistant controls, integration management and save lifecycle. */
.ai-personal-panel{margin-top:16px;min-width:0}
.ai-personal-panel .field{display:flex;flex-direction:column;gap:7px;min-width:0}
.ai-personal-panel .grid{gap:12px}
.ai-personal-panel .ai-memory-list{display:grid;gap:8px;margin-block:12px}
.ai-memory-list .room-entry{overflow-wrap:anywhere;gap:8px}
.ai-memory-list .room-entry>span{flex:1;min-width:0}
.ai-personal-panel [data-form="ai-memory"]{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ai-personal-panel [data-form="ai-memory"] .input{flex:1;min-width:160px}
.integration-settings{min-width:0;display:flex;flex-direction:column;gap:11px}
.integration-settings .field{min-width:0}
.integration-settings input{width:100%;min-width:0}
[data-save-state][data-state="saving"],#aiPersonalSave[data-state="saving"]{color:var(--muted,#99ac9d)}
[data-save-state][data-state="saved"],#aiPersonalSave[data-state="saved"]{color:#2d9d69}
[data-save-state][data-state="error"],#aiPersonalSave[data-state="error"]{color:#d75c5c}
[data-save-state][data-state="retrying"],#aiPersonalSave[data-state="retrying"]{color:#d69c42}
[data-autosave-retry],[data-account-retry]{cursor:pointer;touch-action:manipulation;text-decoration:underline;text-underline-offset:3px}
[data-autosave-retry]:focus-visible,[data-account-retry]:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:4px}

@media(max-width:680px){.ai-personal-panel .grid.two{grid-template-columns:minmax(0,1fr)}.integration-settings{max-width:100%}.ai-memory-list .room-entry{align-items:flex-start}}

/* Task 5: accessible compact Owner AI Studio, no manual Save controls. */
.owner-ai-studio {min-width:0}
.owner-ai-topline,.owner-ai-editor-actions,.owner-ai-model-row {display:flex;align-items:center;justify-content:space-between;gap:12px}
.owner-ai-topline h3,.owner-ai-topline h4,.owner-ai-editor-heading h4 {margin:0}
.owner-ai-topline p,.owner-ai-editor-heading p {margin:5px 0 0}
.owner-ai-model-list {border:1px solid var(--line);border-radius:14px;overflow:hidden;margin-top:12px}
.owner-ai-model-row {padding:11px 13px;border-bottom:1px solid var(--line)}
.owner-ai-model-row:last-child {border-bottom:0}
.owner-ai-model-details {min-width:0;flex:1}
.owner-ai-model-details strong,.owner-ai-model-details small {display:block;overflow-wrap:anywhere;line-height:1.5}
.owner-ai-model-details small {font-size:12px;color:var(--muted)}
.owner-ai-model-actions {display:flex;gap:8px;flex-shrink:0}
.owner-ai-studio .owner-ai-control {width:46px;height:46px;min-width:46px;min-height:46px;padding:10px;border-radius:13px}
.owner-ai-studio .owner-ai-control[hidden] {display:none!important}
.owner-ai-studio .owner-ai-control:focus-visible {outline:3px solid var(--accent,#80deb0);outline-offset:2px}
.owner-ai-budget {max-width:360px}
.owner-ai-advanced {margin:12px 0;border-top:1px solid var(--line);padding-top:12px}
.owner-ai-advanced summary {cursor:pointer;font-weight:700;padding:8px 0;min-height:44px}
.owner-ai-advanced[open] .grid {margin-top:12px}
.owner-ai-editor-actions {justify-content:flex-start;margin-top:14px}
@media(max-width:520px){.owner-ai-topline,.owner-ai-editor-actions{gap:10px}.owner-ai-model-row{padding:10px}.owner-ai-model-details strong{font-size:13px}}

/* Task 6 — compact Assistant workspace with a genuinely responsive drawer. */
.ai-workspace-title{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:0 0 17px;min-width:0}
.ai-workspace-title h1{font-size:clamp(25px,3vw,35px);letter-spacing:-.05em;margin:5px 0}
.ai-workspace-title p{margin:0;line-height:1.5}
.ai-workspace-title .tag{flex-shrink:0}
.assistant-layout{grid-template-columns:minmax(215px,260px) minmax(0,1fr);gap:14px;align-items:start}
.assistant-layout.ai-settings-open{grid-template-columns:minmax(210px,250px) minmax(0,1fr) minmax(250px,310px)}
.ai-sidebar,.ai-conversation,.ai-settings-drawer{min-width:0;border-radius:19px}
.ai-sidebar{padding:12px!important;display:block;min-height:520px;overflow:hidden}
.ai-sidebar-summary{display:none;cursor:pointer;min-height:44px;align-items:center;gap:10px;font-weight:750}
.ai-sidebar-summary .icon{width:18px;height:18px}
.ai-sidebar-summary .muted{margin-left:auto}
.ai-sidebar-content{display:flex;flex-direction:column;gap:9px;min-width:0}
.ai-sidebar-header{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:8px;padding:0 4px 4px}
.ai-sidebar-buttons{display:flex;gap:5px}
.ai-tool{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:44px;min-height:44px;width:44px;height:44px;gap:5px;border:1px solid transparent;border-radius:13px;background:transparent;color:var(--text);cursor:pointer;touch-action:manipulation;transition:background .16s,border-color .16s,transform .16s;text-decoration:none}
.ai-tool .icon{width:19px;height:19px}
.ai-tool:hover:not(:disabled){border-color:#7fc69b55;background:#43855a24}
.ai-tool:focus-visible,.ai-history-open:focus-visible,.ai-model-choice:focus-visible,.ai-sidebar-summary:focus-visible{outline:2px solid #97e3b3;outline-offset:2px}
.ai-tool:active:not(:disabled){transform:scale(.96)}
.ai-tool:disabled{opacity:.37;cursor:not-allowed}
.ai-sidebar-section-label{font-size:10px;font-weight:800;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted);padding:10px 10px 3px}
.ai-model-list{display:grid;gap:3px}
.ai-model-choice{display:flex;align-items:center;gap:10px;min-height:45px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--text);width:100%;padding:8px 10px;text-align:left;cursor:pointer}
.ai-model-choice .icon{width:19px;height:19px;flex:none}
.ai-model-choice span,.ai-history-open span{display:block;min-width:0;flex:1;overflow:hidden}
.ai-model-choice strong,.ai-history-open strong{display:block;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.ai-model-choice small,.ai-history-open small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.ai-model-choice.active,.ai-history-entry.selected{background:#43875d22;border-color:#7bc79b4d}
.ai-model-choice:hover:not(:disabled),.ai-history-entry:hover{background:#43875d18}
.ai-model-choice:disabled{opacity:.5;cursor:not-allowed}
.ai-history-list{display:grid;gap:3px;min-width:0;overflow-y:auto;max-height:min(40vh,400px);overscroll-behavior:contain}
.ai-history-entry{display:flex;gap:1px;align-items:center;border:1px solid transparent;border-radius:12px;padding:1px 3px;min-height:47px}
.ai-history-open{display:flex;align-items:center;gap:9px;text-align:left;flex:1;min-width:0;border:0;background:transparent;color:var(--text);padding:6px 5px;min-height:44px;cursor:pointer}
.ai-history-open .icon{width:17px;height:17px;flex:none}
.ai-history-entry .ai-tool{min-width:35px;width:35px;height:44px}
.ai-history-entry .ai-tool .icon{width:15px;height:15px}
.ai-history-empty{padding:6px 10px}
.ai-sidebar-footer{border-top:1px solid var(--line);margin-top:auto;padding:10px 0 0;display:flex;align-items:center;gap:6px}
.ai-conversation{display:flex;flex-direction:column;min-height:min(79vh,790px);padding:0!important;overflow:hidden}
.ai-chat-top{display:flex;align-items:center;gap:9px;padding:12px 13px;border-bottom:1px solid var(--line);min-height:72px}
.ai-model-avatar{background:#40836025;border:1px solid #79cb9953;width:42px;height:42px;flex:none;border-radius:14px;display:grid;place-items:center}
.ai-model-avatar .icon{width:20px;height:20px}
.ai-chat-heading{min-width:0;flex:1;overflow:hidden}
.ai-chat-heading strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.ai-chat-heading small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px;margin-top:4px}
.ai-conversation .ai-messages{flex:1;min-height:330px;max-height:min(58vh,650px);overflow-y:auto;padding:15px 16px;scrollbar-width:thin;overscroll-behavior:contain}
.ai-empty-thread{height:100%;min-height:280px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:12px;color:var(--muted);padding:28px}
.ai-empty-thread .icon{color:#8adcaa;width:40px;height:40px}
.ai-empty-thread strong{font-size:17px;color:var(--text)}
.ai-empty-thread p{font-size:13px;line-height:1.6;max-width:270px;margin:0}
.ai-conversation .ai-composer-modern{margin:0 13px 4px;padding:7px!important;display:flex;flex-direction:column;gap:3px;align-items:stretch;border:1px solid #76af8b55;background:#12342444;border-radius:17px;min-width:0}
.ai-conversation .ai-composer-modern textarea{min-height:76px;max-height:190px;resize:vertical;width:100%;background:transparent;border:0;box-shadow:none;padding:10px 12px;line-height:1.55}
.ai-conversation .ai-composer-modern textarea:focus{outline:none;box-shadow:none;border:0}
.ai-composer-modern:focus-within{border-color:#92d9a7;box-shadow:0 0 0 2px #69ae7b27}
.ai-composer-modern .ai-compose-actions{display:flex;align-items:center;gap:3px;flex-wrap:nowrap;padding:0 1px}
.ai-compose-actions .ai-tool{flex:none}
.ai-compose-actions .ai-send{background:#347855;border:1px solid #79c69766;color:white;margin-left:auto}
.ai-compose-actions .ai-send:hover:not(:disabled){background:#409466}
.ai-compose-actions .ai-stop{background:#86363644;color:#f4bcbc}
.ai-file-picker{position:relative;cursor:pointer}
.ai-file-picker:focus-within{outline:2px solid #97e3b3;outline-offset:2px}
.ai-file-picker .sr-only{position:absolute}
.ai-composer-hint{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.ai-chat-footnote{padding:0 16px 11px;font-size:10px;line-height:1.4;color:var(--muted);margin:7px 0 0}
.ai-settings-drawer{margin-top:0;padding:17px!important;max-height:min(85vh,850px);overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:10px}
.ai-settings-header{display:flex;justify-content:space-between;align-items:center;gap:10px}
.ai-settings-header h3{margin:0}
.ai-settings-drawer .field{margin:0}
.ai-settings-drawer .field small{font-size:11px;line-height:1.5}
.ai-settings-memories{border-top:1px solid var(--line);margin-top:7px;padding-top:7px;min-width:0}
.ai-memory-list{display:grid;gap:6px}
.ai-memory-row{display:flex;align-items:center;gap:6px;min-width:0;border:1px solid var(--line);padding:5px;border-radius:10px}
.ai-memory-row span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.45;padding-left:6px}
.ai-memory-add{display:flex;gap:5px;align-items:center;margin:10px 0}
.ai-memory-add .input{min-width:0;flex:1}
.ai-clear-memory{width:100%;min-height:42px;border:1px solid #bc626259;background:transparent;color:#e3adad;border-radius:10px;cursor:pointer}
.ai-clear-memory:focus-visible{outline:2px solid #f0acac;outline-offset:2px}
@media(max-width:1150px){.assistant-layout.ai-settings-open{grid-template-columns:minmax(190px,230px) minmax(0,1fr)}.ai-settings-open .ai-settings-drawer{grid-column:2;max-height:none}}
@media(max-width:760px){
 .ai-workspace-title{align-items:start}.ai-workspace-title .tag{font-size:10px}
 .assistant-layout,.assistant-layout.ai-settings-open{grid-template-columns:minmax(0,1fr)!important;gap:10px}
 .ai-sidebar{min-height:0;padding:9px 12px!important}
 .ai-sidebar-summary{display:flex}
 .ai-sidebar:not(.open) .ai-sidebar-content{display:none}
 .ai-sidebar.open .ai-sidebar-content{border-top:1px solid var(--line);padding-top:9px}
 .ai-history-list{max-height:32vh}
 .ai-conversation{min-height:calc(100dvh - 300px)}
 .ai-conversation .ai-messages{max-height:55vh;min-height:270px}
 .ai-settings-open .ai-settings-drawer{grid-column:auto;max-height:none}
 .ai-composer-hint{display:none}
 .ai-chat-top{padding:9px}
 .ai-chat-top .ai-tool{width:42px;min-width:42px}
}
@media(prefers-reduced-motion:reduce){.ai-tool{transition:none}}

.ai-sidebar-summary{width:100%;background:transparent;border:0;color:var(--text);text-align:left;font:inherit}

/* Task 8 — cohesive, mobile-first messaging surfaces. No backend API changes. */
.lb-chat-workspace,.assistant-layout{min-width:0;isolation:isolate;}
.lb-chat-workspace{align-items:stretch;}
.lb-chat-workspace .chat-rooms,.lb-chat-workspace .chat-main,.ai-conversation{
  background:linear-gradient(160deg,rgba(27,63,46,.94),rgba(11,32,25,.94));
  border:1px solid rgba(175,230,190,.14);
  box-shadow:0 18px 46px rgba(0,12,8,.16);
}
.lb-chat-workspace .chat-rooms{padding:17px!important;display:flex!important;flex-direction:column;gap:13px;}
.lb-chat-rooms-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;min-width:0;padding:5px 4px 8px;}
.lb-chat-rooms-heading h3{font-size:20px;letter-spacing:-.035em;margin:4px 0 0;}
.lb-chat-kicker{font-size:10px;letter-spacing:.16em;font-weight:800;color:#9cd5ac;}
.lb-room-count{display:grid;place-items:center;border:1px solid rgba(170,237,184,.19);background:rgba(119,192,141,.13);color:#dcf9e2;border-radius:11px;min-width:37px;height:37px;padding:0 9px;font-size:12px;font-weight:800;}
.lb-chat-workspace .chat-room-list{margin:0;gap:5px;max-height:min(70vh,680px);padding:2px;scrollbar-width:thin;}
.lb-chat-workspace .conversation-item{min-width:0;min-height:70px;gap:12px;border-radius:15px;padding:10px 11px;transition:background .16s,border-color .16s;cursor:pointer;}
.lb-chat-workspace .conversation-item:focus-visible,.lb-chat-workspace .lb-reaction-chip:focus-visible,.lb-chat-workspace .lb-reaction-remove:focus-visible{
  outline:3px solid #9ae9ae;outline-offset:2px;
}
.lb-chat-workspace .conversation-item .avatar{width:43px;height:43px;min-width:43px;border-radius:15px;font-size:12px;}
.lb-chat-workspace .conversation-copy{flex:1;min-width:0;}
.lb-chat-workspace .conversation-copy strong,.lb-chat-workspace .conversation-copy small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.lb-chat-workspace .conversation-copy strong{font-size:13px;font-weight:750;}
.lb-chat-workspace .conversation-copy small{font-size:11px;color:#b4cabb;margin-top:5px;}
.lb-chat-workspace .chat-main{min-height:min(77svh,810px);padding:0!important;overflow:hidden;}
.lb-chat-workspace .chat-header{margin:0;padding:14px 18px;gap:13px;min-height:75px;border-bottom:1px solid rgba(185,236,201,.12);background:rgba(86,148,104,.07);}
.lb-room-avatar{width:43px;height:43px;min-width:43px;border-radius:15px;}
.lb-chat-header-copy{min-width:0;flex:1;}
.lb-chat-header-copy strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:760;}
.lb-chat-header-copy .tiny{margin-top:5px;line-height:1.35;}
.lb-chat-header-action{border-color:rgba(188,228,199,.12);background:rgba(255,255,255,.035);}
.lb-chat-workspace .lb-chat-search{margin:0;gap:7px;flex-wrap:nowrap;min-width:0;padding:10px 17px;border-bottom:1px solid rgba(175,221,191,.09);}
.lb-chat-search .input{margin:0;min-width:0;width:100%;flex:1;min-height:42px;border-radius:13px;padding:10px 13px;font-size:12px;}
.lb-chat-search .lb-search-action{min-width:44px;width:44px;height:44px;border:1px solid rgba(180,233,195,.12);background:rgba(255,255,255,.035);}
.lb-chat-workspace .lb-thread,.ai-conversation .lb-ai-thread{gap:15px;padding:22px 18px 20px;scrollbar-width:thin;scrollbar-gutter:stable;overscroll-behavior-y:contain;}
.lb-chat-workspace .lb-thread{max-height:min(65svh,730px);min-height:320px;}
.lb-chat-workspace .lb-thread-message,.ai-conversation .lb-ai-message{max-width:min(84%,680px);min-width:0;}
.lb-chat-workspace .lb-thread-message .bubble,.ai-conversation .lb-ai-message .bubble{
  min-width:0;background:#244937;border:1px solid rgba(187,231,201,.14);border-radius:6px 19px 19px 19px;
  box-shadow:0 6px 20px rgba(0,0,0,.09);padding:12px 15px;
}
.lb-chat-workspace .lb-thread-message.mine .bubble,.ai-conversation .lb-ai-message.mine .bubble{
  background:linear-gradient(137deg,#326d4d,#24583f);border-color:rgba(185,239,200,.21);border-radius:19px 6px 19px 19px;
}
.lb-thread-message .bubble small,.lb-ai-message .bubble small{font-size:11px;line-height:1.5;color:#b5d3c0;}
.lb-thread-message .bubble p,.lb-ai-message .bubble p{font-size:14px;line-height:1.64;overflow-wrap:anywhere;white-space:pre-wrap;}
.lb-thread-message .bubble .reactions{margin-top:7px;gap:5px;}
.lb-thread-message .lb-reaction-chip,.lb-thread-message .lb-reaction-remove{min-height:35px;cursor:pointer;border-radius:10px;}
.lb-thread-message .message-actions.expanded{max-height:195px;overflow:auto;scrollbar-width:thin;}
.lb-thread-message .message-actions.expanded button{min-height:44px;}
.lb-thread-message .message-image,.lb-ai-message .message-image{border:1px solid rgba(190,226,196,.15);}
.lb-chat-workspace .lb-reply-compose{border-radius:0;margin:0;padding:10px 17px;}
.lb-chat-workspace .lb-reply-compose span{min-width:0;flex:1;}
.lb-chat-workspace .lb-thread-guidance{padding:5px 19px 13px;font-size:11px;line-height:1.5;color:#9ebcaa;margin:0;}
.lb-composer,.ai-conversation .lb-ai-composer{
  display:flex!important;flex-direction:column!important;gap:0!important;min-width:0;
  border:1px solid rgba(151,211,171,.31)!important;
  border-radius:19px!important;
  background:linear-gradient(165deg,rgba(31,74,50,.91),rgba(18,51,36,.94))!important;
  box-shadow:0 4px 16px rgba(0,0,0,.12);padding:6px!important;
  transition:border-color .17s,box-shadow .17s;
}
.lb-composer:focus-within{border-color:#a5e2b1!important;box-shadow:0 0 0 3px rgba(123,208,156,.14);}
.lb-chat-workspace .lb-chat-composer{margin:10px 16px 12px;}
.ai-conversation .lb-ai-composer{margin:12px 15px 5px;}
.lb-compose-editor{min-width:0;width:100%;}
.lb-composer .lb-compose-textarea,.ai-conversation .lb-ai-composer .lb-compose-textarea{
  display:block;width:100%;min-width:0;max-width:100%;min-height:60px;max-height:172px;
  padding:12px 13px;resize:none;overflow-y:auto;line-height:1.55;
  font-size:14px;letter-spacing:.004em;border:0!important;box-shadow:none!important;
  background:transparent!important;color:var(--text);
}
.lb-composer .lb-compose-textarea:focus{outline:0!important;box-shadow:none!important;}
.lb-composer .lb-compose-textarea::placeholder{color:#a6bfb0;opacity:1;}
.lb-composer .lb-compose-toolbar,.ai-conversation .lb-ai-composer .lb-compose-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 4px 4px 6px;min-width:0;
}
.lb-compose-tools,.lb-compose-send{display:flex;align-items:center;min-width:0;gap:5px;}
.lb-compose-tools{flex:1;}
.lb-compose-send{flex-shrink:0;}
.lb-compose-hint{color:#a7c4b2;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.lb-compose-count{color:#a7c4b2;font-size:10px;white-space:nowrap;font-variant-numeric:tabular-nums;margin-right:7px;}
.lb-compose-file,.ai-file-picker.lb-compose-file{
  border:1px solid rgba(176,234,195,.15);display:grid;place-items:center;min-width:44px!important;
  width:44px!important;height:44px!important;min-height:44px!important;
  flex:0 0 auto;border-radius:13px;background:rgba(184,238,190,.07);color:#d7f6df;
  cursor:pointer;touch-action:manipulation;position:relative;
}
.lb-compose-file:hover{background:rgba(165,230,180,.17);border-color:rgba(197,245,203,.33);}
.lb-compose-file:focus-visible,.lb-compose-file:focus-within{outline:3px solid #9be8b3!important;outline-offset:2px;}
.lb-compose-file .icon{width:20px;height:20px;}
.lb-send-action,.ai-conversation .lb-send-action{
  display:grid;place-items:center;background:#7cdb9c!important;color:#102d1e!important;
  border:1px solid rgba(195,255,211,.55)!important;border-radius:14px!important;
  min-width:45px;width:45px;height:45px;min-height:45px;font-weight:750;
}
.lb-send-action:hover:not(:disabled),.ai-conversation .lb-send-action:hover:not(:disabled){background:#9becb3!important;}
.lb-send-action .icon{width:21px;height:21px;}
.lb-send-action:disabled{opacity:.43;}
.lb-composer .press-to-talk{border:1px solid rgba(177,232,191,.12);background:rgba(255,255,255,.035);}
.lb-composer .press-to-talk.listening{border-color:#aee4b8;background:rgba(106,199,133,.25);}
.lb-composer.drag-over{border-color:#c0f7ca!important;box-shadow:0 0 0 4px rgba(118,220,153,.20);}
.lb-composer .lb-attachment-preview{display:flex;align-items:center;width:fit-content;max-width:calc(100% - 18px);margin:2px 9px 8px;border-radius:12px;background:rgba(108,181,125,.14);padding:7px 9px;gap:9px;}
.lb-composer .lb-attachment-preview span{flex:1;min-width:0;max-width:260px;}
.lb-composer .lb-attachment-preview img{width:48px;height:48px;object-fit:cover;}
.lb-compose-remove-file{border:1px solid rgba(228,243,230,.14);border-radius:11px;display:grid;place-items:center;flex-shrink:0;
  background:rgba(255,255,255,.055);color:#e7f5e9;cursor:pointer;min-width:44px;min-height:44px;}
.lb-compose-remove-file .icon{width:17px;height:17px;}
.lb-compose-remove-file:focus-visible{outline:3px solid #9be8b3;outline-offset:2px;}
.ai-conversation .lb-ai-thread{padding:20px 19px;max-height:min(63svh,690px);min-height:315px;}
.ai-conversation .lb-ai-message .bubble{max-width:100%;}
.ai-conversation .ai-chat-footnote{padding:3px 18px 14px;}
@media(max-width:850px){
  .lb-chat-workspace{gap:10px;}
  .lb-chat-workspace .chat-rooms{padding:11px 12px!important;gap:6px;}
  .lb-chat-rooms-heading{padding:1px 5px 2px;}
  .lb-chat-rooms-heading h3{font-size:17px;}
  .lb-chat-workspace .chat-room-list{display:flex;flex-direction:row;overflow-x:auto;overflow-y:hidden;gap:7px;max-height:none;padding:3px 0 9px;}
  .lb-chat-workspace .chat-room-list .conversation-item{min-width:160px;max-width:225px;flex:0 0 auto;min-height:65px;}
  .lb-chat-workspace .lb-thread{max-height:min(55svh,610px);}
}
@media(max-width:600px){
  .lb-chat-workspace .chat-main{min-height:calc(70svh - env(safe-area-inset-bottom,0px));border-radius:20px;}
  .lb-chat-workspace .chat-header{padding:10px 12px;min-height:64px;}
  .lb-chat-workspace .lb-chat-search{padding:8px 11px;flex-wrap:nowrap;}
  .lb-chat-search .input{flex:1 1 auto;min-width:0;max-width:none;width:100%;}
  .lb-chat-search .lb-search-action{flex:0 0 44px;}
  .lb-chat-workspace .lb-thread,.ai-conversation .lb-ai-thread{padding:14px 11px;gap:12px;min-height:250px;}
  .lb-chat-workspace .lb-thread-message,.ai-conversation .lb-ai-message{max-width:94%;}
  .lb-chat-workspace .lb-thread-message .bubble,.ai-conversation .lb-ai-message .bubble{padding:10px 12px;}
  .lb-thread-message .bubble p,.lb-ai-message .bubble p{font-size:13px;}
  .lb-chat-workspace .lb-chat-composer{margin:9px 10px 8px;}
  .ai-conversation .lb-ai-composer{margin:8px 9px 4px;}
  .lb-composer .lb-compose-textarea,.ai-conversation .lb-ai-composer .lb-compose-textarea{min-height:56px;padding:10px 10px;font-size:16px;}
  .lb-composer .lb-compose-toolbar{gap:4px;padding:2px 2px 3px;}
  .lb-compose-hint{display:none;}
  .lb-compose-count{margin-right:3px;font-size:10px;}
  .lb-chat-workspace .lb-thread-guidance{padding:3px 12px 12px;font-size:10px;}
}
@media(prefers-contrast:more){
  .lb-composer,.lb-chat-workspace .chat-rooms,.lb-chat-workspace .chat-main{border:2px solid #d7ffdc!important;}
  .lb-compose-hint,.lb-compose-count,.lb-thread-guidance{color:#e0f1e5;}
}
@media(prefers-reduced-motion:reduce){
  .lb-composer,.lb-chat-workspace .conversation-item{transition:none!important;}
}


/* Task 9 — Home composer and feed controls: icon-first without overflow. */
.update-composer { min-width:0; overflow:visible; }
.home-update-form { width:100%; min-width:0; display:flex; flex-direction:column; align-items:stretch; gap:11px; }
.home-update-form #home-update { flex:1 1 auto; width:100%; min-width:0; max-width:100%; min-height:88px; resize:vertical; }
.home-update-form .home-update-toolbar { width:100%; min-width:0; display:flex; flex-wrap:nowrap; align-items:center; gap:8px; }
.home-update-form .home-file-picker,
.home-update-form .home-icon-action,
.home-feed-actions .home-feed-icon {
  flex:0 0 46px; display:grid; place-items:center; width:46px; min-width:46px;
  height:46px; min-height:46px; max-width:46px; padding:0;
  border:1px solid var(--lb-outline,var(--line)); border-radius:14px;
  color:var(--text); background:rgba(255,255,255,.055);
  cursor:pointer; touch-action:manipulation; line-height:1;
  transition:background .18s ease, border-color .18s ease;
}
.home-update-form .home-file-picker .icon,
.home-update-form .home-icon-action .icon,
.home-feed-actions .home-feed-icon .icon { width:21px; height:21px; }
.home-update-form .home-file-picker:hover,
.home-update-form .home-icon-action:hover,
.home-feed-actions .home-feed-icon:hover { border-color:rgba(153,228,174,.54); background:rgba(118,213,151,.13); }
.home-update-form .home-file-picker:focus-visible { outline:3px solid #d8f39b; outline-offset:2px; }
.home-update-form .home-publish { background:linear-gradient(115deg,#9cedaa,#5abb82); color:#10361f; border-color:transparent; margin-left:auto; }
.home-update-form .home-publish:hover { background:#afeebd; }
.home-update-form .home-file-status { flex:1 1 auto; min-width:0; max-width:100%; overflow:hidden; white-space:nowrap;
  text-overflow:ellipsis; font-size:12px; line-height:1.3; color:var(--muted); }
.home-update-form .home-file-status[hidden],
.home-update-form .home-clear-file[hidden] { display:none!important; }
.home-update-form .home-clear-file { color:#f4c0bc; }
.home-feed-actions { gap:7px; min-width:0; flex-wrap:wrap; }
.home-feed-actions .home-feed-icon { flex-basis:44px; width:44px; min-width:44px; max-width:44px; min-height:44px; height:44px; }
.home-feed-actions .home-feed-icon.destructive { color:#ffc1b8; }
.home-update-form .home-file-input { position:absolute!important; width:1px!important; height:1px!important; flex:none!important; }
@media(max-width:600px) {
  .home-update-form #home-update { font-size:16px; }
  .home-update-form .home-update-toolbar { gap:7px; }
  .home-update-form .home-file-picker,.home-update-form .home-icon-action { flex-basis:44px; width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; }
  .home-update-form .home-file-status { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .home-update-form .home-file-picker,.home-update-form .home-icon-action,.home-feed-actions .home-feed-icon { transition:none; }
}
@media(prefers-contrast:more) {
  .home-update-form .home-file-picker,.home-update-form .home-icon-action,.home-feed-actions .home-feed-icon { border:2px solid #d9ffe2; }
}

/* Additional TASK-002: independently scrollable, keyboard-reachable Assistant settings. */
.ai-settings-drawer{min-height:0;max-height:min(850px,calc(100dvh - 110px));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;scroll-padding-top:16px;-webkit-overflow-scrolling:touch}
.ai-settings-drawer:focus{outline:none}
.ai-settings-drawer:focus-visible{outline:2px solid var(--accent,#76c89d);outline-offset:2px}
.ai-settings-drawer .field,.ai-settings-drawer .ai-settings-memories{flex-shrink:0}
@media(max-width:1150px){.ai-settings-open .ai-settings-drawer{max-height:min(760px,calc(100dvh - 120px));grid-column:2}}
@media(max-width:760px){.ai-settings-open .ai-settings-drawer{grid-column:auto;max-height:min(720px,calc(100dvh - 105px));scroll-margin-top:14px}}
@media(max-height:450px){.ai-settings-drawer,.ai-settings-open .ai-settings-drawer{max-height:calc(100dvh - 48px)}}

/* TASK-003: consistent member and assistant avatars, with initials fallback. */
.status-post > .avatar,.lb-ai-message > .avatar,.lb-ai-message > .ai-model-avatar { flex-shrink:0; align-self:flex-start; }
.lb-ai-message > .ai-model-avatar { width:36px; height:36px; border-radius:12px; display:grid; place-items:center; }
@media(max-width:640px){.status-post > .avatar,.lb-ai-message > .avatar {width:36px;height:36px;border-radius:12px;}}

/* Public member profile cards (Additional TASK-004) */
.member-avatar-trigger{appearance:none;border:0;background:transparent;padding:0;display:inline-flex;flex:none;cursor:pointer;border-radius:50%;align-self:flex-start;color:inherit}
.member-avatar-trigger:focus-visible{outline:3px solid var(--accent,#43b77c);outline-offset:3px}
.member-avatar-trigger>.avatar{pointer-events:none}
.member-profile-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(7,18,15,.72);display:grid;place-items:center;padding:16px;overflow-y:auto}
.member-profile-card{position:relative;width:min(100%,440px);max-height:min(92dvh,780px);overflow-y:auto;padding:0!important;border-radius:22px;box-shadow:0 22px 80px rgba(0,0,0,.32)}
.member-profile-close{position:absolute;z-index:2;right:12px;top:12px;min-width:44px;min-height:44px}
.member-profile-cover{height:145px;background:linear-gradient(135deg,#153d32,#276b58);overflow:hidden}
.member-profile-cover img{width:100%;height:100%;object-fit:cover}
.member-profile-content{padding:0 24px 24px;overflow-wrap:anywhere}
.member-profile-content>.avatar{width:84px;height:84px;margin-top:-42px;position:relative;border:4px solid var(--surface,#172a22)}
.member-profile-content h2{margin:12px 0 8px}
.member-profile-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:20px}
.member-profile-bio{white-space:pre-wrap;line-height:1.6}
@media(max-width:480px){.member-profile-card{max-height:90dvh}.member-profile-content{padding:0 18px 22px}}
@media(prefers-reduced-motion:reduce){.member-profile-backdrop *{scroll-behavior:auto!important}}
/* Owner telemetry: readable on narrow screens and keyboard-accessible. */
.owner-telemetry .grid{margin:16px 0}.owner-telemetry .grid .card{min-width:0;padding:14px}.owner-telemetry-chart{display:flex;align-items:end;gap:12px;overflow-x:auto;min-height:175px;padding:12px 4px 16px}.owner-telemetry-month{display:flex;flex:0 0 92px;flex-direction:column;align-items:center;gap:5px;text-align:center;font-size:12px}.owner-telemetry-bar{width:44px;border-radius:6px 6px 0 0}.owner-telemetry-month strong{font-size:12px}.owner-telemetry form label{display:flex;flex-direction:column;gap:6px;min-width:0}.owner-telemetry .table-scroll{max-width:100%;overflow:auto}@media(max-width:650px){.owner-telemetry .grid{grid-template-columns:1fr 1fr}.owner-telemetry form.grid{grid-template-columns:1fr}}

/* Task 010: responsive, keyboard-accessible presence directory. */
.online-members-control{position:relative;flex-shrink:0}
.online-members-toggle{white-space:nowrap;display:inline-flex;align-items:center;gap:7px}
.online-members-panel{position:absolute;right:0;top:calc(100% + 10px);z-index:110;width:min(340px,calc(100vw - 28px));max-height:min(65vh,480px);display:flex;flex-direction:column;box-shadow:0 12px 32px #0002}
.online-members-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.online-members-list{overflow-y:auto;overscroll-behavior:contain;min-height:0}
.online-member-row{display:flex;align-items:center;text-align:left;gap:12px;width:100%;padding:9px;border:0;border-radius:12px;background:transparent;color:inherit;cursor:pointer}
.online-member-row:hover,.online-member-row:focus-visible{background:var(--surface-hover,#e7f2eb);outline-offset:-2px}
.online-member-row .avatar{flex-shrink:0}.online-member-row span{min-width:0}.online-member-row strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-member-row small{display:block;opacity:.75}
@media(max-width:600px){.online-members-panel{position:fixed;top:64px;right:12px;left:12px;width:auto;max-height:65dvh}.online-members-toggle{padding:7px 9px;font-size:12px}}

/* Audit polish: maintain readable feedback and consistent tactile affordances. */
:root { --surface-hover:#244635; --interactive-line:rgba(157,231,180,.26); }
.online-member-row:hover,.online-member-row:focus-visible { color:var(--text);background:var(--surface-hover); }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .quick-item,.home-feed-actions .home-feed-icon,.home-update-form .home-icon-action,.ai-tool {
    transition:background-color .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease;
  }
  .quick-item:hover {transform:translateY(-2px);border-color:var(--interactive-line);box-shadow:0 9px 24px rgba(0,0,0,.14);}
  .home-feed-actions .home-feed-icon:hover,.home-update-form .home-icon-action:hover {transform:translateY(-1px);}
}
@media (max-width:600px) {
  .card { border-radius:20px; }
  .online-member-row { min-height:48px;touch-action:manipulation; }
}
@media (prefers-reduced-motion:reduce) {
  .quick-item,.home-feed-actions .home-feed-icon,.home-update-form .home-icon-action,.ai-tool {transition:none!important;transform:none!important;}
}

/* Accessible Assistant attachment menu above the mobile composer. */
.ai-attachment-control{position:relative;flex:0 0 auto;min-width:44px}
.ai-attachment-menu{position:absolute;left:0;bottom:calc(100% + 10px);z-index:55;
  width:min(240px,calc(100vw - 42px));padding:7px;border-radius:16px;
  background:var(--card,#1b3428);border:1px solid rgba(169,225,186,.28);
  box-shadow:0 12px 38px rgba(0,0,0,.36)}
.ai-attachment-menu[hidden]{display:none!important}
.ai-attachment-menu button{width:100%;min-height:44px;display:flex;align-items:center;gap:12px;
  border:0;border-radius:11px;padding:9px 12px;background:transparent;color:var(--text,#fff);
  text-align:left;font:inherit;cursor:pointer}
.ai-attachment-menu button:hover,.ai-attachment-menu button:focus-visible{background:rgba(140,215,163,.14)}
.ai-attachment-menu button:focus-visible{outline:2px solid #a1eec0}
.ai-attachment-menu button .icon{width:18px;height:18px;flex:none}
.ai-attachment-menu button small{margin-left:auto;font-size:10px;opacity:.75;max-width:95px}
.owner-management-summary{padding:14px 16px;border:1px solid rgba(151,210,169,.2);border-radius:16px;margin-bottom:14px}
.owner-management-summary .spread{gap:12px;flex-wrap:wrap}
