/* MECH AI 1.0.11 — consolidated MOBILE presentation only.
   Desktop layout and account / chat / API logic remain unchanged. */
.msg-usage{display:block;max-width:100%;margin-top:6px;color:#8fa5be;font-size:11px;line-height:1.5}
.msg-usage summary{display:inline-flex;gap:5px;align-items:center;cursor:pointer;list-style:none;padding:4px 0;color:#8299b6;user-select:none}
.msg-usage summary::-webkit-details-marker{display:none}
.msg-usage summary::before{content:'ⓘ';font-size:12px}
.msg-usage[open]{overflow-wrap:anywhere}
.msg-usage-detail{padding:7px 9px;border:1px solid #2b405c;border-radius:9px;background:#101d2e;color:#a9bfd7}
@media(max-width:800px){
  html,body{width:100%;overflow:hidden;overscroll-behavior:none}
  .app-shell{height:100dvh;max-height:100dvh;min-height:0}
  .workspace{min-height:0;height:100%;flex:1 1 0}
  .topbar{height:calc(62px + env(safe-area-inset-top,0px));min-height:calc(62px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 10px 0;gap:7px;isolation:isolate;z-index:10}
  .topbar>.menu-button{display:grid;place-items:center;flex:0 0 36px;height:40px;font-size:19px}
  .topbar>.mobile-brand{font-size:15px;letter-spacing:-.04em}
  .topbar>.model-combobox{flex:1 1 0;min-width:75px;width:0;max-width:240px}
  .model-dropdown-button{height:39px;border-radius:12px;gap:6px;padding:0 8px}
  .model-dropdown-button span:nth-child(2){font-size:12px!important;min-width:0}
  .model-chevron{font-size:16px}
  .model-dropdown-panel{position:absolute;top:53px;left:0;right:auto;z-index:75;max-height:min(62dvh,450px);overflow:hidden;background:#101c2d;border-color:#35557c}
  .model-options{max-height:min(50dvh,344px)}
  .model-option{min-height:43px;display:flex;align-items:center;color:#d7e7f8}
  .topbar>.settings{display:grid;place-items:center;flex:0 0 36px;width:36px;height:40px;font-size:22px}
  .conversation{min-width:0;flex:1 1 0;min-height:0;padding:15px 14px 22px;overscroll-behavior-y:contain}
  #messages{width:100%;max-width:100%}
  .empty{width:100%;max-width:100%;min-height:100%;gap:6px;padding:14px 0 20px}
  .empty-orb{width:58px;height:58px;border-radius:18px;font-size:29px}
  .empty h1{font-size:clamp(22px,6vw,29px);line-height:1.2;margin:9px 0}
  .empty p{font-size:13px;line-height:1.55;max-width:330px;margin:6px auto}
  .empty .eyebrow{font-size:10px!important}
  .suggestions{gap:8px;margin-top:16px}
  .suggestion{padding:9px 12px;min-height:39px;font-size:12px;border-radius:11px}
  .recent-quick{margin-top:20px}
  .recent-quick-list{gap:6px}
  .recent-quick-item{min-width:0;padding:10px 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .message{gap:8px;margin-bottom:22px;align-items:flex-start}
  .message .avatar{width:26px;height:26px;flex:none;border-radius:9px;font-size:13px}
  .message.user .content-wrap{max-width:88%}
  .message .content-wrap{min-width:0}
  .bubble{font-size:14px;line-height:1.62;overflow-wrap:anywhere}
  .bubble img,.generated-image{display:block;max-width:100%;max-height:65dvh;width:auto;height:auto;object-fit:contain}
  .bubble pre,.bubble .table-wrap{max-width:calc(100vw - 55px);-webkit-overflow-scrolling:touch}
  .message.user .bubble{padding:10px 13px;border-radius:16px 16px 5px 16px}
  .msg-actions,.file-actions,.image-actions{gap:5px;margin-top:7px}
  .action-icon,.msg-tool,.media-download{min-width:34px;min-height:35px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;padding:7px 9px}
  .msg-usage{font-size:11px}
  .composer-area{flex:0 0 auto;padding:8px 10px calc(11px + env(safe-area-inset-bottom,0px));background:linear-gradient(0deg,#080d16 79%,#080d1600)}
  .composer{width:100%;max-width:100%;border-radius:19px;padding:9px 10px 10px;min-width:0;overflow:hidden;background:#162236}
  .composer textarea{min-height:38px;max-height:min(30dvh,180px);font-size:16px;line-height:1.45}
  .composer-tools{min-height:42px;padding-top:7px;gap:7px}
  .composer-action{height:40px;width:40px;min-width:40px;border-radius:12px;font-size:21px}
  .send{width:43px;height:43px;flex:none;border-radius:13px;font-size:19px}
  #attachmentStatus{max-height:150px;max-width:100%;min-width:0;overflow-y:auto;overflow-x:hidden}
  #attachmentStatus .attachment-preview,#attachmentPreview>img{width:42px!important;height:42px!important;max-width:42px!important;max-height:42px!important}
  #attachmentStatus .attachment-heading{min-width:0}
  #attachmentStatus .attachment-details{min-width:0;max-width:calc(100% - 88px)}
  .sidebar{width:min(83vw,315px);max-width:calc(100vw - 44px);height:100dvh;max-height:100dvh;padding-top:calc(12px + env(safe-area-inset-top,0px));padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:70}
  .sidebar-brand{padding:0 4px 15px}
  .sidebar-brand strong{font-size:22px}
  .new-chat-button{min-height:49px}
  .chat-list{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .mobile-sidebar-close{width:43px;height:43px;min-width:43px}
  .backdrop:not([hidden]){display:block;z-index:60}
  .toast-feedback{width:max-content;max-width:calc(100% - 28px);bottom:calc(112px + env(safe-area-inset-bottom,0px));text-align:center;white-space:normal}
  .voice-overlay{padding:calc(22px + env(safe-area-inset-top,0px)) 16px calc(20px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:700px){
  .modal-wrap{inset:0;padding:0;overflow:hidden}
  .settings-modal{height:100dvh;max-height:100dvh;min-height:0;width:100vw;max-width:100vw;border:0;border-radius:0}
  .settings-header{box-sizing:border-box;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:13px;align-items:center;flex:0 0 auto;height:auto;min-height:calc(65px + env(safe-area-inset-top,0px));padding:calc(8px + env(safe-area-inset-top,0px)) 15px 12px;overflow:visible}
  .settings-header>.mobile-settings-back{display:grid;place-items:center;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:0;margin:0;flex:none;font-size:25px}
  .settings-header>.mobile-settings-back span{display:none}
  .settings-header>div{min-width:0;flex:none;overflow:hidden}
  .settings-header>div p{display:none}
  .settings-header>div h2{font-size:20px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
  .settings-header>#closeAccount{display:grid;place-items:center;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:0;flex:none}
  .settings-layout{flex:1 1 0;min-height:0;overflow:hidden}
  .settings-nav{padding:19px 15px calc(20px + env(safe-area-inset-bottom,0px));gap:7px;overscroll-behavior:contain}
  .settings-nav-item{min-height:51px;border-radius:13px;padding:11px 14px;line-height:1.35}
  .settings-nav-item:focus-visible{outline-offset:-2px}
  .settings-content{flex:1 1 0;min-height:0;height:auto;padding:16px 16px calc(24px + env(safe-area-inset-bottom,0px));overscroll-behavior:contain}
  .mobile-settings-sections{min-height:42px;margin-bottom:16px}
  .settings-page>h3{font-size:21px;line-height:1.25}
  .settings-lead{font-size:13px;line-height:1.5}
  .theme-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .theme-card{min-height:67px;font-size:12px;padding:7px 4px}
  .settings-info-card,.connected-account-card,.balance-card{margin-top:14px}
  .key-row{min-width:0}
  .key-row button{flex:none}
  .account-row{flex-wrap:wrap}
  .remember-row{gap:9px;min-height:44px}
  .settings-page input[type="text"],.settings-page input[type="password"],.settings-select{font-size:16px}
}
@media(max-width:360px){
  .topbar{gap:5px;padding-left:6px;padding-right:6px}
  .topbar>.mobile-brand{font-size:13px}
  .topbar>.menu-button,.topbar>.settings{flex-basis:32px;width:32px}
  .model-dropdown-button{gap:4px;padding:0 5px}
  .model-mark{display:none}
  .model-dropdown-button span:nth-child(2){font-size:11px!important}
  .conversation{padding-left:10px;padding-right:10px}
}
/* Balance lives in the settings section on narrow phones, where the full number can be read. */
@media(max-width:390px){.topbar>.balance-pill{display:none}}
@media(max-height:630px) and (max-width:800px){
  .empty-orb{width:45px;height:45px;border-radius:14px;font-size:24px}
  .empty{padding:5px 0}
  .empty h1{margin:4px 0}
  .empty p{margin:3px 0}
  .suggestions{margin-top:8px}
}
:root[data-theme="light"] .msg-usage-detail{background:#ecf3fc;color:#34506d;border-color:#c8d8ea}
:root[data-theme="light"] .msg-usage summary{color:#536f90}
@media(max-width:800px){
  :root[data-theme="light"] .composer{background:#fff;color:#172235}
  :root[data-theme="light"] .composer-area{background:linear-gradient(0deg,#f5f8fc 79%,#f5f8fc00)}
  :root[data-theme="light"] .settings-nav{background:#f7faff}
  :root[data-theme="light"] .settings-nav-item{background:#fff;color:#172235;border-color:#d5e0ed}
  :root[data-theme="light"] .settings-nav-item.active{background:#dceaff;color:#174786}
}

/* v1.0.12: iPhone model list is portaled to BODY, outside topbar backdrop-filter's
   fixed-position containing block. Keep it inside the actual viewport. */
.model-mobile-scrim[hidden],.model-dropdown-panel[hidden]{display:none!important}
.model-mobile-scrim{display:none}
body>.model-dropdown-panel.mobile-model-portal{position:fixed!important;z-index:9991!important;box-sizing:border-box;min-width:0!important;max-width:calc(100vw - 24px)!important}
@media(max-width:800px){
  .model-mobile-scrim:not([hidden]){display:block;position:fixed;inset:0;z-index:9990;width:100vw;height:100dvh;padding:0;margin:0;border:0;background:rgba(3,8,16,.58);touch-action:manipulation}
  body>.model-dropdown-panel.mobile-model-portal{
    position:fixed!important;left:12px!important;right:12px!important;
    width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;
    min-width:0!important;z-index:9991!important;
    padding:10px!important;overflow:hidden!important;
    box-sizing:border-box;border-radius:14px;
    -webkit-transform:none!important;transform:none!important;
  }
  body>.model-dropdown-panel.mobile-model-portal .model-search-wrap{width:100%;min-width:0;max-width:100%}
  body>.model-dropdown-panel.mobile-model-portal .model-search-wrap input{min-width:0;max-width:100%;font-size:16px}
  body>.model-dropdown-panel.mobile-model-portal .model-options{overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  body>.model-dropdown-panel.mobile-model-portal .model-option{box-sizing:border-box;width:100%;max-width:100%;min-height:44px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
/* Full balance remains in Settings > Balance; don't sacrifice the menu/model
   hit targets to display a clipped 8-digit figure on a phone. */
@media(max-width:700px){.topbar>.balance-pill{display:none!important}}
