* {
  box-sizing: border-box;
}

:root {
  --bg: #eef0f5;
  --surface: #ffffff;
  --border: #e6e8ee;
  --text: #1c1f27;
  --text-muted: #6b7280;
  --text-faint: #9aa1ab;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --success: #0f9d64;
  --success-soft: #e4f7ee;
  --danger: #d64545;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 1px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px rgba(16, 24, 40, 0.08), 0 4px 8px rgba(16, 24, 40, 0.04);
  --radius: 14px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(1200px 400px at 10% -10%, #eef0ff 0%, transparent 60%),
    radial-gradient(1000px 400px at 100% 0%, #eefaf3 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

header {
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.column h2,
.reflection-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--text);
}

.heading-icon {
  font-size: 1.1rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.form input,
.form textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfbfd;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--text-faint);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form textarea {
  resize: vertical;
  line-height: 1.5;
}

.form button {
  align-self: flex-end;
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.form button:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.34);
}

.form button:active {
  transform: translateY(1px);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.item-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 4px;
  word-break: break-word;
}

.item-body {
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 10px;
  word-break: break-word;
}

.item-meta {
  font-size: 0.76rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

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

.task-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.task-controls button {
  border: none;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.task-controls button:hover {
  filter: brightness(0.96);
}

.task-controls button:active {
  transform: translateY(1px);
}

.btn-complete {
  background: var(--success-soft);
  color: var(--success);
}

.btn-complete.undo {
  background: #eef0f3;
  color: #4b5563;
}

.btn-delete {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty {
  color: var(--text-faint);
  font-size: 0.9rem;
  padding: 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.reflection-highlight {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: 36px;
}

.reflection-highlight-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 6px;
}

.reflection-highlight-week {
  font-weight: 400;
  opacity: 0.8;
  font-size: 0.8rem;
}

.reflection-highlight-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.reflection-section {
  margin-top: 36px;
}

.reflection-week-label {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .app {
    padding: 32px 14px 56px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
}
