
/* ============================================================================
   Communication drawer + Resource Hub + account access (2026-07-27)
   Appended extension styles. Tokens, radii, and shadows follow the existing
   system. New z-index layers: drawer 25, message menu 26, toast raised to 40.
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.toast {
  z-index: 40;
}

.link-action {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  padding: 4px 0;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-hint {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* --- Top bar entry points ------------------------------------------------ */

.resources-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
  border: 1px solid rgba(24, 34, 47, 0.12);
  border-radius: 10px;
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 8px 22px rgba(24, 34, 47, 0.07);
  padding: 9px 13px;
  font-size: 0.9rem;
  font-weight: 850;
}

.resources-link:hover,
.resources-link.is-active {
  border-color: rgba(18, 111, 102, 0.32);
  background: var(--surface-2);
}

.resources-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.messages-button {
  position: relative;
  color: var(--teal-dark);
}

.messages-button:hover,
.messages-button[aria-expanded="true"] {
  border-color: rgba(18, 111, 102, 0.32);
  background: var(--surface-2);
}

.unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  border: 2px solid var(--bg);
  border-radius: 10px;
  background: var(--coral);
  color: #fffefa;
  padding: 0 4px;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.account-button svg {
  width: 17px;
  height: 17px;
}

body[data-view="home"] .resources-link,
body[data-view="home"] .messages-button,
body[data-role="public"] .resources-link,
body[data-role="public"] .messages-button,
body:not([data-role]) .resources-link,
body:not([data-role]) .messages-button,
body[data-role="public"] .messages-drawer {
  display: none !important;
}

/* --- Messages drawer ----------------------------------------------------- */

