:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --primary: #6366f1;
  --primary-foreground: #ffffff;
  --primary-hover: #4f46e5;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --ring: #6366f1;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --destructive: #ef4444;
  --success: #22c55e;
  --card: #ffffff;
  --card-foreground: #0f172a;
  font-size: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.bg-background {
  background-color: var(--background);
}
.text-foreground {
  color: var(--foreground);
}
.bg-muted {
  background-color: var(--muted);
}
.text-muted-foreground {
  color: var(--muted-foreground);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--muted);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-danger {
  background: var(--destructive);
  color: #ffffff;
  border-color: var(--destructive);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 9999px;
}

.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: var(--background);
  color: var(--foreground);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgb(99 102 241 / 0.15);
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  user-select: none;
}

.timer-progress {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.3s linear;
}

.checkbox {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--background);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox.checked::after {
  content: '';
  width: 0.375rem;
  height: 0.625rem;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.task-item:hover {
  background: var(--muted);
}

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

.markdown-preview h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.markdown-preview h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.75rem 0 0.375rem;
}

.markdown-preview ul {
  list-style: none;
  padding: 0;
}

.markdown-preview li {
  padding: 0.125rem 0;
}

.markdown-preview p {
  margin: 0.25rem 0;
  line-height: 1.6;
}

.markdown-preview strong {
  font-weight: 600;
}

.markdown-preview em {
  font-style: italic;
}

.editor-pane {
  min-height: 300px;
  resize: vertical;
}

.dark {
  --background: #0f172a;
  --foreground: #f1f5f9;
  --primary: #818cf8;
  --primary-foreground: #0f172a;
  --primary-hover: #6366f1;
  --muted: #1e293b;
  --muted-foreground: #94a3b8;
  --border: #334155;
  --ring: #818cf8;
  --card: #1e293b;
  --card-foreground: #f1f5f9;
  --destructive: #f87171;
  --success: #4ade80;
}

@media (max-width: 767px) {
  .timer-display {
    font-size: 3.5rem;
  }
}
