:root {
  --midnight: #07223a;
  --midnight-soft: #12314c;
  --yellow: #f8a809;
  --paper: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #f5f6f8;
  --panel: #f9fafb;
  --line: #e1e5ea;
  --line-strong: #cfd6df;
  --success: #16794c;
  --warning: #946200;
  --danger: #b42318;
  --blue: #1f6feb;
  --purple: #7057ff;
  --shadow: 0 14px 34px rgba(7, 34, 58, 0.08);
  --shadow-soft: 0 1px 2px rgba(7, 34, 58, 0.08);
  --focus-ring: 0 0 0 3px rgba(248, 168, 9, 0.24);
  --radius: 8px;
  --radius-sm: 6px;
  --rail-bg: #071421;
  --rail-text: rgba(255, 255, 255, 0.72);
  --rail-active: rgba(255, 255, 255, 0.12);
  --side-bg: #eef2f6;
  --side-text: #253244;
  --side-hover: #e3e8ef;
  --composer-bg: #182332;
  --composer-panel: #202d3d;
  --composer-text: #f7f7f4;
  --composer-muted: #b9c2cf;
  --composer-border: #3a4859;
}

body.theme-light {
  --rail-bg: #ffffff;
  --rail-text: #4c535f;
  --rail-active: #eef2f6;
  --side-bg: #eef2f6;
  --side-text: #253244;
  --side-hover: #e3e8ef;
  --composer-bg: #ffffff;
  --composer-panel: #f6f8fa;
  --composer-text: #111827;
  --composer-muted: #747985;
  --composer-border: #cfd6df;
  --top-bg: #ffffff;
  --workspace-bg: #f5f6f8;
  --surface-bg: #ffffff;
  --message-bg: #eef2f6;
  --message-alt-bg: #fff5da;
  --table-head-bg: #f3f6f9;
}

body.theme-dark {
  --rail-bg: #061421;
  --rail-text: rgba(255, 255, 255, 0.72);
  --rail-active: rgba(248, 168, 9, 0.16);
  --side-bg: #101926;
  --side-text: #eef3f8;
  --side-hover: rgba(255, 255, 255, 0.08);
  --composer-bg: #162232;
  --composer-panel: #1f2c3d;
  --composer-text: #f7f7f4;
  --composer-muted: #b9c2cf;
  --composer-border: #3a4859;
  --top-bg: #0d1825;
  --workspace-bg: #0a111b;
  --surface-bg: #111c29;
  --message-bg: #1b2a3b;
  --message-alt-bg: #302817;
  --table-head-bg: #172434;
  --paper: #111c29;
  --ink: #f4f6f8;
  --muted: #b9c3d0;
  --soft: #0a111b;
  --panel: #0f1a27;
  --line: #253447;
  --line-strong: #3c4b5f;
  --success: #7ee2a8;
  --warning: #ffd27a;
  --danger: #ff9a91;
  --blue: #9dc1ff;
  --purple: #b9acff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.22);
}

body.theme-dark .strip-button:not(.muted),
body.theme-dark .secondary-button,
body.theme-dark .subnav-item.is-active,
body.theme-dark .project-view-toggle.is-active {
  color: #ffffff;
}

body.theme-dark .member-card strong,
body.theme-dark .channel-item.is-active {
  color: #ffffff;
}

