:root {
  --bg: #f4f7fb;
  --bg-alt: #ecf3ff;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --line: #d7dfeb;
  --ink: #0f172a;
  --muted: #52637a;
  --primary: #0f766e;
  --primary-strong: #0d5f59;
  --secondary: #1148a4;
  --secondary-strong: #0d3a82;
  --ok: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

body[data-theme="dark"] {
  --bg: #0d1119;
  --bg-alt: #131a27;
  --card: rgba(23, 29, 42, 0.93);
  --card-strong: #1a2233;
  --line: #2f3a52;
  --ink: #e7edfb;
  --muted: #a3aec5;
  --primary: #2eb8aa;
  --primary-strong: #239688;
  --secondary: #4f8de7;
  --secondary-strong: #3f73be;
  --ok: #6ee7b7;
  --danger: #ff8f9a;
  --shadow: 0 24px 48px rgba(2, 5, 12, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 60%, #eaf6ef 100%);
}

body[data-theme="dark"] {
  background: linear-gradient(180deg, #101622 0%, var(--bg) 70%, #111926 100%);
}

.bg-layer {
  position: fixed;
  border-radius: 999px;
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}

.bg-a {
  width: 280px;
  height: 280px;
  left: -90px;
  top: -70px;
  background: rgba(32, 109, 229, 0.24);
}

.bg-b {
  width: 320px;
  height: 320px;
  right: -110px;
  bottom: -95px;
  background: rgba(22, 185, 129, 0.2);
}

.page-shell {
  width: min(1420px, calc(100% - 1.6rem));
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0.9rem 0 1.1rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.8rem;
}

body.app-layout-active {
  overflow: hidden;
}

body.app-layout-active .bg-layer {
  opacity: 0.16;
}

body.app-layout-active .page-shell {
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

body.app-layout-active .site-header {
  min-height: 58px;
  padding: 0 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

body[data-theme="dark"].app-layout-active .site-header {
  background: rgba(13, 17, 25, 0.84);
}

.header-leading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mobile-menu-toggle {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.pill-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 0.92rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.center-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.login-layout,
.pending-layout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card,
.pending-card,
.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 100%);
  padding: 1.1rem;
  display: grid;
  gap: 0.5rem;
}

.pending-card {
  width: min(540px, 100%);
  padding: 1.2rem 1.1rem;
  text-align: center;
  display: grid;
  gap: 0.55rem;
}

.pending-icon {
  margin: 0;
  font-size: 2rem;
}

.pending-help {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

.overline {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #174ea6;
  font-weight: 700;
}

body[data-theme="dark"] .overline {
  color: #9bbbf8;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.1rem, 1.9vw, 1.55rem);
}

h3 {
  font-size: 0.95rem;
}

.subtle {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: block;
  margin-top: 0.56rem;
  margin-bottom: 0.35rem;
  color: #30425d;
  font-size: 0.82rem;
  font-weight: 600;
}

body[data-theme="dark"] label {
  color: #bdcbe2;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd7e8;
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  background: var(--card-strong);
  color: var(--ink);
  font: inherit;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
  border-color: #344765;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4b81ca;
  box-shadow: 0 0 0 3px rgba(75, 129, 202, 0.16);
}

.pill-select {
  width: auto;
  min-width: 7.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 2rem 0.5rem 0.92rem;
  background-color: var(--card);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 1rem) calc(50% - 2px),
    calc(100% - 0.72rem) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

body[data-theme="dark"] .pill-select {
  border-color: var(--line);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.56rem 0.95rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.primary {
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
}

.secondary {
  color: #fff;
  background: linear-gradient(180deg, var(--secondary), var(--secondary-strong));
}

.ghost {
  color: var(--ink);
  background: #f7faff;
  border: 1px solid #cfd9e8;
}

body[data-theme="dark"] .ghost {
  background: #1d2638;
  border-color: #364a67;
}

.full {
  width: 100%;
}

.small-btn {
  padding: 0.32rem 0.68rem;
  font-size: 0.74rem;
  color: var(--ink);
  background: #f7faff;
  border: 1px solid #cfd9e8;
}

body[data-theme="dark"] .small-btn {
  background: #1d2638;
  border-color: #364a67;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--secondary);
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
}

.message {
  margin: 0.2rem 0 0;
  min-height: 1.05rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.settings-field-message {
  margin: 0.28rem 0 0.14rem;
  min-height: 0.95rem;
  font-size: 0.74rem;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--ok);
}

.dashboard {
  display: grid;
  grid-template-columns: 312px 1fr;
  gap: 0.85rem;
  height: calc(100dvh - 112px);
  min-height: calc(100dvh - 112px);
  position: relative;
}

body.app-layout-active .dashboard {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  height: calc(100dvh - 59px);
  min-height: calc(100dvh - 59px);
  background: var(--card-strong);
}

body.app-layout-active.sidebar-collapsed:not(.mobile-sidebar-open) .dashboard {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.66rem;
  min-height: 0;
  overflow-y: auto;
}

body.app-layout-active .sidebar {
  padding: 0.55rem 0.45rem 0.65rem;
  gap: 0.42rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--card-strong) 95%, transparent);
  box-shadow: none;
}

body.app-layout-active.sidebar-collapsed:not(.mobile-sidebar-open) .sidebar {
  display: none;
}

.mobile-sidebar-backdrop {
  display: none;
}

.sidebar-search input {
  width: 100%;
  border-radius: 10px;
}

body.app-layout-active .sidebar-search input {
  border-radius: 999px;
  padding: 0.56rem 0.85rem;
}

.sidebar-nav-btn {
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: #f7faff;
  border: 1px solid #cfd9e8;
  border-radius: 12px;
  padding: 0.58rem 0.74rem;
}

body.app-layout-active .sidebar-nav-btn {
  margin-bottom: 0.52rem;
}

.sidebar-nav-btn.active {
  background: #eaf2ff;
  border-color: #bfd0ea;
}

body[data-theme="dark"] .sidebar-nav-btn {
  background: #1d2638;
  border-color: #364a67;
}

body[data-theme="dark"] .sidebar-nav-btn.active {
  background: #223149;
  border-color: #456189;
}

.sidebar-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-strong);
  padding: 0.54rem 0.58rem 0.5rem;
  display: grid;
  gap: 0.3rem;
  min-height: 0;
}

body.app-layout-active .sidebar-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  gap: 0.18rem;
}

body.app-layout-active .sidebar-nav-btn + .sidebar-section {
  margin-top: 0.18rem;
}

body.app-layout-active .sidebar-section + .sidebar-section {
  margin-top: 0.74rem;
  padding-top: 0.72rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.sidebar-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

body.app-layout-active .sidebar-section-head {
  padding: 0 0.14rem;
}

body.app-layout-active .sidebar-section-head h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #7a879b;
}

body[data-theme="dark"].app-layout-active .sidebar-section-head h3 {
  color: #aab6c9;
}

.sidebar-section-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.18rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

body.app-layout-active .sidebar-section-footer {
  padding-top: 0;
  border-top: 0;
}

.sidebar-section-more {
  width: 100%;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  font-size: 0.76rem;
  color: var(--secondary-strong);
  background: #f7faff;
  border: 1px solid #cfd9e8;
}

body[data-theme="dark"] .sidebar-section-more {
  background: #1d2638;
  border-color: #364a67;
}

.quick-list {
  display: grid;
  gap: 0.12rem;
}

.quick-list.expanded-scroll {
  max-height: min(40dvh, 22rem);
  overflow-y: auto;
  padding-right: 0.14rem;
  padding-bottom: 0.12rem;
}

.quick-item-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.28rem;
}

