:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --surface-3: #e8edf2;
  --ink: #20242a;
  --ink-soft: #59616d;
  --muted: #7b8491;
  --line: #dce2e8;
  --line-strong: #c7d0da;
  --accent: #1f7a6f;
  --accent-soft: #e3f3f0;
  --info: #2563eb;
  --info-soft: #eaf1ff;
  --danger: #b9473a;
  --danger-soft: #f7e5e2;
  --notification-bg: #c43f33;
  --notification-border: #f0b6ae;
  --notification-fg: #ffffff;
  --save-border: #b7ddd6;
  --save-hover: #d5ede8;
  --bug: #b9473a;
  --task: #1f7a6f;
  --event: #8a6a1f;
  --event-soft: #f5ecd1;
  --stage-frozen: #0f9f9a;
  --stage-todo: #2563eb;
  --stage-progress: #d97706;
  --stage-developed: #e11d48;
  --stage-verification: #7c3aed;
  --stage-completed: #16a34a;
  --page-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 248, 250, 0) 280px);
  --control-bg: rgba(255, 255, 255, 0.76);
  --column-bg: rgba(255, 255, 255, 0.7);
  --column-drag-bg: rgba(227, 243, 240, 0.62);
  --add-bg: rgba(255, 255, 255, 0.62);
  --overlay-bg: rgba(20, 24, 30, 0.52);
  --modal-border: rgba(255, 255, 255, 0.72);
  --focus-ring: rgba(31, 122, 111, 0.12);
  --accent-inset: rgba(31, 122, 111, 0.18);
  --selected-inset: rgba(31, 122, 111, 0.22);
  --task-shadow: 0 10px 24px -22px rgba(32, 36, 42, 0.36);
  --ghost-shadow: 0 28px 60px -32px rgba(32, 36, 42, 0.48);
  --modal-shadow: 0 35px 90px -44px rgba(5, 10, 18, 0.7);
  --danger-border: #edcbc6;
  --danger-hover: #f2d6d1;
  --checklist-bg: #fbfcfd;
  --points-bg: var(--ink);
  --points-fg: #ffffff;
  --chat-own-bg: #dff4ef;
  --chat-own-border: #a7d8cf;
  --chat-own-fg: #123b35;
  --chat-other-bg: #eef2f5;
  --chat-other-border: #d7dee6;
  --chat-other-fg: var(--ink);
  --theme-dot: #20242a;
  --shadow: 0 20px 45px -28px rgba(32, 36, 42, 0.28);
  --radius: 8px;
  --column-width: 365px;
  --field-control-height: 38px;
  --font: "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050607;
  --surface: #111418;
  --surface-2: #1a2026;
  --surface-3: #252c34;
  --ink: #f4f6f8;
  --ink-soft: #c4ccd5;
  --muted: #8d98a5;
  --line: #2b343d;
  --line-strong: #465360;
  --accent: #5fc0ae;
  --accent-soft: #15342e;
  --info: #60a5fa;
  --info-soft: #10233d;
  --danger: #ff8a7b;
  --danger-soft: #351b18;
  --notification-bg: #ff6f61;
  --notification-border: rgba(255, 138, 123, 0.55);
  --notification-fg: #190806;
  --save-border: rgba(95, 192, 174, 0.46);
  --save-hover: #1d443c;
  --bug: #ff8a7b;
  --task: #7ed8c8;
  --event: #e6c76c;
  --event-soft: #392f18;
  --stage-frozen: #5eead4;
  --stage-todo: #60a5fa;
  --stage-progress: #facc15;
  --stage-developed: #fb7185;
  --stage-verification: #c084fc;
  --stage-completed: #86efac;
  --page-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(5, 6, 7, 0) 280px);
  --control-bg: rgba(17, 20, 24, 0.78);
  --column-bg: rgba(14, 17, 21, 0.86);
  --column-drag-bg: rgba(21, 52, 46, 0.64);
  --add-bg: rgba(17, 20, 24, 0.68);
  --overlay-bg: rgba(0, 0, 0, 0.74);
  --modal-border: rgba(255, 255, 255, 0.12);
  --focus-ring: rgba(95, 192, 174, 0.22);
  --accent-inset: rgba(95, 192, 174, 0.2);
  --selected-inset: rgba(95, 192, 174, 0.28);
  --task-shadow: 0 16px 34px -28px rgba(0, 0, 0, 0.92);
  --ghost-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.9);
  --modal-shadow: 0 35px 90px -44px rgba(0, 0, 0, 0.92);
  --danger-border: rgba(255, 138, 123, 0.42);
  --danger-hover: #4a241f;
  --checklist-bg: #0d1014;
  --points-bg: #f4f6f8;
  --points-fg: #101318;
  --chat-own-bg: #153c35;
  --chat-own-border: rgba(95, 192, 174, 0.48);
  --chat-own-fg: #dffbf5;
  --chat-other-bg: #1a2026;
  --chat-other-border: #313c46;
  --chat-other-fg: var(--ink);
  --theme-dot: #ffffff;
  --shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.92);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page-gradient), var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  border: 0;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  padding: 24px 24px 16px;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  width: 100%;
  margin: 0 0 20px;
}

