/* =========================================================
   Matlis Workspace — original local demo interface
   ========================================================= */

:root {
  --plum-950: #170a20;
  --plum-900: #21102c;
  --plum-850: #2a1438;
  --plum-800: #351c45;
  --plum-700: #4b2c5c;
  --violet-700: #6d3bd1;
  --violet-600: #7c49e8;
  --violet-500: #9067ef;
  --violet-300: #c5a8ff;
  --violet-100: #f1e9ff;
  --lavender: #eee5fb;
  --coral: #ff8a72;
  --coral-soft: #fff0ea;
  --mint: #8fdfc9;
  --amber: #f4b64c;
  --ink: #281b31;
  --ink-soft: #50445b;
  --muted: #7c7185;
  --muted-light: #a399ab;
  --canvas: #faf8fc;
  --canvas-deep: #f4eff8;
  --surface: #ffffff;
  --line: #e9e2ef;
  --line-strong: #d9cde4;
  --green: #35b984;
  --red: #d95165;
  --shadow-sm: 0 1px 2px rgba(37, 16, 50, 0.04), 0 4px 12px rgba(37, 16, 50, 0.035);
  --shadow-md: 0 14px 40px rgba(35, 14, 48, 0.12);
  --shadow-lg: 0 30px 90px rgba(24, 8, 34, 0.26);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 286px;
  --thread-width: 392px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

::selection {
  background: #ddc8fb;
  color: var(--plum-950);
}

:focus-visible {
  outline: 3px solid rgba(124, 73, 232, 0.55);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-12 {
  width: 12px;
  height: 12px;
}

.icon-14 {
  width: 14px;
  height: 14px;
}

.icon-16 {
  width: 16px;
  height: 16px;
}

.icon-18 {
  width: 18px;
  height: 18px;
}

.icon-22 {
  width: 22px;
  height: 22px;
}

/* =========================================================
   Shell
   ========================================================= */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
}

.app-shell.thread-open {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--thread-width);
}

.workspace-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 75% -160px, rgba(197, 168, 255, 0.13), transparent 65%),
    var(--canvas);
  position: relative;
}

/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(90% 50% at 5% 0%, rgba(255, 138, 114, 0.14), transparent 60%),
    radial-gradient(100% 46% at 100% 100%, rgba(124, 73, 232, 0.28), transparent 68%),
    linear-gradient(178deg, #321a43 0%, #271232 52%, #1d0c27 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.sidebar-glow {
  position: absolute;
  width: 230px;
  height: 230px;
  top: 160px;
  left: -150px;
  border-radius: 50%;
  border: 1px solid rgba(197, 168, 255, 0.12);
  box-shadow: 0 0 90px rgba(144, 103, 239, 0.18) inset;
  pointer-events: none;
}

.sidebar-glow::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: inherit;
  border: 1px solid rgba(255, 138, 114, 0.12);
}

.sidebar-top {
  padding: 19px 16px 10px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  width: max-content;
  max-width: 100%;
  border-radius: 12px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: block;
  filter: drop-shadow(0 7px 18px rgba(255, 125, 100, 0.2));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.brand-word {
  font-size: 24px;
  line-height: 1;
  font-weight: 740;
  letter-spacing: -0.055em;
}

.brand-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.workspace-switcher {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.035);
}

.workspace-switcher .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(143, 223, 201, 0.1);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 22px;
  position: relative;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.055);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.search-trigger:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.search-trigger > span {
  font-size: 12.5px;
  font-weight: 550;
  text-align: left;
  flex: 1;
}

.search-trigger kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 31px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9.5px;
  font-family: var(--sans);
  font-weight: 650;
  line-height: 1;
}

.quick-nav {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-link {
  width: 100%;
  height: 35px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.quick-link:hover,
.quick-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
}

.quick-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(144, 103, 239, 0.22), rgba(255, 255, 255, 0.055));
  box-shadow: inset 2px 0 0 rgba(197, 168, 255, 0.85);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 20px;
  color: rgba(255, 255, 255, 0.5);
}

.quick-link.active .quick-icon {
  color: var(--violet-300);
}

.quick-link .icon {
  width: 17px;
  height: 17px;
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  background: var(--coral);
  color: #401308;
  font-size: 9.5px;
  font-weight: 800;
}

.nav-count.muted {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.46);
}

.sidebar-section {
  margin-top: 24px;
}

.section-heading {
  min-height: 24px;
  padding: 0 7px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-add {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 140ms ease, background 140ms ease;
}

.sidebar-add:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-add .icon {
  width: 14px;
  height: 14px;
}

.channel-list,
.dm-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.channel-button,
.dm-button {
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12.7px;
  font-weight: 520;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

.channel-button:hover,
.dm-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

.channel-button.active,
.dm-button.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-weight: 650;
}

.channel-button .channel-glyph {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
}

.channel-button.active .channel-glyph {
  color: var(--violet-300);
}

.channel-button .icon {
  width: 13px;
  height: 13px;
}

.channel-label,
.dm-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-button .unread-dot,
.dm-button .unread-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 138, 114, 0.08);
}

.dm-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.dm-button .avatar {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  font-size: 8px;
  box-shadow: none;
}

.dm-button .avatar[data-presence]::after {
  width: 6px;
  height: 6px;
  right: -2px;
  bottom: -2px;
  border-width: 1.5px;
}

.dm-prefix {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.26);
  font-size: 14px;
}

.huddle-card {
  position: relative;
  width: 100%;
  margin-top: 3px;
  padding: 13px 13px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.48);
  text-align: left;
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(255, 138, 114, 0.16), transparent 70%),
    rgba(255, 255, 255, 0.045);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.huddle-card:hover {
  border-color: rgba(197, 168, 255, 0.3);
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(255, 138, 114, 0.2), transparent 70%),
    rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.huddle-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  right: -24px;
  bottom: -32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 13px rgba(255, 255, 255, 0.025);
}

.huddle-live {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: var(--mint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(143, 223, 201, 0.4);
  animation: soft-pulse 2.8s ease-out infinite;
}

.huddle-card strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  font-weight: 650;
}

.huddle-card > span:not(.huddle-live):not(.huddle-avatars) {
  font-size: 10.5px;
}

.huddle-avatars {
  display: flex;
  margin-top: 9px;
}

.huddle-avatars .avatar {
  width: 20px;
  height: 20px;
  margin-right: -4px;
  border-radius: 6px;
  border: 1.5px solid #2a1438;
  font-size: 7px;
}

.sidebar-footer {
  position: relative;
  z-index: 4;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(18, 7, 25, 0.23);
}

.profile-button {
  width: 100%;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  transition: background 150ms ease;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
}

.profile-button > .icon {
  color: rgba(255, 255, 255, 0.35);
}

.profile-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-copy strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 650;
}

.profile-copy > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9.5px;
}

.profile-copy .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}

.profile-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 74px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #251231;
  box-shadow: 0 20px 50px rgba(8, 2, 12, 0.45);
  animation: pop-in 160ms ease both;
}

.profile-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 5px;
}

.profile-menu-head div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-menu-head strong {
  color: #fff;
  font-size: 12.5px;
}

.profile-menu-head span:not(.avatar) {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.profile-menu > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11.5px;
  text-align: left;
}

.profile-menu > button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.profile-menu > button .icon {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.33);
}

.profile-menu-foot {
  margin-top: 5px;
  padding: 10px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.33);
  font-size: 9.5px;
  line-height: 1.6;
}

.profile-menu-foot .demo-chip {
  margin-right: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 8px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 7, 25, 0.52);
  backdrop-filter: blur(2px);
  z-index: 64;
}

/* =========================================================
   Demo banner
   ========================================================= */

.local-banner {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 6px clamp(16px, 2.4vw, 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6e5032;
  background:
    linear-gradient(90deg, rgba(255, 185, 116, 0.13), transparent 28%),
    #fff8ee;
  border-bottom: 1px solid #f2e3cd;
  font-size: 11px;
  position: relative;
  z-index: 5;
}

.local-banner p {
  margin: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-banner p strong {
  color: #5d3d1e;
}

.demo-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1.3;
  white-space: nowrap;
}

.demo-chip.light {
  background: #f7e5ca;
  color: #815424;
  border: 1px solid #eed8b8;
}

.banner-link {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 4px;
  color: #8a5c2d;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.banner-link:hover {
  color: #5b3a1b;
  background: rgba(137, 92, 45, 0.07);
}

.banner-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #a9865e;
}

.banner-close:hover {
  background: rgba(137, 92, 45, 0.08);
  color: #6e5032;
}

.banner-close .icon {
  width: 13px;
  height: 13px;
}

/* =========================================================
   Main header
   ========================================================= */

.main-header {
  flex: 0 0 auto;
  min-height: 82px;
  padding: 12px clamp(18px, 2.4vw, 28px);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 4;
}

.header-mobile-menu {
  display: none;
}

.header-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-eyebrow {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.header-eyebrow .eyebrow-sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-light);
}

