
  /* All styles scoped under #page-messaging so nothing leaks into the rest of the app. */
  /* PAGE CHROME (2026-09-13): no more padding:0 full-bleed — the page keeps the 24px gutter every page
     shares; the page is the flex column so the two-pane body fills the fold, and the body + footer note
     wear a border/radius so they read as widgets whose edges are the page's edges. */
  #page-messaging.active{display:flex;flex-direction:column}
  .mc-wrap{display:flex;flex-direction:column;flex:1;min-height:0}
  /* Search rides NEXT TO the lane tabs ("search bar in messaging needs to be to the left
     by the sort tabs", 2026-08-17); the bell pushes itself to the far right. */
  .mc-top{display:flex;align-items:center;justify-content:flex-start;gap:14px;
    padding:0 0 12px;flex-wrap:wrap}
  #mc-bell{margin-left:auto}
  .mc-tabs{display:inline-flex;background:#13161b;border:1px solid var(--border);
    border-radius:11px;padding:4px;gap:3px}
  .mc-tab{display:inline-flex;align-items:center;gap:7px;padding:8px 15px;border-radius:8px;
    font-size:12.5px;font-weight:600;color:var(--text2);cursor:pointer;border:none;background:none;
    font-family:inherit;letter-spacing:.2px;transition:all .18s var(--ease);white-space:nowrap}
  .mc-tab:hover{color:var(--text)}
  .mc-tab.on{background:linear-gradient(180deg,#2fa1ad,#1c7e8a);color:#fff;
    box-shadow:0 1px 0 rgba(255,255,255,.16) inset,0 2px 8px rgba(31,126,138,.3)}
  .mc-tab .mc-tab-n{display:inline-flex;align-items:center;justify-content:center;min-width:18px;
    height:18px;padding:0 5px;border-radius:9px;font-size:10.5px;background:rgba(255,255,255,.14);
    color:inherit}
  .mc-tab:not(.on) .mc-tab-n{background:var(--gray-l);color:var(--text3)}
  .mc-searchbox{position:relative;flex:1;max-width:300px;min-width:170px}
  .mc-searchbox input{width:100%;border:1px solid var(--border);border-radius:9px;
    padding:9px 12px 9px 32px;font-size:12.5px;color:var(--text);background:#13161b;outline:none;
    font-family:inherit;transition:all .15s}
  .mc-searchbox input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(47,154,166,.18)}
  .mc-searchbox svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);
    width:15px;height:15px;color:var(--text3);pointer-events:none}

  .mc-body{display:flex;flex:1;min-height:0;border:1px solid var(--border-2);border-radius:var(--r);overflow:hidden}
  .mc-list{width:300px;flex-shrink:0;overflow-y:auto;border-right:1px solid var(--border-2);
    padding:10px 10px 24px}
  .mc-pane{flex:1;min-width:0;display:flex;flex-direction:column}

  .mc-item{display:flex;align-items:center;gap:11px;padding:11px;border-radius:10px;
    cursor:pointer;transition:background .15s;border:1px solid transparent;position:relative}
  /* hairline between rows (inset past the avatar) instead of nine floating cards */
  .mc-item + .mc-item:before{content:'';position:absolute;top:-1px;left:60px;right:10px;height:1px;
    background:rgba(255,255,255,.05)}
  .mc-item:hover{background:rgba(255,255,255,.04)}
  .mc-item.on{background:var(--blue-l);border-color:rgba(47,161,173,.4)}
  .mc-item.on:before,.mc-item.on + .mc-item:before{display:none}
  .mc-av{width:38px;height:38px;flex-shrink:0;border-radius:50%;display:flex;align-items:center;
    justify-content:center;font-size:13px;font-weight:700;color:#fff;letter-spacing:.3px;
    box-shadow:0 1px 0 rgba(255,255,255,.14) inset}
  .mc-av.c{background:linear-gradient(140deg,#2fa1ad,#1c7e8a)}
  .mc-av.v{background:linear-gradient(140deg,#C9A763,#9c7f44)}
  .mc-av.e{background:linear-gradient(140deg,#7E8794,#565d68)}
  .mc-it-main{flex:1;min-width:0}
  .mc-it-name{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis}
  .mc-it-sub{font-size:11px;color:var(--text3);white-space:nowrap;overflow:hidden;
    text-overflow:ellipsis;margin-top:1px}
  .mc-it-dot{width:7px;height:7px;border-radius:50%;background:var(--blue-m);flex-shrink:0}
  /* inbox rows: name + time on one line; unread rows read bold with a count pill */
  .mc-it-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0}
  .mc-it-time{font-size:10px;color:var(--text3);flex-shrink:0}
  .mc-item.unread .mc-it-name{font-weight:800}
  .mc-item.unread .mc-it-sub{color:var(--text2);font-weight:600}
  .mc-it-un{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;
    padding:0 5px;border-radius:9px;font-size:10.5px;font-weight:700;background:var(--blue-m);
    color:#06281c;flex-shrink:0}
  .mc-tab-un{background:var(--blue-m)!important;color:#06281c!important;font-weight:700}
  /* day separators in the conversation */
  .mc-day{display:flex;align-items:center;gap:10px;margin:14px 0 8px;color:var(--text3);font-size:10.5px;
    font-weight:700;text-transform:uppercase;letter-spacing:.6px}
  .mc-day:before,.mc-day:after{content:'';flex:1;height:1px;background:var(--border)}
  /* portal-connected chip in the conversation header */
  .mc-chip.portal{display:inline-block;margin-left:8px;padding:2px 8px;border-radius:10px;font-size:9.5px;
    font-weight:800;letter-spacing:.4px;text-transform:uppercase;vertical-align:2px;
    background:rgba(47,154,166,.16);border:1px solid var(--brand);color:var(--brand);white-space:nowrap}
  /* Sent-tab rows: status + channel under the snippet */
  .mc-sent-meta{display:flex;align-items:center;gap:7px;margin-top:3px;font-size:10px;color:var(--text3)}
  .mc-grp{display:flex;align-items:center;gap:7px;padding:12px 11px 5px;font-size:10px;font-weight:700;
    text-transform:uppercase;letter-spacing:.7px;color:var(--text3)}
  .mc-grp:first-child{padding-top:5px}
  .mc-grp-n{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;
    padding:0 5px;border-radius:8px;font-size:9.5px;background:var(--gray-l);color:var(--text2)}
  .mc-hit-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
  .mc-hit-name{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mc-hit-time{font-size:10px;color:var(--text3);flex-shrink:0}
  .mc-snip{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    overflow:hidden;line-height:1.4;margin-top:2px;font-size:11.5px;color:var(--text3)}
  .mc-hl{background:rgba(47,161,173,.26);color:var(--blue-m);border-radius:3px;padding:0 2px;font-weight:600}
  @keyframes mc-flash-kf{0%{box-shadow:0 0 0 2px var(--blue)}60%{box-shadow:0 0 0 2px var(--blue)}100%{box-shadow:0 0 0 2px transparent}}
  .mc-flash{animation:mc-flash-kf 1.6s var(--ease)}

  .mc-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;
    height:100%;color:var(--text3);text-align:center;padding:40px}
  .mc-empty svg{width:42px;height:42px;opacity:.3;stroke-width:1.3;margin-bottom:14px}
  .mc-empty .t{font-size:14px;font-weight:600;color:var(--text2);margin-bottom:5px}
  .mc-empty .d{font-size:12px;line-height:1.6;max-width:280px}

  /* Conversation pane */
  .mc-conv-head{display:flex;align-items:center;gap:12px;padding:15px 22px;
    border-bottom:1px solid var(--border-2);flex-shrink:0}
  .mc-conv-head .mc-it-name{font-size:15px;font-family:var(--font-display);font-weight:600}
  .mc-conv-meta{font-size:11.5px;color:var(--text3);margin-top:2px;display:flex;gap:9px;
    flex-wrap:wrap;align-items:center}
  .mc-conv-meta a{color:var(--blue-m);text-decoration:none}
  .mc-conv-meta a:hover{text-decoration:underline}
  .mc-log-btn{margin-left:auto;flex-shrink:0}

  /* CONTENT-AWARE SPLIT: the thread takes only the height its messages need (scrolling once
     it can't shrink further), and the composer absorbs ALL remaining space — so a short or
     empty conversation gives the writing area the room, while a long one keeps the history
     tall and the composer at its comfortable minimum. */
  .mc-thread{flex:0 1 auto;min-height:96px;overflow-y:auto;padding:20px 22px;display:flex;flex-direction:column;gap:13px}
  .mc-bubble{max-width:80%;border-radius:13px;padding:11px 14px;font-size:13px;line-height:1.5;
    position:relative;box-shadow:var(--sh-xs)}
  .mc-bubble .mc-subj{font-weight:700;font-size:12px;margin-bottom:5px;letter-spacing:.1px}
  .mc-bubble .mc-body-txt{white-space:pre-wrap;word-break:break-word;color:var(--text)}
  .mc-bubble .mc-meta{display:flex;align-items:center;gap:8px;margin-top:7px;font-size:10.5px;
    color:var(--text3)}
  .mc-out{align-self:flex-end;background:var(--blue-soft);border:1px solid rgba(47,161,173,.32)}
  .mc-in{align-self:flex-start;background:#1e242b;border:1px solid var(--border-2)}
  .mc-st{display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;
    font-size:9.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase}
  .mc-st.gray{background:var(--gray-l);color:var(--text2)}
  .mc-st.teal{background:var(--blue-l);color:var(--blue-m)}
  .mc-st.amber{background:var(--amber-l);color:var(--amber)}
  .mc-st.green{background:var(--green-l);color:var(--green)}
  .mc-st.red{background:var(--red-l);color:var(--red)}
  .mc-del{cursor:pointer;color:var(--text3);opacity:0;transition:opacity .15s}
  .mc-bubble:hover .mc-del{opacity:1}
  .mc-del:hover{color:var(--red)}
  .mc-thread-empty{margin:auto;text-align:center;color:var(--text3);font-size:12.5px;
    line-height:1.6;max-width:300px}

  /* Composer — grows into whatever the thread doesn't need; never shrinks below its content */
  .mc-composer{border-top:1px solid var(--border-2);padding:14px 22px 16px;flex:1 0 auto;
    display:flex;flex-direction:column;min-height:0;
    background:linear-gradient(180deg,rgba(255,255,255,.012),transparent)}
  .mc-thread-empty{margin:14px auto;max-width:460px}
  .mc-comp-row{display:flex;gap:9px;align-items:center;margin-bottom:9px}
  .mc-comp-row select,.mc-comp-row input{border:1px solid var(--border);border-radius:8px;
    padding:8px 11px;font-size:12.5px;color:var(--text);background:#13161b;outline:none;
    font-family:inherit;transition:all .15s}
  .mc-comp-row select:focus,.mc-comp-row input:focus{border-color:var(--blue);
    box-shadow:0 0 0 3px rgba(47,154,166,.18)}
  .mc-subject-in{flex:1}
  .mc-tmpl{min-width:150px}
  .mc-comp-body{width:100%;flex:1;border:1px solid var(--border);border-radius:9px;padding:11px 13px;
    font-size:13px;background:#13161b;color:var(--text);resize:none;min-height:150px;outline:none;
    font-family:inherit;line-height:1.5;transition:border-color .15s,box-shadow .15s}
  .mc-comp-body:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(47,154,166,.18)}
  .mc-comp-actions{display:flex;gap:8px;align-items:center;margin-top:11px;flex-wrap:wrap}
  .mc-spacer{flex:1}
  .mc-addfield{display:flex;gap:7px;align-items:center;margin-bottom:9px;padding:9px 11px;
    background:var(--amber-l);border:1px solid rgba(224,166,70,.3);border-radius:9px}
  .mc-addfield .mc-af-label{font-size:11.5px;color:var(--amber);font-weight:600;white-space:nowrap}
  .mc-addfield input{flex:1;background:#13161b;border:1px solid var(--border);border-radius:7px;
    padding:7px 10px;font-size:12px;color:var(--text);outline:none;font-family:inherit}

  /* Inline "log a reply" form */
  .mc-logform{margin:0 22px 14px;padding:13px;background:#1e242b;border:1px solid var(--border-2);
    border-radius:11px}
  .mc-logform .mc-lf-title{font-size:11.5px;font-weight:700;color:var(--text2);
    text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
  .mc-logform textarea{width:100%;border:1px solid var(--border);border-radius:8px;padding:9px 11px;
    font-size:12.5px;background:#13161b;color:var(--text);resize:vertical;min-height:60px;
    outline:none;font-family:inherit;line-height:1.5}
  .mc-logform .mc-lf-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:9px}

  /* Counts + transport note */
  .mc-counts{display:flex;gap:10px;padding:0 24px 12px;flex-wrap:wrap}
  .mc-count{display:flex;align-items:center;gap:8px;padding:7px 13px;background:#1e242b;
    border:1px solid var(--border-2);border-radius:10px;font-size:12px;color:var(--text2)}
  .mc-count b{color:var(--text);font-size:14px;font-weight:700}
  .mc-count .mc-cdot{width:8px;height:8px;border-radius:50%}
  .mc-note{font-size:11px;color:var(--text3);line-height:1.55;padding:11px 24px;margin-top:8px;
    border:1px solid var(--border-2);border-radius:var(--r);background:rgba(0,0,0,.14);display:flex;gap:9px;
    align-items:flex-start}
  .mc-note svg{width:15px;height:15px;flex-shrink:0;margin-top:1px;color:var(--gray)}
  .mc-note b{color:var(--text2)}
  .mc-note .mc-mode{display:inline-flex;align-items:center;padding:1px 8px;border-radius:20px;
    font-size:9.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;margin-left:4px}
  .mc-note .mc-mode.local{background:var(--amber-l);color:var(--amber)}
  .mc-note .mc-mode.server{background:var(--green-l);color:var(--green)}
