:root {
  color-scheme: light;
  --ink: #20312c;
  --ink-soft: #45564f;
  --muted: #7b8983;
  --muted-strong: #61716a;
  --line: #e2e9e4;
  --line-strong: #d4ded8;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-muted: #edf4f0;
  --canvas: #edf2ef;
  --rail: #eef3f0;
  --rail-hover: #dcefe5;
  --brand: #268f69;
  --brand-strong: #176e51;
  --brand-soft: #dff4e8;
  --brand-pale: #f0faf4;
  --yellow-soft: #fff5d6;
  --yellow: #efc966;
  --danger: #dc5c4d;
  --warning: #da8a32;
  --success: #2d9a70;
  --shadow: 0 24px 60px rgba(42, 68, 57, 0.12), 0 2px 10px rgba(42, 68, 57, 0.07);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-width: 312px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
}

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  font-size: 14px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2c918e;
  outline-offset: 2px;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.auth-shell {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(480px, 1.08fr);
  background: #f4f8f5;
}

body.is-authenticated .auth-shell {
  display: none;
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  background:
    radial-gradient(circle at 18% 82%, rgba(255, 227, 139, 0.24), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(159, 226, 190, 0.24), transparent 28%),
    linear-gradient(145deg, #173c34, #255d4c 58%, #5f7d61);
  color: #fff;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  border: 1px solid rgba(129, 197, 188, 0.14);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.auth-story::before {
  top: -180px;
  right: -210px;
  width: 520px;
  height: 520px;
}

.auth-story::after {
  right: -100px;
  bottom: -260px;
  width: 620px;
  height: 620px;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: #dff0ed;
  color: #0e6866;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.auth-brand strong {
  font-size: 14px;
  letter-spacing: 0.16em;
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: auto 0;
}

.auth-story-copy .eyebrow {
  color: #7ec4bb;
}

.auth-story-copy h1 {
  margin: 16px 0 18px;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.18;
}

.auth-story-copy > p:last-child {
  max-width: 470px;
  margin: 0;
  color: #aebfc7;
  font-size: 13px;
  line-height: 1.8;
}

.auth-principles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-principles article {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-principles article > svg {
  width: 17px;
  height: 17px;
  color: #79bdb5;
}

.auth-principles strong,
.auth-principles small {
  display: block;
}

.auth-principles strong {
  font-size: 10px;
}

.auth-principles small {
  margin-top: 4px;
  color: #8198a3;
  font-size: 8px;
  line-height: 1.45;
}

.auth-version {
  position: relative;
  z-index: 1;
  margin: 28px 0 0;
  color: #647d89;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.auth-panel {
  display: grid;
  min-height: 0;
  padding: 28px;
  place-items: center;
  overflow-y: auto;
}

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted-strong);
  font-size: 11px;
}

.auth-loader {
  width: 30px;
  height: 30px;
  border: 3px solid #d9e1e3;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: auth-spin 720ms linear infinite;
}

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

.auth-card {
  width: min(450px, 100%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 43, 55, 0.1);
}

.auth-tabs {
  display: grid;
  height: 48px;
  padding: 6px;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}

.auth-tabs button {
  position: relative;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

.auth-tabs button:hover {
  color: var(--ink);
}

.auth-tabs button.is-active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 1px 3px rgba(22, 43, 54, 0.09);
}

.auth-form {
  display: grid;
  padding: 28px 32px 30px;
  gap: 14px;
}

.auth-form-heading {
  margin-bottom: 7px;
}

.auth-form-heading h2 {
  margin: 0;
  font-size: 22px;
}

.auth-form-heading > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.auth-form > label,
.auth-field-grid > label,
.auth-captcha > label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.auth-input {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.auth-input:focus-within {
  border-color: #83bdb8;
  box-shadow: 0 0 0 3px rgba(23, 124, 120, 0.08);
}

.auth-input > svg {
  width: 16px;
  height: 16px;
}

.auth-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.auth-input input::placeholder {
  color: #a1abb0;
}

.auth-input button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.auth-input button:hover {
  background: var(--surface-muted);
}

.auth-input button svg {
  width: 15px;
  height: 15px;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-captcha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  align-items: end;
  gap: 10px;
}

.auth-captcha-visual {
  position: relative;
  display: block;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #eff7f4;
}

.auth-captcha-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-captcha-visual > span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand-strong);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(21, 65, 59, 0.12);
}

.auth-captcha-visual > span svg {
  width: 10px;
  height: 10px;
}

.auth-captcha-visual:hover,
.auth-captcha-visual:focus-visible {
  border-color: #69aaa2;
  outline: 3px solid rgba(23, 124, 120, 0.1);
}

.auth-captcha-visual.is-loading img {
  opacity: 0.38;
}

.auth-form label > small {
  min-height: 10px;
  color: var(--danger);
  font-size: 8px;
  font-weight: 500;
}

.auth-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 9px;
}

.auth-form-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-form-options input {
  width: 13px;
  height: 13px;
  accent-color: var(--brand);
}

.auth-form-options button {
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-size: 9px;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #f0d4d0;
  border-radius: 7px;
  background: #fdf4f2;
  color: #aa473d;
  font-size: 9px;
}