.messages-drawer {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  max-height: calc(100vh - 92px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(24, 34, 47, 0.2);
  overflow: hidden;
}

.messages-drawer[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .messages-drawer {
    animation: rise 200ms ease;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.drawer-title {
  font-size: 1.05rem;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.conn-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.conn-state[data-state="reconnecting"] .conn-dot {
  background: var(--amber);
}

.conn-state[data-state="offline"] .conn-dot {
  background: var(--coral);
}

.drawer-head-actions {
  display: flex;
  gap: 6px;
}

.drawer-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
}

.drawer-icon-button:hover,
.drawer-icon-button[aria-expanded="true"] {
  background: var(--surface-2);
}

.drawer-icon-button svg {
  width: 16px;
  height: 16px;
}

.drawer-search {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.drawer-search input {
  min-height: 40px;
}

.drawer-notice {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.drawer-notice strong {
  font-size: 0.9rem;
}

.drawer-notice p {
  margin: 0;
  color: var(--muted);
}

.drawer-notice .secondary-action {
  min-height: 36px;
  width: max-content;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.drawer-nav {
  display: grid;
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 10px 4px;
}

.drawer-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.drawer-tab[aria-selected="true"] {
  border-color: rgba(18, 111, 102, 0.4);
  background: var(--surface-2);
  color: var(--teal-dark);
}

.convo-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.convo-row:hover,
.convo-row.is-selected {
  border-color: rgba(18, 111, 102, 0.4);
  background: var(--surface-2);
}

.convo-row.is-unread .convo-name {
  font-weight: 900;
}

.convo-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.convo-avatar.is-company {
  background: var(--teal);
  color: #fffefa;
}

.convo-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.convo-name {
  font-size: 0.9rem;
  font-weight: 800;
}

.convo-sub {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.convo-time {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.convo-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  background: var(--coral);
  color: #fffefa;
  padding: 0 5px;
  font-size: 0.66rem;
  font-weight: 900;
}

.drawer-convo {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
}

.convo-context {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  min-height: 46px;
}

.convo-context-label {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.convo-context-label strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-context-label small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.convo-context-label small svg {
  width: 12px;
  height: 12px;
}

.convo-back {
  flex: 0 0 auto;
}

.convo-mute {
  flex: 0 0 auto;
}

.convo-mute[aria-pressed="true"] {
  background: rgba(193, 132, 36, 0.14);
  border-color: rgba(193, 132, 36, 0.4);
  color: #7a4b0f;
}

.pinned-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-bottom: 1px solid rgba(193, 132, 36, 0.35);
  background: rgba(193, 132, 36, 0.1);
  color: #6d430d;
  padding: 9px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.pinned-strip svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.pinned-strip strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.convo-scroll {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  padding: 12px;
  outline: none;
}

.convo-scroll:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(18, 111, 102, 0.4);
}

.convo-log {
  display: grid;
  gap: 2px;
}

.day-divider,
.unread-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-divider::before,
.day-divider::after,
.unread-divider::before,
.unread-divider::after {
  content: "";
  border-top: 1px solid var(--line);
}

.unread-divider {
  color: var(--coral);
}

.unread-divider::before,
.unread-divider::after {
  border-color: rgba(200, 91, 69, 0.4);
}

.load-older {
  justify-self: center;
  margin: 0 0 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.msg-row {
  position: relative;
  display: grid;
  gap: 3px;
  border-radius: 8px;
  padding: 5px 30px 5px 10px;
}

.msg-row:hover,
.msg-row:focus-within {
  background: rgba(24, 34, 47, 0.035);
}

.msg-row.is-own {
  border-left: 2px solid rgba(18, 111, 102, 0.45);
}

.msg-row.is-announcement {
  border-left: 3px solid var(--amber);
  background: rgba(193, 132, 36, 0.07);
  margin: 4px 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.msg-head strong {
  font-size: 0.84rem;
}

.msg-head time {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.msg-announcement-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7a4b0f;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.msg-announcement-tag svg {
  width: 12px;
  height: 12px;
}

.msg-body {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-body a {
  color: var(--teal-dark);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg-quote {
  border-left: 2px solid var(--line);
  color: var(--muted);
  padding-left: 8px;
  font-size: 0.82rem;
}

.msg-resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  border: 1px solid rgba(18, 111, 102, 0.25);
  border-radius: 8px;
  background: rgba(18, 111, 102, 0.08);
  color: var(--teal-dark);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.msg-resource-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.msg-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.msg-state svg {
  width: 12px;
  height: 12px;
}

.msg-state.is-failed {
  color: #9e3c2a;
  font-weight: 850;
}

.msg-state.is-queued {
  color: #7a4b0f;
  font-weight: 850;
}

.msg-state button {
  min-height: 24px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 850;
}

.msg-tombstone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.msg-tombstone svg {
  width: 13px;
  height: 13px;
}

.msg-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
}

.msg-row:hover .msg-menu-btn,
.msg-row:focus-within .msg-menu-btn,
.msg-menu-btn:focus-visible {
  opacity: 1;
}

.msg-menu-btn:hover {
  border-color: var(--line);
  background: var(--surface);
}

.msg-menu-btn svg {
  width: 14px;
  height: 14px;
}

.msg-menu {
  position: fixed;
  z-index: 26;
  display: grid;
  gap: 2px;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(24, 34, 47, 0.18);
  padding: 5px;
}

.msg-menu[hidden] {
  display: none !important;
}

.msg-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 7px 9px;
  font-size: 0.84rem;
  font-weight: 750;
  text-align: left;
}

.msg-menu button:hover,
.msg-menu button:focus-visible {
  background: var(--surface-2);
  color: var(--teal-dark);
}

.msg-menu button.is-danger {
  color: #9e3c2a;
}

.msg-menu button svg {
  width: 14px;
  height: 14px;
}

.jump-latest {
  position: absolute;
  right: 14px;
  bottom: 118px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 10px 26px rgba(24, 34, 47, 0.16);
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 850;
}

.jump-latest svg {
  width: 14px;
  height: 14px;
}

.convo-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 16px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.convo-empty strong {
  color: var(--ink);
}

/* --- Composer ------------------------------------------------------------ */

.composer {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: rgba(246, 244, 239, 0.6);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}

.composer-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-attachment .msg-resource-chip {
  margin-top: 0;
}

.composer-attachment button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.composer-attachment button svg {
  width: 12px;
  height: 12px;
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.composer-row textarea {
  min-height: 42px;
  max-height: 118px;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
}

.composer-send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fffefa;
}

.composer-send:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.composer-send svg {
  width: 17px;
  height: 17px;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-tools {
  display: flex;
  gap: 6px;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 850;
}

.composer-tool svg {
  width: 13px;
  height: 13px;
}

.composer-tool[aria-pressed="true"] {
  border-color: rgba(193, 132, 36, 0.5);
  background: rgba(193, 132, 36, 0.14);
  color: #7a4b0f;
}

.composer-help {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.composer-count {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.composer-count.is-warning {
  color: #9e3c2a;
}

/* --- Drawer search results ----------------------------------------------- */

.drawer-results {
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.drawer-results .eyebrow {
  margin: 0;
}

.result-row {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.result-row:hover {
  border-color: rgba(18, 111, 102, 0.4);
  background: var(--surface-2);
}

.result-row strong {
  font-size: 0.86rem;
}

.result-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.result-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.results-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* --- Resource Hub -------------------------------------------------------- */

.resources-header {
  align-items: flex-start;
}

.resources-lede {
  margin: 10px 0 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
}

.resources-header-tools {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.resources-sync {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.resources-sync.is-offline {
  color: #7a4b0f;
  font-weight: 850;
}

.resources-notice {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.resources-notice p {
  margin: 0;
  color: var(--muted);
}

.manager-resource-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(24, 34, 47, 0.08);
  padding: 12px;
}

.resource-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.resource-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 11px;
  font-size: 0.84rem;
  font-weight: 800;
}

.resource-tab[aria-selected="true"] {
  border-color: rgba(18, 111, 102, 0.4);
  background: var(--surface-2);
  color: var(--teal-dark);
}

.resource-tab .count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(24, 34, 47, 0.08);
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 900;
}

.resource-tab .count-pill.is-alert {
  background: rgba(200, 91, 69, 0.16);
  color: #9e3c2a;
}

.resource-counts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.resource-counts strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.resources-pinned {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.resources-pinned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.pinned-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(18, 111, 102, 0.28);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 34, 47, 0.07);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.pinned-card:hover {
  background: var(--surface-2);
}

.pinned-card .resource-icon {
  width: 34px;
  height: 34px;
}

.pinned-card strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
}

.pinned-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.resources-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 800;
}

.filter-chip[aria-pressed="true"] {
  border-color: rgba(18, 111, 102, 0.42);
  background: var(--teal);
  color: #fffefa;
}

.team-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.team-filter label {
  font-size: 0.76rem;
}

.team-filter select {
  width: auto;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.resource-list {
  display: grid;
  gap: 10px;
}

.resource-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 34, 47, 0.06);
  padding: 14px;
}

.resource-card.is-archived {
  opacity: 0.78;
}

.resource-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--teal);
}

.resource-icon svg {
  width: 20px;
  height: 20px;
}

.resource-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.resource-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resource-title-row h3 {
  margin: 0;
  font-size: 1rem;
}

.resource-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resource-badge.is-pinned {
  background: rgba(18, 111, 102, 0.12);
  color: var(--teal-dark);
}

.resource-badge.is-new {
  background: rgba(49, 95, 145, 0.14);
  color: var(--blue);
}

.resource-badge.is-updated {
  background: rgba(193, 132, 36, 0.16);
  color: #7a4b0f;
}

.resource-badge.is-draft {
  background: rgba(24, 34, 47, 0.08);
  color: var(--muted);
}

.resource-badge.is-archived {
  background: rgba(24, 34, 47, 0.08);
  color: var(--muted);
}

.resource-badge.is-issue {
  background: rgba(200, 91, 69, 0.14);
  color: #9e3c2a;
}

.resource-badge svg {
  width: 11px;
  height: 11px;
}

.resource-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.resource-progress {
  display: grid;
  gap: 5px;
  max-width: 300px;
}

.resource-progress small {
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 850;
}

.resource-progress-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(24, 34, 47, 0.09);
  overflow: hidden;
}

.resource-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
}

.resource-progress.is-complete small {
  color: var(--teal-dark);
}

.resource-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-actions .secondary-action {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.resource-overflow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.resource-overflow:hover {
  color: var(--teal-dark);
  background: var(--surface-2);
}

.resource-overflow svg {
  width: 16px;
  height: 16px;
}

.resource-skeleton {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(255, 254, 250, 0.9) 40%, rgba(237, 243, 241, 0.9) 50%, rgba(255, 254, 250, 0.9) 60%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .resource-skeleton {
    animation: shimmer 1.4s ease infinite;
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -80% 0;
  }
}

.resources-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 26px;
  line-height: 1.55;
}

.resources-empty strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.resources-empty p {
  margin: 0;
}

/* --- Dialog framework ---------------------------------------------------- */

.sb-dialog {
  width: min(94vw, 560px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(15, 35, 45, 0.28);
  padding: 0;
}

.sb-dialog::backdrop {
  background: rgba(12, 27, 35, 0.6);
  backdrop-filter: blur(3px);
}

.sb-dialog-inner {
  display: grid;
  gap: 14px;
  max-height: min(84vh, 760px);
  overflow-y: auto;
  padding: 24px;
}

.resource-editor-dialog,
.user-access-dialog {
  width: min(94vw, 680px);
}

.resource-detail-dialog {
  width: min(96vw, 860px);
}

.sb-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sb-dialog-head h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.sb-dialog-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.sb-dialog-close:hover {
  color: var(--teal-dark);
  background: var(--surface-2);
}

.sb-dialog-close svg {
  width: 16px;
  height: 16px;
}

.sb-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.sb-dialog-actions .link-action {
  margin-right: auto;
}

.dialog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  padding: 2px 0;
  font-size: 0.8rem;
  font-weight: 850;
}

.dialog-back svg {
  width: 14px;
  height: 14px;
}

.form-error {
  margin: 0;
  min-height: 1.2em;
  color: #9e3c2a;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.4;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.dialog-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(193, 132, 36, 0.4);
  border-radius: 8px;
  background: rgba(193, 132, 36, 0.1);
  color: #6d430d;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.dialog-note.is-info {
  border-color: rgba(49, 95, 145, 0.35);
  background: rgba(49, 95, 145, 0.08);
  color: var(--blue);
}

.dialog-note svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

/* --- Resource detail ----------------------------------------------------- */

.detail-meta-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-meta-grid strong {
  color: var(--ink);
  font-weight: 800;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail-body-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.checklist-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checklist-progress-head strong {
  color: var(--teal-dark);
  font-size: 0.88rem;
}

.checklist-complete-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(18, 111, 102, 0.35);
  border-radius: 8px;
  background: rgba(18, 111, 102, 0.1);
  color: var(--teal-dark);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

.checklist-complete-banner svg {
  width: 16px;
  height: 16px;
}

.checklist-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.checklist-item label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 48px;
  padding: 12px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.checklist-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--teal);
}

.checklist-item.is-complete label {
  color: var(--muted);
}

.checklist-item.is-complete .checklist-label {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.checklist-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}

.checklist-item.is-disabled {
  opacity: 0.65;
}

.external-link-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.external-link-domain {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.external-link-domain strong {
  color: var(--ink);
}

.external-link-domain svg {
  width: 14px;
  height: 14px;
}

.file-panel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.file-panel small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.secure-file-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.secure-file-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.secure-file-icon {
  width: 44px;
  height: 44px;
}

.secure-file-title {
  min-width: 0;
}

.secure-file-title strong,
.secure-file-title small {
  display: block;
}

.secure-file-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secure-file-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.secure-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secure-file-actions button {
  min-height: 38px;
}

.secure-file-preview {
  display: grid;
  min-height: 440px;
  background: var(--surface-2);
}

.secure-file-preview iframe {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 440px;
  border: 0;
  background: var(--surface-2);
}

.secure-file-preview img {
  display: block;
  width: 100%;
  max-height: min(62vh, 620px);
  margin: auto;
  object-fit: contain;
}

.secure-file-loading,
.secure-file-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 112px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.secure-file-fallback.is-error {
  color: var(--red);
}

.secure-file-fallback svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.secure-file-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: secure-file-spin 0.8s linear infinite;
}

.secure-file-privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 9px 14px;
  font-size: 0.74rem;
}

.secure-file-privacy svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

@keyframes secure-file-spin {
  to {
    transform: rotate(360deg);
  }
}

.related-list {
  display: grid;
  gap: 6px;
}

.related-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
}

.related-list button:hover {
  background: var(--surface-2);
}

.related-list svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.issue-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.issue-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

/* --- Resource editor ----------------------------------------------------- */

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-grid .form-row.is-wide {
  grid-column: 1 / -1;
}

.editor-items {
  display: grid;
  gap: 8px;
}

.editor-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.editor-item-fields {
  display: grid;
  gap: 6px;
}

.editor-item-fields input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.88rem;
}

.editor-item-tools {
  display: grid;
  gap: 4px;
}

.editor-item-tools button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.editor-item-tools button:hover:not(:disabled) {
  color: var(--teal-dark);
  background: var(--surface-2);
}

.editor-item-tools button svg {
  width: 13px;
  height: 13px;
}

.editor-add-item {
  width: max-content;
}

.analyst-picker {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  max-height: 160px;
  overflow-y: auto;
}

.analyst-picker label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}

.analyst-picker input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.upload-panel {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  transition: border-color 140ms ease, background 140ms ease;
}

.upload-panel.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-panel-intro {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-panel-intro strong,
.upload-panel-intro small {
  display: block;
}

.upload-panel-intro strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.upload-panel-intro small {
  color: var(--muted);
  font-size: 0.77rem;
}

.upload-panel-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--teal-dark);
}

.upload-panel-icon svg {
  width: 18px;
  height: 18px;
}

.upload-panel input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-progress-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(24, 34, 47, 0.09);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 200ms ease;
}

.upload-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.upload-state.is-error {
  color: #9e3c2a;
}

.upload-state.is-done {
  color: var(--teal-dark);
}

.editor-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.editor-status.is-saved {
  color: var(--teal-dark);
}

.editor-status.is-error {
  color: #9e3c2a;
}

.confirm-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  font-size: 0.86rem;
  color: var(--muted);
}

