:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-muted: #eef3f0;
  --text: #17201c;
  --muted: #637168;
  --line: #dbe2dd;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warning: #a16207;
  --review: #5b5fc7;
  --done: #2f7d32;
  --shadow: 0 1px 2px rgba(23, 32, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 750;
  text-decoration: none;
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-name,
.eyebrow,
.meta-row,
.flash,
.empty {
  color: var(--muted);
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 56px;
}

.login-page {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1,
.page-head h1 {
  margin: 0 0 18px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stack,
.task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.field {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea.field {
  resize: vertical;
}

.field:focus {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.add-task {
  margin: 0 0 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.add-task summary,
.edit-panel summary {
  cursor: pointer;
  font-weight: 750;
}

.add-task[open] summary {
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px minmax(180px, 260px);
  gap: 12px;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.column {
  min-width: 0;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
}

.column h2 {
  margin: 0;
  font-size: 0.98rem;
  text-transform: capitalize;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.task-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.task-card h3 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.description {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.82rem;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.badge-doing {
  color: var(--warning);
}

.badge-review {
  color: var(--review);
}

.badge-done {
  color: var(--done);
}

.status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.compact {
  min-height: 36px;
}

.edit-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.compact-form {
  margin-top: 10px;
}

.empty {
  margin: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .logout-form {
    justify-content: space-between;
  }

  .page {
    width: min(100vw - 20px, 1180px);
    margin-top: 18px;
  }

  .board {
    grid-template-columns: 1fr;
  }
}