.members-page,
.profile-page { max-width: 1180px; margin: 0 auto; }
.members-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.members-hero h2, .profile-form h2 { margin: 6px 0 8px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.members-hero p, .profile-form > div:first-child p { color: var(--muted); max-width: 700px; margin: 0; }
.member-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.member-search { flex: 1; max-width: 560px; display: grid; gap: 7px; font-weight: 700; }
.member-search input { width: 100%; }
.member-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.member-profile-card { display: flex; flex-direction: column; min-height: 300px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-strong); }
.member-card-heading { display: flex; align-items: center; gap: 14px; }
.member-card-heading h3 { margin: 0 0 7px; }
.member-avatar { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 16px; color: #101827; background: var(--yellow); font-weight: 900; font-size: 1.05rem; }
.member-card-details { display: grid; gap: 8px; margin: 20px 0 12px; }
.member-card-details div { display: grid; grid-template-columns: 74px 1fr; gap: 8px; }
.member-card-details dt { color: var(--muted); font-size: .82rem; font-weight: 700; }
.member-card-details dd { margin: 0; }
.member-profile-card > p { color: var(--muted); line-height: 1.55; }
.member-card-actions { margin-top: auto; padding-top: 18px; }
.muted-label { color: var(--muted); font-size: .86rem; }
.profile-form { display: grid; gap: 20px; max-width: 760px; margin: 24px auto; }
.profile-form > label:not(.checkbox-line) { display: grid; gap: 8px; font-weight: 700; }
.profile-form textarea { resize: vertical; }
.error-text { color: #e97171; }
@media (max-width: 820px) { .members-hero, .member-toolbar { align-items: stretch; flex-direction: column; } .member-search { max-width: none; } }

body.theme-dark .avatar {
  background: var(--yellow);
  color: var(--midnight);
}

body.theme-dark .badge {
  background: rgba(48, 209, 123, 0.18);
  color: #7ee2a8;
}

body.theme-dark .badge.warning {
  background: rgba(248, 168, 9, 0.2);
  color: #ffd27a;
}

body.theme-dark .badge.danger {
  background: rgba(255, 94, 82, 0.18);
  color: #ff9a91;
}

body.theme-dark .score-pill {
  background: rgba(118, 168, 255, 0.18);
  color: #9dc1ff;
}

body.theme-dark .ai-note {
  background: #fff9eb;
  color: #423622;
}

body.theme-dark .ai-note p {
  color: #423622;
}

body.theme-dark .community-sidebar {
  background: linear-gradient(180deg, #101b29, #0c1521);
}

body.theme-dark .workspace-nav-item::before,
body.theme-dark .channel-item::before {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: #f7f7f4;
}

body.theme-dark .workspace-nav-item:hover,
body.theme-dark .workspace-nav-item.is-active,
body.theme-dark .channel-item:hover,
body.theme-dark .channel-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.theme-dark .workspace-nav-item.is-active::before,
body.theme-dark .channel-item.is-active::before {
  border-color: transparent;
  background: var(--yellow);
  color: var(--midnight);
}

body.theme-dark .channel-item.is-locked {
  opacity: 1;
  color: #ccd6e2;
}

body.theme-dark .channel-pin-button,
body.theme-dark .sidebar-action {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--side-text);
}

body.theme-dark .channel-pin-button:hover,
body.theme-dark .channel-pin-button:focus-visible,
body.theme-dark .sidebar-action:hover {
  border-color: rgba(248, 168, 9, 0.72);
  background: rgba(248, 168, 9, 0.14);
  color: #ffffff;
}

body.theme-dark .locked-menu-message a,
body.theme-dark .unlocked-menu-content a,
body.theme-dark .access-popover a {
  color: #ffd27a;
}

body.theme-dark .secondary-button,
body.theme-dark .strip-button:not(.muted) {
  border-color: rgba(255, 255, 255, 0.14);
  background: #12314c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Cabin", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.48;
}

.billing-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148, 98, 0, 0.28);
  background: #fff4d6;
  color: #4a3000;
  font-weight: 600;
}

.billing-banner[hidden] {
  display: none;
}

body:not(.is-authenticated) .trial-strip,
body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .billing-banner {
  display: none;
}

body.is-authenticated .trial-strip {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

.confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 20, 33, 0.58);
}

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

.confirmation-dialog {
  width: min(100%, 420px);
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(7, 20, 33, 0.28);
}

.confirmation-dialog h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.manual-override-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

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

.manual-override-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.manual-override-form input,
.manual-override-form select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
}

.manual-override-form .wide-field {
  grid-column: span 2;
}

.form-status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
}

.admin-access-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-access-record {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.admin-access-record dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.admin-access-record dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-access-record dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 440px);
  align-items: center;
  gap: 36px;
  padding: clamp(22px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(248, 168, 9, 0.16), transparent 34%),
    var(--workspace-bg, var(--soft));
}

.login-brand {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.login-brand .rail-logo {
  width: 52px;
  height: 52px;
  margin: 0;
}

.login-brand h1 {
  font-size: clamp(2rem, 6vw, 4.6rem);
  max-width: 780px;
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-panel h2 {
  font-size: 1.3rem;
}

.login-panel p {
  margin-bottom: 0;
}

.login-actions {
  display: grid;
  gap: 10px;
}

.login-actions .primary-button,
.login-actions .secondary-button {
  width: 100%;
}

.login-message {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.88rem;
}

.login-message.error {
  border-color: rgba(180, 35, 24, 0.34);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.login-note {
  font-size: 0.82rem;
}

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

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea,
[contenteditable="true"] {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.trial-strip {
  height: 54px;
  display: grid;
  grid-template-columns: 286px minmax(220px, 560px) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.workspace-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-name span {
  color: var(--muted);
}

.workspace-name strong {
  color: var(--ink);
  font-weight: 700;
}

.global-search {
  height: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-bg) 82%, var(--workspace-bg));
  color: var(--muted);
}

.global-search span {
  font-size: 0.8rem;
  font-weight: 600;
}

.global-search input {
  border: 0;
  background: transparent;
  padding: 0;
}

.global-search input:focus {
  outline: none;
}

.strip-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--midnight);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--midnight);
  color: var(--paper);
  font-weight: 700;
}

.strip-button.muted {
  border-color: var(--line-strong);
  background: var(--surface-bg);
  color: var(--ink);
}

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

body.nav-collapsed .app-shell {
  grid-template-columns: 78px minmax(0, 1fr);
}

.app-rail {
  display: none;
}

.rail-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--yellow), #ffd56b);
  color: var(--midnight);
  font-weight: 700;
  margin-bottom: 7px;
}

.rail-icon {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--rail-text);
  font-weight: 700;
}

.rail-icon:hover,
.rail-icon.is-active {
  background: var(--rail-active);
  color: var(--composer-text);
  transform: translateY(-1px);
}

.mode-toggle {
  width: 44px;
  font-size: 0.68rem;
}

.rail-spacer {
  flex: 1;
}

