:root {
  --ink: #1d2733;
  --muted: #687385;
  --soft: #f4f6f8;
  --paper: #ffffff;
  --paper-2: #f9fafb;
  --line: #d9dee7;
  --rail: #26343d;
  --rail-2: #31454a;
  --accent: #0c66e4;
  --accent-soft: #e9f2ff;
  --green: #1f845a;
  --green-soft: #e3fcef;
  --amber: #9a6700;
  --amber-soft: #fff3d6;
  --red: #ae2e24;
  --red-soft: #ffebe6;
  --violet: #6554c0;
  --violet-soft: #f1efff;
  --shadow: 0 18px 42px rgba(29, 39, 51, 0.12);
  --radius: 8px;
}

/* AI assist uses a stable compact status row so updates do not shift the panel. */
.ai-assist-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, #f7f8fa);
}

.ai-assist-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-assist-status strong,
.ai-assist-status span {
  overflow-wrap: anywhere;
}

.ai-assist-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-assist-status .icon-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.ai-assist-status.is-loading .icon-button svg {
  animation: ai-assist-spin 1s linear infinite;
}

.ai-assist-error {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--danger, #c9362b);
  background: #fff4f2;
  color: #84251f;
  font-size: 13px;
  line-height: 1.5;
}

.ai-priority-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ai-priority-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: #fff;
}

.ai-priority-list a:hover,
.ai-priority-list a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ai-priority-list a[aria-disabled="true"] {
  pointer-events: none;
}

.ai-priority-list a > span {
  grid-row: 1 / span 2;
  align-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff0e9;
  color: #a43c16;
  font-size: 11px;
  font-weight: 700;
}

.ai-priority-list strong,
.ai-priority-list small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-priority-list small {
  color: var(--muted);
  line-height: 1.4;
}

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

@media (prefers-reduced-motion: reduce) {
  .ai-assist-status.is-loading .icon-button svg {
    animation: none;
  }
}

@media (max-width: 760px) {
  .ai-assist-status {
    align-items: flex-start;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #dfe5ec;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(12, 102, 228, 0.28);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  letter-spacing: 0;
  line-height: 1.18;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

h4 {
  margin-bottom: 6px;
  font-size: 14px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -120px;
  z-index: 100;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 16px;
}

.slack-app {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: 76px 304px minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
  overflow: hidden;
  background: var(--soft);
}

.top-bar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr) max-content;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(217, 222, 231, 0.7);
  background: #ffffff;
}

.top-left,
.top-actions,
.workspace-tools,
.channel-actions,
.detail-actions,
.ai-actions,
.message-actions,
.issue-actions,
.board-tabs,
.composer-tools,
.composer-bottom,
.composer-bottom > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: max-content;
}

.top-link {
  min-height: 36px;
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.top-link:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.language-switcher {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.88);
}

.language-switcher button {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.language-switcher button:hover {
  background: var(--soft);
  color: var(--ink);
}

.language-switcher button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 12px rgba(12, 102, 228, 0.18);
}

body[data-lang="en"] .top-link,
body[data-lang="en"] .outline-button,
body[data-lang="en"] .primary-button {
  white-space: nowrap;
}

body[data-lang="en"] .rail-nav strong {
  font-size: 11px;
}

body[data-lang="en"] .sidebar-section a,
body[data-lang="en"] .mini-link,
body[data-lang="en"] .project-channel {
  line-height: 1.25;
}

.icon-button,
.round-button,
.star-button,
.profile-chip,
.composer-tools button,
.composer-bottom button,
.send-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: #344054;
  font-weight: 800;
}

.icon-button:hover,
.composer-tools button:hover,
.composer-bottom button:hover,
.star-button:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-button.subtle {
  border-color: transparent;
  background: transparent;
  color: #586475;
}

.profile-chip {
  border-color: transparent;
  background: var(--rail-2);
  color: #fff;
}

.profile-menu-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  width: 214px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.profile-menu-head {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.profile-menu-head strong {
  font-size: 15px;
}

.profile-menu-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.profile-menu a,
.profile-menu button {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-weight: 800;
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.profile-menu button[data-logout] {
  color: var(--red);
}

.global-search-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
}

.global-search {
  height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--paper-2);
  color: var(--muted);
  font-weight: 700;
}

.global-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}

.global-search-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(520px, calc(100vh - 96px));
  overflow: auto;
  border: 1px solid rgba(217, 222, 231, 0.95);
  border-radius: 16px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 60px rgba(19, 27, 40, 0.16);
}

.global-search-head,
.global-search-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.global-search-empty {
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 1px dashed rgba(105, 116, 135, 0.26);
  border-radius: 12px;
}

.global-search-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.global-search-empty span,
.global-search-head em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.global-search-list {
  display: grid;
  gap: 4px;
}

.global-search-list button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "type title"
    "type sub"
    "type meta";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.global-search-list button:hover,
.global-search-list button.active {
  border-color: rgba(12, 102, 228, 0.22);
  background: var(--accent-soft);
}