.header-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-title-row h1 {
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-title-row h1 .title-glyph {
  color: var(--violet-600);
  font-size: 19px;
  font-weight: 600;
}

.header-title-row h1 .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.header-topic {
  margin-top: 2px;
  max-width: 620px;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-dm-avatar {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  font-size: 12px;
  flex: 0 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.avatar-stack {
  display: flex;
  align-items: center;
  margin-right: 6px;
}

.avatar-stack .avatar {
  width: 26px;
  height: 26px;
  margin-left: -7px;
  border: 2px solid #fff;
  border-radius: 8px;
  font-size: 8px;
  box-shadow: none;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-stack .stack-more {
  width: 27px;
  height: 27px;
  margin-left: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid #fff;
  background: var(--lavender);
  color: var(--violet-700);
  font-size: 8.5px;
  font-weight: 800;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.icon-button:hover {
  background: var(--violet-100);
  color: var(--violet-700);
  border-color: #e7dbf7;
}

.icon-button.active {
  color: var(--amber);
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.header-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--line);
}

.huddle-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet-600), #6b34c8);
  box-shadow: 0 5px 15px rgba(109, 59, 209, 0.2);
  font-size: 11.5px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.huddle-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(109, 59, 209, 0.27);
}

.huddle-button .icon {
  width: 15px;
  height: 15px;
}

.header-note {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
}

/* Files / notes header */
.view-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button-secondary,
.button-primary,
.button-quiet,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 35px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--violet-600), #6b34c8);
  box-shadow: 0 5px 15px rgba(109, 59, 209, 0.17);
}

.button-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

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

.button-secondary:hover {
  border-color: #cbb8de;
  background: #fcfaff;
}

.button-quiet {
  color: var(--violet-700);
  background: var(--violet-100);
}

.button-quiet:hover {
  background: #e9dcfc;
}

.button-danger {
  color: #a72d42;
  background: #fff0f2;
  border: 1px solid #f1cdd4;
}

.button-danger:hover {
  background: #ffe5e9;
}

.button-primary .icon,
.button-secondary .icon,
.button-quiet .icon,
.button-danger .icon {
  width: 15px;
  height: 15px;
}

/* =========================================================
   Shared
   ========================================================= */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 30%;
  color: #fff;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1;
  background: #9276aa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  user-select: none;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 10px;
}

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

.avatar-lg {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  font-size: 14px;
}

.avatar[data-presence]::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
}

.avatar[data-presence="away"]::after {
  background: var(--amber);
}

.avatar[data-presence="offline"]::after {
  background: #b9afc1;
}

.avatar-alex {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.46), transparent 36%),
    linear-gradient(135deg, #f7a86e 0%, #e56979 52%, #9c4dbb 100%);
  color: #421423;
}

.avatar-maya {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.35), transparent 35%),
    linear-gradient(135deg, #b69cff 0%, #7d5ce8 55%, #5a3ab7 100%);
}

.avatar-idris {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.3), transparent 35%),
    linear-gradient(135deg, #8edbd0 0%, #349ca7 58%, #21606e 100%);
  color: #073137;
}

.avatar-lena {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.36), transparent 35%),
    linear-gradient(135deg, #ffb7b0 0%, #e87599 55%, #a74570 100%);
  color: #4a1329;
}

.avatar-tomas {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.3), transparent 35%),
    linear-gradient(135deg, #f7ce7c 0%, #d69744 58%, #9a6426 100%);
  color: #3e2708;
}

.avatar-priya {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.32), transparent 35%),
    linear-gradient(135deg, #d9abee 0%, #a266c9 55%, #71408f 100%);
  color: #32183e;
}

.avatar-noah {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.34), transparent 35%),
    linear-gradient(135deg, #9bb7ff 0%, #5e77dc 56%, #364b9b 100%);
}

.avatar-samira {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.32), transparent 35%),
    linear-gradient(135deg, #f3a7ce 0%, #cb5e9d 55%, #8e3a6a 100%);
  color: #48132e;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--green);
}

.muted {
  color: var(--muted);
}

.empty-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 19px;
  color: var(--violet-600);
  background: linear-gradient(135deg, #f4ecff, #efe4ff);
  border: 1px solid #e5d6fa;
}

.empty-icon .icon {
  width: 25px;
  height: 25px;
}

/* =========================================================
   Conversation
   ========================================================= */

.view-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.message-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px clamp(20px, 3vw, 44px) 14px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.message-scroll::-webkit-scrollbar,
.view-scroll::-webkit-scrollbar,
.notes-list-scroll::-webkit-scrollbar,
.note-stage::-webkit-scrollbar,
.thread-scroll::-webkit-scrollbar {
  width: 8px;
}

.message-scroll::-webkit-scrollbar-thumb,
.view-scroll::-webkit-scrollbar-thumb,
.notes-list-scroll::-webkit-scrollbar-thumb,
.note-stage::-webkit-scrollbar-thumb,
.thread-scroll::-webkit-scrollbar-thumb {
  background: #ddd2e6;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.channel-intro {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  max-width: 980px;
  margin: 2px auto 18px;
  padding: 20px 21px;
  overflow: hidden;
  border: 1px solid #eadff5;
  border-radius: 19px;
  background:
    radial-gradient(400px 160px at 100% 0%, rgba(255, 138, 114, 0.08), transparent 65%),
    linear-gradient(135deg, #fcf9ff 0%, #f7f1fc 100%);
}

.channel-intro::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -66px;
  top: -82px;
  border-radius: 50%;
  border: 1px solid rgba(124, 73, 232, 0.08);
  box-shadow: 0 0 0 23px rgba(124, 73, 232, 0.025);
  pointer-events: none;
}

.channel-intro-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral) 0%, #c9519b 52%, var(--violet-600) 100%);
  box-shadow: 0 8px 20px rgba(175, 79, 164, 0.18);
  font-size: 22px;
  font-weight: 500;
}

.channel-intro-copy {
  min-width: 0;
  flex: 1;
}

.channel-intro h2 {
  margin: 1px 0 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.channel-intro p {
  margin: 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.channel-intro-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.channel-intro-meta .meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #ebe1f2;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.65);
}

.channel-intro-meta .meta-pill .icon {
  width: 11px;
  height: 11px;
}

.channel-intro-meta .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c8becf;
}

.date-divider {
  max-width: 980px;
  margin: 10px auto 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.date-divider::before,
.date-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, #e7dfed);
}

.date-divider::after {
  background: linear-gradient(90deg, #e7dfed, transparent);
}

.date-divider span {
  padding: 3px 9px;
  border: 1px solid #e9e1ef;
  border-radius: 99px;
  background: #fff;
  white-space: nowrap;
}

.messages {
  max-width: 980px;
  margin: 0 auto;
}

.message {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  padding: 10px 14px;
  margin: 0 -14px;
  border-radius: 12px;
  transition: background 130ms ease, box-shadow 160ms ease;
}

.message:hover,
.message:focus-within {
  background: rgba(247, 242, 252, 0.82);
}

.message.is-first {
  margin-top: 5px;
}

.message.is-grouped {
  padding-top: 3px;
  padding-bottom: 3px;
}

.message.is-grouped.is-last {
  padding-bottom: 10px;
}

.message.flash {
  animation: message-flash 2.8s ease both;
}

.message-avatar-gutter {
  min-width: 0;
}

.message .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 11px;
  margin-top: 1px;
}

.message.is-grouped .avatar {
  visibility: hidden;
}

.message-content {
  min-width: 0;
  padding-top: 1px;
}

.message-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 19px;
  line-height: 1.3;
}

.message-author {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 730;
  letter-spacing: -0.012em;
}

.message-role {
  display: none;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 550;
}

.message-time {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.message-edited {
  color: var(--muted-light);
  font-size: 9px;
  font-style: italic;
}

.message-text {
  margin-top: 1px;
  color: #382c41;
  font-size: 13.6px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.message-text p {
  margin: 0;
}

.message-text p + p {
  margin-top: 7px;
}

.message-text strong {
  color: #24142e;
  font-weight: 720;
}

.message-text em {
  color: #4a3857;
}

.message-text code {
  padding: 1px 4px;
  border: 1px solid #e5d9ef;
  border-radius: 4px;
  color: #6b3b94;
  background: #f8f2fd;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.message-text a {
  color: var(--violet-700);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(109, 59, 209, 0.25);
}

.message-text a:hover {
  border-bottom-color: var(--violet-700);
}

.message-text .mention {
  display: inline;
  padding: 0 3px;
  border-radius: 3px;
  color: var(--violet-700);
  background: #efe6ff;
  font-weight: 650;
}

.message-text .channel-ref {
  color: var(--violet-700);
  font-weight: 620;
}

.message-actions {
  position: absolute;
  top: -14px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid #e7ddeb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(43, 20, 59, 0.09);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 3;
}

.message:hover .message-actions,
.message:focus-within .message-actions,
.message-actions.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message-action {
  width: 27px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}

.message-action:hover {
  color: var(--violet-700);
  background: var(--violet-100);
}

.message-action .icon {
  width: 15px;
  height: 15px;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(330px, 100%);
  padding: 8px;
  border: 1px solid #e8deef;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.attachment-card:hover {
  border-color: #cdb8e0;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(60, 32, 77, 0.08);
}

.attachment-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--violet-700);
  background:
    linear-gradient(135deg, #f6efff, #ede1fb);
  border: 1px solid #ece1f6;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb .icon {
  width: 19px;
  height: 19px;
}

.attachment-thumb[data-kind="image"] {
  background: #f4e8ff;
}

.attachment-thumb[data-kind="data"] {
  color: #167c6c;
  background: #e7f8f3;
  border-color: #d4f0e8;
}

.attachment-thumb[data-kind="archive"] {
  color: #9a6525;
  background: #fff4e1;
  border-color: #f4e8d3;
}

.attachment-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 680;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attachment-meta {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 540;
}

.attachment-action {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #a596af;
}

.attachment-card:hover .attachment-action {
  color: var(--violet-700);
  background: var(--violet-100);
}

.attachment-action .icon {
  width: 14px;
  height: 14px;
}

.reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.reaction-chip {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 5px;
  border: 1px solid #e9dfef;
  border-radius: 999px;
  color: #66596f;
  background: #fff;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1;
  transition: border-color 130ms ease, background 130ms ease, transform 130ms ease;
}

.reaction-chip:hover {
  border-color: #d2bfe4;
  background: #fcf9ff;
  transform: translateY(-1px);
}

.reaction-chip.mine {
  border-color: #cbb2ee;
  background: #f2e8ff;
  color: var(--violet-700);
}

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

.reaction-add {
  width: 24px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 99px;
  color: #a296aa;
}

.reaction-add:hover {
  color: var(--violet-700);
  background: var(--violet-100);
  border-color: #e5d7f7;
}

.reaction-add .icon {
  width: 14px;
  height: 14px;
}

.thread-summary {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--violet-700);
  font-size: 10.5px;
  font-weight: 650;
  text-align: left;
  transition: background 130ms ease, border-color 130ms ease;
}

