:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-alt: #f0f1f7;
  --border: #e2e4ed;
  --text: #1a1d2e;
  --text-muted: #6b7194;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-bg: rgba(108, 92, 231, 0.08);
  --green: #00b894;
  --green-bg: rgba(0, 184, 148, 0.08);
  --green-fill: rgba(0, 184, 148, 0.2);
  --yellow: #e17055;
  --yellow-bg: rgba(225, 112, 85, 0.08);
  --blue: #0984e3;
  --blue-bg: rgba(9, 132, 227, 0.08);
  --orange: #f39c12;
  --orange-bg: rgba(243, 156, 18, 0.08);
  --pink: #e84393;
  --pink-bg: rgba(232, 67, 147, 0.08);
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

/* ─── Header / Dream ─── */
.dream-header {
  text-align: center;
  padding: 36px 24px 28px;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #74b9ff 100%);
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.dream-header::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.dream-header .dream-emoji { font-size: 2.2rem; margin-bottom: 8px; }
.dream-header h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; opacity: 0.95; }
.dream-header .dream-goal { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.dream-header .dream-sub { font-size: 0.78rem; opacity: 0.8; margin-top: 6px; }
.dream-header .contract-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ─── Funnel Section ─── */
.funnel-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: 10px;
}
.funnel-label { font-size: 0.78rem; font-weight: 600; }
.funnel-label .sub { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; display: block; margin-top: 1px; }
.funnel-label .sub a { text-decoration: none; }
.funnel-bar-wrap { position: relative; height: 28px; background: var(--border); border-radius: 8px; overflow: hidden; }
.funnel-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  min-width: 40px;
}
.funnel-bar.bar-accent { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.funnel-bar.bar-green { background: linear-gradient(90deg, #00b894, #55efc4); }
.funnel-bar.bar-blue { background: linear-gradient(90deg, #0984e3, #74b9ff); }
.funnel-bar.bar-pink { background: linear-gradient(90deg, #e84393, #fd79a8); }
.funnel-bar.bar-orange { background: linear-gradient(90deg, #f39c12, #fdcb6e); }
.funnel-nums {
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.funnel-nums .current { color: var(--text); font-size: 0.9rem; }
.funnel-arrow {
  text-align: center;
  color: var(--border);
  font-size: 1.1rem;
  padding: 2px 0;
}
.funnel-cv {
  display: inline-block;
  padding: 1px 8px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  margin-left: 4px;
}

/* ─── Bottleneck callout ─── */
.bottleneck {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: var(--yellow-bg);
  border: 1px solid rgba(225, 112, 85, 0.2);
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.8rem;
}
.bottleneck .icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.bottleneck strong { color: var(--yellow); }

/* ─── Tasks ─── */
.task-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.task-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-group-title .funnel-link {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: auto;
}
.task-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.task-list:last-child { margin-bottom: 0; }
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 0.8rem;
}
.task-item .check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
}
.task-item .check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-item .check.wait { background: var(--orange-bg); border-color: var(--orange); }
.task-item.is-done { opacity: 0.5; }
.task-item .task-text { flex: 1; }
.task-item .task-text .title { font-weight: 600; }
.task-item .task-text .desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.task-item .badge {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.b-todo { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.badge.b-wait { background: var(--orange-bg); color: var(--orange); }
.badge.b-done { background: var(--green-bg); color: var(--green); }

/* ─── Team ─── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.team-card {
  padding: 12px;
  background: var(--surface-alt);
  border-radius: 10px;
  text-align: center;
}
.team-card .avatar { font-size: 1.6rem; margin-bottom: 4px; }
.team-card .name { font-weight: 700; font-size: 0.82rem; }
.team-card .role { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 6px; }
.team-card .ts-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 600;
}

/* ─── Timeline ─── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 18px;
  position: relative;
  margin-top: 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 0.78rem;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -15px; top: 12px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.tl-item.done::before { background: var(--green); }
.tl-item.now::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.tl-item.future::before { background: var(--border); }
.tl-date { font-size: 0.68rem; color: var(--text-muted); }
.tl-text { font-weight: 500; }

/* ─── Calendar ─── */
.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.cal-month {
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
}
.cal-month.current-month {
  border: 2px solid var(--accent);
  background: var(--accent-bg);
}
.cal-month.quiet { opacity: 0.6; }
.cal-month-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.cal-month-name { font-weight: 800; font-size: 0.9rem; }
.cal-month-tag {
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 700;
}
.now-tag { background: var(--accent); color: #fff; }
.big-tag { background: var(--pink); color: #fff; }
.goal-tag { background: linear-gradient(90deg, var(--accent), var(--blue)); color: #fff; }
.cal-events { display: flex; flex-direction: column; gap: 4px; }
.cal-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  background: var(--surface);
}
.cal-event.done { opacity: 0.5; text-decoration: line-through; }
.cal-event.active { background: var(--accent-bg); border: 1px solid rgba(108, 92, 231, 0.2); font-weight: 600; }
.cal-event.milestone { background: var(--pink-bg); border: 1px solid rgba(232, 67, 147, 0.15); font-weight: 600; }
.cal-event.subtle { background: transparent; color: var(--text-muted); font-style: italic; }
.cal-day {
  min-width: 36px;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--accent);
  text-align: center;
  flex-shrink: 0;
}
.cal-text { flex: 1; }

/* ─── Footer ─── */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  body { padding: 10px; }
  .funnel-row { grid-template-columns: 1fr; gap: 6px; }
  .funnel-nums { text-align: left; }
  .dream-header .dream-goal { font-size: 1.3rem; }
}
