/* ===== モノトーン・ミニマルデザイン ===== */
:root {
  --bg: #f4f4f3;
  --surface: #ffffff;
  --fg: #0b0b0b;
  --fg-2: #3f3f3f;
  --muted: #8b8b8b;
  --line: #e8e8e6;
  --line-strong: #cfcfcc;
  --field: #f4f4f3;
  --radius: 18px;
  --font-en: "Inter", "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- ヘッダー ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 244, 243, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--fg);
  box-shadow: inset 0 0 0 5px var(--fg), inset 0 0 0 7px #fff;
}
.today {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

main { max-width: 1240px; margin: 0 auto; padding: 56px 32px 96px; }

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- ヒーロー ---------- */
.hero { margin-bottom: 32px; }
.hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.hero-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- ダッシュボード ---------- */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 56px;
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 160px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 14px; font-weight: 700; }
.stat-en {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.stat-value {
  font-family: var(--font-en);
  font-size: 52px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat-value small {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.stat.dark { background: var(--fg); border-color: var(--fg); color: #fff; }
.stat.dark .stat-en,
.stat.dark small { color: #8f8f8f; }

.stat-review { grid-column: 1 / -1; min-height: 0; transition: border-color 0.2s, transform 0.2s; }
.stat-review:hover { border-color: var(--fg); transform: translateY(-2px); }
.latest-week {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.latest-comment,
.latest-empty {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--fg-2);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-empty { color: var(--muted); }

.tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.04em;
}

/* ---------- パネル ---------- */
.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 80px;
}
.panel-head { margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }

.list-title {
  margin: 32px 0 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- フォーム ---------- */
form { display: flex; flex-direction: column; gap: 10px; }
.inline-form { flex-direction: row; }
.inline-form .field { flex: 1; min-width: 0; }

.field {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field::placeholder { color: var(--muted); }
.field:hover { border-color: var(--line-strong); }
.field:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--fg);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}
textarea.field { resize: vertical; min-height: 88px; }
select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.form-note { margin: 0; font-size: 12px; color: var(--muted); }
.form-note:empty { display: none; }

.btn {
  padding: 12px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--fg);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #333; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible,
.icon-btn:focus-visible,
.check:focus-visible,
.stat-review:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- 一覧 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: none; padding-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 700; line-height: 1.5; word-break: break-word; }
.item-body {
  margin-top: 4px;
  font-size: 14px;
  color: var(--fg-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-en);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.empty {
  padding: 28px 0 8px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.icon-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--field); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }

/* タスク */
.task .item-title { font-weight: 500; }
.check {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 0;
  color: #fff;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.check:hover { border-color: var(--fg); }
.check svg { width: 12px; height: 12px; opacity: 0; transition: opacity 0.15s; }
.task.done .check { background: var(--fg); border-color: var(--fg); }
.task.done .check svg { opacity: 1; }
.task.done .item-title { color: var(--muted); text-decoration: line-through; }

.badge {
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 18px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  color: var(--fg);
}
.task.done .badge { border-color: var(--line); background: var(--field); color: var(--muted); }

/* 振り返り */
.week-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 1080px) {
  .dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #reviews { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar-inner { padding: 12px 16px; }
  main { padding: 32px 16px 64px; }
  .hero h1 { font-size: 24px; }
  .dashboard { gap: 8px; margin-bottom: 32px; }
  .stat { min-height: 0; padding: 14px; gap: 14px; border-radius: 14px; }
  .stat-en { display: none; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 32px; }
  .columns { grid-template-columns: 1fr; gap: 14px; }
  .panel { padding: 20px; border-radius: 14px; }
}
