/* richtext-v1
 * Formatting toolbar, rendered colors / quotes, and the mobile Aa toggle.
 * Lives in its own file so it can stack on staff0, activity3 or phase1
 * without editing app.css.
 */

/* Rendered message / search / activity / edit history */
.rt-c-red{color:#e11d48}
.rt-c-orange{color:#d97706}
.rt-c-green{color:#159947}
.rt-c-blue{color:#1264a3}
.rt-c-purple{color:#7c3aed}
.rt-c-gray{color:#64748b}
.txt blockquote,
.sx-version blockquote,
.act-sum blockquote{
  margin:4px 0;
  padding:2px 0 2px 10px;
  border-left:4px solid #d0d7de;
  color:#1d1c1d;
}
.txt blockquote p,
.act-sum blockquote p{margin:0}
.act-sum b,.act-sum i,.act-sum s,.act-sum code{font:inherit}
.act-sum b{font-weight:700}
.act-sum i{font-style:italic}
.act-sum s{text-decoration:line-through}
.act-sum code{
  background:#f1f4f7;
  border-radius:4px;
  padding:0 4px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12.5px;
}

/* Toolbar */
.rt-bar{
  display:none;
  flex-direction:row;
  flex-wrap:wrap;
  align-items:center;
  gap:2px;
  width:100%;
  min-width:0;
  box-sizing:border-box;
  padding:2px 2px 6px;
  border-bottom:0.5px solid var(--line, #e5e9ee);
  order:-1;
}
.comp.rt-open .rt-bar,
.comp.rt-edit .rt-bar{display:flex}
.rt-btn{
  flex:0 0 auto;
  width:28px;
  height:28px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#2b3540;
  font:600 13px/1 inherit;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.rt-btn:hover,
.rt-btn[aria-expanded="true"]{background:#f1f4f7}
.rt-btn:focus-visible{outline:2px solid #1264a3;outline-offset:1px}
.rt-btn .rt-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700}
.rt-acol{
  font-weight:800;
  font-size:14px;
  line-height:1;
  border-bottom:3px solid #1264a3;
  padding-bottom:1px;
}
.rt-colorwrap{position:relative;display:inline-flex}
.rt-colors{
  position:absolute;
  left:0;
  bottom:calc(100% + 4px);
  z-index:40;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:6px;
  padding:8px;
  background:#fff;
  border:1px solid #c9d1da;
  border-radius:10px;
  box-shadow:0 8px 24px rgba(16,24,40,.12);
}
.rt-colors[hidden]{display:none !important}
.rt-swatch{
  width:22px;
  height:22px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.12);
  padding:0;
  cursor:pointer;
  background:currentColor;
}
.rt-swatch-clear{
  background:#fff;
  color:#55616d;
  font-size:11px;
  font-weight:700;
  line-height:22px;
  text-align:center;
}
.rt-aa{
  font-weight:800 !important;
  font-size:13px !important;
  letter-spacing:-0.02em;
}

/* Desktop: toolbar always on, above a single composer row.
   staff0 uses display:contents on .comp-row so a new first child would
   sit in that row. .rt-body becomes the row instead. */
@media (min-width:701px){
  .comp.rt-ready,
  .comp.row1.rt-ready{
    display:flex !important;
    flex-direction:column;
    align-items:stretch;
    flex-wrap:nowrap;
  }
  .comp.rt-ready .rt-bar{
    display:flex;
    flex:0 0 auto;
    width:100%;
    order:0;
    padding:4px 8px 2px;
  }
  .comp.rt-ready .rt-body{
    display:flex;
    flex-direction:row;
    align-items:center;
    flex-wrap:nowrap;
    width:100%;
    min-width:0;
    order:1;
  }
  .comp.rt-ready .rt-body .comp-row,
  .comp.rt-ready .rt-body .comp-tools{display:contents}
  .comp.rt-ready .rt-aa{display:none !important}
}
/* tablet2b-v1: same rules for an iPad window of 600-700px (html.nc-tablet) */
:where(html.nc-tablet) .comp.rt-ready,
  :where(html.nc-tablet) .comp.row1.rt-ready{
    display:flex !important;
    flex-direction:column;
    align-items:stretch;
    flex-wrap:nowrap;
  }
  :where(html.nc-tablet) .comp.rt-ready .rt-bar{
    display:flex;
    flex:0 0 auto;
    width:100%;
    order:0;
    padding:4px 8px 2px;
  }
  :where(html.nc-tablet) .comp.rt-ready .rt-body{
    display:flex;
    flex-direction:row;
    align-items:center;
    flex-wrap:nowrap;
    width:100%;
    min-width:0;
    order:1;
  }
  :where(html.nc-tablet) .comp.rt-ready .rt-body .comp-row,
  :where(html.nc-tablet) .comp.rt-ready .rt-body .comp-tools{display:contents}
  :where(html.nc-tablet) .comp.rt-ready .rt-aa{display:none !important}


/* Mobile: composer stays one line until Aa opens the toolbar above it. */
@media (max-width:700px){
  :where(html:not(.nc-tablet)) .comp.rt-ready .rt-body{display:contents}
  :where(html:not(.nc-tablet)) .comp.rt-ready .rt-bar{
    display:none;
    order:-1;
    padding:0 0 6px;
    border-bottom:0;
  }
  :where(html:not(.nc-tablet)) .comp.rt-ready.rt-open .rt-bar,
  html:where(:not(.nc-tablet)).nc-kb-open .comp.rt-ready.rt-open .rt-bar{display:flex}
  :where(html:not(.nc-tablet)) .comp-tools .rt-aa,
  :where(html:not(.nc-tablet)) .comp-row .rt-aa{
    display:inline-flex !important;
    flex:0 0 auto;
    width:32px !important;
    min-width:32px !important;
    height:32px !important;
    min-height:32px !important;
  }
  :where(html:not(.nc-tablet)) .comp.rt-open .rt-aa,
  :where(html:not(.nc-tablet)) .comp.rt-open [data-act="rt-aa"]{background:#e8f1f8;color:#1264a3}
}

/* Edit-message modal: always show the bar, hide Aa. */
.comp.rt-edit{
  display:flex !important;
  flex-direction:column;
  align-items:stretch;
  margin:0 0 10px !important;
  padding:0 !important;
  border:1px solid #c9d1da;
  border-radius:10px;
  background:#fff;
}
.comp.rt-edit .rt-bar{display:flex;padding:4px 6px;border-bottom:0.5px solid var(--line, #e5e9ee)}
.comp.rt-edit .rt-body{display:block;width:100%}
.comp.rt-edit .rt-aa{display:none !important}
.comp.rt-edit textarea,
.comp.rt-edit #sxEditText{
  width:100%;
  border:0 !important;
  min-height:120px;
  padding:8px 10px;
  box-sizing:border-box;
  font:inherit;
}

/* tablet2b-v1: phone rules scoped to html:not(.nc-tablet); iPad windows >= 600px keep the tablet layout */
