/* Leaf Box 3.0 / Mobile usability correction.
   Scoped overrides follow the existing system and preserve all server contracts. */

/* Wallet section anchors should never masquerade as selected tabs by default. */
.mp-coins-page .lb-coin-jumps { max-width:100%; }
.mp-coins-page .lb-coin-jumps a { white-space:nowrap; text-decoration:none; }
.mp-coins-page .lb-coin-jumps a:not([aria-current="location"]) { background:transparent; border-color:transparent; color:#dfd5cc; }
.mp-coins-page .lb-coin-jumps a:focus-visible { outline:2px solid #ffe4b3;outline-offset:-2px; }
.mp-coins-page .lb-coin-jumps a[aria-current="location"] { background:rgba(246,202,130,.15);border-color:rgba(246,202,130,.28);color:#ffe5b4; }

/* Chat: an actual single-line composer until the user types multiple lines. */
.lb-chat-workspace .lb-chat-composer { display:block; width:auto; min-width:0; padding:6px!important; }
.lb-chat-workspace .lb-chat-composer .lb-compose-row {
  display:flex;align-items:flex-end;justify-content:stretch;gap:6px;
  min-width:0;padding:0!important;margin:0;flex-wrap:nowrap;
}
.lb-chat-workspace .lb-chat-composer .lb-compose-tools {
  display:flex;align-items:center;flex:0 0 auto;min-width:0;gap:3px;
}
.lb-chat-workspace .lb-chat-composer .lb-compose-editor { min-width:0;width:auto;flex:1 1 0; }
.lb-chat-workspace .lb-chat-composer .lb-compose-textarea {
  display:block;width:100%;min-width:0;min-height:46px!important;max-height:116px!important;
  padding:12px 10px!important;border-radius:12px!important;
  background:rgba(8,24,30,.58)!important;border:1px solid rgba(181,210,222,.16)!important;
  box-sizing:border-box;line-height:1.38;overflow-y:auto;resize:none;letter-spacing:0;
}
.lb-chat-workspace .lb-chat-composer .lb-compose-textarea:focus-visible { border-color:rgba(139,224,190,.6)!important; }
.lb-chat-workspace .lb-chat-composer .lb-compose-send { flex:0 0 auto;display:flex;align-items:flex-end;min-width:0;position:relative; }
.lb-chat-workspace .lb-chat-composer .lb-send-action { width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;border-radius:13px!important; }
.lb-chat-workspace .lb-chat-composer .lb-compose-file,
.lb-chat-workspace .lb-chat-composer .lb-compose-camera {
  display:grid;place-items:center;flex:0 0 44px;min-width:44px!important;width:44px!important;
  min-height:46px!important;height:46px!important;border-radius:12px!important;
}
.lb-chat-workspace .lb-chat-composer .lb-compose-tools .icon { width:19px;height:19px; }
.lb-chat-workspace .lb-chat-composer .lb-compose-count {
  display:none;position:absolute;right:0;bottom:calc(100% + 9px);z-index:2;
  padding:3px 7px;margin:0;border:1px solid rgba(200,244,213,.2);border-radius:9px;
  background:#1b3039;color:#e5f5ec;font-weight:700;font-size:11px;white-space:nowrap;
}
.lb-chat-workspace .lb-chat-composer.is-near-limit .lb-compose-count {display:inline-block;}
.lb-chat-workspace .lb-chat-composer .lb-attachment-preview {max-width:100%;margin:2px 0 8px;overflow:hidden;}
.lb-chat-workspace .lb-chat-composer .lb-attachment-preview span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lb-chat-workspace .lb-thread-guidance {font-size:11px;line-height:1.45;}
.lb-chat-workspace .lb-thread-message .bubble {width:fit-content;max-width:100%;}
.lb-chat-workspace .lb-thread-message .bubble .lb-message-foot {min-height:36px;margin-top:0;}
.lb-chat-workspace .lb-thread-message .bubble p {margin:4px 0 0;}
.lb-chat-workspace .lb-thread-message .bubble .lb-message-more {min-width:44px;min-height:44px;width:44px;height:44px;border-radius:11px;}

/* More sheet: category groups must be FULL WIDTH; nesting two grids made 4 cramped columns. */
@media(max-width:800px){
  .mobile-more-sheet {
    display:flex!important;flex-direction:column;
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    width:auto!important;min-width:0;box-sizing:border-box;
    bottom:calc(var(--lb-dock-height,78px) + 12px + env(safe-area-inset-bottom))!important;
    max-height:min(82dvh,calc(100dvh - var(--lb-dock-height,78px) - 35px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
    padding:13px 13px 14px!important;overflow-x:hidden!important;overflow-y:auto!important;
    scrollbar-width:thin;scrollbar-color:rgba(154,212,170,.42) transparent;
    overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;
  }
  .mobile-more-sheet .mobile-more-heading {position:sticky;top:-13px;z-index:2;
    background:linear-gradient(155deg,#203c38,#172f32);padding:7px 4px 11px;margin:0 0 4px;
    border-bottom:1px solid rgba(190,234,220,.12);flex:0 0 auto;
  }
  .mobile-more-sheet nav {
    display:flex!important;flex-direction:column!important;
    grid-template-columns:none!important;align-items:stretch!important;
    flex:0 0 auto;gap:11px!important;width:100%;max-width:100%;min-width:0;
  }
  .mobile-more-sheet .lb-more-group {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;width:100%;max-width:100%;min-width:0;margin:0!important;align-items:stretch;
  }
  .mobile-more-sheet .lb-more-group-label {
    grid-column:1 / -1;min-width:0;padding:10px 4px 3px!important;margin:0;
    font-size:10px;line-height:1.4;letter-spacing:.105em;color:#b5cbd0;
  }
  .mobile-more-sheet .lb-more-group .more-link {
    box-sizing:border-box;display:flex!important;align-items:center;justify-content:flex-start;
    width:100%;max-width:100%;min-width:0;min-height:54px!important;height:auto;
    padding:10px 11px!important;gap:9px!important;border-radius:13px!important;
    font-size:12px!important;font-weight:700;line-height:1.35;
    white-space:normal;overflow-wrap:anywhere;word-break:normal;text-decoration:none;
  }
  .mobile-more-sheet .more-link>span {display:block;flex:1 1 auto;min-width:0;max-width:100%;overflow-wrap:anywhere;}
  .mobile-more-sheet .more-link .icon {width:19px!important;height:19px!important;flex:0 0 19px;}
  .mobile-more-sheet .more-link.active {border-color:rgba(165,233,194,.38)!important;background:rgba(135,218,166,.15)!important;}
  .mobile-more-sheet .lb-more-group:last-child {padding-bottom:8px;}
  .lb-chat-workspace .chat-main {height:clamp(430px,69dvh,700px);}
  .lb-chat-workspace .lb-chat-composer {margin:7px 9px 7px!important;}
  .lb-chat-workspace .lb-thread-guidance {display:none!important;}
  .lb-chat-workspace .lb-chat-search {padding:7px 10px;gap:6px;}
  .lb-chat-workspace .lb-chat-search .input {min-height:44px;}
  .lb-chat-workspace .lb-chat-search .lb-search-action {width:44px;min-width:44px;height:44px;}
  .lb-chat-workspace .lb-chat-scroll-shell .lb-thread {padding:13px 12px 14px;}
  .lb-chat-workspace .lb-thread-message .bubble {padding:9px 11px;}
  .lb-chat-workspace .lb-compose-textarea::placeholder {color:#b1c2c6;}
}
@media(max-width:380px){
  .mobile-more-sheet .lb-more-group {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .mobile-more-sheet .lb-more-group .more-link {padding:10px 8px!important;gap:6px!important;font-size:11px!important;}
  .lb-chat-workspace .lb-chat-composer .lb-compose-row {gap:4px;}
  .lb-chat-workspace .lb-chat-composer .lb-compose-tools {gap:1px;}
  .lb-chat-workspace .lb-chat-composer .lb-compose-textarea {padding:12px 7px!important;}
  .lb-chat-workspace .lb-chat-composer .lb-compose-file,
  .lb-chat-workspace .lb-chat-composer .lb-compose-camera {min-width:44px!important;width:44px!important;flex-basis:44px;}
  .lb-chat-workspace .lb-chat-composer .lb-send-action {min-width:44px!important;width:44px!important;}
}
@media(max-width:320px){
  .mobile-more-sheet .lb-more-group {grid-template-columns:minmax(0,1fr)!important;}
  .lb-chat-workspace .lb-compose-row {flex-wrap:wrap!important;}
  .lb-chat-workspace .lb-compose-row .lb-compose-editor {order:-1;flex-basis:100%;}
  .lb-chat-workspace .lb-compose-row .lb-compose-send {margin-left:auto;}
}
@media(prefers-reduced-motion:reduce){
 .mobile-more-sheet,.lb-chat-workspace .lb-chat-composer *{transition:none!important;animation:none!important;}
}