.brand-block {
  justify-self: center;
  min-width: 0;
}

.header-left-actions {
  display: flex;
  align-items: center;
  transform: translateY(4px);
}

.header-actions {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 8px;
  transform: translateY(4px);
}

.header-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.eyebrow {
  position: fixed;
  top: 1px;
  left: 50%;
  z-index: 50;
  max-width: calc(100vw - 16px);
  transform: translateX(-50%);
  margin: 0;
  color: var(--accent);
  font-size: 8px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0.07em;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 760;
  line-height: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-status,
.account-menu-button,
.chat-menu-button,
.crm-section-toggle,
.project-menu-button,
.team-menu-button,
.guest-menu-button,
.filter-menu-button,
.side-menu-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.project-menu {
  position: relative;
}

.account-menu-button,
.chat-menu-button,
.crm-section-toggle,
.project-menu-button,
.team-menu-button,
.guest-menu-button,
.filter-menu-button,
.side-menu-toggle {
  min-width: 0;
  cursor: pointer;
  transition:
    border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background 160ms cubic-bezier(0.16, 1, 0.3, 1),
    color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-menu-label,
.chat-menu-label,
.crm-section-toggle,
.project-menu-label,
.team-menu-label,
.guest-menu-label,
.filter-menu-label {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.chat-menu-unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--notification-border);
  border-radius: 999px;
  background: var(--notification-bg);
  color: var(--notification-fg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--control-bg);
}

.theme-toggle {
  cursor: pointer;
  gap: 6px;
  padding: 0 10px;
  transition:
    border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background 160ms cubic-bezier(0.16, 1, 0.3, 1),
    color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-menu-button:hover,
.account-menu-button:focus-visible,
.chat-menu-button:hover,
.chat-menu-button:focus-visible,
.crm-section-toggle:hover,
.crm-section-toggle:focus-visible,
.project-menu-button:hover,
.project-menu-button:focus-visible,
.team-menu-button:hover,
.team-menu-button:focus-visible,
.guest-menu-button:hover,
.guest-menu-button:focus-visible,
.filter-menu-button:hover,
.filter-menu-button:focus-visible,
.side-menu-toggle:hover,
.side-menu-toggle:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-1px);
}

.account-menu-button:focus-visible,
.chat-menu-button:focus-visible,
.crm-section-toggle:focus-visible,
.project-menu-button:focus-visible,
.team-menu-button:focus-visible,
.guest-menu-button:focus-visible,
.filter-menu-button:focus-visible,
.side-menu-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.account-menu-button:active,
.chat-menu-button:active,
.crm-section-toggle:active,
.project-menu-button:active,
.team-menu-button:active,
.guest-menu-button:active,
.filter-menu-button:active,
.side-menu-toggle:active,
.theme-toggle:active {
  transform: translateY(0) scale(0.99);
}