.auth-submit {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.auth-submit:hover {
  background: var(--brand-strong);
}

.auth-submit:disabled {
  background: #94afad;
  cursor: wait;
}

.auth-submit svg {
  width: 15px;
  height: 15px;
}

.auth-agreement {
  margin: -2px 0 0;
  color: #929da3;
  font-size: 8px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { padding: 18px; background: #edf2f2; }
}

@media (max-width: 460px) {
  .auth-card { border-radius: 11px; }
  .auth-form { padding: 22px 20px 24px; }
  .auth-field-grid { grid-template-columns: 1fr; }
  .auth-captcha { grid-template-columns: minmax(0, 1fr) 132px; }
}

.prototype-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid #d7e6de;
  background: linear-gradient(90deg, #e1f3e8, #f7fbf7 58%, #fff2c8);
  color: var(--ink-soft);
  font-size: 12px;
}

.prototype-banner > span {
  padding: 3px 8px;
  border: 1px solid #a9d5bf;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--brand-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.prototype-banner p {
  margin: 0;
  color: #657a70;
}

.prototype-banner button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #ead28e;
  background: #fff7dc;
  color: #725c23;
  font-size: 12px;
  font-weight: 700;
}

.prototype-banner button:hover {
  background: #ffefb8;
}

.prototype-banner button svg {
  width: 14px;
  height: 14px;
}

.desktop-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.app-window {
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.window-bar {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f5f7f8;
  user-select: none;
}

.traffic-lights {
  display: flex;
  gap: 8px;
  padding-left: 14px;
}

.traffic-lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.traffic-lights span:nth-child(1) { background: #ed6b5e; }
.traffic-lights span:nth-child(2) { background: #e8b64a; }
.traffic-lights span:nth-child(3) { background: #61b955; }

.window-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #30414c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.window-title > span:last-child {
  color: #849098;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(45, 154, 112, 0.12);
}

.window-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.window-actions button {
  display: grid;
  width: 42px;
  height: 100%;
  place-items: center;
  background: transparent;
  color: #65727b;
}

.window-actions button:hover {
  background: #e8ecef;
}

.window-actions button:last-child:hover {
  background: #d9574c;
  color: #fff;
}

.window-actions svg {
  width: 13px;
  height: 13px;
}

.app-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 72px var(--sidebar-width) minmax(0, 1fr);
}

.rail {
  z-index: 4;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  background: var(--rail);
  border-right: 1px solid #dce6e0;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  margin-top: 18px;
  place-items: center;
  border-radius: 11px;
  border: 1px solid #b9dccb;
  background: #d8f1e3;
  color: var(--brand-strong);
}

.brand-mark span {
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.rail-primary,
.rail-secondary {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.rail-primary {
  margin-top: 28px;
}

.rail-secondary {
  margin-top: auto;
  padding-bottom: 16px;
}

.rail-button,
.profile-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius-md);
  background: transparent;
  color: #72847b;
}

.rail-button:hover,
.rail-button.is-active {
  background: var(--rail-hover);
  color: var(--brand-strong);
}

.rail-button.is-active::before {
  position: absolute;
  left: -15px;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: #4eae80;
  content: "";
}

.rail-button::after,
.profile-button::after {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: calc(100% + 10px);
  padding: 6px 8px;
  transform: translate(4px, -50%);
  border-radius: 5px;
  background: #29433a;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.rail-button:hover::after,
.profile-button:hover::after {
  transform: translate(0, -50%);
  opacity: 1;
}

.rail-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--rail);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.status-pip {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--rail);
  border-radius: 50%;
  background: #f0a648;
}

.profile-button {
  margin-top: 4px;
}

.profile-button .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.online-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--rail);
  border-radius: 50%;
  background: #55bd76;
}

.sidebar {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fafcfb 0%, #f4f8f5 100%);
}

.sidebar-header {
  display: flex;
  height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 22px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-header h1,
.content-header h2,
.chat-header h2,
.dialog-header h2,
.blueprint-header h2 {
  margin: 0;
}

.sidebar-header h1 {
  font-size: 22px;
  line-height: 1.2;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-strong);
}

.icon-button:hover,
.icon-button.is-active {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--brand-strong);
}

.icon-button-strong {
  border-color: #dbe3e6;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 40, 52, 0.04);
}

.sidebar-tools {
  padding: 0 14px 12px;
}

.search-box,
.dialog-search {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #edf2ef;
  color: var(--muted);
}

.search-box:focus-within,
.dialog-search:focus-within {
  border-color: #8fc8c4;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(23, 124, 120, 0.08);
}

.search-box svg,
.dialog-search svg {
  width: 16px;
  height: 16px;
}

.search-box input,
.dialog-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-box input::placeholder,
.dialog-search input::placeholder {
  color: #8b969d;
}

.search-box kbd {
  padding: 2px 5px;
  border: 1px solid #d4dcdf;
  border-radius: 4px;
  background: #f7f9fa;
  color: #8c979e;
  font-family: inherit;
  font-size: 9px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-tools .filter-tabs {
  margin-top: 12px;
}

.filter-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
}

.filter-tabs button:hover,
.filter-tabs button.is-active,
.filter-tabs button[aria-selected="true"] {
  background: #dff1e7;
  color: var(--brand-strong);
  font-weight: 700;
}

.filter-tabs button span {
  display: grid;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 124, 120, 0.12);
  font-size: 9px;
}

.conversation-list,
.contact-list {
  height: calc(100% - 140px);
  padding: 0 8px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ced6da transparent;
}

.conversation-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 68px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-item:hover {
  background: #edf5f0;
}