.quick-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  padding: 0.35rem 0.3rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
}

.room-detail-menu-wrap {
  position: relative;
}

.room-menu-wrap {
  position: relative;
}

.room-menu-trigger {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.room-menu-trigger.active,
.room-menu-trigger:hover {
  background: #edf4ff;
  border-color: #bfd0ea;
}

body[data-theme="dark"] .room-menu-trigger {
  background: #1d2638;
  border-color: #364a67;
}

body[data-theme="dark"] .room-menu-trigger.active,
body[data-theme="dark"] .room-menu-trigger:hover {
  background: #223149;
  border-color: #456189;
}

.room-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 10;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  padding: 0.26rem;
  display: grid;
  gap: 0.1rem;
}

.room-menu-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.52rem;
  cursor: pointer;
}

.room-menu-item:hover {
  background: #edf4ff;
}

.room-menu-item.danger {
  color: #b91c1c;
}

.room-menu-item.danger:hover {
  background: #fee2e2;
}

body[data-theme="dark"] .room-menu-dropdown {
  background: #182234;
  border-color: #364a67;
  box-shadow: 0 16px 30px rgba(2, 8, 23, 0.55);
}

body[data-theme="dark"] .room-menu-item:hover {
  background: #223149;
}

body[data-theme="dark"] .room-menu-item.danger {
  color: #fca5a5;
}

body[data-theme="dark"] .room-menu-item.danger:hover {
  background: #4a1d24;
}

.quick-item.active {
  background: #edf4ff;
}

body[data-theme="dark"] .quick-item.active {
  border-color: #4b6994;
  background: #223149;
}

.quick-item-main {
  min-width: 0;
}

.quick-item-title-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.quick-item-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.91rem;
  font-weight: 700;
}

.quick-item-title-row .quick-item-title {
  flex-basis: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.28;
}

.mentor-list-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--secondary) 22%, transparent);
  color: var(--secondary-strong);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  max-width: 100%;
}

.room-kind {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.06rem 0.44rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.room-kind-private {
  background: rgba(17, 72, 164, 0.11);
  border-color: rgba(17, 72, 164, 0.24);
  color: #0f3f8a;
}

.room-kind-public {
  background: rgba(15, 118, 110, 0.13);
  border-color: rgba(15, 118, 110, 0.27);
  color: #0a6159;
}

.room-kind-unknown {
  background: rgba(82, 99, 122, 0.12);
  border-color: rgba(82, 99, 122, 0.22);
  color: #3f4d61;
}

body[data-theme="dark"] .room-kind-private {
  background: rgba(79, 141, 231, 0.2);
  border-color: rgba(79, 141, 231, 0.38);
  color: #b7d6ff;
}

body[data-theme="dark"] .room-kind-public {
  background: rgba(46, 184, 170, 0.2);
  border-color: rgba(46, 184, 170, 0.38);
  color: #99efe6;
}

body[data-theme="dark"] .room-kind-unknown {
  background: rgba(163, 174, 197, 0.2);
  border-color: rgba(163, 174, 197, 0.34);
  color: #d4dceb;
}

.quick-item-meta {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 600;
}

.bubble {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(17, 72, 164, 0.12);
  color: var(--secondary-strong);
  border: 1px solid rgba(17, 72, 164, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.38rem;
  font-size: 0.72rem;
  font-weight: 700;
}

body[data-theme="dark"] .bubble {
  background: rgba(79, 141, 231, 0.16);
  color: #98c1ff;
  border-color: rgba(79, 141, 231, 0.34);
}

.sidebar-user-card {
  margin-top: auto;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--ink);
  border-radius: 16px;
  padding: 0.62rem 0.68rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.62rem;
  text-align: left;
  overflow: hidden;
}

body.app-layout-active .sidebar-user-card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.72rem 0.2rem 0.05rem;
  box-shadow: none;
}

