:root {
  --navy-950: #061633;
  --navy-900: #071d49;
  --navy-850: #0a275c;
  --blue-700: #1558d6;
  --blue-600: #276ee8;
  --blue-500: #3c82f6;
  --blue-100: #ddebff;
  --blue-50: #eff6ff;
  --ink-950: #10203d;
  --ink-800: #293958;
  --ink-600: #61708c;
  --ink-500: #7b89a2;
  --line: #dbe3ef;
  --line-strong: #c8d4e4;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --board: #eaf1fb;
  --danger: #c53744;
  --danger-soft: #fff0f1;
  --success: #22a06b;
  --warning: #e59b2f;
  --purple: #8557db;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(9, 30, 66, 0.12), 0 4px 12px rgba(9, 30, 66, 0.06);
  --shadow-float: 0 24px 64px rgba(2, 13, 36, 0.28), 0 4px 16px rgba(2, 13, 36, 0.16);
  --focus: 0 0 0 3px rgba(60, 130, 246, 0.28);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: var(--navy-900);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--navy-900);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink-950);
  background: var(--board);
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button,
select,
label[for],
input[type="file"] {
  cursor: pointer;
}

button {
  border: 0;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--blue-600);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  gap: 3px;
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  color: var(--surface);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.brand__mark span {
  display: block;
  height: 13px;
  border-radius: 2px;
  background: currentColor;
}

.brand__mark span:nth-child(2) {
  height: 9px;
  opacity: 0.75;
}

.brand__mark span:nth-child(3) {
  height: 5px;
  opacity: 0.5;
}

.brand__mark--large {
  grid-template-columns: repeat(3, 6px);
  gap: 4px;
  width: 48px;
  height: 48px;
  padding: 10px;
  border-color: rgba(21, 88, 214, 0.14);
  color: var(--blue-600);
  background: var(--blue-50);
}

.brand__mark--large span {
  height: 21px;
}

.brand__mark--large span:nth-child(2) {
  height: 15px;
}

.brand__mark--large span:nth-child(3) {
  height: 9px;
}

.brand__wordmark {
  font-size: 1.08rem;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 2;
}

.button--primary {
  color: #fff;
  background: var(--blue-700);
  box-shadow: 0 5px 14px rgba(21, 88, 214, 0.2);
}

.button--primary:hover:not(:disabled) {
  background: #0d4fc9;
  box-shadow: 0 7px 18px rgba(21, 88, 214, 0.28);
}

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

.button--secondary {
  border-color: var(--line);
  background: var(--surface);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button--light {
  color: var(--navy-900);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(1, 15, 40, 0.16);
}

.button--light:hover:not(:disabled) {
  background: var(--blue-50);
}

.button--danger {
  border-color: #f3c8cd;
  color: var(--danger);
  background: var(--danger-soft);
}

.button--danger:hover:not(:disabled) {
  border-color: #ecaeb5;
  background: #ffe2e5;
}

.button--small {
  min-height: 32px;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-600);
  background: transparent;
  transition: color 120ms ease, background-color 120ms ease;
}

.icon-button:hover {
  color: var(--ink-950);
  background: rgba(16, 32, 61, 0.07);
}

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

/* Authentication */
.auth-view {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink-950);
  background: var(--surface);
}

.auth-layout {
  display: grid;
  min-height: inherit;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, 0.92fr);
}

.auth-intro {
  position: relative;
  display: flex;
  min-height: inherit;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.75rem);
  color: #fff;
  background:
    radial-gradient(circle at 13% 89%, rgba(51, 135, 255, 0.33), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(104, 171, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #061634 0%, #08265a 55%, #0b3474 100%);
  isolation: isolate;
}

.auth-intro::before,
.auth-intro::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.auth-intro::before {
  right: -15rem;
  bottom: -13rem;
  width: 38rem;
  height: 38rem;
}

.auth-intro::after {
  right: -8rem;
  bottom: -7rem;
  width: 25rem;
  height: 25rem;
}

.brand--auth {
  align-self: flex-start;
  color: #fff;
}

.auth-intro__copy {
  max-width: 650px;
  margin: auto 0 clamp(2rem, 5vh, 4rem);
}

.auth-intro__copy .eyebrow {
  color: #8fbdff;
}

.auth-intro__copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2.65rem, 5vw, 5.75rem);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.auth-intro__copy > p:last-child {
  max-width: 570px;
  margin: 1.65rem 0 0;
  color: #c4d6f2;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.65;
}

