@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --green-900: #1b4332;
  --green-800: #1e4d3a;
  --green-700: #2d6a4f;
  --green-600: #3a7d5f;
  --green-500: #40916c;
  --green-400: #52b788;
  --green-300: #74c69d;
  --green-200: #95d5b2;
  --green-100: #d8f3dc;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-100: #fef3c7;
  --red-500: #ef4444;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --bg: #f0f4f0;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);
}

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

/* ========== SCROLL PROGRESS BAR ========== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--green-400), var(--green-300), #a8edbe);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(82,183,136,0.6);
}

/* ========== BASE ========== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.8;
  font-size: 15px;
  overflow-x: hidden;
}

a {
  color: var(--green-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-18px) rotate(5deg); }
  66% { transform: translateY(-8px) rotate(-3deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-24px) rotate(-6deg); }
  66% { transform: translateY(-12px) rotate(4deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes confetti-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(30px); }
}

@keyframes slideInLeft {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(82,183,136,0.4); }
  50% { box-shadow: 0 0 20px rgba(82,183,136,0.8), 0 0 40px rgba(82,183,136,0.3); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== INDEX PAGE - HERO ========== */
.index-hero {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(64,145,108,0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(82,183,136,0.25) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(27,67,50,0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 10%, rgba(116,198,157,0.2) 0%, transparent 40%),
    #1b4332;
  color: white;
  padding: 80px 40px 72px;
  position: relative;
  overflow: hidden;
}

/* Floating particles */
.hero-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
}

.hero-particle:nth-child(1) {
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(116,198,157,0.8), transparent);
  top: 10%; left: 8%;
  animation: float 7s ease-in-out infinite;
}

.hero-particle:nth-child(2) {
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(82,183,136,0.9), transparent);
  top: 60%; right: 12%;
  animation: float2 9s ease-in-out infinite;
  opacity: 0.2;
}

.hero-particle:nth-child(3) {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(64,145,108,0.7), transparent);
  bottom: -20%; right: 5%;
  animation: float3 11s ease-in-out infinite;
  opacity: 0.12;
}

.hero-particle:nth-child(4) {
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(148,215,178,0.9), transparent);
  top: 30%; left: 55%;
  animation: float 5s ease-in-out infinite 2s;
  opacity: 0.18;
}

.hero-particle:nth-child(5) {
  width: 40px; height: 40px;
  background: radial-gradient(circle, rgba(82,183,136,1), transparent);
  top: 70%; left: 25%;
  animation: float2 6s ease-in-out infinite 1s;
  opacity: 0.25;
}

.index-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.index-company {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease both;
}

.index-title {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 0%, #a8edbe 60%, #74c69d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.index-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 36px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.index-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.stat-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  cursor: default;
}

.stat-item:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-item strong {
  font-weight: 900;
  font-size: 28px;
  display: block;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff, #74c69d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== VIEW TOGGLE ========== */
.view-toggle {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.view-toggle-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-toggle-btn.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
}

.view-toggle-btn:hover:not(.active) {
  border-color: var(--green-500);
  color: var(--green-700);
}

/* ========== INDEX PAGE - FILTER BAR ========== */
.filter-section {
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 40px;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  backdrop-filter: blur(10px);
}

.filter-section-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--green-500);
  color: var(--green-700);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
  box-shadow: 0 3px 10px rgba(45,106,79,0.35);
}

.search-box {
  flex: 1;
  min-width: 200px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--gray-900);
  background: var(--gray-100);
  outline: none;
  transition: all 0.2s ease;
}

.search-box:focus {
  border-color: var(--green-500);
  background: white;
  box-shadow: 0 0 0 3px rgba(64,145,108,0.12);
}

.filter-count {
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
}

mark {
  background: #fef08a;
  color: var(--gray-900);
  border-radius: 2px;
  padding: 0 2px;
}

/* ========== INDEX PAGE - CARD GRID ========== */
.index-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 40px 80px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  transition: all 0.4s ease;
}

/* ========== TIMELINE VIEW ========== */
.card-grid.timeline-view {
  display: block;
  position: relative;
  padding-left: 40px;
}

.card-grid.timeline-view::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green-400), var(--green-200), transparent);
  border-radius: 2px;
}