.sidebar-user-card:hover {
  background: #eef5ff;
  border-color: #bfd0ea;
}

body[data-theme="dark"] .sidebar-user-card {
  background: #1d2638;
  border-color: #364a67;
}

body[data-theme="dark"] .sidebar-user-card:hover {
  background: #223149;
  border-color: #456189;
}

body.app-layout-active .sidebar-user-card:hover,
body[data-theme="dark"].app-layout-active .sidebar-user-card:hover {
  background: transparent;
  border-color: var(--line);
}

.sidebar-user-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.62rem;
}

.sidebar-user-avatar {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(180deg, #2eb8aa, #1e9387);
}

.sidebar-user-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.sidebar-user-name {
  display: block;
  font-size: 0.96rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-user-badges {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  margin-left: 0.4rem;
}

.sidebar-user-profile-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.sidebar-user-invites {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.1rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 72, 164, 0.24);
  background: rgba(17, 72, 164, 0.12);
  color: var(--secondary-strong);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

body[data-theme="dark"] .sidebar-user-invites {
  border-color: rgba(79, 141, 231, 0.34);
  background: rgba(79, 141, 231, 0.16);
  color: #98c1ff;
}

body[data-theme="dark"] .sidebar-user-profile-badge {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

.quick-list .empty {
  border: 0;
  border-radius: 0;
  padding: 0.34rem 0.3rem;
  font-size: 0.8rem;
  background: transparent;
}

.main-pane {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.72rem;
}

body.app-layout-active .main-pane {
  padding: 0.7rem 1rem 0.8rem;
  border: 0;
  border-radius: 0;
  background: var(--card-strong);
  box-shadow: none;
  overflow: hidden;
}

.panel-view {
  width: 100%;
  min-height: 0;
  min-width: 0;
}

body.app-layout-active .panel-head {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.mentor-chat-roomlike {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  flex: 1;
  height: 100%;
  min-height: 0;
}

#roomDetailPanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.discover-section {
  margin-top: 0.62rem;
}

.discover-section + .discover-section {
  margin-top: 0.86rem;
  padding-top: 0.72rem;
  border-top: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.room-detail-head {
  gap: 1rem;
}

.room-detail-head-main {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.room-detail-head-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.55rem;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.44rem 0.86rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--card-strong);
}

.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline.wrap {
  row-gap: 0.46rem;
}

.inline input {
  width: 180px;
}

.form-grid {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.42rem;
  max-width: 620px;
}

.list {
  margin-top: 0.6rem;
  max-height: 350px;
  overflow: auto;
  display: grid;
  gap: 0.45rem;
}

.list.compact {
  max-height: 290px;
}

.mentor-room-composer {
  width: min(860px, 100%);
}

body.app-layout-active .mentor-room-composer {
  width: 100%;
}

.room-chat-list {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-bottom: 0.25rem;
}

.room-ai-panel {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 0.45rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow: visible;
  z-index: 3;
}

body.app-layout-active .room-ai-panel {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 0 0 1rem;
}

.room-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 0.18rem;
  gap: 0.75rem;
}

.room-ai-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}

.room-ai-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.room-ai-tooltip-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  border: 1px solid #cfd9e8;
  border-radius: 999px;
  background: #f7faff;
  color: var(--secondary-strong);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.room-ai-tooltip-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(20rem, 72vw);
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.2rem);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 30;
}

.room-ai-tooltip-button:hover::after,
.room-ai-tooltip-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

body[data-theme="dark"] .room-ai-tooltip-button {
  border-color: #364a67;
  background: #1d2638;
  color: #98c1ff;
}

.room-ai-form {
  display: grid;
  gap: 0.32rem;
}

.room-ai-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.room-ai-form textarea {
  min-height: 6rem;
  max-height: 10rem;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  padding: 0.75rem 0.82rem;
  font-size: 13px;
  line-height: 1.45;
}

.room-ai-panel .message:empty {
  display: none;
}

.room-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.room-ai-actions button {
  flex: 1 1 100%;
}

.room-ai-meta {
  min-height: 1.1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.room-ai-attachments {
  display: grid;
  gap: 0.45rem;
  min-height: 0;
  max-height: min(28dvh, 16rem);
  overflow: auto;
  margin-top: 0.3rem;
  padding-right: 0.18rem;
  align-content: start;
}

.room-ai-attachments-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}

.room-ai-attachments-list {
  display: grid;
  gap: 0.38rem;
}

.room-ai-attachment-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
}

.room-ai-attachment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.room-ai-attachment-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.room-ai-attachment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.46rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.room-ai-attachment-status.analyzed {
  background: #e9f7ee;
  color: #166534;
}

.room-ai-attachment-status.skipped {
  background: #fdecec;
  color: #b91c1c;
}

.room-ai-attachment-detail {
  font-size: 0.74rem;
  color: var(--muted);
}

.room-ai-result {
  min-height: 6rem;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-strong);
  padding: 0.82rem 0.88rem;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  color: var(--ink);
}

.room-ai-result.empty {
  color: var(--muted);
}

.room-ai-result-actions {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  align-self: start;
  margin-top: 0;
}

.room-ai-result-actions .ghost {
  flex: 0 0 auto;
  width: auto;
  min-width: 10.5rem;
  max-width: 100%;
  font-size: 0.84rem;
}

.room-detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.room-detail-meta-row .subtle {
  flex: 1 1 320px;
}

body.app-layout-active #roomDetailPanel .panel-head {
  align-items: flex-start;
  padding-bottom: 0.14rem;
  border-bottom: 0;
}

