* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  margin: 0;
  padding: 0 16px 48px;
  color: #1f2937;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 40%, #ecfeff 100%);
  background-attachment: fixed;
}

/* 背景に淡いカラーの光を散らしてモダンな奥行きを出す */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.18), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.14), transparent 40%),
    radial-gradient(circle at 75% 85%, rgba(14, 165, 233, 0.16), transparent 45%);
}

header {
  text-align: center;
  padding: 28px 0 12px;
}

header h1 {
  margin: 0;
  font-size: 28px;
}

.subtitle {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 900px;
  margin: 16px auto 28px;
}

.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 20px 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.card.highlight {
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.card-num {
  font-size: 34px;
  font-weight: 700;
  color: #2563eb;
}

.card.highlight .card-num {
  color: #ea580c;
}

.card-label {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

/* 最新の振り返り（ダッシュボード） */
.latest-reflection {
  max-width: 900px;
  margin: 0 auto 28px;
  padding: 18px 20px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
}

.latest-reflection .lr-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-bottom: 8px;
}

.latest-reflection .lr-week {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.latest-reflection .lr-comment {
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.latest-reflection .meta {
  color: rgba(255, 255, 255, 0.85);
  margin-top: 8px;
}

.latest-reflection .empty {
  color: rgba(255, 255, 255, 0.9);
  padding: 0;
  text-align: left;
}

/* 2カラム */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

/* 入力フォーム */
.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form input,
.form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.form button {
  padding: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.form button:hover {
  background: #1d4ed8;
}

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

.empty {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

/* メモ項目 */
.note-item {
  border: 1px solid #dbe2ea;
  border-left: 4px solid #2563eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f0f4fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.note-item .note-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  word-break: break-word;
}

.note-item .note-content {
  font-size: 14px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* タスク項目 */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dbe2ea;
  border-left: 4px solid #16a34a;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f0f4fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 完了したタスクは少し落ち着いた見た目に */
.task-item.done {
  background: #eef1f4;
  border-left-color: #9ca3af;
}

.task-item input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 14px;
  word-break: break-word;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #9ca3af;
}

.status {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.status.pending {
  background: #fef3c7;
  color: #b45309;
}

.status.done {
  background: #dcfce7;
  color: #15803d;
}

/* 週次振り返りパネル */
.reflection-panel {
  max-width: 900px;
  margin: 20px auto 0;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.reflection-form input[type="week"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.reflection-form input[type="week"]:focus {
  outline: none;
  border-color: #6366f1;
}

.reflection-panel .form button {
  background: #6366f1;
}

.reflection-panel .form button:hover {
  background: #4f46e5;
}

/* 振り返り項目 */
.reflection-item {
  border: 1px solid #e3ddf6;
  border-left: 4px solid #8b5cf6;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f6f3fe;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reflection-item .reflection-week {
  font-weight: 700;
  font-size: 15px;
  color: #6d28d9;
  margin-bottom: 4px;
}

.reflection-item .reflection-comment {
  font-size: 14px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 削除ボタン */
.del-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.del-btn:hover {
  text-decoration: underline;
}

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