:root {
  color-scheme: light;
  --page: #f4f6f2;
  --surface: #ffffff;
  --surface-soft: #f9faf8;
  --ink: #17211d;
  --muted: #66706b;
  --subtle: #6f7773;
  --line: #dde3df;
  --accent: #356859;
  --accent-dark: #285347;
  --accent-soft: #e5f0eb;
  --warning: #a94f42;
  --warning-soft: #fff0ed;
  --shadow: 0 20px 60px rgba(33, 54, 45, 0.08);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(53, 104, 89, 0.09), transparent 30rem),
    var(--page);
}

button,
input {
  font: inherit;
}

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

.page-shell {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(53, 104, 89, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.025em;
}

.brand small {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #68a584;
  box-shadow: 0 0 0 4px rgba(104, 165, 132, 0.13);
}

main {
  padding-top: 46px;
}

.task-creator {
  padding: clamp(27px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.creator-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.creator-heading h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 50px);
  font-weight: 680;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.creator-description {
  max-width: 630px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.local-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 650;
}

.local-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #68a584;
}

.task-form {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.form-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
}

.field-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 680;
}

input {
  display: block;
  width: 100%;
  min-height: 49px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #747c78;
}

input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(53, 104, 89, 0.1);
}

input[aria-invalid="true"] {
  border-color: var(--warning);
}

.field-error {
  min-height: 17px;
  margin: 5px 0 0;
  color: var(--warning);
  font-size: 11px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.form-alert {
  margin: 0 auto 0 0;
  color: var(--warning);
  font-size: 12px;
  font-weight: 650;
}

.button {
  min-height: 47px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
.task-toggle input:focus-visible + .toggle-box {
  outline: 3px solid rgba(53, 104, 89, 0.25);
  outline-offset: 3px;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 162px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 9px 24px rgba(53, 104, 89, 0.2);
}

.button-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 28px rgba(53, 104, 89, 0.24);
}

.button-primary span {
  font-size: 19px;
  font-weight: 400;
}

.tasks-section {
  padding-top: 55px;
}

.tasks-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
}

.tasks-toolbar .eyebrow {
  margin-bottom: 7px;
}

.tasks-toolbar h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.045em;
}

.task-summary {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-summary span {
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.task-summary strong {
  margin-left: 3px;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.task-list {
  display: none;
}

.task-list.has-tasks {
  display: grid;
  gap: 12px;
}

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 94px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(33, 54, 45, 0.03);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease, opacity 170ms ease;
}

.task-item:hover {
  border-color: #cbd9d3;
  box-shadow: 0 13px 30px rgba(33, 54, 45, 0.07);
  transform: translateY(-1px);
}

.task-item[data-state="overdue"] {
  border-color: #e6c9c4;
}

.task-item.is-completed {
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.76;
}

.task-toggle {
  display: grid;
  position: relative;
  cursor: pointer;
}

.task-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-box {
  display: block;
  width: 25px;
  height: 25px;
  position: relative;
  border: 1.5px solid #aebbb5;
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 150ms ease, background 150ms ease;
}

.task-toggle:hover .toggle-box {
  border-color: var(--accent);
}

.task-toggle input:checked + .toggle-box {
  border-color: var(--accent);
  background: var(--accent);
}

.task-toggle input:checked + .toggle-box::after {
  content: "";
  width: 5px;
  height: 10px;
  position: absolute;
  top: 4px;
  left: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-content {
  min-width: 0;
}

.task-title {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.task-item.is-completed .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-deadline {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.task-status {
  min-width: 102px;
  padding: 8px 10px;
  color: var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.task-item[data-state="overdue"] .task-status {
  color: var(--warning);
  background: var(--warning-soft);
}

.task-item[data-state="today"] .task-status {
  color: #8b6824;
  background: #fff5da;
}

.task-item.is-completed .task-status {
  color: var(--muted);
  background: #edf0ee;
}

.empty-state {
  display: flex;
  min-height: 300px;
  padding: 48px 24px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 1px dashed #cfd8d3;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.44);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  display: flex;
  width: 60px;
  height: 66px;
  padding: 18px 14px;
  align-items: stretch;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
  border: 1px solid #c9dbd3;
  border-radius: 14px;
  background: var(--accent-soft);
}

.empty-icon span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(53, 104, 89, 0.32);
}

.empty-icon span:nth-child(2) {
  width: 72%;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 42px 2px 34px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  padding: 13px 17px;
  color: #fff;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: 0 14px 35px rgba(23, 33, 29, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  .form-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .task-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-status {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  .site-header {
    min-height: 72px;
  }

  .privacy-note {
    font-size: 0;
  }

  .privacy-note::after {
    content: "Локально";
    font-size: 11px;
  }

  main {
    padding-top: 24px;
  }

  .task-creator {
    padding: 24px 19px;
    border-radius: 18px;
  }

  .creator-heading {
    display: block;
    margin-bottom: 26px;
  }

  .creator-heading h1 {
    font-size: 34px;
  }

  .local-badge {
    margin-top: 19px;
  }

  .task-form {
    padding-top: 23px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .button-primary {
    width: 100%;
  }

  .tasks-section {
    padding-top: 42px;
  }

  .tasks-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .task-item {
    gap: 14px;
    padding: 18px;
  }

  .task-summary {
    width: 100%;
  }

  .task-summary span {
    flex: 1;
    text-align: center;
  }

  footer {
    padding-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