body.app-layout-active #mentorPanel .panel-head {
  align-items: flex-start;
  padding-bottom: 0.14rem;
  border-bottom: 0;
}

body.app-layout-active #roomDetailOverline {
  margin-bottom: 0.08rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

body.app-layout-active #mentorPanelOverline {
  margin-bottom: 0.08rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

body.app-layout-active #roomDetailTitle {
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

body.app-layout-active #mentorPanelTitle {
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

body.app-layout-active #roomDetailPanel .room-detail-meta-row {
  justify-content: flex-start;
  gap: 0.45rem;
  padding-bottom: 0.62rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

body.app-layout-active #mentorPanel .room-detail-meta-row {
  justify-content: flex-start;
  gap: 0.45rem;
  padding-bottom: 0.62rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

body.app-layout-active #roomDetailMeta {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

body.app-layout-active #mentorPanelDisclaimer {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.room-detail-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.room-meta-button {
  color: var(--ink);
  background: #f7faff;
  border: 1px solid #cfd9e8;
  padding: 0.42rem 0.88rem;
  font-size: 0.78rem;
}

body.app-layout-active #roomDetailPanel .room-detail-meta-actions {
  gap: 0.5rem;
}

body.app-layout-active #roomDetailPanel .room-meta-button {
  min-height: 2.05rem;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  border-color: #b7cbeb;
  background: #f5f9ff;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

.room-meta-button.active {
  background: #e9f1ff;
  border-color: #9fb9e4;
}

body[data-theme="dark"] .room-meta-button {
  background: #1d2638;
  border-color: #364a67;
}

body[data-theme="dark"] .room-meta-button.active {
  background: #253147;
  border-color: #58719a;
}

body.app-layout-active #roomDetailPanel .room-menu-trigger {
  width: 2.05rem;
  height: 2.05rem;
  min-width: 2.05rem;
  border-radius: 999px;
  border-color: #cfd9e8;
  background: #fbfdff;
}

body[data-theme="dark"].app-layout-active #roomDetailPanel .room-meta-button {
  background: #1c2638;
  border-color: #3c5374;
}

body[data-theme="dark"].app-layout-active #roomDetailPanel .room-menu-trigger {
  background: #172131;
  border-color: #364a67;
}

.room-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  min-height: 0;
}

.room-detail-workspace.ai-open {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

body.app-layout-active .room-detail-workspace {
  gap: 0;
  height: 100%;
}

body.app-layout-active .room-detail-workspace.ai-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 1rem;
}

.room-members-modal {
  width: min(760px, 100%);
  max-height: min(82dvh, 780px);
  grid-template-columns: 1fr;
}

.room-ai-modal {
  width: min(760px, 100%);
  height: min(88dvh, 840px);
  max-height: min(88dvh, 840px);
  grid-template-columns: 1fr;
}

.room-members-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.room-members-modal-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
}

.room-members-modal-header .subtle {
  margin: 0.32rem 0 0;
}

.room-members-modal-body {
  padding: 1rem 1.05rem 1.05rem;
  overflow: auto;
  display: grid;
  gap: 0.75rem;
  min-height: 220px;
  align-content: start;
}

.room-ai-modal-body {
  padding: 0 1.05rem 1.05rem;
  overflow: auto;
  min-height: 0;
}

.room-ai-modal-body .room-ai-panel {
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  overflow: visible;
}

body.app-layout-active .room-ai-modal-body .room-ai-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.room-ai-modal-body .room-ai-result {
  max-height: min(24dvh, 14rem);
}

.room-ai-modal-body .room-ai-attachments {
  max-height: min(22dvh, 12rem);
}

.room-members-list {
  display: grid;
  gap: 0.6rem;
  min-height: 2.5rem;
}

.room-member-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-strong);
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.room-member-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.room-member-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.room-member-login {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}

.room-member-email {
  margin: 0;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.35;
}

.room-member-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.room-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.room-member-actions .ghost,
.room-member-actions .secondary {
  padding: 0.42rem 0.76rem;
  font-size: 0.76rem;
}

body[data-theme="dark"] .room-members-modal-header {
  border-bottom-color: #364a67;
}

.room-chat-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  align-items: stretch;
  gap: 0.45rem;
}

.room-send-form {
  margin-top: 0;
  padding-top: 0.7rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
}

body.app-layout-active .room-send-form {
  padding-top: 0.5rem;
}

