/* Палитра и размеры собраны здесь, чтобы оформление было легко менять. */
:root {
  color-scheme:dark;
  --background:#293133;
  --text:#f0f1ec;
  --accent:#b8c9cb;
  --muted:#a8b3b3;
  --line:#465052;
  --surface:#303a3c;
  --radius:16px;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--text);
  background:var(--background);
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  min-width:320px;
}

button,input,select {
  font:inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color:transparent;
}

button {
  cursor:pointer;
  color:inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:5px;
}


a {
  color:inherit;
  text-decoration:none;
}

[hidden] {
  display:none!important;
}

.site-header {
  max-width: 1320px;
  margin: auto;
  display: flex;
  align-items: center;
  padding: 35px 48px;
}

.brand {
  font-size: 24px;
  font-weight:700;
  letter-spacing:-.8px;
  display:flex;
  align-items:center;
  gap:9px;
}

.brand-mark {
  display:grid;
  place-items:center;
  background:var(--accent);
  color:var(--background);
  width:29px;
  height:29px;
  border-radius:9px;
  font-size: 19px;
}

.brand-dot {
  color:var(--accent);
  margin-left:-8px;
}

main {
  max-width:900px;
  margin:66px auto 0;
  padding:0 24px 48px;
}

.eyebrow {
  color:var(--accent);
  font-size: 13px;
  font-weight:700;
  letter-spacing:3px;
  margin:0 0 24px;
}

h1 {
  font-size:clamp(44px,5.5vw,64px);
  line-height:1.1;
  letter-spacing:-2.6px;
  margin:0;
  font-weight:500;
}

h1 span {
  color:var(--accent);
}

.description {
  font-size: 17px;
  line-height:1.8;
  color:var(--muted);
  margin:22px 0 38px;
}

.workspace {
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:linear-gradient(120deg,#343e40,#2e383a);
  overflow:hidden;
  box-shadow:0 18px 60px #151b1d18;
}

.list-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:25px 26px 20px;
}

h2 {
  font-size: 20px;
  margin:0;
  font-weight:500;
}

#total-count {
  font-size: 14px;
  color:var(--accent);
  margin-left:7px;
  background:#414d4f;
  padding:3px 7px;
  border-radius:5px;
}

.local-badge {
  font-size: 13px;
  color:var(--muted);
  display:flex;
  gap:6px;
  align-items:center;
}

#task-form {
  display:flex;
  align-items:center;
  margin:0 25px 22px;
  background:#293234;
  border:1px solid #576366;
  border-radius:10px;
  padding:6px;
  gap:7px;
}

.input-plus {
  font-size: 22px;
  color:var(--accent);
  padding-left:9px;
}

#task-input {
  width:100%;
  min-width:0;
  background:transparent;
  border:0;
  color:var(--text);
  padding:11px 4px;
  font-size: 16px;
}

#task-input::placeholder {
  color:#99a7a8;
}

#task-input:focus {
  outline:none;
}

#task-form:focus-within {
  border-color:var(--accent);
}

.add-button {
  background:var(--accent);
  color:var(--background);
  border:0;
  border-radius:6px;
  padding:12px 16px;
  font-size: 15px;
  font-weight:700;
  white-space:nowrap;
}

.add-button:hover {
  background:#d1ddde;
}

.toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 25px 17px;
  border-bottom:1px solid var(--line);
}

.filters {
  display:flex;
  gap:5px;
}

.filters button {
  border:0;
  background:transparent;
  color:var(--muted);
  border-radius:6px;
  padding:7px 12px;
  font-size: 14px;
}

.filters button[aria-pressed=true] {
  background:#485557;
  color:var(--text);
}

.remaining {
  font-size: 14px;
  color:var(--muted);
}

#task-list {
  padding:0;
  margin:0;
  list-style:none;
}

.task-item {
  display:flex;
  align-items:center;
  gap:13px;
  min-height:66px;
  padding:15px 26px;
  border-bottom:1px solid #46505280;
}

.task-label {
  display:flex;
  align-items:center;
  gap:13px;
  flex:1;
  min-width:0;
  cursor:pointer;
}

.task-checkbox {
  appearance:none;
  flex-shrink:0;
  width:20px;
  height:20px;
  border:1px solid #829294;
  border-radius:6px;
  margin:0;
  display:grid;
  place-content:center;
  cursor:pointer;
}

.task-checkbox:checked {
  background:var(--accent);
  border-color:var(--accent);
}

.task-checkbox:checked::after {
  content:'✓';
  color:var(--background);
  font-size: 17px;
  font-weight:bold;
}

.task-text {
  font-size: 17px;
  line-height:1.5;
  overflow-wrap:anywhere;
}


.delete-button {
  width:30px;
  height:30px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size: 20px;
}