.thread-summary:hover {
  background: #fff;
  border-color: #eadff4;
}

.thread-summary-faces {
  display: flex;
}

.thread-summary-faces .avatar {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--canvas);
  border-radius: 6px;
  margin-left: -5px;
  font-size: 6.5px;
}

.thread-summary-faces .avatar:first-child {
  margin-left: 0;
}

.thread-summary .icon {
  width: 14px;
  height: 14px;
}

.thread-summary .last-reply {
  max-width: 390px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.thread-summary .reply-time {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 550;
}

.typing-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 0;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 600;
}

.typing-dots {
  display: flex;
  gap: 2px;
}

.typing-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b8abc3;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

/* Channel empty */
.channel-empty {
  max-width: 560px;
  margin: 9vh auto 0;
  padding: 34px;
  text-align: center;
  border: 1px dashed #dfd1eb;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
}

.channel-empty h3 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.channel-empty p {
  max-width: 380px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.channel-empty .button-primary {
  margin-top: 17px;
}

/* =========================================================
   Composer
   ========================================================= */

.composer-wrap {
  flex: 0 0 auto;
  padding: 10px clamp(20px, 3vw, 44px) 13px;
  background: linear-gradient(180deg, rgba(250, 248, 252, 0), var(--canvas) 25%);
}

.composer {
  max-width: 980px;
  margin: 0 auto;
  border: 1.5px solid #ddcfe8;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(44, 20, 61, 0.065);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: #b99de0;
  box-shadow: 0 12px 36px rgba(75, 34, 112, 0.1), 0 0 0 3px rgba(124, 73, 232, 0.07);
}

.composer-main {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 3px 5px 0 7px;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 43px;
  max-height: 180px;
  padding: 11px 8px 8px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

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

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px 8px;
}

.composer-tool {
  width: 28px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #8d8197;
}

.composer-tool:hover {
  color: var(--violet-700);
  background: var(--violet-100);
}

.composer-tool .icon {
  width: 16px;
  height: 16px;
}

.composer-local {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 3px;
  color: #b0a5b7;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.composer-local .icon {
  width: 10px;
  height: 10px;
}

.composer-spacer {
  flex: 1;
}

.composer-send {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--violet-600);
  font-size: 10.5px;
  font-weight: 750;
  box-shadow: 0 3px 9px rgba(109, 59, 209, 0.18);
  transition: background 140ms ease, transform 140ms ease;
}

.composer-send:hover {
  background: var(--violet-700);
  transform: translateY(-1px);
}

.composer-send:disabled {
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.composer-send .icon {
  width: 12px;
  height: 12px;
}

.composer-hint {
  max-width: 980px;
  margin: 5px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #b1a6b8;
  font-size: 8.5px;
  font-weight: 550;
}

.composer-hint kbd {
  padding: 0 3px;
  border: 1px solid #e5dce9;
  border-radius: 3px;
  background: #fff;
  font-size: 8px;
  font-family: var(--sans);
}

.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px 0;
}

.pending-file {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
  padding: 4px 5px 4px 7px;
  border: 1px solid #e8ddf2;
  border-radius: 7px;
  color: var(--ink-soft);
  background: #fbf8ff;
  font-size: 9.5px;
  font-weight: 600;
}

.pending-file .icon {
  width: 13px;
  height: 13px;
  color: var(--violet-600);
}

.pending-file span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pending-remove {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted-light);
}

.pending-remove:hover {
  color: var(--red);
  background: #fff0f2;
}

.pending-remove .icon {
  width: 10px;
  height: 10px;
}

/* =========================================================
   Reaction picker popover
   ========================================================= */

.reaction-popover {
  position: fixed;
  z-index: 79;
  width: 234px;
  padding: 9px;
  border: 1px solid #e6dced;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(37, 16, 50, 0.18);
  animation: pop-in 140ms ease both;
}

.reaction-popover-title {
  padding: 2px 5px 7px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.reaction-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.reaction-option {
  width: 25px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
}

.reaction-option:hover {
  background: var(--violet-100);
  transform: scale(1.08);
}

.reaction-popover-foot {
  margin-top: 5px;
  padding: 6px 5px 1px;
  border-top: 1px solid #f0e8f5;
  color: #b0a5b7;
  font-size: 8.5px;
}

/* =========================================================
   Thread panel
   ========================================================= */

.thread-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fbf9fc;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 35px rgba(44, 20, 61, 0.035);
  z-index: 20;
}

.thread-header {
  flex: 0 0 auto;
  height: 63px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.thread-header-copy {
  min-width: 0;
  flex: 1;
}

.thread-header-copy strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.thread-header-copy span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 9.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.thread-header-copy .icon {
  width: 10px;
  height: 10px;
}

.thread-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
}

.thread-close:hover {
  background: var(--violet-100);
  color: var(--violet-700);
}

.thread-close .icon {
  width: 16px;
  height: 16px;
}

.thread-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 10px;
}

.thread-parent {
  padding-bottom: 12px;
  border-bottom: 1px solid #eee7f2;
}

.thread-parent .message {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  background: transparent;
}

.thread-parent .message:hover {
  background: transparent;
}

.thread-parent .message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.thread-parent .message-actions {
  display: none;
}

.thread-parent .message-text {
  font-size: 13px;
}

.thread-section-label {
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #eee7f2;
}

.thread-replies {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-reply {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  transition: background 130ms ease;
}

.thread-reply:hover {
  background: #f7f2fb;
}

.thread-reply .avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 9px;
}

.thread-reply .message-text {
  font-size: 12.5px;
  line-height: 1.58;
}

.thread-reply .message-author {
  font-size: 12px;
}

.thread-reply .message-actions {
  display: none;
}

.thread-reply-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.thread-reply:hover .thread-reply-actions,
.thread-reply:focus-within .thread-reply-actions {
  opacity: 1;
}

.thread-reply-actions button {
  height: 21px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 5px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 600;
}

.thread-reply-actions button:hover {
  color: var(--violet-700);
  background: var(--violet-100);
}

.thread-reply-actions .icon {
  width: 11px;
  height: 11px;
}

.thread-reply.flash {
  animation: message-flash 2.8s ease both;
}

.thread-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.thread-composer-wrap {
  flex: 0 0 auto;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.thread-composer-wrap .composer {
  border-radius: 12px;
}

.thread-composer-wrap .composer textarea {
  min-height: 38px;
  padding-top: 9px;
  font-size: 12px;
}

.thread-composer-wrap .composer-hint {
  font-size: 8px;
}

.thread-typing {
  padding: 5px 8px 0;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 600;
}

/* =========================================================
   Files view
   ========================================================= */

.view-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 25px clamp(20px, 3vw, 40px) 40px;
}

.view-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.view-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.view-hero h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 730;
  letter-spacing: -0.035em;
}

.view-hero h2 .icon {
  width: 22px;
  height: 22px;
  color: var(--violet-600);
}

.view-hero p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  max-width: 560px;
  line-height: 1.6;
}

.view-stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat-pill {
  min-width: 108px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.stat-pill strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 730;
  letter-spacing: -0.02em;
}

.stat-pill span {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.files-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.inline-search {
  min-width: 210px;
  flex: 1;
  max-width: 340px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.inline-search:focus-within {
  border-color: #bca4df;
  box-shadow: 0 0 0 3px rgba(124, 73, 232, 0.07);
}

.inline-search .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-light);
}

.inline-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.inline-search input::placeholder {
  color: #aaa0b2;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f2fa;
}

