:root {
  --bg: #f4f4f5;
  --column: #e4e4e7;
  --card: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --chip: #e4e4e7;
  --due: #b91c1c;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --column: #18181b;
    --card: #27272a;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --accent: #3b82f6;
    --chip: #3f3f46;
    --due: #f87171;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

#app {
  height: 100%;
}

.signin {
  height: 100%;
  display: grid;
  place-items: center;
}

.signin button,
.sheet .primary {
  background: var(--accent);
  color: var(--accent-text);
  padding: 14px 22px;
  border-radius: var(--radius);
  font-weight: 600;
}

.board {
  height: 100%;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: calc(env(safe-area-inset-top) + 12px) max(12px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 12px) max(12px, env(safe-area-inset-left));
}

.column {
  flex: 0 0 min(86vw, 320px);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  background: var(--column);
  border-radius: var(--radius);
  min-height: 0;
}

.column header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px 6px;
}

.column h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.count {
  color: var(--muted);
  font-size: 13px;
}

.column.over {
  outline: 2px solid var(--accent);
}

.add {
  margin: 0 10px 8px;
}

.add input {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
}

.add input:focus {
  background: var(--card);
  outline: none;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
  overflow-y: auto;
}

.card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 10px;
  padding: 10px 10px 10px 12px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

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

.card .title {
  flex: 1;
  text-align: left;
  padding: 0;
}

.due {
  display: block;
  font-size: 12px;
  color: var(--due);
  margin-top: 2px;
}

.people {
  display: flex;
  gap: 6px;
}

.person {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.person.on {
  background: var(--accent);
  color: var(--accent-text);
}

.more {
  margin: 0 10px 12px;
  padding: 8px;
  color: var(--muted);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: min(100%, 480px);
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.sheet .move {
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  background: var(--column);
}

.sheet .move:disabled {
  opacity: 0.45;
  cursor: default;
}

.sheet a {
  color: var(--accent);
  padding: 12px;
  text-align: center;
  text-decoration: none;
}

#notice {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 90vw;
}
