:root {
  --bg: #1a1814;
  --column: rgba(255, 255, 255, 0.03);
  --column-line: rgba(243, 239, 230, 0.1);
  --paper: #f4efe6;
  --paper-2: #fffdf8;
  --ink: #1c1915;
  --ink-soft: #5e584e;
  --cream: #f3efe6;
  --cream-dim: rgba(243, 239, 230, 0.64);
  --line: #e4dccf;
  --copper: #e07a3d;
  --amber: #e2b15a;
  --sage: #7ea184;
  --danger: #9d3b32;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
}

button,
input,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

#app {
  height: 100%;
  min-width: 0;
}

.board {
  height: 100%;
  min-height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.45;
  color: var(--cream);
  background:
    radial-gradient(880px 380px at 0% -12%, rgba(224, 122, 61, 0.16), transparent 56%),
    radial-gradient(640px 320px at 100% 0%, rgba(126, 161, 132, 0.09), transparent 52%),
    var(--bg);
  position: relative;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--column-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--column-line);
  background: rgba(243, 239, 230, 0.05);
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  align-items: end;
  justify-content: center;
  padding: 8px 0;
}

.mark span {
  display: block;
  width: 4px;
  border-radius: 99px;
  background: var(--amber);
}

.mark span:nth-child(1) {
  height: 12px;
}

.mark span:nth-child(2) {
  height: 20px;
  background: var(--copper);
}

.mark span:nth-child(3) {
  height: 9px;
  background: var(--sage);
}

.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.lede {
  margin: 4px 0 0;
  color: var(--cream-dim);
  font-size: 0.92rem;
}

.tally {
  margin: 0 0 2px;
  flex: none;
  font-size: 0.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--cream-dim);
}

.columns {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}

.column {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--column-line);
  background: var(--column);
  scroll-snap-align: center;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.column[data-column="doing"] {
  background: rgba(224, 122, 61, 0.07);
  border-color: rgba(224, 122, 61, 0.24);
}

.column.is-drop {
  background: rgba(243, 239, 230, 0.06);
  border-color: rgba(224, 122, 61, 0.45);
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
  padding-inline: 2px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--amber);
  flex: none;
}

.column[data-column="doing"] .dot {
  background: var(--copper);
}

.column[data-column="done"] .dot {
  background: var(--sage);
}

.column-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.count {
  margin-left: auto;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(243, 239, 230, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.list {
  flex: 1;
  min-height: 96px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px;
  scrollbar-color: rgba(243, 239, 230, 0.28) transparent;
  overscroll-behavior: contain;
}

.empty {
  margin: 0;
  padding: 20px 10px;
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.85rem;
  border: 1px dashed rgba(243, 239, 230, 0.16);
  border-radius: 12px;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 4px;
  align-items: start;
  padding: 6px 6px 10px 2px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.14);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.card:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.card.is-entering {
  animation: card-in 220ms var(--ease);
}

.card.is-floating {
  position: fixed;
  z-index: 40;
  margin: 0;
  pointer-events: none;
  cursor: grabbing;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
  transform: rotate(1.25deg) scale(1.025);
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.placeholder {
  border-radius: 12px;
  border: 1.5px dashed rgba(224, 122, 61, 0.75);
  background: rgba(224, 122, 61, 0.1);
  box-sizing: border-box;
}

.grip,
.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  touch-action: none;
}

.grip {
  align-self: center;
  cursor: grab;
}

.icon-btn:hover,
.grip:hover,
.icon-btn:focus-visible,
.grip:focus-visible {
  background: rgba(28, 25, 21, 0.06);
  color: var(--ink);
}

.card-actions {
  display: flex;
}

.icon-btn .confirm-label {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 2px;
}

.icon-btn[data-armed="1"] {
  width: auto;
  padding-inline: 8px;
  color: var(--danger);
  background: rgba(157, 59, 50, 0.1);
}

.icon-btn[data-armed="1"] .confirm-label {
  display: inline;
}

.card-body {
  min-width: 0;
  padding-top: 10px;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-desc[hidden],
.add[hidden] {
  display: none !important;
}

.card-desc {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.add,
.primary,
.ghost,
.move {
  min-height: 44px;
  border-radius: 10px;
  transition: transform 150ms ease-out, background 150ms var(--ease), border-color 150ms var(--ease);
}

.add:active,
.primary:active,
.ghost:active,
.move:active:not(:disabled) {
  transform: scale(0.96);
}

.add {
  margin-top: 10px;
  border: 1px dashed rgba(243, 239, 230, 0.22);
  background: transparent;
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}

.add:hover {
  background: rgba(243, 239, 230, 0.06);
  border-color: rgba(243, 239, 230, 0.4);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.composer[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.sheet .field {
  color: var(--ink-soft);
}

.composer input,
.composer textarea,
.sheet input,
.sheet textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  color-scheme: light;
}

.composer textarea,
.sheet textarea {
  min-height: 96px;
  resize: vertical;
}

.composer input:focus-visible,
.composer textarea:focus-visible,
.sheet input:focus-visible,
.sheet textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

::placeholder {
  color: #9a9286;
}

.composer-actions,
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-actions {
  margin-top: 4px;
}

.primary {
  border: 0;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.composer .primary {
  background: var(--cream);
  color: var(--ink);
}

.ghost {
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
}

.composer .ghost {
  color: var(--cream-dim);
}

.danger-text {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 600;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
}

.danger-text:hover {
  background: rgba(157, 59, 50, 0.08);
}

.push {
  margin-left: auto;
}

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

.move {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
}

.move[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.sheet {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: calc(100vw - 28px);
}

.sheet::backdrop {
  background: rgba(18, 16, 14, 0.64);
}

.sheet-card {
  width: min(440px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.sheet[open] .sheet-card {
  animation: sheet-in 180ms var(--ease);
}

.sheet-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.move-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

body.is-dragging .list {
  scroll-behavior: auto;
}

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

.ico {
  display: grid;
  place-items: center;
}

.switcher {
  display: none;
}

@media (max-width: 800px) {
  .top {
    padding: 16px 14px 12px;
  }

  .brand h1 {
    font-size: 1.5rem;
  }

  .lede {
    font-size: 0.82rem;
  }

  .switcher {
    display: flex;
    gap: 8px;
    padding: 12px 14px 0;
  }

  .switcher button {
    flex: 1;
    min-height: 44px;
    border: 1px solid var(--column-line);
    border-radius: 999px;
    background: transparent;
    color: var(--cream);
    font-size: 0.88rem;
    font-weight: 500;
  }

  .switcher button[aria-pressed="true"] {
    background: var(--cream);
    color: var(--ink);
    border-color: var(--cream);
  }

  .columns {
    padding: 12px;
    gap: 12px;
    scroll-snap-type: x mandatory;
  }

  .column {
    flex: 0 0 84%;
    min-width: 84%;
  }
}

@media (hover: hover) {
  .card-actions {
    opacity: 0;
    transition: opacity 150ms var(--ease);
  }

  .card:hover .card-actions,
  .card:focus-within .card-actions {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .card.is-floating {
    transform: none;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
