:root {
  color: #1c1c1e;
  background: #fafafa;
  font: 14px/1.4 system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

header {
  position: relative;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

header h1,
.login-card h1 {
  font-size: 1.15rem;
  margin: 0;
}

header h1 {
  margin-right: auto;
}

header label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #444;
}

header input,
header select,
.login-card input,
.field input,
.field select,
.field textarea,
.rename-input,
.vocab-list input,
.vocab-add input,
.add-card input,
.add-list input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

header button,
.primary,
.add-card button,
.add-list button,
.vocab-add button,
.vocab-list button {
  padding: 0.35rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.primary {
  background: #1c1c1e;
  color: #fff;
  border-color: #1c1c1e;
}

#who {
  color: #555;
}

.filter-note,
.filter-error,
.banner {
  margin: 0;
  padding: 0.35rem 1rem;
}

.filter-note {
  color: #555;
}

.filter-error,
.banner,
.form-error,
.login-card #error {
  color: #e5484d;
}

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  overflow-x: auto;
  padding: 0.75rem 1rem 1rem;
  scroll-snap-type: x proximity;
}

.column,
.add-list {
  flex: 0 0 280px;
  scroll-snap-align: start;
  max-height: 100%;
}

.column {
  display: flex;
  flex-direction: column;
  background: #eee;
  border-radius: 8px;
  min-height: 8rem;
}

.column-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.55rem 0.35rem;
}

.list-title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  cursor: text;
  overflow-wrap: anywhere;
}

.rename-input {
  flex: 1;
  min-width: 0;
}

.list-handle {
  border: 0;
  background: transparent;
  padding: 0.1rem 0.25rem;
  color: #666;
  cursor: grab;
}

.closed-badge {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
  background: #1c1c1e;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
}

.text-btn {
  border: 0;
  background: transparent;
  padding: 0.15rem 0.3rem;
}

.danger {
  color: #e5484d;
}

.list-cards {
  overflow-y: auto;
  padding: 0 0.5rem;
  min-height: 2.5rem;
  flex: 1;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.card h3 {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.card.is-hidden {
  display: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.chip {
  font-size: 0.75rem;
  background: #f3f3f5;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.chip.acv {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.add-card,
.add-list,
.vocab-add {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem;
}

.add-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 8px;
  height: fit-content;
}

.add-list-label {
  margin: 0;
  font-weight: 650;
}

.add-card input,
.add-list input,
.vocab-add input,
.vocab-list input {
  flex: 1;
  min-width: 0;
}

.drag-ghost {
  opacity: 0.45;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4vh 1rem;
  background: rgb(0 0 0 / 35%);
  overflow: auto;
}

.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 12px 40px rgb(0 0 0 / 18%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-head h2,
.modal h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal h3 {
  margin: 1rem 0 0.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.field label {
  color: #444;
  font-size: 0.85rem;
}

.field textarea,
.field input,
.field select {
  width: 100%;
}

.description-view {
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  background: #fafafa;
  overflow-wrap: anywhere;
}

.description-view :first-child {
  margin-top: 0;
}

.description-view :last-child {
  margin-bottom: 0;
}

.description-view pre {
  overflow-x: auto;
  padding: 0.5rem;
  background: #fff;
  border-radius: 4px;
}

.empty {
  color: #888;
  font-style: italic;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.form-error {
  min-height: 1.2em;
  margin: 0.6rem 0 0;
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.total {
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.total span {
  color: #555;
  font-size: 0.8rem;
}

.total strong {
  font-variant-numeric: tabular-nums;
}

.pipeline-table {
  width: 100%;
  border-collapse: collapse;
}

.pipeline-table th,
.pipeline-table td {
  text-align: left;
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.pipeline-table td,
.pipeline-table th:not([scope="row"]) {
  text-align: right;
}

.pipeline-table th[scope="row"] {
  text-align: left;
  font-weight: 550;
}

.scroll-x {
  overflow-x: auto;
}

.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.vocab-list {
  list-style: none;
  margin: 0.4rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vocab-list li,
.vocab-add {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0;
}

.login-body {
  min-height: 100vh;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: min(320px, 100%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
}

.login-card label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  color: #444;
}

.login-card input {
  width: 100%;
}

.login-card button {
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.55rem;
  border: 0;
  border-radius: 5px;
  background: #1c1c1e;
  color: #fff;
}

.login-card #error {
  min-height: 1.2em;
  margin-top: 0.75rem;
}

@media (max-width: 720px) {
  .totals,
  .vocab-grid {
    grid-template-columns: 1fr;
  }
}
