﻿:root {
  color-scheme: dark;
  --muted: #8a8a8a;
  --border: #1f1f1f;
  --accent: #e3262a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #000;
  color: #fff;
  font:
    14px/1.5 Inter,
    system-ui,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 0;
}
button {
  cursor: pointer;
  min-height: 40px;
  padding: 8px 12px;
  border-color: transparent;
}
button:hover {
  background: #0d0d0d;
}
input,
select {
  min-height: 42px;
  padding: 9px 12px;
}
textarea {
  width: 100%;
  padding: 12px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
}
.primary:hover {
  background: #c91e22;
}
header {
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px;
  padding: 0 24px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 76px;
}
.logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}
nav {
  display: flex;
  gap: 28px;
  align-self: stretch;
}
nav a {
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
nav a[aria-current="page"] {
  color: #fff;
  border-color: #fff;
}
.logout {
  margin-left: auto;
  color: var(--muted);
  padding-inline: 0;
}
main {
  max-width: 928px;
  margin: 48px auto;
  padding: 0 24px;
}
h1 {
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.7px;
  font-weight: 600;
  margin: 0;
}
h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
small,
.count,
.empty {
  color: var(--muted);
}
.heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.heading .primary {
  margin-left: auto;
}
.count {
  font-size: 13px;
  font-weight: 400;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.editor {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: #0d0d0d;
  border-radius: 4px;
  margin-bottom: 28px;
}
.form-actions {
  display: flex;
  gap: 8px;
}
.form-actions button:not(.primary) {
  background: transparent;
  color: var(--muted);
}
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.filters select,
.filters input {
  border-color: transparent;
  color: var(--muted);
  max-width: 50%;
}
.filters select:hover,
.filters select:focus,
.filters input:hover,
.filters input:focus {
  border-color: var(--border);
}
.task-tabs {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.task-tabs button {
  padding: 8px 0;
  color: var(--muted);
  border-radius: 0;
}
.task-tabs button[aria-selected="true"] {
  color: #fff;
}
.task-tabs .count {
  margin-left: 4px;
}
.group {
  margin-bottom: 36px;
}
.group-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.group-heading small {
  font-size: 12px;
}
.task + .task,
.history-item + .history-item {
  border-top: 1px solid var(--border);
}
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  min-height: 60px;
}
.task-row:hover {
  background: #0d0d0d;
}
.check {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 1px solid #666;
  border-radius: 50%;
  cursor: pointer;
}
.check:checked {
  background: #fff;
  border-color: #fff;
}
.check:checked::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg);
  margin: 4px 3px;
}
.task-content {
  flex: 1;
  text-align: left;
  padding: 0;
  min-height: 24px;
  min-width: 0;
  background: transparent;
  border: 0;
}
.task-title {
  font-size: 15px;
  overflow-wrap: anywhere;
  display: block;
}
.done .task-title {
  color: var(--muted);
}
.description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  font-weight: 400;
}
.description.full {
  display: block;
  -webkit-line-clamp: unset;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.task-meta time {
  padding-top: 3px;
}
.remove {
  opacity: 0;
  min-height: 24px;
  padding: 0 4px;
  color: var(--muted);
}
.task:hover .remove,
.task:focus-within .remove {
  opacity: 1;
}
.editor {
  margin: 0 0 16px 30px;
}
.bulk-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: -16px 0 16px;
  color: var(--muted);
}
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.history-delete {
  flex: none;
  margin-top: 12px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
}
.history-item:hover .history-delete,
.history-delete:focus-visible,
.history-delete.confirming {
  opacity: 1;
}
.history-delete.confirming {
  color: #e3262a;
}
@media (hover: none) {
  .history-delete {
    opacity: 1;
  }
}
.history-row {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 70px 155px minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  text-align: left;
  border-radius: 0;
  padding: 16px 0;
}
.history-row time,
.history-site {
  font-size: 12px;
  color: var(--muted);
}
.history-title {
  overflow-wrap: anywhere;
  font-size: 15px;
}
.login {
  max-width: 360px;
  margin-top: 16vh;
}
.login .logo {
  margin-bottom: 36px;
}
.login form {
  display: grid;
  gap: 20px;
}
#error {
  position: fixed;
  bottom: 16px;
  left: 24px;
  right: 24px;
  max-width: 600px;
  margin: auto;
  padding: 14px;
  background: #0d0d0d;
  border: 1px solid var(--accent);
  z-index: 5;
}
.empty {
  margin: 24px 0;
}
@media (hover: none) {
  .remove {
    opacity: 1;
  }
}
@media (max-width: 600px) {
  .header-inner {
    gap: 12px;
    min-height: 76px;
  }
  .header-inner .logo {
    width: clamp(96px, 30vw, 130px);
    height: auto;
  }
  nav {
    gap: 12px;
  }
  .logout {
    white-space: nowrap;
    min-height: 28px;
    padding-block: 0;
  }
  .heading {
    gap: 8px;
  }
  .heading .primary {
    font-size: 13px;
    padding: 8px;
  }
  .filters {
    gap: 10px;
    flex-wrap: wrap;
  }
  .filters select {
    max-width: 52%;
    padding-inline: 4px;
    font-size: 14px;
  }
  .filters input[type="search"] {
    max-width: 100%;
    width: 100%;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .task-row {
    gap: 8px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
  }
  .task-meta {
    grid-column: 2;
    justify-content: space-between;
  }
  .remove {
    opacity: 1;
  }
  .editor {
    margin-left: 0;
    padding: 16px;
  }
  .group-heading {
    gap: 6px;
  }
  .group-heading small {
    font-size: 11px;
  }
  .history-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 5px 12px;
  }
  .history-title {
    grid-column: 2;
  }
  .task-tabs {
    gap: 12px;
  }
  .task-tabs button {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

body.modal-open {
  overflow: hidden;
}
#add-dialog {
  width: 560px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: #fff;
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 14px;
}
#add-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}
.modal-fields {
  display: grid;
  gap: 20px;
  padding: 24px;
}
.modal-fields select {
  justify-self: start;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
}
.modal-fields input,
.modal-fields textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  width: 100%;
}
.modal-fields input {
  font-size: 20px;
  font-weight: 600;
}
.modal-fields textarea {
  font-size: 15px;
  line-height: 24px;
  min-height: 96px;
  max-height: 288px;
  resize: none;
}
.add-form .form-actions {
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #262626;
}
.primary:disabled {
  opacity: 0.4;
  cursor: default;
}
@media (max-width: 600px) {
  #add-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }
  .modal-fields textarea,
  .modal-fields select {
    font-size: 16px;
  }
  .add-form .form-actions {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

.modal-fields input:focus-visible,
.modal-fields textarea:focus-visible {
  outline: none;
  box-shadow: 0 1px 0 var(--accent);
}