.confirm-summary strong {
  color: var(--ink);
}

/* --- Picker dialog ------------------------------------------------------- */

.picker-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.picker-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.picker-list button:hover {
  border-color: rgba(18, 111, 102, 0.4);
  background: var(--surface-2);
}

.picker-list strong {
  display: block;
  font-size: 0.88rem;
}

.picker-list small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.picker-list svg {
  width: 16px;
  height: 16px;
  color: var(--teal);
}

/* --- Account settings + user access -------------------------------------- */

.account-email-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.account-email-row strong {
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.account-email-row small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  min-height: 22px;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-pill svg {
  width: 11px;
  height: 11px;
}

.state-pill.is-active {
  background: rgba(18, 111, 102, 0.12);
  color: var(--teal-dark);
}

.state-pill.is-pending {
  background: rgba(49, 95, 145, 0.12);
  color: var(--blue);
}

.state-pill.is-expired {
  background: rgba(193, 132, 36, 0.16);
  color: #7a4b0f;
}

.state-pill.is-suspended {
  background: rgba(200, 91, 69, 0.14);
  color: #9e3c2a;
}

.prefs-form {
  display: grid;
  gap: 12px;
}

.prefs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
}

.prefs-row > span strong {
  display: block;
  font-size: 0.9rem;
}

