* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Noto Sans KR", sans-serif;
}

button, input, select {
  font-family: inherit;
}

body {
  min-height: 100vh;
  background: #f8fafc;
  color: #0f172a;
}

body.dark {
  background: #0f172a;
  color: #f8fafc;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  color: #2563eb;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 8px;
}

h1 {
  font-size: 34px;
  margin: 0;
}

.desc {
  color: #64748b;
}

body.dark .desc {
  color: #94a3b8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-btn, .install-btn, .add-btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
}

.theme-btn {
  background: #0f172a;
  color: white;
}

body.dark .theme-btn {
  background: #fde047;
  color: #0f172a;
}

.install-btn {
  background: #16a34a;
  color: white;
}

.hidden {
  display: none;
}

.progress-card, .form-card, .todo-item, .empty {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

body.dark .progress-card,
body.dark .form-card,
body.dark .todo-item,
body.dark .empty {
  background: #1e293b;
  border-color: #334155;
}

.progress-card {
  width: 230px;
  padding: 18px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #64748b;
}

body.dark .progress-top {
  color: #cbd5e1;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 10px 0;
}

body.dark .progress-bar {
  background: #334155;
}

.progress-bar div {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width .2s ease;
}

.progress-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}

.form-card {
  display: grid;
  grid-template-columns: 1fr 170px 130px auto;
  gap: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

input, select {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: white;
  color: #0f172a;
}

body.dark input,
body.dark select {
  background: #0f172a;
  color: white;
  border-color: #475569;
}

.add-btn {
  background: #2563eb;
  color: white;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filters {
  display: flex;
  gap: 8px;
}

.filters button {
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 700;
}

body.dark .filters button {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

.filters button.active {
  background: #0f172a;
  color: white;
}

body.dark .filters button.active {
  background: white;
  color: #0f172a;
}

.search {
  width: 280px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.check {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: white;
  font-weight: 800;
}

.check.done {
  background: #2563eb;
  border-color: #2563eb;
}

.todo-text {
  flex: 1;
}

.todo-title {
  margin: 0;
  font-weight: 700;
}

.todo-title.done {
  color: #94a3b8;
  text-decoration: line-through;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
}

body.dark .meta {
  color: #cbd5e1;
}

.priority {
  border-radius: 999px;
  border: 1px solid;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.priority.high {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.priority.normal {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.priority.low {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

body.dark .priority.high {
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
  border-color: #7f1d1d;
}

body.dark .priority.normal {
  background: rgba(120, 53, 15, 0.35);
  color: #fcd34d;
  border-color: #78350f;
}

body.dark .priority.low {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

.delete-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
}

.delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.empty {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  border-style: dashed;
}

@media (max-width: 760px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .form-card {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .progress-card {
    width: 100%;
  }
}
