:root {
  --green: #0ccb6e;
  --mint: #d3f2e2;
  --background: #fafafa;
  --surface: #ffffff;
  --border: #e8e8e8;
  --text: #111111;
  --text-secondary: #888888;
}

* {
  box-sizing: border-box;
}

body,
h1,
ul {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Roboto, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

header {
  position: sticky;
  top: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

h1 {
  margin-right: auto;
  font-size: 20px;
  font-weight: 500;
}

header a {
  color: var(--text-secondary);
  font-size: 22px;
  text-decoration: none;
}

#household {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

#household code {
  margin-right: auto;
  font-size: 15px;
  color: var(--text);
  user-select: all;
}

#household button {
  font: inherit;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: var(--text);
  cursor: pointer;
}

.tabs {
  position: sticky;
  top: 53px;
  display: flex;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tabs button {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
}

.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--green);
}

main {
  padding: 8px 0;
}

#list,
#todo {
  list-style: none;
}

#list li,
#todo li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  margin: 8px 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#list li.leaving,
#todo li.leaving {
  animation: celebrate 0.45s ease forwards;
}

@keyframes celebrate {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  25% {
    transform: scale(1.06);
    background: var(--mint);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

#list li input[type="checkbox"],
#todo li input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

#library,
#task-library {
  list-style: none;
}

#library li,
#task-library li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  margin: 8px 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

#library .period,
#task-library .period {
  font-size: 13px;
  color: var(--text-secondary);
}

#library .status,
#task-library .difficulty {
  font-size: 14px;
  color: var(--text-secondary);
}

#sheet,
#task-sheet {
  width: 100%;
  max-width: 500px;
  margin: auto auto 0;
  padding: 24px 16px;
  border: none;
  border-radius: 16px 16px 0 0;
  background: var(--surface);
}

#sheet[open],
#task-sheet[open] {
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
}

#sheet::backdrop,
#task-sheet::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

#sheet form,
#task-sheet form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#sheet h2,
#task-sheet h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

#sheet label,
#task-sheet label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

#sheet input,
#sheet select,
#task-sheet input,
#task-sheet select {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

#sheet input:read-only,
#sheet select:disabled {
  background: var(--background);
  color: var(--text-secondary);
}

#sheet .actions,
#task-sheet .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#sheet .actions button,
#task-sheet .actions button {
  font: inherit;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  cursor: pointer;
}

#sheet .actions .primary,
#task-sheet .actions .primary {
  background: var(--green);
  color: var(--text);
}

#add {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--green);
  color: var(--text);
  font-size: 28px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
