:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #66727f;
  --line: #d9e0e7;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --green: #2f6f4e;
  --green-quiet: #e5f1e9;
  --gold: #8a6418;
  --gold-quiet: #f7edcf;
  --red: #9c3f35;
  --red-quiet: #f4ded9;
  --blue: #315f86;
  --blue-quiet: #e0edf6;
  --shadow: 0 14px 30px rgba(31, 41, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

button.secondary {
  background: var(--ink);
}

button:hover,
button:focus-visible {
  filter: brightness(0.95);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  min-height: 58px;
  resize: vertical;
  line-height: 1.35;
}

.shell {
  width: min(1160px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.login-panel {
  display: grid;
  gap: 24px;
  width: min(520px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.error {
  min-height: 1.3em;
  margin: 8px 0 0;
  color: var(--red);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stats span {
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 8px 10px;
  color: var(--muted);
  text-align: center;
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.3rem;
}

.control-row,
.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(390px, 100%);
}

.tab {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--green-quiet);
  border-color: #9dc5aa;
}

.task-form {
  grid-template-columns: 1fr 140px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.lane {
  min-width: 0;
}

.lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.lane-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.lane-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.05);
}

.task[data-priority="1"] {
  border-left-color: var(--red);
}

.task[data-priority="2"] {
  border-left-color: var(--gold);
}

.task[data-priority="3"] {
  border-left-color: var(--blue);
}

.task[data-priority="4"] {
  border-left-color: var(--green);
}

.task.done {
  opacity: 0.7;
}

.task-main {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  min-width: 0;
}

.check {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  margin-top: 4px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--green);
  padding: 0;
}

.check::after {
  content: "";
}

.task.done .check::after {
  content: "✓";
  font-size: 1.25rem;
  font-weight: 900;
}

.task-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.title-input {
  border-color: transparent;
  background: transparent;
  font-weight: 800;
  padding: 4px 0;
}

.notes-input {
  min-height: 54px;
  border-color: transparent;
  background: #f9faf8;
  color: var(--muted);
}

.task-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.task-meta select {
  min-width: 0;
  font-size: 0.86rem;
}

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 16px, 1160px);
    padding-top: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    justify-content: stretch;
  }

  .stats span {
    flex: 1 1 0;
  }

  .control-row,
  .task-form {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

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

  .task-meta {
    grid-template-columns: 1fr;
  }
}