.card-grid.timeline-view .mtg-card {
  margin-bottom: 20px;
  transform: none !important;
  animation: fadeInUp 0.5s ease both;
}

.card-grid.timeline-view .mtg-card::after {
  content: '';
  position: absolute;
  left: -34px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green-500);
  border: 2px solid white;
  box-shadow: 0 0 0 3px var(--green-200);
}

/* ========== MTG CARDS ========== */
.mtg-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  /* 3D tilt */
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transition: box-shadow 0.3s ease, transform 0.1s ease;
  will-change: transform;
}

/* Left bar animation on hover */
.mtg-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green-500);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.25s ease;
  border-radius: 0 2px 2px 0;
}

.mtg-card[data-type="external"]::before {
  background: var(--amber-500);
}

.mtg-card:hover::before {
  transform: scaleY(1);
}

/* Glare shimmer overlay */
.mtg-card .card-glare {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: none;
}

.mtg-card:hover {
  box-shadow: var(--shadow-xl);
  text-decoration: none;
}

.mtg-card:hover .card-glare {
  animation: shimmer 0.6s ease;
}

.mtg-card.is-hidden {
  display: none;
}

/* Entrance animation */
.mtg-card.card-animate {
  opacity: 0;
  animation: fadeInUp 0.5s ease both;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-date {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ========== BADGES ========== */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-internal {
  background: var(--green-100);
  color: var(--green-900);
}

.badge-external {
  background: var(--amber-100);
  color: #92400e;
  position: relative;
}

/* Pulse ring on external badge */
.badge-external::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  border: 2px solid var(--amber-400);
  animation: pulse-ring 2s ease-out infinite;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.4;
}

.card-summary {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.75;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}

.card-duration {
  font-size: 12px;
  color: var(--gray-400);
}

.card-actions-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  transition: all 0.2s ease;
}

.card-actions-badge.has-actions {
  background: var(--green-100);
  color: var(--green-700);
}

.mtg-card:hover .card-actions-badge.has-actions {
  background: var(--green-700);
  color: white;
}

/* ========== DETAIL PAGE - HEADER ========== */
.detail-header {
  background:
    radial-gradient(ellipse at 15% 50%, rgba(64,145,108,0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 10%, rgba(82,183,136,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(27,67,50,0.5) 0%, transparent 60%),
    #1b4332;
  color: white;
  position: relative;
  overflow: hidden;
}

/* SVG noise texture filter */
.detail-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

/* Floating particles in detail header */
.detail-header .hero-particle {
  opacity: 0.1;
}

.detail-header-leaf {
  position: absolute;
  top: -40px;
  right: -60px;
  width: 360px;
  height: 360px;
  opacity: 0.06;
}

.detail-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 40px 40px;
  position: relative;
  z-index: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
}

.back-link:hover {
  color: white;
  text-decoration: none;
  background: rgba(255,255,255,0.14);
  transform: translateX(-3px);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.header-company {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
}

.header-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #b7f0cb 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-details {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.85;
}

.header-details span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.badge-header-internal {
  background: rgba(116,198,157,0.2);
  border: 1px solid rgba(116,198,157,0.4);
  color: #a8edbe;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-header-external {
  background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.4);
  color: #fef3c7;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.badge-header-external::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(245,158,11,0.5);
  animation: pulse-ring 2.5s ease-out infinite;
}

/* Read time tag */
.read-time-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

/* ========== FLOATING TOC ========== */
.floating-toc {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  z-index: 400;
  max-height: 70vh;
  overflow-y: auto;
}

.floating-toc h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

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

.toc-item {
  font-size: 12px;
  line-height: 1.4;
}

.toc-item a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-item a:hover {
  background: var(--green-100);
  color: var(--green-700);
  text-decoration: none;
}

.toc-item.active a {
  background: var(--green-100);
  color: var(--green-700);
  border-left-color: var(--green-500);
  font-weight: 700;
}

@media (max-width: 1280px) {
  .floating-toc {
    display: none;
  }
}

/* ========== DETAIL PAGE - CONTENT ========== */
.detail-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* Scroll reveal — デフォルトは表示、スクロール時にアニメーション */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* JS有効時のみ非表示スタート */
.js-reveal-ready .reveal:not(.revealed) {
  opacity: 0;
  transform: translateY(24px);
}

/* Section headings with counter */
.detail-content {
  counter-reset: section-counter;
}

