/* ===== コストダウン計算ツール ===== */

/* ヒーロー */
.calc-hero {
  background: var(--navy);
  color: #fff;
  padding: 32px 16px 24px;
  text-align: center;
}

.calc-hero-badge {
  display: inline-block;
  background: var(--teal);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.calc-hero h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.calc-hero p {
  font-size: 14px !important;
  opacity: 0.85;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6 !important;
  white-space: nowrap;
}

/* ===== v7 計算ツール（.calc-tool-wrap スコープ） ===== */

.calc-tool-wrap {
  --v7-navy: #1a2744;
  --v7-blue: #0f3460;
  --v7-gold: #82d8d0;
  --v7-gold-light: #a8e8e0;
  --v7-green: #27ae60;
  --v7-teal: #5bbfb6;
  --v7-bg: #f4f3ee;
  --v7-card: #fff;
  --v7-text: #1a1a1a;
  --v7-muted: #888;
  margin-top: 0;
  position: relative;
}

/* ローディングオーバーレイ */
.calc-tool-wrap .loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,52,96,0.92);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}
.calc-tool-wrap .loading-overlay.show { display: flex; }
.calc-tool-wrap .loading-spinner {
  width: 64px;
  height: 64px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: var(--v7-gold);
  border-radius: 50%;
  animation: calcSpin 0.8s linear infinite;
  margin-bottom: 24px;
}
@keyframes calcSpin { to { transform: rotate(360deg); } }
.calc-tool-wrap .loading-title { font-size: 22px; font-weight: 900; color: var(--v7-gold); margin-bottom: 8px; }
.calc-tool-wrap .loading-msg { font-size: 14px; opacity: 0.7; }
.calc-tool-wrap .loading-step { font-size: 14px; opacity: 0.5; margin-top: 12px; height: 18px; transition: all 0.4s; }