.conversation-item.is-active {
  background: linear-gradient(90deg, #d8f0e3, #e8f7ef);
  box-shadow: inset 3px 0 #52aa7e;
}

.avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  user-select: none;
}

.avatar-group { background: #319b74; }
.avatar-coral { background: #df846e; }
.avatar-blue { background: #6f9fc2; }
.avatar-violet { background: #9387bd; }
.avatar-amber { background: #d9a653; }
.avatar-green { background: #63a681; }
.avatar-navy { background: #698695; }
.avatar-me { background: #3e916f; }

.conversation-content {
  display: block;
  min-width: 0;
  flex: 1;
}

.conversation-top,
.conversation-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-top strong,
.conversation-bottom > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-top strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.conversation-top time {
  flex: 0 0 auto;
  color: #98a2a8;
  font-size: 10px;
}

.conversation-bottom {
  margin-top: 6px;
  color: #7b878f;
  font-size: 11px;
}

.conversation-bottom svg {
  width: 12px;
  height: 12px;
}

.unread-badge {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.pin-mark {
  position: absolute;
  top: 9px;
  left: 7px;
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: #7c878e;
}

.pin-mark svg {
  width: 8px;
  height: 8px;
}

.conversation-online {
  position: absolute;
  top: 42px;
  left: 42px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface-soft);
  border-radius: 50%;
  background: #51b879;
}

.conversation-item.is-active .conversation-online {
  border-color: #d8f0e3;
}

.list-empty {
  display: flex;
  height: 240px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.list-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: #a4afb5;
}

.list-empty strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.list-empty span {
  margin-top: 5px;
  font-size: 11px;
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px;
  background: var(--surface);
}

.workspace.without-details {
  grid-template-columns: minmax(0, 1fr);
}

.main-view {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.details-panel {
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #fffefa 0%, #fbfaf2 100%);
}

.chat-view {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: 72px minmax(0, 1fr) 148px;
  background:
    radial-gradient(circle at 92% 7%, rgba(255, 235, 168, 0.3), transparent 26%),
    linear-gradient(145deg, #f6f8f6 0%, #f1f6f3 58%, #f8f6ed 100%);
}

.chat-header {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 254, 252, 0.94);
  backdrop-filter: blur(12px);
}

.chat-header > .avatar {
  width: 42px;
  height: 42px;
}

.chat-heading {
  min-width: 0;
  flex: 1;
}

.chat-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-heading h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-heading > div > span {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
}

.chat-heading p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.online-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.chat-actions {
  display: flex;
  gap: 3px;
}

.mobile-back {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
}

.chat-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 7% 28px;
  scroll-behavior: auto;
  scrollbar-color: #ced7d9 transparent;
  scrollbar-width: thin;
}

.encryption-note {
  display: flex;
  width: fit-content;
  max-width: 92%;
  align-items: center;
  gap: 6px;
  margin: 0 auto 20px;
  padding: 7px 10px;
  border: 1px solid #d2e6d9;
  border-radius: 999px;
  background: rgba(236, 248, 241, 0.9);
  color: #5c7574;
  font-size: 10px;
  text-align: center;
}

.encryption-note svg {
  width: 12px;
  height: 12px;
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: #929da3;
  font-size: 10px;
}

.date-divider::before,
.date-divider::after {
  height: 1px;
  flex: 1;
  background: #e2e7e8;
  content: "";
}

.message-row {
  display: flex;
  max-width: min(580px, 82%);
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
}

.message-row > .avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 11px;
}

.message-row.is-mine {
  margin-left: auto;
  justify-content: flex-end;
}

.message-stack {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  align-items: flex-start;
}

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

.message-author {
  display: block;
  margin: 0 0 5px 2px;
  color: #6f7d85;
  font-size: 10px;
  font-weight: 600;
}

.message-bubble {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid #dde6e0;
  border-radius: 4px 12px 12px;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(47, 73, 62, 0.045);
  color: #26333c;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.is-mine .message-bubble {
  border-color: #b9dfc9;
  border-radius: 12px 4px 12px 12px;
  background: linear-gradient(135deg, #d4f1df, #c9ebd8);
}

.message-time {
  display: block;
  margin: 5px 0 0 2px;
  color: #9aa4aa;
  font-size: 9px;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
  color: #939fa5;
  font-size: 9px;
}

.message-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #5e9791;
}

.message-meta svg {
  width: 12px;
  height: 12px;
}

/* Critical message layout lives in the base stylesheet so a stale or failed
   enhancement request cannot put every action button back into document flow. */
.message-action-menu {
  position: absolute;
  top: -5px;
  right: -32px;
  z-index: 8;
  pointer-events: none;
}

.message-row.is-mine .message-action-menu {
  right: auto;
  left: -32px;
}

.message-action-menu > summary {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8e3de;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 15px rgba(36, 61, 53, 0.1);
  color: #607870;
  cursor: pointer;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.message-action-menu > summary::-webkit-details-marker {
  display: none;
}

.message-action-menu > summary svg {
  width: 15px;
  height: 15px;
}

.message-row:hover .message-action-menu > summary,
.message-row:focus-within .message-action-menu > summary,
.message-action-menu[open] > summary {
  opacity: 1;
  pointer-events: auto;
}

.message-action-menu[open] > summary {
  border-color: #abd5c4;
  background: #eaf7f1;
  color: #18795e;
}

.message-action-menu:not([open]) > .message-actions {
  display: none !important;
}

.message-actions {
  position: absolute;
  top: 31px;
  right: 0;
  z-index: 9;
  display: flex;
  width: max-content;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(31, 66, 55, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(38, 70, 61, 0.15);
  pointer-events: auto;
}

.message-row:not(.is-mine) .message-actions {
  right: auto;
  left: 0;
}

.message-actions button {
  display: grid;
  width: 28px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #607870;
}

.message-actions button:hover,
.message-actions button:focus-visible {
  background: #eaf7f1;
  color: #18795e;
}

.message-actions svg {
  width: 15px;
  height: 15px;
}

/* Images use a bounded preview and a separate, truncating caption. This keeps
   panoramic photos and long names from changing the width of the chat. */
.image-message {
  position: relative;
  display: grid;
  width: min(360px, 58vw);
  max-width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8e3de;
  border-radius: 14px;
  background: #17221e;
  box-shadow: 0 4px 15px rgba(38, 70, 61, 0.08);
  color: #fff;
  text-align: left;
}

.image-message-preview {
  display: grid;
  width: 100%;
  max-height: 300px;
  overflow: hidden;
  place-items: center;
  background: #edf3f0;
}

.image-message-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.image-message-caption {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #20302a;
  font-size: 11px;
  line-height: 1.4;
}

.image-message-caption > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-message-caption > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.72;
}

@media (hover: none), (max-width: 720px) {
  .message-action-menu {
    top: -9px;
    right: -7px;
  }

  .message-row.is-mine .message-action-menu {
    right: auto;
    left: -7px;
  }

  .message-action-menu > summary {
    opacity: 0.78;
    pointer-events: auto;
  }

  .image-message {
    width: min(360px, 72vw);
  }
}

.load-older {
  display: flex;
  min-height: 32px;
  margin: 2px auto 12px;
  padding: 7px 13px;
  align-items: center;
  gap: 6px;
  border: 1px solid #d5e4dc;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5f7b6e;
  font-size: 10px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.load-older:hover {
  border-color: #a9cfbc;
  background: #f4fbf7;
  transform: translateY(-1px);
}

.load-older svg {
  width: 13px;
  height: 13px;
}

.file-message {
  display: flex;
  width: min(360px, 100%);
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid #dce5df;
  border-radius: 4px 12px 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 12px rgba(46, 70, 60, 0.045);
}

.is-mine .file-message {
  border-color: #e6d9a7;
  background: linear-gradient(135deg, #fffdf6, #fff4cf);
}

.file-message > div {
  min-width: 0;
  flex: 1;
}

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

.file-message strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-message small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.file-type {
  display: grid;
  width: 42px;
  height: 46px;
  place-items: center;
  border-radius: 7px;
  background: #dff2e7;
  color: var(--brand-strong);
  font-size: 9px;
  font-weight: 900;
}

.file-message button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #f0f5f1;
  color: var(--muted-strong);
}

.file-message button:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.file-message button svg {
  width: 16px;
  height: 16px;
}

.mockup-message {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px;
  background: var(--surface);
}

.mockup-message p {
  margin: 0;
  padding: 10px 13px;
  color: #26333c;
  font-size: 13px;
  line-height: 1.6;
}

.shared-preview {
  display: grid;
  height: 142px;
  margin: 0 10px;
  overflow: hidden;
  grid-template-columns: 24px 74px 1fr;
  border: 1px solid #d8e0e2;
  border-radius: 7px;
  background: #f6f8f8;
}

.preview-rail {
  background: var(--rail);
}

.preview-list {
  border-right: 1px solid #dfe5e7;
  background: #eff3f4;
}

.preview-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 30px 16px 12px;
}

.preview-chat::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  border-bottom: 1px solid #e0e6e8;
  background: #fff;
  content: "";
}

.preview-chat i,
.preview-chat b {
  display: block;
  width: 58%;
  height: 16px;
  border-radius: 3px 7px 7px;
  background: #fff;
  box-shadow: 0 0 0 1px #e2e8e9;
}

.preview-chat i:nth-child(2) {
  width: 72%;
}

.preview-chat b {
  width: 60%;
  margin-left: auto;
  border-radius: 7px 3px 7px 7px;
  background: #dcefeb;
  box-shadow: 0 0 0 1px #cee3df;
}

.mockup-message > button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px;
  background: #fff;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.mockup-message > button svg {
  width: 13px;
  height: 13px;
}

.emoji-message {
  font-size: 44px;
  line-height: 1.2;
}

.composer {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 0;
  padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(49, 73, 63, 0.025);
  grid-template-rows: 26px minmax(44px, 1fr) 28px;
}

.composer-toolbar,
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-toolbar > div {
  display: flex;
  gap: 1px;
}

.composer-toolbar button {
  display: grid;
  width: 30px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #69767e;
}

.composer-toolbar button:hover {
  background: var(--surface-muted);
  color: var(--brand);
}

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

.composer-toolbar small {
  color: #9aa4aa;
  font-size: 9px;
}

.composer textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: #a0aab0;
}

.draft-status {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #849097;
  font-size: 9px;
}

.draft-status svg {
  width: 12px;
  height: 12px;
  color: var(--brand);
}

.send-button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2d9c72, #207e5d);
  box-shadow: 0 5px 12px rgba(38, 143, 105, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.send-button:hover {
  background: var(--brand-strong);
}

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

.popover {
  position: absolute;
  z-index: 20;
  bottom: calc(100% - 26px);
  left: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(20, 38, 50, 0.14);
}

.emoji-popover {
  width: min(360px, calc(100% - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(390px, calc(100vh - 96px));
  overflow: hidden;
}

.emoji-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.emoji-popover-header > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.emoji-popover-header strong {
  font-size: 11px;
}

.emoji-popover-header small {
  color: var(--muted);
  font-size: 9px;
}

.emoji-popover-header button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.emoji-popover-header button:hover {
  background: var(--surface-muted);
  color: var(--brand);
}

.emoji-popover-header svg {
  width: 14px;
  height: 14px;
}

.emoji-panel-scroll {
  max-height: min(318px, calc(100vh - 168px));
  padding: 3px 10px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8d8cf transparent;
  scrollbar-width: thin;
}

.emoji-group {
  min-width: 0;
  padding-top: 7px;
}

.emoji-group h3 {
  margin: 0 2px 5px;
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.emoji-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 3px;
}

.emoji-grid button {
  display: grid;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  overflow: clip;
  border-radius: 5px;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(20px, 2.1vw, 23px);
  line-height: 1;
}

.emoji-grid button:hover,
.emoji-grid button:focus-visible {
  background: var(--surface-muted);
}

.attachment-popover {
  display: grid;
  width: 250px;
  padding: 7px;
  gap: 2px;
}

.attachment-popover > button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.attachment-popover > button:hover {
  background: var(--surface-soft);
}

.attachment-popover > button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.attachment-popover strong,
.attachment-popover small {
  display: block;
}

.attachment-popover strong {
  font-size: 11px;
}

.attachment-popover small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.details-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-color: #d4dcdf transparent;
  scrollbar-width: thin;
}

.details-identity {
  padding: 26px 18px 18px;
  text-align: center;
}

.details-identity > .avatar {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 14px;
  font-size: 17px;
}

.details-identity h2 {
  margin: 0;
  font-size: 14px;
}

.details-identity > p {
  margin: 5px 0 16px;
  color: var(--muted);
  font-size: 10px;
}

.details-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.details-quick-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 9px;
}

.details-quick-actions button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffef8;
}

.details-quick-actions button:hover span {
  border-color: #b9d6d3;
  background: var(--brand-pale);
  color: var(--brand);
}

.details-quick-actions svg {
  width: 15px;
  height: 15px;
}

.detail-section {
  padding: 16px 16px;
  border-top: 1px solid var(--line);
}

.section-heading,
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3,
.card-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
}

.section-heading button,
.card-heading button,
.card-heading span {
  background: transparent;
  color: var(--brand);
  font-size: 9px;
}

.member-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 4px;
}

.member-grid button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--muted-strong);
}

.member-grid .avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 10px;
}