.auth-mini-board {
  width: min(100%, 590px);
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(6, 20, 48, 0.4);
  box-shadow: 0 24px 50px rgba(0, 7, 22, 0.28);
  transform: perspective(900px) rotateX(2deg) rotateY(3deg);
  backdrop-filter: blur(12px);
}

.auth-mini-board__top {
  display: flex;
  height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 3px 7px;
}

.auth-mini-board__top > span {
  width: 80px;
  height: 5px;
  margin-right: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.auth-mini-board__top i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
}

.auth-mini-board__columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.auth-mini-board__columns > div {
  min-height: 114px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(230, 239, 252, 0.92);
}

.auth-mini-board__columns b,
.auth-mini-board__columns span {
  display: block;
  border-radius: 3px;
}

.auth-mini-board__columns b {
  width: 48%;
  height: 5px;
  margin-bottom: 9px;
  background: #70809b;
}

.auth-mini-board__columns span {
  height: 22px;
  margin-bottom: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.18);
}

.auth-main {
  display: flex;
  min-height: inherit;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
  background:
    linear-gradient(rgba(236, 242, 250, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 242, 250, 0.7) 1px, transparent 1px),
    #fff;
  background-position: center;
  background-size: 48px 48px;
}

.auth-card {
  width: min(100%, 430px);
  padding: clamp(1.75rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 75px rgba(7, 29, 73, 0.12), 0 3px 12px rgba(7, 29, 73, 0.08);
}

.auth-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  color: var(--blue-700);
  background: var(--blue-50);
}

.auth-card__icon svg {
  width: 22px;
  height: 22px;
}

.auth-card h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.auth-card__lede {
  margin: 0.8rem 0 1.6rem;
  color: var(--ink-600);
  font-size: 0.94rem;
  line-height: 1.6;
}

.auth-form label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink-800);
  font-size: 0.8rem;
  font-weight: 750;
}

.input-with-icon {
  position: relative;
  margin-bottom: 0.85rem;
}

.input-with-icon svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 18px;
  height: 18px;
  color: var(--ink-500);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-with-icon input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem 0.75rem 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-with-icon input:hover {
  border-color: #aebbd0;
}

.input-with-icon input:focus {
  border-color: var(--blue-500);
  box-shadow: var(--focus);
}

.form-help,
.form-status {
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
}

.form-help {
  margin: 0.85rem 0 0;
  color: var(--ink-500);
}

.form-status {
  min-height: 1.1em;
  margin: 0.45rem 0 0;
  color: var(--blue-700);
  font-weight: 650;
}

.form-status[data-tone="error"] {
  color: var(--danger);
}

.form-status[data-tone="success"] {
  color: var(--success);
}

.auth-footer {
  position: absolute;
  right: 2rem;
  bottom: 1.2rem;
  margin: 0;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.auth-footer span {
  margin: 0 0.35rem;
}

/* Loading */
.loading-view {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  background: var(--surface);
}

.loading-card {
  display: flex;
  min-width: 220px;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  color: var(--ink-600);
  font-size: 0.875rem;
  font-weight: 650;
}

.loading-card p {
  margin: 0;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

/* App chrome */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink-950);
  background: var(--board);
}

.app-header {
  position: relative;
  z-index: 10;
  display: grid;
  min-height: 60px;
  flex: 0 0 auto;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 520px) minmax(180px, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem 1.25rem;
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}

.brand--header {
  justify-self: start;
}

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

.global-search > svg {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  width: 17px;
  height: 17px;
  color: #aebbd1;
  pointer-events: none;
  transform: translateY(-50%);
}

.global-search input {
  width: 100%;
  height: 38px;
  padding: 0.5rem 2.6rem 0.5rem 2.35rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-sm);
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.84rem;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.global-search input::placeholder {
  color: #aebbd1;
}

.global-search input:hover {
  background: rgba(255, 255, 255, 0.12);
}

.global-search input:focus {
  border-color: rgba(125, 176, 255, 0.8);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(71, 139, 245, 0.24);
}

.global-search kbd {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  min-width: 20px;
  padding: 0.1rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 4px;
  color: #9eabc0;
  background: rgba(0, 0, 0, 0.12);
  font: 0.67rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  transform: translateY(-50%);
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.member-list {
  display: flex;
  flex-direction: row-reverse;
  margin: 0;
  padding: 0 0.15rem 0 0;
  list-style: none;
}

.member-list > li {
  margin-right: -0.35rem;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--avatar-hue, 218) 62% 54%);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.member-list .avatar {
  width: 30px;
  height: 30px;
  border: 2px solid var(--navy-950);
}

