:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #67736c;
  --line: #dce3de;
  --paper: #f6f7f4;
  --surface: #ffffff;
  --forest: #174d36;
  --forest-hover: #0f3b29;
  --mint: #d9eee2;
  --danger: #a2382a;
  --shadow: 0 18px 55px rgba(23, 33, 27, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 30px 22px;
  color: #f8fbf9;
  background: var(--forest);
}

.brand,
.sidebar-heading,
.workspace-header,
.task-heading,
.dialog-heading,
.dialog-actions,
.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  justify-content: flex-start;
  margin-bottom: 68px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  background: #f8fbf9;
  border-radius: 12px;
}

.brand div {
  display: grid;
}

.brand span:last-child {
  color: #b9d0c3;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar h2 {
  margin: 4px 0 0;
  font: 28px/1.1 Georgia, serif;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #b9d0c3;
}

.icon-button,
.close-button {
  border: 0;
  background: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: #f8fbf9;
  font-size: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.project-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.project-link {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px 15px;
  color: #dbe7e0;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.project-link strong {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-link span {
  color: #a9c0b3;
  font-size: 12px;
}

.project-link:hover,
.project-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.empty-copy {
  color: #b9d0c3;
  line-height: 1.6;
}

.content {
  position: relative;
  padding: 58px clamp(30px, 6vw, 96px);
}

.welcome {
  max-width: 670px;
  margin: 14vh auto 0;
  padding: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.welcome h1,
.workspace-header h1 {
  margin: 9px 0 14px;
  font: clamp(42px, 6vw, 68px)/0.98 Georgia, serif;
  letter-spacing: -0.035em;
}

.welcome p,
.project-description {
  max-width: 700px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.primary-button,
.secondary-button,
.danger-button {
  padding: 11px 17px;
  font-weight: 750;
  border-radius: 9px;
}

.primary-button {
  color: #fff;
  border: 1px solid var(--forest);
  background: var(--forest);
}

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

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

.secondary-button:hover {
  border-color: #a9b7ae;
}

.danger-button {
  color: var(--danger);
  border: 1px solid #e4beb8;
  background: #fff7f5;
}

.workspace-header {
  align-items: flex-start;
}

.project-description {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) minmax(220px, 1.6fr);
  margin: 46px 0 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.stats article {
  display: grid;
  gap: 5px;
  padding: 22px 25px;
  border-right: 1px solid var(--line);
}

.stats article:last-child {
  border-right: 0;
}

.stats strong {
  font: 30px/1 Georgia, serif;
}

.stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.progress-card div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.progress-track {
  overflow: hidden;
  height: 7px;
  margin-top: 8px;
  background: #e8ece9;
  border-radius: 10px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--forest);
  transition: width 180ms ease;
}

.task-heading {
  margin-bottom: 18px;
}

.task-heading h2 {
  margin: 4px 0 0;
  font: 34px/1 Georgia, serif;
}

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

.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.task-card:hover {
  border-color: #bec9c2;
}

.task-toggle {
  width: 21px;
  height: 21px;
  accent-color: var(--forest);
}

.task-copy h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.task-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.task-card.completed .task-copy h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.task-actions {
  display: flex;
  gap: 7px;
}

.task-actions button {
  padding: 7px 9px;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.task-actions button:hover {
  color: var(--ink);
  background: var(--paper);
  border-radius: 7px;
}

.task-empty {
  padding: 50px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed #bcc8c0;
  border-radius: 14px;
}

.task-empty h3 {
  margin-bottom: 7px;
  color: var(--ink);
}

.empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--forest);
  font-size: 24px;
  background: var(--mint);
  border-radius: 50%;
}

.notice {
  position: fixed;
  z-index: 5;
  top: 20px;
  right: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 17px;
  color: #fff;
  background: var(--ink);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.notice.error {
  background: var(--danger);
}

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(17, 28, 21, 0.56);
  backdrop-filter: blur(3px);
}

dialog form {
  display: grid;
  gap: 21px;
  padding: 30px;
}

.dialog-heading h2 {
  margin: 4px 0 0;
  font: 31px/1.1 Georgia, serif;
}

.close-button {
  color: var(--muted);
  font-size: 19px;
}

dialog label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
}

dialog input:not([type="checkbox"]),
dialog textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid #c8d1cb;
  border-radius: 8px;
  outline: none;
}

dialog input:focus,
dialog textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--mint);
}

dialog textarea {
  resize: vertical;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  justify-content: start;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 5px;
}

@media (max-width: 850px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 20px;
  }

  .brand {
    margin-bottom: 28px;
  }

  .project-list {
    grid-auto-columns: minmax(180px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .content {
    padding: 40px 20px;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats .progress-card {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .stats article:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .welcome {
    margin-top: 5vh;
    padding: 32px 25px;
  }

  .workspace-header {
    display: grid;
  }

  .header-actions {
    justify-content: flex-start;
  }

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

  .stats article,
  .stats article:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats .progress-card {
    grid-column: auto;
    border-top: 0;
    border-bottom: 0;
  }

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

  .task-actions {
    grid-column: 2;
  }
}
