.app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.demo-banner {
  margin: 12px 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.96) 0%, rgba(22, 163, 74, 0.96) 48%, rgba(245, 158, 11, 0.96) 100%);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

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

.demo-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.demo-banner-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

.demo-banner h2 {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

.demo-banner p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.4;
  max-width: 720px;
}

.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.demo-banner-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.demo-banner-btn.primary {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #0f172a;
}

.demo-banner-btn.secondary {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.demo-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.session-label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.sync-status.error {
  color: var(--danger);
}

.sync-status.saving {
  color: var(--accent-secondary);
}

.sync-status.saved {
  color: var(--accent);
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 84%, rgba(0, 0, 0, 0.62) 16%);
  backdrop-filter: blur(8px);
}

.auth-shell.active {
  display: flex;
}

.auth-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-copy h1 {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.auth-copy p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  padding: 9px 10px;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--glow-focus);
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-actions .btn {
  flex: 1;
}

.auth-message {
  min-height: 18px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent);
}

body[data-theme="matrix"] {
  background: var(--bg);
  color: var(--text-primary);
}

body[data-theme="matrix"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(134, 239, 172, 0.045) 0px, rgba(134, 239, 172, 0.045) 1px, transparent 1px, transparent 34px),
                    repeating-linear-gradient(to right, rgba(34, 197, 94, 0.032) 0px, rgba(34, 197, 94, 0.032) 1px, transparent 1px, transparent 34px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}

/* ── Taskified Container ── */
.taskified-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 12px 16px;
  min-height: 0;
}

/* ── Sidebar Placeholder ── */
.column.placeholder {
  flex: 0 0 min(220px, 24vw);
  min-width: 220px;
  max-width: 320px;
  border: none;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg) 18%);
  color: var(--text-primary);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 8px;
  box-shadow: none;
}

.column.placeholder .column-header,
.column.placeholder .cards-container {
  display: none;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 12px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  margin-top: auto;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  margin-top: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.sidebar-sync-status {
  padding: 8px 10px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.sidebar-sync-status .sync-status {
  display: block;
  width: 100%;
}

.sidebar-session {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sidebar-session-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sidebar-session-actions {
  display: flex;
  gap: 8px;
}

.sidebar-session-btn {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-session-btn:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-action:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.sidebar-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-placeholder-trash {
  color: var(--danger);
}

.btn-placeholder-trash:hover {
  background: var(--danger-surface, rgba(239, 68, 68, 0.12));
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.placeholder-board-switcher {
  flex: 1;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.sidebar-section-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.board-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-board-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.btn-board-icon:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}

.btn-board-icon.danger {
  color: var(--danger);
}

.btn-board-icon.danger:hover {
  background: var(--danger-surface);
}

.btn-board-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-board-icon svg {
  width: 16px;
  height: 16px;
}

.board-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.board-tabs::-webkit-scrollbar {
  width: 4px;
}

.board-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.board-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.board-tab {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.board-tab:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}

.board-tab.active {
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Board Surface ── */
.taskified-board {
  display: flex;
  gap: 14px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  min-height: 0;
}

.taskified-board::-webkit-scrollbar {
  height: 8px;
}

.taskified-board::-webkit-scrollbar-track {
  background: transparent;
}

.taskified-board::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.taskified-board::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* ── Column ── */
.column {
  flex: 0 0 var(--column-width, 16%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
  height: 100%;
  box-shadow: 0 4px 12px var(--surface-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.column.dragging {
  opacity: 0.7;
  transform: scale(0.98);
}

.column.column-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--info) 0%, var(--info-secondary) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.column-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--text-light);
}

.column-count {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.8);
  margin-left: 8px;
}

/* ── Column Notes Area ── */
.column-notes-area {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--surface-border);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-notes-area);
  min-height: 140px;
  height: 140px;
  transition: height 0.25s ease;
}

.column-notes-area.expanded {
  overflow-y: auto;
  padding-bottom: 18px;
}

.column-notes-area.persist-open {
  box-shadow: inset 0 0 0 1px rgba(47, 42, 29, 0.08);
}

.column-notes-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--bg-notes-font);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  resize: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  min-height: 100%;
}

.column-notes-input::placeholder {
  color: rgba(47, 42, 29, 0.35);
}

.column-notes-input::-webkit-scrollbar {
  width: 4px;
}

.column-notes-input::-webkit-scrollbar-track {
  background: transparent;
}

.column-notes-input::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 2px;
}

