/* FEBRY.OPS V351 — mobile compact polish + lime text safety */
:root{--febry-lime-v351:#B6FF40;--febry-ink-v351:#090D0B;--febry-panel-v351:#0C160F}

/* Hard force: primary lime buttons must keep black text across browsers. */
body.cl-ms #chatView .mobile-simple-open,
body.cl-ms #chatView .mobile-simple-open *,
body.cl-ms #chatView .febry-solid-btn,
body.cl-ms #chatView .febry-solid-btn *,
body.cl-ms #chatView .simple-primary,
body.cl-ms #chatView .simple-primary *,
body.cl-ms #chatView .excel-open-button,
body.cl-ms #chatView .excel-open-button *,
body.cl-ms #chatView .ms-posting-switch button.selected,
body.cl-ms #chatView .ms-posting-switch button.selected *,
body.cl-ms #chatView #msMobileNav button.active,
body.cl-ms #chatView #msMobileNav button.active *,
body.cl-ms #sdScreen .sd-mode-tabs button.current,
body.cl-ms #sdScreen .sd-mode-tabs button.current *,
body.cl-ms #sdScreen .sd-primary,
body.cl-ms #sdScreen .sd-primary *,
body.cl-ms #sdScreen .sd-connect button,
body.cl-ms #sdScreen .sd-connect button *,
body.cl-ms #sdScreen .sd-entry-button,
body.cl-ms #sdScreen .sd-entry-button *,
body.cl-ms #sdScreen .sd-add-link,
body.cl-ms #sdScreen .sd-add-link *,
body.cl-ms #sdScreen .sd-nav button.selected,
body.cl-ms #sdScreen .sd-nav button.selected *{
  color:#F5F9F3 !important;
  -webkit-text-fill-color:#F5F9F3 !important;
  text-shadow:none!important;
}
body.cl-ms #chatView .mobile-simple-open,
body.cl-ms #chatView .febry-solid-btn,
body.cl-ms #chatView .simple-primary,
body.cl-ms #chatView .excel-open-button,
body.cl-ms #chatView .ms-posting-switch button.selected,
body.cl-ms #chatView #msMobileNav button.active,
body.cl-ms #sdScreen .sd-mode-tabs button.current,
body.cl-ms #sdScreen .sd-primary,
body.cl-ms #sdScreen .sd-connect button,
body.cl-ms #sdScreen .sd-entry-button,
body.cl-ms #sdScreen .sd-add-link,
body.cl-ms #sdScreen .sd-nav button.selected{
  background:var(--febry-lime-v351)!important;
  border-color:var(--febry-lime-v351)!important;
}
body.cl-ms #chatView .mobile-simple-open svg,
body.cl-ms #chatView .febry-solid-btn svg,
body.cl-ms #chatView .simple-primary svg,
body.cl-ms #chatView #msMobileNav button.active svg,
body.cl-ms #sdScreen .sd-primary svg,
body.cl-ms #sdScreen .sd-mode-tabs button.current svg,
body.cl-ms #sdScreen .sd-add-link svg,
body.cl-ms #sdScreen .sd-nav button.selected svg,
body.cl-ms #sdScreen .sd-connect button svg{stroke:var(--febry-ink-v351)!important;color:#F5F9F3 !important}
body.cl-ms #chatView button,
body.cl-ms #chatView [role="button"]{-webkit-tap-highlight-color:transparent}