.member-grid small {
  width: 100%;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-avatar {
  border: 1px dashed #cfd8db;
  background: #fff;
  color: var(--muted);
}

.add-avatar svg {
  width: 14px;
  height: 14px;
}

.announcement-card {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid #eee4bd;
  background: linear-gradient(135deg, #fffdf5, #fff5d4);
  color: inherit;
  text-align: left;
}

.announcement-card:hover {
  background: #fff0bc;
}

.announcement-card > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #f5e8d7;
  color: #b46c2d;
}

.announcement-card svg {
  width: 14px;
  height: 14px;
}

.announcement-card strong,
.announcement-card p {
  display: block;
}

.announcement-card strong {
  font-size: 10px;
}

.announcement-card p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-grid {
  display: grid;
  margin-top: 10px;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.media-grid button {
  position: relative;
  display: grid;
  aspect-ratio: 1.2;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eff3f3;
  color: var(--muted-strong);
}

.media-grid button:nth-child(1)::before,
.media-grid button:nth-child(2)::before {
  position: absolute;
  inset: 10px 8px;
  border: 5px solid #789994;
  border-top-width: 14px;
  border-radius: 3px;
  content: "";
  opacity: 0.75;
}

.media-grid button:nth-child(2)::before {
  border-color: #7f8fa8;
}

.media-grid button svg {
  width: 20px;
  height: 20px;
}

.media-grid button span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 8px;
}

.detail-options {
  padding: 7px 8px 18px;
}

.detail-options > button,
.detail-options > label {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
}

.detail-options > button:hover {
  background: var(--surface-muted);
}

.detail-options span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-options > button > svg,
.detail-options span svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.detail-options > button > svg:last-child {
  width: 12px;
  height: 12px;
}

.detail-options small {
  margin-left: auto;
  padding-right: 6px;
  color: var(--muted);
  font-size: 9px;
}

.switch {
  position: relative;
  width: 34px;
  height: 19px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: #c8d0d4;
  cursor: pointer;
  transition: background 140ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 35, 45, 0.2);
  content: "";
  transition: transform 140ms ease;
}