.current-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  padding-left: 0.15rem;
}

.avatar--current {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: #5b75df;
}

.current-user__name {
  max-width: 90px;
  overflow: hidden;
  color: #d7e1f0;
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button--header {
  color: #b9c5d8;
}

.icon-button--header:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.board-toolbar {
  position: relative;
  z-index: 8;
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: #fff;
  background: linear-gradient(110deg, var(--navy-850), #0b3a83);
  box-shadow: 0 2px 9px rgba(4, 20, 48, 0.18);
}

.board-heading {
  min-width: 0;
}

.board-heading .eyebrow {
  margin-bottom: 0.2rem;
  color: #90b9f7;
  font-size: 0.59rem;
}

.board-heading__line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.85rem;
}

.board-heading h1 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 740;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #bdcee8;
  font-size: 0.68rem;
  white-space: nowrap;
}

.sync-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #61d49d;
  box-shadow: 0 0 0 3px rgba(97, 212, 157, 0.13);
}

.sync-status[data-state="saving"] .sync-status__dot {
  background: #f4c56b;
  box-shadow: 0 0 0 3px rgba(244, 197, 107, 0.13);
}

.sync-status[data-state="offline"] .sync-status__dot,
.sync-status[data-state="error"] .sync-status__dot {
  background: #ff7a86;
  box-shadow: 0 0 0 3px rgba(255, 122, 134, 0.13);
}

.sync-status[data-warning="true"] {
  color: #ffd1d5;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.task-total {
  color: #bdcee8;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

/* Board */
.board-main {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(135deg, #e8f0fb, #dfe9f7);
}

.task-board {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: clamp(0.65rem, 1.15vw, 1rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding: clamp(0.75rem, 1.5vw, 1.25rem);
  overscroll-behavior-x: contain;
  scrollbar-color: rgba(28, 50, 85, 0.28) transparent;
  scrollbar-width: thin;
}

.task-board::-webkit-scrollbar,
.task-list::-webkit-scrollbar,
.comment-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.task-board::-webkit-scrollbar-thumb,
.task-list::-webkit-scrollbar-thumb,
.comment-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(28, 50, 85, 0.25);
  background-clip: padding-box;
}

.board-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(175, 191, 214, 0.75);
  border-radius: var(--radius-md);
  background: rgba(245, 248, 252, 0.94);
  box-shadow: 0 2px 7px rgba(7, 29, 73, 0.07);
  contain: layout paint;
}

.column-header {
  display: flex;
  min-height: 53px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.65rem 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(204, 215, 229, 0.72);
}

.column-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.column-title h2 {
  overflow: hidden;
  margin: 0;
  color: var(--ink-800);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #91a0b7;
}

.status-dot--todo {
  background: #7c8ca6;
  box-shadow: 0 0 0 3px rgba(124, 140, 166, 0.13);
}

.status-dot--progress {
  background: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(60, 130, 246, 0.13);
}

.status-dot--review {
  background: var(--purple);
  box-shadow: 0 0 0 3px rgba(133, 87, 219, 0.13);
}

.status-dot--done {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.13);
}

.column-count,
.section-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  color: var(--ink-600);
  background: #e4eaf2;
  font-size: 0.66rem;
  font-weight: 800;
}

.column-add-button {
  width: 31px;
  height: 31px;
}

.task-list {
  display: flex;
  min-height: 88px;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.7rem 0.65rem;
  list-style: none;
  overscroll-behavior-y: contain;
  scrollbar-color: rgba(28, 50, 85, 0.23) transparent;
  scrollbar-width: thin;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.task-list.is-drag-over {
  background: rgba(60, 130, 246, 0.09);
  box-shadow: inset 0 0 0 2px rgba(60, 130, 246, 0.38);
}

.task-list.is-drop-target {
  background: rgba(60, 130, 246, 0.09);
  box-shadow: inset 0 0 0 2px rgba(60, 130, 246, 0.38);
}

.column-empty {
  display: flex;
  min-height: 78px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: auto 0;
  color: #94a0b3;
  font-size: 1rem;
  text-align: center;
}

.column-empty p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
}

.task-list:has(.task-card) .column-empty {
  display: none;
}

