/* Trello-ish board. Three columns of cards. Read-only. Dark/light aware
   via prefers-color-scheme so the page looks at home in either. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #ebecf0;
  --text: #172b4d;
  --text-muted: #5e6c84;
  --border: #dfe1e6;
  --shadow: 0 1px 0 rgba(9, 30, 66, 0.25);
  --accent: #0b7285;
  --chip-todo: #dfe1e6;
  --chip-doing: #ffe9b3;
  --chip-done: #c2e9d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #21262d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    --accent: #58a6ff;
    --chip-todo: #30363d;
    --chip-doing: #5a4316;
    --chip-done: #14432f;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.topbar {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}
.topbar .subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.topbar code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; }
}

.column {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0 4px;
}

.column-count {
  background: var(--surface);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 500;
}

.card {
  background: var(--surface);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.05s ease;
  text-align: left;
  border: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card:hover { transform: translateY(-1px); }
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-title {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.assignees {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.assignee {
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.card-id {
  color: var(--text-muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 16px 0;
  font-style: italic;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px;
}

.error {
  grid-column: 1 / -1;
  text-align: center;
  color: #d1242f;
  padding: 48px;
}

/* Modal. Stays simple — an overlay + a centered card. */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 30, 66, 0.54);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.25);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip[data-status="todo"]  { background: var(--chip-todo); color: var(--text-muted); }
.chip[data-status="doing"] { background: var(--chip-doing); color: #7a4f01; }
.chip[data-status="done"]  { background: var(--chip-done);  color: #1f6e43; }

@media (prefers-color-scheme: dark) {
  .chip[data-status="doing"] { color: #f5cd6f; }
  .chip[data-status="done"]  { color: #7ee2b3; }
}

.modal-assignees {
  display: flex;
  gap: 4px;
}

.modal-description {
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}
.modal-description p { margin: 0 0 12px; }
.modal-description code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.modal-description ul, .modal-description ol { padding-left: 22px; }
.modal-description a { color: var(--accent); }

.modal-footer {
  padding: 10px 20px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  border-top: 1px solid var(--border);
}

.muted { color: var(--text-muted); }
