/* Voice Assistant – reference-matched mobile layout */
.ai-reference-page{max-width:760px;margin:0 auto;min-height:calc(100dvh - 170px);display:flex;flex-direction:column;align-items:center;padding:38px 6px 26px;position:relative}.ai-reference-page>h2{margin:0;color:#12254c;font-size:31px;line-height:1.08;font-weight:850;letter-spacing:-.04em;text-align:center}.ai-voice-stage{margin-top:62px;display:flex;flex-direction:column;align-items:center}.ai-orb{position:relative;width:164px;height:164px;border:0;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#75a0ff,#3f72ea);box-shadow:0 16px 38px rgba(66,112,225,.26),inset 0 1px 0 rgba(255,255,255,.5);color:#fff;z-index:1}.ai-orb::before,.ai-orb::after,.ai-orb-rings{content:"";position:absolute;inset:-22px;border-radius:50%;border:1px solid rgba(89,137,238,.15);box-shadow:0 0 0 14px rgba(87,135,238,.055),0 0 0 30px rgba(87,135,238,.03);pointer-events:none}.ai-orb::after{inset:-44px;border-color:rgba(89,137,238,.1);box-shadow:none}.ai-mic-icon{font-size:60px;line-height:1;filter:grayscale(1) brightness(0) invert(1)}.voice-label{margin-top:62px;color:#4b70b7;font-size:21px;font-weight:600}.ai-reference-log{width:100%;max-width:640px;min-height:0;max-height:220px;margin-top:22px;padding:0 2px;display:flex;flex-direction:column;gap:9px;overflow:auto}.ai-bubble{max-width:88%;padding:11px 14px;border-radius:16px;font-size:14px;line-height:1.5;box-shadow:0 6px 18px rgba(27,50,90,.07)}.ai-bubble.assistant,.ai-bubble.thinking{align-self:flex-start;background:#fff;border:1px solid #e4ebf4}.ai-bubble.assistant.success{border-color:#bee9d8;background:#f3fcf8}.ai-bubble.user{align-self:flex-end;background:#4777e9;color:#fff}.ai-bubble.error{color:#aa3434;background:#fff4f4;border:1px solid #f2d3d3}.ai-bubble.thinking{color:#75849b;font-style:italic}.ai-bubble.review{width:min(94%,520px);max-width:94%;padding:14px}.ai-review-title{font-weight:800;color:#173d8f;margin-bottom:9px}.ai-review-list{border:1px solid #e0e8f2;border-radius:13px;overflow:hidden}.ai-review-list>b{display:block;padding:9px 11px;background:#f3f7fd;color:#173d8f}.ai-review-list>div{display:flex;justify-content:space-between;gap:12px;padding:8px 10px;border-top:1px solid #e8eef5}.ai-review-list span{color:#6f7d93}.ai-review-list strong{text-align:right}.ai-review-actions{display:grid;grid-template-columns:1fr 1.35fr;gap:8px;margin-top:10px}.ai-saving{grid-column:1/-1;text-align:center;padding:8px;color:#63728b;font-weight:700}.ai-reference-composer{width:min(100%,640px);margin-top:42px;display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:8px;padding:8px 9px 8px 12px;background:rgba(255,255,255,.96);border:1px solid #e6ebf2;border-radius:999px;box-shadow:0 12px 30px rgba(31,62,112,.12)}.composer-mic{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#4d7ff0;box-shadow:0 4px 14px rgba(52,91,175,.12);font-size:19px}.ai-reference-composer input{min-width:0;width:100%;height:42px;border:0;outline:0;background:transparent;color:#162440;font-size:15px;padding:0 6px}.ai-reference-composer input::placeholder{color:#a2aabd}.ai-reference-composer button{height:44px;border:0;border-radius:999px;padding:0 22px;background:linear-gradient(145deg,#5b8bff,#3671ec);color:#fff;font-size:15px;font-weight:750;box-shadow:0 7px 18px rgba(59,112,236,.22)}.ai-orb.recording{background:linear-gradient(145deg,#f06670,#cf3242);animation:voicePulse 1.05s infinite}.ai-orb.recording::before{box-shadow:0 0 0 14px rgba(218,58,73,.07),0 0 0 30px rgba(218,58,73,.035)}@keyframes voicePulse{50%{transform:scale(.97)}}
@media(max-width:900px){.ai-reference-page{min-height:calc(100dvh - 135px);padding-top:30px}.ai-reference-page>h2{font-size:29px}.ai-voice-stage{margin-top:56px}.ai-orb{width:154px;height:154px}.voice-label{margin-top:58px}.ai-reference-composer{margin-top:38px}}
@media(max-width:600px){.ai-reference-page{min-height:calc(100dvh - 130px);padding:28px 2px 20px}.ai-reference-page>h2{font-size:27px}.ai-voice-stage{margin-top:52px}.ai-orb{width:142px;height:142px}.ai-mic-icon{font-size:54px}.voice-label{margin-top:54px;font-size:19px}.ai-reference-log{max-height:180px;margin-top:18px}.ai-reference-composer{margin-top:34px;grid-template-columns:38px 1fr auto;padding:7px 8px 7px 10px}.composer-mic{width:34px;height:34px;font-size:17px}.ai-reference-composer input{height:38px;font-size:14px}.ai-reference-composer button{height:40px;padding:0 18px;font-size:14px}.ai-bubble{max-width:94%;font-size:13px;padding:10px 12px}.ai-review-list>div{font-size:12px}}

/* Assistant page is viewport-locked: only the response log scrolls. */
html.mm-assistant-page,html.mm-assistant-page body{height:100%;overflow:hidden!important;overscroll-behavior:none}
html.mm-assistant-page #app,html.mm-assistant-page .layout{height:100dvh;min-height:0!important;overflow:hidden!important}
html.mm-assistant-page .main{height:100dvh;min-height:0!important;display:flex;flex-direction:column;overflow:hidden!important;padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
html.mm-assistant-page .topbar{flex:0 0 auto;margin-bottom:8px!important}
html.mm-assistant-page #content{flex:1 1 auto;min-height:0!important;overflow:hidden!important;display:flex}
html.mm-assistant-page .ai-reference-page{flex:1 1 auto;min-height:0!important;height:auto!important;width:100%;max-width:760px;padding:20px 8px 8px;overflow:hidden!important;display:grid;grid-template-rows:auto auto minmax(96px,1fr) auto;justify-items:center;align-items:start;row-gap:12px}
html.mm-assistant-page .ai-reference-page>h2{margin:0!important;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:40px;padding:7px 15px 7px 9px;border:1px solid rgba(66,108,194,.14);border-radius:999px;background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(241,246,255,.94));box-shadow:0 9px 24px rgba(34,68,123,.09),inset 0 1px 0 rgba(255,255,255,.96);color:#173566;font-size:16px;line-height:1;font-weight:820;letter-spacing:-.015em;text-align:center}
html.mm-assistant-page .ai-reference-page>h2::before{content:"AI";width:26px;height:26px;display:grid;place-items:center;flex:0 0 26px;border-radius:9px;background:linear-gradient(145deg,#6591f7,#3f72e7);color:#fff;font:900 8px/1 Inter,sans-serif;letter-spacing:.08em;box-shadow:0 5px 13px rgba(62,111,226,.22),inset 0 1px 0 rgba(255,255,255,.34)}
html.mm-assistant-page .ai-voice-stage{margin-top:42px}
html.mm-assistant-page .ai-orb{width:142px;height:142px}
html.mm-assistant-page .ai-orb::before,html.mm-assistant-page .ai-orb-rings{inset:-19px;box-shadow:0 0 0 13px rgba(87,135,238,.05),0 0 0 27px rgba(87,135,238,.028)}
html.mm-assistant-page .ai-orb::after{inset:-38px}
html.mm-assistant-page .ai-mic-icon{font-size:53px}
html.mm-assistant-page .voice-label{margin-top:46px;font-size:19px}
html.mm-assistant-page .ai-reference-log{align-self:stretch;width:min(100%,640px);max-width:640px;min-height:96px!important;max-height:none!important;height:auto!important;margin:8px auto 0;padding:2px 3px 8px;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
html.mm-assistant-page .ai-reference-composer{align-self:end;width:min(100%,640px);margin:0 auto 2px;grid-template-columns:44px minmax(0,1fr) auto;gap:8px;padding:7px 8px 7px 9px;border:1px solid rgba(214,224,238,.96);border-radius:22px;background:rgba(255,255,255,.98);box-shadow:0 12px 28px rgba(35,68,119,.10)}
html.mm-assistant-page .composer-mic{width:38px;height:38px;border-radius:13px;background:linear-gradient(145deg,#eef4ff,#e3ecff);box-shadow:none;color:#386fe3;font-size:18px}
html.mm-assistant-page .ai-reference-composer input{height:42px;font-size:14px;padding:0 5px}
html.mm-assistant-page .ai-reference-composer button{height:42px;min-width:76px;padding:0 18px;border-radius:15px;font-size:14px}
html[data-theme="dark"].mm-assistant-page .ai-reference-page>h2{border-color:#29445e;background:linear-gradient(145deg,rgba(20,42,62,.97),rgba(12,29,45,.96));color:#eef5ff;box-shadow:0 10px 26px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.05)}
html[data-theme="dark"].mm-assistant-page .ai-reference-page>h2::before{background:linear-gradient(145deg,#5e8df4,#396bdc);box-shadow:0 5px 13px rgba(29,77,174,.32)}
html[data-theme="dark"].mm-assistant-page .ai-reference-composer{background:rgba(13,29,45,.97);border-color:#29445e;box-shadow:0 12px 28px rgba(0,0,0,.22)}
html[data-theme="dark"].mm-assistant-page .composer-mic{background:linear-gradient(145deg,#173d70,#102d52);color:#78aaff}
html[data-theme="dark"].mm-assistant-page .ai-reference-composer input{color:#eef5ff}

@media(max-width:600px){
  html.mm-assistant-page .main{padding:8px 10px calc(82px + env(safe-area-inset-bottom))!important}
  html.mm-assistant-page .topbar{margin-bottom:4px!important}
  html.mm-assistant-page .ai-reference-page{padding:20px 2px 4px;grid-template-rows:auto auto minmax(92px,1fr) auto;row-gap:10px}
  html.mm-assistant-page .ai-reference-page>h2{min-height:38px;padding:6px 13px 6px 8px;font-size:15px;gap:8px}
  html.mm-assistant-page .ai-reference-page>h2::before{width:24px;height:24px;flex-basis:24px;border-radius:8px;font-size:7.5px}
  html.mm-assistant-page .ai-voice-stage{margin-top:40px}
  html.mm-assistant-page .ai-orb{width:136px;height:136px}
  html.mm-assistant-page .ai-orb::before,html.mm-assistant-page .ai-orb-rings{inset:-18px;box-shadow:0 0 0 12px rgba(87,135,238,.05),0 0 0 25px rgba(87,135,238,.025)}
  html.mm-assistant-page .ai-orb::after{inset:-35px}
  html.mm-assistant-page .ai-mic-icon{font-size:50px}
  html.mm-assistant-page .voice-label{margin-top:43px;font-size:18px}
  html.mm-assistant-page .ai-reference-log{min-height:92px!important;margin-top:4px;padding-bottom:5px}
  html.mm-assistant-page .ai-reference-composer{grid-template-columns:40px minmax(0,1fr) auto;padding:6px 7px 6px 8px;border-radius:20px}
  html.mm-assistant-page .composer-mic{width:34px;height:34px;border-radius:11px;font-size:16px}
  html.mm-assistant-page .ai-reference-composer input{height:38px;font-size:13px}
  html.mm-assistant-page .ai-reference-composer button{height:38px;min-width:68px;padding:0 14px;font-size:13px;border-radius:13px}
}

/* iOS keyboard: hide the fixed nav instead of letting it float above the keyboard. */
@media(max-width:900px){
  html.mm-assistant-page .mobilebar{transition:opacity .14s ease,transform .14s ease,visibility .14s ease}
  html.mm-assistant-page:has(.ai-reference-composer input:focus) .mobilebar{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(calc(100% + 32px))!important}
  html.mm-assistant-page:has(.ai-reference-composer input:focus) .main{padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
  html.mm-assistant-page:has(.ai-reference-composer input:focus) .ai-reference-page{grid-template-rows:auto auto minmax(56px,1fr) auto}
}