.filter-tab {
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.active {
  color: var(--violet-700);
  background: #fff;
  box-shadow: 0 1px 4px rgba(44, 20, 61, 0.08);
}

.files-count {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.file-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e8dfef;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.file-card:hover {
  transform: translateY(-3px);
  border-color: #d3bfe6;
  box-shadow: 0 12px 30px rgba(54, 25, 72, 0.1);
}

.file-preview {
  position: relative;
  height: 116px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(200px 130px at 80% 10%, rgba(255, 255, 255, 0.68), transparent 70%),
    linear-gradient(135deg, #f4ebff, #eee1fb);
  border-bottom: 1px solid #f0e8f5;
}

.file-preview::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -68px;
  bottom: -82px;
  border-radius: 50%;
  border: 1px solid rgba(124, 73, 232, 0.1);
  box-shadow: 0 0 0 16px rgba(124, 73, 232, 0.03);
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview .file-preview-art {
  width: 74px;
  height: 88px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 9px;
  border: 1px solid rgba(109, 59, 209, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 20px rgba(66, 35, 86, 0.09);
  transform: rotate(-2deg);
}

.file-preview .file-preview-art::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 3px;
  background: #e1d2f2;
  box-shadow: 0 9px 0 #eee4f7, 0 18px 0 #eee4f7, 0 27px 0 #eee4f7;
}

.file-preview .file-preview-art .file-art-badge {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 6px;
  color: var(--violet-700);
  background: #efe4ff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.file-preview[data-kind="data"] {
  background:
    radial-gradient(200px 130px at 80% 10%, rgba(255, 255, 255, 0.68), transparent 70%),
    linear-gradient(135deg, #e9f9f4, #ddf4ed);
}

.file-preview[data-kind="data"] .file-preview-art .file-art-badge {
  color: #147b6b;
  background: #d7f3eb;
}

.file-preview[data-kind="archive"] {
  background:
    radial-gradient(200px 130px at 80% 10%, rgba(255, 255, 255, 0.68), transparent 70%),
    linear-gradient(135deg, #fff5e4, #ffedd4);
}

.file-preview[data-kind="archive"] .file-preview-art .file-art-badge {
  color: #8d5b20;
  background: #ffefd8;
}

.file-type-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 6px;
  border-radius: 4px;
  color: #6d5580;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(4px);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-card-body {
  padding: 11px 12px 12px;
}

.file-card-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 690;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 550;
}

.file-card-meta .meta-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #c6b9cf;
}

.file-card-source {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #f2ecf6;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-card-source .avatar {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  font-size: 6px;
}

.file-card-source .icon {
  width: 10px;
  height: 10px;
  color: var(--muted-light);
}

.file-card-source span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 68px 24px;
  text-align: center;
  border: 1px dashed #ddd0e9;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.empty-panel h3 {
  margin: 0 0 5px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.empty-panel p {
  margin: 0 auto;
  max-width: 360px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

/* =========================================================
   Notes view
   ========================================================= */

.notes-view {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  overflow: hidden;
}

.notes-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
}

.notes-sidebar-head {
  padding: 18px 16px 12px;
  border-bottom: 1px solid #f0e9f4;
}

.notes-sidebar-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.notes-sidebar-head h2 .icon {
  width: 17px;
  height: 17px;
  color: var(--violet-600);
}

.notes-sidebar-head p {
  margin: 3px 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.notes-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 11px;
}

.note-list-label {
  padding: 5px 6px 6px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.note-list-card {
  width: 100%;
  display: block;
  padding: 11px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}

.note-list-card:hover {
  background: #faf6fe;
  border-color: #eee4f5;
}

.note-list-card.active {
  background: #f4ebff;
  border-color: #e5d4f8;
}

.note-list-card-head {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.note-list-card h3 {
  flex: 1;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.note-pin {
  flex: 0 0 auto;
  color: #b08c3b;
}

.note-pin .icon {
  width: 11px;
  height: 11px;
  transform: rotate(12deg);
}

.note-list-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.note-list-card-meta {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 8.5px;
}

.note-list-card-meta .mini-tag {
  padding: 1px 5px;
  border-radius: 3px;
  color: #8b6e9f;
  background: rgba(124, 73, 232, 0.07);
  font-weight: 650;
}

.note-stage {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px clamp(22px, 4vw, 56px) 50px;
  background:
    radial-gradient(800px 320px at 85% -80px, rgba(197, 168, 255, 0.16), transparent 60%),
    #fbf9fc;
}

.note-reader {
  max-width: 790px;
  margin: 0 auto;
  animation: fade-up 260ms ease both;
}

.note-reader-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.note-reader-top .note-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-reader-top .note-kicker .icon {
  width: 12px;
  height: 12px;
  color: var(--violet-600);
}

.note-reader-top .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c8becf;
}

.note-reader-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.note-reader h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 41px);
  line-height: 1.13;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.note-byline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 13px 0 24px;
  color: var(--muted);
  font-size: 10.5px;
}

.note-byline .avatar {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 7px;
}

.note-byline .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c8becf;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 2px;
}

.note-tag {
  padding: 2px 6px;
  border: 1px solid #e9dff0;
  border-radius: 99px;
  color: #806890;
  background: #fff;
  font-size: 8px;
  font-weight: 650;
}

.note-body {
  color: #413349;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.8;
  max-width: 700px;
}

.note-body h1,
.note-body h2,
.note-body h3 {
  margin: 26px 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.note-body h1 {
  font-size: 25px;
}

.note-body h2 {
  font-size: 20px;
}

.note-body h3 {
  font-size: 17px;
}

.note-body > :first-child {
  margin-top: 0;
}

.note-body p {
  margin: 0 0 12px;
}

.note-body ul,
.note-body ol {
  margin: 0 0 14px;
  padding-left: 20px;
}

.note-body li {
  margin-bottom: 5px;
}

.note-body li::marker {
  color: var(--violet-500);
}

.note-body strong {
  color: #2a1833;
  font-weight: 720;
}

.note-body em {
  color: #594564;
}

.note-body code {
  padding: 1px 4px;
  border-radius: 4px;
  color: #6b3b94;
  background: #f3eafb;
  font-family: Consolas, monospace;
  font-size: 0.85em;
}

.note-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid #c6a6eb;
  border-radius: 0 8px 8px 0;
  color: #5b4668;
  background: #f9f4ff;
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.note-body a {
  color: var(--violet-700);
}

.note-editor {
  max-width: 850px;
  margin: 0 auto;
  animation: fade-up 230ms ease both;
}

.note-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.note-editor-toolbar .note-editor-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
}

.note-editor-toolbar .saved-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 9px;
  font-weight: 650;
}

.note-editor-toolbar .saved-state .icon {
  width: 11px;
  height: 11px;
}

.note-editor-toolbar .note-reader-actions {
  margin-left: auto;
}

.note-title-input {
  width: 100%;
  padding: 3px 0 11px;
  border: 0;
  border-bottom: 1px solid #e8deef;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.note-title-input:focus {
  border-bottom-color: #c3a4e5;
}

.note-editor-meta {
  margin: 11px 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.note-editor-meta input {
  width: 180px;
  padding: 4px 7px;
  border: 1px solid #e8deef;
  border-radius: 5px;
  background: #fff;
  font-size: 9.5px;
}

.note-content-input {
  width: 100%;
  min-height: 430px;
  padding: 18px 20px;
  resize: vertical;
  border: 1px solid #e5daeE;
  border-radius: 12px;
  outline: none;
  color: #43334c;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(180deg, transparent 0 27px, #f4edf8 27px 28px) border-box;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.8;
  box-shadow: inset 0 1px 3px rgba(48, 24, 64, 0.03);
}

.note-content-input:focus {
  border-color: #c6abe2;
  box-shadow: 0 0 0 3px rgba(124, 73, 232, 0.06);
}

.note-editor-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}

.note-editor-footer .hint {
  color: var(--muted-light);
  font-size: 9px;
}

.note-editor-footer .note-reader-actions {
  margin-left: auto;
}

.note-empty-stage {
  height: 100%;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.note-empty-stage h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.note-empty-stage p {
  max-width: 330px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
}

/* =========================================================
   Search
   ========================================================= */

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 20px;
  background: rgba(23, 10, 32, 0.6);
  backdrop-filter: blur(5px);
  animation: fade-in 150ms ease both;
}

.search-dialog {
  width: min(760px, 100%);
  max-height: min(720px, 82vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 40px 110px rgba(15, 4, 22, 0.38);
  animation: search-in 180ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.search-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #efe8f4;
}

.search-top > .icon {
  width: 21px;
  height: 21px;
  color: var(--violet-600);
}

.search-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 520;
  letter-spacing: -0.015em;
}

.search-input::placeholder {
  color: #b1a5ba;
}

.search-escape {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 6px;
  border: 1px solid #e6dced;
  border-radius: 5px;
  color: #a499ad;
  background: #fbf9fc;
  font-size: 9px;
  font-weight: 650;
}

.search-close {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}

.search-close:hover {
  background: var(--violet-100);
  color: var(--violet-700);
}

.search-close .icon {
  width: 15px;
  height: 15px;
}

.search-filter-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-bottom: 1px solid #f1ebf5;
  background: #fdfbfe;
}

.search-filter {
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
}

.search-filter:hover {
  color: var(--ink);
  background: #f6effb;
}

.search-filter.active {
  color: var(--violet-700);
  background: #eee3fd;
}

.search-scope {
  margin-left: auto;
  color: #b2a6ba;
  font-size: 8.5px;
  font-weight: 600;
}

.search-results {
  flex: 1;
  min-height: 130px;
  overflow-y: auto;
  padding: 8px;
}

.search-results::-webkit-scrollbar {
  width: 7px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #ded2e8;
  border-radius: 99px;
}

.search-group + .search-group {
  margin-top: 4px;
}

.search-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px 5px;
  color: #9e91a7;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-group-title .count {
  padding: 0 4px;
  border-radius: 99px;
  background: #f2ecf6;
  color: #9b8fa4;
  font-size: 8px;
  letter-spacing: 0;
}

.search-result {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: #eee4f5;
  background: #faf6fe;
}

.search-result-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--violet-700);
  background: #f1e7fd;
  font-size: 12px;
}

.search-result-icon.data {
  color: #147b6b;
  background: #e3f7f1;
}

.search-result-icon.note {
  color: #916b2d;
  background: #fbf1dd;
}

.search-result-icon.file {
  color: #6b4ec2;
  background: #f0e7ff;
}

.search-result-icon .icon {
  width: 15px;
  height: 15px;
}

.search-result-icon .avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 7px;
}

.search-result-body {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 680;
}

.search-result-title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-result-title time {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 500;
}