.task-card {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(203, 214, 229, 0.92);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  content-visibility: auto;
  contain-intrinsic-size: auto 116px;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.task-card:hover {
  border-color: #b6c6dc;
  box-shadow: 0 2px 4px rgba(9, 30, 66, 0.12), 0 8px 18px rgba(9, 30, 66, 0.08);
  transform: translateY(-1px);
}

.task-card.is-dragging {
  opacity: 0.48;
  transform: rotate(1.5deg) scale(0.98);
}

.task-card.is-keyboard-dragging {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(60, 130, 246, 0.24), var(--shadow-card);
}

.task-card__drag-handle {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  right: 0.45rem;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  color: var(--ink-500);
  background: transparent;
  opacity: 0.45;
  touch-action: none;
  transition: color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.task-card__drag-handle:hover,
.task-card__drag-handle:focus-visible,
.task-card:focus-within .task-card__drag-handle {
  color: var(--ink-800);
  background: var(--surface-soft);
  opacity: 1;
}

.task-card__drag-handle svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

.task-card__open {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  padding: 0.75rem 2.4rem 0.75rem 0.75rem;
  border-radius: inherit;
  outline: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.task-card__open:focus-visible {
  box-shadow: inset var(--focus);
}

.task-card__status {
  width: 30px;
  height: 3px;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  background: var(--blue-500);
}

.task-card__status--todo {
  background: #7c8ca6;
}

.task-card__status--in_progress {
  background: var(--blue-500);
}

.task-card__status--review {
  background: var(--purple);
}

.task-card__status--done {
  background: var(--success);
}

.task-card__title {
  overflow-wrap: anywhere;
  color: var(--ink-800);
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.38;
}

.task-card__description {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0.38rem;
  color: var(--ink-600);
  font-size: 0.7rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-card__description:empty {
  display: none;
}

.task-card__meta {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  color: var(--ink-500);
  font-size: 0.64rem;
  font-weight: 680;
}

.task-card__due,
.task-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.task-card__due svg,
.task-card__stat svg {
  width: 13px;
  height: 13px;
}

.task-card__due.is-overdue {
  padding: 0.18rem 0.35rem;
  border-radius: 5px;
  color: var(--danger);
  background: var(--danger-soft);
}

.task-card__due[data-tone="soon"] {
  padding: 0.18rem 0.35rem;
  border-radius: 5px;
  color: #946013;
  background: #fff4dd;
}

.task-card__due[data-tone="complete"] {
  color: var(--success);
}

.task-card__spacer {
  flex: 1;
}

.avatar--card {
  width: 24px;
  height: 24px;
  background: #6379cc;
  font-size: 0.55rem;
}

.quick-add-form {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border-top: 1px solid rgba(204, 215, 229, 0.65);
}

.quick-add-form input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0.45rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: 0;
  background: #e9eef5;
  font-size: 0.75rem;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.quick-add-form input::placeholder {
  color: #7e8da4;
}

.quick-add-form input:hover {
  background: #e3e9f2;
}

.quick-add-form input:focus {
  border-color: var(--blue-500);
  background: var(--surface);
  box-shadow: var(--focus);
}

.quick-add-form button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--blue-700);
  background: var(--blue-100);
  transition: color 120ms ease, background-color 120ms ease;
}

.quick-add-form button:hover {
  color: #fff;
  background: var(--blue-700);
}

.quick-add-form button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  width: min(280px, calc(100vw - 2rem));
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 18px 38px rgba(7, 29, 73, 0.24);
  transform: rotate(2deg);
  will-change: transform;
}

.drop-placeholder {
  min-height: 84px;
  flex: 0 0 auto;
  border: 2px dashed rgba(60, 130, 246, 0.5);
  border-radius: 9px;
  background: rgba(60, 130, 246, 0.08);
}

body.is-dragging-task {
  cursor: grabbing;
  user-select: none;
}

body.is-dragging-task * {
  cursor: grabbing !important;
}

/* Task dialog */
.task-dialog {
  width: min(1080px, calc(100vw - 2rem));
  max-width: none;
  height: min(780px, calc(100dvh - 2rem));
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink-950);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.task-dialog::backdrop {
  background: rgba(3, 14, 35, 0.66);
  backdrop-filter: blur(3px);
}

.task-dialog[open] {
  animation: dialog-enter 160ms ease-out;
}

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

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

.dialog-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.dialog-context {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.2rem;
  color: var(--ink-600);
  font-size: 0.66rem;
  font-weight: 750;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.dialog-close {
  width: 38px;
  height: 38px;
  background: var(--surface-soft);
}

.dialog-content {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  overflow: hidden;
}

.task-form {
  min-width: 0;
  overflow-y: auto;
  padding: 1.5rem;
  scrollbar-color: rgba(28, 50, 85, 0.24) transparent;
  scrollbar-width: thin;
}

.field {
  min-width: 0;
  margin-bottom: 1.25rem;
}

.field > label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--ink-800);
  font-size: 0.72rem;
  font-weight: 780;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink-800);
  background: var(--surface);
  font-size: 0.82rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input,
