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

:root {
  /* 背景に奥行きを持たせ、カードとの差を明確にする */
  --bg: #eef1f8;
  --bg-accent: #e6eaf6;
  --card: #ffffff;
  --list-item: #f7f9fd;   /* 一覧アイテム: 背景よりわずかに明るく、白カードより落ち着いた色 */
  --list-hover: #eef3ff;
  --border: #dde2ee;
  --border-strong: #cbd3e6;
  --text: #1f2436;
  --muted: #6b7288;
  --primary: #4f6ef7;
  --primary-dark: #3a56dc;
  --danger: #e5484d;
  --done: #16a34a;
  --shadow-sm: 0 1px 2px rgba(31, 41, 84, 0.06);
  --shadow-md: 0 6px 20px rgba(31, 41, 84, 0.08);
  --radius: 16px;
  /* フォントサイズを2段階アップ(16px → 18px) */
  --fs-base: 18px;
}

html {
  font-size: var(--fs-base);
}

body {
  font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  background:
    radial-gradient(1200px 500px at 100% -10%, #dfe6fb 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 0%, #e7e2fb 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ヘッダー */
.app-header {
  background: linear-gradient(120deg, #4f6ef7 0%, #6a5cf0 60%, #8a5cf0 100%);
  color: #fff;
  padding: 26px 24px;
  box-shadow: var(--shadow-md);
}

.app-header h1 {
  max-width: 1040px;
  margin: 0 auto;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 34px;
}

.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #4f6ef7, #8a5cf0);
  opacity: 0.85;
}

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

.stat-card.highlight::before {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}

.stat-card.highlight .stat-value {
  color: #ea6a0a;
}

/* ダッシュボードの振り返りカード */
.review-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 34px;
}

.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.review-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.review-tag {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  color: #fff;
}

.review-tag.latest {
  background: linear-gradient(120deg, #4f6ef7, #6a5cf0);
}

.review-tag.prev {
  background: #8a91a8;
}

.review-week {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.review-card-body {
  white-space: pre-wrap;
  font-size: 0.98rem;
  color: #33384b;
}

.review-card-body.is-empty {
  color: var(--muted);
  font-style: italic;
}

/* 振り返りパネル */
.review-panel {
  margin-top: 22px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -2px;
}

.review-week-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.list li.review-item {
  border-left-color: #6a5cf0;
}

/* 2カラム */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-accent);
}

/* 入力欄 */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.input-area input,
.input-area textarea {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fcfdff;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-area input::placeholder,
.input-area textarea::placeholder {
  color: #9aa1b5;
}

.input-area input:focus,
.input-area textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.14);
}

.input-area button {
  background: linear-gradient(120deg, var(--primary), #6a5cf0);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.28);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}

.input-area button:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.36);
}

.input-area button:active {
  transform: translateY(1px);
}

/* リスト */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list li {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--list-item);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.list li:hover {
  background: var(--list-hover);
  box-shadow: var(--shadow-md);
}

/* メモは左ボーダーを青、完了タスクは緑・未完了はオレンジで区別 */
.list li.task-item {
  border-left-color: #f59e0b;
}

.list li.task-item.done {
  border-left-color: var(--done);
  background: #f2faf4;
}

.list li.empty {
  border: 1px dashed var(--border-strong);
  border-left: 1px dashed var(--border-strong);
  background: transparent;
  box-shadow: none;
}

.memo-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.memo-content {
  white-space: pre-wrap;
  color: #3a3f52;
  font-size: 0.98rem;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 8px;
}

.empty {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 22px 0;
}

/* タスク行 */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--done);
}

.task-body {
  flex: 1;
}

.task-title {
  font-size: 1.02rem;
}

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

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge.incomplete {
  background: #fff0e0;
  color: #d9730d;
}

.badge.complete {
  background: #e2f7e9;
  color: var(--done);
}

/* 削除ボタン */
.btn-delete {
  background: transparent;
  border: 1px solid transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.btn-delete:hover {
  background: #fdecec;
  border-color: #f5c2c2;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

@media (max-width: 720px) {
  :root {
    --fs-base: 17px;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
  .columns {
    grid-template-columns: 1fr;
  }
}
