:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee6;
  --text: #18202b;
  --muted: #667085;
  --accent: #1f7a5b;
  --warn: #9a6700;
  --bad: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 28px; }
.topbar p, .column-count, .meta, .reason, .matrix p { color: var(--muted); font-size: 13px; line-height: 18px; }

button, select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
button:hover { border-color: #a8b3c3; }
.actions, .exchange-settings { display: flex; gap: 8px; flex-wrap: wrap; }
.exchange-settings { padding: 12px 20px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.exchange-button[data-status="red"] { color: var(--bad); }
.exchange-button[data-status="yellow"] { color: var(--warn); }

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px 20px 24px;
  min-width: 1180px;
}
.column {
  background: #eef1f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 70vh;
}
.column-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
}
.column h3 { font-size: 14px; }
.cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.card-title { font-size: 14px; font-weight: 650; line-height: 18px; }
.card-description { color: #3d4755; font-size: 13px; line-height: 17px; max-height: 68px; overflow: hidden; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; line-height: 16px; padding: 2px 6px; border-radius: 999px; background: #edf7f3; color: var(--accent); }
.badge.source { background: #eef2ff; color: #3538a4; }
.reason { color: var(--bad); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions select { width: 100%; }
.card a { color: var(--accent); font-size: 13px; text-decoration: none; }

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  width: min(920px, calc(100vw - 24px));
}
dialog::backdrop { background: rgba(24, 32, 43, 0.38); }
.modal { padding: 16px; display: grid; gap: 14px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; }
.icon-button { width: 36px; padding: 0; font-size: 22px; }
.matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.matrix-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}
.matrix-card h3 { font-size: 13px; margin-bottom: 6px; }
.matrix-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 18px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font: inherit;
  color: var(--text);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .board { grid-template-columns: 1fr; min-width: 0; }
  .column { min-height: 240px; }
  .matrix, .filter-grid { grid-template-columns: 1fr; }
}