.section-h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 52px;
  margin-bottom: 20px;
  padding: 12px 16px 12px 52px;
  border-left: 4px solid var(--green-700);
  letter-spacing: 0.02em;
  line-height: 1.4;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(to right, rgba(64,145,108,0.06), transparent);
  position: relative;
  counter-increment: section-counter;
  scroll-margin-top: 80px;
}

.section-h2::before {
  content: counter(section-counter, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 900;
  color: var(--green-500);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.section-h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-700);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--green-300);
  letter-spacing: 0.02em;
  scroll-margin-top: 80px;
}

/* Body text */
p {
  margin-bottom: 12px;
  color: var(--gray-700);
  line-height: 1.8;
}

ul, ol {
  padding-left: 1.6em;
  margin-bottom: 12px;
}

li {
  margin-bottom: 8px;
  color: var(--gray-700);
  line-height: 1.75;
}

li ul, li ol {
  margin-top: 6px;
  margin-bottom: 0;
}

.key-term {
  color: var(--green-700);
  font-weight: 700;
}

.decision-box {
  background: linear-gradient(135deg, var(--green-100), rgba(116,198,157,0.15));
  border: 1.5px solid var(--green-300);
  border-left: 4px solid var(--green-700);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--green-900);
  line-height: 1.75;
  box-shadow: 0 2px 8px rgba(64,145,108,0.1);
}

.decision-box strong {
  color: var(--green-900);
}

.section-sep {
  border: none;
  border-top: 1.5px solid var(--gray-200);
  margin: 40px 0;
}

/* ========== ACTION ITEMS - PREMIUM ========== */
.actions-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 30px 32px;
  margin-top: 52px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.actions-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-700), var(--green-400), var(--green-300));
}

.actions-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Progress tracker */
.actions-progress {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--gray-100);
  border-radius: 10px;
}

.actions-progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.actions-progress-count {
  font-size: 14px;
  font-weight: 900;
  color: var(--green-700);
}

.progress-bar-wrap {
  height: 8px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--green-400));
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(64,145,108,0.5);
}

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

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.action-item:hover {
  background: var(--gray-100);
}

.action-item input[type="checkbox"] {
  display: none;
}

.action-item label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

.action-item label::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  margin-top: 1px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: white;
}

.action-item input[type="checkbox"]:checked + label::before {
  background: var(--green-700);
  border-color: var(--green-700);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(45,106,79,0.4);
}

.action-item input[type="checkbox"]:checked + label {
  text-decoration: line-through;
  color: var(--gray-400);
}

/* Copy button */
.copy-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  color: var(--gray-600);
  font-family: 'Noto Sans JP', sans-serif;
  box-shadow: var(--shadow-sm);
}

.action-item:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
}

.copy-btn.copied {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
}

/* ========== CONFETTI ========== */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  top: -10px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall linear forwards, confetti-sway ease-in-out infinite alternate;
}

/* ========== AI SUGGESTIONS ========== */
.ai-section {
  background: linear-gradient(135deg, var(--amber-100), rgba(254,243,199,0.5));
  border: 1.5px solid #fcd34d;
  border-radius: 14px;
  padding: 24px 28px;
  margin-top: 32px;
  box-shadow: 0 2px 12px rgba(245,158,11,0.1);
}

.ai-title {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.ai-list li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: #78350f;
  line-height: 1.7;
  counter-increment: ai-counter;
}

.ai-list li::before {
  content: counter(ai-counter);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--amber-500);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ========== PARTICIPANTS ========== */
.participants-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}

.participants-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}

