:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --panel: #ffffff;
  --ink: #201f1c;
  --muted: #706b63;
  --line: #ded8cd;
  --accent: #18615b;
  --accent-strong: #0f4945;
  --accent-soft: #dcefeb;
  --gold: #d49a2a;
  --danger: #a7332f;
  --shadow: 0 18px 48px rgba(35, 31, 23, 0.12);
  --sidebar-width: 280px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(24, 97, 91, 0.08), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(212, 154, 42, 0.14), transparent 28%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell[data-sidebar-open="false"] {
  grid-template-columns: 0 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 100vh;
  width: var(--sidebar-width);
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  padding: 22px;
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.app-shell[data-sidebar-open="false"] .sidebar {
  pointer-events: none;
  transform: translateX(calc(var(--sidebar-width) * -1));
  opacity: 0;
}

.sidebar-header,
.section-title-row,
.tool-header,
.header-actions {
  display: flex;
  align-items: center;
}

.sidebar-header,
.section-title-row,
.tool-header {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.98;
  max-width: 760px;
}

.sync-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.sync-status.error {
  color: var(--danger);
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.project-nav {
  display: grid;
  gap: 8px;
}

.project-button,
.add-project,
.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
}

.project-button,
.add-project {
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  color: var(--ink);
  background: transparent;
  padding: 10px 12px;
  text-align: left;
}

.project-button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
}

.add-project {
  border: 1px dashed #b8afa2;
  color: var(--muted);
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-button:hover,
.ghost-button:hover,
.add-project:hover,
.project-button:hover {
  border-color: rgba(24, 97, 91, 0.4);
  background: #eef7f4;
}

.sidebar-peek {
  position: fixed;
  top: 22px;
  left: 16px;
  z-index: 20;
  display: none;
  width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-shell[data-sidebar-open="false"] .sidebar-peek {
  display: inline-flex;
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.tool-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.tool-header {
  min-height: 176px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding-left: 2px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  gap: 8px;
  min-width: 118px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

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

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.checklist-projects {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.project-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 6px;
}

.project-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tab:hover {
  background: #eef7f4;
  color: var(--accent-strong);
}

.project-tab.active {
  background: var(--accent);
  color: #ffffff;
}

.project-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 8px;
}

.danger-button {
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.checklist-area,
.notes-area {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  padding: 18px;
}

.counter {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  background: #f0ece4;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 10px;
  margin: 18px 0;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefc;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 97, 91, 0.12);
}

input {
  min-height: 42px;
  padding: 0 13px;
}

.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefc;
  padding: 8px;
}

.task-item.done {
  background: #f5f1ea;
}

.task-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.task-item.done .task-text {
  color: var(--muted);
  text-decoration: line-through;
}

.task-check {
  color: var(--accent);
}

.task-delete {
  color: var(--danger);
}

.empty-state {
  display: none;
  min-height: 220px;
  place-items: center;
  border: 1px dashed #c7beb1;
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.empty-state.visible {
  display: grid;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--gold);
}

.empty-state p {
  max-width: 320px;
  margin: 10px auto 0;
}

.notes-area {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

textarea {
  min-height: 420px;
  resize: vertical;
  padding: 14px;
  line-height: 1.5;
}

svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    width: min(var(--sidebar-width), calc(100vw - 32px));
    box-shadow: var(--shadow);
  }

  .app-shell[data-sidebar-open="false"] {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 24px 16px;
  }

  .tool-header {
    min-height: 154px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 48px;
  }

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

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

  .project-tools {
    grid-template-columns: 1fr 1fr;
  }

  textarea {
    min-height: 300px;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding-inline: 12px;
  }

  h2 {
    font-size: 2.2rem;
  }

  .tool-header {
    margin-bottom: 18px;
  }

  .checklist-area,
  .notes-area {
    padding: 14px;
  }

  .primary-button,
  .ghost-button {
    min-width: 0;
    flex: 1 1 140px;
  }

  .project-tools {
    grid-template-columns: 1fr;
  }
}