.chat-menu-button[data-open="true"] {
  border-color: var(--save-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.account-menu-button[data-authenticated="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.filter-menu-button[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

body[data-section="crm"] .side-menu .project-menu-button {
  display: none;
}

.account-menu-button[hidden],
.guest-menu-button[hidden],
.side-menu-local-actions[hidden],
.side-menu-account[hidden] {
  display: none !important;
}

.side-menu-toggle {
  justify-content: center;
  width: 34px;
  padding: 0;
}

.side-menu-icon {
  display: grid;
  gap: 5px;
  width: 14px;
}

.side-menu-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.theme-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--theme-dot);
}

.header-status[data-sync-state="syncing"] .status-dot {
  background: var(--event);
}

.header-status[data-sync-state="synced"] .status-dot {
  background: var(--accent);
}

.header-status[data-sync-state="offline"] .status-dot {
  background: var(--muted);
}

.header-status[data-sync-state="error"] .status-dot {
  background: var(--danger);
}

.side-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: var(--overlay-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.side-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  display: flex;
  width: min(360px, calc(100vw - 24px));
  height: 100%;
  flex-direction: column;
  border-left: 1px solid var(--modal-border);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
  transform: translateX(100%);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.side-menu-overlay.is-open .side-menu {
  transform: translateX(0);
}

.side-menu-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.side-menu-topbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
}

.side-menu-body {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 12px;
  padding: 16px;
}

.side-menu-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.side-menu .header-status {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
}

.side-menu .theme-toggle {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
}

.side-menu .project-menu-button,
.side-menu .team-menu-button,
.side-menu .guest-menu-button {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
}

.side-menu-account {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.side-account-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.side-account-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-account-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.side-account-message {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.side-account-logout,
.side-account-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  transition:
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.side-account-delete {
  background: var(--danger);
  color: #fff;
}

.side-account-logout:hover,
.side-account-logout:focus-visible,
.side-account-delete:hover,
.side-account-delete:focus-visible {
  background: var(--danger-hover);
}

.side-account-delete:hover,
.side-account-delete:focus-visible {
  color: var(--danger);
}

.side-account-logout:focus-visible,
.side-account-delete:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.side-account-logout:active,
.side-account-delete:active {
  transform: scale(0.99);
}

.side-account-logout:disabled,
.side-account-delete:disabled {
  cursor: progress;
  opacity: 0.65;
}

.side-account-delete[hidden] {
  display: none;
}

.side-menu-local-actions {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.side-local-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  transition:
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.side-local-delete:hover,
.side-local-delete:focus-visible {
  background: var(--danger-hover);
}

.side-local-delete:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.side-local-delete:active {
  transform: scale(0.99);
}

.side-local-delete:disabled {
  cursor: progress;
  opacity: 0.65;
}

.modal.project-modal {
  width: min(520px, 100%);
}

.modal.account-modal {
  width: min(560px, 100%);
}

.project-modal-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.account-modal-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.account-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.account-mode-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.account-mode-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.account-fields {
  display: grid;
  gap: 12px;
}

.account-session-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.account-session-label,
.account-session-email {
  margin: 0;
}

.account-session-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.account-session-email {
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.account-message {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.account-message.is-visible {
  display: block;
}

.delete-account-warning {
  padding: 12px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  margin: 0;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.4;
}

.account-delete-confirm-button {
  border-color: var(--danger-border);
  background: var(--danger);
  color: #fff;
}

.account-delete-confirm-button:hover,
.account-delete-confirm-button:focus-visible {
  background: var(--danger-hover);
  color: var(--danger);
}

.account-modal-footer {
  align-items: center;
}

.account-cancel-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.account-primary-button:disabled,
.account-mode-button:disabled,
.account-cancel-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.project-list-title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.project-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.project-list-item.is-empty {
  color: var(--muted);
}

.project-management-item {
  align-items: stretch;
  min-height: 38px;
  padding: 6px;
}

.project-item-name {
  align-self: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item-actions,
.project-edit-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-edit-form {
  width: 100%;
}

.project-edit-input {
  min-width: 0;
  flex: 1;
}

.project-secondary-button,
.project-danger-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

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

.project-danger-button {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.project-save-button {
  min-height: 30px;
  padding: 0 10px;
}

.team-list {
  max-height: none;
  overflow: visible;
}

.team-list-section {
  display: grid;
  gap: 7px;
}

.team-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  justify-items: stretch;
  padding: 10px;
}

.team-member-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.team-member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.team-member-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-member-copy strong,
.team-member-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.team-member-copy span,
.team-mode-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-mode-note {
  margin: 0;
  line-height: 1.35;
}

.team-member-edit-button {
  min-height: 30px;
  padding: 0 9px;
}

.team-member-delete-button {
  min-height: 30px;
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.team-member-delete-button:hover {
  background: var(--danger-hover);
}

.owner-profile-card {
  border-color: var(--save-border);
  background: var(--accent-soft);
}

.owner-profile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--save-border);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.team-access-create-form,
.team-member-edit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) auto;
  gap: 6px;
}

.team-member-edit-panel {
  grid-template-columns: 1fr;
  gap: 8px;
}

.team-member-edit-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) minmax(110px, 0.45fr);
  gap: 6px;
}

.team-member-edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.owner-profile-edit-panel {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) auto;
}

.team-member-edit-panel input,
.team-member-edit-panel select {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 9px;
}

.member-key-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--save-border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
}

.member-key-callout span {
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
  grid-column: 1 / -1;
}

.member-key-callout strong {
  font-family: var(--mono);
  font-size: 15px;
  overflow-wrap: anywhere;
  min-width: 0;
}

.member-key-copy-button {
  justify-self: end;
}

.guest-project-options {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.guest-project-options-title,
.guest-project-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.guest-project-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}

.guest-project-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.guest-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
}

