.workspace-main { min-width: 0; }
#consultation-notice { margin: 1rem clamp(18px,4vw,44px) 0; }
.consultation-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .65rem .9rem;
  margin-bottom: .4rem;
  border: 1px solid currentColor;
  border-radius: .75rem;
}
.consultation-alert time { font-size: .9em; }
.consultation-inbox { grid-column: 1 / -1; }
.consultation-card { padding: .75rem; margin: .65rem 0; }
.consultation-card .person-label { margin-bottom: .15rem; }
.consultation-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.consultation-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 3em;
  line-height: 1.5;
  margin: .35rem 0;
}
.consultation-history {
  max-height: min(36vh, 18rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  margin-bottom: .6rem;
  min-height: 4rem;
}
.consultation-history article { border-top: 1px solid var(--border); padding-top: .5rem; }
.consultation-history p { margin: .25rem 0; }
.consultation-body { white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-role] .nav-button #consultation-badge { flex: none; width: auto; font-size: .85em; filter: none; }
#consultation-badge[hidden], #consultation-notice[hidden] { display: none; }

.table-wrap { container-type: inline-size; }
.responsive-label { display: none; }
.responsive-table td, .responsive-table th { word-break: normal; overflow-wrap: normal; }
.responsive-table .person-label { display: inline-flex; align-items: center; gap: .5rem; vertical-align: middle; }
.responsive-table .profile-avatar { flex: none; }
.account-name { display: grid; text-align: left; }
.responsive-table .button { white-space: normal; margin-block: .15rem; }
.responsive-table td:nth-child(2), .responsive-table td:nth-child(3) { word-break: normal; }

@container (max-width: 1130px) {
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .responsive-table tbody tr:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: .45rem .8rem;
    padding: .8rem;
    border-bottom: 1px solid var(--border);
  }
  .responsive-table tbody tr[hidden] { display: none; }
  .responsive-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: break-word;
    text-align: left;
  }
  .responsive-label { display: block; font-weight: 700; font-size: .85em; }
}

body[data-role] #app {
  min-height: 0;
  height: calc(100vh - 68px - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - 68px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.access-panel { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
.access-panel button { width: 54px; height: 54px; }
body[data-role] dialog { max-height: calc(100dvh - 140px - env(safe-area-inset-bottom, 0px)); }
.access-tools { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
@media print {
  body[data-role] #app { height: auto; overflow: visible; }
}