.search-result-snippet {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.search-result-context {
  margin-top: 2px;
  color: #b2a7ba;
  font-size: 8.5px;
  font-weight: 550;
}

mark {
  padding: 0 1px;
  border-radius: 2px;
  color: #56328f;
  background: #ead9ff;
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid #f0e9f4;
  background: #fdfbfe;
  color: #b0a5b7;
  font-size: 8.5px;
}

.search-footer kbd {
  padding: 1px 4px;
  border: 1px solid #e6dced;
  border-radius: 3px;
  background: #fff;
  font-family: var(--sans);
  font-size: 8px;
}

.search-footer .token-hint {
  margin-left: auto;
}

.search-empty {
  padding: 44px 20px;
  text-align: center;
}

.search-empty .empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  margin-bottom: 10px;
}

.search-empty h3 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.search-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.search-recent {
  padding: 12px 10px 18px;
}

.search-recent h3 {
  margin: 0 0 8px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.search-chip {
  padding: 5px 8px;
  border: 1px solid #e9dfef;
  border-radius: 6px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 9.5px;
  font-weight: 600;
}

.search-chip:hover {
  color: var(--violet-700);
  border-color: #d5c0e8;
  background: #fbf7ff;
}

.search-tip {
  display: flex;
  gap: 8px;
  margin: 16px 10px;
  padding: 11px 12px;
  border: 1px solid #efe5f7;
  border-radius: 9px;
  background: #fcf9ff;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.search-tip .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--violet-600);
}

/* =========================================================
   Dialogs
   ========================================================= */

/* Dialog mount point. Fixed overlay layer: must NOT be a grid item of
   .app-shell, or the empty div adds a second grid row and shortens the
   sidebar (visible gap under the sidebar background). */
.dialog-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.dialog-root > * {
  pointer-events: auto;
}

/* Popover mount point (reaction / emoji pickers). Same as .dialog-root:
   fixed overlay layer, must not add a grid row to .app-shell. */
.popover-root {
  position: fixed;
  inset: 0;
  z-index: 79;
  pointer-events: none;
}

.popover-root > * {
  pointer-events: auto;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 10, 32, 0.54);
  backdrop-filter: blur(4px);
  animation: fade-in 140ms ease both;
}

.dialog {
  width: min(490px, 100%);
  max-height: min(88vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: dialog-in 180ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.dialog.wide {
  width: min(780px, 100%);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 19px 20px 14px;
  border-bottom: 1px solid #f0e9f4;
}

.dialog-head-copy {
  min-width: 0;
  flex: 1;
}

.dialog-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.dialog-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.dialog-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
}

.dialog-close:hover {
  background: var(--violet-100);
  color: var(--violet-700);
}

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

.dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid #f0e9f4;
  background: #fdfbfe;
}

.form-field {
  margin-bottom: 15px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.form-field .label-hint {
  margin-left: 5px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 500;
}

.text-input,
.text-textarea {
  width: 100%;
  border: 1px solid #ddd0e7;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.text-input {
  height: 38px;
  padding: 0 11px;
}

.text-textarea {
  min-height: 74px;
  padding: 9px 11px;
  resize: vertical;
  line-height: 1.5;
}

.text-input:focus,
.text-textarea:focus {
  border-color: #b99de0;
  box-shadow: 0 0 0 3px rgba(124, 73, 232, 0.07);
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-prefix > span {
  position: absolute;
  left: 11px;
  color: #ab9fb3;
  font-size: 13px;
  pointer-events: none;
}

.input-with-prefix .text-input {
  padding-left: 26px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid #eee6f4;
  border-radius: 9px;
  background: #fcfafd;
}

.checkbox-row input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--violet-600);
}

.checkbox-row div {
  min-width: 0;
}

.checkbox-row strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 680;
}

.checkbox-row span {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.45;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 5px;
  color: #b93852;
  font-size: 9.5px;
  font-weight: 600;
}

.form-error .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.dialog-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 10px;
  border: 1px solid #f1e6d4;
  border-radius: 8px;
  background: #fffaf1;
  color: #8b6a3f;
  font-size: 9.5px;
  line-height: 1.5;
}

.dialog-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: #b58a4c;
}

.dialog-note.purple {
  border-color: #e9dcf8;
  background: #fbf7ff;
  color: #76588e;
}

.dialog-note.purple .icon {
  color: var(--violet-600);
}

/* File preview */
.file-preview-dialog {
  width: min(820px, 100%);
}

.file-preview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.file-preview-meta .file-badge {
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--violet-700);
  background: var(--violet-100);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.file-preview-stage {
  min-height: 260px;
  max-height: 54vh;
  overflow: auto;
  margin: 16px 20px 0;
  padding: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid #eae1f1;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #fbf9fd 25%, transparent 25%, transparent 75%, #fbf9fd 75%),
    linear-gradient(45deg, #fbf9fd 25%, transparent 25%, transparent 75%, #fbf9fd 75%),
    #f6f1fa;
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}

.file-preview-stage img {
  max-width: 100%;
  max-height: 48vh;
  border-radius: 5px;
  box-shadow: 0 8px 26px rgba(32, 15, 45, 0.12);
}

.file-preview-stage pre {
  width: 100%;
  margin: 0;
  color: #42324c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px 17px;
}

.file-preview-toolbar .hint {
  flex: 1;
  color: var(--muted-light);
  font-size: 9px;
}

/* About modal */
.about-mark {
  width: 55px;
  height: 55px;
  margin-bottom: 12px;
}

.about-list {
  display: grid;
  gap: 9px;
}

.about-item {
  display: flex;
  gap: 9px;
  padding: 10px;
  border: 1px solid #f0e7f6;
  border-radius: 9px;
  background: #fcfafd;
}

.about-item .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--violet-600);
}

.about-item.honest .icon {
  color: #a47430;
}

.about-item strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.about-item p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

/* =========================================================
   Huddle
   ========================================================= */

.huddle-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(14, 5, 20, 0.76);
  backdrop-filter: blur(8px);
  animation: fade-in 190ms ease both;
}

.huddle-room {
  width: min(1040px, 96vw);
  height: min(720px, 91vh);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(900px 500px at 15% -20%, rgba(144, 103, 239, 0.22), transparent 60%),
    radial-gradient(700px 420px at 95% 110%, rgba(255, 138, 114, 0.1), transparent 60%),
    #1f102a;
  box-shadow: 0 40px 130px rgba(0, 0, 0, 0.5);
  animation: huddle-in 260ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.huddle-head {
  flex: 0 0 auto;
  height: 65px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.huddle-head-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.huddle-head-copy {
  min-width: 0;
  flex: 1;
}

.huddle-head-copy strong {
  display: block;
  font-size: 12.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.huddle-head-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
}

.simulated-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border: 1px solid rgba(244, 182, 76, 0.28);
  border-radius: 4px;
  color: #f4c97e;
  background: rgba(244, 182, 76, 0.08);
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.huddle-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.huddle-timer .icon {
  width: 12px;
  height: 12px;
}

.huddle-close {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.4);
}

.huddle-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.huddle-close .icon {
  width: 16px;
  height: 16px;
}

.huddle-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.huddle-stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.huddle-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
  mask-image: linear-gradient(180deg, black, transparent 85%);
}

.huddle-intro-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 1px 4px 13px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  font-weight: 550;
}

.huddle-intro-line .live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 99px;
  color: #a8f0de;
  background: rgba(143, 223, 201, 0.1);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.huddle-tiles {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.huddle-tile {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.07), transparent 48%),
    linear-gradient(145deg, #321b42, #25142f);
}

.huddle-tile.speaking {
  border-color: rgba(143, 223, 201, 0.38);
  box-shadow: 0 0 0 1px rgba(143, 223, 201, 0.12), 0 0 35px rgba(143, 223, 201, 0.06);
}

.huddle-tile.you {
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.08), transparent 48%),
    linear-gradient(145deg, #402649, #2b1835);
}

.huddle-tile .tile-avatar {
  width: clamp(54px, 8vw, 78px);
  height: clamp(54px, 8vw, 78px);
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 760;
  letter-spacing: -0.03em;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}

.huddle-tile.speaking .tile-avatar {
  box-shadow: 0 0 0 3px rgba(143, 223, 201, 0.22), 0 12px 35px rgba(0, 0, 0, 0.22);
}

.huddle-tile-info {
  position: absolute;
  left: 11px;
  bottom: 10px;
  right: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tile-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(10, 3, 15, 0.42);
  backdrop-filter: blur(6px);
  font-size: 9px;
  font-weight: 650;
}

.tile-name .you-mark {
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
  font-weight: 500;
}

.tile-muted {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #f3b4ab;
  background: rgba(10, 3, 15, 0.42);
}

.tile-muted .icon {
  width: 10px;
  height: 10px;
}

.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  height: 9px;
  margin-left: 1px;
}

.voice-wave i {
  display: block;
  width: 2px;
  border-radius: 99px;
  background: var(--mint);
  animation: voice 1.1s ease-in-out infinite;
}

.voice-wave i:nth-child(1) {
  height: 4px;
  animation-delay: 0s;
}

.voice-wave i:nth-child(2) {
  height: 8px;
  animation-delay: 0.12s;
}

.voice-wave i:nth-child(3) {
  height: 6px;
  animation-delay: 0.24s;
}

.voice-wave i:nth-child(4) {
  height: 9px;
  animation-delay: 0.36s;
}

.huddle-tile .camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.28);
}

.huddle-tile .camera-placeholder .icon {
  width: 22px;
  height: 22px;
}

.huddle-tile .camera-placeholder span {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.screen-share {
  width: 100%;
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.screen-share-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px;
  color: #c9a8ff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.screen-share-window {
  flex: 1;
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 138, 114, 0.12), transparent 50%),
    linear-gradient(145deg, #fbf7ff, #f0e6fb);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  transform: perspective(900px) rotateX(1.5deg);
}

.screen-share-window .window-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 17px;
}

.screen-share-window .window-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d4c2e4;
}

