/* Shared alignment and reflow fixes; print page dimensions remain unchanged. */
@media screen {
  .shell, .page, .page-head > div, .card2, .card2-tt, .card2-bd, .accnav__item > span { min-width: 0; }
  .page-head h1, .page-head .sub, .card2-tt, .accmenu__mail { overflow-wrap: anywhere; }
  .btn { align-items: center; justify-content: center; gap: .45rem; }
  .btn > .ico, .rail-link > .ico, .accmenu__ico, .card2-ico { flex-shrink: 0; }
  .btn > .ico { vertical-align: middle; }
  .brand, .brand-word, .topbar-title { min-width: 0; }
  .brand-word { line-height: 1.2; }
  .brand img { flex-shrink: 0; object-fit: contain; }
  .card2-hd, .page-actions { flex-wrap: wrap; gap: .65rem; }
  .card2-ac { margin-left: auto; }
  .scroll, .table-responsive { max-width: 100%; overscroll-behavior-inline: contain; }
  .accnav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
  :where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
  @media (max-width: 767.98px) {
    .topbar { gap: .6rem; }
    .page-actions { width: 100%; }
    .page-actions .btn { white-space: normal; }
    .card2-hd { align-items: flex-start; }
    .card2-ac { max-width: 100%; }
    .form-control, .form-select { font-size: 16px; }
    .btn, .accmenu__item, .rail-link { min-height: 42px; }
    .modal-dialog { margin: .5rem; max-width: calc(100% - 1rem); }
    .modal-body { overflow-wrap: anywhere; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
}
.comm-search { max-width: 640px; margin-bottom: 1.25rem; }
.comm-search label, .comm-compose label { display: block; font-weight: 600; margin-bottom: .5rem; }
.comm-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.comm-list { list-style: none; margin: 0; padding: 0; }
.comm-list li { padding: 1rem 0; border-bottom: 1px solid #dbe3ee; overflow-wrap: anywhere; }
.comm-list li:first-child { padding-top: 0; }
.comm-list small { display: block; color: #52627b; margin-top: .25rem; }
.comm-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.comm-compose .comm-actions { justify-content: space-between; }
.comm-members { overflow-wrap: anywhere; }
.comm-log { height: 48vh; min-height: 200px; max-height: 540px; overflow-y: auto; overscroll-behavior: contain; padding: .75rem; border: 1px solid #dbe3ee; border-radius: 10px; background: #f5f8fc; }
.comm-message { background: white; border: 1px solid #dbe3ee; border-radius: 10px; padding: .85rem 1rem; margin-bottom: .75rem; max-width: 90%; overflow-wrap: anywhere; }
.comm-message--mine { margin-left: auto; background: #eaf1ff; border-color: #c7d8fa; }
.comm-message header { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .8rem; color: #52627b; margin-bottom: .45rem; }
.comm-message header b { color: #172b4d; }
.comm-message p { white-space: pre-wrap; margin: 0; }
.comm-compose { margin-top: 1rem; }
.comm-compose textarea { resize: vertical; min-height: 95px; }
.signature-form { max-width: 640px; }
.signature-consent { display: flex; align-items: flex-start; gap: .6rem; margin: 1rem 0; }
.signature-consent input { flex: 0 0 auto; margin-top: .3rem; }
.signature-preview { width: 100%; max-width: 360px; height: auto; border: 1px solid #dbe3ee; }
.signature-file.form-control { height: auto; min-height: 48px; padding: 6px; line-height: 32px; overflow: hidden; }
.signature-file::file-selector-button { margin: 0 12px 0 0; padding: 0 14px; height: 34px; border: 1px solid #c7d8fa; border-radius: 7px; background: #eaf1ff; color: #1e40af; font: inherit; font-weight: 600; cursor: pointer; }
.signature-file::file-selector-button:hover { background: #dbeafe; }
#signature-file-state { min-width:0; max-width:100%; overflow-wrap:anywhere; }
#signature-help { display:block; margin-top:4px; }
.herostate .herostate__ico { color:var(--blue-700); }
.office-moa-card__actions { display:flex; flex-wrap:wrap; gap:8px; }
.office-moa-card__actions > *, .office-moa-card__actions > .btn { flex:1 1 132px; width:auto; min-width:0; }
.office-moa-card__actions .btn { width:100%; min-height:38px; padding:8px 12px; gap:6px; white-space:normal; line-height:1.4; }
.segment-stack label { gap:12px; padding:14px 16px; }
.segment-stack label > .ico { flex:0 0 20px; width:20px; height:20px; }
.segment-stack label > span { min-width:0; overflow-wrap:anywhere; }
.segment-stack label b { display:block; margin-bottom:4px; }
.segment-stack label span { line-height:1.45; }
.attendance-note-text { margin-top:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.comm-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.comm-filters { max-width: none; display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.comm-filters > div:first-of-type { flex: 1 1 240px; }
.comm-filters > div { min-width: 0; }
.comm-contact-scroll { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.comm-contact { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.comm-contact > div { min-width: 0; flex: 1 1 180px; }
.chat-launch { position:fixed; right:20px; bottom:20px; z-index:1045; display:flex; align-items:center; gap:8px; padding:12px 18px; border:0; border-radius:24px; background:#2141b0; color:#fff; box-shadow:0 4px 18px #172b4d33; font-weight:700; }
.chat-dock { position:fixed; right:20px; bottom:0; width:380px; max-width:calc(100vw - 16px); height:min(610px,85dvh); background:#fff; border:1px solid #c7d8fa; border-radius:14px 14px 0 0; box-shadow:0 4px 28px #172b4d40; z-index:1051; overflow:hidden; display:flex; flex-direction:column; }
.chat-dock[hidden], .chat-launch[hidden] { display:none; }
.chat-dock-head { display:flex; align-items:center; gap:4px; padding:8px 10px; background:#2141b0; color:white; }
.chat-dock-head b { margin-right:auto; }
.chat-dock-head button { background:transparent; color:white; border:0; min-width:36px; min-height:36px; border-radius:6px; }
.chat-dock-head button:hover { background:#ffffff26; }
.chat-dock iframe { width:100%; flex:1; min-height:0; border:0; background:white; }
.chat-embedded { background:white; }
.chat-embedded main { padding:12px; }
.chat-embedded .card2-hd, .chat-embedded .comm-members { display:none; }
.chat-embedded .card2-bd { padding:10px; }
.chat-embedded .comm-log { height:calc(100dvh - 230px); min-height:100px; max-height:none; }
.chat-embedded .comm-compose textarea { min-height:60px; max-height:100px; }
.chat-embedded .comm-message { font-size:13px; max-width:94%; padding:8px 10px; border-radius:14px; }
.chat-embedded .comm-message header { font-size:10px; }
.chat-embedded .comm-message header b, .chat-embedded .comm-message header span { display:none; }
.chat-embedded .comm-compose label, .chat-embedded .comm-actions small { display:none; }
.chat-embedded .comm-compose .comm-actions { justify-content:flex-end; }
.chat-embedded .comm-tabs { gap:5px; }
.chat-embedded .comm-tabs .btn { font-size:12px; padding:6px 9px; }
.chat-embedded .comm-filters { gap:8px; }
.chat-embedded .comm-filters label { font-size:12px; }
.chat-embedded .comm-contact-scroll { max-height:none; }
.chat-embedded .comm-contact { gap:8px; }
.chat-embedded .comm-contact > div { flex-basis:140px; }
.chat-conversation main { height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
.chat-conversation main > h1 { flex-shrink:0; }
.chat-conversation .card2 { min-height:0; flex:1; display:flex; flex-direction:column; margin-bottom:0; }
.chat-conversation .card2-bd { min-height:0; flex:1; display:flex; flex-direction:column; }
.chat-conversation .comm-log { min-height:40px; flex:1; height:auto!important; }
.chat-conversation .comm-compose { flex-shrink:0; margin-top:8px; }
.chat-conversation .comm-compose .comm-actions { margin-top:6px; }
.chat-conversation .comm-compose textarea { resize:none; }
@media(max-width:480px) { .chat-dock { right:8px; height:min(590px,85dvh); } }
@media print { .chat-dock, .chat-launch { display:none!important; } }
@media (max-width: 767.98px) {
  .comm-columns { grid-template-columns: minmax(0, 1fr); }
  .comm-message { max-width: 100%; padding: .7rem; }
  .comm-log { padding: .5rem; height: 42vh; }
  .comm-actions form { flex: 1 1 auto; }
  .comm-actions form .btn { width: 100%; }
}

/* Folder documents: keep upload/replace outside the truncated filename area. */
.paperslots li.paperslots__paper {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: .65rem .7rem;
  align-items: start;
}
.paperslots__paper > .paperslots__acts {
  grid-column: 2;
  width: auto;
  margin: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.paperslots__paper > .paperslots__replacement {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.paperslots__replacement .filepick__txt b,
.paperslots__replacement .filepick__txt span,
.paperslots__upload .filepick__txt b,
.paperslots__upload .filepick__txt span,
.paperslots__name .paperslots__reason {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.paperslots .filepick:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.paperslots .filepick__button { flex-shrink: 0; }
.paperslots .filepick.is-busy { pointer-events: none; }