.search-type {
  grid-area: type;
  min-width: 58px;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(12, 102, 228, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.global-search-list strong {
  grid-area: title;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-list small,
.global-search-list em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-list small {
  grid-area: sub;
}

.global-search-list em {
  grid-area: meta;
}

.global-rail {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 12px;
  background: var(--rail);
  color: rgba(255, 255, 255, 0.86);
}

.workspace-badge {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  padding: 0 5px;
  background: #d6e4f0;
  color: #1b2733;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-badge.active {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.24);
}

.workspace-badge[data-badge-length="3"] {
  font-size: 16px;
}

.project-switcher {
  position: absolute;
  left: 68px;
  top: 14px;
  z-index: 80;
  width: 322px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.switcher-head {
  display: grid;
  gap: 2px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.switcher-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.switcher-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-list {
  display: grid;
  gap: 4px;
  padding: 8px 0;
}

.switcher-org-group {
  display: grid;
  gap: 4px;
  padding: 6px 0;
}

.switcher-org-group + .switcher-org-group {
  border-top: 1px solid var(--line);
}

.switcher-org-group > p {
  margin: 0;
  padding: 4px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.switcher-list button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.switcher-list button:hover,
.switcher-list button.active {
  background: var(--accent-soft);
}

.switcher-list button > span {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
  padding: 0 4px;
  background: var(--rail-2);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-list strong,
.switcher-list small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-list small {
  color: var(--muted);
  font-weight: 650;
}

.switcher-actions {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.switcher-actions button,
.switcher-actions a {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--accent);
  font-weight: 850;
}

.switcher-actions button:hover,
.switcher-actions a:hover {
  background: var(--accent-soft);
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.rail-nav a {
  position: relative;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 750;
}

.rail-nav a:hover,
.rail-nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.rail-nav span {
  font-size: 20px;
  line-height: 1;
}

.rail-nav strong {
  font-size: 12px;
  font-weight: 800;
}

.rail-nav em {
  position: absolute;
  right: 6px;
  top: 4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--rail);
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
}

.rail-bottom {
  display: grid;
  gap: 12px;
}

.round-button {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
}

.workspace-sidebar {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7f8fa;
}

.workspace-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

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

.compact-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.compact-action.icon-only {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.compact-action.icon-only svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-action:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-title {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.workspace-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-button {
  width: calc(100% - 32px);
  min-height: 44px;
  margin: 14px 16px;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
}

.upgrade-button:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
}

.sidebar-section {
  display: grid;
  gap: 4px;
  padding: 8px 12px 14px;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid rgba(217, 222, 231, 0.72);
}

.sidebar-section a,
.mini-link,
.project-channel {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: #485465;
  text-align: left;
  font-weight: 760;
}

.sidebar-section a:hover,
.mini-link:hover,
.project-channel:hover {
  background: #edf2f7;
  color: var(--ink);
}

.mini-link.muted,
.star-button.passive,
button:disabled,
button.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.mini-link.muted,
.mini-link.muted:hover {
  background: transparent;
  color: #8a94a3;
}

button:disabled,
button.is-disabled {
  pointer-events: none;
}

.sidebar-section a.active,
.mini-link.active {
  background: #e4edf8;
  color: var(--accent);
}

.section-label {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #6d7786;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-list {
  display: grid;
  gap: 2px;
}

.project-channel {
  min-height: 48px;
  justify-content: space-between;
  padding: 6px 9px;
}

.project-channel.active {
  background: #e4edf8;
  color: var(--accent);
}

.topic-channel {
  min-height: 58px;
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 8px;
}

.topic-channel .channel-hash {
  margin-top: 2px;
}

.topic-channel.is-archived {
  color: #6d7786;
  background: #f7f8fb;
}

.topic-archive-toggle {
  margin-top: 8px;
  border: 1px dashed rgba(136, 146, 160, 0.4);
  background: #fbfcfe;
}

.topic-archive-toggle.active {
  border-style: solid;
  background: #eef4fb;
}

.topic-archive-list {
  display: grid;
  gap: 4px;
  margin: 4px 0 2px 12px;
  padding-left: 8px;
  border-left: 1px solid rgba(136, 146, 160, 0.26);
}

.topic-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.channel-hash {
  color: inherit;
  font-size: 19px;
  line-height: 1;
  font-weight: 700;
}

.project-copy {
  min-width: 0;
  display: grid;
  flex: 1;
}

.project-copy strong,
.project-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.project-channel em {
  max-width: 82px;
  overflow: hidden;
  color: #6d7786;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-main {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--paper);
}

.channel-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.channel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-title > div {
  min-width: 0;
}

.channel-title p,
.detail-head p,
.section-head p,
.panel-title p,
.ai-card > p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.channel-title h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-button {
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.outline-button,
.primary-button,
.board-tabs button,
.message-actions button,
.message-actions a,
.issue-actions button,
.inline-reply button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 850;
}

.primary-button,
.send-button,
.inline-reply button {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.outline-button:hover,
.board-tabs button:hover,
.message-actions button:hover,
.message-actions a:hover,
.issue-actions button:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button:hover,
.send-button:hover,
.inline-reply button:hover {
  background: #0055cc;
}

.tab-row {
  min-height: 48px;
  display: flex;
  align-items: end;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tab-row a,
.tab-row button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #505b6c;
  font-weight: 850;
}

.tab-row a.active,
.tab-row a:hover {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.tab-row button {
  font-size: 20px;
}

.channel-scroll {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  background: linear-gradient(180deg, #f6f8fb 0, #ffffff 220px);
}

.project-summary {
  min-height: 102px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.welcome-copy {
  min-width: 0;
}

.welcome-copy p {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.welcome-copy h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.welcome-copy span {
  color: var(--muted);
  font-weight: 700;
}

.project-pills,
.tile-meta,
.issue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.project-pills span,
.project-pills a,
.tile-meta span,
.issue-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--paper-2);
  color: #435063;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.project-pills a {
  color: var(--accent);
}

.project-pills .ok {
  background: var(--green-soft);
  color: var(--green);
}

.project-pills .risk {
  background: var(--amber-soft);
  color: var(--amber);
}

.topic-card-section,
.topic-detail,
.context-panel,
.board-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.topic-card-section {
  margin-bottom: 16px;
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h2,
.panel-title h2 {
  margin-bottom: 0;
}

.topic-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 12px;
}

.topic-tile {
  min-height: 172px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--paper);
  text-align: left;
}

.topic-tile:hover,
.topic-tile.active {
  border-color: rgba(12, 102, 228, 0.42);
  box-shadow: inset 0 3px 0 var(--accent);
}

.topic-tile strong {
  color: var(--ink);
  line-height: 1.28;
}

.topic-tile p {
  margin-bottom: 0;
  color: var(--muted);
}

.topic-key {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.topic-detail {
  min-width: 0;
  overflow: hidden;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-head > div:first-child {
  min-width: 0;
}

.detail-head h2 {
  overflow-wrap: anywhere;
}

.detail-head span {
  color: var(--muted);
  font-weight: 700;
}

.thread-groups {
  display: grid;
  gap: 2px;
  padding: 8px 0 16px;
}

.topic-archive-note {
  margin: 0 16px 8px;
  border: 1px solid rgba(136, 146, 160, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7f8fb;
  color: var(--muted);
  font-weight: 760;
}

.message-group {
  padding: 10px 16px 12px;
  border-left: 4px solid transparent;
}

.message-group:hover {
  background: #fbfcfe;
}

.message-group.highlighted {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.root-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--rail-2);
  color: #fff;
  font-weight: 900;
}

.message-copy {
  min-width: 0;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
}

.message-meta span,
.message-meta time,
.message-meta em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.message-meta b {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.message-copy p {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.message-actions button,
.message-actions a,
.issue-actions button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.reply-thread {
  display: grid;
  gap: 8px;
  margin: 8px 0 0 52px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.thread-label {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.reply {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--paper-2);
}

.reply span {
  color: var(--muted);
  font-size: 12px;
}

.reply p {
  grid-column: 1 / -1;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.inline-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-reply textarea {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.context-panel {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.panel-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.context-panel [data-ai-panel] {
  display: grid;
  gap: 12px;
}

.ai-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.ai-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.ai-card dl div {
  min-width: 0;
  border-radius: 7px;
  padding: 8px;
  background: var(--paper-2);
}

.ai-card dt,
.ai-card dd {
  margin: 0;
}

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

.ai-card dd {
  overflow-wrap: anywhere;
  font-weight: 850;
}

.ai-card > span,
.ai-state span {
  color: var(--muted);
}

.ai-proposal,
.ai-state {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 10px;
}

.ai-proposal {
  background: var(--violet-soft);
}

.ai-proposal span {
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
}

.ai-task-proposal small,
.ai-conversation-proposal span {
  color: var(--muted);
  line-height: 1.45;
}

.ai-conversation-proposal {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--paper-2);
}

.ai-state.success {
  background: var(--green-soft);
  color: var(--green);
}

.ai-state.muted {
  background: var(--paper-2);
  color: var(--muted);
}

.board-section {
  padding: 16px;
}

.board-tabs {
  flex-wrap: wrap;
}

.board-tabs button {
  min-height: 34px;
  border-radius: 999px;
}

.board-tabs button.active,
.issue-actions button.active {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.issue-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
}

.issue-column {
  min-width: 0;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  padding: 10px;
  background: #f7f9fc;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.issue-column.drag-over {
  border-color: rgba(12, 102, 228, 0.5);
  background: #edf4ff;
  box-shadow: inset 0 0 0 2px rgba(12, 102, 228, 0.12);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.column-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.column-head h3 {
  margin-bottom: 0;
}

.column-head span {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.done-filter {
  position: relative;
}

.done-filter-toggle {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.done-filter-toggle:hover {
  border-color: rgba(0, 102, 204, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.done-filter-toggle.active {
  border-color: rgba(0, 102, 204, 0.3);
  background: var(--accent-soft);
  color: var(--accent);
}

.done-filter-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.done-filter-toggle span {
  min-width: 0;
  height: auto;
  display: inline;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
}

.done-filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 148px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.done-filter-menu[hidden] {
  display: none;
}

.done-filter-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.done-filter-menu button:hover,
.done-filter-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.archive-filter-menu {
  width: min(320px, calc(100vw - 32px));
  gap: 12px;
  padding: 14px;
}

.archive-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.archive-filter-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.archive-filter-field select,
.archive-filter-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.archive-filter-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.done-filter-menu .archive-filter-reset {
  min-height: 42px;
  border: 1px solid var(--line);
  text-align: center;
}

.archive-column {
  background: #f5f6f8;
}

.issue-stack {
  display: grid;
  gap: 8px;
}

.issue-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  cursor: grab;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.issue-card:active {
  cursor: grabbing;
}

.issue-card.dragging {
  opacity: 0.62;
  transform: scale(0.99);
}

.issue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.issue-card-actions,
.detail-icon-actions,
.board-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-card-actions {
  gap: 6px;
}

.issue-top span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.issue-top strong {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.card-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.card-icon:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-icon.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.icon-button svg,
.card-icon svg,
.icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.issue-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-lane {
  min-height: 84px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.composer-shell {
  min-height: 118px;
  display: grid;
  gap: 0;
  margin: 0 22px 18px;
  border: 1px solid #b8c0cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 -1px 0 rgba(29, 39, 51, 0.02);
}

.composer-tools {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 0;
}

.composer-tools button,
.composer-bottom button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-color: transparent;
  background: transparent;
  color: #5f6b7a;
  font-weight: 850;
}

.composer-tools button svg,
.composer-bottom button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-tools button strong,
.composer-tools button em {
  font-size: 16px;
  line-height: 1;
}

.composer-input {
  display: grid;
  gap: 4px;
  padding: 2px 14px;
}

.composer-input span {
  color: var(--muted);
  font-weight: 750;
}

.composer-input textarea {
  width: 100%;
  min-height: 38px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.composer-bottom {
  min-height: 42px;
  justify-content: space-between;
  padding: 0 10px 8px;
}

.send-button {
  width: auto;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 7px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: min(380px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.board-app {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
  background: var(--soft);
  overflow: hidden;
}

.board-top {
  grid-column: 1 / -1;
}

.board-sidebar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  background: #f7f8fa;
}

.board-logo {
  margin-left: 2px;
}

.project-list.compact .project-channel {
  min-height: 52px;
}

.board-main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  background: linear-gradient(180deg, #f6f8fb 0, #ffffff 220px);
}

.board-header {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.board-header-actions {
  justify-content: flex-end;
}

.board-header p {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.board-header h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

.board-header span {
  color: var(--muted);
  font-weight: 700;
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
}

.board-stats article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.board-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.board-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.board-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.board-filter-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.board-filter-summary span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--paper-2);
  color: #435063;
  font-size: 12px;
  font-weight: 850;
}

.people-filter-list,
.team-filter-list {
  display: grid;
  gap: 4px;
}

.people-overview {
  min-height: 122px;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding: 16px 16px 0;
}

.person-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.person-card:hover,
.person-card.active {
  border-color: rgba(12, 102, 228, 0.4);
  box-shadow: inset 3px 0 0 var(--accent);
}

.person-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.person-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.person-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--paper-2);
  color: #435063;
  font-size: 12px;
  font-weight: 800;
}

.board-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  overflow: hidden;
  padding: 16px;
}

.board-workspace .issue-board {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.task-detail-panel {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-panel-head span {
  color: var(--accent);
  font-weight: 900;
}

.detail-panel-head strong {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.task-detail-panel h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.task-detail-panel > p {
  color: var(--muted);
}

.task-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.task-facts div {
  min-width: 0;
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.task-facts dt,
.task-facts dd {
  margin: 0;
}

.task-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-facts dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.source-detail {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.source-detail span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.source-detail p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-actions.vertical {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.task-detail-edit {
  display: grid;
  gap: 12px;
}

.task-detail-edit label {
  display: grid;
  gap: 6px;
}

.task-detail-edit label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-detail-edit input,
.task-detail-edit textarea,
.task-detail-edit select,
.task-dialog-form input,
.task-dialog-form textarea,
.task-dialog-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.task-detail-edit textarea,
.task-dialog-form textarea {
  min-height: 112px;
  resize: vertical;
  padding: 10px 12px;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.issue-card.active {
  border-color: rgba(12, 102, 228, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}

.source-row {
  border-radius: 7px;
  padding: 7px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.empty-detail {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(180deg, #f6f8fb 0, #ffffff 100%);
}

.auth-panel {
  width: min(1080px, 100%);
  display: grid;
  gap: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-brand > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--rail-2);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.auth-brand h1 {
  margin-bottom: 4px;
  font-size: 30px;
}

.auth-brand p {
  margin-bottom: 0;
  color: var(--muted);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-card,
.admin-form,
.admin-section,
.admin-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.auth-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.auth-card label,
.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.auth-card input,
.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
}

.admin-app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  background: var(--soft);
}

.admin-main {
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.admin-hero p {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-hero span {
  color: var(--muted);
}

.admin-current {
  display: grid;
  gap: 4px;
  min-width: 180px;
  border-radius: 8px;
  padding: 12px;
  background: var(--paper-2);
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.admin-content {
  display: grid;
  gap: 16px;
}

.admin-section {
  padding: 16px;
}

.admin-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-form.inline {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
  margin-top: 12px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.8fr) minmax(160px, 0.8fr) minmax(110px, 0.6fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.admin-table span,
.admin-table em {
  color: var(--muted);
  font-style: normal;
}

.admin-table code {
  color: var(--accent);
  font-weight: 850;
}

.admin-hint {
  margin-top: 10px;
  border-radius: 8px;
  padding: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.workspace-auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1fr);
  background: #f6f8fb;
}

.auth-hero-pane {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 44px;
  background: var(--rail);
  color: #fff;
}

.workspace-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e6f0f8;
  color: var(--rail);
  font-size: 24px;
  font-weight: 900;
}

.workspace-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  font-size: 17px;
}

.auth-hero-pane p,
.form-title p,
.settings-hero p {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-hero-pane p {
  color: rgba(255, 255, 255, 0.72);
}

.auth-hero-pane h1 {
  margin-bottom: 10px;
  font-size: 34px;
}

.auth-hero-pane span {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.auth-workspace-preview {
  display: grid;
  gap: 10px;
}

.auth-workspace-preview article {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-workspace-preview strong,
.auth-workspace-preview span {
  display: block;
}

.auth-action-pane {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 44px;
}

.auth-top-switch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
}

.auth-top-switch .outline-button {
  min-height: 40px;
  padding: 0 14px;
}

.invite-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(99, 110, 123, 0.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(16px);
}

.invite-card[hidden] {
  display: none;
}

.invite-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.invite-card h2,
.invite-card p {
  margin-bottom: 2px;
}

.invite-card span {
  color: var(--muted);
  font-weight: 700;
}

.invite-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.invite-actions[hidden] {
  display: none;
}

.auth-tabs {
  display: flex;
  gap: 8px;
}

.auth-tabs a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.auth-tabs a.active,
.auth-tabs a:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.slack-auth-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.slack-auth-card.muted-card {
  background: #fbfcfe;
}

.offline-entry {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(12, 102, 228, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 24px rgba(29, 39, 51, 0.08);
}

.offline-entry p,
.offline-admin-hero p {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.offline-entry h2 {
  margin-bottom: 4px;
}

.offline-entry span,
.offline-admin-hero span {
  color: var(--muted);
  font-weight: 750;
}

.offline-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-title h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.form-title span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.slack-auth-card label {
  color: #435063;
  font-weight: 850;
}

.slack-auth-card .field {
  display: grid;
  gap: 6px;
}

.slack-auth-card input,
.settings-mini-form input,
.settings-form-row input,
.settings-form-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide {
  width: 100%;
}

.auth-secondary-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.auth-assist-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
  font-size: 14px;
  font-weight: 850;
}

.auth-assist-row a,
.auth-secondary-note a {
  color: var(--accent);
  font-weight: 900;
}

.auth-status-note {
  margin: 0;
  border-radius: 8px;
  background: #f6f8fb;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.workspace-settings-app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
  background: #f6f8fb;
}

.workspace-settings-app .top-bar {
  grid-column: 1 / -1;
}

.settings-sidebar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 16px;
  background: #fff;
}

.settings-workspace-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.settings-workspace-card strong,
.settings-workspace-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-workspace-card span {
  color: var(--muted);
  font-size: 12px;
}

.settings-nav {
  display: grid;
  gap: 4px;
  margin: 16px 0;
}

.settings-nav a,
.settings-nav button {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: #485465;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-align: left;
}

.settings-nav a.active,
.settings-nav a:hover,
.settings-nav button.active,
.settings-nav button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-org-list {
  display: grid;
  gap: 6px;
}

.settings-org-switcher {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.org-switcher-button {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.org-switcher-button:hover,
.org-switcher-button[aria-expanded="true"] {
  border-color: rgba(12, 102, 228, 0.36);
  background: var(--accent-soft);
}

.org-switcher-button span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.org-switcher-button strong {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-switcher-button em {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--muted);
  font-style: normal;
  font-size: 18px;
}

.org-switcher-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.org-switcher-list {
  max-height: 320px;
  display: grid;
  gap: 4px;
  overflow: auto;
}

.org-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 4px;
  align-items: center;
  border-radius: 10px;
}

.org-option-row.active {
  background: rgba(74, 21, 75, 0.08);
}

.org-option,
.org-create-trigger {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.org-option:hover,
.org-option.active,
.org-create-trigger:hover {
  background: rgba(74, 21, 75, 0.08);
}

.org-option-mark,
.org-create-trigger > span {
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--rail);
  color: #fff;
  font-weight: 900;
}

.org-option strong,
.org-option small,
.org-create-trigger strong,
.org-create-trigger small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-option small,
.org-create-trigger small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.org-create-trigger {
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  color: var(--accent);
}

.org-create-trigger > span {
  background: var(--accent-soft);
  color: var(--accent);
}

.org-option-row .icon-action {
  width: 36px;
  height: 36px;
  border-color: transparent;
  background: transparent;
}

.settings-mini-form {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.settings-main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow: auto;
  padding: 20px;
}

.settings-hero,
.settings-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 39, 51, 0.03);
}

.settings-hero {
  padding: 18px;
}

.settings-hero h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

.settings-hero span,
.access-note span {
  color: var(--muted);
  font-weight: 700;
}

.settings-section {
  margin-top: 16px;
  padding: 16px;
}

.settings-section[hidden] {
  display: none;
}

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

.lifecycle-strip article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.lifecycle-strip strong,
.lifecycle-strip span {
  display: block;
}

.lifecycle-strip strong {
  font-size: 13px;
}

.lifecycle-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-table {
  display: grid;
  gap: 8px;
}

.settings-table article {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 0.7fr) minmax(110px, 0.5fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.settings-table strong,
.settings-table span {
  display: block;
}

.settings-table span,
.settings-table em {
  color: var(--muted);
  font-style: normal;
}

.settings-table code {
  color: var(--accent);
  font-weight: 850;
}

.subsection-head {
  margin: 14px 0 8px;
}

.subsection-head p,
.dialog-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subsection-head h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.team-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.team-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.team-card > div {
  min-width: 0;
}

.team-grid strong,
.team-grid span,
.project-admin-main strong,
.project-admin-main span {
  display: block;
}

.team-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.table-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions select {
  min-height: 34px;
  max-width: 120px;
}

.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.danger-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  background: #fff2f0;
  color: #c9372c;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.danger-link:hover {
  border-color: rgba(201, 55, 44, 0.28);
}

.agent-access-note {
  display: block;
  border: 1px solid rgba(12, 102, 228, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  background: #eaf3ff;
}

.secret-reveal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(12, 102, 228, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  background: #eaf3ff;
}

.agent-access-note strong,
.agent-access-note span,
.secret-reveal strong,
.secret-reveal code {
  display: block;
}

.agent-access-note span {
  margin-top: 4px;
  color: #44546f;
  font-weight: 700;
  line-height: 1.45;
}

.agent-token-form {
  grid-template-columns: minmax(240px, 1fr) minmax(110px, 150px) minmax(150px, 190px) auto;
}

.secret-reveal {
  margin-top: 10px;
  background: #f8fbff;
}

.secret-reveal code {
  margin-top: 6px;
  overflow: auto;
  border: 1px solid rgba(12, 102, 228, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #0c66e4;
  font-size: 12px;
  white-space: nowrap;
}

.agent-endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-prompt-reveal {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(12, 102, 228, 0.2);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.agent-prompt-reveal[hidden] {
  display: none;
}

.agent-prompt-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.agent-prompt-head strong,
.agent-prompt-head span {
  display: block;
}

.agent-prompt-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.agent-prompt-reveal pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.agent-endpoint-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper-2);
}

.agent-endpoint-card strong,
.agent-endpoint-card code,
.agent-endpoint-card span {
  display: block;
}

.agent-endpoint-card code {
  margin: 6px 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-endpoint-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.agent-token-list .agent-token-row {
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 0.35fr) auto;
}

.icon-action {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: #435063;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.icon-action:hover {
  border-color: rgba(12, 102, 228, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-action.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.icon-action.primary:hover {
  background: #0055cc;
}

.icon-action.danger {
  border-color: transparent;
  background: var(--red-soft);
  color: var(--red);
}

.icon-action.quiet {
  background: transparent;
}

.icon-action.danger:hover {
  border-color: rgba(174, 46, 36, 0.22);
  background: var(--red-soft);
}

.member-row {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) minmax(260px, auto);
}

.member-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-tags {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.member-tags.compact {
  margin-top: 8px;
}

.member-tag {
  min-height: 28px;
  max-width: 180px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: #435063;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.member-tag.tone-green {
  border-color: rgba(31, 132, 90, 0.18);
  background: var(--green-soft);
  color: var(--green);
}

.member-tag.tone-amber {
  border-color: rgba(154, 103, 0, 0.2);
  background: var(--amber-soft);
  color: var(--amber);
}

.member-tag.tone-red {
  border-color: rgba(174, 46, 36, 0.18);
  background: var(--red-soft);
  color: var(--red);
}

.member-tag.tone-blue {
  border-color: rgba(12, 102, 228, 0.2);
  background: var(--accent-soft);
  color: var(--accent);
}

.member-tag.tone-purple {
  border-color: rgba(90, 26, 90, 0.18);
  background: rgba(90, 26, 90, 0.08);
  color: var(--rail);
}

.member-tag.tone-neutral {
  background: #f7f8fa;
  color: #4f5f73;
}

.member-actions {
  flex-wrap: nowrap;
}

.row-code {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-button.small {
  min-height: 34px;
  padding: 0 10px;
}

.settings-form-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr 0.8fr 0.9fr 0.9fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.settings-form-row.project-row {
  grid-template-columns: 0.45fr 1.3fr 1fr 0.9fr 0.7fr auto;
}

.settings-form-row.access-row {
  grid-template-columns: 1.35fr 0.75fr 1.25fr 0.75fr 0.85fr auto;
}

.access-user-search {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border: 1px solid rgba(12, 102, 228, 0.16);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.access-user-search[hidden] {
  display: none;
}

.access-user-search label {
  display: grid;
  gap: 6px;
}

.access-user-search label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.access-user-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.access-user-results {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-user-results:empty {
  display: none;
}

.access-user-results button {
  min-height: 34px;
  border: 1px solid rgba(12, 102, 228, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--accent);
  font-weight: 850;
}

.access-user-results button:hover {
  background: var(--accent-soft);
}

.settings-form-row.team-row {
  grid-template-columns: minmax(220px, 360px) auto;
  justify-content: start;
}

.settings-action-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfcfe;
}

.settings-action-row strong,
.settings-action-row span {
  display: block;
}

.settings-action-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.settings-form-row.search-row,
.settings-form-row.invite-code-row {
  grid-template-columns: minmax(240px, 420px) auto;
  justify-content: start;
}

.settings-form-row select[multiple] {
  min-height: 46px;
  padding: 6px 10px;
}

.team-picker {
  position: relative;
  min-width: 0;
}

.team-picker-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #cfd7e3;
  border-radius: 10px;
  padding: 0 14px;
  background: linear-gradient(#fff, #f9fafc);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.team-picker-button::after {
  content: "⌄";
  color: var(--muted);
  font-size: 15px;
}

.team-picker-button.has-value {
  color: var(--ink);
}

.team-picker-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid rgba(99, 110, 123, 0.18);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.18);
  backdrop-filter: blur(14px);
}

.team-picker-panel[hidden] {
  display: none;
}

.team-check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 0 9px;
  cursor: pointer;
  font-weight: 800;
}

.team-check:hover {
  background: var(--accent-soft);
}

.team-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.team-empty {
  padding: 10px;
  color: var(--muted);
  font-weight: 800;
}

.search-results,
.invite-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.search-results article,
.invite-list article {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-2);
}

.invite-list code {
  max-width: 560px;
  overflow: hidden;
  color: var(--accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.invite-url {
  min-width: 0;
  overflow: hidden;
  display: block;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #f8fafc;
  color: #2f3a4a;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row-actions .icon-action {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
}

.project-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-status-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.project-status-tabs button.active,
.project-status-tabs button:hover {
  border-color: rgba(12, 102, 228, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.project-admin-card {
  grid-template-columns: minmax(260px, 1fr) minmax(110px, 0.35fr) auto;
}

.project-admin-main {
  min-width: 0;
}

.project-admin-main strong {
  color: var(--ink);
}

.project-admin-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.settings-dialog {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 78px rgba(16, 24, 40, 0.26);
}

.settings-dialog::backdrop {
  background: rgba(16, 24, 40, 0.46);
}

.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(16, 24, 40, 0.48);
  backdrop-filter: blur(2px);
}

.confirm-shell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid rgba(29, 39, 51, 0.08);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
}

.confirm-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.confirm-copy {
  min-width: 0;
}

.confirm-kicker {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.confirm-copy h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.confirm-copy p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.confirm-copy small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.danger-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--red);
  color: #fff;
  font-weight: 950;
  touch-action: manipulation;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.danger-button:hover {
  background: #8f231c;
  box-shadow: 0 10px 22px rgba(174, 46, 36, 0.2);
}

.danger-button:active,
.confirm-actions .outline-button:active {
  transform: translateY(1px);
}

.access-dialog {
  width: min(820px, calc(100vw - 32px));
}

.task-dialog {
  width: min(860px, calc(100vw - 32px));
}

.task-visibility-note {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.task-confirmation-note {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  border: 1px solid rgba(16, 122, 92, 0.22);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 13px;
}

.task-confirmation-note strong {
  color: var(--green);
}

.task-confirmation-note[hidden] {
  display: none;
}

.dialog-shell {
  padding: 20px;
  background: #fff;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dialog-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.dialog-form {
  display: grid;
  gap: 12px;
}

.dialog-form label {
  display: grid;
  gap: 6px;
}

.dialog-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.dialog-helper {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

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

.access-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 8px;
  padding: 12px;
  background: var(--accent-soft);
}

@media (max-width: 1380px) {
  .topic-card-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }

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

  .context-panel {
    position: static;
  }

  .context-panel [data-ai-panel] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue-board {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .people-overview {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .board-workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .board-workspace .issue-board {
    overflow: visible;
  }

  .admin-form.inline {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .settings-form-row,
  .settings-form-row.project-row,
  .settings-form-row.access-row,
  .settings-form-row.team-row,
  .settings-form-row.search-row,
  .settings-form-row.invite-code-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .lifecycle-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .slack-app {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .workspace-sidebar {
    display: none;
  }

  .channel-main {
    grid-column: 2;
  }

  .top-bar {
    grid-template-columns: auto minmax(180px, 1fr) auto;
  }

  .channel-header,
  .project-summary,
  .detail-head {
    align-items: flex-start;
  }

  .channel-header,
  .project-summary {
    display: grid;
  }

  .board-app {
    grid-template-columns: 1fr;
  }

  .board-sidebar {
    display: none;
  }

  .board-main {
    grid-column: 1;
  }

  .board-header {
    display: grid;
  }

  .board-header-actions {
    display: grid;
    justify-content: stretch;
  }

  .auth-grid,
  .admin-layout,
  .workspace-auth,
  .workspace-settings-app {
    grid-template-columns: 1fr;
  }

  .settings-sidebar,
  .settings-main {
    grid-column: 1;
  }

  .settings-sidebar {
    grid-row: auto;
  }

  .admin-table article {
    grid-template-columns: 1fr;
  }

  .settings-table article {
    grid-template-columns: 1fr;
  }

  .project-admin-card {
    grid-template-columns: 1fr;
  }

  .table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .slack-app {
    grid-template-columns: 1fr;
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .top-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .top-left {
    display: none;
  }

  .global-rail,
  .workspace-sidebar {
    display: none;
  }

  .channel-main {
    grid-column: 1;
  }

  .channel-actions {
    flex-wrap: wrap;
  }

  .tab-row {
    gap: 12px;
    overflow-x: auto;
    padding: 0 14px;
  }

  .lifecycle-strip {
    grid-template-columns: 1fr;
  }

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

  .project-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-scroll {
    padding: 14px;
  }

  .topic-card-grid,
  .context-panel [data-ai-panel],
  .issue-board,
  .ai-card dl {
    grid-template-columns: 1fr;
  }

  .reply-thread {
    margin-left: 18px;
  }

  .inline-reply {
    grid-template-columns: 1fr;
  }

  .composer-shell {
    margin: 0 12px 12px;
  }

  .board-toolbar,
  .board-header {
    display: grid;
    padding: 14px;
  }

  .board-stats,
  .people-overview,
  .task-facts {
    grid-template-columns: 1fr;
  }

  .task-form-grid {
    grid-template-columns: 1fr;
  }

  .board-workspace {
    padding: 12px;
  }

  .auth-shell,
  .admin-main {
    padding: 12px;
  }

  .admin-hero,
  .admin-form.inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-hero-pane,
  .auth-action-pane,
  .settings-main,
  .settings-sidebar {
    padding: 14px;
  }

  .form-grid.two,
  .settings-form-row,
  .settings-form-row.project-row,
  .settings-form-row.access-row,
  .settings-form-row.team-row,
  .settings-form-row.search-row,
  .settings-form-row.invite-code-row,
  .search-results article,
  .invite-list article {
    grid-template-columns: 1fr;
  }
}

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

/* ProjectHub Design Refresh: Slack structure + Apple restraint. */
:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #f5f5f7;
  --paper: #ffffff;
  --paper-2: #fafafc;
  --line: #e0e0e0;
  --rail: #4a154b;
  --rail-2: #611f69;
  --rail-muted: #d9bdde;
  --sidebar-tint: #f4ede4;
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --accent-soft: #eaf3ff;
  --green: #007a5a;
  --green-soft: #e8f5f0;
  --amber: #9a6700;
  --amber-soft: #fff6df;
  --red: #cc4117;
  --red-soft: #fff1eb;
  --violet: #4a154b;
  --violet-soft: #f9f0ff;
  --shadow: 0 1px 2px rgba(29, 29, 31, 0.08), 0 10px 28px rgba(29, 29, 31, 0.08);
  --shadow-soft: 0 1px 2px rgba(29, 29, 31, 0.07);
  --radius: 8px;
}

body {
  background: var(--soft);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
}

.slack-app {
  grid-template-columns: 72px 312px minmax(0, 1fr);
  background: var(--soft);
}

.top-bar {
  min-height: 56px;
  border-bottom-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.global-search {
  height: 40px;
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(250, 250, 252, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.global-search span {
  color: var(--muted);
  font-weight: 650;
}

.global-search input {
  font-weight: 650;
}

.top-link,
.outline-button,
.primary-button,
.compact-action,
.upgrade-button,
.board-tabs button,
.message-actions button,
.message-actions a,
.issue-actions button,
.inline-reply button {
  min-height: 38px;
  border-radius: 999px;
  font-weight: 700;
}

.top-link,
.outline-button,
.compact-action {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.primary-button,
.send-button,
.inline-reply button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover,
.send-button:hover,
.inline-reply button:hover {
  background: var(--accent-hover);
}

.icon-button,
.round-button,
.star-button,
.profile-chip,
.composer-tools button,
.composer-bottom button,
.send-button,
.icon-action,
.card-icon {
  border-radius: 999px;
}

.icon-button,
.star-button,
.composer-tools button,
.composer-bottom button,
.icon-action,
.card-icon {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.88);
  color: #424245;
}

.icon-button:hover,
.star-button:hover,
.composer-tools button:hover,
.composer-bottom button:hover,
.card-icon:hover,
.icon-action:hover,
.top-link:hover,
.outline-button:hover,
.compact-action:hover {
  border-color: rgba(0, 102, 204, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.global-rail {
  gap: 16px;
  padding: 14px 10px;
  background: var(--rail);
}

.workspace-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  color: var(--rail);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.workspace-badge:hover,
.workspace-badge.active {
  background: var(--sidebar-tint);
}

.profile-chip {
  background: var(--rail);
  color: #fff;
  font-weight: 800;
}

.rail-nav {
  gap: 8px;
}

.rail-nav a {
  min-height: 60px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.rail-nav a:hover,
.rail-nav a.active {
  background: rgba(255, 255, 255, 0.14);
}

.rail-nav span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
}

.rail-nav em {
  border: 1px solid rgba(74, 21, 75, 0.12);
  color: var(--rail);
}

.round-button {
  background: rgba(255, 255, 255, 0.12);
}

.workspace-sidebar,
.board-sidebar,
.settings-sidebar {
  border-right-color: rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #fbf7f2 0, #ffffff 38%);
}

.workspace-head {
  min-height: 74px;
  border-bottom-color: rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.workspace-title {
  font-size: 18px;
  font-weight: 800;
}

.workspace-tools {
  flex: 0 0 auto;
}

.compact-action {
  padding: 0 12px;
  white-space: nowrap;
}

.workspace-title span,
.team-picker-button::after {
  content: "\25BE";
  color: var(--muted);
}

.upgrade-button {
  border-color: rgba(74, 21, 75, 0.18);
  background: var(--rail);
  color: #fff;
}

.upgrade-button:hover {
  border-color: var(--rail-2);
  background: var(--rail-2);
  color: #fff;
}

.section-label {
  color: #77717a;
  font-size: 12px;
  letter-spacing: 0;
}

.sidebar-section a,
.mini-link,
.project-channel {
  min-height: 40px;
  border-radius: 8px;
  color: #3d3541;
  font-weight: 700;
}

.sidebar-section a:hover,
.mini-link:hover,
.project-channel:hover {
  background: rgba(74, 21, 75, 0.08);
}

.mini-link.muted,
.mini-link.muted:hover {
  background: transparent;
  color: #8a94a3;
}

.sidebar-section a.active,
.mini-link.active,
.project-channel.active {
  background: rgba(74, 21, 75, 0.12);
  color: var(--rail);
}

.topic-channel.is-archived {
  background: rgba(61, 53, 65, 0.045);
  color: #6d6570;
}

.topic-archive-toggle {
  border-color: rgba(74, 21, 75, 0.2);
}

.topic-archive-toggle.active {
  background: rgba(74, 21, 75, 0.1);
}

.project-switcher,
.settings-dialog {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.switcher-list button {
  border-radius: 10px;
}

.channel-main,
.board-main {
  background: var(--paper);
}

.channel-header,
.tab-row,
.board-header,
.board-toolbar {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.channel-header {
  min-height: 72px;
}

.channel-title h1,
.board-header h1,
.settings-hero h1 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.16;
}

.channel-title p,
.detail-head p,
.section-head p,
.panel-title p,
.ai-card > p,
.board-header p,
.settings-hero p,
.form-title p,
.auth-hero-pane p,
.subsection-head p,
.dialog-head p {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.tab-row {
  gap: 22px;
}

.tab-row a,
.tab-row button {
  min-height: 50px;
  color: #56525c;
}

.tab-row a.active,
.tab-row a:hover {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.channel-scroll,
.board-workspace,
.settings-main {
  background: var(--soft);
}

.project-summary,
.topic-card-section,
.topic-detail,
.context-panel,
.board-section,
.settings-hero,
.settings-section,
.task-detail-panel,
.slack-auth-card,
.settings-workspace-card,
.invite-card {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.project-summary {
  min-height: 108px;
  border-left: 4px solid var(--accent);
}

.project-pills span,
.project-pills a,
.tile-meta span,
.issue-meta span,
.person-meta span,
.board-filter-summary span,
.status-pill {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--paper-2);
  color: #424245;
  font-weight: 700;
}

.project-pills .risk {
  background: var(--amber-soft);
  color: var(--amber);
}

.project-pills .ok {
  background: var(--green-soft);
  color: var(--green);
}

.topic-card-grid {
  gap: 14px;
}

.topic-tile {
  min-height: 176px;
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0, #fafafc 100%);
  box-shadow: var(--shadow-soft);
}

.topic-tile:hover,
.topic-tile.active {
  border-color: rgba(0, 102, 204, 0.38);
  box-shadow: inset 0 3px 0 var(--accent), var(--shadow-soft);
}

.topic-key,
.issue-top span,
.detail-panel-head span,
.source-detail span {
  color: var(--accent);
}

.detail-head {
  background: #fff;
}

.thread-groups {
  gap: 6px;
  padding: 10px 0 18px;
}

.message-group {
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  padding: 12px 18px 14px;
}

.message-group:hover {
  background: #fbfbfd;
}

.message-group.highlighted {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.avatar {
  border-radius: 10px;
  background: var(--rail);
}

.message-meta b,
.issue-top strong,
.detail-panel-head strong {
  background: var(--red-soft);
  color: var(--red);
}

.reply-thread {
  border-left-color: rgba(74, 21, 75, 0.18);
}

.thread-label {
  background: rgba(74, 21, 75, 0.1);
  color: var(--rail);
}

.reply {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: #fafafc;
}

.context-panel {
  top: 14px;
}

.ai-card {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: none;
}

.ai-proposal {
  background: var(--violet-soft);
}

.composer-shell {
  position: sticky;
  bottom: 12px;
  min-height: 132px;
  border-color: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 32px rgba(29, 29, 31, 0.12);
  backdrop-filter: blur(16px);
}

.composer-input textarea {
  color: var(--ink);
  font-size: 15px;
}

.send-button {
  min-width: 76px;
}

.board-app {
  background: var(--soft);
}

.board-sidebar {
  gap: 12px;
  padding: 18px 14px;
}

.board-header {
  min-height: 124px;
  backdrop-filter: blur(18px);
}

.board-stats {
  gap: 10px;
}

.board-stats article {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.people-overview {
  padding: 16px 20px 0;
}

.person-card {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
}

.person-card:hover,
.person-card.active {
  border-color: rgba(0, 102, 204, 0.38);
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-soft);
}

.progress-track {
  background: #e9e9eb;
}

.progress-track span {
  background: var(--accent);
}

.progress-track.segmented {
  display: flex;
  gap: 2px;
}

.progress-track.segmented span {
  flex: 0 0 auto;
  min-width: 2px;
  border-radius: 0;
}

.progress-track.segmented span:first-child {
  border-radius: 999px 0 0 999px;
}

.progress-track.segmented span:last-child {
  border-radius: 0 999px 999px 0;
}

.progress-track.segmented .todo {
  background: #f59e0b;
}

.progress-track.segmented .doing {
  background: #0a84ff;
}

.progress-track.segmented .done {
  background: #34c759;
}

.message-actions .danger-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--red);
}

.message-actions .danger-text svg,
.reply-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reply {
  position: relative;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.reply-delete {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--red);
  background: transparent;
}

.reply-delete:hover {
  border-color: rgba(222, 53, 11, 0.16);
  background: var(--red-soft);
}

.task-detail-edit input[readonly],
.task-dialog-form input[readonly] {
  border-color: rgba(0, 0, 0, 0.08);
  background: #f5f5f7;
  color: var(--muted);
  cursor: default;
}

.board-workspace {
  grid-template-columns: minmax(0, 1fr) clamp(300px, 19vw, 340px);
  gap: 16px;
  padding: 18px 20px 20px;
}

.board-workspace .issue-board {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
}

.issue-column {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: #f9f9fb;
}

.issue-column.drag-over {
  border-color: rgba(0, 102, 204, 0.52);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(0, 102, 204, 0.15);
}

.column-head {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -12px -12px 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(249, 249, 251, 0.94);
  backdrop-filter: blur(12px);
}

.column-head > span,
.column-count {
  background: #fff;
}

.column-tools {
  gap: 7px;
}

.done-filter-toggle {
  border-color: rgba(0, 0, 0, 0.1);
  background: #fff;
}

.done-filter-toggle span {
  min-width: 0;
  height: auto;
  display: inline;
  place-items: initial;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

.issue-stack {
  gap: 10px;
}

.issue-card {
  position: relative;
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 13px 13px 13px 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.issue-card::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
  opacity: 0.14;
}

.issue-card:hover {
  border-color: rgba(0, 102, 204, 0.32);
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.1);
  transform: translateY(-1px);
}

.issue-card.active {
  border-color: rgba(0, 102, 204, 0.45);
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 20px rgba(29, 29, 31, 0.1);
}

.issue-card.dragging {
  opacity: 0.72;
  transform: rotate(0.3deg) scale(0.99);
}

.card-icon {
  width: 34px;
  height: 34px;
}

.empty-lane {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.52);
}

.task-detail-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100dvh - 92px);
  border-radius: 8px;
  padding: 14px;
}

.task-detail-panel h2 {
  font-size: 18px;
  line-height: 1.24;
}

.task-facts {
  grid-template-columns: 1fr;
}

.source-detail {
  padding: 10px;
}

.task-facts div,
.source-detail {
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #fafafc;
}

.detail-actions.vertical .outline-button,
.detail-actions.vertical .primary-button,
.detail-actions.vertical .danger-link {
  min-height: 40px;
}

.task-detail-edit input,
.task-detail-edit textarea,
.task-detail-edit select,
.task-dialog-form input,
.task-dialog-form textarea,
.task-dialog-form select,
.slack-auth-card input,
.settings-mini-form input,
.settings-form-row input,
.settings-form-row select,
.dialog-form input,
.dialog-form textarea,
.dialog-form select {
  min-height: 44px;
  border-color: rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
}

.task-detail-edit input:hover,
.task-detail-edit textarea:hover,
.task-detail-edit select:hover,
.task-dialog-form input:hover,
.task-dialog-form textarea:hover,
.task-dialog-form select:hover,
.settings-form-row input:hover,
.settings-form-row select:hover,
.dialog-form input:hover,
.dialog-form textarea:hover,
.dialog-form select:hover {
  border-color: rgba(0, 102, 204, 0.32);
}

.settings-sidebar {
  padding: 18px;
}

.settings-workspace-card {
  background: #fff;
}

.settings-nav {
  gap: 6px;
  margin: 18px 0;
}

.settings-nav a,
.settings-nav button {
  min-height: 42px;
  border-radius: 10px;
}

.settings-nav a.active,
.settings-nav a:hover,
.settings-nav button.active,
.settings-nav button:hover {
  background: rgba(74, 21, 75, 0.1);
  color: var(--rail);
}

.settings-main {
  padding: 24px;
}

.settings-hero {
  padding: 22px;
}

.settings-section {
  padding: 18px;
}

.lifecycle-strip article,
.team-grid article,
.settings-table article,
.search-results article,
.invite-list article {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fafafc;
}

.lifecycle-strip article {
  min-height: 86px;
  border-left: 3px solid rgba(74, 21, 75, 0.28);
}

.settings-table article:hover,
.search-results article:hover,
.invite-list article:hover {
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.team-picker-button {
  min-height: 44px;
  border-color: rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  color: #424245;
}

.team-picker-button::after {
  content: "\25BE";
}

.team-picker-panel {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.team-check {
  min-height: 40px;
  border-radius: 8px;
}

.project-status-tabs button {
  min-height: 38px;
  border-color: rgba(0, 0, 0, 0.1);
}

.project-status-tabs button.active,
.project-status-tabs button:hover {
  border-color: rgba(0, 102, 204, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-dialog {
  border-radius: 16px;
}

.dialog-shell {
  padding: 22px;
}

.dialog-head {
  align-items: center;
}

.dialog-actions {
  gap: 10px;
}

.workspace-auth {
  background: var(--soft);
}

.auth-hero-pane {
  background: var(--rail);
}

.auth-hero-pane h1,
.auth-hero-pane .workspace-mark + div h1 {
  color: #fff;
}

.auth-hero-pane .workspace-mark + div span {
  color: rgba(255, 255, 255, 0.82);
}

.auth-action-pane {
  background: var(--soft);
}

.workspace-mark,
.invite-icon {
  border-radius: 14px;
  background: #fff;
  color: var(--rail);
}

.auth-workspace-preview article {
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.auth-tabs a {
  min-height: 42px;
  border-color: rgba(0, 0, 0, 0.1);
  background: #fff;
}

.auth-tabs a.active,
.auth-tabs a:hover {
  border-color: rgba(0, 102, 204, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.toast {
  border-radius: 12px;
  background: rgba(29, 29, 31, 0.96);
  box-shadow: var(--shadow);
}

@media (max-width: 1380px) {
  .board-workspace .issue-board {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 1080px) {
  .slack-app {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .board-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .task-detail-panel {
    position: static;
    max-height: none;
  }

  .settings-main {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .top-bar {
    min-height: 58px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .top-link,
  .top-actions .icon-button {
    display: none;
  }

  .top-actions .profile-chip {
    display: inline-grid;
  }

  .top-link {
    min-height: 40px;
    padding: 0 10px;
  }

  .channel-header,
  .board-header {
    padding: 14px;
  }

  .project-summary,
  .topic-card-section,
  .topic-detail,
  .context-panel,
  .settings-hero,
  .settings-section,
  .task-detail-panel {
    border-radius: 8px;
  }

  .board-workspace .issue-board {
    grid-template-columns: 1fr;
  }

  .composer-shell {
    bottom: 8px;
    min-height: 132px;
    margin: 0 12px 12px;
  }

  .workspace-auth {
    grid-template-columns: 1fr;
  }

  .auth-hero-pane {
    min-height: auto;
  }
}

/* Board drawer refinement: details open on demand instead of consuming a board column. */
.board-workspace {
  grid-template-columns: 1fr;
  overflow: hidden;
}

.board-workspace .issue-board {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.task-detail-panel {
  position: fixed;
  top: 72px;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(380px, calc(100vw - 32px));
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 28px));
  transition: opacity 180ms ease, transform 220ms ease;
  backdrop-filter: blur(18px);
}

.task-detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.task-detail-panel .detail-panel-head {
  position: sticky;
  top: -16px;
  z-index: 2;
  margin: -16px -16px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.task-detail-panel h2 {
  font-size: 20px;
}

.task-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1380px) {
  .board-workspace .issue-board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  .board-workspace {
    overflow: auto;
  }

  .board-workspace .issue-board {
    grid-template-columns: 1fr;
  }

  .task-detail-panel {
    inset: auto 10px 10px;
    width: auto;
    max-height: 82dvh;
    border-radius: 16px;
    transform: translateY(calc(100% + 24px));
  }

  .task-detail-panel.is-open {
    transform: translateY(0);
  }

  .task-facts {
    grid-template-columns: 1fr;
  }
}

.sr-only-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.composer-bottom {
  align-items: center;
}

.composer-bottom button:not(.send-button) {
  width: 44px;
  height: 44px;
  min-width: 44px;
}

.send-button.icon-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.send-button.icon-send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(1px);
}

.send-button.icon-send:hover,
.send-button.icon-send:focus-visible {
  background: var(--accent-hover);
  color: #fff;
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 10px;
}

.attachment-tray[hidden] {
  display: none;
}

.attachment-chip,
.message-attachment {
  max-width: min(360px, 100%);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 102, 204, 0.16);
  border-radius: 999px;
  padding: 5px 8px 5px 10px;
  background: rgba(0, 102, 204, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.attachment-chip.image-chip {
  border-radius: 14px;
  padding: 6px 8px 6px 6px;
}

.attachment-chip.image-chip img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper-2);
}

.attachment-chip svg,
.message-attachment svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-chip > span,
.message-attachment > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip small,
.message-attachment small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.attachment-chip button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
}

.attachment-chip button:hover,
.attachment-chip button:focus-visible {
  background: rgba(215, 61, 50, 0.12);
  color: var(--red);
}

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

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

.message-image-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 180px));
  gap: 10px;
}

.message-image-attachment {
  min-height: 128px;
  display: grid;
  grid-template-rows: 112px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.message-image-attachment img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: var(--paper-2);
}

.message-image-attachment span {
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment:hover,
.message-attachment:focus-visible,
.message-image-attachment:hover,
.message-image-attachment:focus-visible {
  border-color: rgba(0, 102, 204, 0.32);
  background: rgba(0, 102, 204, 0.12);
}

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.reply-actions a,
.reply-actions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--paper);
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.reply-composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-attach {
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
}

.reply-attach svg,
.task-attachment-box svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.task-attachment-box {
  display: grid;
  gap: 10px;
}

.task-attachment-box .compact {
  width: max-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-attachment-tray,
.reply-attachment-tray {
  padding: 0;
}

.mention-popover {
  position: absolute;
  left: 14px;
  bottom: 62px;
  z-index: 70;
  width: min(420px, calc(100% - 28px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 54px rgba(29, 29, 31, 0.18);
  backdrop-filter: blur(18px);
}

.mention-popover[hidden] {
  display: none;
}

.mention-group {
  display: grid;
  gap: 4px;
}

.mention-group + .mention-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mention-group p {
  margin: 2px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mention-group button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  background: transparent;
  text-align: left;
}

.mention-group button:hover,
.mention-group button:focus-visible {
  background: rgba(0, 102, 204, 0.08);
}

.mention-group button > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--rail);
  color: #fff;
  font-weight: 900;
}

.mention-group strong {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.mention-group small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-empty {
  padding: 14px;
  color: var(--muted);
  font-weight: 750;
}

.analytics-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #f5f6f8;
}

.analytics-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(29, 39, 51, 0.1);
  padding: 22px;
  background: #fffdf9;
}

.analytics-brand {
  min-height: 74px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(29, 39, 51, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(29, 39, 51, 0.07);
}

.analytics-brand strong,
.analytics-brand span,
.analytics-note span {
  display: block;
}

.analytics-brand strong {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-brand span,
.analytics-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.analytics-nav {
  display: grid;
  gap: 8px;
}

.analytics-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 900;
}

.analytics-nav a:hover,
.analytics-nav a:focus-visible,
.analytics-nav a.active {
  background: var(--violet-soft);
  color: #4c0f50;
}

.analytics-note {
  margin-top: auto;
  border: 1px solid rgba(12, 102, 228, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: var(--accent-soft);
}

.analytics-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 950;
}

.analytics-main {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 28px;
}

.analytics-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(29, 39, 51, 0.1);
  border-radius: 8px;
  padding: 20px 22px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(29, 39, 51, 0.07);
}

.analytics-header p,
.panel-heading p {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.analytics-header h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

.analytics-header span,
.panel-heading span {
  color: var(--muted);
  font-weight: 750;
}

.analytics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  border: 1px solid rgba(29, 39, 51, 0.12);
  border-radius: 999px;
  padding: 4px;
  background: var(--paper-2);
}

.segmented-control button {
  min-width: 58px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(12, 102, 228, 0.22);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 120px;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(29, 39, 51, 0.1);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(29, 39, 51, 0.06);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 850;
}

.metric-card strong {
  margin: 6px 0;
  font-size: 34px;
  line-height: 1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.analytics-grid.lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-panel {
  min-width: 0;
  border: 1px solid rgba(29, 39, 51, 0.1);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(29, 39, 51, 0.07);
}

.panel-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(29, 39, 51, 0.08);
  padding: 16px 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.chart-bars {
  min-height: 244px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  align-items: end;
  gap: 10px;
  overflow-x: auto;
  padding: 20px 18px 16px;
}

.chart-day {
  min-width: 34px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.chart-stack {
  height: 166px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.bar {
  width: 12px;
  min-height: 4px;
  display: block;
  border-radius: 999px 999px 4px 4px;
}

.bar.events {
  background: var(--accent);
}

.bar.users {
  background: var(--green);
}

.chart-day small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.event-rank-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.event-rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.event-rank-row > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 950;
}

.event-rank-row strong {
  display: block;
  margin-bottom: 7px;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-rank-row em {
  height: 7px;
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

.event-rank-row b {
  color: var(--ink);
  font-weight: 950;
}

.table-scroll {
  overflow: auto;
}

.recent-events-panel .table-scroll {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.recent-events-panel .analytics-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  border-bottom: 1px solid rgba(29, 39, 51, 0.08);
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
}

.analytics-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.analytics-table td {
  font-weight: 800;
}

.analytics-table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  min-height: 112px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(29, 39, 51, 0.18);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
}

.topic-node-icon {
  position: relative;
  flex: 0 0 auto;
  color: var(--rail);
}

.topic-node-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 24px;
  width: 1px;
  height: 22px;
  background: rgba(74, 21, 75, 0.18);
  transform: translateX(-50%);
}

.topic-copy small {
  display: flex;
  align-items: center;
  gap: 5px;
}

.topic-copy small span {
  color: #5f5664;
  font-weight: 850;
}

.topic-copy small i {
  color: #b2aab5;
  font-style: normal;
}

.topic-channel.active .topic-node-icon {
  color: var(--accent);
}

.topic-channel.is-archived .topic-node-icon::after {
  background: rgba(109, 101, 112, 0.18);
}

.conversation-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 304px);
  gap: 12px;
}

.context-panel {
  border-color: rgba(29, 39, 51, 0.08);
  background: #f8f9fc;
  box-shadow: none;
}

.context-panel .panel-title h2 {
  color: #35313a;
  font-size: 18px;
}

.context-panel .panel-title p,
.ai-card > p {
  color: #5d6f86;
}

.ai-card {
  background: rgba(255, 255, 255, 0.82);
}

.message-group {
  position: relative;
  margin: 0 12px;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 8px;
  padding: 14px 14px 14px 12px;
}

.message-group:hover {
  border-color: rgba(74, 21, 75, 0.08);
  background: #fbfbfd;
}

.message-group.highlighted {
  border-color: rgba(245, 158, 11, 0.24);
  border-left: 4px solid var(--amber);
}

.root-message {
  position: relative;
}

.message-level {
  width: fit-content;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(74, 21, 75, 0.12);
  border-radius: 999px;
  padding: 0 7px;
  margin-bottom: 5px;
  background: rgba(74, 21, 75, 0.06);
  color: var(--rail);
  font-size: 11px;
  font-weight: 900;
}

.reply-thread {
  position: relative;
  gap: 9px;
  margin: 10px 0 0 52px;
  padding-left: 24px;
  border-left: 0;
}

.reply-thread::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 26px;
  width: 2px;
  border-radius: 999px;
  background: rgba(74, 21, 75, 0.18);
}

.reply-thread.is-empty::before {
  bottom: 54px;
}

.thread-label {
  gap: 6px;
  background: rgba(74, 21, 75, 0.08);
  color: #5a255c;
}

.thread-label strong {
  font-weight: 950;
}

.reply {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  background: rgba(250, 250, 252, 0.9);
}

.reply::before,
.inline-reply::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 20px;
  width: 17px;
  height: 2px;
  background: rgba(74, 21, 75, 0.18);
}

.reply-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eee7ef;
  color: var(--rail);
  font-size: 12px;
  font-weight: 950;
}

.reply-copy {
  min-width: 0;
}

.reply-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.reply-meta span {
  color: var(--muted);
  font-size: 12px;
}

.reply-delete {
  margin-left: auto;
}

.inline-reply {
  position: relative;
}

.tab-row button[data-create-topic] {
  display: none;
}

@media (max-width: 1180px) {
  .analytics-app {
    grid-template-columns: 1fr;
  }

  .analytics-sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
  }

  .analytics-note {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-grid,
  .analytics-grid.lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .context-panel {
    position: static;
  }

  .reply-thread {
    margin-left: 30px;
    padding-left: 20px;
  }

  .confirm-shell {
    grid-template-columns: 1fr;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions .outline-button,
  .confirm-actions .danger-button {
    width: 100%;
  }

  .analytics-main {
    padding: 16px;
  }

  .analytics-header {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-actions {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .danger-button {
    transition: none;
  }
}

/* Responsive application shell: desktop sidebars become accessible drawers on tablets. */
.responsive-nav-toggle,
.responsive-drawer-head,
.responsive-drawer-links,
.analytics-mobile-bar,
.responsive-sidebar-backdrop {
  display: none;
}

.responsive-nav-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.responsive-sidebar-backdrop[hidden] {
  display: none !important;
}

/* The board filter rail has a variable number of sections and must never stretch one row. */
.board-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.board-sidebar > .sidebar-section {
  flex: 0 0 auto;
}

@media (max-width: 1288px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.responsive-nav-open {
    overflow: hidden;
  }

  img,
  video,
  canvas {
    max-width: 100%;
  }

  .responsive-nav-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: inline-grid;
    place-items: center;
  }

  .responsive-drawer-head {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: max(8px, env(safe-area-inset-top)) 14px 8px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }

  .responsive-drawer-head strong {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .responsive-drawer-head .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 44px;
  }

  [data-responsive-sidebar] {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 181 !important;
    width: min(360px, 88vw) !important;
    max-width: 88vw;
    height: 100dvh;
    min-height: 0;
    grid-column: auto !important;
    grid-row: auto !important;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff !important;
    box-shadow: 18px 0 48px rgba(29, 29, 31, 0.18);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  [data-responsive-sidebar].is-responsive-open {
    transform: translateX(0);
  }

  .responsive-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 180;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(22, 20, 24, 0.38);
    backdrop-filter: blur(3px);
  }

  .board-sidebar {
    gap: 12px;
    padding: 0 14px max(20px, env(safe-area-inset-bottom)) !important;
  }

  .board-sidebar .responsive-drawer-head {
    margin: 0 -14px;
  }

  .settings-sidebar,
  .analytics-sidebar {
    gap: 16px;
    padding: 0 16px max(20px, env(safe-area-inset-bottom)) !important;
  }

  .settings-sidebar .responsive-drawer-head,
  .analytics-sidebar .responsive-drawer-head {
    margin: 0 -16px;
  }

  .workspace-sidebar {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .workspace-sidebar .project-switcher {
    position: static;
    width: auto;
    max-height: none;
    margin: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
  }

  .responsive-drawer-links {
    display: grid;
    gap: 6px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .responsive-drawer-links a,
  .responsive-drawer-links button {
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: transparent;
    color: var(--ink);
    font-weight: 850;
    text-align: left;
  }

  .responsive-drawer-links a:hover,
  .responsive-drawer-links button:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .top-bar {
    grid-template-columns: 44px minmax(0, 1fr) max-content;
    gap: 10px;
    padding: 6px 12px;
  }

  .top-left {
    width: 44px;
    display: flex;
    align-items: center;
  }

  .top-left > :not(.responsive-nav-toggle) {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .top-link {
    min-width: auto;
    min-height: 40px;
    padding: 0 11px;
  }

  .slack-app,
  .board-app,
  .workspace-settings-app {
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .global-rail {
    display: none;
  }

  .channel-main,
  .board-main,
  .settings-main {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .channel-header {
    gap: 12px;
    padding: 10px 14px;
  }

  .channel-title {
    min-width: 220px;
  }

  .channel-actions {
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .channel-actions > * {
    flex: 0 0 auto;
  }

  .topic-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-layout {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 292px);
  }

  .board-main {
    grid-template-rows: auto auto auto auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .board-header {
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px 20px;
  }

  .board-header > div:first-child {
    flex: 1 1 320px;
    min-width: 0;
  }

  .board-header-actions {
    flex: 1 1 500px;
    flex-wrap: wrap;
  }

  .board-header-actions .primary-button {
    flex: 0 0 auto;
  }

  .board-stats {
    flex: 1 1 380px;
  }

  .board-toolbar {
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .people-overview {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 14px 16px 0;
  }

  .board-workspace {
    min-height: 0;
    overflow: visible;
    padding-bottom: 24px;
  }

  .board-workspace .issue-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .settings-main {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px;
  }

  .analytics-app {
    min-height: 100dvh;
    display: block;
  }

  .analytics-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
  }

  .analytics-mobile-bar strong {
    overflow: hidden;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .analytics-main {
    padding: 20px;
  }

  .analytics-grid,
  .analytics-grid.lower {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .top-bar {
    grid-template-columns: 44px minmax(0, 1fr) max-content;
    gap: 7px;
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 10px;
  }

  .global-search > span {
    display: none;
  }

  .top-actions .top-link,
  .top-actions > .icon-button {
    display: none;
  }

  .top-actions .language-switcher {
    min-height: 40px;
  }

  .profile-chip {
    width: 40px;
    height: 40px;
  }

  .profile-menu {
    position: fixed;
    top: 54px;
    right: max(8px, env(safe-area-inset-right));
    width: min(280px, calc(100vw - 16px));
  }

  .channel-main {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .channel-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .channel-title {
    width: 100%;
    min-width: 0;
  }

  .channel-title h1,
  .board-header h1,
  .settings-hero h1,
  .analytics-header h1 {
    font-size: 23px;
  }

  .channel-actions {
    width: 100%;
    padding-bottom: 2px;
  }

  .tab-row {
    gap: 18px;
    overflow-x: auto;
    padding-inline: 12px;
    scrollbar-width: none;
  }

  .tab-row::-webkit-scrollbar {
    display: none;
  }

  .tab-row a,
  .tab-row button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .channel-scroll {
    padding: 10px;
  }

  .project-summary,
  .topic-card-section,
  .topic-detail,
  .context-panel {
    padding: 14px;
  }

  .topic-card-grid,
  .conversation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-thread {
    margin-left: 18px;
    padding-left: 16px;
  }

  .message-group {
    margin-inline: 0;
    padding-inline: 8px;
  }

  .composer-shell {
    bottom: max(6px, env(safe-area-inset-bottom));
    min-height: 132px;
    margin: 0 8px max(8px, env(safe-area-inset-bottom));
    padding: 10px;
  }

  .composer-input textarea {
    font-size: 16px;
  }

  .composer-tools {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .composer-bottom {
    gap: 6px;
  }

  .composer-bottom > div {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .board-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .board-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .board-header-actions .primary-button {
    width: 100%;
  }

  .board-stats {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }

  .board-tabs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .board-tabs button {
    flex: 0 0 auto;
  }

  .board-filter-summary {
    justify-content: flex-start;
  }

  .people-overview,
  .board-workspace .issue-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .people-overview {
    padding: 10px 10px 0;
  }

  .board-workspace {
    padding: 10px;
  }

  .issue-column {
    min-width: 0;
  }

  .task-detail-panel {
    inset: auto max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    width: auto;
    max-height: min(82dvh, 720px);
  }

  .settings-main {
    padding: 10px;
  }

  .settings-hero,
  .settings-section {
    padding: 14px;
  }

  .settings-form-row,
  .task-form-grid,
  .team-grid,
  .agent-endpoint-grid,
  .lifecycle-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .settings-dialog {
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .settings-dialog .dialog-shell {
    max-height: calc(100dvh - env(safe-area-inset-top));
    overflow-y: auto;
    padding: 16px;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 8px -16px -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .analytics-main {
    gap: 12px;
    padding: 10px;
  }

  .analytics-header {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .analytics-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .analytics-table {
    min-width: 620px;
  }

  .auth-shell,
  .workspace-auth {
    width: 100%;
    min-width: 0;
  }

  .auth-form-pane,
  .auth-hero-pane {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-responsive-sidebar] {
    transition: none;
  }
}
