:root {
  color-scheme: dark;
  --im-scene-rail-width: 220px;
  --bg-deep: #05030d;
  --bg: #07050f;
  --bg-elevated: #0a0a0c;
  --panel-outer: #111325;
  --panel: #1b1f33;
  --panel-soft: #20233b;
  --panel-inner: #2a2d48;
  --ink: #f5f8ff;
  --ink-soft: #e8ecf6;
  --muted: #a9b0d2;
  --muted-soft: #8a92b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #7efdc7;
  --accent-strong: #64e4bf;
  --accent-soft: rgba(126, 253, 199, 0.12);
  --accent-muted: rgba(126, 253, 199, 0.06);
  --accent-warm: #ffa45c;
  --accent-warm-soft: rgba(255, 164, 92, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --shadow-soft: 0 16px 32px rgba(1, 5, 16, 0.6);
  --shadow-strong: 0 24px 48px rgba(1, 5, 16, 0.75);
  --shadow-glow: 0 0 40px rgba(126, 253, 199, 0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-ui: "Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", monospace;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
}

/* 2026-04-24 scene-first pixel city revision
   The generated pixel art is the product surface; HUD controls should frame it,
   not cover it with large glass cards. */
body[data-shell-page="hub"][data-shell-variant="public-square"] {
  min-height: 100vh;
  overflow: hidden;
  background: #120d08;
  color: #fff2c9;
}

body[data-shell-page="hub"][data-shell-variant="public-square"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    url("assets/pixel/chinese-modern-city/backgrounds/hub_full.avif") center / cover no-repeat,
    #120d08;
  image-rendering: pixelated;
}

body[data-shell-page="hub"][data-shell-variant="public-square"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 5, 4, 0.08), rgba(7, 5, 4, 0) 34%, rgba(7, 5, 4, 0.26)),
    radial-gradient(circle at 50% 46%, rgba(255, 210, 120, 0.10), transparent 48%);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .city-hub-shell {
  width: min(100vw, 1640px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  background: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud {
  min-height: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(90deg, rgba(34, 22, 11, 0.86), rgba(60, 38, 17, 0.72)),
    url("assets/pixel/chinese-modern-city/ui/hud_top_bar.avif") center / cover no-repeat;
  border: 2px solid #f1c978;
  box-shadow: 0 0 0 3px rgba(28, 16, 8, 0.92), 0 8px 0 rgba(0, 0, 0, 0.32);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--im-scene-rail-width, 220px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail {
  min-width: 0;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  background:
    url("assets/pixel/chinese-modern-city/ui/hud_left_nav.avif") center / cover no-repeat,
    rgba(229, 202, 136, 0.90);
  border: 2px solid #2b1c11;
  box-shadow: 0 0 0 3px rgba(246, 219, 151, 0.55), 0 8px 0 rgba(0, 0, 0, 0.28);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail-head,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-rail-note {
  display: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tab {
  min-height: 56px;
  padding: 6px 4px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #21140b;
  background: rgba(255, 239, 178, 0.72);
  border: 2px solid rgba(40, 25, 13, 0.84);
  box-shadow: inset 0 -3px 0 rgba(78, 45, 20, 0.26);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tab.is-active {
  color: #fff4c9;
  background: #8d3d1b;
  border-color: #fff1aa;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tab span {
  font-size: 24px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-stage {
  position: relative;
  min-height: calc(100vh - 86px);
  overflow: hidden;
  background:
    url("assets/pixel/chinese-modern-city/backgrounds/hub_full.avif") center / cover no-repeat,
    #21150c;
  border: 3px solid #27190f;
  box-shadow: 0 0 0 3px #f1c978, 0 12px 0 rgba(0, 0, 0, 0.34);
  image-rendering: pixelated;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.22)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.18));
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hero {
  position: absolute;
  inset: 12px 12px auto 12px;
  z-index: 2;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy {
  width: min(390px, 42vw);
  padding: 10px 12px;
  background: rgba(18, 11, 7, 0.62);
  border: 2px solid rgba(255, 229, 149, 0.88);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy h1 {
  margin: 4px 0;
  font-size: 30px;
  line-height: 1.05;
  text-shadow: 2px 2px 0 #281205;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta {
  margin-top: 8px;
  gap: 6px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta span {
  background: rgba(255, 236, 164, 0.82);
  color: #28170b;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview {
  width: 226px;
  pointer-events: auto;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame {
  min-height: 118px;
  padding: 7px;
  background:
    url("assets/pixel/chinese-modern-city/backgrounds/hub_mid_scene_band.avif") center / cover no-repeat,
    #1e130b;
  border: 2px solid rgba(255, 231, 151, 0.88);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame::before,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame::after {
  display: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-strip {
  position: absolute;
  left: 14px;
  bottom: 108px;
  z-index: 3;
  width: min(520px, 46%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel {
  min-height: 82px;
  padding: 10px 12px;
  background: rgba(18, 11, 7, 0.66);
  border: 2px solid rgba(255, 224, 143, 0.86);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.24);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel p {
  font-size: 14px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-chat {
  position: absolute;
  right: 14px;
  bottom: 96px;
  z-index: 4;
  width: min(560px, 47%);
  max-height: 38vh;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log {
  max-height: 38vh;
  padding: 4px 2px 8px;
  overflow: auto;
  scrollbar-width: thin;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message {
  width: fit-content;
  max-width: 88%;
  padding: 10px 12px;
  color: #fff6df;
  background: rgba(20, 12, 8, 0.78);
  border: 2px solid rgba(255, 224, 143, 0.82);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message--own {
  margin-left: auto;
  background: rgba(92, 43, 21, 0.82);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 5;
  padding: 8px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background:
    url("assets/pixel/chinese-modern-city/ui/chat_composer_bar.avif") center / cover no-repeat,
    rgba(44, 27, 12, 0.90);
  border: 3px solid #f2c879;
  box-shadow: 0 0 0 3px rgba(33, 19, 10, 0.94), 0 7px 0 rgba(0, 0, 0, 0.32);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool {
  min-width: 48px;
  min-height: 42px;
  background: rgba(255, 233, 168, 0.84);
  border: 2px solid #321d0d;
  color: #2a1709;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field {
  min-height: 44px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: rgba(255, 244, 208, 0.88);
  border: 2px solid #2f1d0f;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field-label {
  color: #5f3313;
  background: transparent;
  border: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea {
  min-height: 30px;
  padding: 4px 0;
  color: #241409;
  background: transparent;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer #composer-send {
  min-width: 86px;
  min-height: 44px;
  color: #fff3cc;
  background: #963f19;
  border: 2px solid #ffd987;
}

@media (max-width: 820px) {
  body[data-shell-page="hub"][data-shell-variant="public-square"] {
    overflow: hidden;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"]::before {
    background:
      url("assets/pixel/chinese-modern-city/backgrounds/hub_mobile_9x16.avif") center / cover no-repeat,
      #120d08;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .city-hub-shell {
    padding: 8px;
    gap: 8px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud {
    min-height: 44px;
    padding: 7px 9px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-layout {
    display: block;
    min-height: 0;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail {
    position: absolute;
    top: 58px;
    left: 8px;
    z-index: 7;
    width: 78px;
    max-height: calc(100vh - 156px);
    padding: 7px 5px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tab {
    min-height: 46px;
    font-size: 12px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tab span {
    font-size: 20px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-stage {
    min-height: calc(100vh - 68px);
    background:
      url("assets/pixel/chinese-modern-city/backgrounds/hub_mobile_9x16.avif") center / cover no-repeat,
      #21150c;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hero {
    inset: 8px 8px auto 78px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy {
    width: auto;
    max-width: none;
    padding: 8px 9px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy h1 {
    font-size: 22px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy p,
  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta,
  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview,
  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-strip {
    display: none;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-chat {
    left: 76px;
    right: 8px;
    bottom: 82px;
    width: auto;
    max-height: 36vh;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log {
    max-height: 36vh;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message {
    max-width: 100%;
    padding: 8px 9px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer {
    left: 8px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool {
    display: none;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field {
    min-height: 42px;
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field-label {
    display: none;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea {
    min-height: 34px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background:
    radial-gradient(
      circle at 20% -10%,
      rgba(79, 82, 197, 0.35) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 0%,
      rgba(126, 253, 199, 0.25) 0%,
      transparent 50%
    ),
    linear-gradient(180deg, #06030c 0%, #05030d 54%, #020109 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  background: linear-gradient(
    135deg,
    rgba(26, 30, 61, 0.92),
    rgba(20, 25, 48, 0.88)
  );
  border: 1px solid rgba(126, 253, 199, 0.18);
  box-shadow: var(--shadow-strong), var(--shadow-glow);
}

/* Unified topbar for user/admin/unified - consistent glass panel */
body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar,
body[data-shell-page="unified"] .topbar {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.08) 0,
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(18, 22, 38, 0.94) 0%,
      rgba(12, 15, 28, 0.92) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.14);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Hub page: light mode entrance */
body[data-shell-page="hub"] .topbar {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.15) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(248, 253, 250, 0.96) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.22);
  box-shadow:
    0 18px 36px rgba(126, 253, 199, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-shell-page="hub"] .eyebrow {
  color: rgba(126, 253, 199, 0.85);
}

body[data-shell-page="hub"] h1 {
  color: rgba(126, 253, 199, 0.98);
  font-weight: 700;
}

body[data-shell-page="user"] .eyebrow,
body[data-shell-page="admin"] .eyebrow,
body[data-shell-page="unified"] .eyebrow {
  color: rgba(126, 253, 199, 0.72);
}

body[data-shell-page="user"] h1,
body[data-shell-page="admin"] h1,
body[data-shell-page="unified"] h1 {
  color: var(--ink);
}

.workspace-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  position: sticky;
  top: 12px;
  z-index: 3;
  background: rgba(255, 252, 245, 0.9);
}

body[data-shell-page="user"] .workspace-switcher,
body[data-shell-page="admin"] .workspace-switcher {
  display: none;
}

body[data-shell-page="user"] .rooms .panel-title,
body[data-shell-page="admin"] .rooms .panel-title,
body[data-shell-page="user"] .conversation .panel-title,
body[data-shell-page="admin"] .conversation .panel-title {
  position: static;
  display: none;
}

.workspace-tab {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.9);
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  font-family: var(--font-mono);
  cursor: pointer;
}

body[data-shell-page="user"] .workspace-tab,
body[data-shell-page="admin"] .workspace-tab {
  padding: 6px 10px;
  font-size: 12px;
}

.workspace-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.masthead {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body[data-shell-page="user"] .masthead,
body[data-shell-page="admin"] .masthead {
  gap: 4px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.shell-mode-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.shell-mode-nav a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.85);
  color: var(--accent);
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
}

.shell-mode-nav a:hover {
  background: var(--accent-soft);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-note {
  margin: 0;
  color: rgba(126, 253, 199, 0.72);
  font-size: 15px;
  line-height: 1.7;
  max-width: 72ch;
}

.hero-callout {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(126, 253, 199, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(248, 253, 250, 0.94) 100%
  );
  box-shadow: var(--shadow-soft);
}

.hero-callout strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(126, 253, 199, 0.88);
  margin-bottom: 4px;
}

.hero-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(126, 253, 199, 0.72);
}

body[data-shell-page="user"] .hero-callout-user {
  display: block;
  border-color: rgba(126, 253, 199, 0.22);
  background: linear-gradient(
    180deg,
    rgba(236, 249, 244, 0.9) 0%,
    rgba(229, 250, 244, 0.88) 100%
  );
}

body[data-shell-page="user"] .hero-callout-admin {
  display: none;
}

body[data-shell-page="admin"] .hero-callout-admin {
  display: block;
  border-color: rgba(126, 253, 199, 0.22);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 247, 0.94) 0%,
    rgba(249, 253, 251, 0.92) 100%
  );
}

body[data-shell-page="admin"] .hero-callout-user {
  display: none;
}

body[data-shell-page="unified"] .hero-callout-unified {
  display: block;
  border-color: rgba(126, 253, 199, 0.2);
  background: linear-gradient(
    180deg,
    rgba(236, 251, 246, 0.96) 0%,
    rgba(248, 253, 250, 0.98) 100%
  );
}

body[data-shell-page="user"] .topbar {
  background:
    radial-gradient(
      circle at top left,
      rgba(220, 248, 240, 0.82) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(248, 253, 250, 0.92) 100%
    );
  border: 1px solid rgba(24, 105, 91, 0.1);
  box-shadow: 0 18px 36px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"] .hero-note {
  max-width: 58ch;
  color: rgba(126, 253, 199, 0.68);
}

/* Admin page: unified accent-based design */
body[data-shell-page="admin"] .topbar {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.08) 0,
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(18, 22, 38, 0.94) 0%,
      rgba(12, 15, 28, 0.92) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.14);
}

body[data-shell-page="user"] .conversation-overview {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.08) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(248, 253, 250, 0.96) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.16);
}

body[data-shell-page="user"] .thread-status-rail {
  display: none;
}

body[data-shell-page="user"] .composer {
  margin: 12px 14px 14px;
  padding: 14px 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 253, 199, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 253, 250, 0.96) 100%
  );
}

body[data-shell-page="user"] #entry-grid,
body[data-shell-page="admin"] #entry-grid {
  display: none;
}

/* Hub entry cards - unified accent-based design */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(126, 253, 199, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 253, 250, 0.96) 100%
  );
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 253, 199, 0.32);
  box-shadow: var(--shadow-strong), 0 0 32px rgba(126, 253, 199, 0.12);
}

.entry-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #edf7f2 0%, #dcf0e7 100%);
}

.entry-card.subtle {
  border-color: rgba(126, 253, 199, 0.12);
  background: linear-gradient(
    180deg,
    rgba(250, 253, 251, 0.96) 0%,
    rgba(244, 250, 247, 0.94) 100%
  );
}

body[data-shell-page="hub"] .entry-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(241, 249, 246, 0.94) 100%
  );
  border-color: rgba(126, 253, 199, 0.18);
  box-shadow:
    0 14px 30px rgba(126, 253, 199, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-shell-page="hub"] .entry-card.active {
  border-color: rgba(126, 253, 199, 0.36);
  background: linear-gradient(180deg, #eef9f4 0%, #dff2ea 100%);
}

.entry-card strong {
  font-size: 16px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 600;
}

body[data-shell-page="hub"] .entry-card strong {
  color: rgba(126, 253, 199, 0.95);
}

.entry-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

body[data-shell-page="hub"] .entry-card span {
  color: rgba(126, 253, 199, 0.72);
}

.entry-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

body[data-shell-page="hub"] .entry-badge {
  background: rgba(126, 253, 199, 0.12);
  color: rgba(126, 253, 199, 0.88);
  border: 1px solid rgba(126, 253, 199, 0.18);
}

.status-cluster {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
}

body[data-shell-page="user"] .status-cluster {
  display: none;
}

body[data-shell-page="admin"] .status-cluster {
  display: flex;
}

body[data-shell-page="hub"] .status-cluster {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(126, 253, 199, 0.12);
  justify-content: flex-start;
}

body[data-shell-page="unified"] .status-cluster {
  display: flex;
  flex-wrap: wrap;
}

/* Unified badge/pill system - consistent across all pages */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 253, 199, 0.18);
  background: rgba(126, 253, 199, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: background 160ms ease, border-color 160ms ease;
}

body[data-shell-page="hub"] .badge {
  background: rgba(126, 253, 199, 0.12);
  border-color: rgba(126, 253, 199, 0.24);
  color: rgba(126, 253, 199, 0.9);
}

body[data-shell-page="user"] .badge,
body[data-shell-page="admin"] .badge,
body[data-shell-page="unified"] .badge {
  padding: 5px 9px;
  font-size: 11px;
  background: rgba(126, 253, 199, 0.06);
  border-color: rgba(126, 253, 199, 0.14);
  color: rgba(126, 253, 199, 0.85);
}

/* Unified layout - glass panel system */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.06) 0,
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(248, 253, 250, 0.94) 100%
    );
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid rgba(126, 253, 199, 0.12);
  box-shadow: var(--shadow-strong);
}

/* User/Admin/Unified: unified glass shell */
body[data-shell-page="user"] .layout,
body[data-shell-page="admin"] .layout,
body[data-shell-page="unified"] .layout {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.08) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(244, 250, 247, 0.96) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.14);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

body[data-shell-page="hub"] .layout {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.12) 0,
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(126, 253, 199, 0.06) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(248, 253, 250, 0.96) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.16);
}

.layout-chat {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      260px,
      320px
    );
}

.layout-chat-inline-detail {
  grid-template-columns: 220px minmax(0, 1fr);
}

.layout-single {
  grid-template-columns: 1fr;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* Unified panel system - glass cards with accent glow */
.panel {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.04) 0,
      transparent 24%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(248, 253, 250, 0.92) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.panel-title {
  padding: 14px 16px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(126, 253, 199, 0.72);
  font-family: var(--font-mono);
  font-weight: 600;
}

.caretaker-panel {
  background: linear-gradient(180deg, #fffefa 0%, #f3f5ff 100%);
  border-color: rgba(69, 88, 126, 0.2);
}

.caretaker-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.caretaker-name {
  font-size: 16px;
  font-weight: 600;
}

.caretaker-status {
  font-size: 13px;
  color: #1f7757;
}

.caretaker-badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.1);
  color: var(--accent);
  border: 1px solid rgba(24, 105, 91, 0.2);
}

.caretaker-summary {
  margin: 0;
  font-size: 13px;
  color: #3b3b3b;
  line-height: 1.6;
}

.caretaker-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.caretaker-message {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(24, 105, 91, 0.1);
}

.caretaker-message-title {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.caretaker-message-time {
  font-size: 11px;
  color: rgba(29, 26, 23, 0.5);
}

.caretaker-messages p {
  margin: 0;
  font-size: 13px;
  color: #1d1a17;
}

.caretaker-rules {
  padding: 8px 0;
}

.caretaker-rules-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.caretaker-rules ul {
  padding-left: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(29, 26, 23, 0.75);
  font-size: 13px;
}

.caretaker-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 105, 91, 0.2);
  background: rgba(228, 242, 237, 0.9);
  color: #164b35;
  font-family: var(--font-ui);
}

.caretaker-status-line strong {
  font-weight: 600;
}

.caretaker-status-item {
  background: rgba(255, 255, 255, 0.65);
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(24, 105, 91, 0.1);
}

.guide-panel {
  padding-bottom: 14px;
  background: var(--panel-strong);
}

.panel.auth,
.panel.governance {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(217, 204, 183, 0.45);
}

body[data-workspace-focus="chat"] .panel.governance,
body[data-workspace-focus="chat"] .panel.auth {
  filter: saturate(0.6);
  opacity: 0.88;
}

.governance .governance-status,
.governance .governance-summary {
  color: rgba(29, 26, 23, 0.72);
}

.governance-block {
  padding: 0 16px 10px;
  border-top: 1px solid rgba(217, 204, 183, 0.4);
  margin-top: 6px;
  opacity: 0.92;
}

.governance-block:first-of-type {
  border-top: 0;
  margin-top: 4px;
}

.governance-block .section-label {
  color: rgba(29, 26, 23, 0.55);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.governance-block .city-list {
  padding: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Governance area — 4 primary sections */
.governance-area {
  padding: 0 16px 10px;
  border-top: 1px solid rgba(217, 204, 183, 0.4);
  margin-top: 6px;
}

.governance-area:first-of-type {
  border-top: 0;
  margin-top: 4px;
}

.governance-area-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(29, 26, 23, 0.82);
  padding: 8px 0;
  cursor: pointer;
}

.governance-area-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.governance-more {
  border-top: 2px dashed rgba(217, 204, 183, 0.6);
  margin-top: 14px;
  padding-top: 12px;
}

.governance-more summary {
  list-style: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(29, 26, 23, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.governance-more summary::-webkit-details-marker {
  display: none;
}

/* Resident login card — shared across user.html and creative.html */
.resident-login-card {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  width: min(420px, 40vw);
  padding: 12px 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(54, 38, 28, 0.98), rgba(24, 17, 18, 0.98));
  border: 2px solid rgba(231, 216, 176, 0.35);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.34);
}

.resident-login-card:not(.shell-hidden) {
  display: flex;
}

.resident-login-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(246, 239, 220, 0.62);
}

.resident-login-copy strong {
  color: #f1d59d;
  font-size: 13px;
}

.resident-login-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(211, 141, 76, 0.9);
}

.resident-login-form {
  display: grid;
  grid-template-columns: 0.9fr 1fr 0.78fr 0.82fr auto;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.resident-login-verify {
  grid-template-columns: 1fr 0.9fr auto;
}

.resident-login-form input,
.resident-login-form select,
.resident-login-hint {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(231, 216, 176, 0.32);
  border-radius: 6px;
  padding: 0 9px;
  background: rgba(20, 15, 18, 0.85);
  color: rgba(246, 239, 220, 0.94);
  font: inherit;
  font-size: 13px;
}

.resident-login-form select {
  color: #f1d59d;
}

.resident-login-hint {
  display: inline-flex;
  align-items: center;
  color: rgba(246, 239, 220, 0.72);
}

.resident-login-form button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #2a1709;
  background: linear-gradient(180deg, #f1d59d, #cb9758);
  border: 2px solid #4a2b1a;
  border-radius: 6px;
  cursor: pointer;
}

body.scene-clear-mode .resident-login-card {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.governance-more[open] summary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Action row with status label */
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid rgba(40, 25, 13, 0.7);
  background: linear-gradient(180deg, #f1d59d, #cb9758);
  color: #2a1709;
  transition: opacity 160ms ease;
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-btn.secondary {
  background: rgba(92, 43, 21, 0.75);
  color: #fff2c9;
  border-color: rgba(247, 210, 118, 0.45);
}

.action-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.action-status-available {
  background: rgba(24, 105, 91, 0.14);
  color: #14695b;
  border-color: rgba(24, 105, 91, 0.35);
}

.action-status-pending {
  background: rgba(161, 58, 54, 0.12);
  color: #a13a36;
  border-color: rgba(161, 58, 54, 0.3);
}

.action-status-readonly {
  background: rgba(111, 101, 87, 0.12);
  color: #4a4238;
  border-color: rgba(111, 101, 87, 0.3);
}

.action-status-gateway {
  background: rgba(59, 91, 142, 0.12);
  color: #3b5b8e;
  border-color: rgba(59, 91, 142, 0.3);
}

.action-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(29, 26, 23, 0.72);
  margin: 0;
}

.governance-details summary {
  font-size: 11px;
}

.governance-forms button {
  border-color: rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 14px;
}

.guide-item {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.governance {
  padding-bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
}

body[data-shell-page="user"] .governance {
  border: 1px solid rgba(24, 105, 91, 0.12);
  box-shadow: 0 12px 26px rgba(24, 105, 91, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

body[data-shell-page="user"] .governance .governance-details summary {
  font-weight: 600;
  color: rgba(24, 105, 91, 0.8);
}

body[data-shell-page="admin"] .governance {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(244, 239, 224, 0.95) 100%
  );
  border: 1px solid rgba(20, 93, 77, 0.35);
  box-shadow: 0 28px 44px rgba(12, 47, 39, 0.2);
}

body[data-shell-page="admin"] .governance .governance-details {
  border-radius: 16px;
  padding: 12px;
  border: 1px dashed rgba(24, 105, 91, 0.35);
  background: rgba(255, 255, 255, 0.92);
}

body[data-shell-page="admin"] .governance .governance-details summary {
  font-weight: 700;
  color: var(--accent);
}

.governance-summary,
.governance-status,
.meta {
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.meta-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.meta-chip-accent {
  background: rgba(24, 105, 91, 0.32);
}

.meta-chip-warm {
  background: rgba(255, 187, 137, 0.3);
  color: #fff3e5;
}

.meta-chip-danger {
  background: rgba(161, 58, 54, 0.35);
  color: #ffe6e1;
}

.panel-toolbar {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-toolbar {
  z-index: 2;
  padding-top: 12px;
  padding-bottom: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.98) 0%,
    rgba(255, 250, 241, 0.9) 100%
  );
  border-bottom: 1px solid rgba(217, 204, 183, 0.5);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.search-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

.segmented-control {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented-control .segment {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 7px 12px;
  font: inherit;
  font-family: var(--font-mono);
  cursor: pointer;
}

.segmented-control .segment.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.room-digest {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(217, 204, 183, 0.72);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(248, 242, 231, 0.96) 100%
  );
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-digest-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.room-digest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caretaker-note {
  border-radius: 14px;
  border: 1px solid rgba(217, 204, 183, 0.8);
  background: rgba(255, 255, 252, 0.92);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caretaker-note-alert {
  background: rgba(255, 244, 220, 0.86);
  border-color: rgba(205, 162, 77, 0.42);
}

.caretaker-note-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
}

.caretaker-note-copy {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.conversation-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
  align-items: center;
}

body[data-shell-page="user"] .conversation-tools {
  display: none;
}

body[data-shell-page="admin"] .conversation-tools {
  display: flex;
}

body[data-shell-page="admin"] .thread-status-rail {
  margin-top: 0;
}

body[data-shell-page="user"] .identity-row {
  display: none;
}

body[data-shell-page="admin"] .identity-row {
  display: grid;
}

body[data-shell-page="user"] .meta,
body[data-shell-page="admin"] .meta {
  margin-top: 0;
  border: 0;
  background: transparent;
  padding-top: 0;
  padding-bottom: 6px;
  color: rgba(111, 101, 87, 0.82);
}

body[data-shell-page="user"] .room-toolbar,
body[data-shell-page="admin"] .room-toolbar {
  padding-top: 8px;
  padding-bottom: 8px;
}

body[data-shell-page="user"] .room-toolbar .segmented-control,
body[data-shell-page="user"] .room-toolbar .toolbar-note {
  display: none;
}

body[data-shell-page="admin"] .room-toolbar .segmented-control {
  display: inline-flex;
}

body[data-shell-page="admin"] .room-toolbar .toolbar-note {
  display: block;
  font-size: 11px;
}

body[data-shell-page="user"] .room-digest,
body[data-shell-page="admin"] .room-digest {
  margin-top: 4px;
  padding: 10px 12px;
}

body[data-shell-page="user"] .room-section-header {
  display: none;
}

body[data-shell-page="admin"] .room-section-header {
  padding-top: 4px;
  padding-bottom: 2px;
}

body[data-shell-page="user"] .room-section-list,
body[data-shell-page="admin"] .room-section-list {
  gap: 6px;
}

body[data-shell-page="user"] .room-button,
body[data-shell-page="admin"] .room-button {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border-radius: 14px;
}

body[data-shell-page="user"] .room-button {
  border-color: rgba(24, 105, 91, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(248, 252, 250, 0.98) 100%
  );
}

body[data-shell-page="user"] .room-button.active {
  border-color: rgba(24, 105, 91, 0.24);
  background: linear-gradient(
    180deg,
    rgba(236, 249, 244, 1) 0%,
    rgba(226, 244, 238, 1) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(24, 105, 91, 0.06),
    0 12px 24px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"] .room-button.room-button-unread {
  border-color: rgba(24, 105, 91, 0.18);
  background: linear-gradient(
    180deg,
    rgba(250, 255, 252, 1) 0%,
    rgba(239, 250, 246, 1) 100%
  );
}

body[data-shell-page="user"] .room-avatar,
body[data-shell-page="admin"] .room-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 13px;
}

body[data-shell-page="user"] .room-kicker,
body[data-shell-page="admin"] .room-kicker,
body[data-shell-page="user"] .room-content > .room-sub:last-of-type,
body[data-shell-page="admin"] .room-content > .room-sub:last-of-type {
  display: none;
}

body[data-shell-page="user"] .room-preview,
body[data-shell-page="admin"] .room-preview {
  font-size: 12px;
  line-height: 1.45;
}

body[data-shell-page="user"] .room-sub,
body[data-shell-page="admin"] .room-sub {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(111, 101, 87, 0.92);
}

body[data-shell-page="user"] .room-status-line,
body[data-shell-page="admin"] .room-status-line {
  font-size: 11px;
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="admin"] .conversation-overview {
  margin-left: 16px;
  margin-right: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 252, 0.9);
  box-shadow: none;
}

body[data-shell-page="user"] .conversation-overview {
  border-color: rgba(126, 253, 199, 0.18);
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.08) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(250, 255, 253, 0.99) 0%,
      rgba(248, 253, 250, 0.98) 100%
    );
  box-shadow: 0 12px 28px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="user"] .conversation-overview .overview-title,
body[data-shell-page="user"] .conversation-overview .overview-summary {
  color: #173835;
}

body[data-shell-page="user"] .conversation-overview .pill-muted {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.86);
}

body[data-shell-page="user"] .conversation-overview .pill-accent {
  background: rgba(39, 182, 157, 0.12);
  color: #156557;
}

body[data-shell-page="user"] .conversation-overview .pill-warm {
  background: rgba(231, 166, 82, 0.12);
  color: #9a6722;
}

body[data-shell-page="admin"] .conversation-overview {
  border-color: rgba(255, 196, 110, 0.16);
  background: linear-gradient(
    180deg,
    rgba(27, 31, 36, 0.98) 0%,
    rgba(16, 19, 24, 0.98) 100%
  );
  box-shadow: 0 16px 34px rgba(11, 16, 22, 0.36);
  color: rgba(255, 245, 226, 0.96);
}

body[data-shell-page="admin"] .conversation-overview .overview-title,
body[data-shell-page="admin"] .conversation-overview .overview-summary {
  color: #fff4dc;
}

body[data-shell-page="admin"] .conversation-overview .pill-muted {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 244, 221, 0.82);
}

body[data-shell-page="admin"] .conversation-overview .pill-accent {
  background: rgba(255, 196, 110, 0.12);
  color: #ffd89e;
}

body[data-shell-page="admin"] .conversation-overview .pill-warm {
  background: rgba(255, 176, 116, 0.12);
  color: #ffd0a0;
}

body[data-shell-page="admin"] .conversation-overview .pill-danger {
  background: rgba(173, 77, 62, 0.18);
  color: #ffcfcb;
}

body[data-shell-page="user"] .overview-header,
body[data-shell-page="admin"] .overview-header {
  align-items: flex-start;
  flex-direction: column;
}

body[data-shell-page="user"] .overview-meta,
body[data-shell-page="admin"] .overview-meta {
  justify-content: flex-start;
}

body[data-shell-page="user"] .overview-summary,
body[data-shell-page="admin"] .overview-summary {
  line-height: 1.45;
}

body[data-shell-page="user"] .meta,
body[data-shell-page="admin"] .meta {
  margin: 0 16px 10px;
  padding: 9px 12px;
  border: 1px solid rgba(217, 204, 183, 0.68);
  border-radius: 14px;
  background: rgba(255, 255, 251, 0.92);
  color: rgba(101, 91, 78, 0.94);
}

body[data-shell-page="user"] .meta-title,
body[data-shell-page="admin"] .meta-title {
  color: var(--ink);
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline {
  padding: 12px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: none;
}

body[data-shell-page="user"] .timeline-divider {
  background: rgba(39, 182, 157, 0.12);
  color: rgba(24, 105, 91, 0.84);
}

body[data-shell-page="admin"] .timeline-divider {
  background: rgba(126, 80, 18, 0.12);
  color: rgba(126, 80, 18, 0.88);
}

body[data-shell-page="user"] .timeline {
  gap: 10px;
}

body[data-shell-page="admin"] .timeline {
  gap: 12px;
}

body[data-shell-page="user"] .message,
body[data-shell-page="admin"] .message {
  border-radius: 14px;
  box-shadow: none;
}

body[data-shell-page="user"] .message-body,
body[data-shell-page="admin"] .message-body {
  font-size: 13px;
  line-height: 1.7;
}

.message-reply-preview {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 6px 0;
  margin-bottom: 2px;
  border-left: 2px solid var(--accent-soft);
  padding-left: 8px;
  opacity: 0.85;
}

body[data-shell-page="user"] .message {
  border-color: rgba(24, 105, 91, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(246, 252, 249, 0.99) 100%
  );
}

body[data-shell-page="user"] .message-header {
  color: rgba(69, 84, 91, 0.74);
}

body[data-shell-page="user"] .message-sender {
  color: #173835;
}

body[data-shell-page="user"] .message-role {
  background: rgba(39, 182, 157, 0.1);
  color: rgba(23, 89, 79, 0.86);
}

body[data-shell-page="user"] .message-time {
  color: rgba(75, 93, 99, 0.58);
}

body[data-shell-page="user"] .message-body {
  color: #1d252b;
}

body[data-shell-page="user"] .message.self {
  border-color: rgba(24, 105, 91, 0.22);
  background: linear-gradient(
    180deg,
    rgba(223, 248, 240, 1) 0%,
    rgba(207, 239, 228, 1) 100%
  );
}

body[data-shell-page="user"] .message.self .message-header,
body[data-shell-page="user"] .message.self .message-sender,
body[data-shell-page="user"] .message.self .message-time,
body[data-shell-page="user"] .message.self .message-body {
  color: #173835;
}

body[data-shell-page="user"] .message.self .message-role {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(23, 89, 79, 0.86);
}

body[data-shell-page="user"] .message-pending {
  border-style: dashed;
  background: linear-gradient(
    180deg,
    rgba(234, 244, 255, 1) 0%,
    rgba(223, 237, 255, 1) 100%
  );
}

body[data-shell-page="user"] .message-pending-failed {
  border-color: rgba(161, 58, 54, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 240, 237, 1) 0%,
    rgba(253, 231, 228, 1) 100%
  );
}

body[data-shell-page="admin"] .message {
  border-color: rgba(120, 93, 36, 0.2);
  background: rgba(20, 24, 31, 0.92);
}

body[data-shell-page="admin"] .message-header {
  color: rgba(255, 219, 162, 0.72);
}

body[data-shell-page="admin"] .message-sender {
  color: #ffe6bb;
}

body[data-shell-page="admin"] .message-role {
  background: rgba(255, 196, 110, 0.12);
  color: rgba(255, 219, 162, 0.9);
}

body[data-shell-page="admin"] .message-time {
  color: rgba(255, 219, 162, 0.5);
}

body[data-shell-page="admin"] .message-body {
  color: rgba(255, 246, 228, 0.94);
}

body[data-shell-page="admin"] .message.self {
  border-color: rgba(176, 129, 53, 0.42);
  background: linear-gradient(
    180deg,
    rgba(182, 133, 57, 0.28) 0%,
    rgba(58, 41, 22, 0.98) 100%
  );
}

body[data-shell-page="admin"] .message.self .message-header,
body[data-shell-page="admin"] .message.self .message-sender,
body[data-shell-page="admin"] .message.self .message-time,
body[data-shell-page="admin"] .message.self .message-body {
  color: rgba(255, 248, 237, 0.96);
}

body[data-shell-page="admin"] .message.self .message-role {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 248, 237, 0.86);
}

body[data-shell-page="admin"] .message-pending {
  border-style: dashed;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 148, 0.12);
}

body[data-shell-page="admin"] .message-pending-failed {
  border-color: rgba(161, 58, 54, 0.34);
}

body[data-shell-page="user"] .composer-context {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-shell-page="user"] .composer-tip {
  border-color: rgba(24, 105, 91, 0.25);
  background: rgba(245, 253, 249, 0.96);
  color: rgba(24, 105, 91, 0.9);
}

body[data-shell-page="user"] .composer-meta,
body[data-shell-page="admin"] .composer-meta {
  grid-template-columns: 1fr;
}

body[data-shell-page="user"] .composer-meta-item,
body[data-shell-page="admin"] .composer-meta-item {
  border-color: rgba(217, 204, 183, 0.72);
  background: rgba(255, 255, 255, 0.78);
}

body[data-shell-page="user"] .composer-context-item {
  border-color: rgba(24, 105, 91, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

body[data-shell-page="admin"] .composer-context-item {
  border-color: rgba(255, 196, 110, 0.16);
  background: rgba(34, 27, 18, 0.42);
}

body[data-shell-page="admin"] .composer-tip {
  border-color: rgba(255, 196, 110, 0.26);
  background: rgba(255, 248, 232, 0.08);
  color: rgba(255, 232, 197, 0.84);
}

body[data-shell-page="admin"] .composer-meta-item {
  border-color: rgba(255, 196, 110, 0.14);
  background: rgba(38, 28, 16, 0.4);
}

body[data-shell-page="admin"] .composer-meta-label {
  color: rgba(255, 212, 146, 0.72);
}

body[data-shell-page="admin"] .composer-meta-value {
  color: rgba(255, 244, 221, 0.98);
}

body[data-shell-page="user"] .composer-meta-label,
body[data-shell-page="admin"] .composer-meta-label {
  color: rgba(111, 101, 87, 0.78);
}

body[data-shell-page="user"] .composer-meta-value,
body[data-shell-page="admin"] .composer-meta-value {
  color: var(--ink);
}

body[data-shell-page="user"] .conversation-tools {
  display: none;
}

body[data-shell-page="admin"] .conversation-tools {
  display: flex;
}

body[data-shell-page="unified"] .composer-row textarea {
  min-height: 68px;
}

body[data-shell-page="unified"] .composer-hints {
  display: flex;
}

body[data-shell-page="unified"] .composer-row textarea {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(24, 105, 91, 0.14);
}

body[data-shell-page="unified"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(42, 196, 166, 1) 0%,
    rgba(17, 105, 89, 1) 100%
  );
}

.conversation-tools select,
.conversation-tools button {
  font: inherit;
  font-family: var(--font-mono);
}

body[data-shell-page="user"] .conversation-tools select,
body[data-shell-page="admin"] .conversation-tools select,
body[data-shell-page="unified"] .conversation-tools select,
body[data-shell-page="user"] .conversation-tools button,
body[data-shell-page="admin"] .conversation-tools button,
body[data-shell-page="unified"] .conversation-tools button {
  font-family: var(--font-ui);
}

.conversation-tools select {
  min-width: 120px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  padding: 8px 10px;
}

.conversation-tools button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.96);
  color: var(--accent);
  padding: 8px 12px;
}

.thread-status-rail {
  display: none;
}

.thread-status-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-status-item-accent {
  border-color: rgba(71, 190, 165, 0.28);
}

.thread-status-item-warm {
  border-color: rgba(255, 184, 116, 0.26);
}

.thread-status-item-danger {
  border-color: rgba(230, 112, 104, 0.28);
}

.thread-status-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-mono);
}

.thread-status-value {
  font-size: 12px;
  line-height: 1.45;
  color: #fff;
}

.governance-status {
  color: var(--accent);
}

.governance-block {
  padding: 0 16px 12px;
}

.governance-summary {
  font-size: 12px;
  color: rgba(29, 26, 23, 0.72);
}

.governance-details summary {
  letter-spacing: 0.1em;
}

.governance-forms button,
.auth-forms button {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.governance-details,
.auth-details {
  border-top: 1px dashed rgba(217, 204, 183, 0.8);
  margin-top: 14px;
  padding-top: 12px;
}

.governance-details summary,
.auth-details summary {
  list-style: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.governance-details summary::-webkit-details-marker,
.auth-details summary::-webkit-details-marker {
  display: none;
}

.governance-details[open] summary,
.auth-details[open] summary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.governance-forms,
.auth-forms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.section-label {
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.city-list,
.room-list {
  list-style: none;
  margin: 0;
  padding: 0 10px 12px;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
}

.compact-list {
  max-height: 220px;
  overflow: auto;
}

.room-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-section-header {
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.room-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-family: var(--font-mono);
}

.room-section-hint {
  font-size: 12px;
  color: var(--muted);
}

.room-section-list {
  list-style: none;
  margin: 0;
  padding: 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.city-card,
.room-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.92);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  color: inherit;
  margin-bottom: 8px;
}

.city-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.micro-card {
  gap: 4px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf0 100%);
}

.room-button {
  cursor: pointer;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-align: left;
  box-shadow: none;
}

.room-button::before {
  content: none;
}

.room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.room-avatar-direct {
  background: linear-gradient(180deg, #1f796a 0%, #155646 100%);
}

.room-avatar-public {
  background: linear-gradient(180deg, #cb7d24 0%, #8f5615 100%);
}

.room-avatar-system {
  background: linear-gradient(180deg, #6b6a61 0%, #4d4a44 100%);
}

.room-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.city-name,
.room-name {
  font-size: 14px;
  font-weight: 600;
}

.city-slug,
.room-sub,
.city-sub,
.city-role,
.city-room-list {
  font-size: 12px;
  color: var(--muted);
}

.city-room-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-room-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fffefb;
  font-size: 12px;
  color: var(--muted);
}

.city-room-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.city-actions button,
.inline-form button,
.composer button {
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #f7fffb;
  padding: 10px 14px;
  font: inherit;
  font-family: var(--font-mono);
  cursor: pointer;
}

.city-actions button.secondary {
  background: transparent;
  color: var(--accent);
}

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

.provider-actions button.secondary {
  background: transparent;
  color: var(--accent);
}

.mini-button {
  padding: 6px 10px;
  font-size: 12px;
}

.room-button {
  cursor: pointer;
  gap: 0;
  margin-bottom: 0;
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.94);
  padding: 14px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.room-button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 105, 91, 0.24);
  box-shadow: 0 10px 24px rgba(33, 24, 13, 0.06);
}

.room-button.active {
  border-color: rgba(24, 105, 91, 0.38);
  background: linear-gradient(180deg, #edf8f4 0%, #e2f1eb 100%);
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.08);
}

.room-button.room-button-unread {
  border-color: rgba(138, 90, 18, 0.4);
  background: linear-gradient(180deg, #fffdf6 0%, #fff6df 100%);
}

.room-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.room-title-stack,
.room-top-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-top-meta {
  align-items: flex-end;
  text-align: right;
}

.room-kicker {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.room-activity {
  font-size: 11px;
  color: rgba(111, 101, 87, 0.92);
  font-family: var(--font-mono);
}

.room-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.room-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.room-tag-row .pill.is-clickable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.room-tag-row .pill.is-clickable:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
  box-shadow: 0 8px 16px rgba(76, 58, 31, 0.08);
}

.room-inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

.room-inline-progress {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(111, 101, 87, 0.12);
  background: rgba(255, 252, 247, 0.74);
  color: rgba(90, 74, 54, 0.84);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.room-inline-progress:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(76, 58, 31, 0.08);
}

.room-inline-progress-count {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: rgba(141, 95, 38, 0.78);
}

.room-inline-progress-label {
  font-size: 11px;
  line-height: 1.25;
  color: rgba(63, 54, 42, 0.88);
}

.room-inline-progress[data-action-intensity="strong"] {
  border-color: rgba(151, 89, 26, 0.18);
  background:
    linear-gradient(180deg, rgba(180, 116, 39, 0.12), rgba(145, 92, 27, 0.05)),
    rgba(255, 250, 244, 0.92);
  color: rgba(104, 61, 18, 0.92);
}

.room-inline-progress[data-action-intensity="steady"] {
  border-color: rgba(24, 105, 91, 0.16);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.1), rgba(24, 105, 91, 0.04)),
    rgba(255, 255, 255, 0.92);
  color: rgba(18, 74, 66, 0.92);
}

.room-inline-progress[data-action-intensity="soft"] {
  border-color: rgba(86, 92, 110, 0.14);
  background: rgba(246, 247, 250, 0.9);
  color: rgba(73, 80, 96, 0.88);
}

.room-inline-preview-hint {
  flex-basis: 100%;
  font-size: 10px;
  line-height: 1.35;
  color: rgba(96, 78, 55, 0.82);
  padding: 2px 4px 0;
}

.room-inline-preview-stage {
  letter-spacing: 0.04em;
}

.room-inline-preview-field {
  color: rgba(63, 54, 42, 0.9);
}

.room-inline-preview-stage.is-clickable,
.room-inline-preview-field.is-clickable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.room-inline-preview-stage.is-clickable:hover,
.room-inline-preview-field.is-clickable:hover {
  transform: translateY(-0.5px);
  filter: saturate(1.04);
}

.room-inline-preview-round {
  display: inline-flex;
  align-items: center;
  transform: translateY(-0.5px);
}

.room-inline-preview-round.is-clickable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.room-inline-preview-round.is-clickable:hover {
  transform: translateY(-1.5px);
  filter: saturate(1.05);
}

.room-inline-preview-card {
  display: grid;
  gap: 6px;
  flex-basis: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(111, 101, 87, 0.12);
  background: rgba(255, 252, 247, 0.78);
}

.room-inline-preview-card-stage {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(141, 95, 38, 0.8);
}

.room-inline-preview-card-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-inline-preview-card-meta-pill {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(111, 101, 87, 0.12);
  padding: 3px 8px;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: rgba(96, 78, 55, 0.78);
  background: rgba(255, 255, 255, 0.64);
}

.room-inline-preview-card-meta-pill[data-meta-kind="state"] {
  border-color: rgba(141, 95, 38, 0.14);
  color: rgba(141, 95, 38, 0.86);
  background: rgba(255, 250, 243, 0.8);
}

.room-inline-preview-card-meta-pill[data-meta-kind="history"][data-selected="true"],
.room-inline-preview-card-meta-pill[data-meta-kind="field-view"][data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.18);
  color: rgba(18, 74, 66, 0.92);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.1), rgba(24, 105, 91, 0.04)),
    rgba(255, 255, 255, 0.9);
}

.room-inline-preview-card-summary {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(63, 54, 42, 0.92);
}

.room-inline-preview-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
  padding-top: 1px;
  border-top: 1px solid rgba(111, 101, 87, 0.08);
}

.room-inline-preview-card-meta-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(111, 101, 87, 0.08);
  color: rgba(111, 101, 87, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.room-inline-preview-card-current-strip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.08);
  color: rgba(22, 78, 69, 0.92);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.room-inline-preview-card-meta-pill[data-current-meta-role="state"],
.room-inline-preview-card-meta-pill[data-current-meta-role="history"],
.room-inline-preview-card-meta-pill[data-current-meta-role="field-view"] {
  opacity: 0.78;
  transform: scale(0.98);
}

.room-inline-preview-card-meta-current,
.room-inline-preview-card-meta-options {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.room-inline-preview-card-meta-current {
  margin-right: 2px;
}

.room-inline-preview-card-meta-options[data-option-kind="history"] {
  padding-left: 2px;
}

.room-inline-preview-card-meta-options[data-option-kind="field-view"] {
  padding-left: 2px;
}

.room-inline-preview-card-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid rgba(111, 101, 87, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: rgba(96, 78, 55, 0.76);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.room-inline-preview-card-meta-pill:hover,
.room-inline-preview-card-meta-pill:focus-visible {
  transform: translateY(-1px);
}

.room-inline-preview-card-meta-pill:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(24, 105, 91, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.room-inline-preview-card-meta-pill[data-meta-kind="history"] {
  border-color: rgba(111, 101, 87, 0.12);
  color: rgba(96, 78, 55, 0.72);
}

.room-inline-preview-card-meta-pill[data-meta-kind="field-view"] {
  border-color: rgba(24, 105, 91, 0.12);
  color: rgba(22, 78, 69, 0.78);
  background: rgba(249, 253, 251, 0.72);
}

.room-inline-preview-card-meta-pill[data-meta-kind="state"] {
  border-color: rgba(141, 95, 38, 0.12);
  color: rgba(116, 69, 20, 0.8);
  background: rgba(255, 251, 246, 0.7);
}

.room-inline-preview-card-meta-pill[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.18);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.1), rgba(24, 105, 91, 0.04)),
    rgba(255, 255, 255, 0.88);
  color: rgba(18, 74, 66, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.room-inline-preview-card-meta-pill[data-selected="false"] {
  opacity: 0.9;
}

.room-inline-preview-card-meta-pill[data-preview-meta-option] {
  border-style: dashed;
}

.room-inline-preview-card-meta-pill[data-preview-meta-option][data-selected="true"] {
  border-style: solid;
}

.room-inline-preview-card-history {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-inline-preview-card[data-inline-history-controls-collapsed="true"] .room-inline-preview-card-history {
  display: none;
}

.room-inline-preview-card-history button {
  appearance: none;
  border: 1px solid rgba(111, 101, 87, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: rgba(96, 78, 55, 0.8);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.room-inline-preview-card-history button:hover {
  transform: translateY(-1px);
}

.room-inline-preview-card-history button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 0 4px rgba(24, 105, 91, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.room-inline-preview-card-history button[data-snapshot-role="latest"] {
  border-color: rgba(24, 105, 91, 0.14);
}

.room-inline-preview-card-history button[data-snapshot-role="history"] {
  border-color: rgba(111, 101, 87, 0.12);
}

.room-inline-preview-card-history button[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.22);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.12), rgba(24, 105, 91, 0.05)),
    rgba(255, 255, 255, 0.92);
  color: rgba(18, 74, 66, 0.94);
  box-shadow:
    0 7px 14px rgba(24, 105, 91, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.room-inline-preview-card-history button[data-selected="false"] {
  color: rgba(96, 78, 55, 0.74);
}

.room-inline-preview-card-view {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-inline-preview-card[data-inline-field-view-controls-collapsed="true"] .room-inline-preview-card-view {
  display: none;
}

.room-inline-preview-card-view button {
  appearance: none;
  border: 1px solid rgba(111, 101, 87, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: rgba(96, 78, 55, 0.82);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.room-inline-preview-card-view button:hover {
  transform: translateY(-1px);
}

.room-inline-preview-card-view button[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.18);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.14), rgba(24, 105, 91, 0.06)),
    rgba(255, 255, 255, 0.96);
  color: rgba(18, 74, 66, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 14px rgba(24, 105, 91, 0.08);
}

.room-inline-preview-card-view button[data-selected="false"] {
  color: rgba(96, 78, 55, 0.76);
}

.room-inline-preview-card-fields {
  display: grid;
  gap: 4px;
}

.room-inline-preview-card-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}

.room-inline-preview-card-row-label {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(141, 95, 38, 0.78);
}

.room-inline-preview-card-row-value {
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(63, 54, 42, 0.9);
}

.room-inline-preview-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.room-inline-preview-card-actions button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  min-height: 30px;
  white-space: nowrap;
  color: rgba(63, 54, 42, 0.88);
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(111, 101, 87, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.room-inline-preview-card-actions button[data-room-inline-preview-priority="primary"] {
  font-weight: 600;
  opacity: 1;
}

.room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"] {
  font-weight: 500;
  opacity: 0.94;
}

.room-inline-preview-card-actions button:hover {
  transform: translateY(-1px);
}

.room-inline-preview-card-actions button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 0 4px rgba(24, 105, 91, 0.2),
    inset 0 0 0 1px rgba(111, 101, 87, 0.1);
}

.room-inline-preview-card-actions button[data-room-inline-preview-priority="primary"] {
  border-color: rgba(24, 105, 91, 0.18);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.16), rgba(24, 105, 91, 0.08)),
    rgba(255, 255, 255, 0.96);
  color: rgba(18, 74, 66, 0.97);
  box-shadow:
    0 8px 16px rgba(24, 105, 91, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"] {
  border-color: rgba(111, 101, 87, 0.12);
  background: rgba(255, 252, 247, 0.76);
  color: rgba(96, 78, 55, 0.8);
}

.room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"]:hover {
  opacity: 1;
}

.room-inline-preview-card[data-action-intensity="strong"] {
  border-color: rgba(151, 89, 26, 0.16);
  background:
    linear-gradient(180deg, rgba(180, 116, 39, 0.12), rgba(145, 92, 27, 0.05)),
    rgba(255, 250, 244, 0.92);
}

.room-inline-preview-card[data-action-intensity="steady"] {
  border-color: rgba(24, 105, 91, 0.14);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.08), rgba(24, 105, 91, 0.03)),
    rgba(255, 255, 255, 0.94);
}

.room-inline-preview-card[data-action-intensity="soft"] {
  border-color: rgba(86, 92, 110, 0.14);
  background: rgba(246, 247, 250, 0.92);
}

.room-inline-preview-card[data-action-intensity="strong"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="primary"] {
  border-color: rgba(166, 96, 25, 0.2);
  background:
    linear-gradient(180deg, rgba(180, 116, 39, 0.18), rgba(145, 92, 27, 0.08)),
    rgba(255, 252, 247, 0.98);
  color: rgba(116, 69, 20, 0.98);
  box-shadow:
    0 10px 18px rgba(145, 92, 27, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.room-inline-preview-card[data-action-intensity="strong"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"] {
  border-color: rgba(151, 89, 26, 0.12);
  background: rgba(255, 250, 244, 0.9);
  color: rgba(116, 69, 20, 0.82);
}

.room-inline-preview-card[data-action-intensity="steady"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="primary"] {
  border-color: rgba(24, 105, 91, 0.2);
}

.room-inline-preview-card[data-action-intensity="steady"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"] {
  border-color: rgba(111, 101, 87, 0.14);
}

.room-inline-preview-card[data-action-intensity="soft"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="primary"] {
  border-color: rgba(86, 92, 110, 0.14);
  background:
    linear-gradient(180deg, rgba(109, 119, 145, 0.12), rgba(91, 100, 124, 0.05)),
    rgba(247, 248, 251, 0.96);
  color: rgba(67, 76, 95, 0.95);
  box-shadow:
    0 8px 14px rgba(86, 92, 110, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.room-inline-preview-card[data-action-intensity="soft"] .room-inline-preview-card-actions button[data-room-inline-preview-priority="secondary"] {
  border-color: rgba(86, 92, 110, 0.1);
  background: rgba(247, 248, 251, 0.78);
  color: rgba(67, 76, 95, 0.8);
}

.room-inline-preview-hint[data-action-intensity="strong"] {
  color: rgba(116, 69, 20, 0.88);
}

.room-inline-preview-hint[data-action-intensity="steady"] {
  color: rgba(18, 74, 66, 0.86);
}

.room-inline-preview-hint[data-action-intensity="soft"] {
  color: rgba(67, 76, 95, 0.84);
}

.room-inline-action {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.room-inline-action:hover {
  transform: translateY(-1px);
}

.room-inline-action-primary {
  border: 1px solid rgba(24, 105, 91, 0.2);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.12), rgba(24, 105, 91, 0.05)),
    rgba(255, 255, 255, 0.92);
  color: rgba(18, 74, 66, 0.95);
  box-shadow:
    0 8px 16px rgba(24, 105, 91, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.room-inline-action-secondary {
  border: 1px solid rgba(111, 101, 87, 0.16);
  background: rgba(255, 252, 247, 0.86);
  color: rgba(96, 78, 55, 0.84);
}

.room-inline-action-primary[data-action-intensity="strong"] {
  border-color: rgba(166, 96, 25, 0.2);
  background:
    linear-gradient(180deg, rgba(180, 116, 39, 0.16), rgba(145, 92, 27, 0.07)),
    rgba(255, 252, 247, 0.94);
  color: rgba(116, 69, 20, 0.96);
  box-shadow:
    0 10px 18px rgba(145, 92, 27, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.room-inline-action-primary[data-action-intensity="soft"] {
  border-color: rgba(86, 92, 110, 0.14);
  background:
    linear-gradient(180deg, rgba(109, 119, 145, 0.1), rgba(91, 100, 124, 0.04)),
    rgba(247, 248, 251, 0.94);
  color: rgba(67, 76, 95, 0.94);
  box-shadow:
    0 8px 14px rgba(86, 92, 110, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

@media (max-width: 640px) {
  .room-inline-preview-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .room-inline-preview-card-actions button {
    width: 100%;
    justify-content: center;
  }
}

.room-preview-shell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-preview-shell.is-interactive {
  cursor: pointer;
  border-radius: 12px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.room-preview-shell.is-interactive:hover {
  background: rgba(255, 251, 244, 0.82);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.08);
}

.room-preview-history {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.room-preview-history-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(111, 101, 87, 0.16);
  background: rgba(255, 252, 247, 0.88);
  color: rgba(99, 83, 63, 0.82);
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.room-preview-history-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 105, 91, 0.2);
  background: rgba(255, 255, 252, 0.94);
  color: rgba(63, 54, 42, 0.92);
}

.room-preview-history-chip[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.14), rgba(24, 105, 91, 0.06)),
    rgba(255, 255, 255, 0.92);
  color: rgba(18, 74, 66, 0.95);
  box-shadow:
    0 8px 14px rgba(24, 105, 91, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.room-preview-stage {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(141, 95, 38, 0.86);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-tag-row .pill-room-action[data-action-intensity="soft"] {
  opacity: 0.9;
}

.room-tag-row .pill-room-action[data-action-intensity="steady"] {
  border: 1px solid rgba(24, 105, 91, 0.16);
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.04);
}

.room-tag-row .pill-room-action[data-action-intensity="strong"] {
  border: 1px solid rgba(201, 144, 57, 0.18);
  box-shadow: 0 6px 14px rgba(201, 144, 57, 0.14);
  transform: translateY(-1px);
}

.conversation-overview .pill-room-action[data-action-intensity="soft"] {
  opacity: 0.92;
}

.conversation-overview .pill-room-action[data-action-intensity="steady"] {
  border: 1px solid rgba(24, 105, 91, 0.16);
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.05);
}

.conversation-overview .pill-room-action[data-action-intensity="strong"] {
  border: 1px solid rgba(201, 144, 57, 0.2);
  box-shadow: 0 7px 16px rgba(201, 144, 57, 0.16);
  transform: translateY(-1px);
}

.room-badges .pill {
  max-width: 100%;
}

.room-preview {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 500;
}

.room-status-line {
  font-size: 11px;
  color: rgba(111, 101, 87, 0.92);
  line-height: 1.45;
}

.inline-form {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-form input,
.inline-form select,
.inline-form textarea,
.identity-row input,
.composer input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  background: #fffefb;
  color: var(--ink);
}

.inline-form textarea {
  resize: vertical;
  min-height: 58px;
}

.inline-form select {
  appearance: none;
}

.rooms {
  min-height: 26vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border: 0;
  box-shadow: 0 20px 40px rgba(34, 24, 12, 0.05);
}

.mode-banner {
  margin: 0 16px 8px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid transparent;
}

.mode-banner[data-variant="user"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(24, 105, 91, 0.3);
}

.mode-banner[data-variant="admin"] {
  background: rgba(255, 255, 255, 0.95);
  color: rgba(24, 105, 91, 0.9);
  border-color: rgba(24, 105, 91, 0.45);
  box-shadow: 0 10px 24px rgba(24, 105, 91, 0.12);
}

.mode-banner[data-variant="unified"] {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-color: rgba(217, 204, 183, 0.6);
}

.room-actions {
  margin: 8px 16px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.room-actions.is-hidden {
  display: none;
}

.room-actions button {
  border-radius: 999px;
  border: 1px solid rgba(24, 105, 91, 0.3);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.room-actions button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* Conversation panel - unified design */
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 74vh;
  background: linear-gradient(
    180deg,
    rgba(18, 30, 34, 0.92) 0%,
    rgba(14, 18, 24, 0.95) 100%
  );
  border-radius: var(--radius-lg);
  padding: 8px 0;
  border: 1px solid rgba(126, 253, 199, 0.16);
}

/* User/Admin/Unified: light glass conversation */
body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="unified"] .conversation {
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.06) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(248, 253, 250, 0.94) 100%
    );
  border: 1px solid rgba(126, 253, 199, 0.18);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.chat-primary .conversation {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.chat-priority-badge {
  margin: 0 16px 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.12);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.chat-quick-links {
  margin: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-quick-links[data-mode="user"] button {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(24, 105, 91, 0.35);
  color: var(--accent);
}

.chat-quick-links[data-mode="admin"] button {
  background: rgba(14, 18, 24, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.chat-quick-links button {
  border: 1px solid rgba(24, 105, 91, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
}

.chat-focus-toggle {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(24, 105, 91, 0.18);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  cursor: pointer;
  margin-left: 8px;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.chat-focus-toggle:hover {
  background: rgba(24, 105, 91, 0.3);
}

.chat-focus-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.conversation-callout {
  margin: 0 16px 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 12, 18, 0.88);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-callout strong {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.conversation-callout p {
  margin: 0;
}

.conversation-callout-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.conversation-callout[data-variant="user"] {
  border-color: rgba(33, 196, 157, 0.45);
  background: linear-gradient(
    180deg,
    rgba(13, 30, 41, 0.92),
    rgba(8, 15, 24, 0.95)
  );
}

.conversation-callout[data-variant="admin"] {
  border-color: rgba(24, 105, 91, 0.45);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 36px rgba(24, 105, 91, 0.25);
}

.conversation-callout[data-variant="admin"] strong {
  color: var(--accent);
}

.conversation-callout[data-variant="admin"] .conversation-callout-note {
  color: rgba(29, 26, 23, 0.65);
}

.conversation-callout[data-variant="unified"] {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(24, 40, 52, 0.85);
}

.conversation-overview {
  margin: 0 16px 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.96) 0%,
    rgba(246, 240, 229, 0.94) 100%
  );
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(36, 26, 15, 0.04);
}

body[data-chat-detail-mode="inline"] .conversation-overview {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 16px;
}

.overview-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.overview-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-title {
  font-size: 17px;
  font-weight: 700;
}

.overview-context {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(216, 207, 188, 0.75);
  background: rgba(255, 252, 245, 0.92);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-context-title {
  font-size: 13px;
  font-weight: 600;
}

.overview-context-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.overview-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.overview-summary-preview {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 9px 11px;
  border: 1px solid rgba(24, 105, 91, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 244, 235, 0.88));
  color: var(--accent);
  font-weight: 600;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(24, 105, 91, 0.06);
}

.overview-summary-preview strong,
.overview-summary-preview b {
  color: rgba(23, 89, 79, 0.94);
  font-weight: 700;
}

.overview-summary-preview .summary-round,
.overview-summary-preview .summary-history,
.quick-action-preview-summary .summary-round,
.quick-action-preview-summary .summary-history,
.quick-action-preview-summary-line .summary-round,
.quick-action-preview-summary-line .summary-history {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.08);
  color: rgba(23, 89, 79, 0.82);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.overview-summary-preview .summary-history,
.quick-action-preview-summary .summary-history,
.quick-action-preview-summary-line .summary-history {
  background: rgba(201, 144, 57, 0.1);
  color: rgba(111, 73, 18, 0.88);
}

.quick-action-preview-summary,
.quick-action-preview-summary-line {
  display: grid;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(249, 244, 235, 0.88));
  color: rgba(53, 44, 33, 0.92);
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(24, 105, 91, 0.06);
}

.quick-action-preview-card {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(216, 207, 188, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(251, 246, 235, 0.92));
  box-shadow: 0 14px 32px rgba(84, 67, 34, 0.08);
}

.quick-action-preview-card[data-action-intensity="steady"] {
  border-color: rgba(24, 105, 91, 0.18);
  box-shadow: 0 14px 32px rgba(24, 105, 91, 0.09);
}

.quick-action-preview-card[data-action-intensity="strong"] {
  border-color: rgba(201, 144, 57, 0.22);
  box-shadow: 0 18px 36px rgba(201, 144, 57, 0.12);
}

.quick-action-preview-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-action-preview-card-heading {
  display: grid;
  gap: 4px;
}

.quick-action-preview-card-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(111, 101, 87, 0.84);
}

.quick-action-preview-card-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(53, 44, 33, 0.94);
}

.quick-action-preview-card-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-action-preview-card-pills-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(111, 101, 87, 0.08);
  color: rgba(111, 101, 87, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-action-preview-card-current-strip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.08);
  color: rgba(22, 78, 69, 0.94);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.quick-action-preview-card-pills .pill[data-current-meta-role="state"],
.quick-action-preview-card-pills .pill[data-current-meta-role="history"],
.quick-action-preview-card-pills .pill[data-current-meta-role="field-view"] {
  opacity: 0.78;
  transform: scale(0.98);
}

.quick-action-preview-card-pills-current,
.quick-action-preview-card-pills-options {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-action-preview-card-pills-current {
  margin-right: 2px;
}

.quick-action-preview-card-pills-options[data-option-kind="history"],
.quick-action-preview-card-pills-options[data-option-kind="field-view"] {
  padding-left: 2px;
}

.quick-action-preview-card-pills .pill.is-clickable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.quick-action-preview-card-pills .pill.is-clickable:hover,
.quick-action-preview-card-pills .pill.is-clickable:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 8px 16px rgba(76, 58, 31, 0.08);
}

.quick-action-preview-card-pills .pill[data-preview-meta-option] {
  border-style: dashed;
}

.quick-action-preview-card-pills .pill[data-preview-meta-option][data-selected="true"] {
  border-style: solid;
  border-color: rgba(24, 105, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.14), rgba(24, 105, 91, 0.08)),
    rgba(255, 255, 255, 0.96);
  color: rgba(22, 78, 69, 0.96);
}

.quick-action-preview-card-pills .pill[data-preview-meta-option][data-selected="false"] {
  opacity: 0.88;
}

.quick-action-preview-card-copy {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(102, 84, 66, 0.86);
}

.quick-action-preview-card-view {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-action-preview-card[data-preview-field-view-controls-collapsed="true"] .quick-action-preview-card-view {
  display: none;
}

.quick-action-preview-card-view button {
  appearance: none;
  border: 1px solid rgba(216, 207, 188, 0.82);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: rgba(96, 78, 55, 0.8);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.quick-action-preview-card-view button:hover {
  transform: translateY(-1px);
}

.quick-action-preview-card-view button[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.24);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.16), rgba(24, 105, 91, 0.08)),
    rgba(255, 255, 255, 0.94);
  color: rgba(18, 74, 66, 0.96);
  box-shadow:
    0 8px 16px rgba(24, 105, 91, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.quick-action-preview-card-view button[data-selected="false"] {
  color: rgba(96, 78, 55, 0.76);
}

.quick-action-preview-history {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(216, 207, 188, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(250, 245, 235, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.quick-action-preview-card[data-preview-history-controls-collapsed="true"] .quick-action-preview-history {
  display: none;
}

.quick-action-preview-history-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(111, 101, 87, 0.72);
}

.quick-action-preview-history-buttons {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  border-radius: 14px;
  border: 1px solid rgba(216, 207, 188, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(245, 239, 229, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 101, 87, 0.22) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.quick-action-preview-history-button {
  position: relative;
  flex: 0 0 auto;
  min-width: 78px;
  border: 1px solid rgba(216, 207, 188, 0.92);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(86, 68, 49, 0.88);
  padding: 8px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
  scroll-snap-align: start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.quick-action-preview-history-buttons::-webkit-scrollbar {
  height: 6px;
}

.quick-action-preview-history-buttons::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(111, 101, 87, 0.22);
}

.quick-action-preview-history-buttons > .quick-action-preview-history-button + .quick-action-preview-history-button {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.quick-action-preview-history-buttons > .quick-action-preview-history-button:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.quick-action-preview-history-buttons > .quick-action-preview-history-button:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.quick-action-preview-history-button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 105, 91, 0.22);
  filter: saturate(1.02);
  box-shadow: 0 6px 14px rgba(76, 58, 31, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.quick-action-preview-history-button:focus-visible {
  outline: 2px solid rgba(24, 105, 91, 0.28);
  outline-offset: 2px;
  z-index: 2;
}

.quick-action-preview-history-button[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.34);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.16), rgba(24, 105, 91, 0.08)),
    rgba(255, 255, 255, 0.9);
  color: rgba(18, 74, 66, 0.95);
  box-shadow:
    0 10px 18px rgba(24, 105, 91, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 3;
  transform: translateY(-1px);
}

.quick-action-preview-history-button[data-selected="true"]:hover {
  border-color: rgba(24, 105, 91, 0.38);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.19), rgba(24, 105, 91, 0.1)),
    rgba(255, 255, 255, 0.95);
  box-shadow:
    0 12px 20px rgba(24, 105, 91, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.quick-action-preview-card-sheet {
  gap: 8px;
}

.quick-action-preview-card-row {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.quick-action-preview-card-notes {
  background: rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  padding: 10px 12px;
}

.overview-preview-card {
  margin-top: -2px;
}

.chat-detail-preview-card {
  margin-top: 2px;
}

.overview-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.overview-actions button {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.92);
  color: var(--accent);
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

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

.workflow-progress {
  display: grid;
  gap: 8px;
}

.workflow-progress-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(111, 101, 87, 0.84);
}

.workflow-progress-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.workflow-progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(216, 207, 188, 0.85);
  background: rgba(255, 252, 245, 0.88);
  color: rgba(111, 101, 87, 0.88);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.workflow-progress-step[role="button"] {
  cursor: pointer;
}

.workflow-progress-step[role="button"]:focus-visible {
  outline: 2px solid rgba(24, 105, 91, 0.26);
  outline-offset: 2px;
}

.workflow-progress-marker {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(216, 207, 188, 0.9);
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.workflow-progress-label {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.workflow-progress-step[data-stage-state="current"] {
  border-color: rgba(24, 105, 91, 0.28);
  background: rgba(24, 105, 91, 0.08);
  color: #17594f;
  box-shadow: 0 10px 18px rgba(24, 105, 91, 0.12);
  transform: translateY(-1px);
}

.workflow-progress-step[data-stage-state="current"] .workflow-progress-marker {
  border-color: rgba(24, 105, 91, 0.36);
  background: rgba(24, 105, 91, 0.14);
  color: #17594f;
}

.workflow-progress-step[data-stage-state="done"] {
  border-color: rgba(166, 128, 70, 0.22);
  background: rgba(247, 239, 218, 0.92);
  color: rgba(88, 64, 36, 0.88);
}

.workflow-progress-step[data-stage-state="done"] .workflow-progress-marker {
  border-color: rgba(166, 128, 70, 0.26);
  background: rgba(255, 246, 224, 0.96);
  color: rgba(88, 64, 36, 0.84);
}

.workflow-progress-step[data-stage-state="upcoming"] {
  opacity: 0.84;
}

.overview-workflow-progress {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(216, 207, 188, 0.75);
  background: rgba(255, 252, 245, 0.88);
}

.conversation-toggle {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill-muted {
  background: #f5efe2;
  color: var(--muted);
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-warm {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.timeline {
  flex: 1;
  margin: 0 16px 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  border-radius: 18px;
  background: rgba(4, 8, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

body[data-shell-page="user"] .timeline {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(24, 105, 91, 0.25);
  color: var(--ink);
  box-shadow: 0 25px 50px rgba(24, 105, 91, 0.15);
}

body[data-shell-page="admin"] .timeline {
  background: rgba(4, 8, 16, 0.9);
  border-color: rgba(66, 78, 90, 0.4);
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.message-row.self {
  flex-direction: row-reverse;
}

.message-row[data-message-kind="system"] {
  justify-content: center;
  align-items: center;
}

.message-row[data-message-kind="system"] .message-stack {
  width: min(100%, 760px);
  justify-content: center;
}

.message-stack {
  min-width: 0;
  display: flex;
}

.message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: #fff;
  background: linear-gradient(180deg, #8f5f26 0%, #5e3c12 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.message-avatar-self {
  background: linear-gradient(180deg, #2ca894 0%, #165d4d 100%);
}

.message-avatar-direct {
  background: linear-gradient(180deg, #4f7df0 0%, #2746a8 100%);
}

.message-avatar-room {
  background: linear-gradient(180deg, #cb7d24 0%, #8f5615 100%);
}

.message-avatar-system {
  background: linear-gradient(180deg, #7a7a72 0%, #4d4a44 100%);
}

.message-avatar-caretaker {
  background: linear-gradient(180deg, #e49f35 0%, #8f5615 100%);
}

.message-row[data-message-kind="system"] .message-avatar {
  box-shadow: 0 10px 18px rgba(34, 24, 13, 0.12);
}

.message-row[data-message-kind="caretaker"] .message-avatar {
  box-shadow: 0 10px 18px rgba(138, 90, 18, 0.18);
}

.message {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  max-width: min(74%, 720px);
  width: fit-content;
  box-shadow: 0 6px 14px rgba(34, 24, 13, 0.03);
}

body[data-shell-page="user"] .message {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  border-color: rgba(217, 204, 183, 0.45);
  box-shadow: 0 12px 28px rgba(24, 105, 91, 0.1);
}

body[data-shell-page="admin"] .message {
  background: rgba(17, 24, 33, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.message.self {
  border-color: rgba(108, 191, 194, 0.6);
  background: linear-gradient(
    180deg,
    rgba(108, 191, 194, 0.2) 0%,
    rgba(24, 46, 54, 0.9) 100%
  );
}

.message[data-message-kind="system"] {
  max-width: min(66%, 580px);
  border-style: dashed;
}

.message[data-message-kind="caretaker"] {
  border-color: rgba(201, 144, 57, 0.28);
}

.message[data-message-kind="direct"] {
  border-color: rgba(108, 191, 194, 0.18);
}

.message[data-message-kind="room"] {
  border-color: rgba(120, 93, 36, 0.14);
}

.message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.message[data-message-kind="system"] .message-header {
  justify-content: center;
}

.message[data-message-kind="system"] .message-meta,
.message[data-message-kind="system"] .message-body {
  justify-content: center;
  text-align: center;
}

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

.message-sender {
  color: #fff;
}

.message-role {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}

.message-edited {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.48);
  letter-spacing: 0.06em;
  font-size: 10px;
}

.message-role-self {
  background: rgba(255, 255, 255, 0.16);
}

body[data-shell-page="user"] .message-role-self {
  background: rgba(24, 105, 91, 0.12);
  color: rgba(23, 89, 79, 0.88);
}

body[data-shell-page="admin"] .message-role-self {
  background: rgba(201, 144, 57, 0.18);
  color: rgba(255, 226, 181, 0.9);
}

.message-quick-action {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(201, 144, 57, 0.22);
  background: rgba(201, 144, 57, 0.12);
  color: rgba(255, 235, 205, 0.9);
  letter-spacing: 0.06em;
  font-size: 10px;
}

.message-quick-action[data-action-intensity="soft"] {
  opacity: 0.88;
}

.message-quick-action[data-action-intensity="steady"] {
  border-width: 1px;
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.04);
}

.message-quick-action[data-action-intensity="strong"] {
  border-width: 1px;
  box-shadow: 0 6px 16px rgba(201, 144, 57, 0.14);
  transform: translateY(-1px);
}

.message-quick-state {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(201, 144, 57, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 235, 205, 0.78);
  letter-spacing: 0.04em;
  font-size: 10px;
}

.message-quick-state[data-action-intensity="soft"] {
  opacity: 0.88;
}

.message-quick-state[data-action-intensity="steady"] {
  border-color: rgba(24, 105, 91, 0.18);
}

.message-quick-state[data-action-intensity="strong"] {
  border-color: rgba(201, 144, 57, 0.24);
  box-shadow: inset 0 0 0 1px rgba(201, 144, 57, 0.06);
}

body[data-shell-page="user"] .message-quick-action {
  border-color: rgba(24, 105, 91, 0.18);
  background: rgba(24, 105, 91, 0.08);
  color: rgba(23, 89, 79, 0.86);
}

body[data-shell-page="user"] .message-quick-state {
  border-color: rgba(24, 105, 91, 0.18);
  background: rgba(24, 105, 91, 0.05);
  color: rgba(23, 89, 79, 0.72);
}

.message-time {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.56);
}

.message-body {
  font-size: 14px;
  line-height: 1.72;
  color: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-body-recalled {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.message-action {
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font: 700 12px/1 var(--font-ui);
  cursor: pointer;
}

.message-action:hover,
.message-action:focus-visible {
  color: #fff;
  border-color: rgba(201, 144, 57, 0.48);
  background: rgba(201, 144, 57, 0.18);
}

.message-action-danger:hover,
.message-action-danger:focus-visible {
  border-color: rgba(214, 88, 88, 0.52);
  background: rgba(214, 88, 88, 0.16);
}

.message-body-structured {
  white-space: normal;
}

.message-body-structured[data-action-intensity="steady"] .message-quick-sheet-row {
  border: 1px solid rgba(24, 105, 91, 0.12);
  box-shadow: inset 0 0 0 1px rgba(24, 105, 91, 0.04);
}

.message-body-structured[data-action-intensity="strong"] .message-quick-sheet-row {
  border: 1px solid rgba(201, 144, 57, 0.16);
  background: rgba(201, 144, 57, 0.08);
  box-shadow: 0 8px 18px rgba(201, 144, 57, 0.12);
}

.message-quick-sheet {
  display: grid;
  gap: 8px;
}

.message-quick-sheet-row {
  display: grid;
  grid-template-columns: minmax(72px, 112px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.message-quick-sheet-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.message-quick-sheet-value {
  color: #fff;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-quick-sheet-notes {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.message-quick-sheet-follow-up {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.message-quick-sheet-follow-up-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.message-quick-sheet-follow-up-copy {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

body[data-shell-page="user"] .message-quick-sheet-row {
  background: rgba(24, 105, 91, 0.06);
}

body[data-shell-page="user"] .message-quick-sheet-label {
  color: rgba(23, 89, 79, 0.72);
}

body[data-shell-page="user"] .message-quick-sheet-value,
body[data-shell-page="user"] .message-quick-sheet-notes {
  color: var(--ink);
}

body[data-shell-page="user"] .message-quick-sheet-follow-up {
  background: rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"] .message-quick-sheet-follow-up-label {
  color: rgba(23, 89, 79, 0.62);
}

body[data-shell-page="user"] .message-quick-sheet-follow-up-copy {
  color: var(--ink);
}

body[data-shell-page="user"] .quick-action-preview-card {
  border-color: rgba(24, 105, 91, 0.18);
  background:
    linear-gradient(180deg, rgba(248, 253, 251, 0.98), rgba(239, 248, 245, 0.94));
  box-shadow: 0 14px 32px rgba(24, 105, 91, 0.09);
}

body[data-shell-page="user"] .quick-action-preview-card[data-action-intensity="strong"] {
  border-color: rgba(201, 144, 57, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 249, 240, 0.98), rgba(252, 244, 229, 0.95));
  box-shadow: 0 18px 36px rgba(201, 144, 57, 0.12);
}

body[data-shell-page="user"] .quick-action-preview-card-kicker {
  color: rgba(23, 89, 79, 0.72);
}

body[data-shell-page="user"] .quick-action-preview-card-title {
  color: rgba(23, 89, 79, 0.9);
}

body[data-shell-page="user"] .quick-action-preview-card-copy {
  color: rgba(23, 89, 79, 0.78);
}

body[data-shell-page="user"] .overview-summary-preview,
body[data-shell-page="user"] .quick-action-preview-summary,
body[data-shell-page="user"] .quick-action-preview-summary-line {
  border-color: rgba(24, 105, 91, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 252, 249, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"] .overview-summary-preview strong,
body[data-shell-page="user"] .overview-summary-preview b,
body[data-shell-page="user"] .quick-action-preview-summary strong,
body[data-shell-page="user"] .quick-action-preview-summary b,
body[data-shell-page="user"] .quick-action-preview-summary-line strong,
body[data-shell-page="user"] .quick-action-preview-summary-line b {
  color: rgba(23, 89, 79, 0.96);
}

body[data-shell-page="user"] .overview-summary-preview .summary-round,
body[data-shell-page="user"] .quick-action-preview-summary .summary-round,
body[data-shell-page="user"] .quick-action-preview-summary-line .summary-round {
  background: rgba(24, 105, 91, 0.1);
  color: rgba(23, 89, 79, 0.86);
}

body[data-shell-page="user"] .overview-summary-preview .summary-history,
body[data-shell-page="user"] .quick-action-preview-summary .summary-history,
body[data-shell-page="user"] .quick-action-preview-summary-line .summary-history {
  background: rgba(201, 144, 57, 0.12);
  color: rgba(111, 73, 18, 0.9);
}

body[data-shell-page="user"][data-room-variant="city"] .overview-summary-preview,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary-line {
  border-color: rgba(36, 83, 118, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 248, 253, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(18, 43, 69, 0.08);
}

body[data-shell-page="user"][data-room-variant="city"] .overview-summary-preview .summary-round,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary .summary-round,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary-line .summary-round {
  background: rgba(36, 83, 118, 0.1);
  color: rgba(24, 58, 86, 0.86);
}

body[data-shell-page="user"][data-room-variant="city"] .overview-summary-preview .summary-history,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary .summary-history,
body[data-shell-page="user"][data-room-variant="city"] .quick-action-preview-summary-line .summary-history {
  background: rgba(44, 113, 160, 0.1);
  color: rgba(24, 58, 86, 0.88);
}

body[data-shell-page="user"] .quick-action-preview-history-label {
  color: rgba(23, 89, 79, 0.72);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-shell-page="user"] .quick-action-preview-history-button {
  border-color: rgba(24, 105, 91, 0.18);
  color: rgba(23, 89, 79, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 252, 250, 0.88));
}

body[data-shell-page="user"] .quick-action-preview-history-button[data-selected="true"] {
  border-color: rgba(24, 105, 91, 0.42);
  background:
    linear-gradient(180deg, rgba(29, 126, 111, 0.18), rgba(24, 105, 91, 0.12)),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 12px 20px rgba(24, 105, 91, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-shell-page="user"] .quick-action-preview-card-row {
  background: rgba(255, 255, 255, 0.76);
}

body[data-shell-page="user"] .quick-action-preview-card-notes {
  background: rgba(255, 255, 255, 0.68);
}

.timeline-empty {
  margin: 0;
}

.timeline-divider {
  align-self: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Composer input - unified glass design */
.composer {
  margin: 12px 16px 16px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(126, 253, 199, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at top left,
      rgba(126, 253, 199, 0.04) 0,
      transparent 24%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(248, 253, 250, 0.94) 100%
    );
  box-shadow: var(--shadow-soft);
  position: sticky;
  bottom: 0;
  z-index: 4;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.composer[data-shell-mode="user"] {
  border-color: rgba(126, 253, 199, 0.18);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 36px rgba(24, 105, 91, 0.15);
}

.composer[data-shell-mode="admin"] {
  border-color: rgba(24, 105, 91, 0.4);
  background: rgba(11, 14, 19, 0.98);
  box-shadow: 0 14px 32px rgba(10, 20, 26, 0.5);
}

.composer[data-draft-state="ready"] {
  box-shadow:
    0 18px 38px rgba(24, 105, 91, 0.16),
    0 0 0 1px rgba(24, 105, 91, 0.12);
}

.composer[data-draft-state="sending"] {
  opacity: 0.97;
}

.composer[data-draft-state="blocked"] {
  border-style: dashed;
}

body[data-shell-page="user"] .composer {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(24, 105, 91, 0.25);
  color: var(--ink);
}

body[data-shell-page="admin"] .composer {
  background: rgba(14, 20, 28, 0.92);
  border-color: rgba(24, 105, 91, 0.4);
  color: #fff;
}

body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  margin: 12px 12px 14px;
  padding: 12px 14px 14px;
  border-radius: 24px;
  box-shadow: 0 16px 34px rgba(35, 23, 11, 0.1);
}

body[data-shell-page="admin"] .composer {
  background: linear-gradient(
    180deg,
    rgba(255, 254, 249, 0.98) 0%,
    rgba(249, 242, 228, 0.97) 100%
  );
  border-color: rgba(201, 144, 57, 0.2);
  color: var(--ink);
}

body[data-shell-page="unified"] .composer {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(244, 251, 247, 0.97) 100%
  );
  border-color: rgba(24, 105, 91, 0.18);
  color: var(--ink);
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer {
  padding-top: 10px;
}

.composer-hero {
  margin: 0 16px 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-hero-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.58);
}

.composer-hero-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.composer-hero-note {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.composer-hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-shell-page="user"] .composer-hero {
  border-color: rgba(24, 105, 91, 0.14);
  background: linear-gradient(
    180deg,
    rgba(241, 252, 247, 0.98) 0%,
    rgba(251, 255, 253, 0.98) 100%
  );
}

body[data-shell-page="user"] .composer-hero-kicker,
body[data-shell-page="unified"] .composer-hero-kicker {
  color: rgba(24, 105, 91, 0.58);
}

body[data-shell-page="user"] .composer-hero-title,
body[data-shell-page="unified"] .composer-hero-title {
  color: var(--ink);
}

body[data-shell-page="user"] .composer-hero-note,
body[data-shell-page="unified"] .composer-hero-note {
  color: rgba(50, 68, 65, 0.78);
}

body[data-shell-page="admin"] .composer-hero {
  border-color: rgba(201, 144, 57, 0.24);
  background: linear-gradient(
    180deg,
    rgba(36, 27, 16, 0.92) 0%,
    rgba(17, 20, 26, 0.96) 100%
  );
}

body[data-shell-page="admin"] .composer-hero,
body[data-shell-page="unified"] .composer-hero {
  border-color: rgba(201, 144, 57, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.98) 0%,
    rgba(248, 241, 228, 0.98) 100%
  );
}

body[data-shell-page="admin"] .composer-hero-kicker {
  color: rgba(255, 209, 148, 0.68);
}

body[data-shell-page="admin"] .composer-hero-kicker,
body[data-shell-page="unified"] .composer-hero-kicker {
  color: rgba(120, 93, 36, 0.64);
}

body[data-shell-page="admin"] .composer-hero-title {
  color: #fff5dc;
}

body[data-shell-page="admin"] .composer-hero-title,
body[data-shell-page="unified"] .composer-hero-title {
  color: #1f1a16;
}

body[data-shell-page="admin"] .composer-hero-note {
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="admin"] .composer-hero-note,
body[data-shell-page="unified"] .composer-hero-note {
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="admin"] .composer-context-item,
body[data-shell-page="unified"] .composer-context-item {
  border-color: rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.88);
}

body[data-shell-page="admin"] .composer-meta-item,
body[data-shell-page="unified"] .composer-meta-item {
  border-color: rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.82);
}

body[data-shell-page="admin"] .composer-tip,
body[data-shell-page="unified"] .composer-tip {
  border-color: rgba(201, 144, 57, 0.16);
  background: rgba(255, 248, 232, 0.92);
  color: rgba(102, 78, 39, 0.9);
}

.chat-detail {
  min-height: 74vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 232, 210, 0.56) 0,
      transparent 28%
    ),
    linear-gradient(180deg, #fffdf9 0%, #f7efdf 100%);
}

body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail {
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 232, 210, 0.34) 0,
      transparent 22%
    ),
    linear-gradient(180deg, #fffdf9 0%, #faf3e6 100%);
}

body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  border: 1px solid rgba(217, 204, 183, 0.38);
  border-right: 4px solid rgba(201, 144, 57, 0.18);
  box-shadow: 0 14px 28px rgba(37, 26, 14, 0.06);
}

body[data-shell-page="admin"] .chat-detail {
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 232, 210, 0.22) 0,
      transparent 24%
    ),
    linear-gradient(180deg, #fffefb 0%, #faf4e8 100%);
}

body[data-shell-page="unified"] .chat-detail {
  background:
    radial-gradient(
      circle at top left,
      rgba(220, 247, 240, 0.22) 0,
      transparent 24%
    ),
    linear-gradient(180deg, #fffefb 0%, #f6f9f7 100%);
}

.chat-detail-content {
  flex: 1;
  overflow: auto;
  padding: 0 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-detail-hero,
.chat-detail-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.96);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 22px rgba(37, 26, 14, 0.05);
}

.chat-detail-hero {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(245, 237, 221, 0.98) 100%
  );
}

body[data-shell-page="admin"] .chat-detail-hero,
body[data-shell-page="admin"] .chat-detail-section,
body[data-shell-page="unified"] .chat-detail-hero,
body[data-shell-page="unified"] .chat-detail-section {
  background: rgba(255, 255, 252, 0.92);
  border-color: rgba(217, 204, 183, 0.58);
}

body[data-shell-page="admin"] .chat-detail-hero,
body[data-shell-page="unified"] .chat-detail-hero {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(247, 241, 229, 0.98) 100%
  );
}

body[data-shell-page="admin"] .chat-detail-title,
body[data-shell-page="unified"] .chat-detail-title {
  color: #1f1a16;
}

body[data-shell-page="admin"] .chat-detail-copy,
body[data-shell-page="unified"] .chat-detail-copy {
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="admin"] .chat-detail-section-title,
body[data-shell-page="unified"] .chat-detail-section-title {
  color: rgba(111, 101, 87, 0.86);
}

.chat-detail-title {
  font-size: 16px;
  font-weight: 700;
}

.chat-detail-copy {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.chat-detail-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-detail-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-family: var(--font-mono);
}

.chat-detail-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px dashed rgba(217, 204, 183, 0.8);
}

.chat-detail-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.chat-detail-label {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.chat-detail-value {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.chat-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-detail-link {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.9);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.chat-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-detail-actions button,
.chat-detail-link {
  font-family: var(--font-mono);
}

.composer.is-sending {
  background: linear-gradient(
    180deg,
    rgba(250, 247, 239, 0.45) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.composer-status {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.composer-status-muted {
  background: #fbf8f0;
  color: var(--muted);
}

.composer-status-accent {
  background: var(--accent-soft);
  border-color: rgba(22, 93, 77, 0.2);
  color: var(--accent);
}

.composer-status-warning {
  background: var(--warning-soft);
  border-color: rgba(138, 90, 18, 0.2);
  color: var(--warning);
}

.composer-status-danger {
  background: var(--danger-soft);
  border-color: rgba(155, 39, 37, 0.18);
  color: var(--danger);
}

.composer-tip {
  margin: 0 16px 8px;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.4;
}

.composer-context {
  margin: 0 16px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 960px) {
  .composer-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.composer-context-item {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-context-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
  font-family: var(--font-mono);
}

.composer-context-value {
  font-size: 12px;
  line-height: 1.45;
  color: #fff;
}

.composer-context-value-accent {
  color: #c7fff4;
}

.composer-context-value-warm {
  color: #ffd194;
}

.composer-context-value-danger {
  color: #ffb8b6;
}

.composer-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.composer-meta-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-meta-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-mono);
}

.composer-meta-value {
  font-size: 12px;
  line-height: 1.45;
  color: #fff;
}

.identity-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

body[data-shell-page="user"] .identity-row,
body[data-shell-page="admin"] .identity-row {
  display: none;
}

.identity-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-mono);
}

.composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.composer-row textarea {
  min-height: 76px;
  resize: none;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(24, 105, 91, 0.32);
  color: var(--ink);
  box-shadow: inset 0 4px 14px rgba(24, 105, 91, 0.15);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.composer-row textarea:focus {
  outline: 2px solid rgba(24, 105, 91, 0.6);
  outline-offset: 2px;
}

.composer-row button {
  min-width: 104px;
  align-self: stretch;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0 18px;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(24, 105, 91, 0.3);
  transition: transform 120ms ease;
}

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

.composer-hints {
  margin-top: 10px;
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: none;
}

.composer-hints span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 183, 0.45);
}

body[data-shell-page="user"] .composer-hints-user {
  display: flex;
}

body[data-shell-page="admin"] .composer-hints-admin {
  display: flex;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(42, 196, 166, 1) 0%,
    rgba(17, 105, 89, 1) 100%
  );
}

body[data-shell-page="admin"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(201, 144, 57, 1) 0%,
    rgba(88, 52, 15, 1) 100%
  );
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 84px;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 1);
  border-color: rgba(24, 105, 91, 0.18);
  box-shadow:
    inset 0 2px 8px rgba(24, 105, 91, 0.08),
    0 8px 18px rgba(24, 105, 91, 0.04);
}

body[data-shell-page="user"] .composer-row button {
  min-width: 112px;
  border-radius: 16px;
}

body[data-shell-page="admin"] .composer-row {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 12px;
}

body[data-shell-page="admin"] .composer-row textarea {
  min-height: 98px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(201, 144, 57, 0.18);
  color: var(--ink);
  box-shadow:
    inset 0 4px 14px rgba(201, 144, 57, 0.08),
    0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="admin"] .composer-row textarea::placeholder {
  color: rgba(111, 101, 87, 0.52);
}

body[data-shell-page="admin"] .composer-row textarea:focus {
  outline-color: rgba(201, 144, 57, 0.42);
}

.composer[data-draft-state="ready"] .composer-row textarea {
  border-color: rgba(24, 105, 91, 0.46);
}

body[data-shell-page="user"]
  .composer[data-draft-state="ready"]
  .composer-row
  textarea {
  box-shadow:
    inset 0 2px 8px rgba(24, 105, 91, 0.08),
    0 0 0 1px rgba(24, 105, 91, 0.08),
    0 10px 22px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="admin"]
  .composer[data-draft-state="ready"]
  .composer-row
  textarea {
  border-color: rgba(201, 144, 57, 0.34);
}

body[data-shell-page="admin"] .composer-row button {
  min-width: 118px;
  border-radius: 16px;
  letter-spacing: 0.1em;
}

body[data-shell-page="admin"] .composer-status {
  border-color: rgba(120, 93, 36, 0.22);
}

.composer-row button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.composer[data-draft-state="blocked"] .composer-row textarea:disabled {
  background: rgba(251, 248, 241, 0.92);
  border-color: rgba(217, 204, 183, 0.72);
  color: rgba(111, 101, 87, 0.92);
  box-shadow: none;
}

body[data-shell-page="user"] .composer[data-draft-state="blocked"] .composer-row textarea:disabled {
  background: rgba(247, 252, 249, 0.96);
  border-color: rgba(24, 105, 91, 0.18);
  color: rgba(67, 82, 79, 0.9);
}

body[data-shell-page="admin"] .composer[data-draft-state="blocked"] .composer-row textarea:disabled {
  background: rgba(21, 24, 30, 0.86);
  border-color: rgba(201, 144, 57, 0.24);
  color: rgba(242, 232, 214, 0.82);
}

.composer[data-draft-state="blocked"] .composer-row button:disabled {
  opacity: 0.6;
  background: rgba(217, 204, 183, 0.22);
  color: rgba(111, 101, 87, 0.82);
}

.composer[data-draft-state="ready"] .composer-row button:not(:disabled) {
  box-shadow: 0 14px 28px rgba(24, 105, 91, 0.22);
}

body[data-shell-page="user"] .composer-row textarea::placeholder,
body[data-shell-page="admin"] .composer-row textarea::placeholder,
body[data-shell-page="unified"] .composer-row textarea::placeholder {
  opacity: 1;
}

body[data-shell-page="admin"] .composer-tip {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
}

.composer-row input,
.identity-row input {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.98);
  color: var(--ink);
  padding: 11px 13px;
  font: inherit;
}

.composer-row input::placeholder,
.identity-row input::placeholder,
.search-input::placeholder {
  color: #988f81;
}

.composer-hints {
  line-height: 1.45;
}

.composer-hints span {
  background: rgba(255, 255, 255, 0.06);
}

body[data-shell-page="user"] .composer-hints span {
  background: rgba(24, 105, 91, 0.06);
  border-color: rgba(24, 105, 91, 0.16);
}

body[data-shell-page="admin"] .composer-hints span {
  background: rgba(201, 144, 57, 0.08);
  border-color: rgba(201, 144, 57, 0.16);
}

button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body[data-workspace="chat"] .layout {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      252px,
      308px
    );
}

body[data-workspace="chat"][data-shell-page="user"] .layout,
body[data-workspace="chat"][data-shell-page="admin"] .layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"][data-shell-page="admin"] .layout {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      268px,
      320px
    );
}

body[data-workspace="chat"] .guide-panel,
body[data-workspace="chat"] .auth,
body[data-workspace="chat"] .governance {
  display: none;
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance {
  display: none;
}

body[data-shell-page="admin"][data-workspace="chat"] .guide-panel {
  display: block;
  background: linear-gradient(
    180deg,
    rgba(251, 243, 227, 0.98) 0%,
    rgba(244, 234, 212, 0.98) 100%
  );
  border: 1px solid rgba(255, 196, 110, 0.18);
  box-shadow: 0 16px 30px rgba(11, 16, 22, 0.12);
}

body[data-shell-page="admin"][data-workspace="chat"] .guide-panel .guide-list {
  color: rgba(34, 27, 18, 0.82);
}

body[data-shell-page="admin"][data-workspace="chat"] .governance {
  display: block;
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
  background: linear-gradient(
    180deg,
    rgba(248, 243, 230, 0.97) 0%,
    rgba(241, 233, 217, 0.97) 100%
  );
  border: 1px solid rgba(120, 93, 36, 0.22);
}

body[data-workspace="chat"] .rooms {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: hidden;
}

body[data-workspace="chat"] .rooms .room-list {
  overflow: auto;
  flex: 1;
}

body[data-workspace="chat"] .conversation {
  min-height: calc(100vh - 126px);
}

body[data-workspace="chat"][data-shell-page="user"] .conversation,
body[data-workspace="chat"][data-shell-page="admin"] .conversation {
  min-height: calc(100vh - 102px);
}

body[data-workspace="chat"][data-shell-page="user"] .layout-chat,
body[data-workspace="chat"][data-shell-page="admin"] .layout-chat {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"][data-shell-page="user"] .layout-chat {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"][data-shell-page="admin"] .layout-chat {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      268px,
      320px
    );
}

@media (max-width: 1024px) {
  body[data-workspace="chat"][data-shell-page="admin"] .layout-chat {
    grid-template-columns: 200px minmax(0, 1fr) minmax(220px, 280px);
  }
}

@media (max-width: 860px) {
  body[data-workspace="chat"][data-shell-page="admin"] .layout-chat {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="admin"] .conversation-overview {
  position: sticky;
  top: 112px;
  z-index: 1;
}

body[data-shell-page="unified"] .conversation-overview {
  position: sticky;
  top: 112px;
  z-index: 1;
}

body[data-workspace="chat"] .chat-detail {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: hidden;
}

body[data-shell-page="user"][data-workspace="chat"] .chat-detail {
  display: none;
}

body[data-shell-page="user"][data-workspace="chat"] .rooms {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(248, 252, 250, 0.98) 100%
  );
  border: 1px solid rgba(24, 105, 91, 0.1);
  border-left: 4px solid rgba(24, 105, 91, 0.24);
  box-shadow: 0 20px 44px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"][data-workspace="chat"] .conversation {
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(253, 255, 254, 0.99) 0%,
    rgba(245, 251, 248, 0.99) 100%
  );
  box-shadow: 0 24px 52px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"][data-workspace="chat"] .composer {
  border-color: rgba(24, 105, 91, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="user"] .composer-context-item {
  border-color: rgba(60, 190, 175, 0.14);
  background: rgba(20, 46, 48, 0.36);
}

body[data-shell-page="user"] .conversation-overview {
  border-color: rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(250, 255, 253, 0.98) 0%,
    rgba(243, 250, 247, 0.98) 100%
  );
}

body[data-shell-page="admin"][data-workspace="chat"] .rooms {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(247, 240, 224, 0.98) 100%
  );
  border: 1px solid rgba(120, 93, 36, 0.14);
  border-left: 4px solid rgba(120, 93, 36, 0.35);
  box-shadow: 0 22px 40px rgba(24, 105, 91, 0.2);
}

body[data-shell-page="admin"][data-workspace="chat"] .conversation {
  background: linear-gradient(
    180deg,
    rgba(28, 30, 35, 0.94) 0%,
    rgba(16, 18, 24, 0.98) 100%
  );
  border-left: 4px solid rgba(24, 105, 91, 0.3);
}

body[data-shell-page="admin"][data-workspace="chat"] .composer {
  border-color: rgba(24, 105, 91, 0.28);
  box-shadow: 0 18px 34px rgba(24, 105, 91, 0.16);
  background: rgba(12, 18, 24, 0.96);
}

body[data-shell-page="admin"] .composer-context-item {
  border-color: rgba(120, 93, 36, 0.16);
  background: rgba(35, 27, 16, 0.38);
}

body[data-shell-page="admin"] .conversation-overview {
  border-color: rgba(120, 93, 36, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 242, 0.98) 0%,
    rgba(245, 235, 214, 0.98) 100%
  );
}

body[data-shell-page="admin"] .room-button.active {
  border-color: rgba(120, 93, 36, 0.26);
  background: linear-gradient(
    180deg,
    rgba(255, 247, 228, 1) 0%,
    rgba(248, 236, 207, 1) 100%
  );
}

body[data-shell-page="admin"] .composer-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-chat-focus="true"] .workspace-switcher,
body[data-chat-focus="true"] .sidebar-stack,
body[data-chat-focus="true"] .guide-panel,
body[data-chat-focus="true"] .governance,
body[data-chat-focus="true"] .chat-detail,
body[data-chat-focus="true"] .rooms {
  display: none !important;
}

body[data-chat-focus="true"] .layout {
  grid-template-columns: minmax(0, 1fr);
  padding: 28px 18px 32px;
  background: transparent;
}

body[data-chat-focus="true"] .conversation {
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.65);
  border-radius: 32px;
  padding: 4px 0 12px;
}

body[data-chat-focus="true"] .timeline {
  margin: 0 24px 0;
  border-radius: 24px;
}

body[data-chat-focus="true"] .status-cluster {
  display: none;
}

body[data-chat-focus="true"] .chat-focus-toggle {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.notice-pending {
  color: var(--warning);
}

.shell-hidden {
  display: none !important;
}

.surface-hidden {
  display: none !important;
}

.empty-note {
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--muted);
}

.timeline-empty-card {
  margin: 4px 16px 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.74);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.99) 0%,
    rgba(247, 240, 227, 0.98) 100%
  );
  box-shadow:
    0 12px 26px rgba(44, 28, 12, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.timeline-empty-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    rgba(24, 105, 91, 0.9) 0%,
    rgba(201, 144, 57, 0.88) 100%
  );
}

.timeline-empty-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f1a16;
}

.timeline-empty-copy,
.timeline-empty-action {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(90, 77, 62, 0.82);
}

.timeline-empty-action {
  color: rgba(24, 105, 91, 0.76);
}

@media (max-width: 960px) {
  .topbar {
    flex-direction: column;
  }

  .workspace-switcher {
    position: static;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .conversation {
    min-height: auto;
  }

  .chat-detail {
    min-height: auto;
  }

  .chat-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .overview-header,
  .room-topline {
    flex-direction: column;
  }

  .thread-status-rail,
  .composer-meta,
  .composer-context {
    grid-template-columns: 1fr;
  }

  .conversation-toggle {
    display: inline-flex;
    align-self: flex-start;
    margin: 0 16px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 253, 247, 0.9);
    color: var(--accent);
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
  }

  /* Narrow screen: show thread by default, list when explicitly requested */
  body[data-workspace="chat"][data-chat-pane="list"] .conversation,
  body[data-workspace="chat"][data-chat-pane-mode="rooms"] .conversation {
    display: none;
  }

  body[data-workspace="chat"][data-chat-pane="thread"] .rooms,
  body[data-workspace="chat"][data-chat-pane-mode="thread"] .sidebar-stack {
    display: none;
  }
}

/* Visual refresh: keep the shell IM-first and soften the console edges. */
body[data-shell-page="user"],
body[data-shell-page="admin"],
body[data-shell-page="unified"] {
  background:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.78) 0,
      transparent 34%
    ),
    radial-gradient(
      circle at 18% 12%,
      rgba(201, 144, 57, 0.09) 0,
      transparent 24%
    ),
    linear-gradient(180deg, #f5efe0 0%, #ece1cb 100%);
}

body[data-shell-page="admin"] {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 216, 146, 0.12) 0,
      transparent 28%
    ),
    radial-gradient(
      circle at 14% 10%,
      rgba(38, 160, 132, 0.08) 0,
      transparent 24%
    ),
    linear-gradient(180deg, #f3ebdb 0%, #e6dcc6 100%);
}

body[data-shell-page="user"] .hero-callout,
body[data-shell-page="admin"] .hero-callout,
body[data-shell-page="unified"] .hero-callout,
body[data-shell-page="user"] #entry-grid,
body[data-shell-page="admin"] #entry-grid,
body[data-shell-page="unified"] #entry-grid {
  display: none;
}

body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar,
body[data-shell-page="unified"] .topbar {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(217, 204, 183, 0.62);
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.84) 0,
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 253, 247, 0.96) 0%,
      rgba(248, 240, 224, 0.92) 100%
    );
  box-shadow: 0 20px 42px rgba(45, 28, 12, 0.08);
}

body[data-shell-page="admin"] .topbar {
  border-color: rgba(120, 93, 36, 0.2);
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 230, 180, 0.16) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 251, 242, 0.98) 0%,
      rgba(244, 236, 220, 0.96) 100%
    );
}

body[data-shell-page="user"] .masthead,
body[data-shell-page="admin"] .masthead,
body[data-shell-page="unified"] .masthead {
  max-width: 880px;
  gap: 8px;
}

body[data-shell-page="user"] .hero-note,
body[data-shell-page="admin"] .hero-note,
body[data-shell-page="unified"] .hero-note {
  max-width: 60ch;
  font-size: 14px;
  line-height: 1.55;
}

body[data-shell-page="user"] .status-cluster,
body[data-shell-page="admin"] .status-cluster,
body[data-shell-page="unified"] .status-cluster {
  justify-content: flex-start;
  gap: 6px;
}

body[data-shell-page="user"] .badge,
body[data-shell-page="admin"] .badge,
body[data-shell-page="unified"] .badge {
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.92);
  border-color: rgba(217, 204, 183, 0.72);
  color: var(--muted);
}

body[data-shell-page="admin"] .badge {
  background: rgba(255, 250, 241, 0.94);
}

body[data-shell-page="user"] .workspace-switcher,
body[data-shell-page="admin"] .workspace-switcher,
body[data-shell-page="unified"] .workspace-switcher {
  margin: 12px 0 14px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid rgba(217, 204, 183, 0.56);
  box-shadow: 0 12px 26px rgba(42, 28, 12, 0.06);
}

body[data-shell-page="user"] .workspace-tab,
body[data-shell-page="admin"] .workspace-tab,
body[data-shell-page="unified"] .workspace-tab {
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.92);
  border-color: rgba(217, 204, 183, 0.7);
  color: var(--muted);
}

body[data-shell-page="user"] .workspace-tab.active,
body[data-shell-page="admin"] .workspace-tab.active,
body[data-shell-page="unified"] .workspace-tab.active {
  background: var(--accent-soft);
  border-color: rgba(24, 105, 91, 0.28);
  color: var(--accent);
}

body[data-workspace="chat"] .layout {
  gap: 14px;
  padding: 14px;
  border-radius: 28px;
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.6) 0,
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 254, 249, 0.9) 0%,
      rgba(244, 237, 224, 0.86) 100%
    );
  box-shadow: 0 28px 60px rgba(42, 28, 12, 0.08);
}

body[data-workspace="chat"][data-shell-page="user"] .layout,
body[data-workspace="chat"][data-shell-page="unified"] .layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"][data-shell-page="admin"] .layout {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      248px,
      288px
    );
}

body[data-shell-page="user"] .panel,
body[data-shell-page="admin"] .panel,
body[data-shell-page="unified"] .panel {
  border-radius: 22px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: rgba(255, 255, 252, 0.94);
  box-shadow: 0 16px 34px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="admin"] .panel {
  border-color: rgba(120, 93, 36, 0.18);
}

body[data-shell-page="user"] .panel-title,
body[data-shell-page="admin"] .panel-title,
body[data-shell-page="unified"] .panel-title,
body[data-shell-page="user"] .section-label,
body[data-shell-page="admin"] .section-label,
body[data-shell-page="unified"] .section-label {
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  color: rgba(111, 101, 87, 0.88);
}

body[data-shell-page="user"] .eyebrow,
body[data-shell-page="admin"] .eyebrow,
body[data-shell-page="unified"] .eyebrow {
  font-family: var(--font-ui);
  letter-spacing: 0.12em;
  color: rgba(111, 101, 87, 0.84);
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms,
body[data-shell-page="unified"] .rooms {
  min-height: 28vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-workspace="chat"] .rooms .room-list {
  overflow: auto;
  flex: 1;
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="unified"] .conversation {
  min-height: 76vh;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(246, 238, 224, 0.96) 100%
  );
}

body[data-shell-page="user"] .conversation {
  border: 1px solid rgba(24, 105, 91, 0.16);
  box-shadow: 0 24px 48px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="admin"] .conversation {
  border: 1px solid rgba(120, 93, 36, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 246, 0.98) 0%,
    rgba(240, 232, 215, 0.96) 100%
  );
  box-shadow: 0 24px 48px rgba(63, 40, 10, 0.1);
}

body[data-shell-page="unified"] .conversation {
  border: 1px solid rgba(217, 204, 183, 0.62);
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="admin"] .conversation-overview,
body[data-shell-page="unified"] .conversation-overview,
body[data-shell-page="user"] .meta,
body[data-shell-page="admin"] .meta,
body[data-shell-page="unified"] .meta {
  border-radius: 16px;
  border-color: rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 250, 0.92);
  box-shadow: none;
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline,
body[data-shell-page="unified"] .timeline {
  padding: 14px;
  gap: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.72);
  border: 1px solid rgba(217, 204, 183, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-shell-page="admin"] .timeline {
  background: linear-gradient(
    180deg,
    rgba(23, 28, 33, 0.96) 0%,
    rgba(14, 18, 22, 0.98) 100%
  );
  border-color: rgba(255, 196, 110, 0.16);
}

body[data-shell-page="unified"] .timeline {
  background: rgba(255, 255, 252, 0.78);
  border-color: rgba(217, 204, 183, 0.48);
}

body[data-shell-page="user"] .message,
body[data-shell-page="admin"] .message,
body[data-shell-page="unified"] .message {
  border-radius: 16px;
  max-width: min(74%, 700px);
}

body[data-shell-page="user"] .message {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(246, 252, 249, 0.99) 100%
  );
  border-color: rgba(24, 105, 91, 0.12);
  box-shadow: 0 10px 22px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="admin"] .message {
  background: linear-gradient(
    180deg,
    rgba(34, 28, 22, 0.96) 0%,
    rgba(24, 20, 17, 0.98) 100%
  );
  border-color: rgba(255, 196, 110, 0.14);
}

body[data-shell-page="unified"] .message {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(248, 243, 232, 0.99) 100%
  );
  border-color: rgba(217, 204, 183, 0.14);
  box-shadow: 0 10px 22px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="user"] .message.self {
  border-color: rgba(24, 105, 91, 0.22);
  background: linear-gradient(
    180deg,
    rgba(226, 246, 239, 1) 0%,
    rgba(210, 236, 226, 1) 100%
  );
}

body[data-shell-page="admin"] .message.self {
  border-color: rgba(201, 144, 57, 0.34);
  background: linear-gradient(
    180deg,
    rgba(194, 143, 68, 0.24) 0%,
    rgba(49, 36, 21, 0.96) 100%
  );
}

body[data-shell-page="unified"] .message.self {
  border-color: rgba(24, 105, 91, 0.2);
  background: linear-gradient(
    180deg,
    rgba(227, 245, 238, 1) 0%,
    rgba(214, 238, 229, 1) 100%
  );
}

body[data-shell-page="user"] .message-header,
body[data-shell-page="admin"] .message-header {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(111, 101, 87, 0.72);
}

body[data-shell-page="admin"] .message-header,
body[data-shell-page="admin"] .message-time {
  color: rgba(255, 219, 162, 0.64);
}

body[data-shell-page="unified"] .message-header {
  color: rgba(111, 101, 87, 0.72);
}

body[data-shell-page="user"] .message-sender {
  color: #173835;
}

body[data-shell-page="admin"] .message-sender {
  color: #fff1d2;
}

body[data-shell-page="unified"] .message-sender {
  color: #173835;
}

body[data-shell-page="user"] .message-body,
body[data-shell-page="admin"] .message-body,
body[data-shell-page="unified"] .message-body {
  font-size: 14px;
  line-height: 1.68;
}

body[data-shell-page="admin"] .message-body {
  color: rgba(255, 247, 232, 0.96);
}

body[data-shell-page="user"] .room-button,
body[data-shell-page="admin"] .room-button {
  border-radius: 16px;
  padding: 11px 12px;
  background: rgba(255, 255, 252, 0.92);
}

body[data-shell-page="user"] .room-button:hover,
body[data-shell-page="admin"] .room-button:hover {
  box-shadow: 0 10px 24px rgba(45, 28, 12, 0.06);
}

body[data-shell-page="user"] .room-button.active {
  border-color: rgba(24, 105, 91, 0.26);
  background: linear-gradient(
    180deg,
    rgba(236, 248, 243, 1) 0%,
    rgba(224, 241, 234, 1) 100%
  );
}

body[data-shell-page="admin"] .room-button.active {
  border-color: rgba(120, 93, 36, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 246, 224, 1) 0%,
    rgba(247, 233, 201, 1) 100%
  );
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  margin: 12px 16px 16px;
  padding: 14px 16px 16px;
  border-radius: 22px;
  border: 1px solid rgba(217, 204, 183, 0.68);
  background: rgba(255, 255, 252, 0.95);
  box-shadow: 0 18px 36px rgba(44, 28, 12, 0.08);
}

body[data-shell-page="admin"] .composer {
  background: linear-gradient(
    180deg,
    rgba(33, 27, 21, 0.97) 0%,
    rgba(20, 16, 13, 0.98) 100%
  );
  border-color: rgba(255, 196, 110, 0.16);
}

body[data-shell-page="unified"] .composer {
  border-color: rgba(24, 105, 91, 0.16);
  background: rgba(255, 255, 252, 0.96);
}

body[data-shell-page="user"] .composer-hero,
body[data-shell-page="admin"] .composer-hero,
body[data-shell-page="unified"] .composer-hero {
  margin: 0 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(217, 204, 183, 0.62);
  background: linear-gradient(
    180deg,
    rgba(255, 253, 248, 0.96) 0%,
    rgba(245, 238, 223, 0.96) 100%
  );
}

body[data-shell-page="admin"] .composer-hero {
  border-color: rgba(255, 196, 110, 0.18);
  background: linear-gradient(
    180deg,
    rgba(36, 27, 17, 0.96) 0%,
    rgba(20, 23, 29, 0.98) 100%
  );
}

body[data-shell-page="user"] .composer-hero-note {
  color: rgba(50, 68, 65, 0.78);
}

body[data-shell-page="admin"] .composer-hero-note {
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="unified"] .composer-hero-note {
  color: rgba(50, 68, 65, 0.78);
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="admin"] .composer-row textarea,
body[data-shell-page="unified"] .composer-row textarea {
  min-height: 86px;
  border-radius: 16px;
  border: 1px solid rgba(24, 105, 91, 0.18);
  box-shadow: inset 0 2px 10px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="admin"] .composer-row textarea {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(201, 144, 57, 0.18);
  color: var(--ink);
  box-shadow:
    inset 0 4px 14px rgba(201, 144, 57, 0.08),
    0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="user"] .composer-row button,
body[data-shell-page="admin"] .composer-row button,
body[data-shell-page="unified"] .composer-row button {
  min-width: 112px;
  border-radius: 14px;
  text-transform: none;
  letter-spacing: 0.05em;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(42, 196, 166, 1) 0%,
    rgba(17, 105, 89, 1) 100%
  );
}

body[data-shell-page="admin"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(201, 144, 57, 1) 0%,
    rgba(88, 52, 15, 1) 100%
  );
}

body[data-shell-page="user"] .composer-hints span,
body[data-shell-page="admin"] .composer-hints span,
body[data-shell-page="unified"] .composer-hints span {
  border-radius: 999px;
  padding: 5px 10px;
}

body[data-shell-page="admin"] .chat-detail {
  border-color: rgba(120, 93, 36, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 244, 0.98) 0%,
    rgba(244, 236, 220, 0.96) 100%
  );
}

body[data-shell-page="admin"][data-workspace="chat"] .conversation {
  background: linear-gradient(
    180deg,
    rgba(40, 34, 28, 0.97) 0%,
    rgba(23, 18, 15, 0.99) 100%
  );
  border: 1px solid rgba(255, 196, 110, 0.16);
  border-left: 4px solid rgba(201, 144, 57, 0.28);
  box-shadow: 0 26px 52px rgba(56, 36, 12, 0.18);
}

body[data-shell-page="admin"] .timeline {
  background: linear-gradient(
    180deg,
    rgba(31, 25, 20, 0.96) 0%,
    rgba(20, 16, 13, 0.98) 100%
  );
  border-color: rgba(255, 196, 110, 0.14);
}

body[data-shell-page="admin"] .message {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

body[data-shell-page="unified"] .chat-detail {
  border-color: rgba(217, 204, 183, 0.56);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(246, 239, 226, 0.96) 100%
  );
}

body[data-chat-focus="true"] .conversation {
  box-shadow: 0 32px 64px rgba(28, 18, 8, 0.28);
}

@media (max-width: 960px) {
  body[data-shell-page="user"] .topbar,
  body[data-shell-page="admin"] .topbar,
  body[data-shell-page="unified"] .topbar {
    padding: 14px;
  }

  body[data-workspace="chat"] .layout,
  body[data-workspace="chat"][data-shell-page="user"] .layout,
  body[data-workspace="chat"][data-shell-page="admin"] .layout,
  body[data-workspace="chat"][data-shell-page="unified"] .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  body[data-shell-page="user"] .conversation,
  body[data-shell-page="admin"] .conversation,
  body[data-shell-page="unified"] .conversation {
    min-height: auto;
  }

  body[data-shell-page="admin"] .chat-detail,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto;
  }

  body[data-shell-page="user"] .composer,
  body[data-shell-page="admin"] .composer,
  body[data-shell-page="unified"] .composer {
    margin: 10px 12px 12px;
  }

  body[data-shell-page="user"] .timeline,
  body[data-shell-page="admin"] .timeline {
    padding: 12px;
  }
}

/* Beta chat product polish: make the shell read like a product, not a console. */
body[data-shell-page="user"],
body[data-shell-page="admin"],
body[data-shell-page="unified"] {
  color-scheme: light;
}

body[data-shell-page="user"] .app,
body[data-shell-page="admin"] .app,
body[data-shell-page="unified"] .app {
  max-width: 1440px;
  padding: 28px 24px 40px;
}

body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar,
body[data-shell-page="unified"] .topbar {
  gap: 18px;
}

.topbar-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.glance-card {
  padding: 16px 17px;
  border-radius: 20px;
  border: 1px solid rgba(217, 204, 183, 0.66);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(248, 241, 229, 0.94) 100%
  );
  box-shadow: 0 14px 30px rgba(44, 28, 12, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-shell-page="user"] .glance-card {
  border-color: rgba(24, 105, 91, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(240, 250, 246, 0.96) 100%
  );
}

body[data-shell-page="admin"] .glance-card {
  border-color: rgba(201, 144, 57, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.98) 0%,
    rgba(248, 238, 214, 0.96) 100%
  );
}

.glance-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.82);
}

body[data-shell-page="admin"] .glance-label {
  background: rgba(201, 144, 57, 0.14);
  color: rgba(126, 77, 8, 0.88);
}

/* Admin: standard backend theme variables */
body[data-shell-page="admin"] {
  --admin-sidebar-bg: #141414;
  --admin-sidebar-text: rgba(255,255,255,0.65);
  --admin-sidebar-active: #1890ff;
  --admin-sidebar-hover: rgba(255,255,255,0.05);
  --admin-content-bg: #f0f2f5;
  --admin-panel-bg: #ffffff;
  --admin-border: #e8e8e8;
  --admin-text: #333333;
  --admin-text-secondary: #666666;
  --admin-text-muted: #999999;
  --admin-accent: #1890ff;
  --admin-success: #52c41a;
  --admin-warning: #faad14;
  --admin-danger: #f5222d;
}

body[data-workspace="chat"] .layout-user-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"] .layout-admin-shell {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      250px,
      292px
    );
}

body[data-workspace="chat"] .layout-unified-shell {
  grid-template-columns: 220px minmax(0, 1fr) minmax(
      232px,
      280px
    );
}

body[data-workspace="chat"] .layout-user-shell .chat-detail {
  grid-column: 1 / -1;
  min-height: auto;
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms,
body[data-shell-page="unified"] .rooms,
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="admin"] .governance,
body[data-shell-page="unified"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="admin"] .auth,
body[data-shell-page="unified"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  overflow: hidden;
}

.panel-shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}

body[data-shell-page="user"] .panel-shell-note,
body[data-shell-page="admin"] .panel-shell-note,
body[data-shell-page="unified"] .panel-shell-note {
  display: none;
}

.panel-shell-header + .panel-title {
  display: none;
}

.panel-shell-header-detail {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(217, 204, 183, 0.46);
  margin-bottom: 4px;
}

body[data-shell-page="admin"] .panel-shell-header-detail {
  border-bottom-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="unified"] .panel-shell-header-detail {
  border-bottom-color: rgba(24, 105, 91, 0.14);
}

body[data-shell-page="admin"] .panel-shell-header-detail,
body[data-shell-page="unified"] .panel-shell-header-detail {
  padding-top: 16px;
  margin: 0 14px 6px;
}

.panel-kicker {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(24, 105, 91, 0.66);
  margin-bottom: 8px;
}

body[data-shell-page="admin"] .panel-kicker {
  color: rgba(146, 96, 23, 0.74);
}

.panel-shell-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1f1a16;
}

.panel-shell-note {
  margin: 0;
  max-width: 30ch;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(90, 77, 62, 0.8);
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(248, 241, 228, 0.94) 100%
  );
}

body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="unified"] .governance,
body[data-shell-page="unified"] .auth {
  background: linear-gradient(
    180deg,
    rgba(252, 248, 240, 0.94) 0%,
    rgba(246, 238, 225, 0.92) 100%
  );
  border-style: solid;
}

body[data-shell-page="admin"] .governance,
body[data-shell-page="admin"] .auth {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 246, 0.96) 0%,
    rgba(242, 232, 209, 0.94) 100%
  );
}

body[data-shell-page="user"] .governance-block,
body[data-shell-page="user"] .auth .inline-form,
body[data-shell-page="unified"] .governance-block,
body[data-shell-page="unified"] .auth .inline-form {
  opacity: 0.84;
}

.guide-list {
  padding: 0 18px 18px;
}

body[data-shell-page="user"] .rooms .room-list,
body[data-shell-page="admin"] .rooms .room-list,
body[data-shell-page="unified"] .rooms .room-list {
  padding: 0 14px 16px;
}

body[data-shell-page="user"] .room-button,
body[data-shell-page="admin"] .room-button,
body[data-shell-page="unified"] .room-button {
  position: relative;
  padding: 14px 14px 14px 16px;
}

body[data-shell-page="user"] .room-button::after,
body[data-shell-page="admin"] .room-button::after,
body[data-shell-page="unified"] .room-button::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.2);
  opacity: 0;
}

body[data-shell-page="admin"] .room-button::after {
  background: rgba(201, 144, 57, 0.34);
}

body[data-shell-page="user"] .room-button.active::after,
body[data-shell-page="admin"] .room-button.active::after,
body[data-shell-page="unified"] .room-button.active::after,
body[data-shell-page="user"] .room-button.room-button-unread::after,
body[data-shell-page="admin"] .room-button.room-button-unread::after,
body[data-shell-page="unified"] .room-button.room-button-unread::after {
  opacity: 1;
}

body[data-shell-page="user"] .room-name,
body[data-shell-page="admin"] .room-name,
body[data-shell-page="unified"] .room-name {
  font-size: 15px;
}

body[data-shell-page="user"] .room-preview,
body[data-shell-page="admin"] .room-preview,
body[data-shell-page="unified"] .room-preview {
  font-weight: 500;
  color: rgba(38, 31, 24, 0.9);
}

body[data-shell-page="admin"] .room-preview {
  color: rgba(52, 40, 26, 0.9);
}

.conversation-stage {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 12px;
}

body[data-shell-page="admin"] .conversation-stage,
body[data-shell-page="unified"] .conversation-stage {
  margin: 0 12px 10px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.42);
  background: linear-gradient(
    180deg,
    rgba(255, 254, 250, 0.96) 0%,
    rgba(249, 244, 232, 0.94) 100%
  );
  box-shadow: 0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="admin"] .conversation-stage {
  border-color: rgba(201, 144, 57, 0.14);
}

body[data-shell-page="unified"] .conversation-stage {
  border-color: rgba(24, 105, 91, 0.14);
}

.conversation-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 700px;
}

body[data-shell-page="admin"] .conversation-stage-copy,
body[data-shell-page="unified"] .conversation-stage-copy {
  max-width: 760px;
}

.conversation-stage-title {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #1d1a17;
}

.conversation-stage-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: rgba(83, 71, 58, 0.82);
}

.conversation-stage-canvas-wrap {
  width: min(100%, 680px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(27, 35, 51, 0.08);
  background: linear-gradient(180deg, rgba(21, 28, 42, 0.96) 0%, rgba(30, 21, 16, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.conversation-stage-canvas {
  display: block;
  width: 100%;
  height: 128px;
}

.conversation-stage-side {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 280px;
}

body[data-shell-page="admin"] .conversation-stage-side,
body[data-shell-page="unified"] .conversation-stage-side {
  max-width: 320px;
  align-items: flex-start;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid rgba(217, 204, 183, 0.72);
  background: rgba(255, 255, 250, 0.94);
  font-size: 12px;
  color: rgba(93, 77, 58, 0.88);
}

body[data-shell-page="user"] .stage-chip,
body[data-shell-page="unified"] .stage-chip {
  border-color: rgba(24, 105, 91, 0.16);
  background: rgba(241, 252, 248, 0.92);
  color: rgba(24, 105, 91, 0.82);
}

body[data-shell-page="admin"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-note {
  color: #f8ecd1;
}

body[data-shell-page="admin"] .stage-chip {
  border-color: rgba(201, 144, 57, 0.24);
  background: rgba(56, 43, 25, 0.7);
  color: rgba(255, 225, 173, 0.92);
}

body[data-shell-page="admin"] .conversation-stage {
  border-bottom: 1px solid rgba(201, 144, 57, 0.12);
}

body[data-shell-page="admin"] .conversation-stage-title {
  color: #231a12;
}

body[data-shell-page="admin"] .conversation-stage-note {
  color: rgba(83, 71, 58, 0.84);
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="unified"] .conversation-stage {
  border-bottom: 1px solid rgba(24, 105, 91, 0.08);
}

body[data-shell-page="unified"] .conversation-stage-title {
  color: #1e1a16;
}

body[data-shell-page="unified"] .conversation-stage-note {
  color: rgba(83, 71, 58, 0.84);
}

body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="admin"] .conversation-tools,
body[data-shell-page="unified"] .conversation-tools {
  padding-top: 6px;
}

body[data-shell-page="admin"] .conversation-tools,
body[data-shell-page="unified"] .conversation-tools {
  gap: 10px;
  margin: 0 12px 12px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(217, 204, 183, 0.38);
}

body[data-shell-page="user"] .meta,
body[data-shell-page="admin"] .meta,
body[data-shell-page="unified"] .meta {
  margin-top: 12px;
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline,
body[data-shell-page="unified"] .timeline {
  position: relative;
  padding: 16px;
}

body[data-shell-page="user"] .timeline {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(247, 251, 249, 0.94) 100%
  );
}

body[data-shell-page="unified"] .timeline {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(248, 243, 232, 0.94) 100%
  );
}

body[data-shell-page="user"] .message-row,
body[data-shell-page="admin"] .message-row,
body[data-shell-page="unified"] .message-row {
  gap: 12px;
}

body[data-shell-page="user"] .message,
body[data-shell-page="admin"] .message,
body[data-shell-page="unified"] .message {
  padding: 14px 16px;
  border-radius: 18px;
}

body[data-shell-page="user"] .message-header,
body[data-shell-page="admin"] .message-header,
body[data-shell-page="unified"] .message-header {
  margin-bottom: 10px;
}

body[data-shell-page="user"] .timeline-divider,
body[data-shell-page="unified"] .timeline-divider {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.74);
}

body[data-shell-page="admin"] .timeline-divider {
  background: rgba(255, 196, 110, 0.12);
  color: rgba(255, 225, 173, 0.82);
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  margin-top: 14px;
}

body[data-shell-page="user"] .composer-row,
body[data-shell-page="admin"] .composer-row,
body[data-shell-page="unified"] .composer-row {
  align-items: end;
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="admin"] .composer-row textarea,
body[data-shell-page="unified"] .composer-row textarea {
  min-height: 92px;
}

body[data-shell-page="user"] .composer-row button,
body[data-shell-page="admin"] .composer-row button,
body[data-shell-page="unified"] .composer-row button {
  min-width: 118px;
}

body[data-shell-page="unified"] .composer-hints-unified {
  display: flex;
}

body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  border-radius: 24px;
}

body[data-shell-page="user"] .chat-detail-content,
body[data-shell-page="admin"] .chat-detail-content,
body[data-shell-page="unified"] .chat-detail-content {
  padding-top: 0;
}

body[data-shell-page="user"] .chat-detail-hero,
body[data-shell-page="user"] .chat-detail-section,
body[data-shell-page="unified"] .chat-detail-hero,
body[data-shell-page="unified"] .chat-detail-section {
  background: rgba(255, 255, 252, 0.98);
}

body[data-shell-page="admin"] .chat-detail-hero,
body[data-shell-page="admin"] .chat-detail-section {
  background: rgba(255, 252, 246, 0.98);
}

body[data-shell-page="user"] .governance-details,
body[data-shell-page="user"] .auth-details,
body[data-shell-page="admin"] .governance-details,
body[data-shell-page="admin"] .auth-details,
body[data-shell-page="unified"] .governance-details,
body[data-shell-page="unified"] .auth-details {
  margin: 0 16px 16px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.54);
  background: rgba(255, 255, 252, 0.72);
}

body[data-shell-page="admin"] .governance-details,
body[data-shell-page="admin"] .auth-details {
  border-color: rgba(201, 144, 57, 0.18);
  background: rgba(255, 251, 245, 0.8);
}

body[data-shell-page="user"] .governance-details summary,
body[data-shell-page="user"] .auth-details summary,
body[data-shell-page="admin"] .governance-details summary,
body[data-shell-page="admin"] .auth-details summary,
body[data-shell-page="unified"] .governance-details summary,
body[data-shell-page="unified"] .auth-details summary {
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 960px) {
  body[data-shell-page="user"] .app,
  body[data-shell-page="admin"] .app,
  body[data-shell-page="unified"] .app {
    padding: 20px 16px 32px;
  }

  .hero-glance,
  .conversation-stage,
  .panel-shell-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .panel-shell-note {
    max-width: none;
  }

  body[data-workspace="chat"] .layout-user-shell,
  body[data-workspace="chat"] .layout-admin-shell,
  body[data-workspace="chat"] .layout-unified-shell {
    grid-template-columns: 1fr;
  }

  body[data-workspace="chat"] .layout-user-shell .chat-detail {
    grid-column: auto;
  }

  .conversation-stage {
    padding: 18px 16px 10px;
  }

  .conversation-stage-side {
    max-width: none;
    justify-content: flex-start;
  }

  body[data-shell-page="user"] .conversation-tools,
  body[data-shell-page="admin"] .conversation-tools,
  body[data-shell-page="unified"] .conversation-tools {
    padding-right: 16px;
    padding-left: 16px;
  }

  body[data-shell-page="user"] .composer-row,
  body[data-shell-page="admin"] .composer-row,
  body[data-shell-page="unified"] .composer-row {
    grid-template-columns: 1fr;
  }

  body[data-shell-page="user"] .composer-row button,
  body[data-shell-page="admin"] .composer-row button,
  body[data-shell-page="unified"] .composer-row button {
    min-height: 48px;
  }
}

/* Chat-first polish: keep the conversation area visually dominant. */
body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="unified"] .conversation {
  box-shadow: 0 30px 64px rgba(35, 23, 11, 0.12);
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  box-shadow: 0 20px 42px rgba(35, 23, 11, 0.1);
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms,
body[data-shell-page="unified"] .rooms,
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="admin"] .governance,
body[data-shell-page="unified"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="admin"] .auth,
body[data-shell-page="unified"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  box-shadow: 0 10px 24px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="user"] .panel-shell-title,
body[data-shell-page="admin"] .panel-shell-title,
body[data-shell-page="unified"] .panel-shell-title,
body[data-shell-page="user"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-title,
body[data-shell-page="unified"] .conversation-stage-title {
  letter-spacing: -0.02em;
}

/* IM-first shell polish: soften console edges and elevate the main chat surfaces. */
body[data-shell-page="user"],
body[data-shell-page="admin"],
body[data-shell-page="unified"] {
  color-scheme: light;
}

body[data-shell-page="user"] .app,
body[data-shell-page="admin"] .app,
body[data-shell-page="unified"] .app {
  max-width: 1460px;
  padding: 24px 20px 36px;
}

body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar,
body[data-shell-page="unified"] .topbar {
  gap: 14px;
  border-radius: 28px;
  padding: 18px;
  border: 1px solid rgba(217, 204, 183, 0.64);
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.97) 0%,
    rgba(248, 240, 224, 0.94) 100%
  );
  box-shadow: 0 18px 40px rgba(45, 28, 12, 0.08);
}

body[data-shell-page="admin"] .topbar {
  border-color: rgba(201, 144, 57, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 242, 0.98) 0%,
    rgba(244, 236, 220, 0.96) 100%
  );
}

body[data-shell-page="user"] .hero-glance,
body[data-shell-page="admin"] .hero-glance,
body[data-shell-page="unified"] .hero-glance {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-shell-page="user"] .glance-card,
body[data-shell-page="admin"] .glance-card,
body[data-shell-page="unified"] .glance-card {
  border-radius: 20px;
  border: 1px solid rgba(217, 204, 183, 0.66);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 241, 229, 0.96) 100%
  );
  box-shadow: 0 12px 26px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="admin"] .glance-card {
  border-color: rgba(201, 144, 57, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.98) 0%,
    rgba(248, 238, 214, 0.96) 100%
  );
}

body[data-shell-page="user"] .status-cluster,
body[data-shell-page="admin"] .status-cluster,
body[data-shell-page="unified"] .status-cluster {
  justify-content: flex-start;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(217, 204, 183, 0.58);
}

body[data-shell-page="admin"] .status-cluster {
  border-top-color: rgba(201, 144, 57, 0.2);
}

body[data-shell-page="user"] .badge,
body[data-shell-page="admin"] .badge,
body[data-shell-page="unified"] .badge {
  background: rgba(255, 255, 252, 0.94);
  border-color: rgba(217, 204, 183, 0.72);
  color: rgba(101, 91, 78, 0.94);
}

body[data-shell-page="user"] .layout,
body[data-shell-page="admin"] .layout,
body[data-shell-page="unified"] .layout {
  gap: 14px;
  padding: 14px;
  border-radius: 30px;
  background: linear-gradient(
    180deg,
    rgba(255, 254, 249, 0.9) 0%,
    rgba(244, 237, 224, 0.86) 100%
  );
  box-shadow: 0 28px 60px rgba(42, 28, 12, 0.08);
}

body[data-shell-page="user"] .layout {
  grid-template-columns: 220px minmax(0, 1fr);
  border: 1px solid rgba(24, 105, 91, 0.08);
}

body[data-shell-page="admin"] .layout {
  grid-template-columns: 220px minmax(0, 1fr) minmax(264px, 304px);
  border: 1px solid rgba(201, 144, 57, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.96) 0%,
    rgba(244, 236, 220, 0.92) 100%
  );
}

body[data-shell-page="unified"] .layout {
  grid-template-columns: minmax(260px, 304px) minmax(0, 1fr) minmax(240px, 284px);
  border: 1px solid rgba(217, 204, 183, 0.56);
}

body[data-shell-page="user"] .panel,
body[data-shell-page="admin"] .panel,
body[data-shell-page="unified"] .panel {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: rgba(255, 255, 252, 0.95);
  box-shadow: 0 16px 34px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="admin"] .panel {
  border-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="user"] .panel-shell-header,
body[data-shell-page="admin"] .panel-shell-header,
body[data-shell-page="unified"] .panel-shell-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body[data-shell-page="user"] .panel-shell-title,
body[data-shell-page="admin"] .panel-shell-title,
body[data-shell-page="unified"] .panel-shell-title {
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1f1a16;
}

body[data-shell-page="user"] .panel-shell-note,
body[data-shell-page="admin"] .panel-shell-note,
body[data-shell-page="unified"] .panel-shell-note {
  max-width: 32ch;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(90, 77, 62, 0.78);
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms,
body[data-shell-page="unified"] .rooms,
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="admin"] .governance,
body[data-shell-page="unified"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="admin"] .auth,
body[data-shell-page="unified"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  overflow: hidden;
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms,
body[data-shell-page="unified"] .rooms {
  min-height: 28vh;
  display: flex;
  flex-direction: column;
}

body[data-shell-page="user"] .rooms {
  border-left: 4px solid rgba(24, 105, 91, 0.24);
}

body[data-shell-page="admin"] .rooms {
  border-left: 4px solid rgba(201, 144, 57, 0.34);
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(248, 241, 228, 0.94) 100%
  );
}

body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel {
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.98) 0%,
    rgba(248, 238, 214, 0.94) 100%
  );
}

body[data-shell-page="user"] .room-digest,
body[data-shell-page="admin"] .room-digest,
body[data-shell-page="unified"] .room-digest {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(44, 28, 12, 0.05);
}

body[data-shell-page="admin"] .room-digest {
  border-color: rgba(201, 144, 57, 0.16);
}

body[data-shell-page="user"] .room-digest-title,
body[data-shell-page="admin"] .room-digest-title,
body[data-shell-page="unified"] .room-digest-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f1a16;
}

body[data-shell-page="user"] .room-digest-copy,
body[data-shell-page="admin"] .room-digest-copy,
body[data-shell-page="unified"] .room-digest-copy {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(90, 77, 62, 0.82);
}

body[data-shell-page="user"] .rooms .room-list,
body[data-shell-page="admin"] .rooms .room-list,
body[data-shell-page="unified"] .rooms .room-list {
  padding: 0 14px 16px;
  gap: 10px;
  overflow: auto;
  flex: 1;
}

body[data-shell-page="user"] .room-button,
body[data-shell-page="admin"] .room-button,
body[data-shell-page="unified"] .room-button {
  position: relative;
  padding: 13px 14px 13px 16px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 10px 22px rgba(44, 28, 12, 0.05);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

body[data-shell-page="user"] .room-button::after,
body[data-shell-page="admin"] .room-button::after,
body[data-shell-page="unified"] .room-button::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.18);
  opacity: 0;
}

body[data-shell-page="admin"] .room-button::after {
  background: rgba(201, 144, 57, 0.34);
}

body[data-shell-page="user"] .room-button:hover,
body[data-shell-page="admin"] .room-button:hover,
body[data-shell-page="unified"] .room-button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 105, 91, 0.22);
  box-shadow: 0 12px 24px rgba(44, 28, 12, 0.07);
}

body[data-shell-page="user"] .room-button:focus-visible,
body[data-shell-page="admin"] .room-button:focus-visible,
body[data-shell-page="unified"] .room-button:focus-visible,
body[data-shell-page="user"] .chat-quick-links button:focus-visible,
body[data-shell-page="admin"] .chat-quick-links button:focus-visible,
body[data-shell-page="unified"] .chat-quick-links button:focus-visible,
body[data-shell-page="user"] .conversation-tools button:focus-visible,
body[data-shell-page="admin"] .conversation-tools button:focus-visible,
body[data-shell-page="unified"] .conversation-tools button:focus-visible,
body[data-shell-page="user"] .conversation-tools select:focus-visible,
body[data-shell-page="admin"] .conversation-tools select:focus-visible,
body[data-shell-page="unified"] .conversation-tools select:focus-visible {
  outline: 2px solid rgba(24, 105, 91, 0.45);
  outline-offset: 2px;
}

body[data-shell-page="user"] .room-button.active,
body[data-shell-page="admin"] .room-button.active,
body[data-shell-page="unified"] .room-button.active,
body[data-shell-page="user"] .room-button.room-button-unread,
body[data-shell-page="admin"] .room-button.room-button-unread,
body[data-shell-page="unified"] .room-button.room-button-unread {
  box-shadow: 0 12px 24px rgba(44, 28, 12, 0.08);
}

body[data-shell-page="user"] .room-button.active {
  border-color: rgba(24, 105, 91, 0.24);
  background: linear-gradient(
    180deg,
    rgba(236, 248, 243, 1) 0%,
    rgba(224, 241, 234, 1) 100%
  );
}

body[data-shell-page="admin"] .room-button.active {
  border-color: rgba(201, 144, 57, 0.24);
  background: linear-gradient(
    180deg,
    rgba(255, 246, 224, 1) 0%,
    rgba(247, 233, 201, 1) 100%
  );
}

body[data-shell-page="user"] .room-button.room-button-unread {
  border-color: rgba(24, 105, 91, 0.16);
  background: linear-gradient(
    180deg,
    rgba(250, 255, 252, 1) 0%,
    rgba(239, 250, 246, 1) 100%
  );
}

body[data-shell-page="admin"] .room-button.room-button-unread {
  border-color: rgba(201, 144, 57, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 238, 1) 0%,
    rgba(248, 241, 214, 1) 100%
  );
}

body[data-shell-page="user"] .room-button.active::after,
body[data-shell-page="admin"] .room-button.active::after,
body[data-shell-page="unified"] .room-button.active::after,
body[data-shell-page="user"] .room-button.room-button-unread::after,
body[data-shell-page="admin"] .room-button.room-button-unread::after,
body[data-shell-page="unified"] .room-button.room-button-unread::after {
  opacity: 1;
}

body[data-shell-page="user"] .room-avatar,
body[data-shell-page="admin"] .room-avatar,
body[data-shell-page="unified"] .room-avatar {
  width: 36px;
  height: 36px;
  border-radius: 13px;
}

body[data-shell-page="user"] .room-name,
body[data-shell-page="admin"] .room-name,
body[data-shell-page="unified"] .room-name {
  font-size: 15px;
  color: #1f1a16;
}

body[data-shell-page="user"] .room-preview,
body[data-shell-page="admin"] .room-preview,
body[data-shell-page="unified"] .room-preview {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(38, 31, 24, 0.9);
  font-weight: 500;
}

body[data-shell-page="admin"] .room-preview {
  color: rgba(52, 40, 26, 0.9);
}

body[data-shell-page="user"] .room-status-line,
body[data-shell-page="admin"] .room-status-line,
body[data-shell-page="unified"] .room-status-line {
  font-size: 11px;
  color: rgba(111, 101, 87, 0.92);
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="unified"] .conversation {
  min-height: 76vh;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(246, 238, 224, 0.96) 100%
  );
  box-shadow: 0 24px 48px rgba(35, 23, 11, 0.1);
}

body[data-shell-page="user"] .conversation {
  border-color: rgba(24, 105, 91, 0.16);
}

body[data-shell-page="admin"] .conversation {
  border-color: rgba(201, 144, 57, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 243, 0.98) 0%,
    rgba(246, 236, 217, 0.96) 100%
  );
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="admin"] .conversation-stage,
body[data-shell-page="unified"] .conversation-stage {
  margin: 0 16px 12px;
  padding: 16px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 252, 0.92);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

body[data-shell-page="admin"] .conversation-stage {
  border-color: rgba(201, 144, 57, 0.16);
  background: rgba(255, 251, 243, 0.92);
}

body[data-shell-page="user"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-title,
body[data-shell-page="unified"] .conversation-stage-title {
  font-size: 22px;
  line-height: 1.08;
  font-weight: 700;
  color: #1f1a16;
}

body[data-shell-page="user"] .conversation-stage-note,
body[data-shell-page="admin"] .conversation-stage-note,
body[data-shell-page="unified"] .conversation-stage-note {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.58;
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="admin"] .conversation-stage-side,
body[data-shell-page="unified"] .conversation-stage-side {
  max-width: 300px;
  justify-content: flex-end;
  align-items: flex-start;
}

.stage-chip {
  border: 1px solid rgba(217, 204, 183, 0.72);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(93, 77, 58, 0.88);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--font-ui);
}

body[data-shell-page="admin"] .stage-chip {
  border-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="admin"] .conversation-callout,
body[data-shell-page="unified"] .conversation-callout {
  margin: 0 16px 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.96) 0%,
    rgba(246, 239, 226, 0.94) 100%
  );
  color: #1f1a16;
  box-shadow: 0 12px 26px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="admin"] .conversation-callout {
  border-color: rgba(201, 144, 57, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(248, 239, 217, 0.96) 100%
  );
}

body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="admin"] .chat-priority-badge,
body[data-shell-page="unified"] .chat-priority-badge {
  margin: 0 16px 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 105, 91, 0.08);
  border: 1px solid rgba(24, 105, 91, 0.14);
  color: rgba(24, 105, 91, 0.82);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.02em;
}

body[data-shell-page="admin"] .chat-priority-badge {
  background: rgba(201, 144, 57, 0.08);
  border-color: rgba(201, 144, 57, 0.16);
  color: rgba(146, 96, 23, 0.82);
}

body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="admin"] .chat-quick-links,
body[data-shell-page="unified"] .chat-quick-links {
  margin: 0 16px 10px;
  gap: 6px;
}

body[data-shell-page="user"] .chat-quick-links button,
body[data-shell-page="admin"] .chat-quick-links button,
body[data-shell-page="unified"] .chat-quick-links button {
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 183, 0.72);
  background: rgba(255, 255, 255, 0.96);
  color: #1f1a16;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

body[data-shell-page="user"] .chat-quick-links button:hover,
body[data-shell-page="admin"] .chat-quick-links button:hover,
body[data-shell-page="unified"] .chat-quick-links button:hover,
body[data-shell-page="user"] .conversation-tools button:hover,
body[data-shell-page="admin"] .conversation-tools button:hover,
body[data-shell-page="unified"] .conversation-tools button:hover,
body[data-shell-page="user"] .conversation-tools select:hover,
body[data-shell-page="admin"] .conversation-tools select:hover,
body[data-shell-page="unified"] .conversation-tools select:hover {
  border-color: rgba(24, 105, 91, 0.24);
}

body[data-shell-page="admin"] .chat-quick-links button {
  border-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="admin"] .thread-status-rail,
body[data-shell-page="unified"] .thread-status-rail {
  margin: 0 16px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-shell-page="user"] .thread-status-item,
body[data-shell-page="admin"] .thread-status-item,
body[data-shell-page="unified"] .thread-status-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(44, 28, 12, 0.05);
}

body[data-shell-page="admin"] .thread-status-item {
  border-color: rgba(201, 144, 57, 0.14);
}

body[data-shell-page="user"] .thread-status-label,
body[data-shell-page="admin"] .thread-status-label,
body[data-shell-page="unified"] .thread-status-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(111, 101, 87, 0.78);
}

body[data-shell-page="user"] .thread-status-value,
body[data-shell-page="admin"] .thread-status-value,
body[data-shell-page="unified"] .thread-status-value {
  font-size: 12px;
  color: #1f1a16;
}

body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="admin"] .conversation-tools,
body[data-shell-page="unified"] .conversation-tools {
  margin: 0 16px 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(217, 204, 183, 0.38);
  align-items: center;
}

body[data-shell-page="user"] .conversation-tools select,
body[data-shell-page="admin"] .conversation-tools select,
body[data-shell-page="unified"] .conversation-tools select,
body[data-shell-page="user"] .conversation-tools button,
body[data-shell-page="admin"] .conversation-tools button,
body[data-shell-page="unified"] .conversation-tools button {
  border-radius: 12px;
  border: 1px solid rgba(217, 204, 183, 0.7);
  background: rgba(255, 255, 255, 0.96);
  color: #1f1a16;
  font-family: var(--font-ui);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

body[data-shell-page="admin"] .conversation-tools select,
body[data-shell-page="admin"] .conversation-tools button {
  border-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="user"] .meta,
body[data-shell-page="admin"] .meta,
body[data-shell-page="unified"] .meta {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(101, 91, 78, 0.94);
}

body[data-shell-page="user"] .meta-title,
body[data-shell-page="admin"] .meta-title,
body[data-shell-page="unified"] .meta-title {
  color: #1f1a16;
  font-family: var(--font-ui);
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline,
body[data-shell-page="unified"] .timeline {
  margin: 0 16px 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 252, 0.96);
  border: 1px solid rgba(217, 204, 183, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

body[data-shell-page="admin"] .timeline {
  background: linear-gradient(
    180deg,
    rgba(255, 251, 245, 0.98) 0%,
    rgba(247, 239, 222, 0.96) 100%
  );
  border-color: rgba(201, 144, 57, 0.16);
}

body[data-shell-page="user"] .message,
body[data-shell-page="admin"] .message,
body[data-shell-page="unified"] .message {
  padding: 14px 16px;
  border-radius: 16px;
  max-width: min(74%, 720px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(217, 204, 183, 0.45);
  box-shadow: 0 10px 22px rgba(44, 28, 12, 0.05);
}

body[data-shell-page="user"] .message {
  border-color: rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(246, 252, 249, 0.99) 100%
  );
}

body[data-shell-page="admin"] .message {
  border-color: rgba(201, 144, 57, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 253, 247, 0.99) 0%,
    rgba(248, 239, 218, 0.98) 100%
  );
}

body[data-shell-page="unified"] .message {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(248, 243, 232, 0.99) 100%
  );
}

body[data-shell-page="user"] .message.self {
  border-color: rgba(24, 105, 91, 0.22);
  background: linear-gradient(
    180deg,
    rgba(226, 246, 239, 1) 0%,
    rgba(210, 236, 226, 1) 100%
  );
}

body[data-shell-page="admin"] .message.self {
  border-color: rgba(201, 144, 57, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 243, 216, 1) 0%,
    rgba(245, 225, 184, 1) 100%
  );
}

body[data-shell-page="unified"] .message.self {
  border-color: rgba(24, 105, 91, 0.2);
  background: linear-gradient(
    180deg,
    rgba(227, 245, 238, 1) 0%,
    rgba(214, 238, 229, 1) 100%
  );
}

body[data-shell-page="user"] .message-header,
body[data-shell-page="admin"] .message-header,
body[data-shell-page="unified"] .message-header {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(111, 101, 87, 0.72);
}

body[data-shell-page="user"] .message-sender,
body[data-shell-page="admin"] .message-sender,
body[data-shell-page="unified"] .message-sender {
  color: #1f1a16;
}

body[data-shell-page="user"] .message-role,
body[data-shell-page="admin"] .message-role,
body[data-shell-page="unified"] .message-role {
  font-size: 10px;
  letter-spacing: 0.04em;
}

body[data-shell-page="user"] .message-role {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.82);
}

body[data-shell-page="admin"] .message-role {
  background: rgba(201, 144, 57, 0.1);
  color: rgba(146, 96, 23, 0.82);
}

body[data-shell-page="unified"] .message-role {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.82);
}

body[data-shell-page="user"] .message-time,
body[data-shell-page="admin"] .message-time,
body[data-shell-page="unified"] .message-time {
  color: rgba(111, 101, 87, 0.58);
}

body[data-shell-page="user"] .message-body,
body[data-shell-page="admin"] .message-body,
body[data-shell-page="unified"] .message-body {
  font-size: 14px;
  line-height: 1.68;
  color: #1d252b;
}

body[data-shell-page="user"] .timeline-divider,
body[data-shell-page="admin"] .timeline-divider,
body[data-shell-page="unified"] .timeline-divider {
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 183, 0.48);
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--font-ui);
}

body[data-shell-page="user"] .timeline-divider {
  background: rgba(24, 105, 91, 0.08);
  color: rgba(24, 105, 91, 0.74);
}

body[data-shell-page="admin"] .timeline-divider {
  background: rgba(201, 144, 57, 0.08);
  color: rgba(146, 96, 23, 0.82);
}

body[data-shell-page="unified"] .timeline-divider {
  background: rgba(24, 105, 91, 0.06);
  color: rgba(24, 105, 91, 0.74);
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  margin: 12px 16px 16px;
  padding: 14px 16px 16px;
  border-radius: 24px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 16px 34px rgba(35, 23, 11, 0.08);
  position: sticky;
  bottom: 0;
  z-index: 4;
}

body[data-shell-page="admin"] .composer {
  border-color: rgba(201, 144, 57, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(248, 240, 221, 0.97) 100%
  );
}

body[data-shell-page="user"] .composer-hero,
body[data-shell-page="admin"] .composer-hero,
body[data-shell-page="unified"] .composer-hero {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(246, 239, 226, 0.95) 100%
  );
}

body[data-shell-page="admin"] .composer-hero {
  border-color: rgba(201, 144, 57, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(248, 239, 217, 0.96) 100%
  );
}

body[data-shell-page="user"] .composer-hero-kicker,
body[data-shell-page="admin"] .composer-hero-kicker,
body[data-shell-page="unified"] .composer-hero-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(111, 101, 87, 0.76);
  font-family: var(--font-ui);
}

body[data-shell-page="user"] .composer-hero-title,
body[data-shell-page="admin"] .composer-hero-title,
body[data-shell-page="unified"] .composer-hero-title {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
  color: #1f1a16;
}

body[data-shell-page="user"] .composer-hero-note,
body[data-shell-page="admin"] .composer-hero-note,
body[data-shell-page="unified"] .composer-hero-note {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(83, 71, 58, 0.82);
}

body[data-shell-page="user"] .composer-status,
body[data-shell-page="admin"] .composer-status,
body[data-shell-page="unified"] .composer-status {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  line-height: 1.5;
}

body[data-shell-page="user"] .composer-tip,
body[data-shell-page="admin"] .composer-tip,
body[data-shell-page="unified"] .composer-tip {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(217, 204, 183, 0.6);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(102, 78, 39, 0.88);
  font-size: 12px;
  line-height: 1.45;
}

body[data-shell-page="user"] .composer-context,
body[data-shell-page="admin"] .composer-context,
body[data-shell-page="unified"] .composer-context,
body[data-shell-page="user"] .composer-meta,
body[data-shell-page="admin"] .composer-meta,
body[data-shell-page="unified"] .composer-meta {
  margin: 0 0 10px;
  gap: 8px;
}

body[data-shell-page="user"] .composer-context-item,
body[data-shell-page="admin"] .composer-context-item,
body[data-shell-page="unified"] .composer-context-item,
body[data-shell-page="user"] .composer-meta-item,
body[data-shell-page="admin"] .composer-meta-item,
body[data-shell-page="unified"] .composer-meta-item {
  border-radius: 14px;
  border: 1px solid rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 12px;
}

body[data-shell-page="admin"] .composer-context-item,
body[data-shell-page="admin"] .composer-meta-item {
  border-color: rgba(201, 144, 57, 0.16);
}

body[data-shell-page="user"] .composer-context-label,
body[data-shell-page="admin"] .composer-context-label,
body[data-shell-page="unified"] .composer-context-label,
body[data-shell-page="user"] .composer-meta-label,
body[data-shell-page="admin"] .composer-meta-label,
body[data-shell-page="unified"] .composer-meta-label {
  font-family: var(--font-ui);
  color: rgba(111, 101, 87, 0.76);
  letter-spacing: 0.08em;
}

body[data-shell-page="user"] .composer-context-value,
body[data-shell-page="admin"] .composer-context-value,
body[data-shell-page="unified"] .composer-context-value,
body[data-shell-page="user"] .composer-meta-value,
body[data-shell-page="admin"] .composer-meta-value,
body[data-shell-page="unified"] .composer-meta-value {
  color: #1f1a16;
}

body[data-shell-page="user"] .composer-row,
body[data-shell-page="admin"] .composer-row,
body[data-shell-page="unified"] .composer-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="admin"] .composer-row textarea,
body[data-shell-page="unified"] .composer-row textarea {
  min-height: 92px;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(217, 204, 183, 0.62);
  box-shadow: inset 0 2px 10px rgba(44, 28, 12, 0.05);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

body[data-shell-page="admin"] .composer-row textarea {
  border-color: rgba(201, 144, 57, 0.18);
}

body[data-shell-page="user"] .composer-row textarea:focus-visible,
body[data-shell-page="admin"] .composer-row textarea:focus-visible,
body[data-shell-page="unified"] .composer-row textarea:focus-visible {
  outline: 2px solid rgba(24, 105, 91, 0.45);
  outline-offset: 2px;
  border-color: rgba(24, 105, 91, 0.42);
  box-shadow:
    inset 0 2px 10px rgba(44, 28, 12, 0.05),
    0 0 0 4px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="admin"] .composer-row textarea:focus-visible {
  outline-color: rgba(201, 144, 57, 0.45);
  border-color: rgba(201, 144, 57, 0.36);
  box-shadow:
    inset 0 2px 10px rgba(44, 28, 12, 0.05),
    0 0 0 4px rgba(201, 144, 57, 0.08);
}

body[data-shell-page="user"] .composer-row button,
body[data-shell-page="admin"] .composer-row button,
body[data-shell-page="unified"] .composer-row button {
  min-width: 116px;
  align-self: stretch;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 24px rgba(24, 105, 91, 0.16);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

body[data-shell-page="user"] .composer-row button:hover,
body[data-shell-page="admin"] .composer-row button:hover,
body[data-shell-page="unified"] .composer-row button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(42, 196, 166, 1) 0%,
    rgba(17, 105, 89, 1) 100%
  );
}

body[data-shell-page="admin"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(201, 144, 57, 1) 0%,
    rgba(88, 52, 15, 1) 100%
  );
}

body[data-shell-page="unified"] .composer-row button {
  background: linear-gradient(
    180deg,
    rgba(42, 196, 166, 1) 0%,
    rgba(17, 105, 89, 1) 100%
  );
}

body[data-shell-page="user"] .composer-hints,
body[data-shell-page="admin"] .composer-hints,
body[data-shell-page="unified"] .composer-hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(101, 91, 78, 0.76);
}

body[data-shell-page="user"] .composer-hints span,
body[data-shell-page="admin"] .composer-hints span,
body[data-shell-page="unified"] .composer-hints span {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 183, 0.56);
  background: rgba(255, 255, 255, 0.96);
}

body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  border-radius: 24px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: rgba(255, 255, 252, 0.96);
  box-shadow: 0 16px 34px rgba(44, 28, 12, 0.06);
}

body[data-shell-page="user"] .chat-detail-content,
body[data-shell-page="admin"] .chat-detail-content,
body[data-shell-page="unified"] .chat-detail-content {
  padding-top: 0;
}

body[data-shell-page="user"] .chat-detail-hero,
body[data-shell-page="user"] .chat-detail-section,
body[data-shell-page="admin"] .chat-detail-hero,
body[data-shell-page="admin"] .chat-detail-section,
body[data-shell-page="unified"] .chat-detail-hero,
body[data-shell-page="unified"] .chat-detail-section {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(217, 204, 183, 0.56);
  box-shadow: 0 10px 22px rgba(44, 28, 12, 0.05);
}

body[data-shell-page="admin"] .chat-detail-hero,
body[data-shell-page="admin"] .chat-detail-section {
  border-color: rgba(201, 144, 57, 0.16);
}

body[data-shell-page="user"] .chat-detail-title,
body[data-shell-page="admin"] .chat-detail-title,
body[data-shell-page="unified"] .chat-detail-title {
  color: #1f1a16;
}

body[data-shell-page="user"] .chat-detail-copy,
body[data-shell-page="admin"] .chat-detail-copy,
body[data-shell-page="unified"] .chat-detail-copy,
body[data-shell-page="user"] .chat-detail-section-title,
body[data-shell-page="admin"] .chat-detail-section-title,
body[data-shell-page="unified"] .chat-detail-section-title {
  color: rgba(90, 77, 62, 0.8);
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="admin"] .conversation-stage,
body[data-shell-page="unified"] .conversation-stage {
  margin: 0 16px 10px;
  padding: 12px 16px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 252, 0.86);
}

body[data-shell-page="user"] .conversation-stage-copy,
body[data-shell-page="admin"] .conversation-stage-copy,
body[data-shell-page="unified"] .conversation-stage-copy {
  max-width: 100%;
}

body[data-shell-page="user"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-title,
body[data-shell-page="unified"] .conversation-stage-title {
  font-size: 18px;
}

body[data-shell-page="user"] .conversation-stage-note,
body[data-shell-page="admin"] .conversation-stage-note,
body[data-shell-page="unified"] .conversation-stage-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="admin"] .conversation-stage-side,
body[data-shell-page="unified"] .conversation-stage-side {
  gap: 6px;
  max-width: 260px;
}

body[data-shell-page="user"] .stage-chip,
body[data-shell-page="admin"] .stage-chip,
body[data-shell-page="unified"] .stage-chip {
  padding: 5px 9px;
  font-size: 10px;
}

body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="admin"] .conversation-tools,
body[data-shell-page="unified"] .conversation-tools {
  margin-top: 0;
}

body[data-shell-page="user"] .hero-glance,
body[data-shell-page="admin"] .hero-glance,
body[data-shell-page="unified"] .hero-glance {
  display: none;
}

body[data-shell-page="user"] .status-cluster,
body[data-shell-page="admin"] .status-cluster,
body[data-shell-page="unified"] .status-cluster {
  display: none;
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="admin"] .guide-panel,
body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="admin"] .chat-detail,
body[data-shell-page="unified"] .chat-detail {
  display: none !important;
}

/* Room-scene tightening pass: keep user/admin closer to a room interior than a dashboard. */
body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar {
  padding: 14px 16px;
  border-radius: 22px;
}

body[data-shell-page="user"] .layout,
body[data-shell-page="admin"] .layout {
  padding: 12px;
  gap: 12px;
  border-radius: 26px;
}

body[data-workspace="chat"] .layout-user-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-workspace="chat"] .layout-admin-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-shell-page="user"] .sidebar-stack,
body[data-shell-page="admin"] .sidebar-stack {
  gap: 10px;
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms {
  min-height: 22vh;
  border-radius: 18px;
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation {
  border-radius: 20px;
  padding: 6px 0 8px;
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="admin"] .conversation-stage {
  margin: 0 12px 8px;
  padding: 11px 14px 10px;
  border-radius: 16px;
  border: 1px solid rgba(140, 245, 212, 0.12);
  background:
    radial-gradient(circle at top left, rgba(140, 245, 212, 0.08) 0, transparent 36%),
    linear-gradient(180deg, rgba(13, 18, 27, 0.96) 0%, rgba(9, 12, 18, 0.98) 100%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

body[data-shell-page="admin"] .conversation-stage {
  border-color: rgba(201, 144, 57, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.1) 0, transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(244, 236, 220, 0.98) 100%);
}

body[data-shell-page="user"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-title {
  font-size: 24px;
  letter-spacing: -0.03em;
}

body[data-shell-page="admin"] .conversation-stage-title {
  font-size: 22px;
}

body[data-shell-page="user"] .conversation-stage-note,
body[data-shell-page="admin"] .conversation-stage-note {
  max-width: 48ch;
  line-height: 1.55;
}

body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="admin"] .conversation-tools {
  margin: 0 12px 8px;
  padding: 0 12px 8px;
  gap: 6px;
}

body[data-shell-page="user"] .conversation-tools select,
body[data-shell-page="admin"] .conversation-tools select,
body[data-shell-page="user"] .conversation-tools button,
body[data-shell-page="admin"] .conversation-tools button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline {
  margin: 0 12px 0;
  padding: 12px;
  border-radius: 16px;
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer {
  margin: 10px 12px 12px;
  padding: 10px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11, 14, 21, 0.98) 0%, rgba(8, 10, 15, 0.98) 100%);
}

body[data-shell-page="admin"] .composer {
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(245, 237, 220, 0.98) 100%);
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="admin"] .composer-row textarea {
  min-height: 68px;
}

body[data-shell-page="user"] .composer-hints span,
body[data-shell-page="admin"] .composer-hints span {
  border-radius: 10px;
  padding: 4px 8px;
}

body[data-shell-page="admin"] .governance-summary,
body[data-shell-page="admin"] .governance-status {
  padding-bottom: 10px;
}

body[data-shell-page="admin"] .governance-details summary {
  padding: 7px 12px;
}

body[data-shell-page="admin"] .governance-roadmap {
  gap: 6px;
  flex-wrap: wrap;
}

body[data-shell-page="admin"] .roadmap-step {
  border-radius: 999px;
  padding: 4px 9px;
}

/* Terminal user-room overrides: 3-column layout (rooms | scene | detail+composer). */
body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
  grid-template-columns: minmax(228px, 260px) minmax(0, 1.4fr) minmax(280px, 360px) !important;
  gap: 12px !important;
}

body[data-shell-page="user"] .rooms {
  min-height: auto !important;
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .thread-status-rail {
  display: none !important;
}

body[data-shell-page="user"] .conversation {
  padding: 12px 12px 10px !important;
  border: 3px solid rgba(44, 28, 18, 0.9) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(164, 96, 52, 0.95) 0%, rgba(104, 58, 31, 0.98) 34%, rgba(31, 19, 12, 0.99) 100%) !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  border: 2px solid rgba(42, 28, 18, 0.78) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(241, 229, 201, 0.96) 0%, rgba(218, 196, 160, 0.98) 100%) !important;
}

body[data-shell-page="user"] .room-scene {
  margin-bottom: 10px !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 0 12px !important;
  padding: 14px !important;
  max-height: clamp(220px, 30vh, 340px) !important;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.98) 0%, rgba(27, 18, 12, 0.98) 100%) !important;
  border: 2px solid rgba(255, 214, 153, 0.12) !important;
}

body[data-shell-page="user"] .message {
  background: linear-gradient(180deg, rgba(46, 33, 23, 0.96) 0%, rgba(26, 18, 12, 0.98) 100%) !important;
  color: #f6ebdc !important;
  border-color: rgba(255, 211, 148, 0.14) !important;
}

body[data-shell-page="user"] .message.self {
  background: linear-gradient(180deg, rgba(32, 69, 58, 0.98) 0%, rgba(16, 39, 33, 0.98) 100%) !important;
  border-color: rgba(129, 223, 183, 0.22) !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 !important;
  padding: 12px 12px 14px !important;
  border: 2px solid rgba(255, 214, 153, 0.16) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(248, 240, 221, 0.98) 0%, rgba(232, 216, 186, 0.98) 100%) !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 82px !important;
  background: rgba(255, 252, 245, 0.98) !important;
  border-color: rgba(84, 56, 35, 0.16) !important;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(244, 171, 60, 1) 0%, rgba(151, 91, 27, 1) 100%) !important;
}

@media (max-width: 960px) {
  body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
    grid-template-columns: minmax(228px, 260px) minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-detail {
    display: none !important;
  }

  body[data-shell-page="user"] .room-scene-viewport {
    height: 260px;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
    grid-template-columns: 1fr !important;
  }
}

/* Final user-room override: 3-column pixel-room layout (rooms | scene | detail+composer). */
body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
  grid-template-columns: minmax(228px, 260px) minmax(0, 1.4fr) minmax(280px, 360px) !important;
  gap: 12px !important;
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .thread-status-rail {
  display: none !important;
}

body[data-shell-page="user"] .conversation {
  padding: 12px 12px 10px !important;
  border: 3px solid rgba(44, 28, 18, 0.9) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(164, 96, 52, 0.95) 0%, rgba(104, 58, 31, 0.98) 34%, rgba(31, 19, 12, 0.99) 100%) !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  border: 2px solid rgba(42, 28, 18, 0.78) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(241, 229, 201, 0.96) 0%, rgba(218, 196, 160, 0.98) 100%) !important;
}

body[data-shell-page="user"] .room-scene {
  display: block;
  margin-bottom: 10px;
}

body[data-shell-page="user"] .timeline {
  margin: 0 0 12px !important;
  padding: 14px !important;
  max-height: clamp(220px, 30vh, 340px) !important;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.98) 0%, rgba(27, 18, 12, 0.98) 100%) !important;
  border: 2px solid rgba(255, 214, 153, 0.12) !important;
}

body[data-shell-page="user"] .message {
  background: linear-gradient(180deg, rgba(46, 33, 23, 0.96) 0%, rgba(26, 18, 12, 0.98) 100%) !important;
  color: #f6ebdc !important;
  border-color: rgba(255, 211, 148, 0.14) !important;
}

body[data-shell-page="user"] .message.self {
  background: linear-gradient(180deg, rgba(32, 69, 58, 0.98) 0%, rgba(16, 39, 33, 0.98) 100%) !important;
  border-color: rgba(129, 223, 183, 0.22) !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 !important;
  padding: 12px 12px 14px !important;
  border: 2px solid rgba(255, 214, 153, 0.16) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(248, 240, 221, 0.98) 0%, rgba(232, 216, 186, 0.98) 100%) !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 82px !important;
  background: rgba(255, 252, 245, 0.98) !important;
  border-color: rgba(84, 56, 35, 0.16) !important;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(244, 171, 60, 1) 0%, rgba(151, 91, 27, 1) 100%) !important;
}

@media (max-width: 960px) {
  body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
    grid-template-columns: minmax(228px, 260px) minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-detail {
    display: none !important;
  }

  body[data-shell-page="user"] .rooms {
    min-height: auto !important;
  }

  body[data-shell-page="user"] .room-scene-viewport {
    height: 260px;
  }

  body[data-shell-page="user"] .conversation {
    padding: 10px !important;
  }
}

body[data-shell-page="user"] {
  color-scheme: dark;
  --bg: #120d0a;
  --panel: #1f1812;
  --panel-soft: #2b2118;
  --panel-strong: #32271d;
  --ink: #f4efe6;
  --muted: #d1c2ae;
  --line: rgba(255, 231, 201, 0.14);
  --accent: #ffcf78;
  --accent-strong: #f4b84c;
  --accent-soft: rgba(255, 207, 120, 0.14);
  --warning: #ffbe67;
  --danger: #ff7c66;
  --shadow: 0 22px 44px rgba(12, 7, 4, 0.42);
  background:
    radial-gradient(circle at 16% 0%, rgba(247, 191, 122, 0.2) 0, transparent 28%),
    radial-gradient(circle at 84% 4%, rgba(123, 159, 255, 0.15) 0, transparent 24%),
    linear-gradient(180deg, #1a120d 0%, #120d0a 56%, #080605 100%);
}

body[data-shell-page="user"] .app {
  max-width: 1480px;
  padding: 12px;
}

body[data-shell-page="user"] .topbar {
  padding: 8px 14px;
  margin-bottom: 8px;
  background:
    linear-gradient(180deg, rgba(12, 10, 12, 0.96) 0%, rgba(22, 15, 12, 0.96) 100%);
  border: 2px solid rgba(255, 210, 143, 0.16);
  border-radius: 20px;
  box-shadow: 0 16px 30px rgba(10, 5, 3, 0.45);
}

body[data-shell-page="user"] .masthead {
  max-width: none;
  gap: 2px;
}

body[data-shell-page="user"] .eyebrow {
  display: none;
}

body[data-shell-page="user"] h1 {
  font-size: clamp(18px, 2.2vw, 24px);
}

body[data-shell-page="user"] .hero-note {
  display: none;
}

body[data-shell-page="user"] .hero-callout {
  margin-top: 8px;
  background: rgba(247, 233, 210, 0.94);
  border-color: rgba(39, 24, 15, 0.1);
}

body[data-shell-page="user"] .hero-callout strong {
  color: #8e5d1f;
}

body[data-shell-page="user"] .hero-callout p {
  color: #2a2016;
}

body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(228px, 260px) minmax(0, 1.4fr) minmax(280px, 360px);
  gap: 12px;
  align-items: stretch;
  background:
    linear-gradient(180deg, rgba(90, 57, 32, 0.88) 0%, rgba(54, 36, 23, 0.94) 100%);
  border: 2px solid rgba(255, 210, 143, 0.14);
  padding: 12px;
  border-radius: 24px;
}

body[data-shell-page="user"] .sidebar-stack-user {
  gap: 10px;
}

body[data-shell-page="user"] .rooms {
  background:
    linear-gradient(180deg, rgba(217, 201, 164, 0.98) 0%, rgba(190, 170, 132, 0.96) 100%);
  border: 3px solid rgba(39, 24, 15, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 217, 0.55),
    0 14px 28px rgba(20, 11, 7, 0.32);
  border-radius: 18px;
  padding: 10px;
  min-height: calc(100vh - 168px);
}

body[data-shell-page="user"] .pixel-menu {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

body[data-shell-page="user"] .pixel-menu-item {
  appearance: none;
  border: 2px solid rgba(43, 28, 18, 0.84);
  background: linear-gradient(180deg, rgba(235, 224, 199, 0.96) 0%, rgba(211, 191, 154, 0.96) 100%);
  color: #22160f;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 250, 238, 0.8);
}

body[data-shell-page="user"] .pixel-menu-item.active {
  background: linear-gradient(180deg, rgba(246, 238, 218, 0.98) 0%, rgba(214, 193, 149, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 230, 0.95),
    0 0 0 2px rgba(255, 205, 126, 0.32);
}

body[data-shell-page="user"] .panel-shell-header {
  align-items: flex-start;
  gap: 10px;
}

body[data-shell-page="user"] .panel-shell-title {
  color: #25160f;
}

body[data-shell-page="user"] .panel-shell-note {
  color: rgba(37, 22, 15, 0.78);
}

body[data-shell-page="user"] .panel-title {
  color: rgba(37, 22, 15, 0.76);
  padding-top: 10px;
}

body[data-shell-page="user"] .room-list {
  gap: 8px;
  margin-top: 4px;
}

body[data-shell-page="user"] .room-button {
  border: 2px solid rgba(58, 35, 21, 0.72);
  background: linear-gradient(180deg, rgba(248, 239, 219, 0.98) 0%, rgba(221, 203, 171, 0.98) 100%);
  color: #1f140e;
  box-shadow: inset 0 1px 0 rgba(255, 249, 236, 0.82);
}

body[data-shell-page="user"] .room-button.active {
  border-color: rgba(255, 201, 102, 0.88);
  background: linear-gradient(180deg, rgba(255, 242, 213, 0.99) 0%, rgba(239, 210, 155, 0.99) 100%);
}

body[data-shell-page="user"] .room-button.room-button-unread {
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 236, 0.82),
    0 0 0 2px rgba(255, 208, 113, 0.22);
}

body[data-shell-page="user"] .conversation {
  padding: 12px 12px 10px;
  border: 3px solid rgba(44, 28, 18, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(164, 96, 52, 0.95) 0%, rgba(104, 58, 31, 0.98) 34%, rgba(31, 19, 12, 0.99) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 214, 153, 0.12),
    0 18px 34px rgba(16, 9, 5, 0.38);
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 2px solid rgba(42, 28, 18, 0.78);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(241, 229, 201, 0.96) 0%, rgba(218, 196, 160, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 238, 0.78),
    0 10px 22px rgba(13, 7, 4, 0.18);
}

body[data-shell-page="user"] .conversation-stage-copy {
  gap: 4px;
}

body[data-shell-page="user"] .conversation-stage-title {
  color: #23160f;
  letter-spacing: -0.02em;
}

body[data-shell-page="user"] .conversation-stage-note {
  color: rgba(35, 22, 15, 0.72);
}

body[data-shell-page="user"] .stage-chip {
  background: rgba(45, 31, 19, 0.12);
  color: #2d1f13;
  border-color: rgba(45, 31, 19, 0.18);
}

body[data-shell-page="user"] .room-scene {
  margin-bottom: 10px;
  padding: 10px 10px 12px;
  border-radius: 18px;
  border: 2px solid rgba(34, 20, 12, 0.82);
  background:
    linear-gradient(180deg, rgba(120, 74, 38, 0.95) 0%, rgba(88, 51, 28, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 175, 0.1),
    0 10px 20px rgba(13, 7, 4, 0.18);
}

body[data-shell-page="user"] .room-scene-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

body[data-shell-page="user"] .room-scene-label {
  color: #f4e0b6;
  font-size: 12px;
  letter-spacing: 0.16em;
}

body[data-shell-page="user"] .room-scene-chip {
  color: rgba(255, 235, 207, 0.68);
  font-size: 11px;
}

body[data-shell-page="user"] .room-scene-viewport {
  position: relative;
  height: clamp(220px, 36vw, 420px);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(37, 20, 12, 0.9);
  background:
    linear-gradient(180deg, #7d4a27 0%, #7d4a27 26%, #d7bf8d 26%, #d7bf8d 58%, #7b4c2f 58%, #7b4c2f 100%);
}

body[data-shell-page="user"] .room-scene-wall {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(70, 37, 20, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 234, 194, 0.06);
}

body[data-shell-page="user"] .room-scene-wall-left {
  left: 23%;
}

body[data-shell-page="user"] .room-scene-wall-mid {
  left: 62%;
}

body[data-shell-page="user"] .room-scene-wall-right {
  right: 9%;
}

body[data-shell-page="user"] .room-scene-screen {
  position: absolute;
  left: 8%;
  top: 12%;
  width: min(46%, 420px);
  padding: 14px 16px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(248, 240, 217, 0.98) 0%, rgba(239, 228, 200, 0.96) 100%);
  border: 2px solid rgba(55, 34, 22, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 240, 0.9),
    0 10px 18px rgba(15, 8, 5, 0.2);
}

body[data-shell-page="user"] .room-scene-screen-top {
  font-family: var(--font-mono);
  color: rgba(48, 32, 20, 0.72);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

body[data-shell-page="user"] .room-scene-screen-title {
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.1;
  color: #2e1d12;
  margin-bottom: 8px;
}

body[data-shell-page="user"] .room-scene-screen-copy {
  color: rgba(46, 29, 18, 0.78);
  line-height: 1.5;
  max-width: 24ch;
}

body[data-shell-page="user"] .room-scene-desk,
body[data-shell-page="user"] .room-scene-sofa,
body[data-shell-page="user"] .room-scene-server,
body[data-shell-page="user"] .room-scene-lamp {
  position: absolute;
  border: 2px solid rgba(48, 28, 18, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.3);
}

body[data-shell-page="user"] .room-scene-desk {
  left: 44%;
  top: 52%;
  width: 18%;
  height: 13%;
  border-radius: 10px;
  background: linear-gradient(180deg, #7f4e2d 0%, #5b341d 100%);
}

body[data-shell-page="user"] .room-scene-sofa {
  right: 12%;
  top: 48%;
  width: 20%;
  height: 18%;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #e2b67f 0%, #bf8d58 100%);
}

body[data-shell-page="user"] .room-scene-server {
  right: 7%;
  top: 12%;
  width: 18%;
  height: 32%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.9) 0 18%, transparent 18% 22%, rgba(8, 8, 8, 0.9) 22% 40%, transparent 40% 44%, rgba(8, 8, 8, 0.9) 44% 60%, transparent 60% 64%, rgba(8, 8, 8, 0.9) 64% 82%, transparent 82% 100%),
    linear-gradient(180deg, #0e0e10 0%, #20211d 100%);
}

body[data-shell-page="user"] .room-scene-lamp {
  left: 25%;
  top: 64%;
  width: 4%;
  height: 18%;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5cf88 0%, #a86c2f 100%);
}

body[data-shell-page="user"] .timeline {
  margin: 0 0 12px;
  padding: 14px;
  max-height: clamp(220px, 30vh, 340px);
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.98) 0%, rgba(27, 18, 12, 0.98) 100%);
  border: 2px solid rgba(255, 214, 153, 0.12);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 238, 208, 0.05);
}

body[data-shell-page="user"] .timeline-empty,
body[data-shell-page="user"] .timeline-divider {
  color: rgba(255, 229, 191, 0.82);
}

body[data-shell-page="user"] .message {
  background: linear-gradient(180deg, rgba(46, 33, 23, 0.96) 0%, rgba(26, 18, 12, 0.98) 100%);
  color: #f6ebdc;
  border-color: rgba(255, 211, 148, 0.14);
}

body[data-shell-page="user"] .message.self {
  background: linear-gradient(180deg, rgba(32, 69, 58, 0.98) 0%, rgba(16, 39, 33, 0.98) 100%);
  border-color: rgba(129, 223, 183, 0.22);
}

body[data-shell-page="user"] .message-header,
body[data-shell-page="user"] .message-time {
  color: rgba(255, 235, 207, 0.72);
}

body[data-shell-page="user"] .message-sender {
  color: #fff6e8;
}

body[data-shell-page="user"] .message-role {
  background: rgba(255, 235, 207, 0.12);
  color: rgba(255, 235, 207, 0.82);
}

body[data-shell-page="user"] .message-body {
  color: #fbf4ea;
}

body[data-shell-page="user"] .conversation-tools {
  margin: 0 0 8px;
  padding: 0;
}

body[data-shell-page="user"] .conversation-tools select,
body[data-shell-page="user"] .conversation-tools button {
  background: rgba(35, 23, 15, 0.92);
  color: #ffe7c2;
  border-color: rgba(255, 214, 153, 0.18);
}

body[data-shell-page="user"] .conversation-tools button.secondary {
  background: rgba(248, 231, 201, 0.96);
  color: #29170f;
}

body[data-shell-page="user"] .composer {
  margin: 0;
  padding: 12px 12px 14px;
  border: 2px solid rgba(255, 214, 153, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 240, 221, 0.98) 0%, rgba(232, 216, 186, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 240, 0.9),
    0 16px 28px rgba(10, 6, 4, 0.2);
}

body[data-shell-page="user"] .identity-row label {
  color: rgba(44, 27, 16, 0.78);
}

body[data-shell-page="user"] .identity-row input {
  background: rgba(255, 250, 240, 0.96);
  color: #2c1a10;
  border-color: rgba(84, 56, 35, 0.14);
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 82px;
  background: rgba(255, 252, 245, 0.98);
  border-color: rgba(84, 56, 35, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(244, 171, 60, 1) 0%, rgba(151, 91, 27, 1) 100%);
  color: #fff7eb;
  border-radius: 12px;
}

body[data-shell-page="user"] .composer-hints span {
  border-color: rgba(84, 56, 35, 0.16);
  background: rgba(255, 250, 240, 0.74);
  color: rgba(46, 29, 18, 0.76);
}

body[data-shell-page="user"] .chat-detail {
  display: none;
}

body[data-shell-page="user"] .mode-banner {
  background: rgba(255, 233, 199, 0.12);
  color: rgba(255, 233, 199, 0.86);
  border-color: rgba(255, 233, 199, 0.16);
}

body[data-shell-page="user"] .chat-quick-links button {
  background: rgba(255, 241, 217, 0.12);
  color: rgba(255, 236, 208, 0.88);
  border-color: rgba(255, 236, 208, 0.12);
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .thread-status-rail {
  display: none !important;
}

body[data-workspace="chat"] .layout-user-shell,
body[data-workspace="chat"] .layout-admin-shell,
body[data-workspace="chat"] .layout-unified-shell {
  grid-template-columns: 220px minmax(0, 1fr) !important;
}

body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="admin"] .conversation-stage-side,
body[data-shell-page="unified"] .conversation-stage-side {
  display: none;
}

body[data-shell-page="user"] .governance > .governance-block,
body[data-shell-page="admin"] .governance > .governance-block,
body[data-shell-page="unified"] .governance > .governance-block {
  display: none;
}

body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar,
body[data-shell-page="unified"] .topbar {
  padding: 16px 18px;
  margin-bottom: 12px;
}

body[data-shell-page="user"] .masthead,
body[data-shell-page="admin"] .masthead,
body[data-shell-page="unified"] .masthead {
  gap: 4px;
}

body[data-shell-page="user"] .topbar-main,
body[data-shell-page="admin"] .topbar-main,
body[data-shell-page="unified"] .topbar-main {
  gap: 8px;
}

body[data-shell-page="user"] .hero-note,
body[data-shell-page="admin"] .hero-note,
body[data-shell-page="unified"] .hero-note {
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.5;
}

body[data-shell-page="user"] .hero-glance,
body[data-shell-page="admin"] .hero-glance,
body[data-shell-page="unified"] .hero-glance {
  display: none !important;
}

@media (max-width: 960px) {
  body[data-shell-page="user"] .hero-glance,
  body[data-shell-page="admin"] .hero-glance,
  body[data-shell-page="unified"] .hero-glance,
  body[data-shell-page="user"] .layout,
  body[data-shell-page="admin"] .layout,
  body[data-shell-page="unified"] .layout,
  body[data-shell-page="user"] .conversation-stage,
  body[data-shell-page="admin"] .conversation-stage,
  body[data-shell-page="unified"] .conversation-stage,
  body[data-shell-page="user"] .thread-status-rail,
  body[data-shell-page="admin"] .thread-status-rail,
  body[data-shell-page="unified"] .thread-status-rail,
  body[data-shell-page="user"] .composer-context,
  body[data-shell-page="admin"] .composer-context,
  body[data-shell-page="unified"] .composer-context,
  body[data-shell-page="user"] .composer-meta,
  body[data-shell-page="admin"] .composer-meta,
  body[data-shell-page="unified"] .composer-meta {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  body[data-shell-page="user"] .conversation-stage-side,
  body[data-shell-page="admin"] .conversation-stage-side,
  body[data-shell-page="unified"] .conversation-stage-side {
    max-width: none;
    justify-content: flex-start;
  }

  body[data-shell-page="user"] .composer-row,
  body[data-shell-page="admin"] .composer-row,
  body[data-shell-page="unified"] .composer-row {
    grid-template-columns: 1fr;
  }

  body[data-shell-page="user"] .composer-row button,
  body[data-shell-page="admin"] .composer-row button,
  body[data-shell-page="unified"] .composer-row button {
    min-height: 48px;
  }
}

/* IA cleanup: user stays chat-only; admin is a minimal owner panel; unified is the linear world backend. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .chat-detail {
  display: none !important;
}

body[data-shell-page="admin"] .guide-panel {
  display: none !important;
}

body[data-shell-page="admin"] .governance {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .governance-details {
  display: block !important;
}

body[data-shell-page="admin"] .governance-roadmap {
  display: flex;
}

body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="unified"] .chat-detail {
  display: none !important;
}

.compact-guide-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

body[data-shell-page="unified"] .auth {
  display: block !important;
}

body[data-shell-page="unified"] .governance {
  display: block !important;
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="unified"] .governance > .governance-block {
  display: block !important;
}

body[data-shell-page="unified"] .governance-roadmap {
  display: flex;
}

.governance-roadmap {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 14px;
}

.roadmap-step {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 183, 0.58);
  background: rgba(255, 255, 255, 0.94);
  color: rgba(90, 77, 62, 0.86);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
}

body[data-shell-page="admin"] .roadmap-step {
  border-color: rgba(201, 144, 57, 0.18);
  background: rgba(255, 251, 242, 0.96);
  color: rgba(126, 77, 8, 0.88);
}

body[data-shell-page="unified"] .roadmap-step {
  border-color: rgba(24, 105, 91, 0.16);
  background: rgba(245, 252, 249, 0.96);
  color: rgba(24, 105, 91, 0.82);
}

body[data-shell-page="admin"] .governance-summary,
body[data-shell-page="admin"] .governance-status,
body[data-shell-page="unified"] .governance-summary,
body[data-shell-page="unified"] .governance-status {
  padding-bottom: 10px;
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="user"] .composer,
body[data-shell-page="user"] .room-button,
body[data-shell-page="user"] .message,
body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="user"] .glance-card,
body[data-shell-page="user"] .conversation-overview {
  border-radius: 12px;
}

body[data-shell-page="user"] .badge,
body[data-shell-page="user"] .stage-chip,
body[data-shell-page="user"] .composer-hints span {
  border-radius: 10px;
}

body[data-shell-page="user"] .room-avatar {
  border-radius: 10px;
}

/* Round 2 projection skin: keep H5 closer to the TUI room interior. */
body[data-shell-page="user"],
body[data-shell-page="unified"] {
  color-scheme: dark;
  --bg: #04060a;
  --panel: #0d1118;
  --panel-soft: #131926;
  --panel-strong: #182131;
  --ink: #f3efe6;
  --muted: #99a3b3;
  --line: rgba(154, 171, 201, 0.18);
  --accent: #8cf5d4;
  --accent-strong: #66dbc2;
  --accent-soft: rgba(140, 245, 212, 0.14);
  --warning: #efc26e;
  --danger: #ff7a7a;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.44);
  background:
    radial-gradient(circle at top, rgba(65, 91, 138, 0.2) 0, transparent 34%),
    radial-gradient(circle at 18% 12%, rgba(140, 245, 212, 0.1) 0, transparent 22%),
    linear-gradient(180deg, #04060a 0%, #0b1017 54%, #05070b 100%);
}

body[data-shell-page="admin"] {
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.16) 0, transparent 24%),
    radial-gradient(circle at 14% 10%, rgba(63, 176, 147, 0.05) 0, transparent 22%),
    linear-gradient(180deg, #f2ead9 0%, #e6dac2 100%);
}

body[data-shell-page="user"] .topbar,
body[data-shell-page="unified"] .topbar {
  border-color: rgba(140, 245, 212, 0.18);
  background:
    radial-gradient(circle at top left, rgba(244, 248, 255, 0.07) 0, transparent 28%),
    linear-gradient(180deg, rgba(14, 18, 28, 0.96) 0%, rgba(9, 12, 18, 0.96) 100%);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.36);
}

body[data-shell-page="user"] .layout,
body[data-shell-page="unified"] .layout {
  background:
    radial-gradient(circle at top left, rgba(140, 245, 212, 0.08) 0, transparent 24%),
    linear-gradient(180deg, rgba(10, 14, 21, 0.96) 0%, rgba(7, 10, 15, 0.94) 100%);
  border: 1px solid rgba(140, 245, 212, 0.14);
  box-shadow: 0 30px 64px rgba(0, 0, 0, 0.34);
}

body[data-shell-page="user"] .panel,
body[data-shell-page="unified"] .panel {
  border-color: rgba(140, 245, 212, 0.12);
  background: linear-gradient(180deg, rgba(13, 16, 25, 0.96) 0%, rgba(9, 12, 19, 0.98) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

body[data-shell-page="user"] .workspace-switcher {
  display: none !important;
}

body[data-shell-page="unified"] .workspace-switcher {
  background: rgba(10, 14, 21, 0.9);
  border-color: rgba(140, 245, 212, 0.14);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .room-toolbar,
body[data-shell-page="user"] .composer-hero,
body[data-shell-page="user"] .composer-context,
body[data-shell-page="user"] .composer-meta,
body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="unified"] .composer-context,
body[data-shell-page="unified"] .composer-meta {
  display: none !important;
}

body[data-shell-page="unified"] .governance,
body[data-shell-page="unified"] .auth {
  opacity: 0.88;
  border-color: rgba(140, 245, 212, 0.1);
}

body[data-shell-page="unified"] .conversation-tools {
  display: none !important;
}

body[data-shell-page="unified"] .room-toolbar {
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.98) 0%, rgba(10, 13, 20, 0.96) 100%);
  border-bottom-color: rgba(140, 245, 212, 0.12);
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="unified"] .rooms {
  border-color: rgba(140, 245, 212, 0.12);
  background: linear-gradient(180deg, rgba(11, 14, 20, 0.98) 0%, rgba(8, 10, 15, 0.98) 100%);
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="unified"] .conversation {
  border-color: rgba(140, 245, 212, 0.16);
  background:
    radial-gradient(circle at top left, rgba(140, 245, 212, 0.06) 0, transparent 22%),
    linear-gradient(180deg, rgba(11, 14, 20, 0.98) 0%, rgba(8, 10, 16, 0.98) 100%);
}

body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="unified"] .conversation-overview,
body[data-shell-page="user"] .meta,
body[data-shell-page="unified"] .meta {
  border-color: rgba(140, 245, 212, 0.12);
  background: rgba(11, 14, 21, 0.92);
  color: rgba(238, 244, 247, 0.86);
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="unified"] .timeline {
  border-color: rgba(140, 245, 212, 0.12);
  background: linear-gradient(180deg, rgba(9, 12, 18, 0.88) 0%, rgba(6, 8, 13, 0.9) 100%);
}

body[data-shell-page="user"] .message,
body[data-shell-page="unified"] .message {
  border-color: rgba(140, 245, 212, 0.12);
  background: linear-gradient(180deg, rgba(16, 20, 29, 0.96) 0%, rgba(10, 13, 20, 0.98) 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

body[data-shell-page="user"] .message.self,
body[data-shell-page="unified"] .message.self {
  border-color: rgba(140, 245, 212, 0.22);
  background: linear-gradient(180deg, rgba(16, 42, 39, 0.98) 0%, rgba(12, 32, 31, 0.98) 100%);
}

body[data-shell-page="user"] .message-body,
body[data-shell-page="unified"] .message-body {
  color: rgba(245, 242, 233, 0.96);
}

body[data-shell-page="user"] .message-header,
body[data-shell-page="unified"] .message-header {
  color: rgba(156, 173, 196, 0.75);
}

body[data-shell-page="user"] .conversation-overview .pill-muted,
body[data-shell-page="unified"] .conversation-overview .pill-muted {
  background: rgba(140, 245, 212, 0.09);
  color: rgba(140, 245, 212, 0.82);
}

body[data-shell-page="user"] .conversation-overview .pill-accent,
body[data-shell-page="unified"] .conversation-overview .pill-accent {
  background: rgba(140, 245, 212, 0.14);
  color: #c5fff0;
}

body[data-shell-page="user"] .composer,
body[data-shell-page="unified"] .composer {
  border-color: rgba(140, 245, 212, 0.16);
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.98) 0%, rgba(8, 11, 16, 0.98) 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="unified"] .composer-row textarea {
  border-color: rgba(140, 245, 212, 0.24);
  background: rgba(8, 11, 17, 0.98);
  color: var(--ink);
  box-shadow:
    inset 0 2px 10px rgba(140, 245, 212, 0.06),
    0 0 0 1px rgba(140, 245, 212, 0.06);
}

body[data-shell-page="user"] .composer-row button,
body[data-shell-page="unified"] .composer-row button {
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(140, 245, 212, 1) 0%, rgba(38, 141, 118, 1) 100%);
  color: #05110d;
  box-shadow: 0 12px 24px rgba(38, 141, 118, 0.28);
}

body[data-shell-page="admin"] .topbar,
body[data-shell-page="admin"] .layout,
body[data-shell-page="admin"] .panel,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="admin"] .timeline,
body[data-shell-page="admin"] .composer {
  border-color: rgba(120, 93, 36, 0.16);
}

body[data-shell-page="admin"] .topbar {
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.16) 0, transparent 24%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(245, 237, 220, 0.96) 100%);
  box-shadow: 0 20px 42px rgba(55, 34, 11, 0.12);
}

body[data-shell-page="admin"] .layout {
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.11) 0, transparent 26%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(245, 238, 224, 0.96) 100%);
}

body[data-shell-page="admin"] .conversation {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98) 0%, rgba(244, 235, 218, 0.96) 100%);
}

body[data-shell-page="admin"] .timeline {
  background: rgba(255, 255, 252, 0.76);
}

body[data-shell-page="admin"] .conversation-tools,
body[data-shell-page="admin"] .room-toolbar {
  padding-left: 14px;
  padding-right: 14px;
}

body[data-shell-page="admin"] .governance-roadmap {
  gap: 0;
  flex-wrap: nowrap;
  padding: 8px 12px;
  margin: 0 0 10px;
  border-radius: 14px;
  background: rgba(255, 251, 242, 0.6);
  border: 1.5px solid rgba(201, 144, 57, 0.14);
}

body[data-shell-page="admin"] .roadmap-step {
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 600;
  color: rgba(126, 77, 8, 0.55);
  border: 0;
  background: transparent;
}

body[data-shell-page="admin"] .roadmap-step + .roadmap-step {
  position: relative;
  margin-left: 4px;
  padding-left: 16px;
}

body[data-shell-page="admin"] .roadmap-step + .roadmap-step::before {
  content: "→";
  position: absolute;
  left: 0;
  font-size: 10px;
  color: rgba(201, 144, 57, 0.3);
}

body[data-shell-page="unified"] .governance-roadmap {
  gap: 0;
  flex-wrap: nowrap;
  padding: 8px 12px;
  margin: 0 0 10px;
  border-radius: 14px;
  background: rgba(245, 252, 249, 0.6);
  border: 1.5px solid rgba(24, 105, 91, 0.14);
}

body[data-shell-page="unified"] .roadmap-step {
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 600;
  color: rgba(24, 105, 91, 0.55);
  border: 0;
  background: transparent;
}

body[data-shell-page="unified"] .roadmap-step + .roadmap-step {
  position: relative;
  margin-left: 4px;
  padding-left: 16px;
}

body[data-shell-page="unified"] .roadmap-step + .roadmap-step::before {
  content: "→";
  position: absolute;
  left: 0;
  font-size: 10px;
  color: rgba(24, 105, 91, 0.3);
}

/* Room/city shell refinement: keep the user page tight and make admin/unified read as linear stacks. */
body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(208px, 236px) minmax(0, 1fr);
  gap: 10px;
}

body[data-shell-page="user"] .rooms {
  min-height: calc(100vh - 176px);
  padding: 10px;
}

body[data-shell-page="user"] .conversation {
  padding: 10px 10px 8px;
}

body[data-shell-page="user"] .conversation-stage {
  margin-bottom: 10px;
}

body[data-shell-page="user"] .composer {
  margin: 10px 10px 10px;
}

body[data-shell-page="user"] .governance {
  display: none !important;
}

body[data-shell-page="admin"] .governance > .governance-block,
body[data-shell-page="unified"] .governance > .governance-block {
  display: block !important;
  opacity: 1;
  background: transparent;
  border-top: 1px solid rgba(217, 204, 183, 0.34);
  margin-top: 0;
  padding: 12px 16px 10px;
}

body[data-shell-page="admin"] .governance > .governance-block:first-of-type,
body[data-shell-page="unified"] .governance > .governance-block:first-of-type {
  border-top: 0;
  margin-top: 4px;
}

body[data-shell-page="admin"] .governance-details,
body[data-shell-page="unified"] .governance-details {
  display: block !important;
  margin: 8px 16px 12px;
}

body[data-shell-page="admin"] .governance-details summary,
body[data-shell-page="unified"] .governance-details summary {
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 12px;
}

body[data-shell-page="admin"] .governance-roadmap,
body[data-shell-page="unified"] .governance-roadmap {
  display: flex;
  margin: 4px 16px 8px;
  padding: 8px 16px 10px;
}

body[data-shell-page="admin"] .governance-summary,
body[data-shell-page="admin"] .governance-status,
body[data-shell-page="unified"] .governance-summary,
body[data-shell-page="unified"] .governance-status {
  color: rgba(29, 26, 23, 0.68);
}

body[data-shell-page="admin"] .governance,
body[data-shell-page="unified"] .governance {
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .layout-admin-shell,
body[data-shell-page="unified"] .layout-unified-shell {
  gap: 12px;
}

body[data-shell-page="admin"] .governance-block {
  padding: 0 14px 8px;
}

/* ── Governance section step markers and dividers ── */

body[data-shell-page="admin"] .governance > .governance-block,
body[data-shell-page="unified"] .governance > .governance-block {
  position: relative;
  padding: 14px 16px 12px;
  border-top: 2px solid rgba(217, 204, 183, 0.22);
  margin-top: 0;
}

body[data-shell-page="admin"] .governance > .governance-block .section-label,
body[data-shell-page="unified"] .governance > .governance-block .section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(29, 26, 23, 0.82);
}

body[data-shell-page="admin"] .governance > .governance-block .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block .section-label::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1.5px solid rgba(201, 144, 57, 0.28);
  background: rgba(255, 251, 242, 0.96);
  text-align: center;
  line-height: 22px;
  font-size: 10px;
  font-weight: 800;
  color: rgba(126, 77, 8, 0.72);
  flex-shrink: 0;
}

body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(1) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(1) .section-label::before { content: "1"; }
body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(2) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(2) .section-label::before { content: "2"; }
body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(3) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(3) .section-label::before { content: "3"; }
body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(4) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(4) .section-label::before { content: "4"; }
body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(5) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(5) .section-label::before { content: "5"; }
body[data-shell-page="admin"] .governance > .governance-block:nth-of-type(6) .section-label::before,
body[data-shell-page="unified"] .governance > .governance-block:nth-of-type(6) .section-label::before { content: "6"; }

body[data-shell-page="unified"] .governance > .governance-block .section-label::before {
  border-color: rgba(24, 105, 91, 0.22);
  background: rgba(245, 252, 249, 0.96);
  color: rgba(24, 105, 91, 0.72);
}

/* ── Governance block collapsible details styling ── */

body[data-shell-page="admin"] .governance > details.governance-block,
body[data-shell-page="unified"] .governance > details.governance-block {
  border-top: 2px solid rgba(217, 204, 183, 0.22);
  padding: 0;
  margin: 0;
}

body[data-shell-page="admin"] .governance > details.governance-block:first-of-type,
body[data-shell-page="unified"] .governance > details.governance-block:first-of-type {
  border-top: 0;
}

body[data-shell-page="admin"] .governance > details.governance-block > summary,
body[data-shell-page="unified"] .governance > details.governance-block > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(29, 26, 23, 0.82);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}

body[data-shell-page="admin"] .governance > details.governance-block > summary:hover,
body[data-shell-page="unified"] .governance > details.governance-block > summary:hover {
  background: rgba(255, 251, 242, 0.5);
}

body[data-shell-page="admin"] .governance > details.governance-block > summary::before,
body[data-shell-page="unified"] .governance > details.governance-block > summary::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1.5px solid rgba(201, 144, 57, 0.28);
  background: rgba(255, 251, 242, 0.96);
  text-align: center;
  line-height: 22px;
  font-size: 10px;
  font-weight: 800;
  color: rgba(126, 77, 8, 0.72);
  flex-shrink: 0;
}

body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(1) > summary::before { content: "1"; }
body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(2) > summary::before { content: "2"; }
body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(3) > summary::before { content: "3"; }
body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(4) > summary::before { content: "4"; }
body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(5) > summary::before { content: "5"; }
body[data-shell-page="admin"] .governance > details.governance-block:nth-of-type(6) > summary::before { content: "6"; }

body[data-shell-page="unified"] .governance > details.governance-block > summary::before {
  border-color: rgba(24, 105, 91, 0.22);
  background: rgba(245, 252, 249, 0.96);
  color: rgba(24, 105, 91, 0.72);
}

body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(1) > summary::before { content: "1"; }
body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(2) > summary::before { content: "2"; }
body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(3) > summary::before { content: "3"; }
body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(4) > summary::before { content: "4"; }
body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(5) > summary::before { content: "5"; }
body[data-shell-page="unified"] .governance > details.governance-block:nth-of-type(6) > summary::before { content: "6"; }

body[data-shell-page="admin"] .governance > details.governance-block > ul,
body[data-shell-page="unified"] .governance > details.governance-block > ul {
  padding: 4px 16px 10px;
}

/* ── Discuz-style partition headers ── */

body[data-shell-page="unified"] .governance-partition {
  padding: 8px 16px 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 105, 91, 0.48);
  border-bottom: 1.5px solid rgba(24, 105, 91, 0.12);
}

body[data-shell-page="unified"] .governance-partition:first-child {
  margin-top: 0;
}

body[data-shell-page="admin"] .composer-hero {
  padding: 10px 12px;
}

body[data-shell-page="admin"] .composer-row textarea {
  border-color: rgba(120, 93, 36, 0.18);
  box-shadow:
    inset 0 4px 14px rgba(120, 93, 36, 0.06),
    0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="admin"] .composer-row button {
  background: linear-gradient(180deg, rgba(201, 144, 57, 1) 0%, rgba(104, 63, 18, 1) 100%);
}

body[data-shell-page="admin"] .conversation-overview .pill-muted {
  background: rgba(120, 93, 36, 0.08);
}

body[data-shell-page="admin"] .conversation-overview .pill-accent {
  background: rgba(201, 144, 57, 0.14);
}

body[data-shell-page="admin"] .conversation-overview .pill-warm {
  background: rgba(231, 166, 82, 0.12);
}

body[data-shell-page="admin"] .conversation-overview .pill-danger {
  background: rgba(161, 58, 54, 0.16);
}

/* Round 3 projection skin: keep the hub as a doorplate and trim the room surfaces a bit more. */
body[data-shell-page="hub"] .layout {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

body[data-shell-page="hub"] .sidebar-stack > .panel:not(.guide-panel),
body[data-shell-page="hub"] .conversation {
  display: none !important;
}

body[data-shell-page="hub"] .guide-panel {
  margin-top: 0;
  padding: 20px 24px 24px;
  border-radius: 20px;
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(241, 249, 245, 0.96) 100%
  );
  box-shadow: 0 16px 36px rgba(24, 105, 91, 0.08);
}

body[data-shell-page="hub"] .guide-panel .panel-title {
  font-size: 18px;
  font-weight: 700;
  color: rgba(31, 28, 24, 0.92);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

body[data-shell-page="hub"] .guide-panel .guide-list {
  color: rgba(99, 83, 63, 0.88);
  font-size: 14px;
  line-height: 1.65;
  padding: 0;
}

body[data-shell-page="hub"] .entry-grid {
  gap: 8px;
}

body[data-shell-page="hub"] .entry-card {
  min-height: 104px;
  padding: 12px 13px;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="hub"] .entry-card strong {
  font-size: 15px;
}

body[data-shell-page="hub"] .entry-card span {
  line-height: 1.45;
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="unified"] .conversation {
  border-radius: 18px;
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline,
body[data-shell-page="unified"] .timeline {
  border-radius: 16px;
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  border-radius: 18px;
}

body[data-shell-page="user"] .room-button,
body[data-shell-page="admin"] .room-button,
body[data-shell-page="unified"] .room-button,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="admin"] .conversation-overview,
body[data-shell-page="unified"] .conversation-overview {
  border-radius: 14px;
}

body[data-workspace="chat"] .layout-user-shell {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

body[data-shell-page="user"] .conversation-stage {
  padding: 14px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(250, 255, 253, 0.98) 0%,
    rgba(238, 248, 244, 0.98) 100%
  );
  box-shadow: 0 14px 28px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="user"] .conversation-stage-title {
  font-size: 28px;
  letter-spacing: -0.03em;
}

body[data-shell-page="user"] .conversation-stage-note {
  max-width: 44ch;
}

body[data-shell-page="user"] .conversation {
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(247, 252, 249, 0.98) 100%
  );
  box-shadow: 0 18px 34px rgba(24, 105, 91, 0.06);
}

body[data-shell-page="user"] .composer {
  margin: 10px 14px 14px;
  padding: 12px 14px 14px;
  border-radius: 16px;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 72px;
}

body[data-shell-page="user"] .composer-hints-user {
  justify-content: flex-start;
}
/* User projection final cut: keep only rooms, timeline, composer, and tiny HUD. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .caretaker-panel,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="user"] .room-digest,
body[data-shell-page="user"] .mode-banner,
body[data-shell-page="user"] .room-actions,
body[data-shell-page="user"] .room-scene,
body[data-shell-page="user"] .chat-detail {
  display: none !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 10px 12px 8px;
  gap: 4px;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 26ch;
  font-size: 11px;
  line-height: 1.4;
}


body[data-shell-page="user"] .rooms {
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(247, 252, 249, 0.96) 100%
  );
}

body[data-shell-page="user"] .conversation {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 12px 8px !important;
  padding: 12px 14px 10px !important;
}

body[data-shell-page="user"] .timeline {
  margin-top: 0 !important;
}

body[data-shell-page="user"] .composer {
  margin-top: 8px !important;
}

body[data-shell-page="user"] .identity-row {
  display: none !important;
}

body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: 220px minmax(0, 1.4fr) minmax(320px, 390px) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

body[data-shell-page="user"] .conversation {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: calc(100vh - 176px) !important;
}

body[data-shell-page="user"] .conversation-stage-user {
  margin: 0 !important;
}

body[data-shell-page="user"] .conversation-stream-user {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

body[data-shell-page="user"] .chat-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: calc(100vh - 176px) !important;
  overflow: hidden !important;
}

body[data-shell-page="user"] .chat-detail-shell {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .chat-detail-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 14px 14px !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px !important;
  gap: 6px !important;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 28ch !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-shell-page="user"] .conversation-meta {
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .shell-column-rooms,
body[data-shell-page="user"] .shell-column-detail {
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .layout-user-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail {
    position: static !important;
  }

  body[data-shell-page="user"] .rooms,
  body[data-shell-page="user"] .conversation,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto !important;
  }
}

@media (max-width: 860px) {
  body[data-shell-page="user"] .conversation-overview,
  body[data-shell-page="user"] .overview-workflow-progress,
  body[data-shell-page="user"] .chat-detail-card-workflow {
    min-width: 0 !important;
  }

  body[data-shell-page="user"] .workflow-progress {
    min-width: 0 !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-title {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }

  body[data-shell-page="user"] .workflow-progress-steps {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 2px !important;
  }

  body[data-shell-page="user"] .workflow-progress-step {
    flex: 0 0 clamp(112px, 42vw, 150px) !important;
    padding: 8px 9px !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-marker {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  body[data-shell-page="user"] .workflow-progress-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-workflow {
    gap: 6px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history {
    padding: 9px 10px !important;
    gap: 7px !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-label {
    font-size: 9px !important;
    letter-spacing: 0.12em !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-buttons {
    padding: 2px !important;
    gap: 0 !important;
    border-radius: 13px !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-button {
    min-width: 72px !important;
    padding: 8px 10px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history {
    padding: 8px 9px !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-label {
    font-size: 9px !important;
    padding: 2px 7px !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-buttons {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding: 2px !important;
    gap: 0 !important;
    scrollbar-width: thin !important;
  }

  body[data-shell-page="user"] .quick-action-preview-history-button {
    min-width: 68px !important;
    padding: 7px 9px !important;
    font-size: 10px !important;
  }
}


@media (max-width: 860px) {
  body[data-shell-page="user"] .conversation-overview,
  body[data-shell-page="user"] .overview-workflow-progress,
  body[data-shell-page="user"] .chat-detail-card-workflow {
    min-width: 0 !important;
  }

  body[data-shell-page="user"] .workflow-progress {
    min-width: 0 !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-title {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }

  body[data-shell-page="user"] .workflow-progress-steps {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 2px !important;
  }

  body[data-shell-page="user"] .workflow-progress-step {
    flex: 0 0 clamp(112px, 42vw, 150px) !important;
    padding: 8px 9px !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-marker {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  body[data-shell-page="user"] .workflow-progress-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-workflow {
    gap: 6px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

body[data-shell-page="user"] .chat-detail-card-shell {
  margin: 0 14px 14px !important;
  padding: 14px !important;
  display: grid !important;
  gap: 12px !important;
  border: 1px solid rgba(231, 216, 176, 0.18) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at top left, rgba(240, 201, 107, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(250, 242, 222, 0.98) 0%, rgba(233, 219, 190, 0.98) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 248, 227, 0.55), 0 16px 30px rgba(12, 8, 5, 0.18) !important;
}

body[data-shell-page="user"] .chat-detail-card-head {
  display: grid !important;
  gap: 4px !important;
}

body[data-shell-page="user"] .chat-detail-card-title {
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  color: #2f2214 !important;
}

body[data-shell-page="user"] .chat-detail-card-body {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

body[data-shell-page="user"] .chat-detail-card-avatar {
  width: 72px !important;
  height: 72px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 20px !important;
  border: 1px solid rgba(92, 68, 40, 0.14) !important;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 248, 222, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(161, 109, 46, 0.2) 0%, rgba(86, 56, 26, 0.06) 100%) !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #6d441a !important;
  letter-spacing: 0.08em !important;
}

body[data-shell-page="user"] .chat-detail-card-meta {
  display: grid !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow {
  margin-top: 12px !important;
  display: grid !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .chat-detail-card-preview {
  margin-top: 4px !important;
  padding: 12px !important;
  border-radius: 18px !important;
  border-color: rgba(92, 68, 40, 0.14) !important;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.96) 0%, rgba(247, 236, 213, 0.94) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 24px rgba(82, 47, 16, 0.08) !important;
}

body[data-shell-page="user"] .chat-detail-card-preview .quick-action-preview-card-kicker {
  color: rgba(68, 49, 31, 0.62) !important;
}

body[data-shell-page="user"] .chat-detail-card-preview .quick-action-preview-card-title {
  color: #3b2815 !important;
}

body[data-shell-page="user"] .chat-detail-card-preview .quick-action-preview-card-copy {
  color: rgba(68, 49, 31, 0.78) !important;
}

body[data-shell-page="user"] .chat-detail-card-preview .quick-action-preview-card-row {
  background: rgba(255, 255, 255, 0.76) !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow .workflow-progress-title {
  color: rgba(68, 49, 31, 0.72) !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow .workflow-progress-step {
  background: rgba(255, 250, 239, 0.94) !important;
  border-color: rgba(92, 68, 40, 0.12) !important;
  color: #4b331d !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow .workflow-progress-marker {
  border-color: rgba(92, 68, 40, 0.16) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #6d441a !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow .workflow-progress-step[data-stage-state="current"] {
  border-color: rgba(156, 106, 39, 0.32) !important;
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.96) 0%, rgba(247, 226, 174, 0.96) 100%) !important;
  color: #3b2815 !important;
  box-shadow: 0 10px 18px rgba(82, 47, 16, 0.12) !important;
}

body[data-shell-page="user"] .chat-detail-card-workflow .workflow-progress-step[data-stage-state="current"] .workflow-progress-marker {
  border-color: rgba(156, 106, 39, 0.3) !important;
  background: rgba(255, 248, 229, 0.96) !important;
  color: #6d441a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-workflow .workflow-progress-title {
  color: rgba(24, 58, 86, 0.68) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-workflow .workflow-progress-step {
  background: rgba(242, 249, 255, 0.95) !important;
  border-color: rgba(36, 83, 118, 0.14) !important;
  color: #17324a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-workflow .workflow-progress-marker {
  border-color: rgba(36, 83, 118, 0.16) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #1d5a83 !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-workflow .workflow-progress-step[data-stage-state="current"] {
  border-color: rgba(44, 113, 160, 0.3) !important;
  background: linear-gradient(180deg, rgba(240, 248, 255, 0.98) 0%, rgba(206, 232, 248, 0.98) 100%) !important;
  box-shadow: 0 10px 18px rgba(18, 43, 69, 0.1) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-preview {
  border-color: rgba(36, 83, 118, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(244, 250, 255, 0.98) 0%, rgba(224, 239, 249, 0.96) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 12px 24px rgba(18, 43, 69, 0.08) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-preview .quick-action-preview-card-kicker {
  color: rgba(24, 58, 86, 0.64) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-preview .quick-action-preview-card-title {
  color: #17324a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-preview .quick-action-preview-card-copy {
  color: rgba(24, 58, 86, 0.78) !important;
}

body[data-shell-page="user"] .chat-detail-card-meta-row {
  display: grid !important;
  grid-template-columns: 60px minmax(0, 1fr) !important;
  gap: 10px !important;
  font-size: 12px !important;
}

body[data-shell-page="user"] .chat-detail-card-meta-label {
  color: rgba(68, 49, 31, 0.62) !important;
}

body[data-shell-page="user"] .chat-detail-card-meta-value {
  color: #3c2a18 !important;
  font-weight: 600 !important;
}

body[data-shell-page="user"] .chat-detail-card-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .chat-detail-card-action {
  min-height: 38px !important;
  border: 1px solid rgba(92, 68, 40, 0.14) !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 239, 0.96) !important;
  color: #4b331d !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  cursor: pointer !important;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease !important;
}

body[data-shell-page="user"] .chat-detail-card-action:hover,
body[data-shell-page="user"] .chat-detail-card-action:focus-visible {
  transform: translateY(-1px) !important;
  border-color: rgba(156, 106, 39, 0.42) !important;
  background: rgba(255, 245, 221, 0.98) !important;
  box-shadow: 0 10px 18px rgba(58, 34, 13, 0.14) !important;
}

body[data-shell-page="user"] .chat-detail-card-action.is-active {
  border-color: rgba(156, 106, 39, 0.48) !important;
  background: linear-gradient(180deg, rgba(245, 214, 137, 1) 0%, rgba(208, 147, 61, 0.98) 100%) !important;
  color: #2a1a0d !important;
  box-shadow: 0 12px 20px rgba(82, 47, 16, 0.18) !important;
}

body[data-shell-page="user"] .chat-detail-card-action-workflow,
body[data-shell-page="user"] .chat-detail-card-action-advance {
  grid-column: 1 / -1 !important;
}

body[data-shell-page="user"] .chat-detail-card-action-workflow {
  border-color: rgba(156, 106, 39, 0.28) !important;
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.98) 0%, rgba(247, 226, 174, 0.98) 100%) !important;
}

body[data-shell-page="user"] .chat-detail-card-action-advance {
  border-style: dashed !important;
  background: rgba(252, 242, 214, 0.98) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-shell {
  background:
    radial-gradient(circle at top left, rgba(102, 184, 222, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(228, 239, 247, 0.98) 0%, rgba(208, 224, 236, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-title,
body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-meta-value {
  color: #17324a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-avatar {
  border-color: rgba(36, 83, 118, 0.14) !important;
  background:
    radial-gradient(circle at 30% 30%, rgba(239, 252, 255, 0.78), transparent 34%),
    linear-gradient(180deg, rgba(44, 113, 160, 0.18) 0%, rgba(24, 58, 86, 0.06) 100%) !important;
  color: #1d5a83 !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-meta-label {
  color: rgba(24, 58, 86, 0.62) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action {
  border-color: rgba(36, 83, 118, 0.16) !important;
  background: rgba(243, 250, 255, 0.98) !important;
  color: #17324a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action:hover,
body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action:focus-visible {
  border-color: rgba(44, 113, 160, 0.42) !important;
  background: rgba(229, 244, 255, 0.98) !important;
  box-shadow: 0 10px 18px rgba(18, 43, 69, 0.12) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action.is-active {
  border-color: rgba(44, 113, 160, 0.46) !important;
  background: linear-gradient(180deg, rgba(156, 216, 247, 0.98) 0%, rgba(72, 145, 190, 0.98) 100%) !important;
  color: #0f2b3f !important;
  box-shadow: 0 12px 20px rgba(18, 43, 69, 0.14) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action-workflow {
  border-color: rgba(44, 113, 160, 0.28) !important;
  background: linear-gradient(180deg, rgba(240, 248, 255, 0.98) 0%, rgba(206, 232, 248, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-card-action-advance {
  background: rgba(233, 244, 252, 0.98) !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* User shell SFC push: make stage/portrait canvas feel like distinct visual surfaces. */
body[data-shell-page="user"] .conversation-stage {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 228px !important;
  gap: 14px !important;
  align-items: start !important;
}

body[data-shell-page="user"] .conversation-stage-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  max-width: none !important;
  min-width: 0 !important;
}

body[data-shell-page="user"] .conversation-stage-canvas-wrap {
  width: 100% !important;
  border-radius: 24px !important;
  border: 1px solid rgba(231, 216, 176, 0.2) !important;
  background:
    radial-gradient(circle at top left, rgba(255, 228, 160, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(12, 14, 18, 0.98) 0%, rgba(20, 17, 20, 0.98) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 28px rgba(0, 0, 0, 0.22) !important;
}

body[data-shell-page="user"] #room-stage-canvas {
  height: 226px !important;
}

body[data-shell-page="user"] .conversation-stage-side {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  width: 228px !important;
  max-width: none !important;
  gap: 10px !important;
}

body[data-shell-page="user"] .conversation-stage-side .conversation-stage-canvas-wrap {
  border-radius: 20px !important;
}

body[data-shell-page="user"] #room-stage-portrait-canvas {
  height: 256px !important;
}

body[data-shell-page="user"] .stage-chip {
  width: 100% !important;
  justify-content: flex-start !important;
  border-radius: 16px !important;
  padding: 9px 11px !important;
  line-height: 1.4 !important;
}

body[data-shell-page="user"] .stage-chip[data-tone="accent"] {
  background: linear-gradient(180deg, rgba(255, 229, 172, 0.96) 0%, rgba(231, 180, 95, 0.96) 100%) !important;
  border-color: rgba(231, 180, 95, 0.42) !important;
  color: rgba(43, 26, 12, 0.92) !important;
}

body[data-shell-page="user"] .stage-chip[data-tone="warm"] {
  background: rgba(93, 49, 24, 0.64) !important;
  border-color: rgba(231, 180, 95, 0.2) !important;
  color: rgba(255, 225, 173, 0.92) !important;
}

body[data-shell-page="user"] .conversation-stage-note {
  max-width: 54ch !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .conversation-stage {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .conversation-stage-side {
    width: auto !important;
  }

  body[data-shell-page="user"] #room-stage-canvas {
    height: 208px !important;
  }

  body[data-shell-page="user"] #room-stage-portrait-canvas {
    height: 228px !important;
  }
}

/* User shell room-driven theming: whole page follows home/public room mood, not only the canvas. */
body[data-shell-page="user"][data-room-variant="home"] .topbar {
  background:
    radial-gradient(circle at top left, rgba(255, 214, 153, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(36, 24, 18, 0.98) 0%, rgba(24, 18, 18, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="home"] .hero-note {
  color: rgba(244, 226, 203, 0.8) !important;
}

body[data-shell-page="user"][data-room-variant="home"] .rooms {
  background:
    radial-gradient(circle at top left, rgba(255, 216, 159, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(49, 35, 30, 0.95) 0%, rgba(24, 19, 19, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="home"] .conversation {
  background:
    radial-gradient(circle at top right, rgba(255, 207, 120, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(38, 28, 26, 0.96) 0%, rgba(18, 14, 16, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="home"] .chat-detail {
  background:
    radial-gradient(circle at top right, rgba(255, 207, 120, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(43, 30, 29, 0.96) 0%, rgba(20, 16, 18, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="home"] .composer-row button {
  background: linear-gradient(180deg, rgba(240, 184, 92, 1) 0%, rgba(163, 92, 34, 1) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .topbar {
  background:
    radial-gradient(circle at top left, rgba(146, 205, 234, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(17, 26, 38, 0.98) 0%, rgba(13, 18, 30, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .masthead-eyebrow,
body[data-shell-page="user"][data-room-variant="city"] .eyebrow {
  color: rgba(173, 212, 237, 0.92) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .hero-note {
  color: rgba(214, 230, 241, 0.8) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .rooms {
  border-color: rgba(157, 196, 224, 0.18) !important;
  background:
    radial-gradient(circle at top left, rgba(143, 183, 218, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(20, 31, 45, 0.96) 0%, rgba(13, 19, 30, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .conversation {
  border-color: rgba(157, 196, 224, 0.2) !important;
  background:
    radial-gradient(circle at top right, rgba(143, 183, 218, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(16, 24, 36, 0.96) 0%, rgba(10, 15, 24, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .conversation-stage {
  border-color: rgba(143, 183, 218, 0.22) !important;
  background:
    radial-gradient(circle at top left, rgba(143, 183, 218, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(29, 39, 55, 0.97) 0%, rgba(14, 19, 30, 0.99) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .timeline {
  border-color: rgba(143, 183, 218, 0.16) !important;
  background:
    radial-gradient(circle at top left, rgba(143, 183, 218, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(7, 12, 20, 0.98) 0%, rgba(11, 15, 24, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail {
  border-color: rgba(157, 196, 224, 0.2) !important;
  background:
    radial-gradient(circle at top right, rgba(143, 183, 218, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(21, 28, 42, 0.96) 0%, rgba(11, 16, 25, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-summary-title,
body[data-shell-page="user"][data-room-variant="city"] .panel-shell-title {
  color: #dceefe !important;
}

body[data-shell-page="user"][data-room-variant="city"] .chat-detail-summary-copy,
body[data-shell-page="user"][data-room-variant="city"] .panel-shell-note {
  color: rgba(214, 230, 241, 0.76) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .composer {
  border-color: rgba(143, 183, 218, 0.2) !important;
  background:
    radial-gradient(circle at top left, rgba(143, 183, 218, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(231, 240, 247, 0.98) 0%, rgba(214, 228, 238, 0.98) 100%) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .composer-row textarea {
  border-color: rgba(76, 103, 130, 0.22) !important;
  background: rgba(248, 252, 255, 0.98) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .composer-row button {
  background: linear-gradient(180deg, rgba(158, 203, 231, 1) 0%, rgba(74, 121, 160, 1) 100%) !important;
  color: #0f1b2a !important;
}

body[data-shell-page="user"][data-room-variant="city"] .stage-chip[data-tone="accent"] {
  background: linear-gradient(180deg, rgba(199, 228, 245, 0.96) 0%, rgba(132, 180, 212, 0.96) 100%) !important;
  border-color: rgba(132, 180, 212, 0.42) !important;
  color: rgba(11, 30, 45, 0.92) !important;
}

body[data-shell-page="user"][data-room-variant="city"] .stage-chip[data-tone="warm"] {
  background: rgba(32, 55, 78, 0.7) !important;
  border-color: rgba(132, 180, 212, 0.24) !important;
  color: rgba(214, 230, 241, 0.92) !important;
}

/* User shell final override: keep the tri-column room / scene / detail layout. */
body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(250px, 290px) minmax(0, 1.4fr) minmax(320px, 390px) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

body[data-shell-page="user"] .conversation {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: calc(100vh - 176px) !important;
}

body[data-shell-page="user"] .conversation-stage-user {
  margin: 0 !important;
}

body[data-shell-page="user"] .conversation-stream-user {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

body[data-shell-page="user"] .chat-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: calc(100vh - 176px) !important;
  overflow: hidden !important;
}

body[data-shell-page="user"] .chat-detail-shell {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .chat-detail-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 14px 14px !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px !important;
  gap: 6px !important;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 28ch !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-shell-page="user"] .conversation-meta {
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .shell-column-rooms,
body[data-shell-page="user"] .shell-column-detail {
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .layout-user-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail {
    position: static !important;
  }

  body[data-shell-page="user"] .rooms,
  body[data-shell-page="user"] .conversation,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto !important;
  }
}

/* User shell v2 final override: keep the tri-column layout and reusable detail rail. */
body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(250px, 290px) minmax(0, 1.4fr) minmax(320px, 390px) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

body[data-shell-page="user"] .conversation {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: calc(100vh - 176px) !important;
}

body[data-shell-page="user"] .conversation-stage-user {
  margin: 0 !important;
}

body[data-shell-page="user"] .conversation-stream-user {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

body[data-shell-page="user"] .chat-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: calc(100vh - 176px) !important;
  overflow: hidden !important;
}

body[data-shell-page="user"] .chat-detail-shell {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .chat-detail-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 14px 14px !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px !important;
  gap: 6px !important;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 28ch !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-shell-page="user"] .conversation-meta {
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .shell-column-rooms,
body[data-shell-page="user"] .shell-column-detail {
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .layout-user-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail {
    position: static !important;
  }

  body[data-shell-page="user"] .rooms,
  body[data-shell-page="user"] .conversation,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto !important;
  }
}

/* User shell v2: three-column room / scene / detail layout with a reusable detail rail. */
body[data-shell-page="user"] {
  --bg: #120d11;
  --panel: #1a1620;
  --panel-soft: #241d28;
  --panel-strong: #2d232b;
  --ink: #f7efdf;
  --muted: #c0b196;
  --line: rgba(231, 216, 176, 0.18);
  --accent: #f0c96b;
  --accent-strong: #ffd98a;
  --accent-soft: rgba(240, 201, 107, 0.14);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(240, 201, 107, 0.16), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(126, 253, 199, 0.07), transparent 24%),
    linear-gradient(180deg, #120d11 0%, #100c10 52%, #09070b 100%);
}

body[data-shell-page="user"] .app {
  max-width: 1520px;
  padding: 18px 18px 28px;
}

body[data-shell-page="user"] .topbar {
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(231, 216, 176, 0.18);
  background:
    radial-gradient(circle at top left, rgba(240, 201, 107, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(33, 26, 33, 0.98) 0%, rgba(18, 14, 20, 0.96) 100%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.36);
}

body[data-shell-page="user"] .hero-note {
  max-width: 62ch;
  color: rgba(240, 229, 208, 0.8);
}

body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(250px, 290px) minmax(0, 1.4fr) minmax(320px, 390px) !important;
  gap: 14px !important;
  align-items: stretch !important;
  padding: 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(243, 201, 108, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(26, 20, 28, 0.96) 0%, rgba(15, 12, 18, 0.98) 100%);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

body[data-shell-page="user"] .shell-column {
  min-height: 0;
}

body[data-shell-page="user"] .shell-column-rooms,
body[data-shell-page="user"] .shell-column-detail {
  position: sticky;
  top: 12px;
  align-self: start;
}

body[data-shell-page="user"] .rooms {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 176px);
  border: 1px solid rgba(231, 216, 176, 0.14);
  background:
    radial-gradient(circle at top left, rgba(255, 228, 160, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(41, 31, 38, 0.95) 0%, rgba(22, 18, 24, 0.98) 100%);
  overflow: hidden;
}

body[data-shell-page="user"] .room-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}

body[data-shell-page="user"] .conversation {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 176px);
  border: 1px solid rgba(231, 216, 176, 0.16);
  background:
    radial-gradient(circle at top right, rgba(240, 201, 107, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(28, 22, 28, 0.96) 0%, rgba(14, 11, 16, 0.98) 100%);
}

body[data-shell-page="user"] .conversation-stage-user {
  margin: 0 !important;
  padding: 16px 16px 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 226, 160, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(52, 39, 35, 0.96) 0%, rgba(25, 18, 20, 0.98) 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26);
}

body[data-shell-page="user"] .conversation-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-shell-page="user"] .conversation-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-shell-page="user"] .conversation-stage-canvas-wrap {
  padding: 12px;
  border: 1px solid rgba(231, 216, 176, 0.14);
  border-radius: 18px;
  background: rgba(10, 8, 12, 0.72);
}

body[data-shell-page="user"] .conversation-stage-title {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.03em;
  color: var(--accent);
}

body[data-shell-page="user"] .conversation-stage-note,
body[data-shell-page="user"] .conversation-stream-note {
  max-width: 58ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(240, 229, 208, 0.72);
}

body[data-shell-page="user"] .conversation-stream-user {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}

body[data-shell-page="user"] .conversation-stream-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 0 2px;
}

body[data-shell-page="user"] .timeline {
  margin: 0 !important;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  border: 1px solid rgba(231, 216, 176, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(243, 201, 108, 0.04), transparent 28%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.98) 0%, rgba(18, 14, 17, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body[data-shell-page="user"] .chat-detail {
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 176px);
  border: 3px solid rgba(44, 28, 18, 0.82);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(217, 201, 164, 0.98) 0%, rgba(190, 170, 132, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 217, 0.55),
    0 14px 28px rgba(20, 11, 7, 0.32);
  overflow: hidden;
}

body[data-shell-page="user"] .chat-detail-shell-header {
  border-bottom: 2px solid rgba(44, 28, 18, 0.72);
  padding-bottom: 10px;
}

body[data-shell-page="user"] .chat-detail-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

body[data-shell-page="user"] .chat-detail-summary {
  padding: 0 14px 12px;
}

body[data-shell-page="user"] .chat-detail-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: #3b2815;
}

body[data-shell-page="user"] .chat-detail-summary-copy {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(58, 38, 22, 0.78);
}

body[data-shell-page="user"] .chat-detail-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 14px;
}

body[data-shell-page="user"] .chat-detail-hero,
body[data-shell-page="user"] .chat-detail-section {
  background:
    radial-gradient(circle at top left, rgba(255, 228, 160, 0.04), transparent 24%),
    rgba(255, 252, 245, 0.98);
  border-color: rgba(231, 216, 176, 0.18);
}

body[data-shell-page="user"] .chat-detail-section-title {
  color: rgba(89, 74, 55, 0.9);
}

body[data-shell-page="user"] .chat-detail-copy {
  color: rgba(88, 74, 57, 0.78);
}

body[data-shell-page="user"] .chat-detail-row {
  border-top-color: rgba(231, 216, 176, 0.72);
}

body[data-shell-page="user"] .chat-detail-value {
  color: #231b18;
}

body[data-shell-page="user"] .chat-detail-link {
  border-color: rgba(231, 216, 176, 0.22);
  background: rgba(255, 253, 248, 0.96);
}

body[data-shell-page="user"] .composer {
  margin: 0 14px 14px !important;
  padding: 12px 12px 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(240, 201, 107, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(248, 238, 216, 0.98) 0%, rgba(231, 215, 184, 0.98) 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 86px;
  border-color: rgba(92, 68, 40, 0.18);
  background: rgba(255, 251, 243, 0.98);
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(240, 201, 107, 1) 0%, rgba(171, 107, 33, 1) 100%);
  color: #1d160f;
}

body[data-shell-page="user"] .composer-hints-user {
  justify-content: flex-start;
}

body[data-shell-page="user"] .composer-hints-user span,
body[data-shell-page="user"] .conversation-meta .meta-chip {
  border-radius: 10px;
}

body[data-shell-page="user"] .conversation-meta .meta-chip {
  background: rgba(240, 201, 107, 0.14);
  border-color: rgba(240, 201, 107, 0.18);
}

body[data-shell-page="user"] .composer-status,
body[data-shell-page="user"] .composer-tip,
body[data-shell-page="user"] .composer-meta {
  margin-left: 2px;
  margin-right: 2px;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px;
}

body[data-shell-page="user"] .panel-shell-title {
  color: #25160f;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 28ch;
  color: rgba(37, 22, 15, 0.78);
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .layout-user-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail {
    position: static;
  }

  body[data-shell-page="user"] .rooms,
  body[data-shell-page="user"] .conversation,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto;
  }
}

/* User projection final cut: keep only rooms, timeline, composer, and tiny HUD. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .caretaker-panel,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="user"] .room-digest,
body[data-shell-page="user"] .mode-banner,
body[data-shell-page="user"] .room-actions,
body[data-shell-page="user"] .room-scene,
body[data-shell-page="user"] .chat-detail {
  display: none !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 10px 12px 8px;
  gap: 4px;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 26ch;
  font-size: 11px;
  line-height: 1.4;
}

body[data-shell-page="user"] .rooms {
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(247, 252, 249, 0.96) 100%
  );
}

body[data-shell-page="user"] .conversation {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 12px 8px !important;
  padding: 12px 14px 10px !important;
}

body[data-shell-page="user"] .timeline {
  margin-top: 0 !important;
}

body[data-shell-page="user"] .composer {
  margin-top: 8px !important;
}

body[data-shell-page="user"] .identity-row {
  display: none !important;
}

body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .caretaker-panel,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="user"] .room-digest,
body[data-shell-page="user"] .mode-banner,
body[data-shell-page="user"] .room-actions,
body[data-shell-page="user"] .room-scene,
body[data-shell-page="user"] .chat-detail {
  display: none !important;
}

body[data-shell-page="user"] .rooms {
  border: 1px solid rgba(24, 105, 91, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(247, 252, 249, 0.96) 100%
  );
}

body[data-shell-page="user"] .conversation {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 12px 8px !important;
}

body[data-shell-page="user"] .timeline {
  margin-top: 0 !important;
}

body[data-shell-page="user"] .identity-row {
  display: none !important;
}

body[data-shell-page="user"] .composer-status {
  margin-bottom: 8px;
}

body[data-shell-page="user"] .chat-detail {
  margin-top: 10px;
  border: 1px solid rgba(24, 105, 91, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 252, 0.98) 0%,
    rgba(243, 250, 246, 0.96) 100%
  );
  box-shadow: 0 14px 28px rgba(24, 105, 91, 0.05);
}

body[data-shell-page="user"] .chat-detail-content {
  padding-bottom: 14px;
}

body[data-shell-page="user"] .chat-detail-hero,
body[data-shell-page="user"] .chat-detail-section {
  padding-left: 16px;
  padding-right: 16px;
}

/* Final room-tightening overrides: place last so they win over older broad layout rules. */
body[data-shell-page="user"] .topbar,
body[data-shell-page="admin"] .topbar {
  padding: 14px 16px;
  border-radius: 22px;
}

body[data-shell-page="user"] .layout,
body[data-shell-page="admin"] .layout {
  padding: 12px;
  gap: 12px;
  border-radius: 26px;
}

body[data-workspace="chat"] .layout-user-shell {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 12px;
}

body[data-workspace="chat"] .layout-admin-shell {
  grid-template-columns: minmax(232px, 264px) minmax(0, 1fr);
  gap: 12px;
}

body[data-shell-page="user"] .sidebar-stack,
body[data-shell-page="admin"] .sidebar-stack {
  gap: 10px;
}

body[data-shell-page="user"] .rooms,
body[data-shell-page="admin"] .rooms {
  min-height: 22vh;
  border-radius: 18px;
}

body[data-shell-page="user"] .conversation,
body[data-shell-page="admin"] .conversation {
  border-radius: 20px;
  padding: 6px 0 8px;
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="admin"] .conversation-stage {
  margin: 0 12px 8px;
  padding: 11px 14px 10px;
  border-radius: 16px;
  border: 1px solid rgba(140, 245, 212, 0.12);
  background:
    radial-gradient(circle at top left, rgba(140, 245, 212, 0.08) 0, transparent 36%),
    linear-gradient(180deg, rgba(13, 18, 27, 0.96) 0%, rgba(9, 12, 18, 0.98) 100%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

body[data-shell-page="admin"] .conversation-stage {
  border-color: rgba(201, 144, 57, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.1) 0, transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(244, 236, 220, 0.98) 100%);
}

body[data-shell-page="user"] .conversation-stage-title,
body[data-shell-page="admin"] .conversation-stage-title {
  font-size: 24px;
  letter-spacing: -0.03em;
}

body[data-shell-page="admin"] .conversation-stage-title {
  font-size: 22px;
}

body[data-shell-page="user"] .conversation-stage-note,
body[data-shell-page="admin"] .conversation-stage-note {
  max-width: 48ch;
  line-height: 1.55;
}

body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="admin"] .conversation-tools {
  margin: 0 12px 8px;
  padding: 0 12px 8px;
  gap: 6px;
}

body[data-shell-page="user"] .conversation-tools select,
body[data-shell-page="admin"] .conversation-tools select,
body[data-shell-page="user"] .conversation-tools button,
body[data-shell-page="admin"] .conversation-tools button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
}

body[data-shell-page="user"] .timeline,
body[data-shell-page="admin"] .timeline {
  margin: 0 12px 0;
  padding: 12px;
  border-radius: 16px;
}

body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer {
  margin: 10px 12px 12px;
  padding: 10px 12px 12px;
  border-radius: 16px;
}

body[data-shell-page="user"] .composer-row textarea,
body[data-shell-page="admin"] .composer-row textarea {
  min-height: 68px;
}

body[data-shell-page="user"] .composer-hints span,
body[data-shell-page="admin"] .composer-hints span {
  border-radius: 10px;
  padding: 4px 8px;
}

body[data-shell-page="admin"] .governance-summary,
body[data-shell-page="admin"] .governance-status {
  padding-bottom: 10px;
}

body[data-shell-page="admin"] .governance-details summary {
  padding: 7px 12px;
}

body[data-shell-page="admin"] .governance-roadmap {
  gap: 6px;
  flex-wrap: wrap;
}

body[data-shell-page="admin"] .roadmap-step {
  border-radius: 999px;
  padding: 4px 9px;
}


/* Final shell split: user is room-first, admin/unified are exterior-first. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .thread-status-rail {
  display: none !important;
}

body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) !important;
  gap: 12px !important;
}

body[data-shell-page="user"] .rooms {
  min-height: calc(100vh - 168px) !important;
}

body[data-shell-page="user"] .conversation {
  padding: 12px 12px 10px !important;
  border: 3px solid rgba(44, 28, 18, 0.9) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(164, 96, 52, 0.95) 0%, rgba(104, 58, 31, 0.98) 34%, rgba(31, 19, 12, 0.99) 100%) !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  border: 2px solid rgba(42, 28, 18, 0.78) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(241, 229, 201, 0.96) 0%, rgba(218, 196, 160, 0.98) 100%) !important;
}

body[data-shell-page="user"] .conversation-stage-side {
  display: none !important;
}

body[data-shell-page="user"] .room-scene {
  display: block !important;
  margin-bottom: 10px !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 0 12px !important;
  padding: 14px !important;
  max-height: clamp(220px, 30vh, 340px) !important;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.98) 0%, rgba(27, 18, 12, 0.98) 100%) !important;
  border: 2px solid rgba(255, 214, 153, 0.12) !important;
}

body[data-shell-page="user"] .message {
  background: linear-gradient(180deg, rgba(46, 33, 23, 0.96) 0%, rgba(26, 18, 12, 0.98) 100%) !important;
  color: #f6ebdc !important;
  border-color: rgba(255, 211, 148, 0.14) !important;
}

body[data-shell-page="user"] .message.self {
  background: linear-gradient(180deg, rgba(32, 69, 58, 0.98) 0%, rgba(16, 39, 33, 0.98) 100%) !important;
  border-color: rgba(129, 183, 183, 0.22) !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 !important;
  padding: 12px 12px 14px !important;
  border: 2px solid rgba(255, 214, 153, 0.16) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(248, 240, 221, 0.98) 0%, rgba(232, 216, 186, 0.98) 100%) !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 82px !important;
  background: rgba(255, 252, 245, 0.98) !important;
  border-color: rgba(84, 56, 35, 0.16) !important;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(244, 171, 60, 1) 0%, rgba(151, 91, 27, 1) 100%) !important;
}

/* User home should stay room-first but keep an obvious edge drawer for world tools. */
body[data-shell-page="user"] .caretaker-panel {
  display: none !important;
}

body[data-shell-page="user"] .governance {
  display: block !important;
  border: 1px solid rgba(24, 105, 91, 0.14) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.98) 0%, rgba(243, 250, 246, 0.96) 100%) !important;
  box-shadow: 0 12px 28px rgba(24, 105, 91, 0.08) !important;
}

body[data-shell-page="user"] .governance > .governance-block {
  display: none !important;
}

body[data-shell-page="user"] .governance-summary,
body[data-shell-page="user"] .governance-status {
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 10px;
}

body[data-shell-page="user"] .governance-status {
  color: rgba(24, 105, 91, 0.78);
}

body[data-shell-page="user"] .governance-details {
  display: block !important;
  margin: 0 16px 14px;
  border: 1px dashed rgba(24, 105, 91, 0.22);
  background: rgba(247, 252, 249, 0.9);
}

body[data-shell-page="user"] .governance-details summary {
  padding: 8px 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(24, 105, 91, 0.88);
}

body[data-shell-page="user"] .governance-forms {
  padding-top: 6px;
}

body[data-shell-page="user"] .governance-forms .section-label {
  letter-spacing: 0.08em;
}

body[data-shell-page="user"] .room-actions,
body[data-shell-page="user"] .room-digest,
body[data-shell-page="user"] .mode-banner {
  display: none !important;
}

body[data-shell-page="admin"] .guide-panel {
  display: none !important;
}

body[data-shell-page="admin"] .governance {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .governance > .governance-block {
  display: block !important;
  opacity: 1;
  background: transparent;
  border-top: 1px solid rgba(217, 204, 183, 0.34);
  margin-top: 0;
  padding: 12px 16px 10px;
}

body[data-shell-page="admin"] .governance > .governance-block:first-of-type {
  border-top: 0;
  margin-top: 4px;
}

body[data-shell-page="admin"] .governance-details {
  display: block !important;
  margin: 8px 16px 12px;
}

body[data-shell-page="admin"] .governance-details summary {
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 12px;
}

body[data-shell-page="admin"] .governance-roadmap {
  display: flex;
  margin: 4px 16px 8px;
  padding: 8px 16px 10px;
}

body[data-shell-page="admin"] .governance-summary,
body[data-shell-page="admin"] .governance-status {
  color: rgba(29, 26, 23, 0.68);
}

body[data-shell-page="admin"] .governance {
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .layout-admin-shell {
  gap: 12px;
}

body[data-shell-page="admin"] .conversation-stage {
  margin: 0 12px 10px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(201, 144, 57, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.1) 0, transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(244, 236, 220, 0.98) 100%);
  box-shadow: 0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="admin"] .conversation-stage-side {
  display: flex;
}

body[data-shell-page="admin"] .conversation-tools {
  margin: 0 12px 8px;
  padding: 0 12px 8px;
  gap: 6px;
}

body[data-shell-page="admin"] .timeline {
  margin: 0 12px 0;
  padding: 12px;
  border-radius: 16px;
}

body[data-shell-page="admin"] .composer {
  margin: 10px 12px 12px;
  padding: 10px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(245, 237, 220, 0.98) 100%) !important;
}

body[data-shell-page="admin"] .composer-row textarea {
  min-height: 68px;
}

body[data-shell-page="admin"] .composer-row button {
  background: linear-gradient(180deg, rgba(201, 144, 57, 1) 0%, rgba(104, 63, 18, 1) 100%);
}

body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="unified"] .chat-detail {
  display: none !important;
}

body[data-shell-page="unified"] .governance {
  display: block !important;
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="unified"] .governance > .governance-block {
  display: block !important;
  opacity: 1;
  background: transparent;
  border-top: 1px solid rgba(217, 204, 183, 0.34);
  margin-top: 0;
  padding: 12px 16px 10px;
}

body[data-shell-page="unified"] .governance > .governance-block:first-of-type {
  border-top: 0;
  margin-top: 4px;
}

body[data-shell-page="unified"] .governance-details {
  display: block !important;
  margin: 8px 16px 12px;
}

body[data-shell-page="unified"] .governance-details summary {
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 12px;
}

body[data-shell-page="unified"] .governance-roadmap {
  display: flex;
  margin: 4px 16px 8px;
  padding: 8px 16px 10px;
}

body[data-shell-page="unified"] .governance-summary,
body[data-shell-page="unified"] .governance-status {
  color: rgba(29, 26, 23, 0.68);
}

body[data-shell-page="unified"] .governance {
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="unified"] .layout-unified-shell {
  gap: 12px;
}

body[data-shell-page="unified"] .conversation-stage {
  margin: 0 12px 10px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(24, 105, 91, 0.14);
  background:
    radial-gradient(circle at top left, rgba(220, 247, 240, 0.18) 0, transparent 24%),
    linear-gradient(180deg, rgba(255, 254, 250, 0.96) 0%, rgba(249, 244, 232, 0.94) 100%);
  box-shadow: 0 10px 22px rgba(37, 26, 14, 0.04);
}

body[data-shell-page="unified"] .conversation-stage-side {
  display: flex;
}

body[data-shell-page="unified"] .conversation-tools {
  display: none !important;
}

body[data-shell-page="unified"] .conversation {
  border: 1px solid rgba(24, 105, 91, 0.18);
  background:
    radial-gradient(circle at top left, rgba(140, 245, 212, 0.05) 0, transparent 22%),
    linear-gradient(180deg, rgba(11, 14, 20, 0.98) 0%, rgba(8, 10, 16, 0.98) 100%);
}

/* Final role split: user is room-first, admin/unified are exterior-first shells. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .chat-detail,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="user"] .conversation-tools {
  display: none !important;
}

body[data-shell-page="user"] .governance {
  display: none !important;
}

body[data-shell-page="user"][data-workspace="chat"] .layout-user-shell {
  grid-template-columns: minmax(210px, 248px) minmax(0, 1fr) !important;
  gap: 12px !important;
}

body[data-shell-page="user"] .topbar {
  padding: 10px 12px !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .masthead {
  gap: 4px !important;
}

body[data-shell-page="user"] .hero-note {
  max-width: 62ch !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

body[data-shell-page="user"] .hero-callout,
body[data-shell-page="user"] .status-cluster {
  display: none !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 0 10px !important;
  padding: 9px 11px !important;
  border-radius: 18px !important;
  border: 2px solid rgba(42, 28, 18, 0.78) !important;
  background:
    linear-gradient(180deg, rgba(241, 229, 201, 0.96) 0%, rgba(218, 196, 160, 0.98) 100%) !important;
}

body[data-shell-page="user"] .room-scene {
  display: block !important;
  margin-bottom: 8px !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 0 12px !important;
  padding: 14px !important;
  max-height: clamp(220px, 30vh, 340px) !important;
  border: 2px solid rgba(255, 214, 153, 0.12) !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 !important;
  padding: 12px 12px 14px !important;
  border-radius: 18px !important;
  border: 2px solid rgba(255, 214, 153, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(248, 240, 221, 0.98) 0%, rgba(232, 216, 186, 0.98) 100%) !important;
}

body[data-shell-page="admin"] .guide-panel {
  display: none !important;
}

body[data-shell-page="admin"] .governance {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .conversation-stage {
  margin: 0 12px 10px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(201, 144, 57, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 216, 146, 0.1) 0, transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(244, 236, 220, 0.98) 100%);
}

body[data-shell-page="admin"] .conversation-stage-side {
  display: flex !important;
}

body[data-shell-page="admin"] .conversation-tools {
  display: flex !important;
  margin: 0 12px 8px;
  padding: 0 12px 8px;
  gap: 6px;
}

body[data-shell-page="admin"] .layout-admin-shell {
  gap: 12px !important;
}

body[data-shell-page="unified"] .guide-panel,
body[data-shell-page="unified"] .auth,
body[data-shell-page="unified"] .chat-detail {
  display: none !important;
}

body[data-shell-page="unified"] .governance {
  display: block !important;
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="unified"] .conversation-stage {
  margin: 0 12px 10px;
  padding: 18px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(24, 105, 91, 0.14);
  background:
    radial-gradient(circle at top left, rgba(220, 247, 240, 0.18) 0, transparent 24%),
    linear-gradient(180deg, rgba(255, 254, 250, 0.96) 0%, rgba(249, 244, 232, 0.94) 100%);
}

body[data-shell-page="unified"] .conversation-stage-side {
  display: flex !important;
}

body[data-shell-page="unified"] .conversation-tools {
  display: none !important;
}

body[data-shell-page="unified"] .layout-unified-shell {
  gap: 12px !important;
}

/* User-page hard cut: keep only list, timeline, and composer visible. */
body[data-shell-page="user"] .pixel-menu,
body[data-shell-page="user"] .room-scene,
body[data-shell-page="user"] .identity-row {
  display: none !important;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 26ch;
  font-size: 12px;
  line-height: 1.45;
}

body[data-shell-page="user"] .conversation-stage-note {
  max-width: none;
}

body[data-shell-page="user"] .composer {
  padding-top: 12px !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 84px;
}

/* User-page room-first finish: flatten the shell and keep only the chat path prominent. */
body[data-shell-page="user"] .panel-title {
  display: none !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px;
  gap: 6px;
}

body[data-shell-page="user"] .panel-shell-note {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.45;
  max-width: 30ch;
}

body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth {
  border: 1px solid rgba(24, 105, 91, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(246, 250, 247, 0.95) 100%
  ) !important;
  box-shadow: 0 10px 22px rgba(24, 105, 91, 0.05) !important;
}

body[data-shell-page="user"] .governance-summary,
body[data-shell-page="user"] .governance-status {
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(29, 26, 23, 0.72);
}

body[data-shell-page="user"] .governance-details,
body[data-shell-page="user"] .auth-details {
  margin: 0 14px 12px;
}

body[data-shell-page="user"] .governance-details summary,
body[data-shell-page="user"] .auth-details summary {
  padding: 8px 10px;
}

body[data-shell-page="user"] .conversation {
  border: 1px solid rgba(24, 105, 91, 0.12) !important;
  background:
    radial-gradient(
      circle at top left,
      rgba(220, 248, 240, 0.2) 0,
      transparent 24%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.99) 0%,
      rgba(245, 250, 247, 0.98) 100%
    ) !important;
  box-shadow: 0 18px 34px rgba(24, 105, 91, 0.06) !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 12px 10px !important;
  padding: 12px 14px 10px !important;
  border: 1px solid rgba(24, 105, 91, 0.12) !important;
  background: linear-gradient(
    180deg,
    rgba(250, 255, 253, 0.98) 0%,
    rgba(240, 247, 244, 0.98) 100%
  ) !important;
  box-shadow: 0 12px 24px rgba(24, 105, 91, 0.05) !important;
}

body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .room-scene {
  display: none !important;
}

body[data-shell-page="user"] .conversation-stage-title {
  font-size: 24px;
  letter-spacing: -0.03em;
}

body[data-shell-page="user"] .conversation-stage-note {
  max-width: 44ch;
  line-height: 1.55;
}

body[data-shell-page="user"] .timeline {
  margin: 0 12px 0 !important;
  padding: 12px !important;
  border: 1px solid rgba(24, 105, 91, 0.1) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

body[data-shell-page="user"] .composer {
  margin: 10px 12px 12px !important;
  padding: 12px 12px 14px !important;
  border: 1px solid rgba(24, 105, 91, 0.12) !important;
  background: linear-gradient(
    180deg,
    rgba(250, 255, 253, 0.98) 0%,
    rgba(244, 249, 246, 0.98) 100%
  ) !important;
  box-shadow: 0 12px 24px rgba(24, 105, 91, 0.05) !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 78px !important;
}

body[data-shell-page="user"] .composer-hints-user {
  justify-content: flex-start;
}

/* User projection final override: last rules win over historical workspace skin. */
body[data-shell-page="user"] .guide-panel,
body[data-shell-page="user"] .governance,
body[data-shell-page="user"] .auth,
body[data-shell-page="user"] .caretaker-panel,
body[data-shell-page="user"] .conversation-overview,
body[data-shell-page="user"] .chat-priority-badge,
body[data-shell-page="user"] .chat-quick-links,
body[data-shell-page="user"] .conversation-callout,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .thread-status-rail,
body[data-shell-page="user"] .room-digest,
body[data-shell-page="user"] .mode-banner,
body[data-shell-page="user"] .room-actions,
body[data-shell-page="user"] .room-scene {
  display: none !important;
}

body[data-shell-page="user"] .layout-user-shell {
  grid-template-columns: minmax(250px, 290px) minmax(0, 1.4fr) minmax(320px, 390px) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

body[data-shell-page="user"] .rooms {
  display: flex !important;
  flex-direction: column !important;
  min-height: calc(100vh - 176px) !important;
  border: 1px solid rgba(231, 216, 176, 0.14) !important;
  background:
    radial-gradient(circle at top left, rgba(255, 228, 160, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(41, 31, 38, 0.95) 0%, rgba(22, 18, 24, 0.98) 100%) !important;
  overflow: hidden !important;
}

body[data-shell-page="user"] .conversation {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: calc(100vh - 176px) !important;
  border: 1px solid rgba(231, 216, 176, 0.16) !important;
  background:
    radial-gradient(circle at top right, rgba(240, 201, 107, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(28, 22, 28, 0.96) 0%, rgba(14, 11, 16, 0.98) 100%) !important;
}

body[data-shell-page="user"] .conversation-stage {
  margin: 0 !important;
  padding: 16px 16px 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.18) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at top left, rgba(255, 226, 160, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(52, 39, 35, 0.96) 0%, rgba(25, 18, 20, 0.98) 100%) !important;
}

body[data-shell-page="user"] .conversation-stream-user {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

body[data-shell-page="user"] .timeline {
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.14) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at top left, rgba(243, 201, 108, 0.04), transparent 28%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.98) 0%, rgba(18, 14, 17, 0.98) 100%) !important;
}

body[data-shell-page="user"] .chat-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: calc(100vh - 176px) !important;
  border: 1px solid rgba(231, 216, 176, 0.18) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at top right, rgba(240, 201, 107, 0.06), transparent 26%),
    linear-gradient(180deg, rgba(32, 25, 32, 0.96) 0%, rgba(16, 13, 19, 0.98) 100%) !important;
  overflow: hidden !important;
}

body[data-shell-page="user"] .chat-detail-shell {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

body[data-shell-page="user"] .chat-detail-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body[data-shell-page="user"] .chat-detail-hero,
body[data-shell-page="user"] .chat-detail-section {
  background:
    radial-gradient(circle at top left, rgba(255, 228, 160, 0.04), transparent 24%),
    rgba(255, 252, 245, 0.98) !important;
  border-color: rgba(231, 216, 176, 0.18) !important;
}

body[data-shell-page="user"] .panel-shell-header {
  padding: 12px 14px 10px !important;
  gap: 6px !important;
}

body[data-shell-page="user"] .panel-shell-note {
  max-width: 28ch !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-shell-page="user"] .conversation-meta {
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body[data-shell-page="user"] .composer {
  margin: 0 14px 14px !important;
  padding: 12px 12px 14px !important;
  border: 1px solid rgba(231, 216, 176, 0.18) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at top left, rgba(240, 201, 107, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(248, 238, 216, 0.98) 0%, rgba(231, 215, 184, 0.98) 100%) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2) !important;
}

body[data-shell-page="user"] .composer-row textarea {
  min-height: 86px !important;
  border-color: rgba(92, 68, 40, 0.18) !important;
  background: rgba(255, 251, 243, 0.98) !important;
}

body[data-shell-page="user"] .composer-row button {
  background: linear-gradient(180deg, rgba(240, 201, 107, 1) 0%, rgba(171, 107, 33, 1) 100%) !important;
  color: #1d160f !important;
}

body[data-shell-page="user"] .shell-column-rooms,
body[data-shell-page="user"] .shell-column-detail {
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
}

body[data-shell-page="user"] .conversation-stage-side,
body[data-shell-page="user"] .conversation-tools,
body[data-shell-page="user"] .chat-detail {
  display: flex !important;
}

@media (max-width: 1180px) {
  body[data-shell-page="user"] .layout-user-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail {
    position: static !important;
  }

  body[data-shell-page="user"] .rooms,
  body[data-shell-page="user"] .conversation,
  body[data-shell-page="user"] .chat-detail {
    min-height: auto !important;
  }
}
@media (max-width: 860px) {
  body[data-shell-page="user"] .conversation-overview,
  body[data-shell-page="user"] .overview-workflow-progress,
  body[data-shell-page="user"] .chat-detail-card-workflow {
    min-width: 0 !important;
  }

  body[data-shell-page="user"] .workflow-progress {
    min-width: 0 !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-title {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }

  body[data-shell-page="user"] .workflow-progress-steps {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 2px !important;
  }

  body[data-shell-page="user"] .workflow-progress-step {
    flex: 0 0 clamp(112px, 42vw, 150px) !important;
    padding: 8px 9px !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-marker {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  body[data-shell-page="user"] .workflow-progress-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-workflow {
    gap: 6px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
@media (max-width: 860px) {
  body[data-shell-page="user"] .conversation-overview,
  body[data-shell-page="user"] .overview-workflow-progress,
  body[data-shell-page="user"] .chat-detail-card-workflow {
    min-width: 0 !important;
  }

  body[data-shell-page="user"] .workflow-progress {
    min-width: 0 !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-title {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }

  body[data-shell-page="user"] .workflow-progress-steps {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 2px !important;
  }

  body[data-shell-page="user"] .workflow-progress-step {
    flex: 0 0 clamp(112px, 42vw, 150px) !important;
    padding: 8px 9px !important;
    gap: 6px !important;
  }

  body[data-shell-page="user"] .workflow-progress-marker {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  body[data-shell-page="user"] .workflow-progress-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-workflow {
    gap: 6px !important;
  }

  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="user"] .chat-detail-card-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ── Message entrance animations ── */

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageSlideInSelf {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pendingShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes sendPulse {
  0% { box-shadow: 0 0 0 0 rgba(24, 105, 91, 0.35); }
  70% { box-shadow: 0 0 0 10px rgba(24, 105, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 105, 91, 0); }
}

@keyframes echoAppear {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  40% {
    opacity: 0.7;
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes unreadDividerSlide {
  from {
    opacity: 0;
    transform: scaleX(0.3);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes focusRingPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(24, 105, 91, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(24, 105, 91, 0.12); }
}

.message-row {
  animation: messageSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-row.self {
  animation: messageSlideInSelf 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-row[data-message-kind="system"] {
  animation-duration: 200ms;
}

.message-row[data-message-kind="pending"] {
  animation: echoAppear 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-row[data-message-kind="pending"] .message {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(24, 105, 91, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: pendingShimmer 1.8s ease-in-out infinite;
}

body[data-shell-page="user"] .message-row[data-message-kind="pending"] .message {
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(241, 252, 248, 0.98) 50%,
    rgba(255, 255, 255, 0.98) 100%
  );
  background-size: 200% 100%;
}

.timeline-divider {
  animation: unreadDividerSlide 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: left center;
}

.message-row {
  animation-delay: var(--msg-stagger, 0ms);
}

.composer[data-draft-state="sending"] {
  animation: sendPulse 600ms ease-out;
}

/* ── Timeline smooth scroll ── */

.timeline {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* ── Scroll-to-bottom FAB ── */

.scroll-to-bottom {
  position: sticky;
  bottom: 12px;
  right: 0;
  align-self: flex-end;
  margin: 0 12px 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 105, 91, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: rgba(24, 105, 91, 0.9);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(24, 105, 91, 0.18);
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease;
  z-index: 5;
  display: none;
}

.scroll-to-bottom:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(24, 105, 91, 0.24);
}

.scroll-to-bottom[data-visible="true"] {
  display: inline-flex;
}

/* ── Enhanced unread divider ── */

.timeline-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-weight: 600;
}

.timeline-divider::before,
.timeline-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

body[data-shell-page="user"] .timeline-divider {
  color: rgba(24, 105, 91, 0.72);
  background: rgba(241, 252, 248, 0.6);
  border-radius: 12px;
  margin: 4px 0;
}

body[data-shell-page="admin"] .timeline-divider {
  color: rgba(201, 144, 57, 0.72);
  background: rgba(56, 43, 25, 0.3);
  border-radius: 12px;
  margin: 4px 0;
}

/* ── Message row hover micro-interaction ── */

.message-row .message {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.message-row:not(.self):hover .message {
  transform: translateX(2px);
  box-shadow: 0 8px 20px rgba(34, 24, 13, 0.06);
}

.message-row.self:hover .message {
  transform: translateX(-2px);
  box-shadow: 0 8px 20px rgba(34, 24, 13, 0.06);
}

body[data-shell-page="user"] .message-row:not(.self):hover .message {
  box-shadow: 0 14px 32px rgba(24, 105, 91, 0.14);
}

body[data-shell-page="user"] .message-row.self:hover .message {
  box-shadow: 0 14px 32px rgba(24, 105, 91, 0.14);
}

/* ── Room button active indicator ── */

.room-button.active {
  position: relative;
}

.room-button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(126, 253, 199, 0.4);
  transition: height 200ms ease;
}

/* ── Pill hover scale ── */

.pill,
.pill-room-action,
.stage-chip {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.pill:hover,
.pill-room-action:hover,
.stage-chip:hover {
  transform: translateY(-1px);
}

/* ── Focus-visible rings ── */

.room-button:focus-visible,
.composer-row textarea:focus-visible,
.composer-row button:focus-visible,
.chat-detail-link:focus-visible,
.chat-detail-actions button:focus-visible,
.scroll-to-bottom:focus-visible {
  outline: 2px solid rgba(24, 105, 91, 0.5);
  outline-offset: 2px;
}

body[data-shell-page="admin"] .room-button:focus-visible,
body[data-shell-page="admin"] .composer-row textarea:focus-visible,
body[data-shell-page="admin"] .composer-row button:focus-visible {
  outline-color: rgba(201, 144, 57, 0.5);
}

/* ── Composer focus glow ── */

.composer-row textarea:focus {
  border-color: rgba(24, 105, 91, 0.45);
  box-shadow:
    0 0 0 3px rgba(24, 105, 91, 0.08),
    0 12px 28px rgba(24, 105, 91, 0.12);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

body[data-shell-page="admin"] .composer-row textarea:focus {
  border-color: rgba(201, 144, 57, 0.45);
  box-shadow:
    0 0 0 3px rgba(201, 144, 57, 0.08),
    0 12px 28px rgba(201, 144, 57, 0.12);
}

/* ── Composer auto-resize transition ── */

.composer-row textarea {
  transition:
    height 120ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

/* ── Empty state upgrade ── */

.timeline-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(24, 105, 91, 0.2);
  background: linear-gradient(
    180deg,
    rgba(241, 252, 248, 0.5) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  max-width: 420px;
  margin: 24px auto;
}

.timeline-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  animation: emptyFloat 3s ease-in-out infinite;
}

.timeline-empty-copy {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(83, 71, 58, 0.72);
}

.timeline-empty-action {
  font-size: 12px;
  color: rgba(24, 105, 91, 0.7);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

body[data-shell-page="admin"] .timeline-empty-card {
  border-color: rgba(201, 144, 57, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.5) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
}

body[data-shell-page="admin"] .timeline-empty-action {
  color: rgba(201, 144, 57, 0.7);
}

/* ── Conversation switch transition ── */

.timeline[data-switching="true"] {
  opacity: 0.4;
  transform: scale(0.995);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.timeline {
  transition:
    opacity 200ms ease 60ms,
    transform 200ms ease 60ms;
}

/* ── Send button active state ── */

.composer-row button:active {
  transform: scale(0.96);
  transition: transform 80ms ease;
}

.composer-row button {
  transition:
    transform 120ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

/* ── Avatar online pulse ── */

.message-avatar[data-online="true"]::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(126, 253, 199, 0.4);
  animation: focusRingPulse 2.4s ease-in-out infinite;
}

.message-avatar {
  position: relative;
}

/* ── Responsive: reduce animations for narrow screens ── */

@media (max-width: 640px) {
  .message-row {
    animation-duration: 180ms;
  }

  .timeline-empty-title {
    animation: none;
  }

  .message-row:not(.self):hover .message,
  .message-row.self:hover .message {
    transform: none;
  }
}

/* ── Respect reduced motion preference ── */

@media (prefers-reduced-motion: reduce) {
  .message-row,
  .timeline-divider,
  .timeline-empty-title,
  .composer[data-draft-state="sending"],
  .message-avatar[data-online="true"]::after {
    animation: none !important;
  }

  .timeline {
    scroll-behavior: auto;
    transition: none;
  }

  .message-row .message,
  .pill,
  .pill-room-action,
  .stage-chip,
  .scroll-to-bottom,
  .composer-row button,
  .composer-row textarea {
    transition: none;
  }
}

/* ── Typing / sending indicator ── */

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.timeline-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12px;
  color: rgba(83, 71, 58, 0.6);
  font-family: var(--font-mono);
}

.timeline-typing-dots {
  display: flex;
  gap: 3px;
}

.timeline-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(24, 105, 91, 0.5);
  animation: typingDot 1.4s ease-in-out infinite;
}

.timeline-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.timeline-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

body[data-shell-page="admin"] .timeline-typing-dot {
  background: rgba(201, 144, 57, 0.5);
}

/* ── Message grouping ── */

.message-row[data-grouped="true"] .message-avatar {
  visibility: hidden;
}

.message-row[data-grouped="true"] .message-header {
  margin-bottom: 2px;
}

.message-row[data-grouped="true"] .message-sender,
.message-row[data-grouped="true"] .message-role {
  display: none;
}

.message-row[data-grouped="true"] .message {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  margin-top: -4px;
  padding-top: 8px;
}

.message-row.self[data-grouped="true"] .message {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

/* ── Message timestamp tooltip ── */

.message-time {
  position: relative;
  cursor: default;
}

.message-time[data-full-time]:hover::after {
  content: attr(data-full-time);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(30, 26, 23, 0.92);
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* ── Narrow-screen chat pane toggle ── */

.chat-pane-toggle {
  display: none;
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 105, 91, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: rgba(24, 105, 91, 0.85);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(24, 105, 91, 0.1);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
}

.chat-pane-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(24, 105, 91, 0.16);
}

@media (max-width: 960px) {
  .chat-pane-toggle {
    display: block;
  }

  /* Default: show only the message stream (scene column) on narrow screens */
  body[data-shell-page="user"] .shell-column-rooms,
  body[data-shell-page="user"] .shell-column-detail,
  body[data-shell-page="admin"] .sidebar-stack-admin,
  body[data-shell-page="admin"] .chat-detail,
  body[data-shell-page="unified"] .sidebar-stack,
  body[data-shell-page="unified"] .chat-detail {
    display: none !important;
  }

  /* Explicit mode overrides */
  body[data-chat-pane-mode="thread"] .shell-column-rooms,
  body[data-chat-pane-mode="thread"] .shell-column-detail {
    display: none !important;
  }

  body[data-chat-pane-mode="rooms"] .shell-column-scene,
  body[data-chat-pane-mode="rooms"] .shell-column-detail {
    display: none !important;
  }

  body[data-chat-pane-mode="rooms"] .shell-column-rooms,
  body[data-chat-pane-mode="rooms"] .sidebar-stack-admin,
  body[data-chat-pane-mode="rooms"] .sidebar-stack {
    display: block !important;
  }
}

body[data-shell-page="admin"] .chat-pane-toggle {
  border-color: rgba(201, 144, 57, 0.2);
  color: rgba(201, 144, 57, 0.85);
  box-shadow: 0 6px 16px rgba(201, 144, 57, 0.1);
}

body[data-shell-page="user"] .chat-pane-toggle {
  border-color: rgba(44, 28, 18, 0.2);
  color: rgba(44, 28, 18, 0.85);
  box-shadow: 0 6px 16px rgba(44, 28, 18, 0.1);
  background: rgba(248, 239, 219, 0.95);
}

@media (max-width: 960px) {
  body[data-chat-pane-mode="detail"] .shell-column-rooms,
  body[data-chat-pane-mode="detail"] .shell-column-scene {
    display: none !important;
  }

  body[data-chat-pane-mode="detail"] .shell-column-detail,
  body[data-chat-pane-mode="detail"] .chat-detail {
    display: block !important;
  }
}

/* ── Visual consistency: unified accent-based design across all shell pages ── */

body[data-shell-page="user"] .eyebrow,
body[data-shell-page="admin"] .eyebrow,
body[data-shell-page="unified"] .eyebrow {
  color: rgba(126, 253, 199, 0.72);
}

body[data-shell-page="user"] h1,
body[data-shell-page="admin"] h1,
body[data-shell-page="unified"] h1 {
  color: var(--ink);
}

body[data-shell-page="user"] .panel-kicker,
body[data-shell-page="admin"] .panel-kicker,
body[data-shell-page="unified"] .panel-kicker {
  color: rgba(126, 253, 199, 0.68);
}

body[data-shell-page="user"] .panel-shell-title,
body[data-shell-page="admin"] .panel-shell-title,
body[data-shell-page="unified"] .panel-shell-title {
  color: var(--ink);
}

body[data-shell-page="user"] .hero-note,
body[data-shell-page="admin"] .hero-note,
body[data-shell-page="unified"] .hero-note {
  color: rgba(126, 253, 199, 0.72);
}

/* Badge contrast - unified accent style */
body[data-shell-page="user"] .badge,
body[data-shell-page="admin"] .badge,
body[data-shell-page="unified"] .badge {
  background: rgba(126, 253, 199, 0.06);
  border-color: rgba(126, 253, 199, 0.14);
  color: rgba(126, 253, 199, 0.85);
}

/* Pill contrast - unified accent style */
body[data-shell-page="user"] .pill,
body[data-shell-page="admin"] .pill,
body[data-shell-page="unified"] .pill {
  background: rgba(255, 252, 247, 0.92);
  border-color: rgba(217, 204, 183, 0.64);
  color: rgba(99, 83, 63, 0.88);
}

body[data-shell-page="user"] .stage-chip,
body[data-shell-page="admin"] .stage-chip,
body[data-shell-page="unified"] .stage-chip {
  background: rgba(255, 250, 241, 0.92);
  border-color: rgba(217, 204, 183, 0.56);
  color: rgba(99, 83, 63, 0.84);
}

/* Panel spacing uniform */
body[data-shell-page="user"] .panel-shell-header,
body[data-shell-page="admin"] .panel-shell-header,
body[data-shell-page="unified"] .panel-shell-header {
  padding: 14px 16px 10px;
  gap: 12px;
}

body[data-shell-page="user"] .conversation-stage,
body[data-shell-page="admin"] .conversation-stage,
body[data-shell-page="unified"] .conversation-stage {
  padding: 14px 16px 12px;
  margin: 0 0 10px;
}

/* Composer visual hierarchy */
body[data-shell-page="user"] .composer,
body[data-shell-page="admin"] .composer,
body[data-shell-page="unified"] .composer {
  margin: 12px 14px 14px;
  padding: 12px 14px 14px;
  border-radius: 18px;
}

/* Detail-card visual hierarchy - unified accent style */
body[data-shell-page="admin"] .chat-detail-card-shell,
body[data-shell-page="unified"] .chat-detail-card-shell {
  border-radius: 16px;
  border: 1px solid rgba(126, 253, 199, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(248, 253, 250, 0.94) 100%
  );
  box-shadow: var(--shadow-soft);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SFC / 像素住宅聊天壳 - user 页专用
   参考原型：docs/mockups/sfc-canvas-draft.html
   气质：16-bit RPG、木质边框、像素画布、暖色室内、深色底聊天条
   ───────────────────────────────────────────────────────────────────────────── */

/* SFC 主题激活时，压掉现代玻璃控制台风格 */
body[data-sfc-theme] {
  --sfc-bg: #141014;
  --sfc-panel: #221920;
  --sfc-panel-2: #2d222b;
  --sfc-line: #e7d8b0;
  --sfc-text: #f6efdc;
  --sfc-muted: #b8a98b;
  --sfc-gold: #f3c96c;
  --sfc-green: #9ac47c;
  --sfc-cyan: #87d0df;
  --sfc-rose: #d96b83;
  --sfc-wood-1: #8c5d33;
  --sfc-wood-2: #5e3721;
  --sfc-ink: #0d0b10;
  --sfc-wood-light: #cfa07a;
  --sfc-cream: #fff3dc;
  color-scheme: dark;
  background: 
    radial-gradient(circle at top, rgba(243, 201, 108, 0.08), transparent 30%),
    linear-gradient(180deg, #100d12 0%, #151118 48%, #0e0c10 100%);
}

/* SFC 壳层容器 */
.sfc-shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 14px 14px 18px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 薄状态条 - 游戏 HUD，不是大 topbar */
.sfc-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border: 2px solid rgba(231, 216, 176, 0.42);
  background: rgba(34, 25, 32, 0.85);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-title {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  color: var(--sfc-gold);
  font-family: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

.hud-right {
  display: flex;
  gap: 8px;
}

.hud-pill {
  border: 1px solid rgba(231, 216, 176, 0.28);
  background: rgba(45, 34, 43, 0.72);
  color: var(--sfc-muted);
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.hud-rail-toggle {
  display: none;
}

/* SFC 主布局：左窄栏 + 中央房间 + 底部聊天 */
.sfc-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1;
  border: 2px solid rgba(231, 216, 176, 0.52);
  background: rgba(15, 12, 17, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* 左侧窄功能栏 - 木框/旧终端感 */
.sfc-rail {
  border-right: 2px solid rgba(231, 216, 176, 0.36);
  background:
    linear-gradient(180deg, rgba(240, 222, 180, 0.06), transparent 14%),
    linear-gradient(180deg, #84755f 0%, #6f5d48 100%);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-title {
  color: #1b1510;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

/* 会话按钮 - 像素风格 */
.rail-list .room-button,
.room-section-list .room-button {
  border: 1px solid rgba(24, 18, 14, 0.16);
  background: rgba(255, 247, 224, 0.22);
  color: #18120e;
  padding: 8px 10px;
  border-radius: 0;
  font-size: 13px;
  display: block;
  text-align: left;
  min-height: auto;
  box-shadow: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.rail-list .room-button:hover,
.room-section-list .room-button:hover {
  background: rgba(255, 239, 193, 0.7);
  border-color: rgba(24, 18, 14, 0.24);
}

.rail-list .room-button.active,
.room-section-list .room-button.active {
  background: rgba(255, 239, 193, 0.88);
  font-weight: 700;
  border-color: rgba(24, 18, 14, 0.28);
}

.rail-list .room-button .room-avatar,
.room-section-list .room-button .room-avatar,
.rail-list .room-button .room-kicker,
.room-section-list .room-button .room-kicker,
.rail-list .room-button .room-badges,
.room-section-list .room-button .room-badges,
.rail-list .room-button .room-inline-preview-card,
.room-section-list .room-button .room-inline-preview-card,
.rail-list .room-button .room-inline-actions,
.room-section-list .room-button .room-inline-actions,
.rail-list .room-button .room-inline-progress,
.room-section-list .room-button .room-inline-progress,
.rail-list .room-button .room-top-meta,
.room-section-list .room-button .room-top-meta,
.rail-list .room-button .room-activity,
.room-section-list .room-button .room-activity,
.rail-list .room-button .room-preview,
.room-section-list .room-button .room-preview,
.rail-list .room-button .room-preview-shell,
.room-section-list .room-button .room-preview-shell,
.rail-list .room-button .room-tag-row,
.room-section-list .room-button .room-tag-row {
  display: none;
}

.rail-list .room-button .room-content,
.room-section-list .room-button .room-content {
  display: block;
}

.rail-list .room-button .room-name,
.room-section-list .room-button .room-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #18120e;
  font-size: 13px;
  font-weight: 600;
}

.rail-list .room-button .room-preview,
.rail-list .room-button .room-sub,
.room-section-list .room-button .room-preview,
.room-section-list .room-button .room-sub {
  color: #4a3a28;
  font-size: 11px;
  margin-top: 2px;
}

.rail-list .room-button.active .room-name,
.room-section-list .room-button.active .room-name {
  color: #0c0908;
}

/* 中央房间场景 - 视觉重心 */
.sfc-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0a0810;
  min-height: 0;
}

.stage-canvas-wrap {
  position: relative;
  flex: 1 1 200px;
  min-height: 200px;
  max-height: 280px;
  padding: 10px;
  background:
    /* 近处路面 */
    linear-gradient(180deg, transparent 0%, transparent 65%, rgba(20, 14, 10, 0.5) 65%, rgba(20, 14, 10, 0.8) 100%),
    /* 建筑轮廓层 */
    linear-gradient(180deg, transparent 0%, transparent 35%, rgba(15, 12, 22, 0.6) 35%, rgba(15, 12, 22, 0.6) 55%, transparent 55%),
    /* 网格线 */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 20px,
      rgba(101, 67, 33, 0.12) 20px,
      rgba(101, 67, 33, 0.12) 21px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 20px,
      rgba(101, 67, 33, 0.08) 20px,
      rgba(101, 67, 33, 0.08) 21px
    ),
    /* 夜空 */
    linear-gradient(180deg, #0d1018 0%, #1a1420 40%, #241a12 70%, #1a120e 100%);
  overflow: hidden;
}

.stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(135deg, rgba(210, 179, 111, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, #3d2e22 0%, #1a1410 100%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 3px solid rgba(231, 216, 176, 0.35);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(210, 179, 111, 0.06);
  position: relative;
}

/* 城市页 canvas 默认视觉 */
.sfc-city-shell .stage-canvas {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(210, 179, 111, 0.22) 0%, transparent 55%),
    linear-gradient(180deg, #4a3728 0%, #2a1e17 60%, #1a120e 100%);
}

/* 住宅页 scene-mini-canvas 默认视觉 */
.scene-mini-canvas {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(211, 141, 76, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, #2a1e17 0%, #151118 100%);
}

/* 底部聊天条 - 深色，贴着房间 */
.sfc-chat-bar {
  border-top: 3px solid rgba(101, 67, 33, 0.45);
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.95) 0%, rgba(15, 10, 8, 0.98) 100%);
  padding: 12px 14px 8px;
  min-height: 120px;
  max-height: 320px;
  overflow: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 90, 43, 0.3) transparent;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 游戏 HUD 聊天消息 - 参考图底部的 RPG 聊天风格 */
.chat-log .message {
  border-radius: 4px;
  border: 1px solid rgba(101, 67, 33, 0.35);
  background: rgba(20, 14, 10, 0.88);
  padding: 8px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.04);
  margin: 0 4px;
  max-width: 85%;
  font-family: var(--font-mono);
}

.chat-log .message.self {
  margin-left: auto;
  background: rgba(45, 34, 43, 0.7);
  border-color: rgba(139, 90, 43, 0.4);
}

/* 系统消息 - 游戏公告风格 */
.chat-log .message[data-message-kind="system"] {
  background: rgba(30, 20, 10, 0.92);
  border-color: rgba(210, 179, 111, 0.3);
  border-left: 3px solid rgba(210, 179, 111, 0.5);
  max-width: 95%;
}

.chat-log .message[data-message-kind="system"] .message-sender::before {
  content: "<系统> ";
  color: #d2b36f;
}

.chat-log .message-header {
  color: rgba(160, 140, 110, 0.8);
  font-size: 11px;
  margin-bottom: 2px;
}

.chat-log .message-sender {
  color: #d2b36f;
  font-weight: 600;
}

.chat-log .message-body {
  color: #e8dcc8;
  font-size: 14px;
  line-height: 1.5;
}

.chat-log .message.self .message-sender,
.chat-log .message.self .message-body {
  color: #f5ead6;
}

/* 聊天区整体氛围 - 像游戏内聊天窗口 */
.sfc-chat-bar {
  border-top: 3px solid rgba(101, 67, 33, 0.45);
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.95) 0%, rgba(15, 10, 8, 0.98) 100%);
  padding: 12px 14px 8px;
  min-height: 100px;
  max-height: 220px;
  overflow: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 90, 43, 0.3) transparent;
}

/* 输入框 - 轻量 action bar */
.sfc-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(15, 10, 8, 0.85);
  border-top: 1px solid rgba(101, 67, 33, 0.35);
  flex-shrink: 0;
}

.sfc-composer textarea {
  border: 1px solid rgba(101, 67, 33, 0.5);
  padding: 7px 10px;
  color: #e8dcc8;
  background: rgba(20, 14, 10, 0.7);
  font-size: 14px;
  border-radius: 0;
  resize: none;
  min-height: 36px;
  font-family: inherit;
  touch-action: manipulation;
  line-height: 1.4;
}

.sfc-composer textarea::placeholder {
  color: rgba(160, 128, 96, 0.55);
}

.sfc-composer textarea:focus {
  outline: 1px solid rgba(212, 168, 83, 0.5);
  outline-offset: 0;
  border-color: rgba(212, 168, 83, 0.4);
}

.sfc-composer button {
  border: 1px solid rgba(101, 67, 33, 0.5);
  padding: 7px 14px;
  background: rgba(196, 92, 58, 0.85);
  color: #f0d878;
  font-weight: 600;
  font-size: 13px;
  border-radius: 0;
  cursor: pointer;
  transition: background 120ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-pixel);
  letter-spacing: 1px;
}

.sfc-composer button:hover {
  background: rgba(196, 92, 58, 1);
}

.sfc-composer button:active {
  background: rgba(180, 80, 48, 1);
}

.sfc-composer button:focus {
  outline: 1px solid rgba(212, 168, 83, 0.5);
}

/* ── City hub 桌面端：彻底隐藏所有非必要辅助元素 ── */
body[data-sfc-theme="city"] .composer-status,
body[data-sfc-theme="city"] .composer-hero,
body[data-sfc-theme="city"] .composer-context,
body[data-sfc-theme="city"] .composer-meta,
body[data-sfc-theme="city"] .composer-tip,
body[data-sfc-theme="city"] .caretaker-status-line,
body[data-sfc-theme="city"] .composer-hints,
body[data-sfc-theme="city"] .chat-priority-badge {
  display: none !important;
}

body[data-sfc-theme="city"] #composer {
  max-height: 80px;
  min-height: 40px;
  overflow: hidden;
}

body[data-sfc-theme="city"] #composer-input::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 响应式：窄屏时左栏变为抽屉 */
@media (max-width: 720px) {
  .sfc-layout {
    grid-template-columns: 1fr;
  }

  .sfc-rail {
    position: fixed;
    left: 0;
    top: 40px;
    bottom: 0;
    width: 180px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    display: flex;
    flex-direction: column;
    background:
      linear-gradient(180deg, rgba(240, 222, 180, 0.06), transparent 14%),
      linear-gradient(180deg, #2d222b 0%, #221920 100%);
    border-right: 2px solid rgba(231, 216, 176, 0.36);
  }

  .sfc-rail.open {
    transform: translateX(0);
  }

  .hud-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(231, 216, 176, 0.36);
    background: rgba(45, 34, 43, 0.72);
    color: var(--sfc-gold);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }

  .sfc-shell {
    padding: 8px 8px 12px;
  }

  .sfc-hud {
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 0;
    padding: 6px 10px;
  }

  .stage-canvas-wrap {
    min-height: 140px;
    padding: 6px;
  }

  /* Hub 移动端精简 */
  .sfc-layout.sfc-city-layout {
    grid-template-columns: 1fr;
  }

  .sfc-city-stage {
    min-width: 0;
    min-height: 0;
  }

  .sfc-city-stage .stage-canvas-wrap {
    flex: 0 0 100px !important;
    height: auto !important;
    min-height: 90px !important;
    max-height: 130px !important;
    padding: 5px !important;
    overflow: hidden !important;
    background:
      linear-gradient(180deg, rgba(10,8,12,0.6) 0%, transparent 40%),
      linear-gradient(0deg, rgba(10,8,12,0.85) 0%, transparent 45%),
      url('./assets/pixel/chinese-modern-city/backgrounds/hub_mobile_9x16.avif') !important;
    background-size: 100% 100%, 100% 100%, cover !important;
    background-position: center, center, center !important;
    image-rendering: pixelated;
  }

  .sfc-city-stage .stage-canvas-wrap canvas,
  .sfc-city-stage .stage-canvas-wrap .pixel-scene-decor {
    max-height: 90px !important;
  }

  .sfc-city-stage .pixel-city-label {
    display: none !important;
  }

  .sfc-city-chat {
    flex: 1 1 auto;
    min-height: 160px;
    max-height: none;
    padding: 8px 10px;
  }

  .chat-log .message {
    max-width: 86%;
    padding: 6px 9px;
    margin: 0 2px;
  }

  .chat-log .message-body {
    font-size: 15px;
  }

  .sfc-composer {
    padding: 5px 8px;
    gap: 4px;
    border-top: 1px solid rgba(101, 67, 33, 0.25);
  }

  .sfc-composer textarea {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 15px;
    border: 1px solid rgba(101, 67, 33, 0.4);
  }

  .sfc-composer button {
    padding: 6px 10px;
    font-size: 12px;
  }

  .composer-context,
  .composer-hero,
  .composer-tip,
  .composer-status,
  .composer-hints,
  .composer-meta,
  .caretaker-status-line,
  .chat-priority-badge {
    display: none !important;
  }

  .conversation-overview {
    margin: 0 8px 8px;
    padding: 8px 10px;
    border-radius: 8px;
  }

  .conversation-overview .overview-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .conversation-overview .overview-title {
    font-size: 14px;
  }

  .conversation-overview .overview-context,
  .conversation-overview .overview-preview-card {
    display: none;
  }

  .conversation-overview {
    display: none;
  }

  .thread-status-rail {
    display: none;
  }

  .stage-canvas-wrap {
    min-height: 180px;
  }
}

/* ── 压掉旧 user 页的现代玻璃控制台风格 ── */

/* 完全隐藏旧的 topbar、hero、panel-shell-header 等 */
body[data-sfc-theme] .topbar,
body[data-sfc-theme] .layout-user-shell,
body[data-sfc-theme] .sidebar-stack-user,
body[data-sfc-theme] .shell-column-detail,
body[data-sfc-theme] .chat-detail,
body[data-sfc-theme] .conversation-stage-copy .panel-kicker,
body[data-sfc-theme] .conversation-stage-copy .conversation-stage-title,
body[data-sfc-theme] .conversation-stage-note,
body[data-sfc-theme] .conversation-stream-header,
body[data-sfc-theme] .conversation-stream-note,
body[data-sfc-theme] .panel-shell-header,
body[data-sfc-theme] .panel-shell-note,
body[data-sfc-theme] .panel-kicker,
body[data-sfc-theme] .chat-detail-summary,
body[data-sfc-theme] .chat-detail-card-shell,
body[data-sfc-theme] .composer-hints {
  display: none !important;
}

/* 保留必要的 canvas 和 timeline */
body[data-sfc-theme] #room-stage-canvas,
body[data-sfc-theme] #timeline,
body[data-sfc-theme] #composer-input,
body[data-sfc-theme] #composer-send {
  display: block !important;
}

/* wechat 模式下 composer 用 flex 布局 */
body[data-chat-style="wechat"] #composer.wechat-composer {
  display: flex !important;
}

/* timeline 消息样式覆盖 */
body[data-sfc-theme] .timeline {
  background: transparent;
  padding: 0;
  gap: 6px;
}

body[data-sfc-theme] .timeline-divider {
  display: none;
}

body[data-sfc-theme] .message {
  border-radius: 0;
  box-shadow: none;
}

/* 像素风消息时间戳 */
body[data-sfc-theme] .message-time {
  color: var(--sfc-muted);
  font-size: 10px;
  font-family: var(--font-mono);
}


/* ─────────────────────────────────────────────────────────────────────────────
   城邦公共页 SFC City 主题 - hub/index.html
   气质：像素城邦、公共频道、木框、城邦感
   ───────────────────────────────────────────────────────────────────────────── */

body[data-sfc-theme="city"] {
  --sfc-bg: #141014;
  --sfc-panel: #221920;
  --sfc-line: #e7d8b0;
  --sfc-text: #f6efdc;
  --sfc-muted: #b8a98b;
  --sfc-gold: #f3c96c;
  --sfc-city-wood: #6f5d48;
  --sfc-city-light: #cfa07a;
  color-scheme: dark;
  background: 
    radial-gradient(circle at top, rgba(243, 201, 108, 0.1), transparent 35%),
    linear-gradient(180deg, #100d12 0%, #151118 48%, #0e0c10 100%);
}

.sfc-city-shell .sfc-hud .hud-title {
  color: var(--sfc-gold);
}

.sfc-city-layout {
  grid-template-columns: 128px minmax(0, 1fr);
}

.sfc-city-rail {
  background:
    linear-gradient(180deg, rgba(240, 222, 180, 0.05), transparent 12%),
    linear-gradient(180deg, #7a6b58 0%, #5e4d3a 100%);
  padding: 10px 8px;
}

.sfc-city-rail .rail-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.sfc-city-rail .rail-item {
  display: block;
  padding: 5px 8px;
  border: 1px solid rgba(24, 18, 14, 0.14);
  background: rgba(255, 247, 224, 0.18);
  color: #18120e;
  text-decoration: none;
  font-size: 12px;
  transition: background 100ms ease;
}

.sfc-city-rail .rail-item:hover {
  background: rgba(255, 239, 193, 0.6);
}

.rail-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(24, 18, 14, 0.12);
}

.rail-section-title {
  color: rgba(27, 21, 16, 0.6);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* 城邦 rail 里的会话列表要极度紧凑，不能形成亮块 */
.sfc-city-rail .room-section-list {
  padding: 0;
  gap: 3px;
}

.sfc-city-rail .room-section-list .room-button {
  display: block;
  padding: 3px 6px;
  border-radius: 2px;
  background: rgba(255, 247, 224, 0.1);
  border: 1px solid rgba(24, 18, 14, 0.12);
  margin-bottom: 0;
  font-size: 11px;
}

.sfc-city-rail .room-section-list .room-button:hover {
  background: rgba(255, 239, 193, 0.35);
}

.sfc-city-rail .room-section-list .room-button .room-content {
  gap: 0;
  min-width: 0;
}

.sfc-city-rail .room-section-list .room-button .room-name {
  font-size: 11px;
  font-weight: 500;
  color: #18120e;
}

/* 强制 room-button 内部布局扁平化，防止隐藏元素撑高 */
.sfc-city-rail .room-section-list .room-button .room-content,
.sfc-city-rail .room-section-list .room-button .room-topline,
.sfc-city-rail .room-section-list .room-button .room-title-stack {
  display: block;
  gap: 0;
  min-height: 0;
}

.sfc-city-rail .room-section-list .room-button .room-top-meta,
.sfc-city-rail .room-section-list .room-button .room-kicker,
.sfc-city-rail .room-section-list .room-button .room-activity,
.sfc-city-rail .room-section-list .room-button .room-badges,
.sfc-city-rail .room-section-list .room-button .room-sub,
.sfc-city-rail .room-section-list .room-button .room-status-line,
.sfc-city-rail .room-section-list .room-button .room-preview,
.sfc-city-rail .room-section-list .room-button .room-tag-row {
  display: none !important;
}

/* 城邦 rail 隐藏会话分区 header 和 digest，减少阅读感，强化导航感 */
.sfc-city-rail .room-section-header,
.sfc-city-rail .room-digest {
  display: none !important;
}

.sfc-city-rail .room-section {
  gap: 3px;
}

.sfc-city-stage .stage-canvas-wrap {
  min-height: 240px;
  background:
    linear-gradient(180deg, rgba(10,8,12,0.55) 0%, transparent 40%),
    linear-gradient(0deg, rgba(10,8,12,0.8) 0%, transparent 45%),
    url('./assets/pixel/chinese-modern-city/backgrounds/hub_desktop_16x9.avif');
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center;
  image-rendering: pixelated;
}

.sfc-city-stage .stage-canvas {
  background: transparent !important;
}

.sfc-city-chat {
  min-height: 160px;
  max-height: 320px;
}

.sfc-city-composer {
  background: rgba(15, 10, 8, 0.7);
  border-top: 1px solid rgba(101, 67, 33, 0.25);
  max-height: 80px;
  overflow: hidden;
}

/* 像素城邦场景装饰层 - 在 canvas 之上营造氛围 */
.pixel-scene-decor {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  z-index: 1;
}

.pixel-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(139, 90, 43, 0.25),
      rgba(139, 90, 43, 0.25) 14px,
      rgba(160, 110, 55, 0.3) 14px,
      rgba(160, 110, 55, 0.3) 28px
    );
  border-top: 3px solid rgba(101, 67, 33, 0.5);
}

.pixel-window-light {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 44px;
  height: 44px;
  background: rgba(255, 220, 150, 0.4);
  box-shadow:
    0 0 30px rgba(255, 220, 150, 0.25),
    inset 0 0 0 3px rgba(255, 220, 150, 0.55),
    inset 14px 0 0 0 rgba(255, 220, 150, 0.25),
    inset 0 14px 0 0 rgba(255, 220, 150, 0.25),
    inset 28px 0 0 0 rgba(255, 220, 150, 0.25),
    inset 0 28px 0 0 rgba(255, 220, 150, 0.25);
}

.pixel-city-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 10, 8, 0.85);
  border: 1px solid rgba(212, 168, 83, 0.35);
  color: rgba(240, 216, 120, 0.85);
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
  z-index: 2;
}

/* ── 像素家具：参考图中的房间元素 ── */
.pixel-furniture {
  position: absolute;
  pointer-events: none;
}

/* 电脑桌（左侧） */
.pixel-desk {
  bottom: 18%;
  left: 8%;
  width: 64px;
  height: 52px;
  background: #5c4033;
  border: 2px solid rgba(101, 67, 33, 0.6);
  box-shadow: inset 0 4px 0 rgba(139, 90, 43, 0.3);
}

.pixel-desk::before {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 4px;
  width: 8px;
  height: 12px;
  background: #4a3328;
}

.pixel-desk::after {
  content: "";
  position: absolute;
  bottom: -12px;
  right: 4px;
  width: 8px;
  height: 12px;
  background: #4a3328;
}

.pixel-monitor {
  position: absolute;
  top: -18px;
  left: 8px;
  width: 44px;
  height: 28px;
  background: #1a1a2e;
  border: 2px solid #3d3d5c;
  box-shadow: inset 0 0 8px rgba(100, 200, 255, 0.15);
}

.pixel-monitor::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 8px;
  background: #3d3d5c;
}

.pixel-keyboard {
  position: absolute;
  top: 16px;
  left: 10px;
  width: 40px;
  height: 8px;
  background: #2a2a3e;
  border: 1px solid #3d3d5c;
}

/* 沙发（中间偏右） */
.pixel-sofa {
  bottom: 16%;
  right: 18%;
  width: 80px;
  height: 44px;
  background: #8b6914;
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 6px 0 rgba(160, 120, 50, 0.3);
}

.pixel-sofa::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 4px;
  width: 68px;
  height: 20px;
  background: #7a5c12;
  border: 2px solid rgba(139, 90, 43, 0.4);
  border-radius: 6px 6px 0 0;
}

/* 龙虾角色（沙发上） */
.pixel-lobster {
  position: absolute;
  top: -36px;
  left: 20px;
  width: 36px;
  height: 28px;
  background: #c44;
  border: 2px solid #a33;
  border-radius: 50% 50% 40% 40%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.pixel-lobster::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 4px;
  width: 10px;
  height: 12px;
  background: #c44;
  border: 2px solid #a33;
  border-radius: 50%;
}

.pixel-lobster::after {
  content: "";
  position: absolute;
  top: -8px;
  right: 4px;
  width: 10px;
  height: 12px;
  background: #c44;
  border: 2px solid #a33;
  border-radius: 50%;
}

/* 咖啡桌（沙发前） */
.pixel-coffee-table {
  bottom: 10%;
  right: 24%;
  width: 44px;
  height: 32px;
  background: #6b4226;
  border: 2px solid rgba(101, 67, 33, 0.5);
  box-shadow: inset 0 3px 0 rgba(139, 90, 43, 0.3);
}

.pixel-coffee-table::before {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 4px;
  width: 6px;
  height: 10px;
  background: #5a3620;
}

.pixel-coffee-table::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 4px;
  width: 6px;
  height: 10px;
  background: #5a3620;
}

.pixel-cup {
  position: absolute;
  top: 6px;
  left: 14px;
  width: 12px;
  height: 10px;
  background: #e8e0d0;
  border: 1px solid #c8c0b0;
}

.pixel-cup::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 2px;
  width: 6px;
  height: 6px;
  background: rgba(255, 220, 150, 0.4);
  border-radius: 50%;
}

/* 植物（右侧） */
.pixel-plant {
  bottom: 16%;
  right: 6%;
  width: 24px;
  height: 40px;
  background: #4a7c3f;
  border: 2px solid rgba(60, 100, 50, 0.5);
  border-radius: 40% 40% 0 0;
}

.pixel-plant::before {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 12px;
  background: #8b4513;
  border: 1px solid #6b3510;
}

/* 书架（左侧靠后） */
.pixel-bookshelf {
  bottom: 32%;
  left: 4%;
  width: 36px;
  height: 56px;
  background: #5c4033;
  border: 2px solid rgba(101, 67, 33, 0.5);
}

.pixel-bookshelf::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: rgba(101, 67, 33, 0.4);
  box-shadow: 0 14px 0 rgba(101, 67, 33, 0.4), 0 28px 0 rgba(101, 67, 33, 0.4);
}

/* 住宅页像素房间装饰 */
.pixel-room-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.pixel-room-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(139, 90, 43, 0.2),
      rgba(139, 90, 43, 0.2) 10px,
      rgba(160, 110, 55, 0.25) 10px,
      rgba(160, 110, 55, 0.25) 20px
    );
}

/* ── 迷你像素家具（user 页场景条）── */
.pixel-room-furniture {
  position: absolute;
  pointer-events: none;
}

.pixel-mini-desk {
  bottom: 8px;
  left: 12%;
  width: 32px;
  height: 24px;
  background: #5c4033;
  border: 1px solid rgba(101, 67, 33, 0.5);
}

.pixel-mini-monitor {
  position: absolute;
  top: -10px;
  left: 4px;
  width: 22px;
  height: 12px;
  background: #1a1a2e;
  border: 1px solid #3d3d5c;
}

.pixel-mini-sofa {
  bottom: 8px;
  right: 20%;
  width: 36px;
  height: 18px;
  background: #8b6914;
  border: 1px solid rgba(139, 90, 43, 0.4);
  border-radius: 4px 4px 0 0;
}

.pixel-mini-sofa::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 2px;
  width: 30px;
  height: 8px;
  background: #7a5c12;
  border: 1px solid rgba(139, 90, 43, 0.3);
  border-radius: 3px 3px 0 0;
}

.pixel-mini-plant {
  bottom: 8px;
  right: 6%;
  width: 14px;
  height: 22px;
  background: #4a7c3f;
  border: 1px solid rgba(60, 100, 50, 0.4);
  border-radius: 50% 50% 0 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   微信式聊天心智 - user 房间页
   参考原型：微信聊天界面
   气质：气泡流、左右分边、输入框贴底、scene 降为语境层
   ───────────────────────────────────────────────────────────────────────────── */

body[data-chat-style="wechat"] .sfc-shell {
  padding: 0;
  max-width: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body[data-chat-style="wechat"] .sfc-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin-bottom: 0;
}

body[data-chat-style="wechat"] .sfc-layout {
  display: none;
}

/* 微信主壳 */
.wechat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 36px; /* HUD 高度 */
  background:
    radial-gradient(circle at top, rgba(243, 201, 108, 0.06), transparent 30%),
    linear-gradient(180deg, #100d12 0%, #151118 100%);
  overflow: hidden;
}

/* 房间场景 - 语境层，更小巧 */
.wechat-scene-bar {
  height: 56px;
  padding: 6px 8px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 12px,
      rgba(101, 67, 33, 0.15) 12px,
      rgba(101, 67, 33, 0.15) 13px
    ),
    linear-gradient(180deg, #3d2a1e 0%, #1e1612 100%);
  border-bottom: 2px solid rgba(101, 67, 33, 0.35);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.scene-mini-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(211, 141, 76, 0.25) 0%, transparent 60%),
    linear-gradient(180deg, #3d2a1e 0%, #1e1612 100%);
  border: 2px solid rgba(231, 216, 176, 0.25);
}

.wechat-login-card {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1fr) minmax(180px, 0.85fr);
  gap: 10px;
  align-items: stretch;
  padding: 8px 12px;
  background:
    linear-gradient(180deg, rgba(54, 38, 28, 0.98), rgba(24, 17, 18, 0.98));
  border-bottom: 2px solid rgba(231, 216, 176, 0.22);
  color: rgba(246, 239, 220, 0.9);
}

.wechat-login-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(246, 239, 220, 0.62);
}

.wechat-login-copy strong {
  color: #f1d59d;
  font-size: 13px;
}

.wechat-login-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(211, 141, 76, 0.9);
}

.wechat-login-form {
  display: grid;
  grid-template-columns: 1fr 0.78fr 0.82fr auto;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.wechat-login-verify {
  grid-template-columns: 1fr 0.72fr auto;
}

.wechat-login-form input {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(231, 216, 176, 0.32);
  border-radius: 6px;
  padding: 0 9px;
  background: rgba(20, 15, 18, 0.85);
  color: rgba(246, 239, 220, 0.94);
  font: inherit;
  font-size: 13px;
}

.wechat-login-form input::placeholder {
  color: rgba(246, 239, 220, 0.38);
}

.wechat-login-form button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: linear-gradient(180deg, #f1d59d 0%, #cb9758 100%);
  color: #201912;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.wechat-login-form input:disabled,
.wechat-login-form button:disabled,
.wechat-composer textarea:disabled,
.wechat-composer button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* 消息流区 - 占最大面积，游戏 HUD 聊天感 */
.wechat-chat-area {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.95) 0%, rgba(15, 10, 8, 0.98) 100%);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 90, 43, 0.3) transparent;
  border-top: 2px solid rgba(101, 67, 33, 0.3);
}

.wechat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

/* 微信消息行 - 左右分边 */
.wechat-messages .message-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: 82%;
}

/* 隐藏头像 - 微信不显示消息头像 */
.wechat-messages .message-avatar {
  display: none;
}

/* 消息栈占满 */
.wechat-messages .message-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 对方消息 - 左边 */
.wechat-messages .message-row:not(.self) {
  align-self: flex-start;
}

/* 自己消息 - 右边 */
.wechat-messages .message-row.self {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
}

/* 微信气泡 - 游戏 RPG 聊天风格 */
.wechat-messages .message {
  max-width: 100%;
  border-radius: 6px;
  padding: 8px 12px;
  border: none;
  box-shadow: none;
  position: relative;
  font-family: var(--font-mono);
}

/* 对方消息气泡 - 深色木框感 */
.wechat-messages .message:not(.self) {
  background: rgba(30, 20, 14, 0.92);
  border: 1px solid rgba(101, 67, 33, 0.35);
}

.wechat-messages .message:not(.self)::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right-color: rgba(30, 20, 14, 0.92);
}

/* 自己消息气泡 - 金色渐变 */
.wechat-messages .message.self {
  background: linear-gradient(180deg, #f1d59d 0%, #cb9758 100%);
  color: #201912;
  border: 1px solid rgba(201, 144, 57, 0.3);
}

/* Override dark-green user-page self-messages back to gold WeChat style */
body[data-shell-page="user"] .wechat-messages .message.self {
  background: linear-gradient(180deg, #f1d59d 0%, #cb9758 100%) !important;
  border-color: rgba(201, 144, 57, 0.3) !important;
}

body[data-shell-page="user"] .wechat-messages .message.self .message-body,
body[data-shell-page="user"] .wechat-messages .message.self .message-time,
body[data-shell-page="user"] .wechat-messages .message.self .message-sender {
  color: #201912 !important;
}

/* 系统消息 - 游戏公告风格 */
.wechat-messages .message[data-message-kind="system"] {
  background: rgba(20, 14, 10, 0.92);
  border: 1px solid rgba(210, 179, 111, 0.25);
  border-left: 3px solid rgba(210, 179, 111, 0.4);
  max-width: 95%;
  align-self: flex-start;
}

.wechat-messages .message[data-message-kind="system"] .message-sender::before {
  content: "<系统> ";
  color: #d2b36f;
}

.wechat-messages .message.self::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #cb9758;
}

/* 微信气泡内布局：时间戳放在内容下方 */
.wechat-messages .message {
  display: flex;
  flex-direction: column;
}

.wechat-messages .message-header {
  order: 1;
  display: block;
  margin-top: 4px;
  text-align: right;
  background: none;
  border: none;
  padding: 0;
}

.wechat-messages .message-meta {
  display: none;
}

/* 群聊中显示发送者名称 */
.wechat-messages .message-row[data-message-kind="standard"] .message-meta,
.wechat-messages .message-row[data-message-kind="public"] .message-meta {
  display: block;
  margin-bottom: 2px;
  text-align: left;
  font-size: 12px;
  color: rgba(246, 239, 220, 0.55);
}

.wechat-messages .message-row[data-message-kind="standard"] .message-meta .message-role,
.wechat-messages .message-row[data-message-kind="public"] .message-meta .message-role,
.wechat-messages .message-row[data-message-kind="standard"] .message-meta .message-quick-action-chip,
.wechat-messages .message-row[data-message-kind="public"] .message-meta .message-quick-action-chip,
.wechat-messages .message-row[data-message-kind="standard"] .message-meta .message-quick-state-chip,
.wechat-messages .message-row[data-message-kind="public"] .message-meta .message-quick-state-chip {
  display: none;
}

.wechat-messages .message-body {
  order: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(246, 239, 220, 0.9);
}

.wechat-messages .message.self .message-body {
  color: #201912;
}

.wechat-messages .message-time {
  font-size: 11px;
  color: rgba(246, 239, 220, 0.6);
  text-align: right;
  display: block;
}

.wechat-messages .message.self .message-time {
  color: rgba(32, 25, 18, 0.65);
}

/* WeChat 模式 typing indicator */
.wechat-messages .timeline-typing {
  justify-content: center;
  padding: 8px 0;
  color: rgba(246, 239, 220, 0.45);
}

.wechat-messages .timeline-typing-dot {
  background: rgba(243, 201, 108, 0.45);
}

/* WeChat 模式 pending 消息 */
.wechat-messages .message-pending {
  background: rgba(45, 34, 43, 0.6);
  border: 1px dashed rgba(231, 216, 176, 0.3);
}

.wechat-messages .message-pending-failed {
  background: rgba(80, 30, 30, 0.7);
  border: 1px dashed rgba(217, 107, 131, 0.5);
}

.wechat-messages .message-pending .message-body {
  color: rgba(246, 239, 220, 0.6);
}

.wechat-messages .message-pending-failed .message-body {
  color: rgba(246, 239, 220, 0.75);
}

/* 输入框 - 固定贴底 */
.wechat-input-bar {
  flex-shrink: 0;
  padding: 8px 12px 12px;
  background: #151019;
  border-top: 2px solid rgba(231, 216, 176, 0.32);
}

.wechat-composer {
  display: flex !important;
  gap: 10px;
  align-items: flex-end;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  position: static !important;
}

.wechat-composer textarea {
  flex: 1;
  min-height: 36px;
  max-height: 100px;
  padding: 10px 14px;
  border: 2px solid rgba(231, 216, 176, 0.4);
  background: rgba(30, 25, 35, 0.9);
  color: rgba(246, 239, 220, 0.95);
  font-size: 16px;
  border-radius: 6px;
  resize: none;
  font-family: inherit;
  touch-action: manipulation;
}

.wechat-composer textarea::placeholder {
  color: rgba(246, 239, 220, 0.4);
}

.wechat-composer textarea:focus {
  outline: none;
  border-color: var(--sfc-gold);
}

.wechat-composer button {
  padding: 10px 18px;
  border: none;
  background: linear-gradient(180deg, #f1d59d 0%, #cb9758 100%);
  color: #201912;
  font-weight: 700;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.wechat-composer button:hover {
  filter: brightness(1.05);
}

.wechat-composer button:active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

/* 左侧会话抽屉 - 默认隐藏 */
.wechat-rail-drawer {
  position: fixed;
  left: 0;
  top: 36px;
  bottom: 0;
  width: 200px;
  background:
    linear-gradient(180deg, rgba(240, 222, 180, 0.06), transparent 14%),
    linear-gradient(180deg, #84755f 0%, #6f5d48 100%);
  border-right: 2px solid rgba(231, 216, 176, 0.36);
  transform: translateX(-100%);
  transition: transform 200ms ease;
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.wechat-rail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 12px;
  border-bottom: 1px solid rgba(24, 18, 14, 0.16);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  color: #1b1510;
  font-size: 14px;
  font-weight: 700;
}

.drawer-close {
  background: transparent;
  border: none;
  color: #1b1510;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.drawer-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-list .room-button {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(24, 18, 14, 0.14);
  background: rgba(255, 247, 224, 0.22);
  color: #18120e;
  border-radius: 0;
  text-align: left;
  box-shadow: none;
}

.drawer-list .room-button.active {
  background: rgba(255, 239, 193, 0.88);
  font-weight: 700;
}

.drawer-list .room-button .room-avatar,
.drawer-list .room-button .room-kicker,
.drawer-list .room-button .room-badges,
.drawer-list .room-button .room-inline-preview-card {
  display: none;
}

.drawer-list .room-button .room-name {
  color: #18120e;
  font-size: 14px;
}

/* 打开抽屉按钮 */
.wechat-rail-toggle {
  position: fixed;
  left: 12px;
  bottom: 80px;
  z-index: 95;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(231, 216, 176, 0.4);
  background: rgba(45, 34, 43, 0.85);
  color: var(--sfc-gold);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.wechat-rail-toggle:hover {
  background: rgba(45, 34, 43, 0.95);
}

.wechat-rail-toggle:active {
  transform: scale(0.92);
}

/* 响应式 */
@media (max-width: 480px) {
  .wechat-rail-toggle {
    bottom: 110px;
    width: 40px;
    height: 40px;
  }

  .wechat-rail-drawer {
    width: 100%;
  }

  .wechat-scene-bar {
    height: 28px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .wechat-scene-bar .scene-mini-canvas,
  .wechat-scene-bar .pixel-room-decor {
    display: none !important;
  }

  .wechat-chat-area {
    padding: 8px 10px;
  }

  .wechat-messages {
    gap: 6px;
  }

  .wechat-messages .message-row {
    max-width: 86%;
  }

  .wechat-messages .message {
    padding: 7px 11px;
    border-radius: 6px;
  }

  .wechat-messages .message-body {
    font-size: 15px;
  }

  .wechat-messages .message-time {
    font-size: 10px;
  }

  .wechat-login-card {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px 10px;
  }

  .wechat-login-form,
  .wechat-login-verify {
    grid-template-columns: 1fr auto;
  }

  .wechat-login-form #auth-mobile-input,
  .wechat-login-form #auth-device-input {
    grid-column: span 1;
  }

  .wechat-composer textarea {
    background: rgba(30, 25, 35, 0.9);
    color: rgba(246, 239, 220, 0.95);
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .wechat-composer button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .wechat-input-bar {
    padding: 6px 10px 8px;
  }
}

/* ── 压掉旧的 user 页 SFC 三栏布局 ── */
body[data-chat-style="wechat"] .sfc-layout,
body[data-chat-style="wechat"] .sfc-rail,
body[data-chat-style="wechat"] .sfc-stage,
body[data-chat-style="wechat"] .sfc-chat-bar,
body[data-chat-style="wechat"] .sfc-composer:not(.wechat-composer) {
  display: none !important;
}

/* 保留必要元素 */
body[data-chat-style="wechat"] #room-stage-canvas,
body[data-chat-style="wechat"] #timeline,
body[data-chat-style="wechat"] #composer-input,
body[data-chat-style="wechat"] #composer-send,
body[data-chat-style="wechat"] #room-list {
  display: block !important;
}

/* 微信模式隐藏 composer 辅助元素 */
body[data-chat-style="wechat"] .composer-status,
body[data-chat-style="wechat"] .composer-hints,
body[data-chat-style="wechat"] .composer-tip,
body[data-chat-style="wechat"] .composer-hero,
body[data-chat-style="wechat"] .composer-context,
body[data-chat-style="wechat"] .composer-meta {
  display: none !important;
}

/* 微信空态样式 */
body[data-chat-style="wechat"] .timeline-empty,
body[data-chat-style="wechat"] .timeline-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
  border-radius: 0;
  border: none;
  background: transparent;
  max-width: none;
  margin: 0;
  box-shadow: none;
}

body[data-chat-style="wechat"] .timeline-empty::before,
body[data-chat-style="wechat"] .timeline-empty-card::before {
  content: "";
  display: none;
}

body[data-chat-style="wechat"] .timeline-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(246, 239, 220, 0.75);
  animation: none;
}

body[data-chat-style="wechat"] .timeline-empty-copy {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(246, 239, 220, 0.5);
}

body[data-chat-style="wechat"] .timeline-empty-action {
  font-size: 13px;
  color: rgba(211, 141, 76, 0.6);
  font-family: inherit;
  letter-spacing: normal;
}

/* 微信场景标题样式 */
body[data-chat-style="wechat"] #room-stage-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--sfc-gold);
}

/* ═════════════════════════════════════════════════════════════════════════════
   2026-04-24 Hub Polish
   只作用于 index.html 的公共广场页，不影响 user/admin
   策略：
   - 顶部只保留小型 scene plate
   - 大图只用于 band / preview，不直接充当整页背景
   - rail 收回导航层
   - composer 收成聊天 action bar
   ═════════════════════════════════════════════════════════════════════════════ */

body[data-shell-page="hub"][data-shell-variant="public-square"] {
  --hub-bg: #0f0c0b;
  --hub-panel: #17110f;
  --hub-panel-soft: #2a211b;
  --hub-panel-warm: #3e3026;
  --hub-line: rgba(223, 192, 123, 0.18);
  --hub-line-strong: rgba(223, 192, 123, 0.42);
  --hub-gold: #e0c27b;
  --hub-gold-soft: #ae8f5e;
  --hub-ink: #f3ead6;
  --hub-muted: #a38a67;
  --hub-accent: #b96b42;
  --hub-accent-deep: #86472b;
  --hub-teal: #55b8a2;
  background:
    radial-gradient(circle at top left, rgba(185, 107, 66, 0.08), transparent 22%),
    linear-gradient(180deg, #15100e 0%, #0f0c0b 100%);
}

body[data-shell-page="hub"][data-shell-variant="public-square"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at top right, rgba(85, 184, 162, 0.08), transparent 24%);
  pointer-events: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .app.city-hub-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 14px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(180deg, rgba(38, 29, 24, 0.94), rgba(18, 14, 13, 0.98));
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 30px rgba(0, 0, 0, 0.28);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 12, 11, 0.86), rgba(15, 12, 11, 0.44)),
    url('./assets/pixel/chinese-modern-city/ui/hud_top_bar.avif');
  background-size: auto 100%, cover;
  background-position: left center, center;
  opacity: 0.3;
  pointer-events: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud > * {
  position: relative;
  z-index: 1;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-kicker,
body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-chip,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-kicker,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta span,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-badge,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel-kicker,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-shortcut,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field-label,
body[data-shell-page="hub"][data-shell-variant="public-square"] .sfc-city-rail .room-button,
body[data-shell-page="hub"][data-shell-variant="public-square"] .rail-item {
  font-family: var(--font-pixel);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-kicker {
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(224, 194, 123, 0.72);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud .hud-title {
  color: var(--hub-ink);
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: 1.4px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-chip,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud .hud-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--hub-line);
  background: rgba(21, 17, 16, 0.82);
  font-size: 19px;
  color: var(--hub-gold);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-chip {
  color: var(--hub-teal);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 10px 8px;
  border: 2px solid #f1c978;
  background:
    linear-gradient(180deg, rgba(45, 28, 15, 0.96), rgba(24, 14, 8, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 230, 150, 0.07) 0 1px, transparent 1px 22px);
  color: #fff2c9;
  box-shadow: 0 0 0 3px rgba(28, 16, 8, 0.92), 0 8px 0 rgba(0, 0, 0, 0.32);
  overflow: auto;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail::after {
  content: '';
  margin-top: auto;
  height: 138px;
  border: 1px solid rgba(24, 18, 14, 0.14);
  background:
    linear-gradient(180deg, rgba(24, 18, 14, 0.12), rgba(24, 18, 14, 0.72)),
    url('./assets/pixel/chinese-modern-city/ui/hud_left_nav.avif');
  background-size: cover;
  background-position: center bottom;
  opacity: 0.72;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-shortcuts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-shortcut {
  min-height: 32px;
  border: 1px solid rgba(24, 18, 14, 0.16);
  background: rgba(255, 247, 224, 0.2);
  color: #201912;
  font-size: 18px;
  letter-spacing: 0.8px;
  cursor: pointer;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-shortcut.is-active {
  background: rgba(255, 239, 193, 0.88);
  color: #18120e;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .rail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 9px;
  border: 2px solid rgba(241, 201, 120, 0.62);
  background: rgba(255, 242, 201, 0.08);
  color: #fff2c9;
  font-size: 18px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .rail-item-meta {
  color: rgba(255, 242, 201, 0.58);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .rail-section {
  margin-top: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .rail-section-title {
  color: rgba(255, 242, 201, 0.62);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-list,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-section-list {
  padding: 0;
  gap: 5px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-section,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-section-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-section-header,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-digest,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-avatar,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-kicker,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-badges,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-preview,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-sub,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-status-line,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-tag-row,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-activity,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-top-meta {
  display: none !important;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-button {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 2px solid rgba(241, 201, 120, 0.52);
  background: rgba(255, 242, 201, 0.08);
  color: #fff2c9;
  font-size: 18px;
  text-align: left;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-button:hover,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-button.active {
  background: rgba(255, 239, 193, 0.38);
  border-color: rgba(24, 18, 14, 0.18);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-content,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-topline,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-title-stack {
  display: block;
  min-width: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail .room-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(180deg, rgba(23, 17, 15, 0.96), rgba(15, 12, 11, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 22px 42px rgba(0, 0, 0, 0.3);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.82fr);
  gap: 12px;
  min-height: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(145deg, rgba(39, 29, 24, 0.92), rgba(20, 15, 13, 0.96));
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-kicker {
  margin: 0;
  font-size: 16px;
  color: var(--hub-gold);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-title {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 0.95;
  color: var(--hub-ink);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-blurb {
  max-width: 34rem;
  margin: 0;
  font-size: 15px;
  line-height: 1.58;
  color: rgba(243, 234, 214, 0.82);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(223, 192, 123, 0.14);
  background: rgba(19, 15, 14, 0.72);
  font-size: 15px;
  color: var(--hub-muted);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-badge {
  align-self: flex-start;
  padding: 1px 8px;
  border: 1px solid rgba(223, 192, 123, 0.2);
  background: rgba(18, 14, 13, 0.88);
  color: var(--hub-gold);
  font-size: 16px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame {
  position: relative;
  flex: 1;
  min-height: 170px;
  padding: 8px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(180deg, rgba(15, 12, 11, 0.36), rgba(15, 12, 11, 0.82)),
    url('./assets/pixel/chinese-modern-city/backgrounds/hub_top_scene_band.avif');
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  overflow: hidden;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 98px;
  height: 58px;
  border: 1px solid rgba(223, 192, 123, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 12, 11, 0.12), rgba(15, 12, 11, 0.52)),
    url('./assets/pixel/chinese-modern-city/backgrounds/hub_mid_scene_band.avif');
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame .stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent !important;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel {
  min-height: 86px;
  padding: 10px 12px;
  border: 1px solid var(--hub-line);
  background:
    linear-gradient(180deg, rgba(20, 15, 14, 0.84), rgba(20, 15, 14, 0.96)),
    url('./assets/pixel/chinese-modern-city/ui/ui_general_button_strip.avif');
  background-size: auto 100%, cover;
  background-position: center;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel strong {
  display: block;
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 16px;
  color: var(--hub-ink);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(243, 234, 214, 0.74);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(223, 192, 123, 0.14);
  background: rgba(15, 12, 11, 0.82);
  color: var(--hub-gold);
  font-size: 14px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-chat {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 16px;
  border: 1px solid rgba(223, 192, 123, 0.12);
  background:
    linear-gradient(180deg, rgba(14, 11, 10, 0.72), rgba(14, 11, 10, 0.94));
  overflow: auto;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message {
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 0;
  background: rgba(35, 26, 22, 0.84);
  border: 1px solid rgba(223, 192, 123, 0.12);
  box-shadow: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message.self {
  margin-left: auto;
  background: rgba(43, 31, 30, 0.9);
  border-color: rgba(85, 184, 162, 0.22);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message[data-message-kind="system"] {
  max-width: 100%;
  background: rgba(18, 14, 13, 0.92);
  border-color: rgba(223, 192, 123, 0.18);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border-top: none;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool {
  min-width: 58px;
  border: 1px solid rgba(223, 192, 123, 0.18);
  background:
    linear-gradient(180deg, rgba(34, 26, 22, 0.94), rgba(20, 15, 13, 0.98));
  color: var(--hub-gold);
  font-size: 18px;
  cursor: pointer;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool:hover {
  color: var(--hub-teal);
  border-color: rgba(85, 184, 162, 0.3);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px 12px;
  border: 1px solid rgba(223, 192, 123, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 14, 13, 0.9), rgba(18, 14, 13, 0.98)),
    url('./assets/pixel/chinese-modern-city/ui/chat_composer_bar.avif');
  background-size: auto 100%, cover;
  background-position: center;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field-label {
  align-self: flex-start;
  padding: 2px 10px;
  border: 1px solid rgba(223, 192, 123, 0.14);
  background: rgba(13, 10, 9, 0.68);
  color: var(--hub-muted);
  font-size: 17px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea {
  min-height: 50px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--hub-ink);
  font-size: 15px;
  line-height: 1.6;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea::placeholder {
  color: rgba(163, 138, 103, 0.66);
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer #composer-send {
  min-width: 108px;
  border: 1px solid rgba(185, 107, 66, 0.36);
  background: linear-gradient(180deg, #b96b42 0%, #86472b 100%);
  color: var(--hub-ink);
  font-family: var(--font-pixel);
  font-size: 22px;
  letter-spacing: 1px;
}

body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer #composer-send:disabled,
body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea:disabled,
body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 960px) {
  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-layout {
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 38%);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message {
    max-width: 84%;
  }
}

@media (max-width: 720px) {
  body[data-shell-page="hub"][data-shell-variant="public-square"] .app.city-hub-shell {
    padding: 8px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 8px 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .hub-hud-chip {
    display: none;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-hud .hud-title {
    font-size: 24px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-layout {
    grid-template-columns: 1fr;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail {
    position: fixed;
    top: 58px;
    left: 8px;
    bottom: 8px;
    width: 186px;
    z-index: 40;
    transform: translateX(-108%);
    transition: transform 160ms ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.42);
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-rail.open {
    transform: translateX(0);
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-stage {
    gap: 8px;
    padding: 8px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-copy {
    gap: 8px;
    padding: 12px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-title {
    font-size: 34px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-blurb {
    font-size: 14px;
    line-height: 1.5;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta {
    gap: 6px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-meta span {
    min-height: 22px;
    padding: 0 7px;
    font-size: 14px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame {
    min-height: 108px;
    padding: 7px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-preview-frame::after {
    width: 72px;
    height: 40px;
    right: 7px;
    bottom: 7px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-strip {
    grid-auto-columns: 76%;
    gap: 6px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-panel {
    min-height: 78px;
    padding: 9px 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-chat {
    padding: 8px 8px 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log {
    gap: 8px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-log .message {
    max-width: 100%;
    padding: 9px 10px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool {
    min-height: 36px;
    font-size: 16px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool:nth-child(1),
  body[data-shell-page="hub"][data-shell-variant="public-square"] .square-tool:nth-child(2) {
    grid-column: span 1;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field {
    grid-column: 1 / -1;
    gap: 6px;
    padding: 7px 8px 8px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-field-label {
    padding: 1px 8px;
    font-size: 15px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer textarea {
    min-height: 38px;
    font-size: 15px;
  }

  body[data-shell-page="hub"][data-shell-variant="public-square"] .public-square-composer #composer-send {
    min-width: 72px;
    font-size: 18px;
  }
}

/* ═════════════════════════════════════════════════════════════════════════════
   2026-04-25 Admin Visual Polish
   Warm pixel-city consistency for admin.html without changing layout structure.
   ═════════════════════════════════════════════════════════════════════════════ */

body[data-shell-page="admin"] {
  background:
    radial-gradient(circle at top left, rgba(185, 107, 66, 0.06), transparent 22%),
    linear-gradient(180deg, #120d08 0%, #090706 100%);
}

body[data-shell-page="admin"] .topbar {
  background:
    linear-gradient(180deg, rgba(63, 40, 20, 0.96), rgba(29, 18, 10, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 230, 150, 0.08) 0 1px, transparent 1px 24px);
  border: 2px solid #f1c978;
  box-shadow: 0 0 0 3px rgba(28, 16, 8, 0.92), 0 8px 0 rgba(0, 0, 0, 0.32);
}

body[data-shell-page="admin"] .eyebrow {
  color: #9f8561;
}

body[data-shell-page="admin"] h1 {
  color: #fff2c9;
  text-shadow: 2px 2px 0 #281205;
}

body[data-shell-page="admin"] .hero-note {
  color: rgba(255, 242, 201, 0.78);
}

body[data-shell-page="admin"] .badge {
  color: #fff2c9;
  background: rgba(92, 43, 21, 0.82);
  border: 2px solid rgba(247, 210, 118, 0.55);
}

body[data-shell-page="admin"] .layout {
  gap: 10px;
}

body[data-shell-page="admin"] .panel {
  background: rgba(18, 11, 7, 0.72);
  border: 2px solid rgba(247, 210, 118, 0.35);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

body[data-shell-page="admin"] .panel-shell-header {
  background: rgba(42, 24, 12, 0.58);
  border-bottom: 2px solid rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .panel-kicker {
  color: #9f8561;
}

body[data-shell-page="admin"] .panel-shell-title {
  color: #fff2c9;
}

body[data-shell-page="admin"] .panel-title {
  color: rgba(255, 242, 201, 0.78);
  border-bottom: 1px solid rgba(247, 210, 118, 0.22);
}

body[data-shell-page="admin"] .governance-summary {
  color: rgba(255, 242, 201, 0.78);
}

body[data-shell-page="admin"] .governance-status {
  color: #9f8561;
}

body[data-shell-page="admin"] .roadmap-step {
  color: #2a1709;
  background: rgba(255, 239, 178, 0.72);
  border: 2px solid rgba(40, 25, 13, 0.84);
}

body[data-shell-page="admin"] .governance-block summary,
body[data-shell-page="admin"] .governance-details summary,
body[data-shell-page="admin"] .auth-details summary {
  color: #fff2c9;
  background: rgba(42, 24, 12, 0.58);
  border: 2px solid rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .inline-form input,
body[data-shell-page="admin"] .inline-form textarea,
body[data-shell-page="admin"] .inline-form select {
  background: rgba(20, 15, 18, 0.85);
  color: rgba(246, 239, 220, 0.94);
  border: 1px solid rgba(231, 216, 176, 0.32);
}

body[data-shell-page="admin"] .inline-form button[type="submit"] {
  color: #2a1709;
  background: linear-gradient(180deg, #f1d59d, #cb9758);
  border: 2px solid #4a2b1a;
}

body[data-shell-page="admin"] .inline-form button.secondary {
  color: #fff2c9;
  background: rgba(92, 43, 21, 0.82);
  border: 2px solid rgba(247, 210, 118, 0.55);
}

/* Admin governance area high-contrast overrides */
body[data-shell-page="admin"] .governance-area-title {
  color: #fff2c9;
}

body[data-shell-page="admin"] .governance-area-body .action-desc {
  color: rgba(255, 242, 201, 0.82);
}

body[data-shell-page="admin"] .governance-area-body .section-label {
  color: rgba(255, 242, 201, 0.65);
}

body[data-shell-page="admin"] .governance-area-body .city-list {
  color: rgba(255, 242, 201, 0.78);
}

body[data-shell-page="admin"] .action-btn {
  background: linear-gradient(180deg, #f1d59d, #cb9758);
  color: #2a1709;
  border-color: rgba(40, 25, 13, 0.84);
}

body[data-shell-page="admin"] .action-btn:disabled {
  opacity: 0.45;
  background: rgba(60, 50, 40, 0.6);
  color: rgba(255, 242, 201, 0.5);
  border-color: rgba(247, 210, 118, 0.25);
}

body[data-shell-page="admin"] .action-btn.secondary {
  background: rgba(92, 43, 21, 0.82);
  color: #fff2c9;
  border-color: rgba(247, 210, 118, 0.55);
}

body[data-shell-page="admin"] .action-status-available {
  background: rgba(126, 253, 199, 0.15);
  color: #7efdc7;
  border-color: rgba(126, 253, 199, 0.4);
}

body[data-shell-page="admin"] .action-status-pending {
  background: rgba(255, 100, 80, 0.12);
  color: #ff8a75;
  border-color: rgba(255, 100, 80, 0.35);
}

body[data-shell-page="admin"] .action-status-readonly {
  background: rgba(255, 242, 201, 0.1);
  color: rgba(255, 242, 201, 0.72);
  border-color: rgba(255, 242, 201, 0.25);
}

body[data-shell-page="admin"] .action-status-gateway {
  background: rgba(126, 180, 253, 0.18);
  color: #e6f0ff;
  border-color: rgba(126, 180, 253, 0.5);
}

body[data-shell-page="admin"] .governance-more summary {
  background: rgba(42, 24, 12, 0.58);
  color: #fff2c9;
  border-color: rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .governance-more[open] summary {
  background: rgba(24, 105, 91, 0.25);
  color: #7efdc7;
  border-color: rgba(126, 253, 199, 0.45);
}

body[data-shell-page="admin"] .conversation-stage {
  background: rgba(18, 11, 7, 0.42);
  border: 2px solid rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .conversation-stage-title {
  color: #fff2c9;
}

body[data-shell-page="admin"] .conversation-stage-note {
  color: rgba(255, 242, 201, 0.72);
}

body[data-shell-page="admin"] .stage-chip {
  color: #2a1709;
  background: rgba(255, 239, 178, 0.72);
  border: 1px solid rgba(40, 25, 13, 0.84);
}

body[data-shell-page="admin"] .timeline {
  background: transparent;
}

body[data-shell-page="admin"] .timeline .message {
  color: #17110b;
  background: rgba(255, 245, 221, 0.94);
  border: 2px solid rgba(96, 61, 28, 0.72);
  border-radius: 12px;
}

body[data-shell-page="admin"] .timeline .message.self {
  color: #14100b;
  background: rgba(255, 221, 137, 0.96);
  border-color: rgba(88, 49, 17, 0.88);
}

body[data-shell-page="admin"] .composer {
  background:
    linear-gradient(180deg, rgba(255, 236, 171, 0.96), rgba(214, 165, 84, 0.94)),
    repeating-linear-gradient(90deg, rgba(46, 28, 13, 0.10) 0 2px, transparent 2px 28px);
  border: 3px solid #f2c879;
  box-shadow: 0 0 0 3px rgba(33, 19, 10, 0.94), 0 7px 0 rgba(0, 0, 0, 0.32);
}

body[data-shell-page="admin"] .composer textarea {
  color: #14100b;
  caret-color: #14100b;
  background: rgba(255, 244, 208, 0.88);
  border: 2px solid #2f1d0f;
}

body[data-shell-page="admin"] .composer textarea::placeholder {
  color: rgba(36, 20, 9, 0.44);
}

body[data-shell-page="admin"] .composer #composer-send {
  color: #fff3cc;
  background: #963f19;
  border: 2px solid #ffd987;
}

body[data-shell-page="admin"] .chat-detail {
  background: rgba(18, 11, 7, 0.72);
  border: 2px solid rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .chat-detail-summary-title {
  color: #fff2c9;
}

body[data-shell-page="admin"] .chat-detail-summary-copy {
  color: rgba(255, 242, 201, 0.72);
}

body[data-shell-page="admin"] .chat-detail-card-shell {
  background: rgba(42, 24, 12, 0.58);
  border: 2px solid rgba(247, 210, 118, 0.35);
}

body[data-shell-page="admin"] .chat-detail-card-title {
  color: #fff2c9;
}

body[data-shell-page="admin"] .chat-detail-card-avatar {
  color: #fff5ce;
  background: linear-gradient(180deg, #d88a2d, #945016);
  border: 2px solid rgba(255, 231, 166, 0.88);
}

body[data-shell-page="admin"] .chat-detail-card-meta-label {
  color: #9f8561;
}

body[data-shell-page="admin"] .chat-detail-card-meta-value {
  color: rgba(255, 242, 201, 0.82);
}

body[data-shell-page="admin"] .chat-detail-card-actions button {
  color: #2a1709;
  background: linear-gradient(180deg, #f1d59d, #cb9758);
  border: 2px solid #4a2b1a;
}

body[data-shell-page="admin"] .room-button {
  color: rgba(255, 242, 201, 0.88);
  background: rgba(42, 24, 12, 0.42);
  border: 1px solid rgba(247, 210, 118, 0.28);
}

body[data-shell-page="admin"] .room-button.active {
  color: #fff2c9;
  background: rgba(141, 61, 27, 0.72);
  border-color: rgba(255, 241, 170, 0.72);
}

body[data-shell-page="admin"] .room-avatar {
  color: #fff5ce;
  background: linear-gradient(180deg, #d88a2d, #945016);
  border: 2px solid rgba(255, 231, 166, 0.88);
}

body[data-shell-page="admin"] .room-kicker {
  color: #9f8561;
}

body[data-shell-page="admin"] .room-sub {
  color: rgba(255, 242, 201, 0.62);
}

body[data-shell-page="admin"] .room-status-line {
  color: #9f8561;
}

body[data-shell-page="admin"] .section-label {
  color: #fff2c9;
}

body[data-shell-page="admin"] .governance.surface-hidden,
body[data-shell-page="admin"] .auth.surface-hidden,
body[data-shell-page="admin"] .chat-detail.surface-hidden {
  display: none !important;
}

body[data-shell-page="admin"] .governance:not(.surface-hidden),
body[data-shell-page="admin"] .auth:not(.surface-hidden),
body[data-shell-page="admin"] .chat-detail:not(.surface-hidden) {
  display: block !important;
}

body[data-shell-page="admin"] .governance:not(.surface-hidden),
body[data-shell-page="admin"] .auth:not(.surface-hidden) {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

body[data-shell-page="admin"] .governance .panel-shell-note {
  display: block;
  color: rgba(255, 242, 201, 0.76);
}

body[data-shell-page="admin"] .governance .panel-shell-header {
  align-items: flex-start;
}

body[data-shell-page="admin"] .governance > .governance-block > summary,
body[data-shell-page="admin"] .governance-details summary,
body[data-shell-page="admin"] .auth-details summary {
  color: #fff2c9;
  background: rgba(42, 24, 12, 0.78);
}

body[data-shell-page="admin"] .governance .city-card {
  color: #2a1709;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(248, 239, 222, 0.96));
  border-color: rgba(82, 52, 24, 0.34);
}

body[data-shell-page="admin"] .governance .city-name {
  color: #5a3218;
}

body[data-shell-page="admin"] .governance .city-slug,
body[data-shell-page="admin"] .governance .city-sub,
body[data-shell-page="admin"] .governance .city-role,
body[data-shell-page="admin"] .governance .city-room-list {
  color: rgba(62, 39, 20, 0.78);
}

/* 2026-04-26 admin audit patch: fold governance columns before mobile overflow. */
@media (max-width: 960px) {
  body[data-shell-page="admin"] {
    overflow-x: hidden;
  }

  body[data-shell-page="admin"] .app {
    width: min(100%, 100vw) !important;
  }

  body[data-shell-page="admin"] .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    margin: 10px !important;
    padding: 14px !important;
  }

  body[data-shell-page="admin"] .topbar-main,
  body[data-shell-page="admin"] .masthead,
  body[data-shell-page="admin"] .hero-note,
  body[data-shell-page="admin"] .hero-callout,
  body[data-shell-page="admin"] .status-cluster {
    min-width: 0 !important;
    max-width: none !important;
  }

  body[data-shell-page="admin"] .status-cluster {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }

  body[data-shell-page="admin"] .layout-admin-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 10px 14px !important;
    overflow-x: hidden !important;
  }

  body[data-shell-page="admin"] .sidebar-stack-admin,
  body[data-shell-page="admin"] .shell-column-main,
  body[data-shell-page="admin"] .conversation,
  body[data-shell-page="admin"] .governance,
  body[data-shell-page="admin"] .chat-detail {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: auto !important;
    max-height: none !important;
  }

  body[data-shell-page="admin"] .sidebar-stack-admin {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body[data-shell-page="admin"][data-workspace="chat"] .sidebar-stack-admin {
    display: none !important;
  }

  body[data-shell-page="admin"]:not([data-workspace="chat"]) .sidebar-stack-admin {
    display: grid !important;
  }

  body[data-shell-page="admin"] .conversation-stage,
  body[data-shell-page="admin"] .conversation-tools,
  body[data-shell-page="admin"] .timeline,
  body[data-shell-page="admin"] .composer {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-shell-page="admin"] .governance-roadmap,
  body[data-shell-page="admin"] .provider-actions,
  body[data-shell-page="admin"] .chat-detail-card-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="admin"] .inline-form,
  body[data-shell-page="admin"] .compact-form {
    min-width: 0 !important;
  }
}

@media (max-width: 640px) {
  body[data-shell-page="admin"] .topbar {
    margin: 8px !important;
    padding: 12px !important;
  }

  body[data-shell-page="admin"] .layout-admin-shell {
    padding-inline: 8px !important;
  }

  body[data-shell-page="admin"] .masthead h1,
  body[data-shell-page="admin"] #masthead-title {
    font-size: clamp(1.55rem, 8vw, 2.4rem) !important;
    line-height: 1.05 !important;
  }

  body[data-shell-page="admin"] .hero-note,
  body[data-shell-page="admin"] .hero-callout {
    font-size: 0.88rem !important;
  }

  body[data-shell-page="admin"] .conversation-tools {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="admin"] .composer {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-shell-page="admin"] .composer #composer-send {
    width: 100% !important;
  }

  .resident-login-card {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
  }

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

  .resident-login-verify {
    grid-template-columns: 1fr 1fr auto;
  }
}

/* ── Admin tools panel (right rail) ── */

body[data-shell-page="admin"] #chat-detail-content {
  display: none;
}

.admin-tools-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 12px;
  overflow: auto;
}

.tool-group {
  border: 1px dashed rgba(217, 204, 183, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

body[data-shell-page="admin"] .tool-group {
  border-color: rgba(126, 253, 199, 0.22);
  background: rgba(18, 11, 7, 0.42);
}

body[data-shell-page="admin"] .tool-group--primary {
  border-style: solid;
  border-color: rgba(247, 210, 118, 0.45);
  background: rgba(42, 25, 14, 0.72);
}

.tool-group-title--static {
  cursor: default;
  color: #fff2c9;
}

body[data-shell-page="admin"] .tool-group-title--static::after {
  content: none;
}

.tool-group-title {
  list-style: none;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(29, 26, 23, 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 160ms ease;
}

body[data-shell-page="admin"] .tool-group-title {
  color: rgba(255, 242, 201, 0.82);
}

.tool-group-title::-webkit-details-marker {
  display: none;
}

.tool-group-title::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: rgba(29, 26, 23, 0.45);
  transition: color 160ms ease;
}

body[data-shell-page="admin"] .tool-group-title::after {
  color: rgba(255, 242, 201, 0.45);
}

.tool-group[open] .tool-group-title::after {
  content: "−";
  color: var(--accent);
}

body[data-shell-page="admin"] .tool-group[open] .tool-group-title::after {
  color: #7efdc7;
}

.tool-group-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-group-body .action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-group-body .inline-form {
  padding: 0;
  border: none;
  background: transparent;
}

body[data-shell-page="admin"] .tool-group-body .inline-form {
  background: transparent;
}

body[data-shell-page="admin"] .admin-conversation-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 0;
}

body[data-shell-page="admin"] .admin-conversation-tools select {
  background: rgba(255, 245, 221, 0.92);
  color: #2a1709;
  border: 1px solid rgba(96, 61, 28, 0.72);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

body[data-shell-page="admin"] .admin-conversation-tools button {
  background: rgba(255, 245, 221, 0.88);
  color: #2a1709;
  border: 1px solid rgba(96, 61, 28, 0.72);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

body[data-shell-page="admin"] .admin-conversation-tools button:hover {
  background: rgba(255, 245, 221, 1);
}

/* Admin management shell: collapsible category navigation */
body[data-shell-page="admin"] .layout-admin-shell {
  grid-template-columns: minmax(200px, 240px) minmax(520px, 1fr) minmax(240px, 280px);
  align-items: stretch;
}

body[data-shell-page="admin"] .admin-nav-shell {
  gap: 12px;
}


body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] {
  width: 72px;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-panel {
  padding-inline: 10px;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-head {
  justify-content: center;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-head > div,
body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-copy,
body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-item::after,
body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-session-queue {
  display: none;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 56px;
  padding: 8px 6px;
  border-radius: 12px;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-toggle {
  writing-mode: vertical-rl;
  padding: 8px 6px;
}

body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] + .conversation {
  min-width: 0;
}

body[data-shell-page="admin"][data-admin-nav="collapsed"] .layout-admin-shell {
  grid-template-columns: 72px minmax(480px, 1fr) minmax(280px, 340px);
}

@media (max-width: 1100px) {
  body[data-shell-page="admin"] .layout-admin-shell,
  body[data-shell-page="admin"][data-admin-nav="collapsed"] .layout-admin-shell {
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  }

  body[data-shell-page="admin"] .admin-context-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body[data-shell-page="admin"] .layout-admin-shell,
  body[data-shell-page="admin"][data-admin-nav="collapsed"] .layout-admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-shell-page="admin"] .admin-nav-shell,
  body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] {
    width: auto;
  }

  body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-copy,
  body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-item::after,
  body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-session-queue {
    display: flex;
  }

  body[data-shell-page="admin"] .admin-nav-shell[data-admin-nav="collapsed"] .admin-nav-item {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: stretch;
  }
}

/* Admin page: standard backend theme — 国内后台风格 */
body[data-shell-page="admin"] {
  background: var(--admin-content-bg);
}

body[data-shell-page="admin"] .topbar {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-radius: 4px;
}

body[data-shell-page="admin"] .eyebrow {
  color: var(--admin-text-muted);
  letter-spacing: 0.08em;
}

body[data-shell-page="admin"] h1 {
  color: var(--admin-text);
  font-weight: 700;
}

body[data-shell-page="admin"] .hero-note {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .status-cluster {
  border-top-color: var(--admin-border);
}

body[data-shell-page="admin"] .badge {
  background: #f5f5f5;
  border-color: var(--admin-border);
  color: var(--admin-text-secondary);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
}

body[data-shell-page="admin"] .layout {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Left sidebar: dark standard nav */
body[data-shell-page="admin"] .admin-nav-shell {
  background: var(--admin-sidebar-bg);
  border-radius: 4px;
}

body[data-shell-page="admin"] .admin-nav-panel {
  background: transparent;
  border: none;
  color: var(--admin-sidebar-text);
  box-shadow: none;
}

body[data-shell-page="admin"] .admin-nav-head {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

body[data-shell-page="admin"] .admin-nav-head-title .panel-kicker {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

body[data-shell-page="admin"] .admin-nav-head-title .panel-shell-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

body[data-shell-page="admin"] .admin-nav-toggle {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body[data-shell-page="admin"] .admin-nav-toggle:hover,
body[data-shell-page="admin"] .admin-nav-toggle:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  outline: none;
}

body[data-shell-page="admin"] .admin-nav-list {
  gap: 12px;
}

body[data-shell-page="admin"] .admin-nav-module {
  display: grid;
  gap: 4px;
}

body[data-shell-page="admin"] .admin-nav-module-title {
  color: rgba(255,255,255,0.64);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 8px 4px 4px;
}

body[data-shell-page="admin"] .admin-nav-module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 4px;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.64);
  border-radius: 4px;
}

body[data-shell-page="admin"] .admin-nav-module-toggle:hover,
body[data-shell-page="admin"] .admin-nav-module-toggle:focus-visible {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
  outline: none;
}

body[data-shell-page="admin"] .admin-nav-module-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

body[data-shell-page="admin"] .admin-nav-module[data-admin-module="advanced"] {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 8px;
}

body[data-shell-page="admin"] .admin-nav-module[data-admin-module-expanded="false"] .admin-nav-module-items {
  display: none;
}

body[data-shell-page="admin"] .admin-nav-module[data-admin-module-expanded="true"] .admin-nav-module-toggle-icon {
  transform: rotate(90deg);
}

body[data-shell-page="admin"] .admin-nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--admin-sidebar-text);
  border-radius: 4px;
  min-height: 44px;
  padding: 8px 12px;
}

body[data-shell-page="admin"] .admin-nav-item:hover,
body[data-shell-page="admin"] .admin-nav-item:focus-visible {
  background: var(--admin-sidebar-hover);
  color: #ffffff;
  outline: none;
}

body[data-shell-page="admin"] .admin-nav-item.is-active {
  background: rgba(24,144,255,0.12);
  color: #ffffff;
  border-left: 3px solid var(--admin-sidebar-active);
}

body[data-shell-page="admin"] .admin-nav-item::after {
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}

body[data-shell-page="admin"] .admin-nav-item.is-active::after {
  background: var(--admin-sidebar-active);
  color: #ffffff;
}

body[data-shell-page="admin"] .admin-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  color: var(--admin-sidebar-text);
}

body[data-shell-page="admin"] .admin-nav-item:hover .admin-nav-icon,
body[data-shell-page="admin"] .admin-nav-item.is-active .admin-nav-icon {
  background: var(--admin-sidebar-active);
  color: #ffffff;
}

body[data-shell-page="admin"] .admin-nav-icon svg {
  stroke: currentColor;
}

body[data-shell-page="admin"] .admin-nav-copy strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

body[data-shell-page="admin"] .admin-nav-item:not(.is-active) .admin-nav-copy strong {
  color: var(--admin-sidebar-text);
}

body[data-shell-page="admin"] .admin-nav-copy small {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

/* Session queue: white card inside dark sidebar */
body[data-shell-page="admin"] .admin-session-queue {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-radius: 4px;
  margin-top: 12px;
}

body[data-shell-page="admin"] .admin-session-queue .panel-shell-title,
body[data-shell-page="admin"] .admin-session-queue .panel-kicker {
  color: var(--admin-text);
}

body[data-shell-page="admin"] .admin-session-queue .panel-shell-note {
  color: var(--admin-text-secondary);
}

/* Content panels: light standard */
body[data-shell-page="admin"] .panel,
body[data-shell-page="admin"] .conversation,
body[data-shell-page="admin"] .admin-context-panel,
body[data-shell-page="admin"] .chat-detail {
  background: var(--admin-panel-bg);
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  color: var(--admin-text);
}

body[data-shell-page="admin"] .conversation-stage {
  background: #fafafa;
  border: 1px solid var(--admin-border);
  margin: 12px;
  border-radius: 4px;
}

body[data-shell-page="admin"] .conversation-stage-title {
  color: var(--admin-text);
  font-weight: 600;
}

body[data-shell-page="admin"] .conversation-stage-note {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .stage-chip {
  color: var(--admin-text-secondary);
  background: #f5f5f5;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
}

body[data-shell-page="admin"] .timeline {
  background: transparent;
}

body[data-shell-page="admin"] .timeline .message {
  color: var(--admin-text);
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .timeline .message.self {
  background: #e6f7ff;
  border-color: #91d5ff;
}

/* Composer */
body[data-shell-page="admin"] .composer {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin: 12px;
  padding: 12px;
  border-radius: 4px;
}

body[data-shell-page="admin"] .composer .identity-row {
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

body[data-shell-page="admin"] .composer .identity-row label {
  color: var(--admin-text-secondary);
  font-size: 12px;
}

body[data-shell-page="admin"] .composer textarea {
  color: var(--admin-text);
  background: #f5f5f5;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .composer textarea:focus {
  border-color: var(--admin-accent);
  outline: none;
}

body[data-shell-page="admin"] .composer textarea::placeholder {
  color: var(--admin-text-muted);
}

body[data-shell-page="admin"] .composer #composer-send {
  color: #ffffff;
  background: var(--admin-accent);
  border: 1px solid var(--admin-accent);
  border-radius: 4px;
}

body[data-shell-page="admin"] .composer #composer-send:hover {
  background: #40a9ff;
}

body[data-shell-page="admin"] .composer-hints-admin span {
  color: var(--admin-text-muted);
  font-size: 11px;
}

/* Right panel */
body[data-shell-page="admin"] .chat-detail-summary-title {
  color: var(--admin-text);
}

body[data-shell-page="admin"] .chat-detail-summary-copy {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .chat-detail-card-shell {
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .chat-detail-card-title {
  color: var(--admin-text);
}

body[data-shell-page="admin"] .chat-detail-card-avatar {
  color: #ffffff;
  background: var(--admin-accent);
}

body[data-shell-page="admin"] .chat-detail-card-meta-label {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .chat-detail-card-meta-value {
  color: var(--admin-text);
}

body[data-shell-page="admin"] .chat-detail-card-actions button {
  color: var(--admin-text);
  background: #f5f5f5;
  border-color: var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .chat-detail-card-actions button:hover {
  background: #e8e8e8;
}

/* Room list */
body[data-shell-page="admin"] .room-button {
  color: var(--admin-text);
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .room-button.active {
  color: var(--admin-accent);
  background: #e6f7ff;
  border-color: #91d5ff;
}

body[data-shell-page="admin"] .room-avatar {
  color: #ffffff;
  background: var(--admin-accent);
}

body[data-shell-page="admin"] .room-kicker {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .room-sub {
  color: var(--admin-text-muted);
}

body[data-shell-page="admin"] .room-status-line {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .section-label {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

body[data-shell-page="admin"] .governance-more summary {
  background: #fafafa;
  color: var(--admin-text);
  border-color: var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .governance-more[open] summary {
  background: #f5f5f5;
  color: var(--admin-text);
  border-color: var(--admin-border);
}

body[data-shell-page="admin"] .panel-shell-header-detail {
  border-bottom-color: var(--admin-border);
}

/* Tool groups */
body[data-shell-page="admin"] .tool-group {
  border-color: var(--admin-border);
  background: #ffffff;
  border-style: solid;
  border-radius: 4px;
}

body[data-shell-page="admin"] .tool-group-title {
  color: var(--admin-text);
}

body[data-shell-page="admin"] .tool-group-title::after {
  color: var(--admin-text-muted);
}

body[data-shell-page="admin"] .tool-group[open] .tool-group-title::after {
  color: var(--admin-accent);
}

body[data-shell-page="admin"] .action-row {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .action-desc {
  color: var(--admin-text-secondary);
}

/* Action statuses: standard colored badges */
body[data-shell-page="admin"] .action-status {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
}

body[data-shell-page="admin"] .action-status-available {
  background: #f6ffed;
  color: #389e0d;
  border-color: #b7eb8f;
}

body[data-shell-page="admin"] .action-status-pending {
  background: #fffbe6;
  color: #d48806;
  border-color: #ffe58f;
}

body[data-shell-page="admin"] .action-status-readonly {
  background: #f5f5f5;
  color: #666666;
  border-color: #d9d9d9;
}

body[data-shell-page="admin"] .action-status-gateway {
  background: #e6f7ff;
  color: #096dd9;
  border-color: #91d5ff;
}

/* Admin tools summary (right panel - minimal) */
body[data-shell-page="admin"] .admin-tools-summary {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-shell-page="admin"] .admin-summary-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-shell-page="admin"] .admin-summary-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-shell-page="admin"] .admin-summary-head .tool-group-title--static {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text);
  letter-spacing: 0.02em;
}

body[data-shell-page="admin"] .admin-summary-head .action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-shell-page="admin"] .admin-summary-item-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .admin-summary-reason {
  color: var(--admin-text-secondary);
  font-weight: 500;
}

body[data-shell-page="admin"] .admin-summary-reason-type {
  color: var(--admin-text);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body[data-shell-page="admin"] .admin-summary-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--admin-border);
}

body[data-shell-page="admin"] .admin-summary-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

body[data-shell-page="admin"] .admin-summary-tool-card {
  padding: 8px 0;
}

body[data-shell-page="admin"] .admin-summary-tool-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text);
}

body[data-shell-page="admin"] .admin-summary-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--admin-text);
}

body[data-shell-page="admin"] .admin-summary-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-shell-page="admin"] .admin-summary-action-row {
  margin-top: 4px;
}

body[data-shell-page="admin"] .admin-summary-reason-row {
  font-size: 12px;
  line-height: 1.45;
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .admin-summary-reason-label {
  font-weight: 600;
  color: var(--admin-text);
}

body[data-shell-page="admin"] .admin-summary-reason-value {
  color: var(--admin-text-secondary);
}

body[data-shell-page="admin"] .admin-summary-drawer-row {
  margin-top: 4px;
}

/* Tool drawer */
body[data-shell-page="admin"] #admin-tool-forms {
  background: var(--admin-panel-bg);
}

body[data-shell-page="admin"] .admin-tool-drawer-head {
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

body[data-shell-page="admin"] .admin-tool-drawer-close {
  background: #f5f5f5;
  color: var(--admin-text);
  border-color: var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .admin-tool-drawer-close:hover {
  background: #e8e8e8;
}

/* Inline forms */
body[data-shell-page="admin"] .inline-form.compact-form input,
body[data-shell-page="admin"] .inline-form.compact-form select,
body[data-shell-page="admin"] .inline-form.compact-form textarea {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  border-radius: 4px;
}

body[data-shell-page="admin"] .inline-form.compact-form input:focus,
body[data-shell-page="admin"] .inline-form.compact-form select:focus,
body[data-shell-page="admin"] .inline-form.compact-form textarea:focus {
  border-color: var(--admin-accent);
}

body[data-shell-page="admin"] .admin-conversation-tools select {
  background: #ffffff;
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .admin-conversation-tools button {
  background: #f5f5f5;
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 4px;
}

body[data-shell-page="admin"] .admin-conversation-tools button:hover {
  background: #e8e8e8;
}

body[data-shell-page="admin"] .action-btn.secondary {
  background: #f5f5f5;
  color: var(--admin-text);
  border-color: var(--admin-border);
}

body[data-shell-page="admin"] button[disabled],
body[data-shell-page="admin"] button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* === 左边栏搜索 + 滚动 + 居民入口 === */

.creative-rail-divider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 4px;
}

.rail-search-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(24, 18, 14, 0.24);
  background: rgba(255, 247, 224, 0.35);
  color: #18120e;
  font-size: 13px;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

.rail-search-input::placeholder {
  color: rgba(24, 18, 14, 0.35);
}

.rail-search-input:focus {
  border-color: #1890ff;
  background: rgba(255, 255, 255, 0.85);
}

/* 房间列表可滚动 */
.rail-list {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  scrollbar-width: thin;
}

/* 居民头像可点击指示 */
.room-button .room-avatar {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.room-button .room-avatar:hover {
  transform: scale(1.1);
}

/* 切换确认对话框 */
.room-switch-confirm {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(24, 18, 14, 0.95);
  color: #fff4e0;
  padding: 20px 24px;
  border: 1px solid rgba(255, 247, 224, 0.3);
  border-radius: 6px;
  z-index: 9999;
  min-width: 240px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.room-switch-confirm p {
  margin: 0 0 14px;
  font-size: 15px;
}

.room-switch-confirm button {
  margin: 0 6px;
  padding: 6px 18px;
  border: 1px solid rgba(255, 247, 224, 0.4);
  background: rgba(255, 247, 224, 0.12);
  color: #fff4e0;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}

.room-switch-confirm button.confirm-yes {
  background: #1890ff;
  border-color: #1890ff;
  font-weight: 600;
}

.room-switch-confirm button:hover {
  background: rgba(255, 247, 224, 0.22);
}

.room-switch-confirm button.confirm-yes:hover {
  background: #1677cc;
}