.field select {
  height: 42px;
  padding: 0.55rem 0.7rem;
}

.field textarea {
  min-height: 170px;
  padding: 0.75rem;
  line-height: 1.55;
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #aab9ce;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue-500);
  box-shadow: var(--focus);
}

.field--title input {
  height: auto;
  padding: 0.7rem 0;
  border-width: 0 0 1px;
  border-radius: 0;
  color: var(--ink-950);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 730;
  letter-spacing: -0.025em;
}

.field--title input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 1px 0 var(--blue-500);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-500);
  border-bottom: 1.5px solid var(--ink-500);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  padding-right: 1.8rem;
  appearance: none;
}

.field-hint {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink-500);
  font-size: 0.66rem;
}

.task-activity {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
  scrollbar-color: rgba(28, 50, 85, 0.24) transparent;
  scrollbar-width: thin;
}

.activity-section {
  padding: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.activity-section--comments {
  display: flex;
  min-height: 280px;
  flex: 1;
  flex-direction: column;
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.section-heading h3 {
  margin: 0;
  color: var(--ink-800);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.section-count {
  min-width: 20px;
  height: 20px;
  font-size: 0.61rem;
}

.attachment-dropzone {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border: 1px dashed #b8c7da;
  border-radius: var(--radius-sm);
  color: var(--ink-600);
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.attachment-dropzone:hover,
.attachment-dropzone.is-drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.attachment-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.attachment-dropzone svg {
  width: 20px;
  height: 20px;
  color: var(--blue-600);
}

.attachment-dropzone span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.attachment-dropzone strong {
  color: var(--ink-800);
  font-size: 0.72rem;
}

.attachment-dropzone small {
  color: var(--ink-500);
  font-size: 0.62rem;
}

.attachment-list,
.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.attachment {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.attachment__icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  color: var(--blue-600);
  background: var(--blue-50);
}

.attachment__icon svg {
  width: 16px;
  height: 16px;
}

.attachment__info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
}

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

.attachment__info strong {
  color: var(--ink-800);
  font-size: 0.68rem;
}

.attachment__info small {
  color: var(--ink-500);
  font-size: 0.59rem;
}

.attachment__remove {
  width: 28px;
  height: 28px;
}

.comment-list {
  display: flex;
  min-height: 40px;
  flex: 1;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.comment-list:empty::after {
  margin: auto;
  color: var(--ink-500);
  content: "No comments yet";
  font-size: 0.7rem;
}

.detail-empty {
  margin: auto;
  padding: 0.75rem;
  color: var(--ink-500);
  font-size: 0.7rem;
  text-align: center;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.avatar--comment {
  width: 29px;
  height: 29px;
  margin-top: 0.05rem;
  background: #6379cc;
  font-size: 0.57rem;
}

.comment__body {
  min-width: 0;
  flex: 1;
}

.comment__delete {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  opacity: 0;
}

.comment:hover .comment__delete,
.comment:focus-within .comment__delete {
  opacity: 1;
}

.comment__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment__meta strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment__meta time {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: 0.56rem;
}

.comment__body p {
  margin: 0.24rem 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-600);
  font-size: 0.69rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.comment-form {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1rem;
}

.comment-composer {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.comment-composer:focus-within {
  border-color: var(--blue-500);
  box-shadow: var(--focus);
}

.comment-composer textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 0.65rem 0.7rem;
  border: 0;
  outline: 0;
  color: var(--ink-800);
  background: transparent;
  font-size: 0.7rem;
  line-height: 1.45;
  resize: none;
}

.comment-composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem;
  border-top: 1px solid #edf0f5;
}

.comment-composer__actions > span {
  padding-left: 0.3rem;
  color: var(--ink-500);
  font-size: 0.55rem;
}

.dialog-footer {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.dialog-footer__primary {
  display: flex;
  gap: 0.55rem;
}

/* Feedback */
.toast-region {
  position: fixed;
  z-index: 200;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  width: min(360px, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 12px 32px rgba(3, 14, 35, 0.28);
  font-size: 0.76rem;
  line-height: 1.45;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast[data-type="success"],
.toast--success {
  border-left: 3px solid #61d49d;
}

.toast[data-type="error"],
.toast--error {
  border-left: 3px solid #ff7a86;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1080px) {
  .app-header {
    grid-template-columns: auto minmax(210px, 1fr) auto;
  }

  .current-user__name {
    display: none;
  }

  .task-board {
    grid-auto-columns: minmax(265px, 30vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    scroll-snap-type: x proximity;
  }

  .board-column {
    scroll-snap-align: start;
  }
}

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

  .auth-intro {
    min-height: auto;
    padding: 2rem clamp(1.25rem, 6vw, 3.5rem) 2.5rem;
  }

  .auth-intro__copy {
    margin: 5rem 0 0;
  }

  .auth-intro__copy h1 {
    max-width: 600px;
    font-size: clamp(2.5rem, 9vw, 4.5rem);
  }

  .auth-mini-board {
    display: none;
  }

  .auth-main {
    min-height: 48vh;
    padding: 2.5rem 1.25rem 4rem;
  }

  .auth-footer {
    right: 0;
    bottom: 1rem;
    left: 0;
    text-align: center;
  }

  .member-list {
    display: none;
  }

  .dialog-content {
    display: block;
    overflow-y: auto;
  }

  .task-form {
    overflow: visible;
  }

  .task-activity {
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .app-header {
    min-height: 56px;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 0.6rem;
    padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem;
  }

  .brand--header .brand__wordmark {
    display: none;
  }

  .brand--header .brand__mark {
    width: 34px;
    height: 34px;
  }

  .global-search input {
    height: 36px;
    padding-right: 0.7rem;
  }

  .global-search kbd,
  .current-user {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .board-toolbar {
    min-height: 70px;
    padding: 0.7rem 0.8rem;
  }

  .board-heading .eyebrow,
  .sync-status,
  .task-total {
    display: none;
  }

  .button--light {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .button--light span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .board-main {
    overflow: hidden;
  }

  .task-board {
    grid-auto-columns: calc(100vw - 2rem);
    gap: 0.75rem;
    padding: 0.75rem 1rem max(0.9rem, env(safe-area-inset-bottom));
    scroll-padding-inline: 1rem;
    scroll-snap-type: x mandatory;
  }

  .task-dialog {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .dialog-header {
    min-height: 64px;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem 0.75rem 1rem;
  }

  .dialog-content {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .task-form {
    padding: 1rem;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .field textarea {
    min-height: 140px;
  }

  .activity-section {
    padding: 1rem;
  }

  .dialog-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 68px;
    padding: 0.65rem 0.8rem max(0.65rem, env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(9, 30, 66, 0.08);
  }

  .dialog-footer .button--danger {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .dialog-footer .button--danger span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dialog-footer__primary {
    flex: 1;
    justify-content: flex-end;
  }

  .dialog-footer__primary .button {
    flex: 1;
    max-width: 150px;
  }

  .toast-region {
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.5rem);
  }
}

@media (max-width: 420px) {
  .auth-intro {
    padding-top: 1.25rem;
  }

  .auth-intro__copy {
    margin-top: 3.5rem;
  }

  .auth-intro__copy h1 {
    font-size: 2.55rem;
  }

  .auth-main {
    padding-inline: 0.85rem;
  }

  .auth-card {
    padding: 1.45rem;
  }

  .task-board {
    grid-auto-columns: calc(100vw - 1.5rem);
    padding-inline: 0.75rem;
    scroll-padding-inline: 0.75rem;
  }
}

@media (pointer: coarse) {
  .task-card__drag-handle {
    top: 0.22rem;
    right: 0.22rem;
    width: 40px;
    height: 40px;
    opacity: 0.72;
  }

  .task-card__open {
    padding-right: 3rem;
  }

  .quick-add-form input,
  .quick-add-form button {
    min-height: 44px;
  }

  .quick-add-form button,
  .attachment__remove,
  .comment__delete {
    width: 44px;
    height: 44px;
  }

  .comment__delete {
    opacity: 1;
  }
}

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

@media (forced-colors: active) {
  .status-dot,
  .sync-status__dot,
  .task-card__status {
    border: 1px solid CanvasText;
  }

  .task-card,
  .board-column,
  .button,
  .attachment-dropzone {
    border: 1px solid CanvasText;
  }
}