.switch:checked {
  background: var(--brand);
}

.switch:checked::after {
  transform: translateX(15px);
}

.directory-shortcuts {
  padding: 0 10px 8px;
}

.directory-shortcuts button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}

.directory-shortcuts button:hover {
  background: var(--surface-muted);
}

.directory-shortcuts button > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.directory-shortcuts button:nth-child(2) > span {
  background: #e9ecf5;
  color: #6b68a0;
}

.directory-shortcuts strong {
  flex: 1;
  font-size: 11px;
}

.directory-shortcuts svg {
  width: 15px;
  height: 15px;
}

.directory-shortcuts > button > svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.directory-shortcuts small {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
}

.list-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 6px;
  color: #8a959c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contact-list {
  height: calc(100% - 212px);
}

.contact-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.contact-item:hover,
.contact-item.is-active {
  background: #e6eeed;
}

.contact-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 11px;
}

.contact-item > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.contact-item strong,
.contact-item small {
  display: block;
}

.contact-item strong {
  font-size: 11px;
}

.contact-item small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.group-summary {
  display: grid;
  margin: 0 14px 10px;
  padding: 11px;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.group-summary span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}

.group-summary span + span {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

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

body[data-view="groups"] .contact-list {
  height: calc(100% - 226px);
}

.file-nav,
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 12px;
}

