:root {
  --ink: #202124;
  --muted: #74777c;
  --line: #e7e5e1;
  --paper: #fbfaf8;
  --sidebar: #23232a;
  --sidebar-soft: #303039;
  --coral: #ed746a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.auth-loading .app-shell, .auth-required .app-shell { visibility: hidden; }
.auth-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 20% 10%, #4d454d, #27252b 56%); }
body:not(.auth-loading):not(.auth-required) .auth-gate { display: none; }
.auth-card { width: min(390px,100%); padding: 34px; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.auth-logo { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 14px; background: var(--coral); color: white; font-size: 18px; font-weight: 850; }
.auth-card h1 { margin: 3px 0 8px; color: #302d30; font-size: 26px; letter-spacing: -.04em; }
.auth-card > p { color: #716b68; font-size: 12px; line-height: 1.55; }
.auth-card form { display: grid; gap: 7px; margin-top: 22px; }
.auth-card label { margin-top: 6px; color: #514c49; font-size: 11px; font-weight: 750; }
.auth-card input { height: 42px; padding: 0 11px; border: 1px solid #d8d3cf; border-radius: 9px; outline: 0; }
.auth-card input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(237,116,106,.13); }
.auth-card form button, .google-login { width: 100%; min-height: 42px; margin-top: 9px; border: 0; border-radius: 9px; background: var(--coral); color: white; font-weight: 760; }
.google-login { border: 1px solid #d8d3cf; background: white; color: #494442; }
.auth-card .auth-message { min-height: 18px; margin: 13px 0 0; color: #a64e48; font-size: 10px; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, textarea { font: inherit; }
button { cursor: pointer; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 70px 268px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.workspace-rail {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 13px;
  background: #19191f;
  padding-top: 18px;
  color: white;
  min-height: 0;
  overflow: hidden;
}

.workspace-logo, .rail-avatar {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 13px;
  background: var(--coral);
  color: white;
  font-weight: 800;
  letter-spacing: -.06em;
}

.rail-avatar { background: #303039; color: #bdbdc5; font-size: 22px; font-weight: 400; }
.rail-divider { width: 30px; height: 1px; background: #383840; }
.presence-dot { position: absolute; bottom: 21px; width: 9px; height: 9px; border-radius: 50%; background: #6ccf8e; }

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  color: #e8e8eb;
  border-left: 1px solid #2d2d34;
  height: 100%;
  min-height: 0;
}

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 18px 18px 20px;
  border-bottom: 1px solid #35353d;
}

.eyebrow { display: block; margin-bottom: 3px; color: #9999a3; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.workspace-heading h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.workspace-menu-wrap { position: relative; min-width: 0; }
.workspace-menu-button { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: #f3f3f5; font-size: 18px; font-weight: 760; letter-spacing: -.02em; }
.workspace-menu-button span { color: #aaaab3; font-size: 12px; transition: transform .15s ease; }
.workspace-menu-button[aria-expanded="true"] span { transform: rotate(180deg); }
.workspace-menu { position: absolute; z-index: 50; top: 47px; left: -8px; width: 250px; padding: 8px; border: 1px solid #dedad7; border-radius: 12px; background: white; color: #393638; box-shadow: 0 16px 46px rgba(15,13,16,.3); }
.workspace-menu[hidden] { display: none; }
.workspace-menu-title { display: grid; gap: 2px; padding: 10px 11px 11px; border-bottom: 1px solid #ebe7e4; }
.workspace-menu-title strong { font-size: 13px; }
.workspace-menu-title span { color: #8b8581; font-size: 10px; }
.workspace-menu > button { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 6px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: #423e3b; text-align: left; font-size: 12px; font-weight: 680; }
.workspace-menu > button:hover { background: #f4f1ef; }
.pending-invites { display: grid; gap: 5px; margin-top: 5px; padding-top: 7px; border-top: 1px solid #ebe7e4; }
.pending-invites:empty { display: none; }
.pending-invite { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 6px 9px; border-radius: 7px; background: #faf8f6; }
.pending-invite span { overflow: hidden; color: #595451; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pending-invite small { color: #b15a53; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: white; color: #24242a; font-size: 18px; }

.main-nav { display: grid; gap: 4px; padding: 16px 12px 12px; }
.main-nav .nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #d3d3d9; text-align: left; font-size: 14px; }
.main-nav .nav-item:hover { background: var(--sidebar-soft); }
.main-nav .nav-item span { width: 18px; text-align: center; color: #aaaab3; }
.main-nav .nav-item b, .channel b { margin-left: auto; min-width: 19px; padding: 2px 6px; border-radius: 999px; background: var(--coral); color: white; font-size: 10px; text-align: center; }

.channel-section { padding: 12px; }
.section-label { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; color: #93939e; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.section-label button { border: 0; background: transparent; color: #aaaab3; font-size: 18px; }
.channel { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #c8c8cf; text-align: left; font-size: 14px; }
.channel:hover { background: var(--sidebar-soft); }
.channel.active { background: #f3ecea; color: #2d292a; font-weight: 650; }
.channel > span { color: #8d8d97; font-size: 17px; }
.channel em { position: absolute; left: 30px; bottom: 7px; width: 7px; height: 7px; border: 2px solid var(--sidebar); border-radius: 50%; background: #6ccf8e; }
.mini-avatar { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: #202124; font-size: 10px; font-style: normal; font-weight: 750; }
.maja { background: #f3a56f; } .oskar { background: #7ea6df; } .sara { background: #91c9a8; }

.profile-card { display: flex; align-items: center; gap: 10px; margin: auto 12px 12px; padding: 10px; border: 1px solid #3b3b44; border-radius: 12px; background: #292930; }
.profile-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--coral); font-size: 11px; font-weight: 800; }
.profile-card label { display: grid; flex: 1; gap: 2px; min-width: 0; }
.profile-card label > span { color: #92929c; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.profile-card select { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #f0f0f2; font-size: 12px; font-weight: 700; }
.profile-card select option { color: #202124; }
.profile-online { width: 8px; height: 8px; border-radius: 50%; background: #6ccf8e; }

.chat-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.chat-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 15px 27px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); }
.channel-title { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 750; }
.channel-title > span { color: #8d8d91; font-weight: 500; }
.channel-title button { border: 0; background: transparent; color: #999; }
.chat-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.conversation-tabs { display: flex; gap: 14px; margin-top: 10px; }
.conversation-tabs button { padding: 0 0 5px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #8a8683; font-size: 10px; }
.conversation-tabs button.active { border-color: var(--coral); color: #343133; font-weight: 750; }
.header-actions { display: flex; gap: 10px; }
.member-stack, .search-button { display: flex; align-items: center; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.member-stack { padding: 0 9px; }
.member-stack span { display: grid; place-items: center; width: 22px; height: 22px; margin-left: -6px; border: 2px solid white; border-radius: 7px; background: #eee3df; font-size: 7px; font-weight: 800; }
.member-stack span:first-child { margin-left: 0; background: #f3a56f; }
.member-stack span:nth-child(2) { background: #7ea6df; }
.member-stack span:nth-child(3) { background: #91c9a8; }
.member-stack b { margin-left: 6px; color: #666; font-size: 11px; }
.search-button { gap: 7px; padding: 0 12px; color: #7b7b80; font-size: 12px; }

.message-list { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 28px 0 18px; scroll-behavior: smooth; }
.channel-intro { max-width: 720px; padding: 12px 34px 30px; }
.intro-icon { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 15px; background: #f4efed; color: #716b69; font-size: 25px; }
.channel-intro h2 { margin: 15px 0 6px; font-size: 23px; letter-spacing: -.035em; }
.channel-intro p { max-width: 600px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.channel-intro button { margin-top: 10px; padding: 0; border: 0; background: transparent; color: #cf5e57; font-size: 12px; font-weight: 650; }
.date-separator { display: flex; align-items: center; margin: 0 27px 13px; color: #777; font-size: 10px; font-weight: 700; }
.date-separator::before, .date-separator::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.date-separator span { padding: 0 12px; }

.message { position: relative; display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; gap: 12px; padding: 10px 34px; }
.message:hover { background: #faf9f7; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #262626; font-size: 10px; font-weight: 800; }
.message-meta { display: flex; align-items: baseline; gap: 8px; }
.message-meta strong { font-size: 13px; }
.message-meta time { color: #9a9a9d; font-size: 10px; }
.message-flags { display: inline-flex; gap: 7px; margin-left: 2px; color: #99938f; font-size: 9px; font-weight: 650; }
.pinned-label { color: #b95751; }
.message-text { max-width: 760px; margin: 4px 0 0; font-size: 14px; line-height: 1.52; }
.message-text a { color: #b9534c; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.message-text a:hover { color: #8f3934; }
.message-text code { padding: 1px 4px; border: 1px solid #e2ddda; border-radius: 4px; background: #f6f3f1; color: #b34d46; font-size: .9em; }
.message-text blockquote { margin: 3px 0; padding-left: 10px; border-left: 3px solid #c9c4c0; color: #5f5a57; }
.message-text .bullet-line::before { content: '•'; margin-right: 8px; color: #77716d; }
.mention { display: inline-block; padding: 0 3px; border-radius: 4px; background: #e8f1fb; color: #28669d; font-weight: 700; }
.mention.own-mention { background: #ffe0dc; color: #9f3f38; }
.unread-divider { display: flex; align-items: center; gap: 9px; margin: 7px 0; color: #d34f46; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.unread-divider::before, .unread-divider::after { content: ''; height: 1px; background: #e56b63; }
.unread-divider::before { width: 28px; }
.unread-divider::after { flex: 1; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.attachment-card { display: flex; align-items: center; gap: 10px; min-width: 230px; max-width: 360px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: white; color: #46413f; text-decoration: none; }
.attachment-card:hover { border-color: #d4aaa6; box-shadow: 0 5px 18px rgba(30,27,25,.07); }
.attachment-card > span { display: grid; gap: 3px; min-width: 0; }
.attachment-card strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-card small { color: #98918d; font-size: 9px; }
.attachment-card.image-card { display: grid; width: min(360px, 100%); padding: 0; overflow: hidden; }
.attachment-card.image-card img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.attachment-card.image-card > span { padding: 0 10px 10px; }
.link-preview { display: grid; gap: 3px; max-width: 480px; margin-top: 9px; padding: 10px 12px; border-left: 3px solid var(--coral); border-radius: 0 9px 9px 0; background: #f8f5f3; color: #4b4643; text-decoration: none; }
.link-preview small { color: #918b87; font-size: 9px; }
.link-preview strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.link-preview span { color: #88817d; font-size: 10px; }
.reaction { margin-top: 8px; padding: 4px 8px; border: 1px solid #ddd8d5; border-radius: 8px; background: #f8f5f3; font-size: 13px; }
.reaction.mine { border-color: #e78a83; background: #fff0ee; }
.reaction span { margin-left: 3px; color: #777; font-size: 10px; }
.message-actions { align-self: start; visibility: hidden; display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 5px 18px rgba(30, 27, 25, .08); }
.message-actions button { width: 31px; height: 29px; border: 0; border-left: 1px solid var(--line); background: white; color: #777; }
.message-actions button:first-child { border-left: 0; }
.message-actions button:hover { background: #f5f2f0; color: #343235; }
.message:hover .message-actions, .message:focus-within .message-actions { visibility: visible; }
.demo-message { margin: 0 24px 12px; padding: 15px 12px; border: 1px solid #e6e1de; border-radius: 13px; background: #fff; box-shadow: 0 4px 16px rgba(30,27,25,.035); }
.demo-message:hover { border-color: #dab6b2; background: #fffdfc; }
.demo-message .message-actions { visibility: visible; }
.demo-explainer { display: grid; gap: 4px; margin-bottom: 10px; padding: 9px 11px; border-radius: 9px; background: #f5f1ef; }
.demo-explainer > strong { color: #a84943; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; }
.demo-explainer > span { color: #69635f; font-size: 10px; line-height: 1.45; }
.demo-state-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.demo-state-list small { padding: 3px 6px; border: 1px solid #dfd7d3; border-radius: 999px; background: white; color: #716a66; font-size: 8px; font-weight: 700; }
.message-menu { position: absolute; z-index: 14; right: 34px; top: 42px; display: grid; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 14px 38px rgba(30, 27, 25, .17); }
.message-menu button { padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #403c3a; font-size: 12px; text-align: left; }
.message-menu button:hover { background: #f3f0ee; }
.message-menu button.danger { color: #bd423a; }
.inline-editor { display: grid; gap: 8px; margin-top: 7px; }
.inline-editor textarea { width: 100%; resize: vertical; padding: 9px 10px; border: 1px solid #aaa39e; border-radius: 9px; outline: 0; font: inherit; line-height: 1.45; }
.inline-editor > div { display: flex; justify-content: flex-end; gap: 7px; }
.inline-editor button { padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #57514e; font-size: 11px; font-weight: 700; }
.inline-editor button[type="submit"] { border-color: var(--coral); background: var(--coral); color: white; }
.linked-highlight { animation: linked-message 2.2s ease-out; }
@keyframes linked-message { 0%, 35% { background: #fff2ce; } 100% { background: transparent; } }
.thread-summary { display: block; margin-top: 8px; padding: 0; border: 0; background: transparent; color: #c45f58; font-size: 11px; font-weight: 700; }
.emoji-picker { position: absolute; z-index: 12; right: 34px; top: 42px; display: flex; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 12px 32px rgba(30, 27, 25, .15); }
.emoji-picker button { width: 31px; height: 31px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 17px; }
.emoji-picker button:hover { background: #f3f0ee; transform: translateY(-1px); }

.composer { position: relative; margin: 0 27px 23px; border: 1px solid #d7d4d0; border-radius: 14px; background: #fff; box-shadow: 0 8px 28px rgba(36,30,28,.06); }
.typing-indicator { position: absolute; left: 7px; top: -24px; color: #77726f; font-size: 10px; font-weight: 650; }
.composer:focus-within { border-color: #a8a39e; box-shadow: 0 0 0 3px rgba(237,116,106,.1); }
.composer.dragging { border-color: var(--coral); background: #fff8f7; box-shadow: 0 0 0 4px rgba(237,116,106,.13); }
.composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.composer textarea { display: block; width: 100%; min-height: 58px; resize: none; padding: 15px 16px 7px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; line-height: 1.4; }
.composer textarea::placeholder { color: #aaa7a4; }
.mention-menu { position: absolute; z-index: 16; left: 8px; bottom: calc(100% - 5px); display: grid; width: min(310px, calc(100% - 16px)); padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 14px 38px rgba(30,27,25,.17); }
.mention-menu[hidden] { display: none; }
.mention-menu button { display: grid; gap: 2px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #3f3a38; text-align: left; }
.mention-menu button:hover, .mention-menu button.selected { background: #f3efed; }
.mention-menu strong { font-size: 11px; }
.mention-menu small { color: #918b87; font-size: 9px; }
.format-toolbar { display: flex; gap: 3px; padding: 6px 10px; border-top: 1px solid #efedea; border-bottom: 1px solid #efedea; background: #fbfaf9; }
.format-toolbar[hidden] { display: none; }
.format-toolbar button { min-width: 29px; height: 27px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: #6e6966; font-size: 11px; }
.format-toolbar button:hover { background: #eeeae7; }
.attachment-tray { display: flex; flex-wrap: wrap; gap: 7px; padding: 7px 10px; border-top: 1px solid #efedea; }
.attachment-tray[hidden] { display: none; }
.pending-attachment { display: grid; grid-template-columns: 34px minmax(0, 1fr) 22px; align-items: center; gap: 7px; width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f6; }
.pending-attachment > img, .pending-attachment > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: #eee9e6; }
.pending-attachment > span { display: grid; min-width: 0; }
.pending-attachment strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pending-attachment small { color: #99928e; font-size: 8px; }
.pending-attachment button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: #8a8480; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 7px 7px; }
.composer-toolbar button { width: 29px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: #817d7a; }
.composer-toolbar button:hover { background: #f3f0ee; }
.composer-toolbar .send-button { background: var(--coral); color: white; font-size: 18px; font-weight: 700; }
.composer-toolbar .send-button:disabled { background: #ece9e6; color: #b9b5b2; cursor: default; }
.send-actions { display: flex; gap: 2px; }
.send-actions > button:last-child { width: 24px; }

.thread-panel[hidden] { display: none; }
.thread-panel {
  position: absolute;
  z-index: 20;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(390px, 100%);
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -18px 0 45px rgba(37, 32, 30, .09);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.thread-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.thread-header div { display: flex; align-items: baseline; gap: 9px; }
.thread-header strong { font-size: 16px; }
.thread-header span { color: var(--muted); font-size: 11px; }
.thread-header button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f4f1ef; color: #696568; font-size: 22px; line-height: 1; }
.thread-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 0 18px; }
.thread-message { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 19px; }
.thread-message:hover { background: transparent; }
.thread-message .avatar { width: 35px; height: 35px; border-radius: 11px; }
.thread-message .message-text { font-size: 13px; }
.thread-divider { display: flex; align-items: center; gap: 10px; padding: 11px 19px 4px; color: #8c8885; font-size: 10px; font-weight: 700; }
.thread-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.thread-composer { position: relative; margin: 0 15px 16px; border: 1px solid #d7d4d0; border-radius: 12px; background: white; }
.thread-composer:focus-within { border-color: #a8a39e; box-shadow: 0 0 0 3px rgba(237,116,106,.1); }
.thread-composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.thread-composer textarea { display: block; width: 100%; min-height: 67px; resize: none; padding: 13px 46px 10px 13px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.thread-composer button { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--coral); color: white; font-size: 18px; }
.thread-composer button:disabled { background: #ece9e6; color: #b9b5b2; cursor: default; }

.channel-dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(24, 22, 25, .28);
}
.channel-dialog::backdrop { background: rgba(20, 19, 23, .58); backdrop-filter: blur(3px); }
.channel-dialog form { padding: 25px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.dialog-heading > button { width: 33px; height: 33px; border: 0; border-radius: 9px; background: #f3f0ee; color: #716d6b; font-size: 22px; }
.channel-dialog form > p { margin: 10px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.channel-dialog label { display: block; margin: 16px 0 7px; font-size: 12px; font-weight: 750; }
.channel-dialog label small { color: #97928f; font-weight: 500; }
.channel-name-field { display: flex; align-items: center; height: 43px; border: 1px solid #d9d5d2; border-radius: 10px; overflow: hidden; }
.channel-name-field:focus-within, .channel-dialog textarea:focus { border-color: #9c9691; box-shadow: 0 0 0 3px rgba(237,116,106,.1); }
.channel-name-field span { padding-left: 12px; color: #8d8885; }
.channel-name-field input { width: 100%; height: 100%; padding: 0 12px 0 6px; border: 0; outline: 0; background: transparent; }
.channel-dialog textarea { width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid #d9d5d2; border-radius: 10px; outline: 0; }
.schedule-dialog input[type="datetime-local"] { width: 100%; height: 43px; padding: 0 11px; border: 1px solid #d9d5d2; border-radius: 10px; outline: 0; }
.schedule-dialog form > p { max-height: 90px; overflow: auto; padding: 11px; border-radius: 9px; background: #f7f4f2; color: #5f5a57; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.dialog-actions button { min-height: 38px; padding: 0 16px; border: 1px solid #d9d5d2; border-radius: 9px; background: #fff; color: #4f4b49; font-size: 12px; font-weight: 750; }
.dialog-actions button.primary { border-color: var(--coral); background: var(--coral); color: white; }
.dialog-input, .channel-dialog select { width: 100%; height: 41px; padding: 0 10px; border: 1px solid #d9d5d2; border-radius: 9px; outline: 0; background: white; }
.task-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 12px; }
.quick-times button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #faf8f6; color: #5d5753; font-size: 9px; }
.reminder-item { grid-template-columns: 36px minmax(0, 1fr) auto; }
.reminder-item.completed { opacity: .62; }
.reminder-actions { display: flex; gap: 5px; }
.reminder-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #645e5a; font-size: 9px; }

.activity-panel[hidden] { display: none; }
.activity-panel { position: absolute; z-index: 18; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; overflow: hidden; background: #fbfaf8; }
.canvas-panel { z-index: 22; background: #f4f1ee; }
.canvas-header > div:last-child { display: flex; align-items: center; gap: 10px; }
.canvas-save-status { color: #8b8581; font-size: 9px; font-weight: 650; }
.canvas-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 24px 60px; }
.canvas-document { width: min(780px, 100%); min-height: calc(100vh - 150px); margin: 0 auto; padding: 0 46px 50px; border: 1px solid #e1dcd8; border-radius: 16px; background: white; box-shadow: 0 16px 48px rgba(32,28,26,.08); }
.canvas-cover { display: grid; gap: 9px; margin: 0 -46px 24px; padding: 32px 46px 25px; border-radius: 16px 16px 0 0; background: linear-gradient(135deg, #2d2c33, #48434a); }
.canvas-cover > span { color: #f19a92; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.canvas-cover input { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: white; font-size: clamp(24px, 4vw, 38px); font-weight: 780; letter-spacing: -.045em; }
.canvas-mode-tabs { display: flex; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.canvas-mode-tabs button { padding: 0 0 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #8b8581; font-size: 9px; }
.canvas-mode-tabs button.active { border-color: var(--coral); color: #3f3a37; font-weight: 750; }
.canvas-markdown-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0; }
.canvas-markdown-toolbar button { min-width: 29px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: #faf8f6; color: #5d5753; font-size: 9px; }
.canvas-markdown-layout { display: grid; grid-template-columns: 1fr; min-height: 470px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.canvas-markdown-layout[data-mode="visual"] #canvas-markdown { display: none; }
.canvas-markdown-layout[data-mode="markdown"] .canvas-preview { display: none; }
#canvas-markdown { width: 100%; min-height: 470px; resize: vertical; padding: 18px; border: 0; outline: 0; background: #fbfaf9; color: #383431; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.canvas-preview { min-width: 0; min-height: 470px; padding: 20px 24px 40px; overflow-wrap: anywhere; outline: 0; }
.canvas-preview:focus { box-shadow: inset 0 0 0 2px rgba(205, 92, 83, .16); }
.canvas-preview:empty::before { content: 'Börja skriva i din Canvas…'; color: #aaa29d; }
.markdown-body h1 { margin: 0 0 18px; font-size: 28px; letter-spacing: -.04em; }
.markdown-body h2 { margin: 25px 0 10px; font-size: 19px; }
.markdown-body h3 { margin: 20px 0 8px; font-size: 15px; }
.markdown-body p { margin: 5px 0; color: #514c48; font-size: 12px; line-height: 1.6; }
.markdown-body blockquote { margin: 12px 0; padding: 10px 13px; border-left: 3px solid var(--coral); background: #faf3f1; color: #5f5854; font-size: 12px; }
.markdown-body code { padding: 2px 4px; border-radius: 4px; background: #f1edeb; color: #a3453f; }
.markdown-body a { color: #ac4c45; font-weight: 650; }
.markdown-list-item, .markdown-number-item, .markdown-task { display: flex; align-items: flex-start; gap: 8px; margin: 5px 0; color: #514c48; font-size: 12px; }
.markdown-list-item::before { content: '•'; color: var(--coral); }
.markdown-number-item::before { content: attr(data-number) '.'; color: #8d8580; font-weight: 700; }
.markdown-task input { margin-top: 2px; accent-color: var(--coral); }
.markdown-task:has(input:checked) span { color: #98918d; text-decoration: line-through; }
.markdown-table-row { display: grid; grid-auto-columns: minmax(90px, 1fr); grid-auto-flow: column; border: 1px solid var(--line); border-bottom: 0; color: #514c48; font-size: 10px; }
.markdown-table-row span { padding: 7px 8px; border-right: 1px solid var(--line); }
.markdown-table-row span:last-child { border-right: 0; }
.markdown-table-row.separator { display: none; }
.markdown-table-row:has(+ .markdown-table-row.separator) { background: #f5f2f0; font-weight: 750; }
.canvas-markdown-help { margin: 9px 0 0; color: #918a86; font-size: 9px; }
.canvas-markdown-layout[data-mode="visual"] ~ .canvas-markdown-help .markdown-help,
.canvas-markdown-layout[data-mode="markdown"] ~ .canvas-markdown-help .visual-help { display: none; }
.activity-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 15px 27px; border-bottom: 1px solid var(--line); background: white; }
.activity-header h2 { margin: 1px 0 0; font-size: 21px; letter-spacing: -.03em; }
.activity-header button { width: 33px; height: 33px; border: 0; border-radius: 9px; background: #f3f0ee; color: #716d6b; font-size: 22px; }
.activity-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 27px; }
.activity-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; width: min(680px, 100%); margin-bottom: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; }
.activity-item.unread { border-color: #efb0aa; box-shadow: inset 3px 0 var(--coral); }
.activity-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f4e8e5; color: #b95751; font-weight: 800; }
.activity-copy { display: grid; gap: 4px; min-width: 0; }
.activity-copy strong { font-size: 12px; }
.activity-copy > span { overflow: hidden; color: #575457; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy small { color: #99938f; font-size: 10px; }
.activity-empty { display: grid; justify-items: center; padding: 80px 20px; color: #817c79; text-align: center; }
.activity-empty > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #e5f3e9; color: #43945d; font-size: 22px; }
.activity-empty h3 { margin: 15px 0 4px; color: #353234; }
.activity-empty p { margin: 0; font-size: 12px; }
.tasks-content { min-height: 0; overflow-y: auto; padding: 22px 27px 40px; }
.tasks-summary { margin-bottom: 13px; color: #817b77; font-size: 10px; font-weight: 700; }
.tasks-board { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.task-column { min-height: 150px; padding: 10px; border-radius: 12px; background: #efebe8; }
.task-column h3 { margin: 2px 2px 9px; color: #6d6662; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.task-card { display: grid; gap: 7px; margin-bottom: 8px; padding: 11px; border: 1px solid var(--line); border-left: 3px solid #a6a09c; border-radius: 9px; background: white; }
.task-card.priority-high { border-left-color: #db5a52; }
.task-card.priority-low { border-left-color: #6ca3cb; }
.task-card > span { color: #938c87; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.task-card > strong { font-size: 11px; line-height: 1.4; }
.task-card > small { color: #8e8783; font-size: 9px; }
.task-card > div { display: flex; justify-content: space-between; gap: 5px; }
.task-card button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: #faf8f6; color: #625c58; font-size: 8px; font-weight: 700; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 15px; border-radius: 10px; background: #282528; color: white; box-shadow: 0 12px 34px rgba(20, 18, 20, .22); font-size: 12px; font-weight: 650; }
.toast[hidden] { display: none; }
.collection-content { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.collection-tabs { display: flex; gap: 17px; padding: 14px 27px 0; border-bottom: 1px solid var(--line); background: white; }
.collection-tabs button { padding: 0 0 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #827d79; font-size: 11px; }
.collection-tabs button.active { border-color: var(--coral); color: #3c3836; font-weight: 750; }
.files-list .activity-item { cursor: pointer; }
.test-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 27px 40px; }
.test-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; max-width: 900px; padding: 20px; border-radius: 15px; background: #292930; color: white; }
.test-hero strong { font-size: 18px; }
.test-hero p { max-width: 490px; margin: 7px 0 0; color: #c7c5cb; font-size: 12px; line-height: 1.5; }
.test-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.test-actions button { min-height: 34px; padding: 0 11px; border: 1px solid #4a4850; border-radius: 8px; background: #38373e; color: white; font-size: 10px; font-weight: 700; }
.test-actions button.primary { border-color: var(--coral); background: var(--coral); }
.test-summary { display: grid; gap: 3px; max-width: 900px; margin: 14px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.test-summary strong { font-size: 12px; }
.test-summary span { color: #8b8581; font-size: 10px; }
.test-summary.success { border-color: #9ed4ad; background: #f1faf4; }
.test-summary.warning { border-color: #e6c27e; background: #fff9eb; }
.test-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 7px; max-width: 900px; }
.test-result { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 45px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.test-result > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.test-result strong { font-size: 10px; }
.test-result small { color: #8d8783; font-size: 8px; }
.test-result.passed > span { background: #e4f4e9; color: #33854c; }
.test-result.failed > span { background: #ffe3df; color: #b8473f; }
.manual-tests { max-width: 900px; margin-top: 24px; }
.test-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 11px; }
.test-section-heading h3 { margin: 0; font-size: 15px; }
.test-section-heading p { margin: 4px 0 0; color: #817b77; font-size: 10px; }
.test-section-heading > span { padding: 5px 9px; border-radius: 999px; background: #eeeae7; color: #625d59; font-size: 9px; font-weight: 750; }
#manual-test-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 9px; }
.manual-test { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; transition: border-color .15s, opacity .15s; }
.manual-test.completed { border-color: #a9d7b5; background: #f7fcf8; }
.manual-test-top { display: grid; grid-template-columns: 35px minmax(0, 1fr) 18px; align-items: center; gap: 9px; }
.manual-test-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #f1e9e6; color: #ad514b; font-size: 11px; font-weight: 800; }
.manual-test-top > div { display: grid; gap: 2px; }
.manual-test-top small { color: #9a938f; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.manual-test-top strong { font-size: 11px; }
.manual-test input { accent-color: var(--coral); }
.manual-test p { margin: 0; color: #6f6965; font-size: 9px; line-height: 1.45; }
.manual-test p b { color: #403c39; }
.manual-test p.expected { padding: 7px 8px; border-radius: 7px; background: #f6f3f1; }
.manual-test > button { justify-self: start; padding: 6px 9px; border: 0; border-radius: 7px; background: #292930; color: white; font-size: 9px; font-weight: 700; }
.manual-test > button:hover { background: var(--coral); }
.search-content { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.search-form { display: grid; gap: 12px; padding: 22px 27px 15px; background: white; }
.search-form > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-field { display: flex; align-items: center; gap: 9px; max-width: 720px; padding: 0 13px; border: 1px solid #aaa39e; border-radius: 11px; box-shadow: 0 0 0 3px rgba(237,116,106,.08); }
.search-field span { color: #88817d; }
.search-field input { width: 100%; height: 43px; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.search-filters label { display: flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: #8a8582; font-size: 10px; font-weight: 700; }
.search-filters select { border: 0; outline: 0; background: white; color: #474341; font-size: 11px; }
.search-summary { padding: 0 27px 10px; color: #8b8581; font-size: 11px; font-weight: 650; background: white; }
.search-results { padding-top: 13px; }
.search-result .activity-copy > span { white-space: normal; line-height: 1.4; }

@media (min-width: 1100px) {
  .thread-open .chat-header,
  .thread-open .message-list,
  .thread-open > .composer { margin-right: 390px; }
}

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 58px minmax(0, 1fr); }
  .sidebar { display: none; }
  .workspace-logo, .rail-avatar { width: 38px; height: 38px; }
  .chat-header { padding-inline: 18px; }
  .message { padding-inline: 20px; }
  .composer { margin-inline: 16px; }
  .thread-message { padding-inline: 19px; }
  .test-hero { display: grid; }
  .test-actions { justify-content: flex-start; }
  .demo-message { margin-inline: 10px; }
  .tasks-board { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-shell { grid-template-columns: 1fr; }
  .workspace-rail { display: none; }
  .header-actions .member-stack { display: none; }
  .search-button span { display: none; }
  .channel-intro { padding-inline: 20px; }
  .chat-header p { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .canvas-scroll { padding: 12px 8px 30px; }
  .canvas-document { padding-inline: 20px; }
  .canvas-cover { margin-inline: -20px; padding-inline: 20px; }
}