.screen-share-window h4 {
  margin: 0 0 5px;
  color: #2d193a;
  font-family: var(--serif);
  font-size: clamp(15px, 2.1vw, 22px);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.screen-share-window p {
  margin: 0;
  max-width: 300px;
  color: #7e688d;
  font-size: 8px;
  line-height: 1.5;
}

.screen-share-window .fake-bars {
  margin-top: auto;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 35%;
  padding-top: 13px;
  border-top: 1px solid rgba(80, 40, 110, 0.08);
}

.fake-bars i {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #c4a4f0, #e7d7f8);
}

.fake-bars i:nth-child(1) { height: 40%; }
.fake-bars i:nth-child(2) { height: 68%; }
.fake-bars i:nth-child(3) { height: 52%; }
.fake-bars i:nth-child(4) { height: 88%; }
.fake-bars i:nth-child(5) { height: 61%; }
.fake-bars i:nth-child(6) { height: 77%; }

.huddle-side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 3, 12, 0.18);
}

.huddle-side-section {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.huddle-side-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.huddle-side-heading .count {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.24);
  letter-spacing: 0;
}

.huddle-person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.huddle-person .avatar {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  font-size: 8px;
}

.huddle-person-copy {
  min-width: 0;
  flex: 1;
}

.huddle-person-copy strong {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 9.5px;
  font-weight: 600;
}

.huddle-person-copy span {
  display: block;
  color: rgba(255, 255, 255, 0.28);
  font-size: 7.5px;
}

.huddle-person-status {
  display: flex;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.26);
}

.huddle-person-status .icon {
  width: 11px;
  height: 11px;
}

.huddle-person-status.speaking {
  color: var(--mint);
}

.huddle-caption-card {
  margin: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.huddle-caption-card span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  color: #bfa4e8;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.huddle-caption-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  line-height: 1.6;
  font-style: italic;
}

.huddle-disclaimer {
  margin-top: auto;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.26);
  font-size: 8px;
  line-height: 1.6;
}

.huddle-footer {
  flex: 0 0 auto;
  min-height: 80px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 3, 12, 0.16);
}

.huddle-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 63px;
  color: rgba(255, 255, 255, 0.39);
  font-size: 8px;
  font-weight: 600;
}

.huddle-control-button {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.77);
  background: rgba(255, 255, 255, 0.08);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.huddle-control-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.huddle-control-button.active {
  color: #fff;
  border-color: rgba(144, 103, 239, 0.5);
  background: rgba(144, 103, 239, 0.34);
}

.huddle-control-button.off {
  color: #f3b4ab;
  border-color: rgba(217, 81, 101, 0.26);
  background: rgba(217, 81, 101, 0.16);
}

.huddle-control-button .icon {
  width: 17px;
  height: 17px;
}

.huddle-control-button.share {
  width: auto;
  min-width: 115px;
  padding: 0 13px;
  border-radius: 20px;
  gap: 6px;
  display: inline-flex;
  font-size: 9px;
  font-weight: 700;
}

.huddle-control-button.share.active {
  color: #d9c6ff;
  border-color: rgba(197, 168, 255, 0.35);
}

.huddle-leave {
  margin-left: 15px;
  height: 39px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  color: #fff;
  background: #c64c5f;
  font-size: 9px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(198, 76, 95, 0.22);
}

.huddle-leave:hover {
  background: #b73f52;
}

.huddle-leave .icon {
  width: 15px;
  height: 15px;
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(440px, calc(100vw - 30px));
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.82);
  background: #2a1636;
  box-shadow: 0 12px 36px rgba(24, 8, 34, 0.28);
  font-size: 10.5px;
  font-weight: 550;
  animation: toast-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.toast.out {
  animation: toast-out 180ms ease both;
}

.toast .toast-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 223, 201, 0.13);
  color: var(--mint);
}

.toast .toast-icon.warn {
  background: rgba(244, 182, 76, 0.12);
  color: #f4c97e;
}

.toast .toast-icon .icon {
  width: 11px;
  height: 11px;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes soft-pulse {
  0% { box-shadow: 0 0 0 0 rgba(143, 223, 201, 0.35); }
  65% { box-shadow: 0 0 0 6px rgba(143, 223, 201, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 223, 201, 0); }
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@keyframes voice {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1); }
}

@keyframes message-flash {
  0% { background: rgba(232, 213, 255, 0.88); box-shadow: 0 0 0 3px rgba(144, 103, 239, 0.14); }
  60% { background: rgba(245, 236, 255, 0.55); box-shadow: 0 0 0 3px rgba(144, 103, 239, 0.06); }
  100% { background: transparent; box-shadow: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes search-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes huddle-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px) scale(0.98); }
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (min-width: 1280px) {
  .message-role {
    display: inline;
  }
}

@media (max-width: 1160px) {
  :root {
    --sidebar-width: 260px;
  }

  .app-shell.thread-open {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .thread-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(var(--thread-width), 94vw);
    box-shadow: -20px 0 65px rgba(29, 11, 39, 0.18);
    z-index: 68;
  }

  .header-topic {
    max-width: 400px;
  }
}

@media (max-width: 980px) {
  .notes-view {
    grid-template-columns: 268px minmax(0, 1fr);
  }

  .avatar-stack {
    display: none;
  }

  .header-note {
    display: none;
  }

  .huddle-body {
    grid-template-columns: minmax(0, 1fr) 245px;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 286px;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.thread-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 65;
    transform: translateX(-101%);
    transition: transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .header-mobile-menu {
    display: inline-flex;
  }

  .main-header {
    min-height: 76px;
    padding: 11px 16px;
    gap: 11px;
  }

  .header-topic {
    max-width: 100%;
  }

  .header-actions {
    gap: 2px;
  }

  .header-divider {
    display: none;
  }

  .huddle-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .huddle-button span {
    display: none;
  }

  .message-scroll {
    padding: 18px 18px 12px;
  }

  .composer-wrap {
    padding: 8px 14px 12px;
  }

  .local-banner p {
    white-space: normal;
    line-height: 1.3;
  }

  .banner-link {
    display: none;
  }

  .notes-view {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 33vh) minmax(0, 1fr);
  }

  .notes-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .notes-sidebar-head {
    padding: 13px 14px 9px;
  }

  .notes-sidebar-head p {
    display: none;
  }

  .notes-sidebar-head .inline-search {
    max-width: none;
    margin-top: 8px;
  }

  .notes-list-scroll {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
  }

  .note-list-label {
    display: none;
  }

  .note-list-card {
    flex: 0 0 210px;
    margin-bottom: 0;
    padding: 9px;
  }

  .note-list-card p {
    -webkit-line-clamp: 1;
  }

  .note-stage {
    padding: 22px 22px 40px;
  }

  .note-body {
    font-size: 13.5px;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  }

  .search-layer {
    padding: 4vh 14px 14px;
  }

  .search-dialog {
    max-height: 88vh;
  }

  .huddle-overlay {
    padding: 10px;
  }

  .huddle-room {
    width: 100%;
    height: min(760px, 96vh);
    height: min(760px, 96dvh);
    border-radius: 18px;
  }

  .huddle-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .huddle-side {
    display: none;
  }

  .huddle-footer {
    gap: 3px;
    min-height: 72px;
    padding: 10px;
  }

  .huddle-control {
    min-width: 55px;
  }

  .huddle-control-button.share {
    min-width: 100px;
  }

  .huddle-leave {
    margin-left: 7px;
  }
}