.guest-create-form .guest-project-options,
.guest-create-form .project-create-button {
  grid-column: 1 / -1;
}

.project-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.project-create-input {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 9px;
}

.team-member-edit-panel input:focus,
.team-member-edit-panel select:focus,
.team-access-create-form .project-create-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.project-create-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.project-create-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.project-create-button:hover,
.project-create-button:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
}

.project-menu-message {
  display: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.project-menu-message.is-visible {
  display: block;
}

.board-wrap {
  width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
}

.board {
  display: grid;
  width: max-content;
  min-width: max-content;
  grid-template-columns: repeat(7, var(--column-width));
  align-items: stretch;
  gap: 14px;
  height: calc(100dvh - 84px);
  min-height: 0;
  max-height: calc(100dvh - 84px);
}

.crm-board {
  display: grid;
  width: 100%;
  min-width: 0;
  height: calc(100dvh - 84px);
  min-height: 0;
  max-height: calc(100dvh - 84px);
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.crm-board.is-chat-open {
  grid-template-columns: var(--column-width) minmax(0, 1fr);
}

.crm-view {
  display: flex;
  width: 100%;
  height: calc(100dvh - 84px);
  min-height: 0;
  max-height: calc(100dvh - 84px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--column-bg);
}

.crm-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.crm-view-header h2 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
}

.crm-view-indicators {
  margin-left: auto;
}

.column-count.crm-prospect-active-count {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.column-percent.crm-prospect-closed-count {
  background: var(--accent-soft);
  color: var(--task);
}

.column-percent.crm-prospect-conversion-rate {
  background: var(--info-soft);
  color: var(--info);
}

.crm-view-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
}

.crm-prospect-scroll {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
}

.crm-empty-state {
  display: grid;
  min-height: 74px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

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

.crm-add-prospect-button {
  flex: 0 0 auto;
  margin-top: 12px;
}

.crm-prospect-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.1fr)
    minmax(130px, 0.9fr)
    minmax(120px, 0.72fr)
    minmax(160px, 1fr)
    auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--task-shadow);
  transition:
    border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-prospect-row:hover,
