/* HOPE PHONE CHAT 20261012-v1 */
/* All layout rules are device-scoped. Resizing a desktop window keeps desktop behavior. */
html.hope-phone{--sidebar:56px;--banner:29px;--hope-phone-height:100dvh;--hope-phone-offset-top:0px}
html.hope-phone [data-nav="create"],html.hope-phone .hero,html.hope-phone #recentSection,html.hope-phone #directoryGuide,html.hope-phone #chatClose{display:none!important}
html.hope-phone .sidebar{width:var(--sidebar);padding:18px 6px max(12px,env(safe-area-inset-bottom));overflow-y:auto}
html.hope-phone .brand-row{justify-content:center;padding:0 0 20px}
html.hope-phone .brand>span:last-child,html.hope-phone .collapse,html.hope-phone .nav-item>span,html.hope-phone .profile>span:nth-child(2),html.hope-phone .profile svg,html.hope-phone .local-note{display:none}
html.hope-phone .brand{gap:0}html.hope-phone .brand-mark{width:30px;height:30px}
html.hope-phone .nav-item{justify-content:center;min-height:44px;padding:10px 6px}
html.hope-phone .sidebar-bottom .profile{justify-content:center;min-height:44px;padding-top:12px}
html.hope-phone .announcement{height:var(--banner);font-size:10px;padding:0 28px}
html.hope-phone .top-actions{top:calc(var(--banner) + 10px);right:12px;gap:7px}
html.hope-phone .top-actions .account-balance{padding:8px 10px;min-height:36px;font-size:12px}
html.hope-phone .top-actions .login{font-size:12px;max-width:105px;min-height:36px}
html.hope-phone .top-actions .admin-site-button{font-size:10px;padding:7px;max-width:85px}
html.hope-phone body.home-chat-view{overflow:hidden;overscroll-behavior:none}
html.hope-phone body.home-chat-view .home-chat-section{left:var(--sidebar);right:0;top:calc(var(--hope-phone-offset-top) + var(--banner) + 52px);bottom:auto;height:calc(var(--hope-phone-height) - var(--banner) - 52px);min-height:0;padding:0}
html.hope-phone .home-chat-section .chat-panel{grid-template-columns:minmax(0,1fr);grid-template-rows:48px minmax(0,1fr) auto;border-radius:0;inset:0;overflow:hidden;box-shadow:none}
html.hope-phone .home-chat-section .chat-panel-head,html.hope-phone .home-chat-section .chat-transcript,html.hope-phone .home-chat-section .chat-foot{grid-column:1}
html.hope-phone .home-chat-section .chat-panel-head{padding:0 12px;gap:8px;border-bottom:1px solid #edf0f6}
html.hope-phone .home-chat-section .chat-panel-head strong{font-size:17px}
html.hope-phone .home-chat-section .chat-head-icon{display:none}
html.hope-phone .home-chat-section #chatHistoryButton{display:grid;order:-1;min-width:44px;min-height:44px}
html.hope-phone .home-chat-section .chat-transcript{padding:18px 16px 24px;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html.hope-phone .home-chat-section .chat-content{font-size:17px;line-height:1.85;overflow-wrap:anywhere}
html.hope-phone .home-chat-section .chat-content h3{font-size:19px}
html.hope-phone .home-chat-section .chat-content pre{max-width:100%;overflow:auto;font-size:14px}
html.hope-phone .home-chat-section .chat-message.user .chat-content{max-width:95%;padding:11px 14px}
html.hope-phone .home-chat-section .chat-empty{min-height:0;padding:22px 0}
html.hope-phone .home-chat-section .chat-empty h2{font-size:24px;line-height:1.5}
html.hope-phone .home-chat-section .chat-empty p{font-size:15px;line-height:1.8}
html.hope-phone .home-chat-section .chat-suggestions{grid-template-columns:1fr;gap:8px;margin-top:20px}
html.hope-phone .home-chat-section .chat-suggestions button{font-size:14px;padding:12px;text-align:left;min-height:44px}
html.hope-phone .home-chat-section .chat-foot{max-width:none;padding:0 10px max(10px,env(safe-area-inset-bottom));background:#fff;min-height:0}
html.hope-phone .home-chat-section .chat-input-box{padding:11px 10px 9px;border-radius:16px;max-height:calc(var(--hope-phone-height) * .55);overflow-y:auto}
html.hope-phone .home-chat-section .chat-input-box textarea{font-size:16px;line-height:1.6;max-height:140px;min-height:48px;resize:none}
html.hope-phone .home-chat-section .chat-input-toolbar{display:grid;grid-template-columns:44px minmax(0,1fr) 36px 44px;gap:3px;margin-top:8px;align-items:center}
html.hope-phone .home-chat-section .home-chat-attachment{width:44px;height:44px;min-height:44px;margin:0;border-radius:12px;background:#edf2ff;color:#5d7bf7}
html.hope-phone .home-chat-section .home-chat-attachment:disabled{opacity:.45}
html.hope-phone .home-chat-section .chat-model{max-width:none;width:100%;min-width:0;height:44px;font-size:16px;padding:6px 3px;border-radius:10px}
html.hope-phone .home-chat-section .chat-input-toolbar>.chat-icon-button:not(.home-chat-attachment){width:36px;height:44px;margin:0}
html.hope-phone .home-chat-section .chat-send{width:44px;height:44px;margin:0;border-radius:12px}
html.hope-phone .home-chat-section .chat-footnote{font-size:11px;line-height:1.5;margin:7px 0 0;text-align:center}
html.hope-phone .home-chat-section .chat-reference-count{font-size:12px}
html.hope-phone .home-chat-section .chat-references .chat-image-strip{flex-wrap:nowrap;overflow-x:auto;padding:7px 4px 4px;scrollbar-width:thin}
html.hope-phone .home-chat-section .chat-image-item{width:62px;height:62px}
html.hope-phone .home-chat-section .chat-remove-image{width:25px;height:25px;line-height:25px;right:-4px;top:-5px;font-size:18px!important}
html.hope-phone .home-chat-section .home-chat-history-rail{display:none;position:absolute;inset:0 auto 0 0;width:min(280px,94%);z-index:5;box-shadow:12px 0 35px #25335a16;padding:20px 12px 14px}
html.hope-phone .home-chat-section .home-chat-history-open .home-chat-history-rail{display:flex}
html.hope-phone .home-chat-section .home-chat-history-dismiss{display:grid;min-width:44px;min-height:44px}
html.hope-phone .home-chat-section .home-chat-history-open .home-chat-history-backdrop{display:block;position:absolute;inset:0;z-index:4;width:100%;height:100%;background:#25335a2b;border:0;padding:0}
html.hope-phone .home-chat-section .home-chat-new{min-height:46px;font-size:15px}
html.hope-phone .home-chat-section .chat-history-entry{min-height:44px;padding:12px 10px}
html.hope-phone.hope-phone-keyboard body.home-chat-view .home-chat-section{top:var(--hope-phone-offset-top);height:var(--hope-phone-height);z-index:80}
html.hope-phone.hope-phone-keyboard .home-chat-section .chat-panel{grid-template-rows:40px minmax(0,1fr) auto}
html.hope-phone.hope-phone-keyboard .home-chat-section .chat-footnote{display:none}
html.hope-phone.hope-phone-keyboard .home-chat-section .chat-input-box textarea{max-height:80px}
html.hope-phone .home-mobile-photo-dialog{position:fixed;inset:auto 12px max(12px,env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:440px;max-height:calc(100dvh - 30px);overflow:auto;margin:0 auto;padding:22px 18px 16px;border:1px solid #e4e9f6;border-radius:22px;background:#fff;color:#45516d;box-shadow:0 18px 70px #23365033}
html.hope-phone .home-mobile-photo-dialog::backdrop{background:#1c284969;backdrop-filter:blur(4px)}
html.hope-phone .home-mobile-photo-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin:0 2px 14px}
html.hope-phone .home-mobile-photo-dialog header strong{font-size:18px;font-weight:600}
html.hope-phone .home-mobile-photo-dialog header p{margin:6px 0 0;color:#919bb2;font-size:12px;line-height:1.6}
html.hope-phone .home-mobile-photo-close{background:#f1f4fa;border:0;border-radius:50%;font-size:25px;color:#8a95ad;width:40px;height:40px;flex:none}
html.hope-phone .home-mobile-photo-option{display:flex;align-items:center;gap:13px;width:100%;padding:17px 14px;margin:8px 0;border:1px solid #e1e8f8;border-radius:14px;background:#f7f9ff;text-align:left;font-family:inherit;color:#5d7bf7;min-height:76px}
html.hope-phone .home-mobile-photo-option>svg{width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}
html.hope-phone .home-mobile-photo-option>span:nth-child(2){flex:1}
html.hope-phone .home-mobile-photo-option strong{display:block;font-size:16px;font-weight:550;color:#536a9e}
html.hope-phone .home-mobile-photo-option small{display:block;margin-top:4px;font-size:12px;color:#99a5bd}
html.hope-phone .home-mobile-photo-option>span:last-child{font-size:25px;color:#a8b4cf}
html.hope-phone .home-mobile-photo-dialog button:focus-visible{outline:3px solid #9bafff;outline-offset:2px}
html.hope-phone .home-mobile-photo-dialog button:disabled{opacity:.45}
@media(max-height:440px){html.hope-phone .home-chat-section .chat-empty{padding:4px 0}html.hope-phone .home-chat-section .chat-empty-mark,html.hope-phone .home-chat-section .chat-suggestions{display:none}html.hope-phone .home-chat-section .chat-footnote{display:none}}

/* HOPE PHONE CHAT FOCUS 20261012-v2 */
/* Only the phone homepage is simplified. Desktop rules remain unchanged. */
html.hope-phone{--sidebar:0px;--banner:0px;background:#fff}
html.hope-phone body{background:#fff;overflow:hidden;overscroll-behavior:none}
html.hope-phone main{margin-left:0;padding-top:0;min-height:0}
/* The shared model picker is portalled to body so the chat's overflow cannot clip it.
   Keep that overlay visible alongside the conversation, auth dialogs and photo chooser. */
html.hope-phone body>:not(main):not(#loginDialog):not(#accountDialog):not(.account-recovery-dialog):not(.home-mobile-photo-dialog):not(.hope-model-menu):not(script):not(style):not(.defs),
html.hope-phone main>:not(#homeChatSection),
html.hope-phone .sidebar,html.hope-phone .announcement,html.hope-phone .top-actions,
html.hope-phone #adminSiteButton,html.hope-phone #accountBalance,
html.hope-phone #freeBalanceHint,html.hope-phone #rechargeBalanceHint{display:none!important}
html.hope-phone body.home-chat-view .home-chat-section,
html.hope-phone.hope-phone-keyboard body.home-chat-view .home-chat-section{
  left:0;right:0;top:var(--hope-phone-offset-top);bottom:auto;
  height:var(--hope-phone-height);padding:0;min-height:0;z-index:80;
}
html.hope-phone .home-chat-section .chat-panel,
html.hope-phone.hope-phone-keyboard .home-chat-section .chat-panel{
  grid-template-rows:calc(56px + env(safe-area-inset-top)) minmax(0,1fr) auto;
}
html.hope-phone .home-chat-section .chat-panel-head{
  padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));
  gap:8px;min-height:56px;background:#fff;
}
html.hope-phone .home-chat-section .chat-panel-head>strong{flex:1;min-width:0}
html.hope-phone .home-chat-section .chat-panel-head>.home-mobile-login{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
  margin:0 0 0 auto;padding:0 14px;min-width:70px;width:auto;
  max-width:clamp(90px,35vw,150px);height:44px;min-height:44px;
  border:1px solid #e1e6f1;border-radius:22px;background:#f7f9ff;
  color:#617199;font:inherit;font-size:14px;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
html.hope-phone .home-chat-section .chat-panel-head>.home-mobile-login:focus-visible{
  outline:2px solid #7b8edb;outline-offset:2px;
}
html.hope-phone .home-chat-section .home-chat-history-rail{
  padding-top:calc(20px + env(safe-area-inset-top));
  padding-left:max(12px,env(safe-area-inset-left));
}
html.hope-phone .home-chat-section .chat-transcript{
  padding-left:max(16px,env(safe-area-inset-left));
  padding-right:max(16px,env(safe-area-inset-right));
}
html.hope-phone .home-chat-section .chat-foot{
  padding-left:max(10px,env(safe-area-inset-left));
  padding-right:max(10px,env(safe-area-inset-right));
}