@media (max-width: 640px) {
  .local-banner {
    padding: 6px 12px;
    gap: 7px;
    font-size: 9.5px;
  }

  .local-banner p {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .local-banner .banner-close {
    margin-left: auto;
  }

  .main-header {
    min-height: 70px;
    padding: 9px 11px;
    gap: 6px;
  }

  .header-eyebrow {
    font-size: 8px;
  }

  .header-title-row h1 {
    font-size: 16px;
  }

  .header-topic {
    font-size: 10px;
    max-width: 200px;
  }

  .header-actions .icon-button:not(.header-search):not(.header-info) {
    display: none;
  }

  .header-actions .huddle-button {
    display: inline-flex;
  }

  .header-info {
    display: none;
  }

  .message-scroll {
    padding: 14px 10px 10px;
  }

  .channel-intro {
    margin: 0 auto 13px;
    padding: 15px;
    border-radius: 15px;
    gap: 11px;
  }

  .channel-intro-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 18px;
  }

  .channel-intro h2 {
    font-size: 16px;
  }

  .channel-intro p {
    font-size: 11px;
  }

  .channel-intro-meta {
    margin-top: 8px;
    font-size: 9px;
    gap: 5px;
  }

  .message {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 7px;
    margin: 0;
  }

  .message .avatar {
    width: 33px;
    height: 33px;
    border-radius: 10px;
    font-size: 9px;
  }

  .message-text {
    font-size: 12.8px;
  }

  .message-actions {
    position: static;
    margin-top: 4px;
    width: max-content;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    display: flex;
  }

  .message-action {
    width: 25px;
    height: 22px;
    color: #9b90a4;
  }

  .message.is-grouped .avatar {
    visibility: hidden;
  }

  .attachment-card {
    width: 100%;
  }

  .thread-summary .last-reply {
    max-width: 180px;
  }

  .thread-summary .reply-time {
    display: none;
  }

  .composer-wrap {
    padding: 7px 10px 10px;
  }

  .composer textarea {
    font-size: 12.5px;
    min-height: 39px;
  }

  .composer-hint .hint-keyboard {
    display: none;
  }

  .composer-local {
    font-size: 7.5px;
  }

  .view-scroll {
    padding: 18px 14px 32px;
  }

  .view-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .view-hero h2 {
    font-size: 21px;
  }

  .files-grid {
    grid-template-columns: 1fr;
  }

  .files-toolbar {
    gap: 8px;
  }

  .inline-search {
    max-width: none;
    flex-basis: 100%;
    order: 3;
  }

  .files-count {
    margin-left: 0;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .filter-tab {
    flex: 1;
    white-space: nowrap;
  }

  .notes-view {
    grid-template-rows: minmax(152px, 27vh) minmax(0, 1fr);
  }

  .note-stage {
    padding: 18px 15px 36px;
  }

  .note-reader h1 {
    font-size: 27px;
  }

  .note-body {
    font-size: 13px;
    line-height: 1.7;
  }

  .note-reader-top {
    flex-wrap: wrap;
  }

  .note-reader-actions {
    margin-left: 0;
  }

  .note-editor-meta {
    flex-wrap: wrap;
  }

  .note-content-input {
    min-height: 320px;
    font-size: 12.5px;
    padding: 14px;
  }

  .note-list-card {
    flex-basis: 185px;
  }

  .search-layer {
    padding: 0;
  }

  .search-dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .search-top {
    padding: 14px 13px;
  }

  .search-input {
    font-size: 16px;
  }

  .search-escape {
    display: none;
  }

  .search-filter-row {
    overflow-x: auto;
    padding: 7px 10px;
  }

  .search-scope {
    display: none;
  }

  .search-footer .token-hint {
    display: none;
  }

  .dialog-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .dialog {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }

  .dialog-head {
    padding: 16px 16px 12px;
  }

  .dialog-body {
    padding: 15px 16px;
  }

  .dialog-footer {
    padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  }

  .file-preview-stage {
    margin: 12px 14px 0;
    padding: 14px;
  }

  .file-preview-toolbar {
    padding: 11px 14px 14px;
    flex-wrap: wrap;
  }

  .huddle-overlay {
    padding: 0;
  }

  .huddle-room {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .huddle-head {
    height: 58px;
    padding: 0 12px;
  }

  .huddle-head .simulated-badge {
    display: none;
  }

  .huddle-timer {
    font-size: 9px;
  }

  .huddle-stage {
    padding: 10px;
  }

  .huddle-intro-line {
    padding-bottom: 8px;
  }

  .huddle-tiles {
    gap: 7px;
  }

  .huddle-tile.speaking .tile-avatar {
    width: 48px;
    height: 48px;
  }

  .screen-share-window {
    padding: 12px;
  }

  .huddle-control {
    min-width: 48px;
  }

  .huddle-control-button.share {
    min-width: 40px;
    width: 40px;
    border-radius: 50%;
    padding: 0;
  }

  .huddle-control-button.share span {
    display: none;
  }

  .huddle-leave {
    margin-left: 2px;
    padding: 0 12px;
  }

  .huddle-footer {
    padding: 9px 4px calc(9px + env(safe-area-inset-bottom));
  }

  .toast-stack {
    bottom: 16px;
  }

  /* thread on mobile */
  .thread-panel {
    width: 100%;
    z-index: 78;
  }

  .thread-header {
    height: 58px;
  }

  .reaction-popover {
    width: 225px;
  }
}

@media (max-width: 420px) {
  .header-topic {
    max-width: 145px;
  }

  .header-eyebrow .eyebrow-hide-mobile {
    display: none;
  }

  .header-eyebrow .eyebrow-sep.hide-mobile {
    display: none;
  }

  .files-toolbar .filter-tabs {
    font-size: 9px;
  }

  .huddle-tile-info {
    left: 7px;
    right: 7px;
    bottom: 7px;
  }

  .tile-name {
    padding: 3px 5px;
    font-size: 8px;
  }

  .huddle-tile .tile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 15px;
    font-size: 15px;
  }

  .screen-share-window h4 {
    font-size: 13px;
  }

  .screen-share-window p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Additional interaction states
   ========================================================= */

.dm-picker-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dm-picker-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  transition: background 130ms ease, border-color 130ms ease;
}

.dm-picker-row:hover {
  border-color: #eee4f5;
  background: #faf6fe;
}

.dm-picker-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dm-picker-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.dm-picker-copy span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.dm-picker-action {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--violet-700);
  background: var(--violet-100);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.file-preview-unavailable {
  align-self: center;
  margin: auto;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.file-preview-unavailable .icon {
  width: 28px;
  height: 28px;
  color: var(--violet-600);
}

.file-preview-unavailable h3 {
  margin: 10px 0 4px;
  color: var(--ink);
  font-size: 15px;
}

.file-preview-unavailable p {
  margin: 0;
  max-width: 280px;
  font-size: 10px;
  line-height: 1.5;
}

.file-preview-stage iframe {
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.composer.drag-over {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 4px rgba(124, 73, 232, 0.11), 0 12px 36px rgba(75, 34, 112, 0.1);
}

.composer.drag-over::after {
  content: "Drop a file to attach it locally";
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  border: 1px dashed #b99de0;
  border-radius: 11px;
  color: var(--violet-700);
  background: rgba(250, 246, 255, 0.95);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.composer {
  position: relative;
}

.screen-share-overlay {
  position: absolute;
  inset: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(500px 300px at 60% 0%, rgba(144, 103, 239, 0.3), transparent 65%),
    rgba(24, 12, 33, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  animation: fade-up 200ms ease both;
}

.screen-share-overlay .screen-share-window {
  width: min(560px, 94%);
  height: min(100%, 360px);
  min-height: 160px;
}

.screen-share-flag {
  position: absolute;
  top: 11px;
  right: 12px;
  padding: 3px 6px;
  border: 1px solid rgba(244, 182, 76, 0.35);
  border-radius: 4px;
  color: #f4c97e;
  background: rgba(244, 182, 76, 0.09);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.huddle-tile.camera-on {
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.15), transparent 52%),
    linear-gradient(145deg, #57316e, #2d1a3a);
}

.camera-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.camera-preview .avatar {
  width: clamp(58px, 8vw, 82px);
  height: clamp(58px, 8vw, 82px);
  border-radius: 26px;
  font-size: clamp(18px, 2.4vw, 26px);
}

.camera-preview > span {
  color: rgba(255, 255, 255, 0.34);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.note-stage.flash {
  animation: note-flash 2.6s ease both;
}

@keyframes note-flash {
  0% { background-color: rgba(238, 229, 251, 0.95); }
  100% { background-color: #fbf9fc; }
}

@media (max-width: 640px) {
  .screen-share-overlay {
    inset: 8px;
    padding: 8px;
  }

  .screen-share-overlay .screen-share-window {
    width: 100%;
    height: 84%;
    min-height: 120px;
  }

  .screen-share-window p {
    display: none;
  }
}

/* =========================================================
   Boot + authentication
   ========================================================= */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background:
    radial-gradient(600px 400px at 50% -10%, rgba(255, 138, 114, 0.2), transparent 65%),
    radial-gradient(700px 500px at 90% 110%, rgba(144, 103, 239, 0.26), transparent 65%),
    #21102c;
}

.boot-screen .brand-mark {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.3));
}

.boot-word {
  font-size: 33px;
  font-weight: 760;
  letter-spacing: -0.06em;
}

.boot-spinner {
  width: 22px;
  height: 22px;
  margin-top: 24px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffb49f;
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

.boot-caption {
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  letter-spacing: 0.06em;
}

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

.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 130;
  overflow-y: auto;
  background: #fbf8fd;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(440px, 1.08fr);
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 52px);
  color: #fff;
  background:
    radial-gradient(600px 480px at 12% 3%, rgba(255, 138, 114, 0.17), transparent 64%),
    radial-gradient(700px 600px at 100% 90%, rgba(144, 103, 239, 0.3), transparent 68%),
    linear-gradient(155deg, #3a1f4b 0%, #261231 54%, #1a0b24 100%);
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -180px;
  top: -190px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.025), 0 0 0 96px rgba(255, 255, 255, 0.014);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: #fff;
  text-decoration: none;
}

.auth-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  margin-top: clamp(60px, 11vh, 130px);
  max-width: 540px;
}

.auth-kicker {
  display: block;
  margin-bottom: 18px;
  color: rgba(197, 168, 255, 0.7);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.auth-brand-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-brand-copy h1 em {
  color: #ffb49f;
  font-weight: 500;
}

.auth-brand-copy p {
  max-width: 390px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  line-height: 1.7;
}

.auth-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-top: 36px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 600;
}

.auth-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-points .icon {
  width: 13px;
  height: 13px;
  color: rgba(197, 168, 255, 0.7);
}

.auth-art {
  position: relative;
  z-index: 1;
  min-height: 180px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 25px;
}

.auth-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(197, 168, 255, 0.1);
}

.orbit-one {
  width: 310px;
  height: 310px;
}

.orbit-two {
  width: 210px;
  height: 210px;
  border-color: rgba(255, 138, 114, 0.12);
}

.auth-art-note {
  position: relative;
  z-index: 1;
  width: min(310px, 86%);
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(10, 3, 15, 0.18);
  transform: rotate(-2deg);
}

.auth-art-note > span {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 8px;
  color: #ffb49f;
  background: rgba(255, 138, 114, 0.1);
}

.auth-art-note .icon {
  width: 14px;
  height: 14px;
}

.auth-art-note strong {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.auth-art-note p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9.5px;
  line-height: 1.55;
}

.auth-copyright {
  position: relative;
  z-index: 1;
  padding-top: 20px;
  color: rgba(255, 255, 255, 0.26);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(26px, 5vw, 64px);
  background:
    radial-gradient(700px 500px at 100% 0%, rgba(197, 168, 255, 0.12), transparent 65%),
    #fbf8fd;
}

.auth-card {
  width: min(430px, 100%);
  animation: fade-up 260ms ease both;
}

.auth-mobile-brand {
  display: none;
}

.auth-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 19px;
  padding: 4px 8px;
  border: 1px solid #e8def2;
  border-radius: 5px;
  color: #7b668b;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-status .icon {
  width: 11px;
  height: 11px;
  color: var(--violet-600);
}