@media(max-width:900px){
  body.cl-ms:has(#chatView:not(.hidden)) .topbar{
    min-height:62px!important;
    padding-top:max(8px,env(safe-area-inset-top))!important;
    padding-bottom:8px!important;
    padding-left:max(10px,env(safe-area-inset-left))!important;
    padding-right:max(10px,env(safe-area-inset-right))!important;
  }
  body.cl-ms:has(#chatView:not(.hidden)) .topbar .mschat-brand .febry-site-logo{
    height:35px!important;max-width:148px!important;
  }
  body.cl-ms #chatView{
    padding:0 0 calc(84px + env(safe-area-inset-bottom))!important;
  }
  body.cl-ms #chatView .ms-mobile-shell{
    padding:0 10px 14px!important;
  }
  body.cl-ms #chatView .ms-mobile-pane{
    min-height:calc(100dvh - 134px)!important;
    padding:4px 0 6px!important;
  }
  body.cl-ms #chatView .mobile-card,
  body.cl-ms #chatView .mobile-template-wrap,
  body.cl-ms #chatView .mobile-simple-terms,
  body.cl-ms #chatView .ms-account-overlay .threads-oauth-card,
  body.cl-ms #chatView .ms-account-overlay .threads-account-item{
    border-radius:16px!important;
  }
  body.cl-ms #chatView .mobile-card{
    padding:14px 13px!important;
    margin-bottom:12px!important;
  }
  body.cl-ms #chatView .mobile-pane-title{
    gap:8px!important;
  }
  body.cl-ms #chatView .mobile-pane-title h3{
    font-size:15px!important;
    line-height:1.25!important;
    margin:0 0 3px!important;
  }
  body.cl-ms #chatView .mobile-pane-title p{
    font-size:11px!important;
    line-height:1.45!important;
  }
  body.cl-ms #chatView .mobile-pane-actions{gap:8px!important}
  body.cl-ms #chatView .btn,
  body.cl-ms #chatView a.btn,
  body.cl-ms #chatView button.btn,
  body.cl-ms #chatView .ms-mobile-pane .chat-actions .btn,
  body.cl-ms #chatView .mobile-simple-open,
  body.cl-ms #chatView .excel-open-button,
  body.cl-ms #chatView .simple-actions .btn,
  body.cl-ms #chatView .simple-output-actions .btn{
    min-height:44px!important;
    padding:10px 12px!important;
    font-size:12px!important;
    border-radius:12px!important;
  }
  body.cl-ms #chatView .nav-badge{min-width:24px!important;height:24px!important;font-size:10px!important}

  /* Chat pane */
  body.cl-ms #chatView .ms-mobile-pane .chat-head{padding:4px 2px 10px!important;margin-bottom:6px!important}
  body.cl-ms #chatView .ms-mobile-pane .chat-head h1{font-size:26px!important}
  body.cl-ms #chatView .ms-mobile-pane .chat-head p{font-size:11px!important;line-height:1.45!important}
  body.cl-ms #chatView .ms-mobile-pane .messages{
    height:calc(100dvh - 270px)!important;
    min-height:220px!important;
    padding:4px 0 10px!important;
  }
  body.cl-ms #chatView .ms-mobile-pane .messages .bubble{font-size:13px!important;line-height:1.56!important}
  body.cl-ms #chatView .ms-mobile-pane .composer-wrap{
    bottom:calc(76px + env(safe-area-inset-bottom))!important;
    padding-top:8px!important;
  }
  body.cl-ms #chatView .ms-mobile-pane .composer textarea{font-size:16px!important;min-height:52px!important}
  body.cl-ms #chatView .ms-mobile-pane .composer .btn{min-width:52px!important}

  /* Bottom nav */
  body.cl-ms #chatView .ms-mobile-nav,
  body.cl-ms #msMobileNav{
    left:8px!important;right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom))!important;
    gap:7px!important;
    padding:8px!important;
    border-radius:22px!important;
  }
  body.cl-ms #chatView .ms-mobile-nav button,
  body.cl-ms #msMobileNav button{
    min-height:64px!important;
    padding:8px 6px!important;
    border-radius:16px!important;
  }
  body.cl-ms #chatView .ms-mobile-nav .nav-icon,
  body.cl-ms #msMobileNav .nav-icon{width:28px!important;height:28px!important}
  body.cl-ms #chatView .ms-mobile-nav .nav-label,
  body.cl-ms #msMobileNav .nav-label{font-size:10.5px!important;line-height:1.1!important}

  /* Posting hub */
  body.cl-ms #chatView .ms-posting-pane{padding:10px 0 calc(24px + env(safe-area-inset-bottom))!important}
  body.cl-ms #chatView .ms-posting-switch{
    padding:4px!important;
    margin:0 0 12px!important;
    gap:6px!important;
    border-radius:14px!important;
  }
  body.cl-ms #chatView .ms-posting-switch button{
    min-height:40px!important;
    padding:9px 6px!important;
    font-size:11.5px!important;
    border-radius:10px!important;
  }
  body.cl-ms #chatView .ms-posting-pane .mobile-simple-intro{gap:10px!important}
  body.cl-ms #chatView .ms-posting-pane .mobile-simple-heading{font-size:18px!important}
  body.cl-ms #chatView .ms-posting-pane .mobile-simple-heading .mobile-simple-mark{width:42px!important;height:42px!important;border-radius:13px!important}
  body.cl-ms #chatView .ms-posting-pane .mobile-simple-intro > p{font-size:11px!important;line-height:1.5!important;margin:0!important}
  body.cl-ms #chatView .ms-posting-pane .mobile-simple-info{font-size:10px!important;line-height:1.55!important;padding:10px!important}
  body.cl-ms #chatView .mobile-simple-terms summary{padding:13px 12px!important;gap:10px!important}
  body.cl-ms #chatView .mobile-simple-terms summary span{font-size:11px!important}
  body.cl-ms #chatView .mobile-simple-terms-content{padding:0 12px 13px!important}
  body.cl-ms #chatView .mobile-simple-terms-content p{font-size:11px!important;line-height:1.55!important;margin:0 0 10px!important}

  /* Saya pane */
  body.cl-ms #chatView .ms-mobile-profile-pane{padding:10px 3px 18px!important}
  body.cl-ms #chatView .ms-mobile-profile-hub{
    padding:10px 2px 14px!important;
    gap:8px!important;
  }
  body.cl-ms #chatView .ms-mobile-profile-hub h2{font-size:22px!important;margin:4px 0 2px!important}
  body.cl-ms #chatView .ms-mobile-profile-hub > p{font-size:11px!important;line-height:1.45!important}
  body.cl-ms #chatView .ms-mobile-hide-mount{margin-top:14px!important}
  body.cl-ms #chatView .ms-mobile-hide-mount .ms-text-visibility{
    padding:11px 12px!important;gap:10px!important;border-radius:14px!important;
  }
  body.cl-ms #chatView .ms-mobile-hide-mount .ms-text-visibility-copy strong{font-size:12px!important}
  body.cl-ms #chatView .ms-mobile-hide-mount .ms-text-visibility-copy small{font-size:10px!important;line-height:1.45!important}
  body.cl-ms #chatView .ms-mobile-hide-mount .ms-text-visibility-switch{min-width:86px!important;gap:8px!important}
  body.cl-ms #chatView .ms-mobile-profile-actions{gap:9px!important;margin-top:12px!important}
  body.cl-ms #chatView .ms-mobile-profile-action{padding:12px 12px!important;gap:10px!important;border-radius:14px!important}
  body.cl-ms #chatView .ms-mobile-profile-icon{width:38px!important;height:38px!important;min-width:38px!important;border-radius:12px!important}
  body.cl-ms #chatView .ms-mobile-profile-copy strong{font-size:13px!important}
  body.cl-ms #chatView .ms-mobile-profile-copy small{font-size:10px!important;line-height:1.42!important}
  body.cl-ms #chatView .ms-mobile-profile-chevron{font-size:22px!important}
  body.cl-ms #chatView .ms-mobile-logout-mount{margin-top:13px!important}
  body.cl-ms #chatView .ms-mobile-logout-mount #logoutBtn{
    min-height:42px!important;font-size:12px!important;border-radius:12px!important;
  }

  /* Template pane */
  body.cl-ms #chatView #mobilePaneTemplate .mobile-card{padding:14px 13px!important}
  body.cl-ms #chatView #mobilePaneTemplate .mobile-favorite-list{gap:10px!important}

  /* Simple dashboard compact mode */
  body.cl-ms #sdScreen .sd-shell{width:min(100% - 18px,760px)!important;padding:10px 0 88px!important}
  body.cl-ms #sdScreen .sd-top{gap:12px!important;padding:8px 0 14px!important}
  body.cl-ms #sdScreen .sd-brand h1{font-size:28px!important;line-height:1.1!important;margin:8px 0 3px!important}
  body.cl-ms #sdScreen .sd-brand p{font-size:12px!important;line-height:1.5!important}
  body.cl-ms #sdScreen .sd-mode-tabs{padding:3px!important;border-radius:12px!important}
  body.cl-ms #sdScreen .sd-mode-tabs button{min-height:42px!important;padding:10px 10px!important;font-size:11.5px!important;border-radius:9px!important}
  body.cl-ms #sdScreen .sd-metrics{padding:12px 0 14px!important;gap:7px!important}
  body.cl-ms #sdScreen .sd-metrics span{padding:7px 10px!important;font-size:10.5px!important}
  body.cl-ms #sdScreen .sd-quiet{min-height:42px!important;padding:10px 12px!important;font-size:11.5px!important;border-radius:10px!important}
  body.cl-ms #sdScreen .sd-nav{gap:6px!important;margin:0 0 14px!important;padding-bottom:6px!important}
  body.cl-ms #sdScreen .sd-nav button{min-height:42px!important;padding:10px 8px!important;font-size:11.5px!important;border-radius:10px 10px 0 0!important}
  body.cl-ms #sdScreen .sd-compose{padding:15px 12px!important;border-radius:18px!important}
  body.cl-ms #sdScreen .sd-title{gap:10px!important}
  body.cl-ms #sdScreen .sd-count{width:30px!important;height:30px!important;flex:0 0 30px!important;border-radius:9px!important;font-size:12px!important}
  body.cl-ms #sdScreen .sd-title h2{font-size:16px!important;margin:1px 0 3px!important}
  body.cl-ms #sdScreen .sd-title p{font-size:10.5px!important;line-height:1.5!important}
  body.cl-ms #sdScreen .sd-form{padding-top:12px!important}
  body.cl-ms #sdScreen .sd-form-field{margin:13px 0!important}
  body.cl-ms #sdScreen .sd-form-field > label,
  body.cl-ms #sdScreen .sd-date-row label,
  body.cl-ms #sdScreen .sd-draft-label,
  body.cl-ms #sdScreen .sd-chain-label{font-size:11.5px!important;margin-bottom:7px!important}
  body.cl-ms #sdScreen .sd-form-field > input:not([type=file]),
  body.cl-ms #sdScreen .sd-form-field > textarea,
  body.cl-ms #sdScreen .sd-form-field > select,
  body.cl-ms #sdScreen .sd-date-row input,
  body.cl-ms #sdScreen .sd-date-row select,
  body.cl-ms #sdScreen .sd-random-fields input,
  body.cl-ms #sdScreen .sd-link-input,
  body.cl-ms #sdScreen .sd-account-count input{
    min-height:44px!important;
    border-radius:11px!important;
    padding:11px 12px!important;
    font-size:16px!important;
  }
  body.cl-ms #sdScreen .sd-form-field > textarea,
  body.cl-ms #sdScreen .sd-form-field > textarea.sd-caption{min-height:96px!important}
  body.cl-ms #sdScreen .sd-upload{padding:13px!important;gap:10px!important;border-radius:12px!important}
  body.cl-ms #sdScreen .sd-upload-ico{width:34px!important;height:34px!important;border-radius:10px!important;font-size:20px!important}
  body.cl-ms #sdScreen .sd-upload b{font-size:12px!important}
  body.cl-ms #sdScreen .sd-upload small,
  body.cl-ms #sdScreen .sd-form-field small,
  body.cl-ms #sdScreen .sd-countrow,
  body.cl-ms #sdScreen .sd-auto-alert,
  body.cl-ms #sdScreen .sd-generation-option small,
  body.cl-ms #sdScreen .sd-delivery-options small,
  body.cl-ms #sdScreen .sd-final-note,
  body.cl-ms #sdScreen .sd-random-fields p{font-size:10.5px!important;line-height:1.55!important}
  body.cl-ms #sdScreen .sd-account-choice,
  body.cl-ms #sdScreen .sd-account-count,
  body.cl-ms #sdScreen .sd-delivery-options label,
  body.cl-ms #sdScreen .sd-generation-option,
  body.cl-ms #sdScreen .sd-random-toggle,
  body.cl-ms #sdScreen .sd-variant-editor,
  body.cl-ms #sdScreen .sd-connect,
  body.cl-ms #sdScreen .sd-schedules,
  body.cl-ms #sdScreen .sd-schedule-card{padding:12px!important;border-radius:12px!important}
  body.cl-ms #sdScreen .sd-primary,
  body.cl-ms #sdScreen .sd-connect button{min-height:46px!important;padding:11px 14px!important;font-size:12px!important;border-radius:11px!important}
  body.cl-ms #sdScreen .sd-primary.sd-big{min-height:48px!important}
  body.cl-ms #sdScreen .sd-add-link{min-height:40px!important;margin-top:9px!important}
  body.cl-ms #sdScreen .sd-link-row{gap:6px!important}
  body.cl-ms #sdScreen .sd-remove-link{padding:9px 10px!important;font-size:11px!important;border-radius:10px!important}
  body.cl-ms #sdScreen .sd-notice{font-size:11px!important;line-height:1.55!important;padding:13px 14px!important;border-radius:12px!important}
}

@media(max-width:390px){
  body.cl-ms #chatView .ms-mobile-nav button,
  body.cl-ms #msMobileNav button{min-height:62px!important}
  body.cl-ms #chatView .ms-mobile-nav .nav-label,
  body.cl-ms #msMobileNav .nav-label{font-size:10px!important}
  body.cl-ms #sdScreen .sd-brand h1{font-size:26px!important}
  body.cl-ms #sdScreen .sd-mode-tabs button,
  body.cl-ms #sdScreen .sd-nav button{font-size:11px!important}
}