.crm-prospect-row:focus-visible {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.crm-prospect-row:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.crm-prospect-company,
.crm-prospect-contact,
.crm-prospect-phone,
.crm-prospect-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-prospect-company {
  font-size: 15px;
  font-weight: 820;
}

.crm-prospect-contact,
.crm-prospect-phone,
.crm-prospect-email {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.crm-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--save-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.column {
  display: flex;
  width: var(--column-width);
  min-width: var(--column-width);
  height: calc(100dvh - 84px);
  min-height: 0;
  max-height: calc(100dvh - 84px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--column-bg);
  transition:
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background 180ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-column {
  height: calc(100dvh - 84px);
  min-height: 0;
  max-height: calc(100dvh - 84px);
  overflow: hidden;
}

.column.is-drag-over {
  border-color: var(--accent);
  background: var(--column-drag-bg);
  box-shadow: inset 0 0 0 1px var(--accent-inset);
}

.column.is-move-target {
  border-style: dashed;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.column-title {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 780;
}

.column-indicators {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.column-count,
.column-percent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.column-count {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.column-percent {
  min-width: 40px;
  background: var(--accent-soft);
  color: var(--task);
}

.task-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.column > .add-task-button {
  flex: 0 0 auto;
  width: auto;
  margin: 0 12px 12px;
}

.chat-column-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
}

.chat-list-view,
.chat-conversation-view {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.chat-list {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.chat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.chat-list-item:hover,
.chat-list-item:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  outline: none;
}

.chat-list-item.is-locked {
  color: var(--muted);
  border-style: dashed;
}

.chat-list-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-list-copy strong,
.chat-list-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-copy strong {
  font-size: 13px;
  font-weight: 780;
}

.chat-list-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chat-unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--task);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.chat-create-group-button {
  margin-top: auto;
}

.chat-group-form {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.chat-group-form input[type="text"] {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 9px;
}

.chat-group-form input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chat-group-members {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow: auto;
}

.chat-group-member-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}

.chat-group-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.chat-conversation-topbar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.chat-conversation-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-conversation-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-conversation-title strong,
.chat-conversation-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversation-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.chat-conversation-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.chat-edit-group-button,
.chat-delete-group-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  cursor: pointer;
}

.chat-edit-group-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.chat-edit-group-button:hover,
.chat-edit-group-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.chat-delete-group-button {
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.chat-delete-group-button:hover,
.chat-delete-group-button:focus-visible {
  border-color: var(--danger);
  background: var(--danger-hover);
  outline: none;
}

.chat-edit-group-button svg,
.chat-delete-group-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.chat-message-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 2px 2px 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-message-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chat-message-row {
  display: flex;
  justify-content: flex-start;
}

.chat-message-row.is-own {
  justify-content: flex-end;
}

.chat-date-separator-row {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.chat-date-separator-pill {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .chat-date-separator-pill {
  background: color-mix(in srgb, var(--surface2) 88%, transparent);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.chat-bubble {
  display: grid;
  gap: 5px;
  max-width: 86%;
  padding: 9px 10px;
  border: 1px solid var(--chat-other-border);
  border-radius: var(--radius);
  background: var(--chat-other-bg);
  color: var(--chat-other-fg);
  overflow-wrap: anywhere;
}

.chat-message-row.is-own .chat-bubble {
  border-color: var(--chat-own-border);
  background: var(--chat-own-bg);
  color: var(--chat-own-fg);
}

.chat-message-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.35;
}

.chat-message-text a {
  color: inherit;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-message-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.chat-message-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  justify-self: end;
}

.chat-composer {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 9px;
}

.chat-composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chat-composer-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.filter-modal-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.filter-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  outline: none;
  padding: 0 10px;
  text-transform: none;
}

.filter-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.filter-done-button {
  min-width: 84px;
}

.chat-notice {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.chat-notice.is-error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.task-card {
  position: relative;
  min-height: 132px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--task-shadow);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  transition:
    opacity 180ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.task-card:hover,
.task-card:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  outline: none;
}

.task-card:active {
  cursor: pointer;
}

.task-card.is-dragging {
  border-color: var(--accent);
  opacity: 0.48;
  transform: none;
}

.task-card.is-selected-for-move {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--selected-inset), var(--shadow);
}

.is-card-dragging .task-card:not(.is-dragging) {
  cursor: pointer;
}

.is-card-dragging .column {
  border-style: dashed;
}

.is-card-dragging {
  -webkit-user-select: none;
  user-select: none;
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: block;
  flex: none;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  box-shadow: var(--ghost-shadow);
  box-sizing: border-box;
  transition: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  -webkit-font-smoothing: antialiased;
}

.move-handle {
  position: absolute;
  top: 13px;
  right: 12px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  opacity: 0.72;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.move-handle::before {
  width: 12px;
  height: 18px;
  background-image: radial-gradient(circle, currentColor 1.45px, transparent 1.6px);
  background-position: 0 0;
  background-size: 6px 6px;
  content: "";
}

.move-handle:active {
  cursor: grabbing;
}

.task-card:hover .move-handle,
.task-card:focus-within .move-handle,
.task-card.is-selected-for-move .move-handle {
  opacity: 1;
}

.task-title {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  padding-right: 44px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
}

.chart-card {
  min-height: 318px;
  cursor: default;
}

.stage-chart-card {
  min-height: 396px;
}

.leaderboard-chart-card {
  min-height: 318px;
}

.chart-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-right: 34px;
  margin-bottom: 10px;
}

.chart-card-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.2;
}

.chart-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--task);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.leaderboard-mode-select {
  max-width: 118px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
  outline: none;
  padding: 0 24px 0 10px;
}

.leaderboard-mode-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chart-frame {
  width: 100%;
  min-height: 194px;
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.chart-status-message {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.pie-chart-frame {
  display: grid;
  place-items: center;
  min-height: 176px;
  padding: 8px;
}

.pie-svg {
  display: block;
  width: 100%;
  max-height: 172px;
}

.pie-segment {
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 2;
}

.pie-segment-frozen {
  fill: var(--stage-frozen);
}

.pie-segment-todo {
  fill: var(--stage-todo);
}

.pie-segment-in_progress {
  fill: var(--stage-progress);
}

.pie-segment-developed {
  fill: var(--stage-developed);
}

.pie-segment-verification {
  fill: var(--stage-verification);
}

.pie-segment-completed {
  fill: var(--stage-completed);
}

.pie-empty {
  fill: var(--surface-2);
  stroke: var(--line-strong);
  stroke-width: 2;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis {
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-x-label,
.chart-y-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
}

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

.chart-period-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 28px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
}

.chart-period-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--task);
}

.chart-period-button:hover,
.chart-period-button:focus-visible {
  border-color: var(--line-strong);
  color: var(--ink);
  outline: none;
}

.chart-team-control {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

.chart-team-control select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
}

.chart-team-control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.leaderboard-list {
  display: grid;
  gap: 7px;
  min-height: 214px;
  max-height: 232px;
  margin-bottom: 10px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.leaderboard-rank,
.leaderboard-value,
.leaderboard-percent {
  font-family: var(--mono);
  line-height: 1;
  white-space: nowrap;
}

.leaderboard-rank {
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 820;
}

.leaderboard-percent {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.leaderboard-empty {
  place-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.stage-team-control {
  margin-bottom: 10px;
}

.stage-breakdown {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.stage-metric {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.stage-metric-frozen {
  border-color: var(--stage-frozen);
}

.stage-metric-todo {
  border-color: var(--stage-todo);
}

.stage-metric-in_progress {
  border-color: var(--stage-progress);
}

.stage-metric-developed {
  border-color: var(--stage-developed);
}

.stage-metric-verification {
  border-color: var(--stage-verification);
}

.stage-metric-completed {
  border-color: var(--stage-completed);
}

.stage-count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

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

.stage-percent {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.task-project {
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.task-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.task-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.task-meta-left {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.type-badge,
.folio-badge,
.date-badge,
.points-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.type-badge {
  padding: 0 8px;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.type-badge[data-type="Bug"] {
  background: var(--danger-soft);
  color: var(--bug);
}

.type-badge[data-type="Tarea"] {
  background: var(--accent-soft);
  color: var(--task);
}

.type-badge[data-type="Evento"] {
  background: var(--event-soft);
  color: var(--event);
}

.folio-badge,
.date-badge {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.folio-badge {
  max-width: 102px;
}

.date-badge {
  flex: 1 1 auto;
  max-width: 154px;
}

.points-badge {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 48px;
  padding: 0 9px;
  background: var(--points-bg);
  color: var(--points-fg);
  font-family: var(--mono);
}

.responsible {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-height: 24px;
  max-width: 128px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-task-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--add-bg);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background 180ms cubic-bezier(0.16, 1, 0.3, 1),
    color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.add-task-button:hover,
.add-task-button:focus-visible {
  background: var(--surface);
  color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.add-task-button:active {
  transform: translateY(0) scale(0.99);
}

.plus-mark {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.plus-mark::before,
.plus-mark::after {
  position: absolute;
  inset: 6px 1px auto;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.plus-mark::after {
  transform: rotate(90deg);
}

.empty-column-note {
  display: grid;
  min-height: 78px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay-bg);
}

.modal {
  width: min(1040px, 100%);
  max-height: min(900px, calc(100dvh - 48px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--modal-border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
  -webkit-overflow-scrolling: touch;
}

.modal-form {
  display: flex;
  max-height: none;
  flex-direction: column;
}

.modal-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: 18px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.modal-left-row,
.modal-right-row {
  display: grid;
  gap: 12px;
}

.modal-left-row {
  grid-template-columns: minmax(170px, 1fr) minmax(118px, 0.5fr) minmax(130px, 0.55fr);
}

.modal-right-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(88px, 0.5fr);
}

.modal-responsible {
  grid-column: 1 / -1;
}

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

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.checklist-title-input,
.checklist-item-text {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.field input,
.field select,
.checklist-title-input,
.checklist-item-text {
  height: var(--field-control-height);
  min-height: var(--field-control-height);
  padding: 0 10px;
  line-height: 1.2;
}

.field input[type="date"],
.field input[type="number"],
.field select {
  appearance: none;
  -webkit-appearance: none;
}

.field input[type="date"] {
  display: block;
  max-width: 100%;
  padding-block: 0;
  line-height: calc(var(--field-control-height) - 2px);
  text-align: left;
}

.field input[type="date"]::-webkit-date-and-time-value {
  display: flex;
  height: calc(var(--field-control-height) - 2px);
  align-items: center;
  margin: 0;
  min-height: calc(var(--field-control-height) - 2px);
  line-height: calc(var(--field-control-height) - 2px);
  text-align: left;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  align-self: center;
  margin-block: 0;
}

.field select {
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size:
    6px 6px,
    6px 6px;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.field .short-description-textarea {
  min-height: var(--field-control-height);
  overflow: hidden;
  resize: none;
  padding: 7px 10px;
  line-height: 1.35;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.checklist-title-input:focus,
.checklist-item-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field input[readonly] {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.close-button,
.save-task-button,
.delete-task-button,
.toolbar-button,
.small-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  transition:
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.close-button {
  width: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
}

.save-task-button {
  padding: 0 12px;
  border: 1px solid var(--save-border);
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.delete-task-button {
  padding: 0 12px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  white-space: nowrap;
}

.close-button:hover,
.toolbar-button:hover,
.small-button:hover {
  background: var(--surface-2);
}

.save-task-button:hover {
  background: var(--save-hover);
}

.delete-task-button:hover {
  background: var(--danger-hover);
}

.close-button:focus-visible,
.save-task-button:focus-visible,
.delete-task-button:focus-visible,
.toolbar-button:focus-visible,
.small-button:focus-visible,
.danger-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.modal-body {
  display: grid;
  flex: none;
  gap: 18px;
  min-height: auto;
  overflow: visible;
  padding: 20px;
}

.crm-prospect-modal {
  width: min(980px, 100%);
}

.crm-modal-body {
  gap: 20px;
}

.crm-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.crm-comments-field {
  grid-column: 1 / -1;
}

.crm-address-field {
  grid-column: span 2;
}

.crm-address-field textarea {
  min-height: 86px;
}

.crm-registrant-field {
  grid-column: span 2;
}

.crm-registrant-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.crm-registrant-value {
  display: flex;
  min-height: var(--field-control-height);
  align-items: center;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.crm-contacts-section,
.crm-interactions-section {
  display: grid;
  gap: 12px;
}

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

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

.crm-contact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.crm-contact-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(0, 1fr)
    minmax(0, 0.9fr)
    minmax(0, 1.1fr);
  gap: 10px;
}

.crm-contact-delete-button {
  min-width: 76px;
}

.crm-interaction-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.crm-interaction-form textarea {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 10px;
  resize: vertical;
}

.crm-interaction-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.crm-interaction-list {
  display: grid;
  gap: 8px;
}

.crm-interaction-item,
.crm-interaction-empty {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.crm-interaction-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.crm-interaction-comment {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.crm-interaction-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.description-grid {
  display: grid;
  gap: 16px;
}

.long-description-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.toolbar-button {
  min-width: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.long-description-shell textarea {
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none;
}

.checklists-section {
  display: grid;
  gap: 12px;
}

.section-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--checklist-bg);
}

.checklist-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.small-button {
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  white-space: nowrap;
}

.small-button.team-member-delete-button {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.small-button.team-member-delete-button:hover {
  background: var(--danger-hover);
}

.danger-button {
  width: 34px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover {
  background: var(--danger-hover);
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checklist-item.is-completed .checklist-item-text {
  color: var(--muted);
  text-decoration: line-through;
}

.validation-message {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.validation-message.is-visible {
  display: block;
}

@media (max-width: 1100px) {
  .modal-header {
    grid-template-columns: 1fr;
  }

  .modal-left-row,
  .modal-right-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
  }

  .board {
    height: calc(100dvh - 84px);
    min-height: 0;
    max-height: calc(100dvh - 84px);
  }

  .crm-board,
  .crm-view {
    height: calc(100dvh - 84px);
    min-height: 0;
    max-height: calc(100dvh - 84px);
  }

  .crm-board.is-chat-open {
    width: max-content;
    min-width: max-content;
    grid-template-columns: repeat(2, var(--column-width));
  }

  .crm-field-grid,
  .crm-interaction-form,
  .crm-contact-item,
  .crm-contact-grid {
    grid-template-columns: 1fr;
  }

  .crm-address-field {
    grid-column: 1 / -1;
  }

  .crm-registrant-field {
    grid-column: 1 / -1;
  }

  .crm-prospect-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .crm-status-pill {
    justify-self: start;
  }

  .column {
    height: calc(100dvh - 84px);
    min-height: 0;
    max-height: calc(100dvh - 84px);
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
  }

  .modal-header {
    grid-template-columns: 1fr;
  }

  .modal-left-row,
  .modal-right-row {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .checklist-header,
  .checklist-item {
    grid-template-columns: 1fr;
  }

  .danger-button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  :root {
    --column-width: calc(100vw - 32px);
  }

  .team-access-create-form,
  .team-member-edit-panel,
  .team-member-edit-fields,
  .owner-profile-edit-panel {
    grid-template-columns: 1fr;
  }

  .team-member-edit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-list-item,
  .project-item-actions,
  .project-edit-form {
    align-items: stretch;
  }

  .project-management-item,
  .project-edit-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .crm-add-prospect-button {
    width: 100%;
    min-width: 0;
  }

  .project-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-member-summary {
    align-items: flex-start;
  }

  .team-member-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .app-header {
    gap: 10px;
  }

  .header-actions {
    gap: 6px;
    justify-items: end;
  }

  .header-action-row {
    gap: 4px;
  }

  .header-status,
  .account-menu-button,
  .chat-menu-button,
  .crm-section-toggle,
  .project-menu-button,
  .team-menu-button,
  .guest-menu-button,
  .filter-menu-button,
  .side-menu-toggle,
  .theme-toggle {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .theme-toggle {
    gap: 6px;
    padding: 0 9px;
  }

  .account-menu-button,
  .chat-menu-button,
  .crm-section-toggle,
  .project-menu-button,
  .team-menu-button,
  .guest-menu-button,
  .filter-menu-button {
    max-width: none;
  }

  .side-menu-toggle {
    width: 32px;
  }

  .account-menu-label,
  .chat-menu-label,
  .crm-section-toggle,
  .project-menu-label,
  .team-menu-label,
  .guest-menu-label,
  .filter-menu-label {
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 360px) {
  .app-header {
    gap: 8px;
  }

  .header-status,
  .account-menu-button,
  .chat-menu-button,
  .crm-section-toggle,
  .project-menu-button,
  .team-menu-button,
  .guest-menu-button,
  .filter-menu-button,
  .side-menu-toggle,
  .theme-toggle {
    min-height: 30px;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .theme-toggle {
    gap: 5px;
    padding: 0 8px;
  }

  .account-menu-button,
  .chat-menu-button,
  .crm-section-toggle,
  .project-menu-button,
  .team-menu-button,
  .guest-menu-button,
  .filter-menu-button {
    max-width: none;
  }

  .side-menu-toggle {
    width: 30px;
  }
}