.auth-card h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(31px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.auth-sub {
  margin: 9px 0 25px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-form .form-field {
  margin-bottom: 13px;
}

.auth-form .text-input {
  height: 44px;
  border-color: #dfd3e9;
  border-radius: 9px;
  font-size: 12.5px;
}

.auth-form .text-input:read-only {
  color: var(--muted);
  background: #f7f3fa;
}

.auth-form .text-input:focus {
  border-color: #b193dc;
  box-shadow: 0 0 0 4px rgba(124, 73, 232, 0.07);
}

.auth-error,
.auth-inline-error {
  margin: 6px 0 12px;
  padding: 9px 10px;
  border: 1px solid #f1cdd4;
  border-radius: 7px;
  color: #a72d42;
  background: #fff4f5;
  font-size: 10px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 5px;
  border-radius: 9px;
  font-size: 11.5px;
}

.auth-submit .icon {
  width: 14px;
  height: 14px;
}

.auth-demo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid #eee5f4;
}

.auth-demo-block > span {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-demo-block .button-secondary {
  margin-left: auto;
  height: 31px;
  font-size: 10px;
}

.auth-switch {
  margin-top: 19px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  line-height: 1.6;
}

.auth-switch button {
  padding: 0;
  color: var(--violet-700);
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 12px;
  margin-top: 27px;
  padding-top: 14px;
  border-top: 1px solid #eee6f4;
  color: #b0a6b8;
  font-size: 8.5px;
}

.auth-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.auth-foot .icon {
  width: 10px;
  height: 10px;
}

/* =========================================================
   Live data states
   ========================================================= */

.conversation-loading,
.thread-loading {
  max-width: 980px;
  margin: 28px auto;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed #e1d5ec;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 600;
}

.conversation-loading .icon,
.thread-loading .icon {
  width: 14px;
  height: 14px;
  color: var(--violet-600);
  animation: auth-spin 2.2s linear infinite;
}

.thread-loading {
  margin: 24px 10px;
  border: 0;
  background: transparent;
}

.load-earlier {
  max-width: 980px;
  margin: 4px auto 10px;
  display: flex;
  justify-content: center;
}

.load-earlier .button-quiet {
  height: 29px;
  padding: 0 10px;
  font-size: 9.5px;
}

.invite-result {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.invite-result .text-input {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.file-preview-unavailable {
  min-height: 200px;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-main {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 30px 20px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 36px;
    color: var(--ink);
    font-size: 23px;
    font-weight: 760;
    letter-spacing: -0.055em;
  }

  .auth-mobile-brand .brand-mark {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .auth-main {
    align-items: flex-start;
    padding: 23px 17px;
  }

  .auth-card {
    margin: auto 0;
  }

  .auth-mobile-brand {
    margin-bottom: 28px;
  }

  .auth-card h2 {
    font-size: 30px;
  }

  .auth-sub {
    font-size: 11px;
  }

  .auth-demo-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-demo-block .button-secondary {
    margin-left: 0;
  }

  .auth-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   Live huddle
   ========================================================= */

.huddle-audio-root {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border: 1px solid rgba(143, 223, 201, 0.3);
  border-radius: 4px;
  color: #a8f0de;
  background: rgba(143, 223, 201, 0.09);
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.huddle-tiles.single {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.huddle-tiles.duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.huddle-tile .huddle-video-slot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.huddle-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #160b1d;
}

.huddle-avatar-layer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tile-camera-off {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tile-camera-off .icon {
  width: 11px;
  height: 11px;
}

.huddle-tile-info {
  z-index: 2;
}

.huddle-tile .camera-preview {
  display: none;
}

.huddle-connecting-state {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
}

.huddle-connecting-state > .icon {
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  color: #c5a8ff;
}

.huddle-connecting-state h3 {
  margin: 0 0 5px;
  color: #fff;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.huddle-connecting-state p {
  max-width: 330px;
  margin: 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  line-height: 1.6;
}

.huddle-connecting-state .button-secondary {
  margin-top: 17px;
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.huddle-connecting-orbit {
  width: 70px;
  height: 70px;
  margin-bottom: 18px;
  border: 1px solid rgba(197, 168, 255, 0.22);
  border-top-color: #c5a8ff;
  border-radius: 50%;
  animation: auth-spin 1.2s linear infinite;
}

.huddle-error-state .icon {
  color: #ffb49f;
}

.huddle-waiting {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
}

.huddle-waiting .icon {
  width: 20px;
  height: 20px;
}

.huddle-person-empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
}

.screen-share-overlay.huddle-screen-live {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.screen-share-topline {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d8c7ff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.screen-share-topline .icon {
  width: 13px;
  height: 13px;
}

.huddle-screen-video-slot {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #0f0714;
}

.huddle-screen-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f0714;
  border-radius: 10px;
}

.huddle-side .huddle-person-status .icon {
  width: 12px;
  height: 12px;
}

@media (max-width: 640px) {
  .huddle-tiles.single,
  .huddle-tiles.duo {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .huddle-tiles.duo {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .huddle-tile .huddle-avatar-layer .tile-avatar {
    width: 52px;
    height: 52px;
  }
}

.huddle-tile.camera-on .huddle-avatar-layer {
  visibility: hidden;
  opacity: 0;
}

/* =========================================================
   Workspace administration
   ========================================================= */

.auth-inline-success {
  margin: 6px 0 12px;
  padding: 9px 10px;
  border: 1px solid #cce7d8;
  border-radius: 7px;
  color: #256548;
  background: #f1fbf5;
  font-size: 10px;
  line-height: 1.5;
}

.admin-root {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-loading,
.admin-error {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
}

.admin-error {
  color: #a72d42;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  border-bottom: 1px solid #f0e9f4;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.admin-tab .icon {
  width: 13px;
  height: 13px;
}

.admin-tab span {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f4eef8;
  color: var(--muted);
  font-size: 9px;
}

.admin-tab.active {
  border-bottom-color: var(--violet-600);
  color: var(--violet-700);
}

.admin-scroll {
  min-height: 0;
  max-height: 54vh;
  overflow-y: auto;
  padding: 14px 20px 18px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-section-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-section-head strong {
  color: var(--ink);
  font-size: 11px;
}

.admin-section-head span {
  color: var(--muted);
  font-size: 9px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 11px;
  border: 1px solid #eee7f2;
  border-radius: 10px;
  background: #fdfbfe;
}

.admin-row-muted {
  opacity: 0.68;
}

.admin-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}

.admin-person-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.admin-name-line strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-self,
.admin-badge {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1e8fb;
  color: var(--violet-700);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-self {
  background: #eef7f2;
  color: #2e7051;
}

.admin-badge.danger {
  background: #fff0f2;
  color: #a72d42;
}

.admin-badge.private {
  background: #f4eef8;
  color: #6e4d8c;
}

.admin-email {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meta {
  color: #998ba7;
  font-size: 8.5px;
}

.admin-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
  max-width: 290px;
}

.admin-action {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #e9e0ef;
  border-radius: 6px;
  color: #5d4b6b;
  background: #fff;
  font-size: 8.5px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-action .icon {
  width: 11px;
  height: 11px;
}

.admin-action:hover {
  border-color: #cbb7e2;
  color: var(--violet-700);
  background: #faf7ff;
}

.admin-action.primary {
  border-color: #d7c6ef;
  color: var(--violet-700);
  background: #f7f1ff;
}

.admin-action.danger {
  border-color: #f0d4d9;
  color: #a72d42;
}

.admin-action:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.admin-channel-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--violet-700);
  background: #f2eafb;
  font-size: 15px;
  font-weight: 750;
}

.admin-channel-mark .icon {
  width: 14px;
  height: 14px;
}

.admin-new-channel {
  height: 28px;
  padding: 0 9px;
  font-size: 9px;
}

.admin-footnote {
  margin: 12px 2px 0;
  color: #998ba7;
  font-size: 8.5px;
  line-height: 1.55;
}

.admin-member-panel {
  margin-bottom: 16px;
}

.admin-member-panel h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
}

.admin-member-panel h3 span {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f4eef8;
  color: var(--muted);
  font-size: 8.5px;
}

.admin-member-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f5eff8;
}

.admin-member-line > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-member-line strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-member-line span {
  color: var(--muted);
  font-size: 8.5px;
}

.admin-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 9.5px;
}

@media (max-width: 640px) {
  .admin-scroll {
    max-height: 58vh;
    padding: 12px 14px 16px;
  }

  .admin-tabs {
    padding: 8px 14px 0;
  }

  .admin-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-controls {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .admin-person {
    width: 100%;
  }
}

.dm-readonly {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 14px 14px;
  padding: 11px 13px;
  border: 1px solid #ece3f1;
  border-radius: 10px;
  color: var(--muted);
  background: #fbf8fd;
}

.dm-readonly .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--violet-600);
}

.dm-readonly > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-readonly strong {
  color: var(--ink);
  font-size: 10.5px;
}

.dm-readonly span {
  font-size: 9.5px;
  line-height: 1.45;
}

.huddle-alone-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px auto 0;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
}

.huddle-alone-note .icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.huddle-alone-note strong {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 650;
}