.community-sidebar {
  background: color-mix(in srgb, var(--side-bg) 76%, #ffffff);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

body.nav-collapsed .community-sidebar {
  align-items: center;
  padding: 18px 10px;
}

.brand-block {
  width: 100%;
  padding: 0 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

body.nav-collapsed .brand-block {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.brand-name {
  color: var(--side-text);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.sidebar-mode-toggle {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--paper);
  color: var(--midnight);
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-toggle {
  min-width: 44px;
}

.sidebar-actions {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sidebar-action {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--side-text);
  font-weight: 600;
}

body.nav-collapsed .sidebar-actions {
  width: 100%;
  align-items: center;
  justify-items: center;
}

body.nav-collapsed .sidebar-action {
  width: 52px;
  min-height: 38px;
  padding: 0;
  font-size: 0;
}

body.nav-collapsed .sidebar-action::before {
  content: attr(data-short);
  font-size: 0.78rem;
  font-weight: 700;
}

body.theme-dark .sidebar-mode-toggle {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.member-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-soft);
}

body.nav-collapsed .brand-name,
body.nav-collapsed .brand-tagline,
body.nav-collapsed .member-card,
body.nav-collapsed .channel-section-title {
  display: none;
}

.workspace-nav {
  width: 100%;
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.workspace-nav-item {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--side-text);
  text-align: left;
  font-weight: 600;
}

.workspace-nav-item[hidden],
.channel-section[hidden],
.channel-item[hidden],
.rail-icon[hidden],
.strip-button[hidden],
.primary-button[hidden],
.secondary-button[hidden],
.composer[hidden],
.channel-access-note[hidden],
.free-upgrade-panel[hidden],
.free-header-links[hidden] {
  display: none !important;
}

.workspace-nav-item::before,
.channel-item::before {
  content: attr(data-short);
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface-bg) 82%, var(--side-bg));
  color: var(--midnight);
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-nav-item:hover,
.workspace-nav-item.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.workspace-nav-item[aria-disabled="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.workspace-nav-item.is-active::before,
.channel-item.is-active::before {
  background: var(--yellow);
  color: var(--midnight);
}

body.nav-collapsed .workspace-nav,
body.nav-collapsed .channel-nav {
  width: 100%;
}

body.nav-collapsed .workspace-nav-item,
body.nav-collapsed .channel-item {
  justify-content: center;
  min-height: 44px;
  padding: 0;
  font-size: 0;
}

body.nav-collapsed .workspace-nav-item::before,
body.nav-collapsed .channel-item::before {
  margin: 0;
}

body.theme-dark .member-card,
body.theme-dark .channel-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.11);
}

body.theme-dark .member-card strong,
body.theme-dark .channel-item.is-active {
  color: var(--paper);
}

.member-card strong {
  color: var(--midnight);
}

.member-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.channel-nav {
  display: grid;
  gap: 14px;
  overflow: auto;
}

.channel-section {
  display: grid;
  gap: 2px;
}

.channel-section-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 10px 6px;
}

.channel-item {
  width: 100%;
  border: 0;
  color: var(--side-text);
  background: transparent;
  text-align: left;
  min-height: 36px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.channel-item-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.channel-item-copy > span,
.channel-item-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.channel-item-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.channel-pin-button {
  margin-left: auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 7px;
  background: color-mix(in srgb, var(--surface-bg) 82%, var(--side-bg));
  color: var(--side-text);
  font-size: 0.7rem;
  font-weight: 800;
}

.channel-pin-button:hover,
.channel-pin-button:focus-visible {
  border-color: rgba(248, 168, 9, 0.72);
  background: color-mix(in srgb, var(--yellow) 16%, var(--surface-bg));
  color: var(--ink);
}

.channel-item.is-pinned {
  min-height: 48px;
  align-items: center;
}

.channel-item:hover {
  background: var(--side-hover);
}

.channel-item.is-locked {
  opacity: 0.74;
  border: 1px dashed color-mix(in srgb, var(--side-text) 24%, transparent);
}

.channel-item.is-active {
  color: var(--midnight);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--yellow);
  font-weight: 700;
}

.locked-access-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0 6px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--side-text) 18%, transparent);
  border-radius: var(--radius-sm);
  background: var(--yellow);
  color: var(--midnight);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.locked-access-card:hover {
  border-color: color-mix(in srgb, var(--yellow) 56%, transparent);
  background: var(--paper);
  color: var(--ink);
}

.locked-access-card.secondary {
  background: color-mix(in srgb, var(--surface-bg) 76%, var(--side-bg));
  color: var(--side-text);
}

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

.access-popover {
  position: fixed;
  z-index: 1200;
  width: min(280px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(248, 168, 9, 0.44);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(7, 20, 33, 0.2);
}

.access-popover strong {
  color: var(--ink);
}

.access-popover a {
  color: var(--midnight);
  font-weight: 800;
}

.main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface-bg);
  overflow: hidden;
}

.topbar {
  position: relative;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 34px;
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  box-shadow: var(--shadow-soft);
}

.topbar-main {
  flex: 1 1 260px;
  min-width: 180px;
  padding-bottom: 0;
}

