:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c1e21;
  --text-muted: #6b7280;
  --primary: #4f46e5;
  --primary-text: #ffffff;
  --danger: #ef4444;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #232428;
    --text: #f2f2f3;
    --text-muted: #9aa0a6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.login-screen form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

button {
  position: relative;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease, filter 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  color: transparent;
  filter: brightness(0.85);
  cursor: not-allowed;
  transform: none;
}

button:disabled::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.task-group {
  margin-bottom: 24px;
}

.task-group h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.task-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.task-card.task-done {
  opacity: 0.5;
}

.task-card.task-done .task-title {
  text-decoration: line-through;
}

.task-check {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  padding: 0;
}

.task-card.task-done .task-check {
  background: var(--primary);
}

.task-title {
  flex: 1;
  font-size: 16px;
}

.task-time,
.task-date {
  font-size: 13px;
  color: var(--text-muted);
}

.task-delete {
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}

.capture-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.capture-form input {
  flex: 1;
}

#carousel-container {
  margin-bottom: 20px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.carousel-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.carousel-label {
  font-weight: 600;
  margin: 0 0 8px;
}

.carousel-card ul {
  margin: 0;
  padding-inline-start: 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.carousel-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.carousel-actions button {
  flex: 1;
}

#carousel-cancel,
#carousel-edit {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.push-banner {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.error-banner {
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--danger);
  font-size: 14px;
}

.error-banner button {
  background: transparent;
  color: var(--danger);
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}