.composer-shortcuts-row {
  width: min(860px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0 0.18rem;
}

body.app-layout-active .composer-shortcuts-row {
  width: 100%;
}

.composer-enter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.composer-enter-toggle input {
  width: 0.92rem;
  height: 0.92rem;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.composer-shortcut-hint {
  margin: 0;
  font-size: 0.76rem;
  text-align: right;
}

.room-composer {
  width: min(860px, 100%);
  border: 1px solid #cfd9e8;
  border-radius: 999px;
  background: var(--card-strong);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
}

body.app-layout-active .room-composer {
  width: 100%;
}

.room-attachment-input {
  display: none;
}

.room-attach-icon-button {
  width: 2.3rem;
  height: 2.3rem;
  min-width: 2.3rem;
  border-radius: 999px;
  border: 1px solid #cfd9e8;
  background: #f8fbff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.room-attach-icon-button:hover:not(:disabled) {
  background: #eef4ff;
}

.room-attach-icon-button:disabled {
  opacity: 0.55;
}

.room-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  resize: none;
  min-height: 1.5rem;
  max-height: 6rem;
  overflow-y: hidden;
  padding: 0;
  line-height: 1.5;
  box-shadow: none;
}

.room-composer textarea:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.room-send-icon-button {
  width: 2.3rem;
  height: 2.3rem;
  min-width: 2.3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  background: #0f172a;
  border: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.room-send-icon-button:hover:not(:disabled) {
  background: #111827;
}

.room-send-icon-button:disabled {
  opacity: 0.55;
}

.room-send-form .message {
  width: min(860px, 100%);
}

body.app-layout-active .room-send-form .message {
  width: 100%;
}

.room-pending-attachment {
  width: min(860px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #d2ddf2;
  border-radius: 12px;
  background: #f2f6ff;
  padding: 0.45rem 0.7rem;
}

body.app-layout-active .room-pending-attachment {
  width: 100%;
}

.room-pending-attachment-text {
  font-size: 0.8rem;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-pending-attachment-remove {
  border: 0;
  background: transparent;
  color: #475569;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.room-pending-attachment-remove:hover:not(:disabled) {
  background: rgba(71, 85, 105, 0.14);
}

body[data-theme="dark"] .room-composer {
  border-color: #364a67;
  background: #1a2334;
}

body[data-theme="dark"] .room-attach-icon-button {
  border-color: #364a67;
  background: #111827;
  color: #e2e8f0;
}

body[data-theme="dark"] .room-send-icon-button {
  background: #e7edfb;
  color: #111827;
}

body[data-theme="dark"] .room-pending-attachment {
  border-color: #364a67;
  background: #1a2334;
}

body[data-theme="dark"] .room-pending-attachment-text {
  color: #cdd8eb;
}

body[data-theme="dark"] .room-pending-attachment-remove {
  color: #d6dfef;
}

body[data-theme="dark"] .room-ai-form textarea {
  border-color: #364a67;
  background: #1a2334;
  color: #e5eefc;
}

body[data-theme="dark"] .room-ai-attachment-status.analyzed {
  background: rgba(34, 197, 94, 0.16);
  color: #8df0a9;
}

body[data-theme="dark"] .room-ai-attachment-status.skipped {
  background: rgba(239, 68, 68, 0.16);
  color: #ff9a9a;
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  padding: 0.64rem;
}

.suggestion-item {
  display: grid;
  gap: 0.38rem;
}

.suggestion-login {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.suggestion-status {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.suggestion-meta {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.suggestion-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-left: auto;
}

.suggestion-reason {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
}

.mentor-resolve {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  padding: 0.75rem;
}

.mentor-resolve .message {
  margin: 0 0 0.75rem;
}

.mentor-collaborators {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.mentor-collaborators-body {
  display: grid;
  gap: 0.7rem;
}

.mentor-collaborators-summary {
  display: grid;
  gap: 0.55rem;
}

.mentor-collaborators-summary-item {
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-strong);
}

.mentor-collaborators-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.mentor-collaborators-summary-value {
  color: var(--ink);
  line-height: 1.4;
}

.mentor-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary) 14%, transparent);
  color: var(--secondary-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body.app-layout-active #mentorPanel .mentor-chat-badge {
  min-height: 2.05rem;
  padding: 0.42rem 1rem;
  border: 1px solid #b7cbeb;
  border-radius: 999px;
  background: #f5f9ff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

body[data-theme="dark"].app-layout-active #mentorPanel .mentor-chat-badge {
  background: #1c2638;
  border-color: #3c5374;
  color: var(--ink);
}

.mentor-message-status {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.mentor-message-status.error {
  color: #b91c1c;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}


.room-name-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.24rem;
}

.room-name-wrap strong {
  display: block;
}

.room-name-translate {
  display: block;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
  padding: 0;
  cursor: pointer;
}

.room-name-translate:disabled {
  opacity: 0.65;
  cursor: wait;
  text-decoration: none;
}

body[data-theme="dark"] .room-name-translate {
  color: #9fb0ca;
}

.room-name-translate-note {
  display: block;
  margin-top: 0.06rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.room-name-translate-note.error {
  color: var(--danger);
}

.room-msg {
  max-width: 80%;
}

.room-msg-me {
  align-self: flex-end;
  background: #e7f6f1;
  border-color: #b8e4d8;
}

.room-msg-other {
  align-self: flex-start;
  background: #f2f6ff;
  border-color: #d2ddf2;
}

.room-msg-palette-0 {
  background: #eef4ff;
  border-color: #c9d8f7;
}

.room-msg-palette-1 {
  background: #fff5e6;
  border-color: #f0d39b;
}

.room-msg-palette-2 {
  background: #fff0f3;
  border-color: #efc3d0;
}

.room-msg-palette-3 {
  background: #ebf8f5;
  border-color: #b7e1d7;
}

.room-msg-palette-4 {
  background: #f4efff;
  border-color: #d5caf6;
}

.room-msg-palette-5 {
  background: #edf9ee;
  border-color: #bfe3c3;
}

.room-msg-palette-6 {
  background: #fff1e9;
  border-color: #edc7b0;
}

.room-msg-palette-7 {
  background: #edf7ff;
  border-color: #b8dbf1;
}

.room-msg .item-head {
  font-size: 0.75rem;
  color: var(--muted);
}

.room-msg .item-head strong {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.room-msg .meta {
  margin-top: 0.3rem;
  display: block;
  font-size: 0.75rem;
  color: var(--ink);
}

.room-msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.room-msg .meta.room-msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.room-msg .meta span {
  white-space: pre-wrap;
  word-break: break-word;
}

.room-msg-actions {
  display: grid;
  justify-items: start;
  gap: 0.18rem;
  margin-top: -0.05rem;
}

.room-msg-icon-row {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.room-msg:hover .room-msg-icon-row,
.room-msg:focus-within .room-msg-icon-row {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.room-msg-action {
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.8;
}

.room-msg-action.icon {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.room-msg-action.icon svg {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
}

.room-msg-action:hover:not(:disabled) {
  opacity: 1;
}

.room-msg-action.danger {
  color: #dc2626;
}

.msg-rich-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.room-msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.room-msg-attachment-size {
  font-size: 0.72rem;
  color: var(--muted);
}

.room-msg-attachment-image {
  margin-top: 0.3rem;
  display: block;
  width: min(100%, 340px);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.room-msg-attachment-preview {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

.msg-inline-link {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body[data-theme="dark"] .msg-inline-link {
  color: #98c1ff;
}

.msg-video-embed {
  margin-top: 0.45rem;
  width: min(100%, 520px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.msg-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-modal {
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.app-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.app-modal-description {
  margin: 0;
}

.app-modal-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.app-modal-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--ink);
  font: inherit;
  padding: 0.68rem 0.78rem;
}

.app-modal-input:focus {
  outline: none;
  border-color: #7aa0d8;
  box-shadow: 0 0 0 3px rgba(122, 160, 216, 0.18);
}

.report-modal {
  width: min(560px, 100%);
}

.report-modal-form {
  display: grid;
  gap: 0.72rem;
}

.report-modal-preview {
  display: grid;
  gap: 0.35rem;
  padding: 0.82rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.report-modal-preview-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-modal-preview-body {
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.report-modal-textarea {
  min-height: 110px;
  resize: vertical;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.52rem;
}

.app-modal-actions .primary.danger {
  background: #b91c1c;
  border-color: #991b1b;
}

.app-modal-actions .primary.danger:hover {
  background: #991b1b;
  border-color: #7f1d1d;
}

body[data-theme="dark"] .app-modal-backdrop {
  background: rgba(2, 8, 23, 0.6);
}

body[data-theme="dark"] .app-modal {
  background: #182234;
  border-color: #364a67;
  box-shadow: 0 26px 54px rgba(2, 8, 23, 0.65);
}

body[data-theme="dark"] .app-modal-input {
  background: #131b2b;
  border-color: #364a67;
}

body[data-theme="dark"] .report-modal-preview {
  background: #131b2b;
  border-color: #364a67;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.settings-modal {
  width: min(880px, 100%);
  height: min(86dvh, 860px);
  max-height: min(86dvh, 860px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.settings-nav {
  border-right: 1px solid var(--line);
  background: rgba(237, 244, 255, 0.62);
  padding: 0.85rem 0.65rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.settings-close-button {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.settings-nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  justify-content: flex-start;
  padding: 0.58rem 0.6rem;
  font-size: 0.93rem;
  font-weight: 600;
}

.settings-nav-item.active {
  border-color: #cfd9e8;
  background: #f7faff;
}

.settings-content {
  padding: 0.8rem 1.05rem 1rem;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-content-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: -0.1rem 0 0.4rem;
  padding-bottom: 0.28rem;
  background: linear-gradient(180deg, var(--card-strong) 72%, transparent 100%);
}

.settings-content h3 {
  font-size: 1.65rem;
  margin-bottom: 0.55rem;
}

.settings-section {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 0.4rem;
  overscroll-behavior: contain;
}

.settings-form {
  display: grid;
  gap: 0.5rem;
  max-width: 600px;
}

.settings-label-missing {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.settings-required-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.settings-field-missing {
  border-color: rgba(185, 28, 28, 0.42) !important;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

#userSettingsEmailInput {
  background: #eef2f8;
  border-color: #d4dceb;
  color: #6b778c;
  cursor: not-allowed;
}

#userSettingsDescriptionInput {
  min-height: 120px;
  resize: vertical;
}

body[data-theme="dark"] #userSettingsEmailInput {
  background: #202b3f;
  border-color: #3b4e6d;
  color: #99abc8;
}

body[data-theme="dark"] .settings-required-indicator {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

body[data-theme="dark"] .settings-field-missing {
  border-color: rgba(248, 113, 113, 0.52) !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.16);
}

.settings-interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.settings-interest-chip {
  border: 1px solid #cfd9e8;
  background: #f7faff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.settings-interest-chip.active {
  border-color: rgba(15, 118, 110, 0.42);
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-strong);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.52rem;
  align-items: center;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 0.9rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--card-strong);
  z-index: 2;
  box-shadow: 0 -10px 18px rgba(15, 23, 42, 0.04);
}

.settings-rooms-toolbar {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.55rem;
}

.settings-room-tab {
  border-radius: 999px;
  border: 1px solid #cfd9e8;
  background: #f7faff;
  color: var(--ink);
  padding: 0.36rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-room-tab.active {
  border-color: rgba(15, 118, 110, 0.42);
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-strong);
}

.settings-rooms-list {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.45rem;
  max-height: min(52dvh, 520px);
  overflow: auto;
}

.settings-room-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  padding: 0.62rem;
  display: grid;
  gap: 0.36rem;
}

.settings-room-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.55rem;
}

.settings-room-item-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.25;
}

.settings-room-item-meta {
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.settings-room-item-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.settings-room-item-actions button {
  padding: 0.3rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.settings-room-item-actions .danger {
  color: #fff;
  background: #b91c1c;
  border: 1px solid #991b1b;
}

.settings-invite-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  padding: 0.62rem;
  display: grid;
  gap: 0.32rem;
}

.settings-invite-item-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.25;
}

.settings-invite-item-meta {
  color: var(--muted);
  font-size: 0.75rem;
  display: grid;
  gap: 0.16rem;
}

body[data-theme="dark"] .settings-backdrop {
  background: rgba(2, 8, 23, 0.68);
}

body[data-theme="dark"] .settings-modal {
  background: #182234;
  border-color: #364a67;
  box-shadow: 0 28px 60px rgba(2, 8, 23, 0.68);
}

body[data-theme="dark"] .settings-nav {
  border-color: #364a67;
  background: #141f30;
}

body[data-theme="dark"] .settings-content-head {
  background: linear-gradient(180deg, #182234 72%, transparent 100%);
}

body[data-theme="dark"] .settings-actions {
  box-shadow: 0 -10px 20px rgba(2, 8, 23, 0.24);
}

body[data-theme="dark"] .settings-close-button {
  border-color: #364a67;
  background: #1d2638;
}

body[data-theme="dark"] .settings-nav-item.active {
  border-color: #456189;
  background: #223149;
}

body[data-theme="dark"] .settings-interest-chip {
  border-color: #364a67;
  background: #1d2638;
}

body[data-theme="dark"] .settings-interest-chip.active {
  border-color: rgba(46, 184, 170, 0.42);
  background: rgba(46, 184, 170, 0.16);
  color: #99efe6;
}

body[data-theme="dark"] .settings-room-tab {
  border-color: #364a67;
  background: #1d2638;
}

body[data-theme="dark"] .settings-room-tab.active {
  border-color: rgba(46, 184, 170, 0.42);
  background: rgba(46, 184, 170, 0.16);
  color: #99efe6;
}

body[data-theme="dark"] .settings-room-item {
  background: #1a2334;
  border-color: #364a67;
}

body[data-theme="dark"] .settings-invite-item {
  background: #1a2334;
  border-color: #364a67;
}

.room-msg-translate {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  text-decoration: underline;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.room-msg-translate:disabled {
  opacity: 0.65;
  cursor: wait;
  text-decoration: none;
}

body[data-theme="dark"] .room-msg-translate {
  color: #98c1ff;
}

.room-msg-translation-note {
  display: block;
  margin-top: 0.04rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.room-msg-translation-note.error {
  color: var(--danger);
}

.room-msg-translation-info {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
}

body[data-theme="dark"] .room-msg-me {
  background: #1b3a35;
  border-color: #2c5e56;
}

body[data-theme="dark"] .room-msg-other {
  background: #1a2436;
  border-color: #304461;
}

body[data-theme="dark"] .room-msg-action {
  color: #dbe7fb;
}

body[data-theme="dark"] .room-msg-action:hover:not(:disabled) {
  opacity: 1;
}

body[data-theme="dark"] .room-msg-action.danger {
  color: #ff6b6b;
}

body[data-theme="dark"] .room-msg-palette-0 {
  background: #182845;
  border-color: #2f507e;
}

body[data-theme="dark"] .room-msg-palette-1 {
  background: #3a2c18;
  border-color: #6d562e;
}

body[data-theme="dark"] .room-msg-palette-2 {
  background: #3d2030;
  border-color: #72445f;
}

body[data-theme="dark"] .room-msg-palette-3 {
  background: #19352f;
  border-color: #2e665c;
}

body[data-theme="dark"] .room-msg-palette-4 {
  background: #2a2140;
  border-color: #56457a;
}

body[data-theme="dark"] .room-msg-palette-5 {
  background: #203722;
  border-color: #436b48;
}

body[data-theme="dark"] .room-msg-palette-6 {
  background: #40261f;
  border-color: #7f5346;
}

body[data-theme="dark"] .room-msg-palette-7 {
  background: #193141;
  border-color: #37647d;
}

.meta {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.75rem;
}

.tag {
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.11);
  color: var(--primary-strong);
  padding: 0.14rem 0.5rem;
  font-size: 0.7rem;
}

.tag.topic {
  border-color: rgba(17, 72, 164, 0.25);
  background: rgba(17, 72, 164, 0.11);
  color: var(--secondary-strong);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  color: var(--muted);
}

.session-panel {
  margin-top: 0.7rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 1160px) {
  body:not(.app-layout-active) .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .room-detail-workspace.ai-open {
    grid-template-columns: minmax(0, 1fr);
  }

  body.app-layout-active .main-pane {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.app-layout-active #roomDetailPanel {
    grid-template-rows: auto auto auto auto auto;
    height: auto;
    min-height: 0;
  }

  body.app-layout-active .room-detail-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.app-layout-active .room-detail-workspace.ai-open {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }

  body.app-layout-active .room-detail-workspace.ai-open .room-ai-panel {
    order: -1;
  }

  body.app-layout-active .room-ai-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    padding: 0.85rem;
    overflow: hidden;
  }

  body.app-layout-active .room-chat-list {
    height: auto;
    min-height: min(34dvh, 22rem);
  }

  body.app-layout-active .room-detail-workspace {
    gap: 0.7rem;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .dashboard {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 108px);
    height: calc(100dvh - 108px);
  }

  body.app-layout-active .dashboard {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100dvh - 59px);
    height: calc(100dvh - 59px);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    max-width: 320px;
    z-index: 120;
    border-radius: 0 18px 18px 0;
    transform: translateX(-105%);
    transition: transform 180ms ease-out;
    overflow-y: auto;
  }

  body.app-layout-active .sidebar {
    top: 58px;
    bottom: 0;
    width: min(84vw, 320px);
    border-right: 1px solid var(--line);
    border-radius: 0 18px 0 0;
  }

  .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-out;
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-sidebar-open .mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  body.app-layout-active .page-shell {
    width: 100%;
    padding-top: 0;
  }

  body.app-layout-active .site-header {
    min-height: auto;
    padding: 0.45rem 0.75rem 0.55rem;
    gap: 0.45rem;
  }

  body.app-layout-active .main-pane {
    padding: 0.4rem 0.5rem calc(0.8rem + env(safe-area-inset-bottom));
  }

  body.app-layout-active #roomDetailPanel {
    gap: 0.08rem;
  }

  body.app-layout-active #roomDetailPanel .room-detail-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.32rem;
  }

  body.app-layout-active #roomDetailPanel .room-detail-head-main {
    gap: 0.22rem;
  }

  body.app-layout-active #roomDetailOverline {
    display: none;
  }

  body.app-layout-active #roomDetailTitle {
    font-size: clamp(1.08rem, 5.4vw, 1.38rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .room-detail-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.32rem;
    justify-content: stretch;
  }

  .room-detail-menu-wrap {
    justify-self: end;
  }

  .composer-shortcuts-row {
    align-items: flex-start;
    gap: 0.18rem;
    padding: 0 0.05rem;
  }

  .header-actions {
    width: 100%;
    gap: 0.35rem;
  }

  .header-actions .pill-button,
  .header-actions .pill-select {
    min-height: 2.3rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .composer-shortcut-hint {
    width: 100%;
    text-align: left;
  }

  .room-detail-meta-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.34rem;
  }

  #roomMembersToggleButton {
    display: none;
  }

  .room-detail-meta-actions .room-meta-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    padding: 0.64rem 0.85rem;
  }

  .room-ai-panel {
    width: 100%;
    padding: 0.8rem;
  }

  .room-detail-meta-row {
    display: none;
  }

  body.app-layout-active #roomDetailPanel .room-detail-meta-row {
    display: none;
  }

  .room-ai-form textarea {
    min-height: 5.4rem;
  }

  .room-ai-actions button,
  .room-ai-result-actions .ghost {
    width: 100%;
  }

  .room-ai-result {
    min-height: 5rem;
    max-height: 10rem;
  }

  .room-detail-workspace,
  .room-chat-list {
    width: 100%;
  }

  .room-chat-content {
    width: 100%;
    gap: 0.3rem;
  }

  .room-msg {
    max-width: calc(100% - 0.25rem);
  }

  body.app-layout-active .room-chat-list {
    padding-bottom: 0;
    min-height: 0;
  }

  .room-ai-modal {
    width: min(100%, calc(100vw - 0.5rem));
    height: min(calc(100dvh - 0.5rem), 920px);
    max-height: min(calc(100dvh - 0.5rem), 920px);
  }

  .room-ai-modal-header {
    padding: 0.85rem 0.85rem 0.6rem;
  }

  .room-ai-modal-body {
    padding: 0 0.85rem 0.9rem;
  }

  .room-ai-modal-body .room-ai-panel {
    gap: 0.5rem;
  }

  .room-composer {
    align-items: flex-end;
    border-radius: 18px;
    padding: 0.18rem 0.18rem 0.18rem 0.42rem;
    gap: 0.22rem;
  }

  .room-composer textarea {
    min-height: 1.7rem;
    padding: 0.16rem 0;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .room-attach-icon-button,
  .room-send-icon-button {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }

  .room-attach-icon-button {
    font-size: 1.15rem;
  }

  .room-send-icon-button {
    font-size: 1rem;
  }

  body.app-layout-active .room-send-form {
    gap: 0.12rem;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .room-send-form .message,
  .room-pending-attachment {
    width: 100%;
  }

  .page-shell {
    width: calc(100% - 1rem);
    padding-top: 0.65rem;
  }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .header-leading {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .brand {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .inline input {
    width: 100%;
  }

  .settings-modal {
    width: min(100%, calc(100vw - 1rem));
    height: min(calc(100dvh - 1rem), 920px);
    max-height: min(calc(100dvh - 1rem), 920px);
    grid-template-columns: 1fr;
  }

  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0.65rem;
  }

  .settings-content {
    padding: 0.72rem 0.9rem 0.9rem;
  }

  .settings-section {
    padding-bottom: 0.2rem;
  }

  .settings-actions {
    gap: 0.42rem;
    flex-wrap: wrap;
    padding-top: 0.72rem;
  }

  .settings-actions button {
    flex: 1 1 10rem;
  }

  .room-members-modal-header {
    padding: 0.9rem 0.9rem 0.65rem;
  }

  .room-members-modal-body {
    padding: 0.9rem;
  }
}

@media (max-width: 480px) {
  body.app-layout-active .main-pane {
    padding-inline: 0.35rem;
  }

  body.app-layout-active .site-header {
    padding-inline: 0.35rem;
  }

  body.app-layout-active .header-leading {
    gap: 0.45rem;
  }

  body.app-layout-active .brand {
    font-size: 1.08rem;
  }

  body.app-layout-active .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  body.app-layout-active .header-actions .pill-select,
  body.app-layout-active .header-actions .pill-button {
    width: 100%;
    min-width: 0;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  body.app-layout-active #roomDetailPanel .panel-head {
    padding-bottom: 0.35rem;
  }

  body.app-layout-active #roomDetailOverline {
    font-size: 0.9rem;
    margin-bottom: 0;
  }

  .room-detail-head-actions {
    grid-template-columns: minmax(0, 1fr) 2.4rem;
    gap: 0.35rem;
  }

  .room-detail-meta-actions .room-meta-button {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  .room-msg {
    max-width: 100%;
  }

  body.app-layout-active #roomDetailPanel .room-menu-trigger {
    width: 2.4rem;
    height: 2.4rem;
    min-width: 2.4rem;
  }

  .room-ai-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  #roomAiBackdrop {
    padding: 0;
  }

  .room-ai-modal-header {
    padding: 0.8rem 0.75rem 0.55rem;
  }

  .room-ai-modal-body {
    padding: 0 0.75rem calc(0.85rem + env(safe-area-inset-bottom));
  }
}