.topbar-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.topbar-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.free-header-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-logo-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--yellow);
  color: var(--midnight);
  font-size: 0.92rem;
}

.topbar-logo-text {
  white-space: nowrap;
  font-size: 0.94rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.7rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

h3 {
  color: var(--ink);
  font-size: 0.98rem;
  margin-bottom: 0;
}

h4 {
  color: var(--ink);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.top-menu {
  flex: 2 1 620px;
  display: flex;
  gap: 6px;
  align-self: center;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
  flex-wrap: wrap;
}

.top-menu-group {
  position: relative;
}

.top-menu-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.top-menu-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}

.top-menu-item:hover,
.top-menu-item.is-active {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--yellow) 42%, transparent);
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
}

.top-menu-group.is-locked .top-menu-item::after,
.channel-item.is-locked::after {
  content: "Locked";
  margin-left: auto;
  color: var(--warning);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(620px, calc(100vw - 32px));
  display: none;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(7, 20, 33, 0.18);
}

.compact-menu {
  width: min(360px, calc(100vw - 32px));
}

.wide-menu {
  width: min(760px, calc(100vw - 32px));
}

.top-menu-group:not(.is-click-closed):hover .mega-menu,
.top-menu-group:not(.is-click-closed):focus-within .mega-menu,
.top-menu-group.is-open .mega-menu {
  display: block;
}

.top-menu-group.is-locked .unlocked-menu-content,
.top-menu-group.is-unlocked .locked-menu-message {
  display: none;
}

.top-menu-group.is-unlocked .locked-only-menu {
  display: none !important;
}

.locked-menu-message,
.unlocked-menu-content {
  display: grid;
  gap: 10px;
}

.locked-menu-message {
  padding: 12px;
  border: 1px solid rgba(248, 168, 9, 0.38);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--yellow) 12%, var(--paper));
}

.locked-menu-message strong,
.unlocked-menu-content strong,
.mega-link {
  color: var(--ink);
}

.locked-menu-message a,
.unlocked-menu-content a {
  color: var(--midnight);
  font-weight: 800;
}

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

.mega-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.mega-grid span,
.member-directory-mini span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.mega-link {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-bg);
  text-align: left;
  padding: 0 10px;
  font-weight: 700;
}

.mega-link:hover {
  border-color: rgba(248, 168, 9, 0.72);
  background: color-mix(in srgb, var(--yellow) 10%, var(--surface-bg));
}

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

.member-directory-mini {
  display: grid;
  gap: 7px;
}

.member-directory-mini a {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-bg);
}

.view {
  display: none;
  padding: 28px 34px 34px;
  background: var(--soft);
  overflow: auto;
  min-height: 0;
}

.view.is-visible {
  display: block;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.panel-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-actions-row:empty {
  display: none;
}

.heading-actions,
.detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.subnav {
  display: inline-flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.subnav-item {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.subnav-item.is-active {
  background: var(--midnight);
  color: var(--paper);
}

.meeting-subview {
  display: none;
}

.meeting-subview.is-visible {
  display: block;
}

.channel-layout {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

body.is-admin .channel-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.channel-panel {
  position: relative;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.theme-dark .channel-panel {
  background: var(--surface-bg);
}

.channel-admin-panel {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  overflow: auto;
}

#channels.view.is-visible {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-stack,
.compact-form {
  display: grid;
  gap: 12px;
}

.compact-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compact-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.compact-form input,
.compact-form select,
.compact-form textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
}

.compact-form textarea {
  min-height: 74px;
  resize: vertical;
}

.compact-form .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-form .checkbox-line input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.access-result {
  min-height: 36px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 0.82rem;
}

.attachment-file {
  display: grid;
  place-items: center;
  height: 92px;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
}

.message-list {
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface-bg), var(--workspace-bg));
}

.message-empty-state {
  align-self: center;
  justify-self: center;
  max-width: 420px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.channel-access-note {
  margin: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  background: color-mix(in srgb, var(--yellow) 10%, var(--surface-bg));
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.free-upgrade-panel {
  display: grid;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-bg);
}

.upgrade-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--yellow) 36%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 88%, var(--yellow));
  box-shadow: 0 0 32px color-mix(in srgb, var(--yellow) 18%, transparent);
}

.upgrade-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.upgrade-hero h3 {
  margin-bottom: 6px;
}

.upgrade-hero p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.upgrade-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.glow-button {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--yellow) 36%, transparent), 0 0 22px color-mix(in srgb, var(--yellow) 40%, transparent);
}

.events-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
}

.humanitix-page-widget {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-bg);
}

.humanitix-page-widget iframe {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
}

.message {
  width: min(760px, 86%);
  padding: 13px 14px;
  display: grid;
  gap: 5px;
  background: var(--message-bg);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.message.is-other {
  margin-right: auto;
  background: var(--message-bg);
}

.message.is-own {
  margin-left: auto;
  background: var(--message-alt-bg);
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.message-author {
  color: color-mix(in srgb, var(--yellow) 52%, var(--ink));
  font-weight: 700;
}

.message-time {
  color: var(--muted);
  font-size: 0.8rem;
}

.message p,
.message-body {
  margin-bottom: 0;
  color: var(--ink);
}

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

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

.message-body blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
}

.message-body pre {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #111821;
  color: #f7f7f4;
  overflow: auto;
}

.mention-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--yellow) 44%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--yellow) 16%, var(--surface-bg));
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.message-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, var(--line));
  border-radius: var(--radius-sm);
  padding: 0 9px;
  background: color-mix(in srgb, var(--surface-bg) 86%, transparent);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.message-action:hover:not(:disabled),