.column-notes-input::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

.column-actions {
  position: relative;
}

.btn-menu {
  background: transparent;
  border: none;
  color: rgba(248, 250, 252, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-menu svg {
  width: 18px;
  height: 18px;
}

.btn-menu:hover {
  background: rgba(15, 23, 42, 0.18);
  color: var(--text-light);
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  min-width: 140px;
  margin-top: 6px;
  display: none;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.menu-dropdown.active {
  display: flex;
}

.menu-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px 18px;
  text-align: left;
  font-size: 14px;
  transition: all 0.2s ease;
}

.menu-item:first-child {
  border-radius: 9px 9px 0 0;
}

.menu-item:last-child {
  border-radius: 0 0 9px 9px;
}

.menu-item:hover {
  background: var(--accent-secondary-light);
  color: var(--accent-secondary);
  padding-left: 18px;
}

.menu-item.delete {
  color: var(--danger);
}

.menu-item.delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  padding-left: 18px;
}

/* ── Cards Container ── */
.cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  position: relative;
  z-index: 0;
}

.cards-container > * {
  position: relative;
  z-index: 1;
}

.cards-container::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -1px;
  width: 1px;
  background: linear-gradient(180deg, rgba(209, 216, 230, 0) 0%, rgba(209, 216, 230, 0.7) 50%, rgba(209, 216, 230, 0) 100%);
  pointer-events: none;
}

.cards-container::-webkit-scrollbar {
  width: 6px;
}

.cards-container::-webkit-scrollbar-track {
  background: transparent;
}

.cards-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.cards-container.drag-over {
  background: var(--accent-secondary-light);
  border-radius: 10px;
}

/* ── Card ── */
.card {
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: move;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  box-shadow: var(--card-surface-shadow);
  position: relative;
  animation: cardFadeIn 160ms ease;
}

.card.card-menu-active {
  z-index: 8;
}

.card.compact {
  padding: 8px 10px;
  gap: 6px;
}

.card-pinned {
  background: var(--accent-secondary-light);
  border-color: var(--accent-secondary);
}

.card-pinned .card-title {
  color: var(--accent-secondary);
}

.card-pinned .card-note {
  color: rgba(79, 70, 229, 0.78);
}

.card-pinned .btn-icon {
  color: var(--accent-secondary);
}

.card-pinned .btn-icon:hover {
  background: rgba(79, 70, 229, 0.15);
}

.card-done {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
  opacity: 0.85;
}

.card-done .card-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.card-done .card-note {
  color: rgba(148, 163, 184, 0.9);
}

.card-done .btn-icon {
  color: var(--text-tertiary);
}

.card:hover {
  background: var(--card-surface-hover);
  border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.4), inset 0 0 0 1px rgba(22, 163, 74, 0.18);
}

.card-done:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

.card.dragging {
  opacity: 0.65;
  border-color: var(--accent);
  background: var(--card-surface-hover);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.32);
}

.card-content {
  flex: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--card-text, var(--text-light));
  word-break: break-word;
}

.card-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
  word-break: break-word;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(1.45em * 3);
}


.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: relative;
}

.card-actions.menu-open,
.card:hover .card-actions {
  opacity: 1;
}

.card-menu-button {
  color: var(--icon-muted, var(--text-tertiary));
  padding: 4px;
  border-radius: 6px;
}

.card-menu-button:hover {
  color: var(--accent-secondary);
  background: var(--icon-hover, var(--accent-secondary-light));
}

.card-menu-dropdown {
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  z-index: 12;
}

.card-menu-dropdown .menu-item {
  font-size: 13px;
  padding: 10px 16px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--icon-muted, var(--text-tertiary));
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-secondary);
  background: var(--icon-hover, var(--accent-secondary-light));
}

.btn-icon.delete:hover {
  color: var(--danger);
  background: var(--danger-surface, rgba(239, 68, 68, 0.2));
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}

/* ── Add Card Button ── */
.btn-add-card {
  width: 100%;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed var(--surface-border);
  border-radius: 8px;
  padding: 9px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-card::before {
  content: '+';
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.btn-add-card:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  background: var(--accent-secondary-light);
  transform: translateY(-1px);
}
