:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --col-bg: #eceef2;
  --fg: #1c1f26;
  --muted: #6b7280;
  --dim: #9aa1ad;
  --border: #e3e5ea;
  --border-strong: #d1d5db;
  --accent: #6e56cf;
  --accent-soft: #f1edff;
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.05), 0 1px 1px rgba(20, 25, 40, 0.03);
  --shadow-md: 0 4px 12px rgba(20, 25, 40, 0.08), 0 2px 4px rgba(20, 25, 40, 0.04);
  --shadow-lg: 0 12px 30px rgba(20, 25, 40, 0.12), 0 4px 8px rgba(20, 25, 40, 0.05);

  /* label colors (soft pastels) */
  --c-py-bg: #e8f0fe;     --c-py-fg: #1a56db;
  --c-db-bg: #fef3c7;     --c-db-fg: #92400e;
  --c-es-bg: #d1fae5;     --c-es-fg: #065f46;
  --c-cpp-bg: #ede9fe;    --c-cpp-fg: #5b21b6;
  --c-lead-bg: #fce7f3;   --c-lead-fg: #9d174d;
  --c-arch-bg: #e0e7ff;   --c-arch-fg: #3730a3;
  --c-ai-bg: #ecfeff;     --c-ai-fg: #0e7490;
  --c-k8s-bg: #e0f2fe;    --c-k8s-fg: #075985;
  --c-edu-bg: #fef2c7;    --c-edu-fg: #854d0e;
  --c-fam-bg: #ffe4e6;    --c-fam-fg: #9f1239;
  --c-run-bg: #dcfce7;    --c-run-fg: #166534;
  --c-coffee-bg: #f5e6d3; --c-coffee-fg: #78350f;
  --c-old-bg: #e5e7eb;    --c-old-fg: #374151;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- TOP BAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: white;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14px; font-weight: 600; }
.brand-text .muted { font-size: 12px; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dim);
}
.dot.live {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn.ghost {
  border-color: var(--border);
  color: var(--fg);
  background: var(--panel);
}
.btn.ghost:hover { background: #f9fafb; text-decoration: none; }
.btn.primary {
  background: var(--accent);
  color: white;
}
.btn.primary:hover { background: #5b46b5; text-decoration: none; }

/* ---------- LAYOUT ---------- */
.board-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- SIDEBAR ---------- */
.sidebar { min-width: 0; }
.card-pin {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}
.pin-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.avatar-big {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-soft);
}
.pin-head h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.pin-head .role {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.small { font-size: 11px; }

.pin-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pin-section:last-child { border-bottom: none; padding-bottom: 0; }
.pin-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.pin-section p {
  font-size: 13px;
  color: var(--fg);
  line-height: 1.55;
}
.agreements {
  padding-left: 1.1rem;
  font-size: 13px;
  line-height: 1.55;
}
.agreements li { padding: 0.15rem 0; }
.agreements li::marker { color: var(--accent); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.language-list {
  display: grid;
  gap: 0.55rem;
}
.language-list div {
  display: grid;
  gap: 0.1rem;
}
.language-list dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.language-list dd {
  font-size: 12px;
  color: var(--muted);
}

.thought blockquote {
  font-size: 13px;
  line-height: 1.55;
  font-style: italic;
  color: var(--fg);
  padding: 0.7rem 0.85rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

/* ---------- LABELS / CHIPS ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.c-py     { background: var(--c-py-bg);     color: var(--c-py-fg); }
.c-db     { background: var(--c-db-bg);     color: var(--c-db-fg); }
.c-es     { background: var(--c-es-bg);     color: var(--c-es-fg); }
.c-cpp    { background: var(--c-cpp-bg);    color: var(--c-cpp-fg); }
.c-lead   { background: var(--c-lead-bg);   color: var(--c-lead-fg); }
.c-arch   { background: var(--c-arch-bg);   color: var(--c-arch-fg); }
.c-ai     { background: var(--c-ai-bg);     color: var(--c-ai-fg); }
.c-k8s    { background: var(--c-k8s-bg);    color: var(--c-k8s-fg); }
.c-edu    { background: var(--c-edu-bg);    color: var(--c-edu-fg); }
.c-fam    { background: var(--c-fam-bg);    color: var(--c-fam-fg); }
.c-run    { background: var(--c-run-bg);    color: var(--c-run-fg); }
.c-coffee { background: var(--c-coffee-bg); color: var(--c-coffee-fg); }
.c-old    { background: var(--c-old-bg);    color: var(--c-old-fg); }

/* ---------- BOARD ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 1rem;
  min-width: 0;
}
.column {
  background: var(--col-bg);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 200px;
  transition: background 0.15s;
}
.column.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}
.col-head { padding: 0.25rem 0.25rem 0.5rem; }
.col-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}
.col-title h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
}
.s-todo  { background: #9aa1ad; }
.s-doing { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
.s-done  { background: #10b981; }
.count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin-left: auto;
}
.col-sub {
  font-size: 11px;
  color: var(--muted);
  padding-left: 1px;
}

.col-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 40px;
}

.col-add {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.2rem;
}
.col-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- CARD ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem 0.6rem;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  position: relative;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.card:active { cursor: grabbing; }
.card.dragging {
  opacity: 0.4;
  transform: rotate(2deg) scale(0.98);
}
.card.done { opacity: 0.95; }
.card.done h3 { color: #4b5563; }

.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}
.card-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  font-weight: 500;
  margin-right: auto;
}
.card h3 {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.card p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.meta {
  font-size: 11px;
  color: var(--muted);
}
.assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  color: var(--fg);
}
.assignee img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- FOOTER ---------- */
.page-foot {
  text-align: center;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--panel);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .board-wrap { grid-template-columns: 1fr; }
  .card-pin { position: static; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .board { grid-template-columns: 1fr; }
  .topbar-actions .pill { display: none; }
}
@media (max-width: 500px) {
  .topbar { flex-wrap: wrap; }
  .board-wrap { padding: 0.75rem; }
}