.message-action.is-active {
  border-color: color-mix(in srgb, var(--yellow) 64%, var(--line));
  background: color-mix(in srgb, var(--yellow) 22%, var(--surface-bg));
}

.message-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.message-action.is-danger {
  border-color: color-mix(in srgb, #b42318 36%, var(--line));
  color: #b42318;
}

.message-action.is-danger:hover:not(:disabled) {
  border-color: #b42318;
  background: color-mix(in srgb, #b42318 10%, var(--surface-bg));
}

.message-comment-owner-actions {
  margin-top: 1px;
}

.reaction-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.reaction-icon.is-down {
  transform: rotate(180deg);
}

.message-comments {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, var(--line));
}

.message-comment {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-left: 3px solid color-mix(in srgb, var(--yellow) 58%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-bg) 82%, transparent);
}

.message-comment-form {
  display: grid;
  gap: 8px;
}

.message-comment-form[hidden] {
  display: none;
}

.message-comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-bg);
  color: var(--ink);
  font: inherit;
}

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

.message-attachments,
.attachment-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.message-attachments {
  margin-top: 8px;
}

.message-attachments figure,
.attachment-preview figure {
  margin: 0;
  position: relative;
  width: 138px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-bg);
}

.message-attachments img,
.message-attachments video,
.attachment-preview img,
.attachment-preview video {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  background: var(--workspace-bg);
}

.message-attachments figcaption,
.attachment-preview figcaption {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 24px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: rgba(7, 34, 58, 0.9);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
}

.composer {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-bg);
  box-shadow: 0 -14px 28px rgba(7, 34, 58, 0.12);
}

.rich-composer {
  grid-template-columns: 1fr;
}

.rich-composer.is-expanded {
  position: relative;
  z-index: 2;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--composer-border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--composer-bg);
}

.tool-button,
.footer-icon,
.send-icon-button {
  min-height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 9px;
  background: transparent;
  color: var(--composer-text);
  font-weight: 700;
}

.tool-button:hover,
.footer-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.danger-tool {
  margin-left: auto;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: color-mix(in srgb, var(--composer-text) 22%, transparent);
  margin: 0 5px;
}

.message-editor {
  min-height: 44px;
  max-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--composer-border);
  border-top: 0;
  border-bottom: 0;
  background: var(--composer-bg);
  color: var(--composer-text);
  outline: 0;
  line-height: 1.55;
  overflow: auto;
  transition: min-height 160ms ease, max-height 160ms ease;
}

.rich-composer.is-expanded .message-editor {
  min-height: 330px;
  max-height: min(54vh, 520px);
  padding: 14px;
}

.rich-composer:not(.is-expanded) .message-editor {
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.message-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--composer-muted);
}

.mention-menu {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
  padding: 7px;
  border-left: 1px solid var(--composer-border);
  border-right: 1px solid var(--composer-border);
  background: var(--composer-panel);
  color: var(--composer-text);
}

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

.mention-menu p {
  margin: 0;
  padding: 8px;
  color: var(--composer-muted);
  font-size: 0.82rem;
}

.mention-menu button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  background: transparent;
  color: var(--composer-text);
  text-align: left;
}

.mention-menu button:hover {
  background: color-mix(in srgb, var(--yellow) 18%, transparent);
}

.mention-menu button span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--midnight);
  font-size: 0.72rem;
  font-weight: 900;
}

.mention-menu button strong,
.mention-menu button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-menu button small {
  color: var(--composer-muted);
  font-size: 0.74rem;
}

.message-editor:focus,
.message-editor.is-dragging {
  box-shadow: inset 0 -2px 0 var(--yellow);
}

.message-editor.is-dragging {
  outline: 2px dashed var(--yellow);
  outline-offset: -9px;
  background: color-mix(in srgb, var(--composer-bg) 88%, var(--yellow));
}

.message-editor blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
  color: var(--composer-muted);
}

.message-editor pre {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #111821;
  color: #f7f7f4;
}

.image-dropzone {
  display: none;
  position: relative;
  min-height: 86px;
  border: 1px dashed var(--composer-border);
  border-top: 0;
  background: var(--composer-panel);
  color: var(--composer-text);
  padding: 16px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.image-dropzone.is-visible {
  display: flex;
}

.image-dropzone.is-dragging {
  background: #332a13;
  border-color: var(--yellow);
}

.image-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-dropzone strong,
.image-dropzone span {
  display: block;
}

.image-dropzone span {
  margin-top: 4px;
  color: var(--composer-muted);
  font-size: 0.86rem;
}

.attachment-preview {
  padding: 10px;
  border-left: 1px solid var(--composer-border);
  border-right: 1px solid var(--composer-border);
  background: var(--composer-bg);
}

.attachment-preview:empty {
  display: none;
}

.composer-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--composer-border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--composer-bg);
}

