:root {
  --bg: #eff2f8;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-muted: #f2f4fa;
  --rail: #34284f;
  --rail-soft: #46376a;
  --ink: #1c2540;
  --muted: #7d879b;
  --line: #e6eaf3;
  --accent: #5b4cf0;
  --accent-soft: rgba(91, 76, 240, 0.12);
  --danger: #f04461;
  --success: #22b07d;
  --shadow: 0 22px 50px rgba(31, 41, 63, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-ui: "Pretendard Variable", "Segoe UI Variable", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(91, 76, 240, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f8fc 0%, #edf1f8 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

.install-prompt {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  background: rgba(52, 40, 79, 0.96);
  box-shadow: 0 20px 42px rgba(26, 20, 44, 0.26);
  color: #ffffff;
  backdrop-filter: blur(14px);
}

.install-prompt-copy {
  display: grid;
  gap: 4px;
}

.install-prompt-copy strong {
  font-size: 14px;
}

.install-prompt-copy span {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.install-prompt .ghost-button {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.install-prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-push-prompt {
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
}

.web-push-prompt .primary-button {
  padding: 10px 14px;
}

body.modal-open {
  overflow: hidden;
}

.background-glow {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.65;
  pointer-events: none;
}

.background-glow-left {
  top: -120px;
  left: -140px;
  width: 260px;
  height: 260px;
  background: rgba(91, 76, 240, 0.12);
}

.background-glow-right {
  right: -120px;
  bottom: -140px;
  width: 300px;
  height: 300px;
  background: rgba(23, 170, 135, 0.1);
}

.hidden {
  display: none !important;
}

.login-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7a82a4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-brand {
  padding: 10px 12px 12px 2px;
}

.login-brand h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.login-copy {
  max-width: 32rem;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.login-form,
.seed-panel,
.panel,
.room-panel,
.conversation-shell,
.inspector {
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-form,
.seed-panel,
.panel {
  border-radius: var(--radius-lg);
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.seed-panel {
  display: none !important;
}

.seed-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.seed-header h2,
.section-title-row h3,
.list-title-group h2,
.conversation-header h2,
.empty-state h3,
#meName {
  margin: 0;
}

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

.field,
.switch-field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.switch-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}

button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9dfec;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px 15px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(91, 76, 240, 0.52);
  box-shadow: 0 0 0 4px rgba(91, 76, 240, 0.12);
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: default;
  opacity: 0.56;
  transform: none;
}

.primary-button {
  background: linear-gradient(135deg, #5b4cf0, #7166ff);
  color: #ffffff;
}

.ghost-button {
  background: var(--surface-muted);
  color: var(--ink);
}

.danger-button {
  background: rgba(240, 68, 97, 0.12);
  color: #cc2f50;
}

.compact-button {
  padding: 10px 14px;
  font-size: 13px;
}

.send-button {
  min-width: 96px;
}

.seed-account {
  border: 1px solid #e1e6f1;
  background: #ffffff;
  color: var(--ink);
}

.error-text {
  margin: 0;
  color: #c12749;
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 104px minmax(360px, 420px) minmax(480px, 1fr) minmax(280px, 320px);
  gap: 18px;
  height: var(--app-viewport-height, 100vh);
  min-height: var(--app-viewport-height, 100vh);
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
}

.app-nav,
.room-panel,
.conversation-shell,
.inspector {
  min-height: 0;
}

.app-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 0;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--rail) 0%, #2e2547 100%);
  box-shadow: var(--shadow);
}

.app-nav-top {
  display: grid;
  gap: 22px;
}

.profile-dock {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0;
  padding: 0 12px;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
}

.profile-dock:hover,
.nav-icon-button:hover {
  transform: none;
}

.profile-dock-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--rail);
  font-size: 12px;
  font-weight: 700;
}

.avatar-token {
  --avatar-hue: 248;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: hsl(var(--avatar-hue) 65% 92%);
  color: hsl(var(--avatar-hue) 35% 28%);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.avatar-lg {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
  border: 2px solid #ffffff;
}

.nav-icon-stack {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.nav-icon-stack-bottom {
  gap: 14px;
}

.nav-icon-button {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  width: 66px;
  min-height: 54px;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
}

.nav-icon-button.is-active {
  background: linear-gradient(135deg, #5b4cf0, #735dff);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(91, 76, 240, 0.34);
}

.nav-icon {
  font-size: 14px;
  font-weight: 800;
}

.nav-label {
  max-width: 58px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon-button.is-active .nav-label {
  color: #ffffff;
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.room-panel,
.conversation-shell,
.inspector {
  border-radius: var(--radius-xl);
}

.room-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  min-height: 0;
}

.list-header {
  display: grid;
  gap: 14px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.list-header-row,
.list-title-group,
.list-action-group,
.list-summary-row,
.room-card-top,
.room-preview-row,
.section-title-row,
.composer-actions,
.meta-row,
.conversation-header,
.header-actions,
.conversation-title-group,
.message-search-panel-header,
.notification-card-top,
.erp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.conversation-title-group {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.conversation-subtitle {
  flex-basis: 100%;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.list-title-group h2 {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.list-action-group {
  gap: 10px;
}

.list-icon-button {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: #6f7795;
  font-weight: 700;
}

.list-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  position: relative;
  display: block;
}

.search-box::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 2px solid #8b93ac;
  border-radius: 999px;
  transform: translateY(-50%);
}

.search-box::after {
  content: "";
  position: absolute;
  top: calc(50% + 6px);
  left: 28px;
  width: 8px;
  height: 2px;
  background: #8b93ac;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-box input {
  padding-left: 42px;
  background: #ffffff;
}

.quick-panel {
  display: grid;
  gap: 12px;
  margin: 0 14px 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.room-list,
.notification-list,
.message-list {
  overflow: auto;
}

.room-list {
  display: grid;
  align-content: start;
}

.room-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.room-card-static {
  grid-template-columns: 1fr;
  cursor: default;
}

.room-card:hover {
  background: rgba(91, 76, 240, 0.04);
}

.room-card.active {
  background: linear-gradient(90deg, rgba(91, 76, 240, 0.09), rgba(91, 76, 240, 0.02));
}

.room-card-static {
  cursor: default;
}

.room-avatar-stack {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
}

.room-avatar-stack .avatar-sm {
  position: absolute;
}

.room-avatar-stack .avatar-sm:nth-child(1) {
  left: 0;
  top: 0;
  z-index: 3;
}

.room-avatar-stack .avatar-sm:nth-child(2) {
  left: 14px;
  top: 9px;
  z-index: 2;
}

.room-avatar-stack .avatar-sm:nth-child(3) {
  left: 8px;
  top: 18px;
  z-index: 1;
}

.room-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.room-name-row,
.room-meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.room-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.notification-title {
  font-weight: 800;
  color: var(--ink);
}

.room-count,
.room-role-chip {
  color: #7e87a3;
  font-size: 13px;
  font-weight: 700;
}

.room-attention-chip,
.room-notice-chip {
  padding: 2px 7px;
  border-radius: 999px;
}

.room-attention-chip {
  background: rgba(236, 74, 94, 0.12);
  color: var(--danger);
}

.room-notice-chip {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5b00;
}

.room-time,
.room-preview,
.notification-body,
.meta-text,
.composer-hint,
.message-time,
.message-meta,
.empty-state p {
  color: var(--muted);
}

.room-time,
.message-meta {
  font-size: 12px;
}

.room-preview-row {
  align-items: flex-start;
}

.room-preview {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-preview.is-typing {
  color: #4e42d4;
  font-weight: 700;
}

.unread-badge,
.notification-count,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.unread-badge,
.notification-count {
  background: var(--danger);
  color: #ffffff;
}

.status-chip {
  background: #eff1f8;
  color: #7b839c;
}

.status-soft {
  background: rgba(34, 176, 125, 0.14);
  color: var(--success);
}

.status-mention {
  background: rgba(236, 74, 94, 0.12);
  color: var(--danger);
}

.status-notice {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5b00;
}

.status-live {
  background: rgba(34, 176, 125, 0.14);
  color: var(--success);
}

.status-idle {
  background: rgba(91, 76, 240, 0.12);
  color: #5b4cf0;
}

.conversation-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
  min-height: 0;
}

.drag-drop-overlay {
  position: absolute;
  inset: 16px;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 2px dashed rgba(91, 76, 240, 0.36);
  background: rgba(246, 244, 255, 0.76);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.conversation-shell.drag-drop-active .drag-drop-overlay {
  opacity: 1;
  visibility: visible;
}

.drag-drop-card {
  display: grid;
  gap: 6px;
  width: min(360px, calc(100% - 40px));
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.drag-drop-card strong {
  font-size: 18px;
}

.home-dashboard {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.home-dashboard-header,
.home-section-title,
.home-list-item,
.home-dashboard-actions,
.home-list-meta {
  display: flex;
  align-items: center;
}

.home-dashboard-header {
  justify-content: space-between;
  gap: 16px;
}

.home-dashboard-header h3 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.25;
}

.home-dashboard-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.home-metric,
.home-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.home-metric {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  text-align: left;
}

.home-metric span,
.home-list-copy span,
.home-list-meta,
.home-empty {
  color: var(--muted);
}

.home-metric strong {
  font-size: 30px;
  line-height: 1;
}

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

.home-section {
  min-width: 0;
  overflow: hidden;
}

.home-section-title {
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.home-list {
  display: grid;
}

.home-list-item {
  width: 100%;
  min-height: 72px;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.home-list-item:last-child {
  border-bottom: 0;
}

.home-list-item:hover,
.home-metric:hover {
  background: rgba(91, 76, 240, 0.04);
}

.home-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.home-list-copy strong,
.home-list-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list-meta {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.home-notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(236, 74, 94, 0.12);
}

.home-notification-dot.is-read {
  background: #a5adbf;
  box-shadow: none;
}

.home-empty {
  padding: 18px 16px;
  font-size: 14px;
}

.drag-drop-card span {
  color: var(--muted);
  line-height: 1.5;
}

.conversation-header,
.composer {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.conversation-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

.mobile-back-button {
  display: none;
}

.conversation-title-group {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-search {
  width: min(320px, 100%);
  min-width: 220px;
}

.header-search input {
  min-height: 44px;
}

.message-search-panel {
  display: grid;
  gap: 12px;
  padding: 14px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 255, 0.92);
}

.pinned-messages-panel {
  display: grid;
  gap: 12px;
  padding: 14px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 246, 255, 0.92);
}

.pinned-messages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pinned-messages-header strong {
  color: var(--ink);
  font-size: 14px;
}

.pinned-messages-list {
  display: flex;
  gap: 12px;
  overflow: auto;
  padding-bottom: 2px;
}

.room-attachments-panel {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.room-attachments-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.attachment-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.attachment-filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attachment-filter-chip.is-active {
  border-color: rgba(91, 76, 240, 0.36);
  background: var(--accent-soft);
  color: #4235cf;
}

.room-attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.room-attachment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.room-attachment-card:hover {
  background: rgba(91, 76, 240, 0.04);
}

.room-attachment-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.room-attachment-copy strong,
.room-attachment-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-attachment-copy span {
  color: var(--muted);
  font-size: 12px;
}

.room-attachments-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.pinned-message-card {
  min-width: 240px;
  max-width: 300px;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 12px 24px rgba(25, 35, 60, 0.06);
}

.pinned-message-card:hover {
  background: rgba(91, 76, 240, 0.04);
}

.pinned-message-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pinned-message-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.pinned-message-sender {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pinned-message-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-search-panel-header strong {
  font-size: 14px;
  color: var(--ink);
}

.message-search-results {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
}

.message-search-result {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  text-align: left;
}

.message-search-result:hover {
  background: rgba(91, 76, 240, 0.04);
}

.message-search-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.message-search-result-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-search-empty {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.message-search-mark {
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(91, 76, 240, 0.15);
  color: #4c3fcb;
}

.mention-suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 255, 0.96);
}

.mention-suggestion-card {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
}

.mention-suggestion-card:hover,
.mention-suggestion-card.is-active {
  background: rgba(91, 76, 240, 0.08);
}

.mention-suggestion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.mention-suggestion-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.composer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: linear-gradient(180deg, #fbfcff 0%, #ffffff 100%);
  min-height: 0;
}

.empty-state {
  margin: auto;
  max-width: 420px;
  text-align: center;
}

.message-row {
  display: flex;
  width: 100%;
  scroll-margin-top: 28px;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(68%, 420px);
}

.message-row.mine .message-stack {
  align-items: flex-end;
}

.message-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.message-bubble {
  display: inline-block;
  width: auto;
  max-width: 100%;
  min-height: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  line-height: 1.45;
  flex: 0 0 auto;
}

.message-menu-button {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(91, 76, 240, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: #7280a0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.message-menu-button:hover {
  background: #eef2fb;
}

.message-row.mine .message-bubble-row {
  justify-content: flex-end;
}

.message-text {
  line-height: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-mention {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
  font-weight: 700;
}

.message-mention-self {
  background: rgba(240, 68, 97, 0.14);
  color: #cc2f50;
}

.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-edit-window {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.message-read-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(125, 135, 155, 0.11);
  color: #66738f;
  font-size: 12px;
  font-weight: 700;
}

.message-read-status.is-read {
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
}

.message-row.mine .message-read-status {
  align-self: flex-end;
}

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

.message-row.mine .message-reaction-row {
  justify-content: flex-end;
}

.message-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(91, 76, 240, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #66738f;
  font-size: 13px;
  font-weight: 700;
}

.message-reaction-chip:hover {
  background: rgba(91, 76, 240, 0.06);
}

.message-reaction-chip.is-active {
  border-color: rgba(91, 76, 240, 0.28);
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
}

.message-reaction-chip-emoji {
  font-size: 15px;
  line-height: 1;
}

.message-reaction-chip-count {
  font-variant-numeric: tabular-nums;
}

.message-row.is-search-target .message-bubble {
  border-color: rgba(91, 76, 240, 0.38);
  box-shadow: 0 0 0 4px rgba(91, 76, 240, 0.12);
}

.message-row.mine .message-meta {
  justify-content: flex-end;
}

.message-row.mine .message-bubble {
  background: linear-gradient(135deg, rgba(91, 76, 240, 0.12), rgba(255, 255, 255, 0.96));
  border-color: rgba(91, 76, 240, 0.18);
}

.message-row.system .message-bubble,
.message-row.alert .message-bubble {
  background: var(--surface-soft);
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.attachment-item,
.erp-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.attachment-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.attachment-button:hover {
  border-color: rgba(91, 76, 240, 0.24);
  background: rgba(91, 76, 240, 0.06);
}

.attachment-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
  font-size: 11px;
  font-weight: 900;
}

.attachment-preview {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(34, 176, 125, 0.12);
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-preview .attachment-kind {
  width: 46px;
  height: 46px;
}

.attachment-kind.is-image,
.attachment-button.is-image .attachment-kind {
  background: rgba(34, 176, 125, 0.14);
  color: #138a63;
}

.attachment-kind.is-pdf,
.attachment-button.is-pdf .attachment-kind {
  background: rgba(240, 68, 97, 0.14);
  color: #cc2f50;
}

.attachment-kind.is-sheet,
.attachment-button.is-sheet .attachment-kind {
  background: rgba(23, 170, 135, 0.14);
  color: #0d8068;
}

.attachment-kind.is-doc,
.attachment-button.is-doc .attachment-kind {
  background: rgba(31, 60, 136, 0.13);
  color: #1f3c88;
}

.attachment-kind.is-archive,
.attachment-button.is-archive .attachment-kind {
  background: rgba(245, 158, 11, 0.16);
  color: #a05c00;
}

.attachment-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.attachment-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy span,
.attachment-download-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-download-label {
  white-space: nowrap;
}

.erp-card {
  margin-top: 10px;
}

.erp-open-button {
  flex-shrink: 0;
  padding: 8px 12px;
}

.reply-preview-card,
.reply-composer-bar {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.reply-preview-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  text-align: left;
}

.reply-preview-card.is-clickable {
  cursor: pointer;
}

.reply-preview-author {
  color: #586684;
  font-size: 12px;
  font-weight: 700;
}

.reply-preview-text {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer textarea {
  min-height: 76px;
  max-height: 180px;
  resize: vertical;
}

.typing-status-bar {
  min-height: 22px;
  padding: 0 18px 10px;
  color: #4e42d4;
  font-size: 13px;
  font-weight: 700;
}

.pending-attachment-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.reply-composer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.reply-composer-copy {
  min-width: 0;
  flex: 1;
}

.reply-composer-copy .reply-preview-card {
  margin: 6px 0 0;
}

.reply-composer-label {
  color: #586684;
  font-size: 12px;
  font-weight: 700;
}

.pending-attachment-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.pending-attachment-chip strong,
.attachment-item strong {
  display: block;
}

.pending-attachment-chip span {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chip-remove-button {
  padding: 8px 12px;
  background: rgba(240, 68, 97, 0.12);
  color: #cc2f50;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.composer-actions {
  align-items: flex-end;
}

.message-bubble-muted,
.message-deleted,
.message-empty {
  color: var(--muted);
}

.message-deleted,
.message-empty {
  font-style: italic;
}

.desktop-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: grid;
  place-items: center;
  padding: 24px;
}

.desktop-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 38, 0.34);
  backdrop-filter: blur(8px);
}

.desktop-settings-sheet {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 60px rgba(16, 24, 40, 0.22);
}

.desktop-settings-header,
.desktop-settings-section-header,
.desktop-settings-actions,
.desktop-settings-footer,
.desktop-settings-update-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.desktop-settings-header h3,
.desktop-settings-section-header h4 {
  margin: 0;
}

.desktop-settings-summary,
.desktop-settings-form,
.desktop-settings-section,
.desktop-settings-update-copy,
.desktop-settings-update-card {
  display: grid;
  gap: 12px;
}

.desktop-settings-summary {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fd 100%);
}

.desktop-settings-summary strong {
  color: var(--ink);
  font-size: 16px;
}

.desktop-settings-summary span,
.desktop-settings-update-copy span,
.desktop-settings-update-time {
  color: var(--muted);
  font-size: 13px;
}

.desktop-settings-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.desktop-settings-update-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.desktop-settings-section-header-wrap {
  flex-wrap: wrap;
}

.desktop-settings-inline-fields,
.push-delivery-list,
.push-delivery-card,
.push-delivery-card-copy,
.readiness-list,
.readiness-card,
.readiness-card-copy {
  display: grid;
  gap: 12px;
}

.desktop-settings-inline-fields {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.desktop-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.desktop-status-idle {
  background: rgba(91, 76, 240, 0.1);
  color: #5b4cf0;
}

.desktop-status-ok {
  background: rgba(34, 176, 125, 0.14);
  color: var(--success);
}

.desktop-status-live {
  background: rgba(91, 76, 240, 0.14);
  color: #4e42d4;
}

.desktop-status-warn {
  background: rgba(255, 176, 32, 0.16);
  color: #9f6900;
}

.desktop-status-error {
  background: rgba(240, 68, 97, 0.14);
  color: #cc2f50;
}

.desktop-settings-update-copy strong,
.desktop-settings-update-copy p {
  margin: 0;
}

.desktop-settings-update-copy strong {
  color: var(--ink);
}

.desktop-settings-update-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.push-delivery-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.push-delivery-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.push-delivery-card-top,
.push-delivery-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.push-delivery-card-copy strong,
.push-delivery-body,
.push-delivery-provider,
.push-delivery-error,
.push-delivery-actions,
.push-delivery-empty {
  margin: 0;
}

.push-delivery-card-copy strong {
  color: var(--ink);
}

.push-delivery-card-copy span,
.push-delivery-meta {
  color: var(--muted);
  font-size: 13px;
}

.push-delivery-meta {
  flex-wrap: wrap;
}

.push-delivery-body {
  color: var(--ink);
  line-height: 1.6;
  word-break: break-word;
}

.push-delivery-provider {
  color: var(--muted);
  font-size: 13px;
}

.push-delivery-error {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(240, 68, 97, 0.1);
  color: #b42342;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.push-delivery-actions {
  display: flex;
  justify-content: flex-end;
}

.push-delivery-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.readiness-list {
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.readiness-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.readiness-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.readiness-card-copy strong,
.readiness-card-copy span,
.readiness-body,
.readiness-empty {
  margin: 0;
}

.readiness-card-copy strong {
  color: var(--ink);
}

.readiness-card-copy span {
  color: var(--muted);
  font-size: 13px;
}

.readiness-body {
  color: var(--ink);
  line-height: 1.6;
  word-break: break-word;
}

.cutover-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(91, 76, 240, 0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.readiness-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.readiness-group {
  display: grid;
  gap: 12px;
}

.readiness-group + .readiness-group {
  margin-top: 14px;
}

.readiness-group-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.readiness-group-stack {
  display: grid;
  gap: 12px;
}

.message-action-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(8px);
}

.image-viewer-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  width: min(1040px, 100%);
  max-height: calc(100vh - 36px);
  padding: 16px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.34);
}

.image-viewer-header,
.image-viewer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-viewer-header h3 {
  max-width: min(56vw, 620px);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-counter {
  display: inline-flex;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-viewer-actions {
  flex-shrink: 0;
}

.image-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: auto;
  border-radius: 16px;
  background: #111827;
}

.image-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 58px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #111827;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
}

.image-viewer-nav:disabled {
  opacity: 0.36;
}

.image-viewer-nav-prev {
  left: 14px;
}

.image-viewer-nav-next {
  right: 14px;
}

.image-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}

.message-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 38, 0.38);
  backdrop-filter: blur(8px);
}

.message-action-sheet {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 60px rgba(16, 24, 40, 0.22);
}

.message-action-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.message-action-sheet-header h3 {
  margin: 0;
}

.message-action-body,
.message-action-list {
  display: grid;
  gap: 12px;
}

.message-action-preview-card,
.message-action-confirm-copy {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.message-action-preview-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-action-preview-text {
  margin: 0;
  line-height: 1.55;
  word-break: break-word;
}

.message-action-field {
  gap: 10px;
}

.message-action-field textarea {
  min-height: 144px;
  resize: vertical;
}

.message-action-sheet-button {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.message-action-sheet-button.is-danger {
  border-color: rgba(240, 68, 97, 0.2);
  background: rgba(240, 68, 97, 0.08);
  color: #cc2f50;
}

.message-action-confirm-copy {
  display: grid;
  gap: 8px;
}

.message-action-confirm-copy strong,
.message-action-confirm-copy p {
  margin: 0;
}

.message-action-confirm-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.message-reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.message-reaction-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.message-reaction-option:hover {
  background: rgba(91, 76, 240, 0.05);
}

.message-reaction-option.is-active {
  border-color: rgba(91, 76, 240, 0.28);
  background: rgba(91, 76, 240, 0.12);
  color: #4e42d4;
}

.message-reaction-option-emoji {
  font-size: 20px;
  line-height: 1;
}

.message-action-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inspector {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  background: transparent;
  box-shadow: none;
  border: 0;
  min-height: 0;
}

.panel {
  padding: 18px;
}

.profile-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.panel-fill {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.meta-stack {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.meta-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  font-size: 14px;
}

.meta-row-stack {
  align-items: start;
}

.member-presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}

.member-presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c4cada;
  box-shadow: 0 0 0 3px rgba(196, 202, 218, 0.22);
}

.presence-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 176, 125, 0.16);
}

.presence-dot.is-offline {
  background: #c4cada;
}

.member-presence-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.notification-list,
.user-result-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.notification-list {
  overflow: auto;
}

.user-result-list {
  max-height: 360px;
  overflow: auto;
}

.department-browser {
  display: grid;
  gap: 12px;
}

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

.department-list {
  max-height: 150px;
  overflow: auto;
  padding-right: 2px;
}

.department-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px 8px calc(10px + var(--dept-depth, 0) * 12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.department-chip.is-active {
  border-color: rgba(91, 76, 240, 0.36);
  background: var(--accent-soft);
  color: #4235cf;
}

.department-user-panel {
  display: grid;
  gap: 10px;
}

.department-user-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.department-user-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notification-card,
.user-result-card {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: left;
}

.notification-card {
  cursor: pointer;
}

.user-result-card .avatar-token {
  flex-shrink: 0;
}

.notification-card.is-read {
  opacity: 0.82;
}

.user-result-empty {
  cursor: default;
}

@media (max-width: 1440px) {
  .app-shell {
    grid-template-columns: 104px minmax(320px, 390px) minmax(0, 1fr);
  }

  .inspector {
    display: none;
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 104px 1fr;
    height: auto;
    min-height: 100vh;
  }

  .conversation-shell {
    grid-column: 2;
    min-height: auto;
  }

  .room-panel {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  body.mobile-room-open {
    overflow: hidden;
  }

  .install-prompt {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
  }

  .install-prompt-actions {
    width: 100%;
    justify-content: stretch;
  }

  .install-prompt-actions > * {
    flex: 1;
  }

  .web-push-prompt {
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
    grid-template-columns: 1fr;
    height: auto;
    min-height: var(--app-viewport-height, 100vh);
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      calc(12px + env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      calc(12px + env(safe-area-inset-left, 0px));
  }

  .app-nav {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px;
  }

  .app-nav-top,
  .nav-icon-stack,
  .nav-icon-stack-bottom {
    display: flex;
    align-items: center;
  }

  .app-nav-top {
    justify-content: space-between;
    width: 100%;
  }

  .nav-icon-stack-bottom {
    display: none;
  }

  .nav-icon-stack {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-icon-button {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    gap: 0;
  }

  .nav-label {
    display: none;
  }

  .room-panel,
  .conversation-shell {
    min-height: auto;
  }

  .room-panel,
  .conversation-shell,
  .app-nav {
    width: 100%;
  }

  .app-shell:not(.is-mobile-room-open) .conversation-shell {
    display: none;
  }

  .app-shell.is-mobile-room-open .room-panel {
    display: none;
  }

  .app-shell.is-mobile-room-open {
    padding: 0;
  }

  .app-shell.is-mobile-room-open .app-nav {
    display: none;
  }

  .app-shell.is-mobile-room-open .conversation-shell {
    position: fixed;
    top: var(--app-viewport-offset-top, 0px);
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 12;
    display: grid;
    height: var(--app-viewport-height, 100vh);
    min-height: var(--app-viewport-height, 100vh);
    padding:
      env(safe-area-inset-top, 0px)
      env(safe-area-inset-right, 0px)
      0
      env(safe-area-inset-left, 0px);
    border: 0;
    border-radius: 0;
  }

  .mobile-back-button {
    display: inline-flex;
  }

  .conversation-header {
    padding-top: 16px;
  }

  .home-dashboard {
    padding: 16px;
  }

  .home-dashboard-header,
  .home-dashboard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-dashboard-header h3 {
    font-size: 20px;
  }

  .home-metric-grid,
  .home-section-grid {
    grid-template-columns: 1fr;
  }

  .home-metric {
    min-height: 82px;
  }

  .home-list-item {
    align-items: flex-start;
  }

  .home-list-meta {
    min-width: 64px;
  }

  .image-viewer-modal {
    padding: 10px;
  }

  .image-viewer-sheet {
    max-height: calc(100vh - 20px);
    padding: 12px;
    border-radius: 18px;
  }

  .image-viewer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-viewer-header h3 {
    max-width: calc(100vw - 44px);
  }

  .image-viewer-actions {
    width: 100%;
  }

  .image-viewer-actions > * {
    flex: 1;
  }

  .image-viewer-nav {
    width: 40px;
    height: 52px;
    font-size: 30px;
  }

  .image-viewer-nav-prev {
    left: 8px;
  }

  .image-viewer-nav-next {
    right: 8px;
  }

  .image-viewer-stage img {
    max-height: calc(100vh - 210px);
  }

  .app-shell.is-mobile-room-open .conversation-header {
    padding-top: 14px;
  }

  .app-shell.is-mobile-room-open .message-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .composer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .composer-actions,
  .pending-attachment-chip,
  .reply-composer-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-tools {
    align-items: stretch;
  }

  .message-stack {
    max-width: 100%;
  }

  .message-menu-button {
    display: none;
  }

  .pinned-messages-list {
    flex-direction: column;
  }

  .room-attachments-toolbar {
    grid-template-columns: 1fr;
  }

  .attachment-filter-list {
    justify-content: flex-start;
  }

  .room-attachments-list {
    grid-template-columns: 1fr;
    max-height: 320px;
  }

  .pinned-message-card {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .message-action-modal {
    padding: 12px;
    align-items: end;
  }

  .desktop-settings-modal {
    padding: 12px;
    align-items: end;
  }

  .desktop-settings-sheet {
    width: min(100%, 760px);
    max-height: min(92vh, 920px);
    border-radius: 24px 24px 18px 18px;
    padding: 18px;
  }

  .desktop-settings-actions,
  .desktop-settings-footer,
  .desktop-settings-update-header {
    flex-direction: column;
    align-items: stretch;
  }

  .message-action-sheet {
    width: min(100%, 520px);
    border-radius: 24px 24px 18px 18px;
    padding: 18px;
  }

  .message-action-footer {
    flex-direction: column-reverse;
  }

  .message-reaction-picker-grid {
    grid-template-columns: 1fr;
  }
}