.file-nav button,
.settings-nav button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
}

.file-nav button:hover,
.file-nav button.is-active,
.settings-nav button:hover,
.settings-nav button.is-active {
  background: #e4eeed;
  color: var(--brand-strong);
}

.file-nav button span,
.settings-nav button span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}

.file-nav svg,
.settings-nav svg {
  width: 15px;
  height: 15px;
}

.file-nav small {
  font-size: 9px;
}

.storage-card {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.storage-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.storage-card > div:first-child span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.storage-card svg {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.storage-card strong {
  font-size: 9px;
}

.storage-track {
  height: 5px;
  margin: 10px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edef;
}

.storage-track span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.storage-card > small {
  color: var(--muted);
  font-size: 8px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.settings-profile .avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 11px;
}

.settings-profile > div {
  min-width: 0;
  flex: 1;
}

.settings-profile strong,
.settings-profile small {
  display: block;
}

.settings-profile strong { font-size: 11px; }
.settings-profile small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.security-chip,
.verified-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--success);
  font-size: 8px;
  font-weight: 700;
}

.security-chip svg,
.verified-label svg {
  width: 11px;
  height: 11px;
}

.settings-nav button > svg:last-child {
  width: 12px;
  height: 12px;
}

.version-label {
  position: absolute;
  right: 0;
  bottom: 16px;
  left: 0;
  margin: 0;
  color: #9aa4aa;
  font-size: 8px;
  text-align: center;
}

.content-page {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  background: #f6f8f9;
  scrollbar-color: #ccd5d8 transparent;
  scrollbar-width: thin;
}

.content-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.content-header h2 {
  font-size: 18px;
}

.content-header > div:last-child {
  display: flex;
  gap: 8px;
}

.button-primary,
.button-secondary,
.button-quiet,
.select-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-primary:hover {
  background: var(--brand-strong);
}

.button-primary:disabled {
  background: #b9c6c8;
  cursor: not-allowed;
}

.button-secondary,
.select-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
}

.button-secondary:hover,
.select-button:hover {
  border-color: #b8cecc;
  background: var(--brand-pale);
  color: var(--brand-strong);
}

.button-quiet {
  background: transparent;
  color: var(--muted-strong);
}

.button-primary svg,
.button-secondary svg,
.button-quiet svg,
.select-button svg {
  width: 15px;
  height: 15px;
}

.profile-hero {
  display: grid;
  align-items: center;
  padding: 30px 34px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.profile-hero > .avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 24px;
}

.profile-hero > div:nth-child(2) > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-hero h3 {
  margin: 0;
  font-size: 22px;
}

.profile-hero p {
  margin: 6px 0 7px;
  color: var(--muted-strong);
  font-size: 12px;
}

.presence-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9f6ef;
  color: #287c5a;
  font-size: 9px;
}