.composer-status {
  flex: 1 1 180px;
  margin: 0 4px 0 auto;
  color: var(--composer-muted);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: right;
}

.composer-status:empty {
  display: none;
}

.composer-status.error {
  color: #ffcf99;
}

.composer-status.success {
  color: #b9e7b4;
}

.send-icon-button {
  background: var(--yellow);
  color: var(--midnight);
  padding: 0 13px;
}

.composer-size-toggle {
  border: 1px solid color-mix(in srgb, var(--composer-text) 18%, transparent);
}

.rich-composer.is-expanded .composer-size-toggle {
  background: var(--yellow);
  color: var(--midnight);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 16px;
  align-items: start;
}

.table-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.table-toolbar span {
  margin-right: auto;
  color: var(--ink);
  font-weight: 700;
}

.data-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-bg);
  box-shadow: var(--shadow-soft);
}

.table-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) 120px 105px minmax(150px, 0.8fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-bg);
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
}

.table-row > span {
  min-width: 0;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  background: var(--table-head-bg);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-row:hover,
.project-row.is-selected {
  background: color-mix(in srgb, var(--yellow) 13%, var(--surface-bg));
}

.project-row.is-selected {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.project-view-toggle.is-active {
  background: var(--midnight);
  border-color: var(--midnight);
  color: var(--paper);
}

.project-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.project-detail-form,
.project-note-form,
.project-notes,
.project-commitments {
  display: grid;
  gap: 12px;
}

.project-detail-form label,
.project-note-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.project-detail-form input,
.project-detail-form select,
.project-detail-form textarea,
.project-note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-bg);
  color: var(--ink);
  padding: 10px 11px;
  font: inherit;
}

.project-detail-form textarea,
.project-note-form textarea {
  min-height: 92px;
  resize: vertical;
}

.project-notes,
.project-commitments {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.project-notes h4,
.project-commitments h4 {
  margin: 0;
}

.note-list,
.project-commitments {
  display: grid;
  gap: 10px;
}

.note-list article,
.project-commitments article {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--panel);
}

.note-list article span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.note-list article p,
.project-commitments article p {
  margin: 5px 0 0;
}

.project-commitments article {
  display: grid;
  gap: 7px;
}

.project-commitments article span {
  justify-self: start;
}

.muted-text {
  color: var(--muted);
  margin: 0;
}

.danger-button {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface-bg));
  color: var(--danger);
}

.board-column {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px;
}

.board-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 4px 8px;
  color: var(--ink);
}

.board-column-heading span {
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--yellow) 18%, var(--surface-bg));
  color: var(--warning);
  font-size: 0.74rem;
  font-weight: 700;
}

.board-card-list {
  display: grid;
  gap: 10px;
}

.board-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-bg);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.board-card:hover,
.board-card.is-selected {
  border-color: rgba(248, 168, 9, 0.72);
  box-shadow: inset 3px 0 0 var(--yellow);
}

.board-card p {
  margin-bottom: 10px;
}

.board-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.board-card dl div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
}

.board-card dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.board-card dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.32;
}

.board-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  min-height: 82px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
}

.table-row strong {
  display: block;
  color: var(--ink);
}

.table-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.detail-pane {
  position: sticky;
  top: 18px;
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 420px;
  box-shadow: var(--shadow-soft);
}

.detail-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.detail-header p {
  margin: 4px 0 0;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--midnight);
  font-weight: 700;
}

.record-fields {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.record-fields div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.record-fields dt {
  color: var(--muted);
}

.record-fields dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.38;
  font-weight: 600;
}

.ai-note {
  margin-top: 14px;
  border: 1px solid rgba(248, 168, 9, 0.45);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff9eb;
}

.ai-note span {
  display: block;
  color: var(--warning);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ai-note p {
  margin-bottom: 0;
  color: #423622;
}

.meeting-grid,
.one-to-one-layout {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.meeting-grid {
  grid-template-columns: minmax(440px, 1fr) 380px;
}

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

.one-to-one-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
}

.item-list,
.meeting-stack,
.meeting-list,
.agenda-list {
  display: grid;
  gap: 10px;
}

.item-card,
.meeting-row,
.connection-card,
.course-card {
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.meeting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: start;
}

.meeting-row.is-selected {
  background: color-mix(in srgb, var(--yellow) 13%, var(--surface-bg));
  border-color: rgba(248, 168, 9, 0.72);
  box-shadow: inset 3px 0 0 var(--yellow);
}

.meeting-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.meeting-row h3 {
  margin: 5px 0 7px;
}

.meeting-row p {
  margin-bottom: 0;
}

.meeting-row-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.agenda-list article {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.agenda-list span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--midnight);
  font-weight: 700;
}

.agenda-list strong {
  color: var(--ink);
}

.agenda-list p {
  margin-bottom: 0;
}

.meeting-detail-panel,
.form-page {
  max-width: 1040px;
}

.qna-layout {
  display: grid;
  gap: 16px;
  max-width: 1120px;
}

.qna-date-list,
.qna-recording-list {
  display: grid;
  gap: 12px;
}