.delete-button:hover {
  color:var(--text);
  background:#4c5759;
}

.empty-state {
  text-align:center;
  padding:34px 15px 39px;
}

.empty-icon {
  display:grid;
  place-items:center;
  margin:0 auto 15px;
  border:1px solid #5a696b;
  border-radius:14px;
  width:45px;
  height:45px;
  color:var(--accent);
  font-size: 23px;
  transform:rotate(-7deg);
}

h3 {
  font-size: 17px;
  font-weight:400;
  margin:0 0 9px;
}

.empty-state p {
  font-size: 15px;
  color:var(--muted);
  line-height:1.6;
  margin:0;
}

.list-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:17px 26px;
  border-top:1px solid var(--line);
  min-height:49px;
  font-size: 13px;
  color:var(--muted);
}

#clear-completed {
  border:0;
  padding:0;
  background:none;
  font-size: 13px;
  color:var(--accent);
}

#clear-completed:hover {
  text-decoration:underline;
}

.progress-track {
  height:3px;
  background:#394547;
}

#progress-bar {
  height:100%;
  background:var(--accent);
  width:0;
  transition:width .25s;
}

.status {
  font-size: 15px;
  color:var(--accent);
  margin:10px 0;
  min-height:15px;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* На телефоне сохраняем удобный ввод и крупные области нажатия. */
@media(max-width:600px) {
  .site-header {
    padding:25px 22px;
  }
  main {
    margin-top:38px;
    padding:0 18px 32px;
  }
  h1 {
    letter-spacing:-1.8px;
  }
  .description {
    font-size: 16px;
  }
  .list-heading {
    padding:23px 18px;
  }
  .local-badge {
    font-size: 12px;
  }
  #task-form {
    margin:0 16px 18px;
  }
  .add-button {
    padding:12px;
  }
  .toolbar {
    padding:0 16px 15px;
  }
  .filters button {
    padding:9px;
  }
  .remaining {
    font-size: 13px;
  }
  .task-item {
    padding:15px 18px;
  }
  .list-footer {
    padding:17px 18px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
  }
}

/* Выбор проекта фильтрует список, не меняя сами задачи. */
.projects {
  margin: 0 0 24px;
}

.projects-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.projects-heading h2 {
  font-size: 16px;
  color: var(--muted);
}

.projects-heading button {
  background: transparent;
  border: 0;
  font-size: 15px;
  color: var(--accent);
  padding: 8px 0 8px 12px;
}

.project-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 15px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}

.project-list button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--background);
  border-color: var(--accent);
}

.project-list button span {
  margin-left: 9px;
  opacity: .7;
}

#project-form {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#project-name {
  min-width: 120px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  font-size: 16px;
}

#project-form button {
  background: var(--accent);
  color: var(--background);
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 15px;
}

#project-form #cancel-project {
  background: transparent;
  color: var(--muted);
}

.project-assignment {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 26px 20px;
  font-size: 14px;
  color: var(--muted);
}

#task-project {
  min-width: 0;
  max-width: 55%;
  border: 1px solid var(--line);
  background: var(--background);
  color: var(--text);
  border-radius: 6px;
  padding: 7px;
  font-size: 14px;
}

.task-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.task-project-name {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.task-checkbox:checked + .task-content .task-text {
  text-decoration: line-through;
  color: var(--muted);
}

.move-task {
  max-width: 160px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--background);
  color: var(--muted);
  padding: 7px;
  font-size: 13px;
}

@media (max-width: 600px) {
  .move-task {
    max-width: 145px;
  }
  .task-item {
    gap: 8px;
  }
}

/* Своя стрелка сохраняет одинаковый отступ от края в разных браузерах. */
#task-project,
.move-task {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 38px 10px 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

@media (max-width: 600px) {
  .project-assignment {
    margin-right: 18px;
    margin-left: 18px;
    flex-wrap: wrap;
  }
  #task-project {
    max-width: 100%;
  }
  .task-item {
    flex-wrap: wrap;
  }
  .task-label {
    flex-basis: calc(100% - 44px);
  }
  .move-task {
    order: 3;
    margin-left: 33px;
    max-width: calc(100% - 33px);
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .list-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .list-footer {
    flex-wrap: wrap;
    gap: 12px;
  }
}


/* Действия относятся к выбранному проекту; системные группы удалить нельзя. */
.archive-toggle,
.project-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
}
.archive-toggle { margin-bottom: 12px; }
.archive-toggle[aria-pressed="true"] { background: var(--surface); }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#selected-project-name { flex: 1; min-width: 100px; overflow-wrap: anywhere; font-size: 15px; }
#delete-project { color: #e3b5ae; }
.archive-empty { color: var(--muted); font-size: 15px; }