.presence-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-layout {
  display: grid;
  align-items: start;
  padding: 22px 26px 32px;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.profile-layout > div {
  display: grid;
  gap: 16px;
}

.info-card,
.shared-groups,
.file-table-card,
.settings-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.info-card,
.shared-groups {
  padding: 18px;
}

.info-card dl {
  display: grid;
  margin: 16px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.info-card dl div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: baseline;
}

.info-card dt {
  color: var(--muted);
  font-size: 10px;
}

.info-card dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.activity-list {
  display: grid;
  margin-top: 14px;
  gap: 12px;
}

.activity-list article {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-list article > span,
.task-card article > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.activity-list article > span svg,
.task-card article > span svg {
  width: 15px;
  height: 15px;
}

.activity-list strong,
.activity-list small {
  display: block;
}

.activity-list strong {
  font-size: 10px;
}

.activity-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.shared-groups {
  display: grid;
  gap: 6px;
}

.shared-groups .card-heading {
  margin-bottom: 8px;
}

.shared-groups > button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.shared-groups > button:hover {
  background: var(--surface-soft);
}

.shared-groups .avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 10px;
}

.shared-groups > button > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.shared-groups strong,
.shared-groups small {
  display: block;
}

.shared-groups strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-groups small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.shared-groups svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.group-cover {
  display: grid;
  align-items: center;
  padding: 28px 32px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.group-cover > .avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 23px;
}

.group-cover > div:nth-child(2) > span {
  color: var(--brand);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.group-cover h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.group-cover p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.group-metrics {
  display: flex;
  align-items: center;
  gap: 18px;
}

.group-metrics span {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.group-metrics span + span {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.group-metrics strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 18px;
}

.dashboard-grid {
  display: grid;
  align-items: start;
  padding: 22px 26px 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.task-card article {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
}

.task-card article > span {
  background: #f8ead9;
  color: #b66f31;
}

.task-card article strong {
  font-size: 11px;
}

.task-card article p {
  margin: 5px 0;
  color: var(--muted-strong);
  font-size: 10px;
  line-height: 1.55;
}

.task-card article small {
  color: var(--muted);
  font-size: 9px;
}

.active-members {
  display: grid;
  margin-top: 10px;
}

.active-members > div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f1;
}

.active-members > div:last-child {
  border-bottom: 0;
}

.active-members .avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 9px;
}

.active-members > div > span:nth-child(2) {
  flex: 1;
}

.active-members strong,
.active-members small {
  display: block;
}

.active-members strong { font-size: 10px; }
.active-members small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.active-members b { color: var(--muted); font-size: 8px; font-weight: 600; }

.recent-files {
  display: grid;
  gap: 5px;
}

.recent-files .card-heading {
  margin-bottom: 4px;
}

.simple-file-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.simple-file-row:hover {
  background: var(--surface-soft);
}

.simple-file-row > span {
  min-width: 0;
  flex: 1;
}

.simple-file-row strong,
.simple-file-row small {
  display: block;
}

.simple-file-row strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-file-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.simple-file-row > svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.file-icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 7px;
  background: #e8f0ef;
  color: var(--brand);
}

.file-pdf { background: #f9e7e4; color: #c55246; }
.file-xls { background: #e4f1e8; color: #35825a; }
.file-zip { background: #eee9f6; color: #6f5b9b; }
.file-doc { background: #e7edf6; color: #466f9d; }
.file-fig { background: #f6ebdf; color: #ac6c34; }

.safety-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.safety-card > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.safety-card > div > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.safety-card h3,
.safety-card p {
  margin: 0;
}

.safety-card h3 { font-size: 11px; }
.safety-card p { margin-top: 5px; color: var(--muted); font-size: 9px; }

.file-stats {
  display: grid;
  padding: 20px 26px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.file-stats article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.file-stats article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}

.file-stats article:nth-child(2) > span { background: #e9edf5; color: #5e7094; }
.file-stats article:nth-child(3) > span { background: #e6f2e9; color: #3b8158; }
.file-stats article svg { width: 17px; height: 17px; }
.file-stats strong, .file-stats small { display: block; }
.file-stats strong { font-size: 16px; }
.file-stats small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.file-table-card {
  margin: 16px 26px 28px;
  overflow: hidden;
}

.file-table-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.file-table {
  min-width: 720px;
}

.file-table-head,
.file-table-row {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(220px, 1.6fr) minmax(120px, 1fr) 80px 70px 104px 32px;
  column-gap: 10px;
}

.file-table-head {
  min-height: 36px;
  padding: 0 16px;
  background: #f8f9fa;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.file-table-row {
  min-height: 54px;
  padding: 0 16px;
  border-top: 1px solid #edf0f1;
  color: var(--muted-strong);
  font-size: 9px;
}

.file-table-row:hover {
  background: #fbfcfc;
}

.file-name-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.file-name-cell .file-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.file-name-cell strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-table-row > button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.file-table-row > button:hover {
  background: var(--surface-muted);
}

.file-table-row > button svg {
  width: 14px;
  height: 14px;
}

.settings-content {
  display: grid;
  max-width: 840px;
  padding: 22px 28px 40px;
  gap: 16px;
}

.settings-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  overflow: hidden;
}

.settings-section-heading {
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #f9fafb;
}

.settings-section-heading h3,
.settings-section-heading p {
  margin: 0;
}

.settings-section-heading h3 {
  font-size: 12px;
}

.settings-section-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.setting-rows > label {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.setting-rows > label:last-child {
  border-bottom: 0;
}

.setting-rows strong,
.setting-rows small {
  display: block;
}

.setting-rows strong {
  font-size: 10px;
}

.setting-rows small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.select-button {
  min-width: 110px;
}

.app-dialog,
.blueprint-dialog {
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 72px rgba(13, 31, 42, 0.3);
}

.app-dialog::backdrop,
.blueprint-dialog::backdrop {
  background: rgba(12, 28, 38, 0.52);
  backdrop-filter: blur(3px);
}

.app-dialog form {
  display: grid;
  max-height: min(680px, calc(100vh - 64px));
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.dialog-header,
.blueprint-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
}

.dialog-header h2,
.blueprint-header h2 {
  font-size: 19px;
}

.dialog-search {
  margin: 0 24px 12px;
}

.selected-people {
  display: flex;
  min-height: 36px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 0 24px 10px;
}

.selected-people > span:not(.selection-hint) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 700;
}

.selected-people svg {
  width: 11px;
  height: 11px;
}

.selection-hint {
  color: var(--muted);
  font-size: 9px;
}

.contact-picker {
  min-height: 0;
  padding: 0 16px 10px;
  overflow-y: auto;
}

.picker-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.picker-person:hover {
  background: var(--surface-soft);
}

.picker-person input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.picker-person .avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 11px;
}

.picker-person > span:last-child {
  flex: 1;
}

.picker-person strong,
.picker-person small {
  display: block;
}

.picker-person strong { font-size: 11px; }
.picker-person small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfb;
}

.blueprint-dialog {
  width: min(940px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.blueprint-header {
  padding: 26px 30px 20px;
  border-bottom: 1px solid var(--line);
}

.blueprint-header > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.blueprint-grid {
  display: grid;
  padding: 20px 30px 26px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.blueprint-grid article {
  position: relative;
  min-height: 190px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.blueprint-grid article:nth-child(3n) { border-right: 0; }
.blueprint-grid article:nth-last-child(-n + 3) { border-bottom: 0; }

.blueprint-index {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #c1c9cd;
  font-family: Georgia, serif;
  font-size: 15px;
}

.blueprint-grid article > svg {
  width: 26px;
  height: 26px;
  margin-bottom: 20px;
  color: var(--brand);
}

.blueprint-grid h3 {
  margin: 0;
  font-size: 14px;
}

.blueprint-grid p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 10px;
  line-height: 1.7;
}

.blueprint-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  border-top: 1px solid var(--line);
  background: #f8faf9;
}

.blueprint-dialog footer span,
.blueprint-dialog footer strong {
  display: block;
}

.blueprint-dialog footer span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.blueprint-dialog footer strong {
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  top: 56px;
  right: 24px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 240px;
  max-width: 360px;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  transform: translateY(-8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  border-color: rgba(255, 255, 255, 0.18);
  background: #29493d;
  box-shadow: 0 10px 24px rgba(28, 55, 45, 0.2);
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 16px;
  height: 16px;
  color: #a8e2c4;
}

@media (max-width: 1260px) {
  :root { --sidebar-width: 288px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 252px; }
  .details-panel { font-size: 12px; }
  .member-grid { grid-template-columns: repeat(4, 1fr); }
  .member-grid button:nth-child(4) { display: none; }
  .chat-scroll { padding-right: 5%; padding-left: 5%; }
  .profile-layout { grid-template-columns: minmax(0, 1fr) 230px; }
}

@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .details-panel { display: none; }
  .chat-actions button:last-child { display: none; }
  .group-cover { grid-template-columns: auto minmax(0, 1fr); }
  .group-metrics { grid-column: 1 / -1; padding-left: 90px; justify-content: flex-start; }
  .profile-hero { grid-template-columns: auto minmax(0, 1fr); }
  .profile-actions { grid-column: 1 / -1; padding-left: 90px; }
}

@media (max-width: 900px) {
  .desktop-stage { padding: 0; }
  .app-window { border: 0; border-radius: 0; }
  .window-bar { display: none; }
  .app-window { grid-template-rows: minmax(0, 1fr); }
  .app-layout { grid-template-columns: 64px 272px minmax(0, 1fr); }
  .profile-layout { grid-template-columns: 1fr; }
  .shared-groups { grid-column: 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .safety-card { grid-column: 1; }
  .file-stats { grid-template-columns: 1fr; }
  .file-stats article { padding: 10px 14px; }
  .settings-section { grid-template-columns: 1fr; }
  .settings-section-heading { border-right: 0; border-bottom: 1px solid var(--line); }
  .file-table-card { overflow-x: auto; }
}

@media (max-width: 720px) {
  body { grid-template-rows: 32px minmax(0, 1fr); }
  .prototype-banner { justify-content: space-between; padding: 0 10px; }
  .prototype-banner p { display: none; }
  .prototype-banner button { margin: 0; padding: 4px 7px; }
  .app-layout { position: relative; display: block; }
  .rail {
    position: absolute;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: 58px;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .brand-mark,
  .rail-secondary,
  .rail-primary .rail-button:nth-child(n + 5) { display: none; }
  .rail-primary { display: contents; }
  .rail-button { width: 42px; height: 42px; margin: auto; }
  .rail-button.is-active::before { top: auto; bottom: -8px; left: 50%; width: 20px; height: 3px; transform: translateX(-50%); border-radius: 4px 4px 0 0; }
  .rail-button::after { display: none; }
  .sidebar { position: absolute; inset: 0 0 58px; border-right: 0; }
  .workspace { position: absolute; z-index: 8; inset: 0 0 58px; transform: translateX(100%); transition: transform 180ms ease; }
  .mobile-chat-open .workspace { transform: translateX(0); }
  body:not([data-view="messages"]) .workspace { transform: translateX(0); }
  body:not([data-view="messages"]) .sidebar { display: none; }
  .mobile-back { display: grid; }
  .chat-header { padding: 0 10px; }
  .chat-header > .avatar { display: none; }
  .chat-actions .icon-button:nth-child(1) { display: none; }
  .chat-scroll { padding: 14px 12px 24px; }
  .message-row { max-width: 92%; }
  .composer-toolbar small { display: none; }
  .content-header { padding: 0 16px; }
  .content-header .button-secondary { display: none; }
  .profile-hero,
  .group-cover { padding: 22px 18px; grid-template-columns: auto minmax(0, 1fr); }
  .profile-hero > .avatar,
  .group-cover > .avatar { width: 58px; height: 58px; border-radius: 15px; font-size: 18px; }
  .profile-actions { padding-left: 0; }
  .profile-layout,
  .dashboard-grid { padding: 16px; }
  .info-card dl { grid-template-columns: 1fr; }
  .group-metrics { padding-left: 0; gap: 10px; }
  .group-metrics span + span { padding-left: 10px; }
  .file-stats { padding: 14px 14px 0; }
  .file-table-card { margin: 14px; }
  .settings-content { padding: 14px; }
  .blueprint-grid { grid-template-columns: 1fr; padding: 10px 20px 20px; }
  .blueprint-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .blueprint-grid article:last-child { border-bottom: 0 !important; }
  .blueprint-dialog footer { align-items: flex-start; flex-direction: column; }
}