.prefs-row > span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.prefs-row select {
  width: auto;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.prefs-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--teal);
}

.quiet-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mute-list {
  display: grid;
  gap: 6px;
}

.mute-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.86rem;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.user-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-row-main strong {
  font-size: 0.92rem;
}

.user-row-main small {
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.user-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-row-actions .secondary-action,
.user-row-actions .danger-action {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.invite-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.invite-form .form-row.is-wide,
.invite-form .form-error,
.invite-form .form-hint,
.invite-form .sb-inline-actions {
  grid-column: 1 / -1;
}

.sb-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.delivery-list {
  display: grid;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}

.delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 10px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1120px) {
  .messages-drawer {
    width: min(380px, calc(100vw - 24px));
  }

  .resources-header {
    flex-direction: column;
  }

  .resources-header-tools {
    width: 100%;
    justify-items: stretch;
  }

  .resources-search {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
  }

  .journal-link {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: 44px;
    max-width: none;
    min-height: 44px;
    padding: 0;
  }

  .journal-link span {
    display: none;
  }

  .topbar > .resources-link {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .resources-link span {
    display: none;
  }

  .topbar > .messages-button {
    grid-column: 4;
    grid-row: 1;
    width: 44px;
    height: 44px;
  }

  .session-bar {
    grid-column: 5;
    grid-row: 1;
  }

  .secure-file-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .secure-file-actions {
    grid-column: 1 / -1;
  }

  .secure-file-actions button {
    flex: 1;
    justify-content: center;
  }

  .secure-file-preview,
  .secure-file-preview iframe {
    min-height: 360px;
  }

  .messages-drawer {
    top: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .drawer-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .drawer-icon-button,
  .composer-tool {
    min-height: 44px;
    min-width: 44px;
  }

  .composer-send {
    width: 46px;
    height: 46px;
  }

  .jump-latest {
    bottom: 132px;
  }

  .resource-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .resource-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .resource-actions .secondary-action {
    min-height: 44px;
  }

  .filter-chip,
  .resource-tab {
    min-height: 44px;
  }

  .team-filter {
    margin-left: 0;
    width: 100%;
  }

  .team-filter select {
    flex: 1;
  }

  .editor-grid,
  .invite-form {
    grid-template-columns: 1fr;
  }

  .quiet-hours-grid {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-row-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .messages-drawer,
  .view.is-active {
    animation: none;
  }

  .upload-progress-fill {
    transition: none;
  }
}

/* --- Identity accents (2026-07-27 master brief) ---------------------------
   One deterministic accent per person, always paired with a name or
   initials. Colors identify people, never roles; all eight pass WCAG AA for
   white text and are distinct from the action teal. --- */

.identity-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #fffefa;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.identity-chip-lg {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.identity-0 { background: #315f91; }
.identity-1 { background: #6d430d; }
.identity-2 { background: #5d3a86; }
.identity-3 { background: #205e33; }
.identity-4 { background: #8a2f52; }
.identity-5 { background: #0f5c74; }
.identity-6 { background: #4d5420; }
.identity-7 { background: #4a5568; }

.convo-avatar.identity-0, .convo-avatar.identity-1, .convo-avatar.identity-2,
.convo-avatar.identity-3, .convo-avatar.identity-4, .convo-avatar.identity-5,
.convo-avatar.identity-6, .convo-avatar.identity-7 {
  color: #fffefa;
}

.msg-head .identity-chip {
  margin-right: 2px;
}

.invite-identity-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 10px;
}

.invite-identity-preview small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

html[data-theme="dark"] .identity-chip,
html[data-theme="dark"] .convo-avatar {
  outline: 1px solid rgba(24, 34, 47, 0.35);
}

.msg-head {
  align-items: center;
}