.qna-date-card,
.qna-recording-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-bg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.qna-date-card h3,
.qna-recording-card h3 {
  margin: 5px 0 7px;
}

.qna-date-card p,
.qna-recording-card p {
  margin-bottom: 0;
}

.qna-date-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.qna-recording-card {
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
}

.qna-recording-copy {
  min-width: 0;
}

.qna-recording-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.compact-admin-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.item-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(22, 121, 76, 0.12);
  color: var(--success);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.warning {
  background: rgba(248, 168, 9, 0.18);
  color: var(--warning);
}

.badge.danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.score-pill {
  background: rgba(31, 111, 235, 0.12);
  color: var(--blue);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.form-grid label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

legend {
  padding: 0 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--yellow);
  box-shadow: var(--focus-ring);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--yellow);
}

.project-picker {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-weight: 600;
  color: var(--ink);
}

.check-row input {
  width: auto;
  margin-top: 3px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--yellow);
  color: var(--midnight);
  box-shadow: 0 8px 20px rgba(248, 168, 9, 0.18);
}

.primary-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.58;
}

.secondary-button[aria-disabled="true"],
.strip-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.58;
}

.secondary-button {
  background: var(--midnight);
  color: var(--paper);
}

.ghost-button {
  background: var(--surface-bg);
  color: var(--midnight);
  border-color: var(--line-strong);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.strip-button:hover,
.send-icon-button:hover {
  transform: translateY(-1px);
}

body.theme-dark .ghost-button {
  color: var(--ink);
}

.compact {
  min-height: 32px;
  padding: 0 11px;
}

.connection-list,
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card,
.brief-card,
.connection-detail,
.email-template-grid article,
.member-debug-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric-card strong {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 8px;
}

.metric-card p,
.brief-card p,
.connection-detail p,
.email-template-grid p,
.timeline p {
  margin-bottom: 0;
}

.commitment-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 14px;
  min-width: 0;
}

.commitment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 380px);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.commitment-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 12px 0 16px;
}

.commitment-filters label {
  margin: 0;
}

.commitment-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.commitment-form[hidden] {
  display: none;
}

.commitment-board section {
  display: grid;
  gap: 10px;
  align-content: start;
  border-radius: var(--radius);
  transition: background 150ms ease, outline-color 150ms ease;
  min-width: 0;
}

.commitment-board section.is-drop-target {
  background: color-mix(in srgb, var(--yellow) 9%, transparent);
  outline: 2px dashed rgba(248, 168, 9, 0.78);
  outline-offset: 6px;
}

.commitment-board h3 {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 0 4px;
}

.commitment-board h3 span {
  color: var(--muted);
  font-size: 0.82rem;
}

.commitment-card {
  appearance: none;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.commitment-card[draggable="true"] {
  cursor: grab;
}

.commitment-card[draggable="true"]:active {
  cursor: grabbing;
}

.commitment-card.is-selected {
  background: color-mix(in srgb, var(--yellow) 10%, var(--surface-bg));
  border-color: rgba(248, 168, 9, 0.72);
  box-shadow: inset 3px 0 0 var(--yellow), var(--shadow-soft);
}

.commitment-card.is-dragging {
  opacity: 0.55;
}

.commitment-card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.commitment-card-topline strong,
.commitment-card-topline span,
.commitment-card-project,
.commitment-card-footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.commitment-card-topline strong {
  line-height: 1.28;
}

.commitment-card-project {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.25;
}

.commitment-card-topline > span:not(.badge) {
  color: var(--ink);
  font-weight: 650;
}

.commitment-card p {
  margin: 0;
  line-height: 1.36;
}

.commitment-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.88rem;
}

.commitment-card-footer span {
  flex: 1 1 0;
}

.commitment-card-footer span:last-child {
  text-align: right;
}

.commitment-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.commitment-card-actions .primary-button,
.commitment-card-actions .secondary-button {
  flex: 1 1 120px;
}

.commitment-detail-pane {
  min-height: 360px;
}

.commitment-edit-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

@media (max-width: 1480px) {
  .commitment-layout {
    grid-template-columns: 1fr;
  }

  .commitment-detail-pane {
    position: static;
  }
}

.compact-fields {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}

.compact-fields div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.compact-fields dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.compact-fields dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
}

.coach-layout,
.admin-layout,
.debugger-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  align-items: start;
}

.coach-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}

.coach-summary-panel {
  min-height: 360px;
}

.coach-controls-panel,
.coach-member-detail {
  align-self: start;
}

.coach-member-panel {
  grid-column: 1 / 2;
}

.coach-member-detail {
  grid-column: 2 / 4;
}

.coach-group-list,
.coach-member-list {
  display: grid;
  gap: 10px;
}

.coach-group-card,
.coach-member-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-bg);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.coach-group-card {
  display: grid;
  gap: 7px;
  padding: 13px;
}

.coach-group-card strong {
  font-size: 1rem;
}

.coach-group-card small,
.coach-member-card small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.coach-group-card .badge {
  justify-self: start;
}