.participant-badge {
  font-size: 12px;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.participant-badge:hover {
  background: var(--green-100);
  color: var(--green-700);
}

/* ========== CHART / VISUALIZATION ========== */
@keyframes donutSpin {
  from { opacity: 0; transform: scale(0.85) rotate(-90deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes gaugeArc {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes barGrow {
  from { max-width: 0; opacity: 0; }
  to   { max-width: 100%; opacity: 1; }
}
@keyframes lineReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fillReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* チャートSVG全体フェードイン */
.chart-container svg {
  animation: fillReveal 0.7s ease-out forwards;
}

.chart-container .chart-grid > div:nth-child(2) svg {
  animation-delay: 0.15s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.chart-container {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  border-radius: 16px;
  padding: 28px;
  margin: 28px 0;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(27,67,50,0.35);
}
.chart-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 0%, rgba(116,198,157,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.chart-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.65;
  margin-bottom: 20px;
}
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .chart-grid { grid-template-columns: 1fr; }
}

/* SVG charts */
.chart-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.chart-svg-wrap svg {
  max-width: 100%;
  height: auto;
  overflow: visible;
}

/* Legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  opacity: 0.9;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Animated bar */
.anim-bar-wrap {
  margin: 10px 0;
}
.anim-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  opacity: 0.9;
}
.anim-bar-track {
  height: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
}
.anim-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #52b788, #74c69d);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(82,183,136,0.5);
}
.anim-bar-fill.red-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.anim-bar-fill.amber-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Flow diagram */
.flow-col {
  background: rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}
.flow-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 12px;
}
.flow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
}
.flow-item:last-child { border-bottom: none; }
.flow-amount {
  font-size: 16px;
  font-weight: 900;
  color: #74c69d;
}
.flow-amount.red { color: #f87171; }
.flow-date {
  font-size: 11px;
  opacity: 0.6;
  margin-left: auto;
}

/* Timeline */
.timeline-chart {
  position: relative;
  padding: 20px 0 8px;
}
.timeline-axis {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid rgba(255,255,255,0.2);
  padding-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}
.timeline-events {
  position: relative;
  height: 80px;
}
.timeline-event {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
}
.timeline-event.income { color: #74c69d; bottom: 4px; }
.timeline-event.expense { color: #f87171; top: 4px; }
.timeline-arrow { font-size: 16px; font-weight: 900; }

/* Phase roadmap */
.phase-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.phase-box {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 16px 14px;
  position: relative;
  transition: background 0.2s;
}
.phase-box:hover { background: rgba(255,255,255,0.10); }
.phase-box.ph1 { border-color: rgba(116,198,157,0.3); }
.phase-box.ph2 { border-color: rgba(82,183,136,0.45); }
.phase-box.ph3 { border-color: rgba(45,106,79,0.7); background: rgba(45,106,79,0.15); }
.phase-arrow {
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 18px;
  opacity: 0.4;
}
.phase-number {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.55;
  margin-bottom: 6px;
}
.phase-ha {
  font-size: 28px;
  font-weight: 900;
  color: #74c69d;
  line-height: 1;
  margin-bottom: 4px;
}
.phase-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.phase-desc {
  font-size: 11px;
  opacity: 0.65;
  line-height: 1.6;
}

/* KPI dashboard */
.kpi-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kpi-item {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kpi-name {
  font-size: 13px;
  font-weight: 700;
}
.kpi-value {
  font-size: 13px;
  font-weight: 900;
  color: #74c69d;
}
.kpi-value.done { color: #95d5b2; }
.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.kpi-badge.green { background: rgba(116,198,157,0.2); color: #74c69d; }
.kpi-badge.orange { background: rgba(245,158,11,0.2); color: #fbbf24; }
.kpi-badge.gray { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }

/* Crop status cards */
.crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.crop-card {
  perspective: 800px;
  height: 140px;
  cursor: default;
}
.crop-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.crop-card:hover .crop-card-inner {
  transform: rotateY(180deg);
}
.crop-front, .crop-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.crop-back {
  transform: rotateY(180deg);
  background: rgba(45,106,79,0.4);
  border-color: rgba(116,198,157,0.25);
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255,255,255,0.9);
}
.crop-emoji { font-size: 24px; }
.crop-name { font-size: 13px; font-weight: 700; }
.urgency-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.urgency-dot.red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.urgency-dot.yellow { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.urgency-dot.green { background: #52b788; box-shadow: 0 0 6px #52b788; }
.crop-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
}

/* Styled table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255,255,255,0.05);
}
.data-table tr:last-child td { border-bottom: none; }
.subsidy-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(116,198,157,0.18);
  color: #74c69d;
  white-space: nowrap;
}
.subsidy-badge.alt {
  background: rgba(245,158,11,0.18);
  color: #fbbf24;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .index-title {
    font-size: 32px;
  }

  .index-hero, .filter-section, .index-main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .detail-header-inner, .detail-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-title {
    font-size: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .floating-toc {
    display: none;
  }
}