/* スティッキーバー */
.calc-tool-wrap .sticky-bar { display: none; }
.calc-tool-wrap .sticky-inner { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: center; }
.calc-tool-wrap .s-item { text-align: center; }
.calc-tool-wrap .s-label { font-size: 14px; opacity: 0.5; font-weight: 700; letter-spacing: 0.5px; display: block; margin-bottom: 2px; color: white; }
.calc-tool-wrap .s-val { font-size: clamp(15px,2.8vw,22px); font-weight: 900; line-height: 1; transition: all 0.3s; color: white; }
.calc-tool-wrap .s-val.gold { color: var(--v7-gold); }
.calc-tool-wrap .s-val.green { color: #5dde95; }
.calc-tool-wrap .s-val.teal { color: #5eead4; }
.calc-tool-wrap .s-val.pop { animation: calcPop 0.35s ease; }
@keyframes calcPop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.calc-tool-wrap .sticky-cta { background: var(--v7-gold); color: #ffffff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 900; font-family: inherit; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; transition: all 0.2s; }
.calc-tool-wrap .sticky-cta:hover { background: var(--v7-gold-light); transform: translateY(-1px); }

/* コンテナ */
.calc-tool-wrap .container { max-width: 720px; margin: 0 auto; padding: 28px 16px 100px; }

/* ステップラベル */
.calc-tool-wrap .step-label { font-size: 14px; font-weight: 700; color: var(--v7-blue); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.calc-tool-wrap .step-label::before { content: attr(data-step); background: var(--v7-blue); color: white; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; flex-shrink: 0; }

/* 業種ボタン */
.calc-tool-wrap .industry-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 32px; }
.calc-tool-wrap .ind-btn { background: white; border: 2px solid #e8e8e0; border-radius: 14px; padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.calc-tool-wrap .ind-btn:hover { border-color: var(--v7-gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(130,216,208,0.2); }
.calc-tool-wrap .ind-btn.active { border-color: var(--v7-blue); background: linear-gradient(135deg,#f0f7ff,#e8f4fd); }
.calc-tool-wrap .ind-icon { font-size: 26px; margin-bottom: 6px; }
.calc-tool-wrap .ind-name { font-size: 14px; font-weight: 700; color: var(--v7-text); }
.calc-tool-wrap .ind-avg { font-size: 14px; color: var(--v7-muted); margin-top: 3px; }
.calc-tool-wrap .ind-btn.active .ind-avg { color: var(--v7-blue); font-weight: 700; }

/* 作業リスト */
.calc-tool-wrap .task-section { display: none; }
.calc-tool-wrap .task-section.show { display: block; animation: calcFadeIn 0.4s ease; }
@keyframes calcFadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.calc-tool-wrap .task-intro { background: white; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; border-left: 4px solid var(--v7-gold); box-shadow: 0 2px 8px rgba(0,0,0,0.05); font-size: 16px; color: #444; line-height: 1.8; }
.calc-tool-wrap .task-intro strong { color: var(--v7-blue); }

/* 作業カード */
.calc-tool-wrap .task-card { background: white; border-radius: 14px; margin-bottom: 10px; border: 2px solid transparent; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: all 0.2s; overflow: hidden; }
.calc-tool-wrap .task-card:hover { border-color: rgba(130,216,208,0.4); transform: translateY(-1px); }
.calc-tool-wrap .task-card.active { border-color: var(--v7-blue); background: linear-gradient(135deg,#f0f7ff,#e8f4fd); }
.calc-tool-wrap .task-card.active .task-quick { display: grid; }

.calc-tool-wrap .task-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none; }
.calc-tool-wrap .task-chk { width: 24px; height: 24px; border: 2px solid #ddd; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: transparent; background: white; transition: all 0.2s; }
.calc-tool-wrap .task-card.active .task-chk { background: var(--v7-blue); border-color: var(--v7-blue); color: white; }
.calc-tool-wrap .task-info { flex: 1; }
.calc-tool-wrap .task-name { font-size: 16px; font-weight: 700; color: var(--v7-text); line-height: 1.4; }
.calc-tool-wrap .task-default { font-size: 14px; color: var(--v7-muted); margin-top: 2px; }
.calc-tool-wrap .task-card.active .task-default { color: var(--v7-blue); font-weight: 600; }
.calc-tool-wrap .task-saving-badge { background: var(--v7-green); color: white; font-size: 14px; font-weight: 900; padding: 3px 10px; border-radius: 20px; white-space: nowrap; opacity: 0; transition: opacity 0.3s; flex-shrink: 0; }
.calc-tool-wrap .task-card.active .task-saving-badge { opacity: 1; }

/* クイック結果 */
.calc-tool-wrap .task-quick { display: none; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 16px 12px; }
.calc-tool-wrap .tq-item { background: linear-gradient(135deg, var(--v7-navy), var(--v7-blue)); border-radius: 10px; padding: 10px; text-align: center; }
.calc-tool-wrap .tq-label { font-size: 14px; color: rgba(255,255,255,0.55); font-weight: 700; display: block; margin-bottom: 3px; }
.calc-tool-wrap .tq-val { font-size: 16px; font-weight: 900; color: white; }
.calc-tool-wrap .tq-val.gold { color: var(--v7-gold); }
.calc-tool-wrap .tq-val.teal { color: #5eead4; }

/* 詳細入力 */
.calc-tool-wrap .task-expand-btn { display: none; align-items: center; gap: 6px; margin: 0 16px 12px; padding: 7px 14px; background: transparent; border: 1px dashed #aac4e0; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--v7-blue); cursor: pointer; font-family: inherit; transition: all 0.2s; width: calc(100% - 32px); }
.calc-tool-wrap .task-expand-btn:hover { background: #e8f4fd; border-style: solid; }
.calc-tool-wrap .task-card.active .task-expand-btn { display: flex; }
.calc-tool-wrap .expand-arrow { transition: transform 0.25s; display: inline-block; }

.calc-tool-wrap .task-detail { display: none; padding: 0 16px 14px; }
.calc-tool-wrap .task-detail.open { display: block; animation: calcSlideDown 0.3s ease; }
@keyframes calcSlideDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }

.calc-tool-wrap .detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.calc-tool-wrap .d-field label { font-size: 14px; color: var(--v7-muted); font-weight: 700; letter-spacing: 0.3px; display: block; margin-bottom: 4px; }
.calc-tool-wrap .d-wrap { display: flex; align-items: center; background: #f0f4f8; border-radius: 10px; padding: 8px 12px; border: 1px solid #dde4ee; transition: border-color 0.2s; }
.calc-tool-wrap .d-wrap:focus-within { border-color: var(--v7-blue); background: white; }
.calc-tool-wrap .d-wrap input { border: none; background: transparent; font-size: 16px; font-weight: 700; font-family: inherit; color: var(--v7-text); width: 100%; outline: none; text-align: right; }
.calc-tool-wrap .d-wrap .unit { font-size: 14px; color: var(--v7-muted); margin-left: 4px; white-space: nowrap; }
.calc-tool-wrap .slider-row { display: flex; align-items: center; gap: 12px; }
.calc-tool-wrap .slider-row label { font-size: 14px; color: var(--v7-muted); font-weight: 700; min-width: 100px; }
.calc-tool-wrap .slider-row input[type=range] { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: #dde4ee; border-radius: 3px; outline: none; cursor: pointer; }
.calc-tool-wrap .slider-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; background: var(--v7-blue); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.calc-tool-wrap .slider-row input[type=range]::-moz-range-thumb { width: 22px; height: 22px; background: var(--v7-blue); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.calc-tool-wrap .slider-val { font-size: 16px; font-weight: 900; color: white; background: var(--v7-blue); padding: 2px 10px; border-radius: 8px; min-width: 52px; text-align: center; }

/* 結果パネル */
.calc-tool-wrap .result-section { display: none; margin-top: 24px; }
.calc-tool-wrap .result-section.show { display: block; animation: calcFadeIn 0.5s ease; }

.calc-tool-wrap .result-hero { background: linear-gradient(160deg, var(--v7-navy), var(--v7-blue)); border-radius: 24px; padding: 32px 24px; color: white; text-align: center; margin-bottom: 14px; position: relative; overflow: hidden; }
.calc-tool-wrap .result-hero::before { content:''; position: absolute; inset: 0; background: radial-gradient(ellipse at 80% 20%, rgba(130,216,208,0.15), transparent 55%); }
.calc-tool-wrap .rh-pre { font-size: 18px; opacity: 0.85; margin-bottom: 10px; font-weight: 700; position: relative; }
.calc-tool-wrap .rh-industry { font-size: 16px; font-weight: 900; color: var(--v7-gold); margin-bottom: 12px; position: relative; }
.calc-tool-wrap .rh-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; position: relative; }
.calc-tool-wrap .rh-item { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 14px; }
.calc-tool-wrap .rh-label { font-size: 14px; opacity: 0.55; font-weight: 700; display: block; margin-bottom: 4px; }
.calc-tool-wrap .rh-val { font-size: clamp(18px,4vw,26px); font-weight: 900; line-height: 1.1; }
.calc-tool-wrap .rh-val.gold { color: var(--v7-gold); }
.calc-tool-wrap .rh-val.green { color: #5dde95; }
.calc-tool-wrap .rh-val.teal { color: #5eead4; }

/* 5年カード */
.calc-tool-wrap .five-year-card { background: linear-gradient(135deg,#f0fff8,#e0f7ef); border: 2px solid #a8e6c0; border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 14px; }
.calc-tool-wrap .fy-title { font-size: 18px; color: var(--v7-green); font-weight: 900; margin-bottom: 10px; }
.calc-tool-wrap .fy-val { font-size: clamp(26px,6vw,40px); font-weight: 900; color: var(--v7-green); line-height: 1; }
.calc-tool-wrap .fy-sub { font-size: 14px; color: #666; margin-top: 6px; }

/* 人的資本メッセージ */
.calc-tool-wrap .human-card { background: white; border-radius: 16px; padding: 20px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-left: 4px solid var(--v7-teal); }
.calc-tool-wrap .human-title { font-size: 18px; font-weight: 900; color: #1a7a6e; margin-bottom: 10px; }
.calc-tool-wrap .human-body { font-size: 16px; color: #444; line-height: 1.85; }
.calc-tool-wrap .human-body strong { color: #1a7a6e; }

/* TOP作業 */
.calc-tool-wrap .top-title { font-size: 18px; font-weight: 900; color: var(--v7-navy); padding-left: 12px; border-left: 3px solid var(--v7-gold); margin-bottom: 16px; }
.calc-tool-wrap .top-card { background: white; border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; gap: 12px; align-items: center; }
.calc-tool-wrap .top-rank { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; flex-shrink: 0; color: white; }
.calc-tool-wrap .r1 { background: linear-gradient(135deg,#82d8d0,#a8e8e0); color: var(--v7-navy); }
.calc-tool-wrap .r2 { background: linear-gradient(135deg,#aaa,#ccc); }
.calc-tool-wrap .r3 { background: linear-gradient(135deg,#cd7f32,#e09560); }
.calc-tool-wrap .top-info { flex: 1; }
.calc-tool-wrap .top-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.calc-tool-wrap .top-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.calc-tool-wrap .tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 14px; font-weight: 700; }
.calc-tool-wrap .tag-g { background: #eafaf1; color: var(--v7-green); }
.calc-tool-wrap .tag-t { background: #e8f4fd; color: var(--v7-blue); }

/* CTA */
.calc-tool-wrap .cta-card { background: linear-gradient(160deg, var(--v7-navy), var(--v7-blue)); border-radius: 24px; padding: 30px 24px; color: white; text-align: center; margin-top: 20px; }
.calc-tool-wrap .cta-card h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; line-height: 1.4; }
.calc-tool-wrap .cta-card p { font-size: 16px; opacity: 0.65; margin-bottom: 20px; }
.calc-tool-wrap .cta-p { display: block; width: 100%; padding: 16px; background: var(--v7-gold); color: #ffffff; border: none; border-radius: 12px; font-size: 16px; font-weight: 900; font-family: inherit; cursor: pointer; text-decoration: none; margin-bottom: 10px; transition: all 0.2s; }
.calc-tool-wrap .cta-p:hover { background: var(--v7-gold-light); transform: translateY(-1px); }
.calc-tool-wrap .cta-note { font-size: 14px; opacity: 0.45; margin-top: 8px; }

/* スコアカード */
.calc-tool-wrap .score-card { background: linear-gradient(160deg, var(--v7-navy), var(--v7-blue)); border-radius: 24px; padding: 36px 24px 28px; color: white; text-align: center; margin-bottom: 14px; position: relative; overflow: hidden; }
.calc-tool-wrap .score-card::before { content:''; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 20%, rgba(130,216,208,0.18), transparent 55%); }
.calc-tool-wrap .sc-pre { font-size: 18px; opacity: 0.85; font-weight: 700; margin-bottom: 10px; position: relative; }
.calc-tool-wrap .sc-score-wrap { display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin-bottom: 10px; position: relative; }
.calc-tool-wrap .sc-num { font-size: clamp(72px, 16vw, 100px); font-weight: 900; color: #e8b86d; line-height: 1; }
.calc-tool-wrap .sc-pct { font-size: 36px; font-weight: 900; color: #e8b86d; opacity: 0.8; padding-bottom: 10px; }
.calc-tool-wrap .sc-label { font-size: 20px; font-weight: 900; margin-bottom: 6px; position: relative; }
.calc-tool-wrap .sc-msg { font-size: 16px; opacity: 0.65; position: relative; }

/* 診断ボタンエリア */
.calc-tool-wrap .diagnose-wrap { text-align: center; padding: 32px 0 16px; }
.calc-tool-wrap .diagnose-count { font-size: 16px; font-weight: 700; color: var(--v7-blue); margin-bottom: 12px; min-height: 20px; }
.calc-tool-wrap .diagnose-btn { display: inline-flex; align-items: center; gap: 10px; padding: 18px 52px; background: linear-gradient(135deg, var(--v7-gold), var(--v7-gold-light)); color: #ffffff; border: none; border-radius: 50px; font-size: 16px; font-weight: 900; font-family: inherit; cursor: pointer; box-shadow: 0 6px 24px rgba(130,216,208,0.45); transition: all 0.3s; }
.calc-tool-wrap .diagnose-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(130,216,208,0.55); }
.calc-tool-wrap .diagnose-hint { font-size: 14px; color: var(--v7-muted); margin-top: 8px; }

/* 注意書き */
.calc-tool-wrap .disclaimer { font-size: 14px; color: var(--v7-muted); text-align: center; padding: 16px 8px 0; line-height: 1.7; }


/* ===== 事例スライダー ===== */

.calc-cases-section {
  background: var(--bg2);
  padding: 56px 16px;
}

.calc-cases-inner {
  max-width: 900px;
  margin: 0 auto;
}

.calc-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--teal);
}

.calc-cases-slider {
  overflow: hidden;
}

.calc-cases-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease;
}

.calc-case-card {
  min-width: 280px;
  max-width: 280px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.calc-case-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: var(--teal-pale);
  color: var(--navy);
  padding: 3px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.calc-case-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.4;
}

.calc-case-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}

.calc-case-before { color: #999; }
.calc-case-arrow { color: var(--teal-dark); font-size: 18px; }
.calc-case-after { color: var(--teal-dark); }

.calc-case-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 12px;
}

.calc-case-effect {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  background: var(--teal-pale);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}

.calc-cases-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.calc-cases-nav-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calc-cases-nav-btn:hover {
  border-color: var(--teal);
  background: var(--teal-pale);
}


/* ===== レスポンシブ ===== */

@media (max-width: 540px) {
  .calc-tool-wrap .industry-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .calc-tool-wrap .sticky-inner { grid-template-columns: 1fr 1fr; }
  .calc-tool-wrap .sticky-cta { grid-column: 1/-1; text-align: center; }
  .calc-tool-wrap .detail-grid { grid-template-columns: 1fr 1fr; }
  .calc-tool-wrap .rh-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 768px) {
  .calc-hero h1 {
    font-size: 22px;
  }

  .calc-cases-section {
    padding-bottom: 80px;
  }

  .calc-cases-slider {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .calc-cases-slider::-webkit-scrollbar {
    display: none;
  }

  .calc-case-card {
    scroll-snap-align: start;
  }

  .calc-cases-nav {
    margin-bottom: 16px;
  }
}
