:root {
  --bg: #ffffff;
  --col: #f4f5f7;
  --card: #ffffff;
  --text: #111319;
  --muted: #5f6672;
  --line: #dfe2e7;
  --accent: #0366d6;
  --accent-text: #ffffff;
  --over: #e6effb;
  --shadow: 0 1px 2px rgba(17, 19, 25, 0.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111319;
    --col: #1b1e25;
    --card: #23272f;
    --text: #e6e8eb;
    --muted: #9aa1ac;
    --line: #333844;
    --accent: #4e9cf5;
    --accent-text: #0b0d11;
    --over: #1c2a3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.loading, .msg, .home { padding: 24px 16px; max-width: 560px; margin: 0 auto; }
.msg h1, .home h1 { font-size: 18px; margin: 0 0 8px; }
.msg p, .home p { color: var(--muted); margin: 0 0 16px; }
.err { color: #c0392b !important; }
.result code { display: block; padding: 8px; margin: 0 0 8px; background: var(--col); border-radius: 6px; word-break: break-all; }

.top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.board-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

.board {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; overflow-x: auto; min-height: calc(100% - 50px);
}
.column {
  flex: 0 0 272px; max-width: 85vw;
  background: var(--col); border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.add-column { background: transparent; border: 1px dashed var(--line); }
.empty { flex: 0 0 272px; padding: 8px; color: var(--muted); }

.col-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.col-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { color: var(--muted); font-size: 12px; }

.cards { display: flex; flex-direction: column; gap: 6px; min-height: 8px; border-radius: 6px; padding: 2px; }
.cards.over { background: var(--over); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px; box-shadow: var(--shadow);
}
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: 0.4; }
.card-main { display: flex; gap: 6px; align-items: flex-start; }
.card-title { font-weight: 500; overflow-wrap: anywhere; }
.icon { flex: 0 0 auto; }
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.placeholder { height: 36px; border: 2px dashed var(--accent); border-radius: 6px; opacity: 0.6; }

.move, .col-menu {
  font: inherit; font-size: 12px; color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; cursor: pointer;
}
.move { margin-top: 6px; width: 100%; border-color: var(--line); }
.col-menu { width: 28px; }
.move:focus, .col-menu:focus { border-color: var(--accent); outline: none; }
/* Em telas com mouse, o "Mover para…" só aparece ao passar por cima do card. */
@media (hover: hover) and (pointer: fine) {
  .card .move { display: none; }
  .card:hover .move, .card:focus-within .move { display: block; }
}

.row { display: flex; gap: 6px; flex-wrap: wrap; }
.input {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; margin-bottom: 6px;
}
.home .row .input { flex: 1; min-width: 200px; margin: 0; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 6px 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--col); color: var(--text); }
.btn.add { width: 100%; text-align: left; }

.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 13px;
  max-width: calc(100% - 32px);
}