.coach-group-card:hover,
.coach-group-card.is-selected,
.coach-member-card:hover,
.coach-member-card.is-selected {
  border-color: rgba(248, 168, 9, 0.72);
  background: color-mix(in srgb, var(--yellow) 8%, var(--surface-bg));
}

.coach-group-card.is-selected,
.coach-member-card.is-selected {
  box-shadow: inset 3px 0 0 var(--yellow), var(--shadow-soft);
}

.coach-group-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.coach-group-summary p {
  max-width: 92ch;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1rem;
}

.coach-member-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.coach-member-card .avatar {
  width: 38px;
  height: 38px;
}

.coach-member-detail {
  display: grid;
  gap: 12px;
}

.coach-member-detail .brief-card {
  background: var(--surface-bg);
  box-shadow: none;
}

.brief-grid,
.connection-matrix,
.email-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brief-card {
  box-shadow: none;
  background: var(--surface-bg);
}

.brief-card ul,
.brief-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.brief-card li + li {
  margin-top: 7px;
}

.connection-detail {
  box-shadow: none;
  background: var(--surface-bg);
}

.editable-connection-card {
  cursor: pointer;
}

.editable-connection-card:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.connection-edit-form {
  margin-top: 14px;
  cursor: default;
}

.connection-detail code,
.panel-heading code {
  color: var(--ink);
  background: color-mix(in srgb, var(--yellow) 14%, var(--surface-bg));
  border: 1px solid rgba(248, 168, 9, 0.35);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.78rem;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-list .secondary-button {
  justify-content: flex-start;
}

.connection-summary {
  margin-top: 16px;
}

.email-template-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  box-shadow: none;
  background: var(--surface-bg);
}

.email-template-grid article p {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-bg);
}

.timeline .badge {
  margin-bottom: 8px;
}

.debugger-grid {
  grid-template-columns: 250px minmax(0, 1fr);
}

.member-debug-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: none;
  background: var(--surface-bg);
}

.member-debug-card .avatar {
  width: 62px;
  height: 62px;
}

.member-debug-card h3,
.member-debug-card p {
  margin-bottom: 0;
}

.access-fields {
  margin-top: 0;
}

.access-fields div {
  grid-template-columns: 160px minmax(0, 1fr);
}

.mini-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-row span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.detail-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.detail-section li + li {
  margin-top: 7px;
}

@media (max-width: 1180px) {
  .trial-strip {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 420px) auto auto;
  }

  .strip-button.muted {
    display: none;
  }

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

  body.nav-collapsed .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .app-rail {
    display: none;
  }

  .topbar {
    gap: 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .mega-menu {
    left: 0;
    right: auto;
  }

  .free-header-links {
    justify-content: flex-start;
    order: 4;
    width: 100%;
  }

  .workspace-grid,
  .meeting-grid,
  .qna-date-card,
  .qna-recording-card,
  .one-to-one-layout,
  .connection-list,
  .course-grid,
  .metric-grid,
  .channel-layout,
  .commitment-board,
  .commitment-layout,
  .commitment-filters,
  .coach-layout,
  .coach-workspace,
  .admin-layout,
  .debugger-grid {
    grid-template-columns: 1fr;
  }

  .coach-member-panel,
  .coach-member-detail {
    grid-column: auto;
  }

  .brief-grid,
  .connection-matrix,
  .email-template-grid,
  .upgrade-hero {
    grid-template-columns: 1fr;
  }

  .upgrade-actions {
    justify-content: flex-start;
  }

  .detail-pane {
    position: static;
  }

  body.is-admin .channel-layout {
    grid-template-columns: 1fr;
  }

  .channel-admin-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: auto;
  }

  #projects .data-table {
    display: grid;
    gap: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
    padding-left: 4px;
  }

  #projects .table-head {
    display: none;
  }

  #projects .project-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--surface-bg);
    padding: 14px;
  }

  #projects .project-row.is-selected {
    border-left-color: var(--yellow);
    box-shadow: none;
  }

  #projects .project-row > span {
    display: grid;
    gap: 5px;
    align-content: start;
  }

  #projects .project-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  #projects .project-row > span:first-child,
  #projects .project-row > span:last-child {
    grid-column: 1 / -1;
  }

  #projects .project-board {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }
}

@media (max-width: 820px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .trial-strip {
    display: none;
  }

  .app-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  body.nav-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .community-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 330px);
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 16px 0 40px rgba(6, 12, 24, 0.28);
  }

  body.nav-collapsed .community-sidebar {
    position: static;
    width: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    box-shadow: none;
  }

  body.nav-collapsed .workspace-nav,
  body.nav-collapsed .channel-nav {
    display: none;
  }

  .view {
    padding: 16px;
  }

  .topbar {
    padding-right: 16px;
  }

  .top-menu {
    gap: 4px;
  }

  .top-menu-item {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.86rem;
  }

  .mega-grid,
  .peer-menu-grid {
    grid-template-columns: 1fr;
  }

  .composer,
  .meeting-row {
    grid-template-columns: 1fr;
  }

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

  .table-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .table-head {
    display: none;
  }
}

body.theme-dark .member-card strong,
body.theme-dark .channel-item.is-active,
body.theme-dark .channel-item.is-active:hover {
  color: #ffffff;
}
