/* Leaf Box v1.6 — mobile-first design layer.
 * Deliberately loaded after the legacy stylesheet: one place for mobile overrides.
 * Preserve existing route names, permissions and interactive semantics.
 */
:root{
  --lb-phone-gap:clamp(12px,3.5vw,20px);
  --lb-dock-height:72px;
  --lb-motion-spring:cubic-bezier(.22,1,.36,1);
  --lb-elevation-soft:0 14px 36px rgba(0,8,5,.21);
  --lb-glass-outline:rgba(179,241,198,.17);
}
:where(button,a,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation}
:where(img,video,canvas,svg){max-width:100%}
:where(.card,.grid,.form-row,.spread,.main,.content,.panel-content,.panel-results,.panel-layout,.page-heading,.lb-chat-workspace,.chat-main,.assistant-layout){min-width:0}
:where(.card,.panel-content,.content,.chat-main,.page-heading){overflow-wrap:anywhere}
:where(.card,.glass,.btn,.input,.mobile-nav,.mobile-more-sheet){backface-visibility:hidden}
:where([data-motion-reveal]){will-change:auto}
/* More legible controls at actual phone sizes. */
:where(.input,select.input,textarea.input){font-size:16px}
:where(.btn,.ai-tool,.home-icon-action,.upload-btn,.mobile-more-sheet .more-link){min-height:44px}
:where(.btn,.quick-item,.conversation-item,.mobile-nav a,.mobile-nav button){transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .25s var(--lb-motion-spring)}
:where(.btn,.quick-item,.conversation-item,.mobile-nav a,.mobile-nav button):active:not(:disabled){transform:scale(.977)}
:where(.card,.chat-main,.ai-conversation){contain:style}
/* Input content should never force a containing grid past the viewport. */
:where(input,select,textarea,button){max-width:100%}
:where(.page-heading>*,.spread>*,.room-entry>*,.form-row>*,.card>*,.panel-content>*){min-width:0}
:where(.panel-nav,.chat-room-list,.table-scroll){scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.mobile-drawer-backdrop{display:none}
.mobile-drawer[role="dialog"],.mobile-more-sheet[role="dialog"]{outline:none}
.mobile-drawer-handle,.mobile-more-handle{display:none}

@media (max-width:800px){
  html{scroll-padding-top:75px}
  body{background:radial-gradient(ellipse 85% 300px at 12% -65px,rgba(62,144,89,.22),transparent 76%),#091b14;overflow-x:clip}
  .app-shell{display:block;width:100%;min-height:100dvh;overflow:clip}
  .main{width:100%;min-width:0}
  .sidebar{display:none!important}
  .topbar{
    position:sticky;top:0;z-index:45;min-height:68px;gap:10px;
    padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));
    background:rgba(10,28,20,.92);backdrop-filter:blur(18px) saturate(1.2);
    -webkit-backdrop-filter:blur(18px) saturate(1.2);border-bottom:1px solid rgba(177,228,184,.13)
  }
  .topbar .heading{min-width:0;flex:1;font-size:clamp(17px,4.7vw,21px);line-height:1.16;letter-spacing:-.035em;overflow-wrap:anywhere}
  .topbar .heading small{margin-top:4px;font-size:10px;font-weight:550;color:#a8cbb1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .menu-button{display:inline-flex;min-width:44px;min-height:44px;border-radius:15px;color:#ceebd7}
  .top-right{gap:7px;flex:0 0 auto}
  .top-right>.tag,.top-right>.upgrade{display:none!important}
  .top-right>.btn.icon-btn{min-width:44px;min-height:44px;border-radius:15px;background:#254a36a6;border-color:#b7f6c024}
  .online-members-toggle{min-width:44px;min-height:44px}
  .content{
    width:100%;max-width:100%;margin:0;
    padding:22px max(var(--lb-phone-gap),env(safe-area-inset-right))
      calc(var(--lb-dock-height) + 56px + env(safe-area-inset-bottom))
      max(var(--lb-phone-gap),env(safe-area-inset-left));
    animation:none!important
  }
  .page-heading{display:grid;grid-template-columns:minmax(0,1fr);gap:11px;margin:0 0 19px;align-items:start}
  .page-heading .eyebrow{letter-spacing:.12em;font-size:10px}
  .page-heading h1{font-size:clamp(25px,7.1vw,34px);line-height:1.12;letter-spacing:-.052em;margin:6px 0 7px}
  .page-heading p{font-size:13px;line-height:1.55;max-width:54ch}
  .page-heading>button,.page-heading>.btn{justify-self:start;min-height:44px}
  .page-heading>.tag{justify-self:start;max-width:100%}
  .card{border-radius:21px;padding:clamp(15px,4.3vw,22px);background:linear-gradient(147deg,rgba(35,69,51,.84),rgba(15,40,29,.87));border-color:var(--lb-glass-outline);box-shadow:var(--lb-elevation-soft)}
  .glass{backdrop-filter:blur(16px) saturate(1.18);-webkit-backdrop-filter:blur(16px) saturate(1.18)}
  .grid{gap:11px}
  .grid.two,.grid.three{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
  .grid.three>.card:first-child{grid-column:1/-1}
  .stat{padding:16px;align-items:flex-start;gap:11px;flex-wrap:wrap}
  .stat .stat-icon{width:43px;height:43px;flex-shrink:0;border-radius:14px}
  .stat strong{font-size:clamp(20px,5.8vw,27px);overflow-wrap:anywhere}
  .stat small{display:block;line-height:1.5;margin-top:2px}
  .section-title{font-size:17px;margin:26px 0 13px;letter-spacing:-.04em}
  .quick-item{min-height:58px;border-radius:17px;padding:13px;background:linear-gradient(145deg,rgba(50,86,64,.55),rgba(23,50,36,.65));border-color:rgba(169,235,186,.14)}
  .quick-item>span{min-width:0;font-size:12px;line-height:1.45}
  .quick-item .icon{width:21px;height:21px}
  .welcome{min-height:190px;border-radius:23px;position:relative;isolation:isolate;gap:0;padding:21px;box-shadow:0 24px 55px rgba(2,18,9,.2)}
  .welcome>div{position:relative;z-index:1;max-width:80%}
  .welcome h2{font-size:clamp(23px,6vw,33px);line-height:1.15}
  .welcome p{font-size:12px;line-height:1.55}
  .welcome img{position:absolute;right:-24px;bottom:4px;width:clamp(115px,32vw,165px);height:auto;opacity:.65;z-index:0;pointer-events:none}
  .tools,.form-row{max-width:100%}
  .tools{gap:11px;flex-wrap:wrap}
  .tools .input{width:100%}
  .form-row{grid-template-columns:minmax(0,1fr)!important}
  .room-entry{flex-wrap:wrap;gap:10px}
  .room-entry .btn{flex:0 1 auto}
  .panel-layout{display:grid;grid-template-columns:minmax(0,1fr)!important;gap:13px}
  .panel-nav{position:relative;top:auto;display:flex;gap:7px;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding:9px!important;border-radius:17px}
  .panel-link{flex:0 0 auto;scroll-snap-align:start;white-space:nowrap;min-height:45px;padding:10px 13px}
  .panel-content,.panel-results{min-width:0;width:100%;max-width:100%}
  .panel-results .owner-table{min-width:575px}
  .table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
  .mobile-nav{
    display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;justify-content:initial;
    position:fixed;z-index:80;left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));
    bottom:calc(10px + env(safe-area-inset-bottom));min-height:var(--lb-dock-height);
    padding:6px;gap:3px;border-radius:24px;
    background:linear-gradient(145deg,rgba(29,63,45,.96),rgba(14,40,28,.97));
    border:1px solid rgba(177,242,189,.22);box-shadow:0 12px 32px rgba(0,12,7,.45),inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)
  }
  .mobile-nav a,.mobile-nav .more-tab{
    display:flex!important;min-width:0;min-height:60px;width:100%!important;align-items:center;justify-content:center;
    flex-direction:column;gap:4px;white-space:nowrap;padding:8px 2px!important;
    border-radius:18px!important;color:#aacabb;background:transparent;border:1px solid transparent;
    text-decoration:none;position:relative;font-size:10px!important;font-weight:700;line-height:1.1
  }
  .mobile-nav a>.icon,.mobile-nav button>.icon{width:22px;height:22px;stroke-width:1.8;transition:transform .23s var(--lb-motion-spring)}
  .mobile-nav a.active,.mobile-nav .more-tab.active{color:#d7ffe0;background:linear-gradient(145deg,rgba(100,192,127,.22),rgba(55,125,80,.24));border-color:rgba(162,237,179,.19);box-shadow:inset 0 1px 0 rgba(207,255,210,.13)}
  .mobile-nav a.active::before,.mobile-nav .more-tab.active::before{content:"";position:absolute;top:3px;left:31%;right:31%;height:2px;background:#b4f9bc;border-radius:8px}
  .mobile-nav a.active>.icon,.mobile-nav .more-tab.active>.icon{transform:translateY(-1px)}
  .mobile-nav :is(a,button):focus-visible{outline:3px solid #d8ffbd;outline-offset:2px}
  .mobile-more-backdrop,.mobile-drawer-backdrop{display:block;position:fixed;inset:0;background:rgba(2,9,6,.64);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);border:0;z-index:84}
  .mobile-more-sheet{
    display:block;position:fixed;z-index:86;
    left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));
    bottom:calc(var(--lb-dock-height) + 22px + env(safe-area-inset-bottom));
    max-height:min(69dvh,600px);padding:12px 14px 17px;border-radius:25px;
    overflow-y:auto;overscroll-behavior:contain;background:linear-gradient(153deg,#224c35,#10291d);
    border:1px solid rgba(175,239,184,.29);box-shadow:0 28px 65px rgba(0,0,0,.5)
  }
  .mobile-more-handle{display:block;width:39px;height:4px;border-radius:10px;background:rgba(225,255,232,.34);margin:1px auto 12px}
  .mobile-more-heading{padding:0 3px 9px;margin-bottom:9px}
  .mobile-more-heading strong{font-size:19px;letter-spacing:-.04em}
  .mobile-more-sheet nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .mobile-more-sheet .more-link{display:flex;align-items:center;gap:10px;min-height:58px;padding:12px;border-radius:16px;font-weight:700;font-size:12px;background:rgba(236,255,239,.052);border-color:rgba(170,227,183,.13)}
  .mobile-more-sheet .more-link .icon{width:20px;height:20px;color:#a5e5b8}
  .mobile-more-sheet .more-link.active{background:rgba(122,211,152,.2);border-color:rgba(170,238,184,.5)}
  .mobile-drawer-backdrop{z-index:88}
  .mobile-drawer{
    display:flex;flex-direction:column;position:fixed;z-index:90;top:0;bottom:0;left:0!important;right:auto!important;
    width:min(335px,87vw);max-width:100%;padding:max(18px,env(safe-area-inset-top)) 15px calc(24px + env(safe-area-inset-bottom));
    border-right:1px solid rgba(172,233,185,.22);border-left:0;background:linear-gradient(160deg,#214632,#0b2017);
    overflow-y:auto;overscroll-behavior:contain;box-shadow:20px 0 70px rgba(0,0,0,.4)
  }
  .mobile-drawer .logo{padding:0 10px 15px}
  .mobile-drawer>.btn{margin-bottom:12px}
  .mobile-drawer .nav-link{min-height:48px}
  .mobile-drawer .nav-label{padding-top:14px}
  .mobile-drawer-handle{display:block;align-self:center;width:40px;height:4px;background:rgba(226,255,232,.28);border-radius:8px;margin-bottom:16px}
  /* Floating buttons and overlays must remain clear of the bottom dock. */
  .lb-toast-stack{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));max-width:none;top:calc(12px + env(safe-area-inset-top));bottom:auto}
  .lb-toast,.lb-upload-toast{max-width:100%;width:100%}
  .device-setup-dialog{max-width:100%}
  .footer{padding-bottom:4px;font-size:11px}
  body.lb-overlay-open{overflow:hidden;overscroll-behavior:none}
  body.lb-overlay-open .mobile-nav{pointer-events:none;filter:brightness(.75)}
  body.lb-overlay-open .mobile-nav .more-tab{pointer-events:auto}
  body.lb-keyboard-open .mobile-nav{transform:translateY(calc(100% + 24px + env(safe-area-inset-bottom)));pointer-events:none;opacity:0}
  body.lb-keyboard-open .mobile-more-sheet{bottom:calc(8px + env(safe-area-inset-bottom))}
  /* Chat threads: one column, readable composer, no clipped message actions. */
  .lb-chat-workspace,.assistant-layout,.assistant-layout.ai-settings-open{grid-template-columns:minmax(0,1fr)!important;gap:12px}
  .lb-chat-workspace .chat-rooms{padding:14px!important;border-radius:20px;gap:6px}
  .lb-chat-workspace .chat-room-list{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;gap:8px;max-height:none;padding:4px 1px 10px}
  .lb-chat-workspace .chat-room-list .conversation-item{flex:0 0 min(72vw,230px);min-width:0;max-width:230px;scroll-snap-align:start;min-height:64px}
  .lb-chat-workspace .chat-main,.ai-conversation{min-height:0!important;max-width:100%;border-radius:21px}
  .lb-chat-workspace .chat-header{min-height:62px;padding:11px 13px}
  .lb-chat-workspace .lb-thread,.ai-conversation .lb-ai-thread{
    min-height:260px;max-height:clamp(280px,49dvh,590px);padding:13px 11px;overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch
  }
  .chat-message,.lb-chat-workspace .lb-thread-message,.ai-conversation .lb-ai-message{max-width:94%;min-width:0}
  .chat-message .bubble{min-width:0;max-width:100%}
  .chat-message .bubble p{font-size:13.5px;line-height:1.57}
  .message-actions.expanded{display:flex;flex-wrap:wrap;gap:5px}
  .message-actions.expanded button{min-height:44px}
  .lb-chat-workspace .lb-chat-composer,.ai-conversation .lb-ai-composer{width:auto;margin:9px 10px 10px;max-width:calc(100% - 20px)}
  .lb-composer .lb-compose-textarea,.ai-conversation .lb-ai-composer .lb-compose-textarea{font-size:16px;min-height:52px;line-height:1.45}
  .lb-composer .lb-compose-toolbar{flex-wrap:nowrap!important;gap:6px}
  .lb-compose-tools,.lb-compose-send{min-width:0}
  .lb-compose-count{font-size:10px}
  .lb-compose-send .ai-tool,.lb-compose-file{min-width:44px;min-height:44px}
  .ai-sidebar{border-radius:20px;padding:10px 12px!important}
  .ai-conversation .ai-messages{max-height:clamp(280px,48dvh,590px);min-height:260px}
  .ai-settings-drawer{max-height:min(68dvh,650px)!important;scrollbar-gutter:auto}
  .ai-settings-drawer .grid.two{grid-template-columns:minmax(0,1fr)}
  .ai-chat-top{gap:6px;flex-wrap:wrap}
  .ai-chat-top .ai-tool{width:44px;min-width:44px;min-height:44px}
  .auth-right{min-height:100dvh;padding:24px 16px calc(30px + env(safe-area-inset-bottom));place-items:center}
  .auth-mobile-logo{width:100%;margin:0 0 16px}
  .auth-panel{width:min(100%,500px);padding:clamp(20px,5vw,27px);border-radius:25px}
  .auth-panel h2{font-size:clamp(25px,7.5vw,31px)}
  .auth-panel .tabs button{min-height:47px}
}
@media(max-width:420px){
  .topbar{gap:7px;padding-inline:11px}
  .topbar .heading{font-size:clamp(16px,4.3vw,19px)}
  .topbar .heading small{font-size:9px}
  .online-members-toggle{padding:6px 8px}
  .content{padding-top:18px}
  .grid.three>.card:first-child{grid-column:1/-1}
  .stat{padding:13px}
  .welcome>div{max-width:85%}
  .welcome img{opacity:.43}
  .mobile-more-sheet nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mobile-nav{left:6px;right:6px;padding:5px;gap:1px;border-radius:21px}
  .mobile-nav a,.mobile-nav button{font-size:9px!important;padding:7px 1px!important}
  .mobile-nav .icon,.mobile-nav button .icon{width:20px;height:20px}
  .lb-compose-hint{display:none}
}
@media(max-width:335px){
  .mobile-more-sheet nav{grid-template-columns:minmax(0,1fr)}
  .grid.two,.grid.three{grid-template-columns:minmax(0,1fr)}
  .grid.three>.card:first-child{grid-column:auto}
  .stat{flex-direction:row}
  .mobile-nav a>span,.mobile-nav button>span{font-size:8px}
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .card:has(> .stat-icon):hover,.quick-item:hover{transform:translateY(-2px)}
}
@media(prefers-reduced-motion:reduce){
  .mobile-drawer,.mobile-more-sheet,.mobile-nav,.mobile-nav *,.card,.btn,.quick-item,.conversation-item{
    animation:none!important;transition:none!important;transform:none!important;scroll-behavior:auto!important
  }
}
@media(prefers-contrast:more){
  .mobile-nav,.mobile-more-sheet,.mobile-drawer,.card,.input{border-color:rgba(232,255,235,.65)!important}
  .mobile-nav a,.mobile-nav button,.page-heading p,.muted{color:#e0f3e6}
}
/* Owner and account surfaces have dense toolbars; keep actions legible and discoverable. */
@media(max-width:800px){
  .owner-ai-topline,.owner-ai-editor-actions,.owner-model-header,.owner-integration-header,.profile-settings-header{flex-wrap:wrap;align-items:flex-start;gap:10px}
  .owner-ai-model-row,.owner-ai-editor,.integration-settings,.owner-telemetry,.owner-telemetry-chart{max-width:100%;min-width:0}
  .owner-ai-model-row{padding:12px;border-radius:17px}
  .owner-ai-model-row .btn,.owner-ai-editor-actions .btn{min-height:44px}
  .owner-ai-editor-actions{display:flex;flex-wrap:wrap}
  .integration-settings form,.owner-ai-editor form{min-width:0;max-width:100%}
  .owner-telemetry-chart{overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:19px}
  .owner-telemetry-month{scroll-snap-align:start}
  .profile-cover{border-radius:18px;min-height:145px}
  .profile-avatar-edit{max-width:100%}
  .profile-content .grid.two,.account-layout{grid-template-columns:minmax(0,1fr)}
  .room-entry :is(.room-controls,.button-row){max-width:100%}
  :where(.lb-dialog,.member-profile-card){max-width:calc(100vw - 18px)}
}

@media(min-width:801px){.mobile-drawer,.mobile-more-sheet,.mobile-more-backdrop,.mobile-drawer-backdrop{display:none!important}}
@media(max-width:800px){
  .grid.three>.quick-item:last-child:nth-child(odd){grid-column:1/-1}
  .tag{max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .member-profile-card{max-height:min(90dvh,800px);overflow-y:auto}
}


/* v1.6.1 — category-specific records, accessible student-card panning, and scrollable Assistant. */
.panel-results>.subscription-section {min-width:0;overflow:visible;}
.subscription-section-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px;}
.subscription-section-heading h2 {font-size:clamp(20px,3.7vw,26px);margin:5px 0 7px;letter-spacing:-.035em;}
.subscription-section-heading p {margin:0;line-height:1.55;max-width:70ch;}
.subscription-section .table-scroll {position:relative;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;overscroll-behavior-x:contain;}
.subscription-section h3:not(:first-child) {margin-top:24px;}
.subscription-section .owner-table {width:max(100%,650px);min-width:650px;}
.lb-table-hint {margin:10px 0 0;}
/* .card:has(.owner-table) previously set overflow:hidden, overriding the student directory's horizontal scroll. */
.card.table-scroll.lb-student-directory:has(.owner-table),.panel-results .card.table-scroll.lb-student-directory {display:block;min-width:0;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;scrollbar-width:thin;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;}
.lb-student-directory .owner-table {width:max(100%,750px);min-width:750px!important;table-layout:auto;}
.lb-student-directory .owner-table :is(th,td){white-space:nowrap;}
.lb-student-directory .owner-table td:first-child{min-width:190px;max-width:280px;white-space:normal;overflow-wrap:anywhere;}
.lb-student-directory :is(.role-select,.btn){min-height:44px;}
.lb-student-directory:focus-visible,.table-scroll[tabindex="0"]:focus-visible{outline:3px solid #c6f5b5;outline-offset:2px;border-radius:12px;}
/* Keep the scrollable thread and composer in a stable flex column; never clip the Assistant on phones. */
.assistant-layout,.assistant-layout>.ai-conversation {min-width:0;}
.assistant-layout .ai-conversation {display:flex;flex-direction:column;min-height:0;max-height:none;}
.assistant-layout .ai-conversation .ai-messages {flex:1 1 auto;min-height:160px;max-height:none;overflow-x:hidden;overflow-y:auto!important;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;scrollbar-width:thin;}
.assistant-layout .ai-sidebar.open .ai-sidebar-content {max-height:min(62dvh,580px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.assistant-layout .ai-settings-drawer {overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;}
.lb-thread-message.is-selected>.bubble {position:relative;border-color:rgba(183,242,184,.6)!important;box-shadow:inset 0 0 0 1px rgba(173,251,202,.25),0 12px 26px rgba(0,0,0,.14);padding-top:52px!important;}
.lb-thread-message .bubble{position:relative;}
.lb-message-top-actions {position:absolute;top:7px;right:8px;display:flex;gap:6px;z-index:1;animation:lb-message-actions-in .16s ease-out both;}
.lb-message-top-actions button {display:grid;place-items:center;flex:0 0 44px;min-width:44px;min-height:44px;padding:9px;border:1px solid rgba(175,226,192,.35);border-radius:11px;background:rgba(30,74,51,.98);color:#e8fff1;cursor:pointer;touch-action:manipulation;}
.lb-message-top-actions button:hover,.lb-message-top-actions button:focus-visible{background:#3a7e52;border-color:#baf5c6;}
.lb-message-top-actions .lb-danger-icon{color:#ffc4bf;border-color:rgba(242,142,136,.34);}
.lb-message-top-actions button:disabled{opacity:.38;cursor:not-allowed;}
.lb-message-top-actions .icon{width:19px;height:19px;}
@keyframes lb-message-actions-in {from{opacity:0;transform:translateY(-5px) scale(.94);}to{opacity:1;transform:translateY(0) scale(1);}}
@media(min-width:801px){
  /* Keep desktop chat history independently scrollable, with the composer always visible. */
  .assistant-layout .ai-conversation{height:clamp(590px,calc(100dvh - 185px),900px);overflow:hidden;}
  .assistant-layout .ai-conversation .ai-messages{min-height:0!important;max-height:none!important;flex:1 1 0;}
  .assistant-layout .ai-conversation .ai-composer{flex:0 0 auto;}
}
@media(max-width:800px){
  .assistant-layout .ai-conversation {height:clamp(430px,calc(100dvh - 178px),790px);overflow:hidden;}
  .assistant-layout .ai-conversation .ai-messages {max-height:none!important;min-height:0!important;flex:1 1 0;padding-bottom:18px;}
  .assistant-layout .ai-conversation .ai-composer {flex:0 0 auto;}
  .assistant-layout .ai-conversation .ai-chat-footnote{flex-shrink:0;}
  .content:has(.assistant-layout){overflow:visible;}
  .panel-results .subscription-section{padding:14px;}
  .subscription-section .owner-table{min-width:650px;}
  .lb-student-directory{margin:0;}
  .panel-results:has(.lb-student-directory){overflow:visible;}
}
@media(max-width:420px){.assistant-layout .ai-conversation{height:max(405px,calc(100dvh - 180px));}}
@media(prefers-reduced-motion:reduce){.lb-message-top-actions{animation:none;}}

/* Chat composer stays reachable above the floating Android navigation dock,
   including display cutouts and browser/WebView safe areas. */
@media (max-width:800px){
  html{scroll-padding-bottom:calc(var(--lb-dock-height,72px) + 44px + env(safe-area-inset-bottom))}
  .content:has(.lb-chat-workspace){
    padding-bottom:calc(var(--lb-dock-height,72px) + 76px + env(safe-area-inset-bottom))!important;
  }
  .lb-chat-workspace .chat-main{
    box-sizing:border-box;min-width:0;
    padding-bottom:calc(20px + env(safe-area-inset-bottom))!important;
  }
  .lb-chat-workspace .lb-chat-composer{
    position:relative;z-index:2;flex:0 0 auto;
    scroll-margin-bottom:calc(var(--lb-dock-height,72px) + 36px + env(safe-area-inset-bottom));
    margin-bottom:12px!important;
  }
  .lb-chat-workspace .lb-compose-textarea{scroll-margin-bottom:calc(var(--lb-dock-height,72px) + 36px + env(safe-area-inset-bottom))}
}
