/* =========================================================
   投資回収シミュレーター - seo-check 系ダークテーマ
   ========================================================= */

:root {
  --bg: #0d0d12;
  --fg: #f5f5f7;
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.04);
  --card-bg-hover: rgba(255, 255, 255, 0.04);

  --purple: #a855f7;
  --purple-light: #c084fc;
  --purple-dark: #7c3aed;
  --orange: #f97316;
  --orange-light: #fb923c;
  --teal: #14b8a6;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.3);

  --profit: #22c55e;
  --loss: #ef4444;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               "游ゴシック", "Yu Gothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
               "Noto Sans JP", "Meiryo", sans-serif;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.6;
  min-height: 100vh;
}

body { min-height: 100vh; position: relative; overflow-x: hidden; }

/* Aurora gradient header */
.aurora-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 50, 200, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(200, 100, 150, 0.3) 0%, transparent 40%),
    radial-gradient(ellipse 50% 30% at 30% 10%, rgba(249, 115, 22, 0.2) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ========== Top Nav ========== */
.top-nav {
  position: relative;
  z-index: 10;
  padding: 18px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.logo-link:hover { opacity: 1; }
.logo-img {
  height: 42px;
  width: auto;
  display: block;
}
.nav-tool-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 20px 60px;
  position: relative;
  z-index: 1;
}

/* ========== Header (hero) ========== */
.site-header {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px;
}
.brand-mark { color: var(--text-primary); font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
.brand-divider { color: rgba(255, 255, 255, 0.15); }
.brand-tool { color: var(--purple-light); }

.site-title {
  font-size: clamp(28px, 5vw, 48px);
  margin: 0 0 16px;
  color: var(--text-primary);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.site-title .accent {
  font-weight: 600;
  background: linear-gradient(135deg, #a855f7 0%, #c084fc 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}
.site-title .title-sub {
  font-size: 0.55em;
  font-weight: 300;
  color: var(--text-tertiary);
  margin-left: 0.4em;
  letter-spacing: 0;
}
@media (max-width: 540px) {
  .site-title .title-sub { display: block; margin: 6px 0 0; font-size: 0.5em; }
}

.site-lead {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 auto 24px;
  max-width: 680px;
  font-weight: 300;
  line-height: 1.75;
}
.site-lead strong { color: var(--text-primary); font-weight: 500; }

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.feature-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.feature-badges svg {
  width: 16px;
  height: 16px;
  color: var(--purple-light);
}

/* ========== Glass Cards ========== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.card-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 20px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: linear-gradient(to bottom, var(--purple), var(--orange));
  border-radius: 2px;
}

.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  text-align: center;
  margin: 0 0 8px;
}

/* ========== Input Card ========== */
.input-card { padding: 28px; }

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.field-wide { grid-column: span 2; }
.field { display: flex; flex-direction: column; }

.field label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: block;
  line-height: 1.5;
}
.input-card .field > label {
  /* オーバーライドは下の .field label flex 定義側で行う */
}
.label-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(249, 115, 22, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  margin-right: 14px;
  vertical-align: -14px;
  letter-spacing: 0;
  box-shadow: 0 4px 12px -4px rgba(168, 85, 247, 0.4);
}
/* ステップ番号付きラベルの強調 */
label:has(> .label-step) {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  font-size: 17px !important;
  font-weight: 700 !important;
  gap: 0;
  color: var(--text-primary);
  margin-bottom: 14px !important;
}
label:has(> .label-step) .hint {
  flex-basis: 100%;
  margin-left: 56px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
}
.row-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 64px;
  letter-spacing: 0;
}

/* 時間×人件費モード横並び */
.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 6px;
}
.time-col { display: flex; flex-direction: column; gap: 8px; }
.time-col .row-label {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: none;
  min-width: 0;
}
.time-col .input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.time-col .input-with-unit { flex: 1 1 auto; min-width: 0; }
.preview-only {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
@media (max-width: 760px) {
  .time-grid { grid-template-columns: 1fr; gap: 16px; }
}
.field .hint, .impact-field .hint {
  display: block;
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 4px;
  letter-spacing: 0;
  line-height: 1.5;
}

/* Inputs */
.input-with-unit {
  display: inline-flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  min-width: 0;
}
/* Size variants: 数値の桁数に合わせた適切な幅 */
.input-with-unit.size-num    { width: 110px; }   /* 例: 10時間, 24ヶ月, 20日 */
.input-with-unit.size-money  { width: 160px; }   /* 例: 15,000円 */
.input-with-unit.size-money-lg { width: 180px; } /* 例: 50,000円〜 */
.input-with-unit:focus-within {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08);
}
.input-with-unit input {
  border: none;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  width: 100%;
  outline: none;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.input-with-unit input::placeholder { color: var(--text-tertiary); }
.input-with-unit .unit {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  font-weight: 400;
}

.select {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 34px 12px 14px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  flex: 0 0 auto;
}
.select.size-period { width: 130px; }
.select.size-wage   { width: 110px; }
.select:focus {
  border-color: rgba(168, 85, 247, 0.5);
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08);
}
.select option { background: #1a1a22; color: var(--text-primary); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row + .row { margin-top: 10px; }

.readonly-result {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 0 4px;
  letter-spacing: 0;
}
.readonly-result.inline {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.readonly-result strong {
  color: var(--purple-light);
  font-size: 16px;
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: inline-flex;
  width: auto;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
  gap: 2px;
}
.tab {
  border: none;
  background: transparent;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 9px;
  font-family: inherit;
  transition: all 0.2s ease;
}
.tab.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(249, 115, 22, 0.15));
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.tab:hover:not(.active) { color: var(--text-primary); }
.tab-panel.hidden { display: none; }

/* Range slider */
.period-row { gap: 16px; }
.range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, var(--purple) 0%, var(--purple) var(--range-fill, 38%), rgba(255,255,255,0.08) var(--range-fill, 38%), rgba(255,255,255,0.08) 100%);
  border-radius: 3px;
  outline: none;
  min-width: 0;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border: 3px solid #1a1a22;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.3), 0 4px 12px rgba(168, 85, 247, 0.4);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border: 3px solid #1a1a22;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.3), 0 4px 12px rgba(168, 85, 247, 0.4);
  cursor: pointer;
}
.period-row .input-with-unit { flex: 0 0 120px; width: 120px; }

/* number input native arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.field.invalid .input-with-unit { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.05); }

/* Advanced (details) */
.advanced {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  transition: background 0.2s;
}
.advanced[open] { background: rgba(255, 255, 255, 0.025); }
.advanced summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: color 0.15s;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary:hover { color: var(--text-primary); }
.advanced summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s;
  margin-right: 2px;
}
.advanced[open] summary::before { transform: rotate(45deg); }
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 8px 18px 18px;
}
@media (max-width: 760px) {
  .advanced-grid { grid-template-columns: 1fr; }
}

/* ========== Incident (ミス・トラブル) Block ========== */
.incident-block {
  margin-top: 22px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.04), rgba(168, 85, 247, 0.03));
  border: 1px solid rgba(249, 115, 22, 0.12);
  border-radius: 16px;
  overflow: hidden;
}
.incident-block[open] {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(168, 85, 247, 0.04));
}
.incident-block summary {
  cursor: pointer;
  padding: 16px 20px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  flex-wrap: wrap;
}
.incident-block summary::-webkit-details-marker { display: none; }
.incident-block summary::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.8px solid var(--orange-light);
  border-bottom: 1.8px solid var(--orange-light);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.incident-block[open] summary::before { transform: rotate(45deg); }

.incident-summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.incident-summary-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
  flex-basis: 100%;
  margin-left: 21px;
  line-height: 1.5;
}

.incident-body {
  padding: 4px 20px 22px;
}
.incident-lead {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--orange);
  border-radius: 0 10px 10px 0;
}

.incident-freq-row {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.incident-impact-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.incident-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 20px;
}
.impact-field {
  display: flex;
  flex-direction: column;
}
.impact-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
  line-height: 1.5;
}
.impact-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(249, 115, 22, 0.18);
  color: var(--orange-light);
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  vertical-align: -4px;
}
.impact-field .input-with-unit { width: 100%; max-width: 220px; }

.incident-summary-box {
  margin-top: 22px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}
.incident-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
}
.incident-summary-row strong {
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.incident-summary-row.highlight {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.incident-summary-row.highlight strong {
  color: var(--orange-light);
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .incident-grid { grid-template-columns: 1fr; gap: 16px; }
  .incident-summary-row { flex-wrap: wrap; gap: 4px; }
  .incident-summary-row strong { margin-left: auto; }
  .impact-field .input-with-unit { max-width: none; }
}

/* ========== Summary Cards ========== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.summary-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.3s ease;
}
.summary-card:hover {
  background: var(--card-bg-hover);
  transform: translateY(-2px);
}
.summary-card.is-good::after {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), transparent);
}
.summary-card.is-bad::after {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), transparent);
}
.summary-card.is-neutral::after {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), transparent);
}

.summary-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.summary-value {
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  word-break: break-all;
}
.summary-card.is-good .summary-value { color: #4ade80; font-weight: 400; }
.summary-card.is-bad .summary-value { color: #f87171; font-weight: 400; }
.summary-sub {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== Chart Card ========== */
.chart-card { padding: 24px 26px 20px; }
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-header .card-title { margin-bottom: 0; }
.legend-note {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding-top: 4px;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 0;
  box-shadow: 0 0 8px currentColor;
}
.legend-cost { background: var(--loss); color: var(--loss); }
.legend-saving { background: var(--teal); color: var(--teal); }
.legend-profit { background: var(--profit); color: var(--profit); }

.chart-wrap {
  position: relative;
  height: 380px;
  margin-top: 12px;
}
.chart-caption {
  margin: 14px 0 0;
  text-align: center;
}
.chart-caption-main {
  margin: 0;
  font-size: 13px;
  color: var(--text-tertiary);
}
.chart-caption-hint {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  padding: 6px 12px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 100px;
}
.chart-caption-hint svg {
  flex-shrink: 0;
  color: var(--purple-light);
}

/* グラフ直下の期間スライダー */
.period-control {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}
.period-control-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.period-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
}
.period-control .range { flex: 1; }
.period-control .period-input {
  flex: 0 0 110px;
  width: 110px;
}
@media (max-width: 760px) {
  .period-control { flex-wrap: wrap; gap: 10px; }
  .period-control .range { flex: 1 1 100%; order: 3; }
  .period-control-label { order: 1; }
  .period-control .period-input { order: 2; margin-left: auto; }
}

/* ========== Comment ========== */
.comment-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 26px;
}
.comment-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(249, 115, 22, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  flex-shrink: 0;
}
.comment-icon svg { width: 18px; height: 18px; }
.comment-card.is-good .comment-icon {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
  color: #4ade80;
}
.comment-card.is-bad .comment-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  color: #f87171;
}
.comment-body { flex: 1; min-width: 0; }
.comment-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.comment-text {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ========== Intangible (定量化しにくい効果) ========== */
.intangible-card {
  padding: 32px 28px 28px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(168, 85, 247, 0.12);
}
.intangible-header {
  text-align: center;
  margin-bottom: 28px;
}
.intangible-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-light);
  font-weight: 600;
  padding: 5px 14px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 100px;
  margin-bottom: 16px;
}
.intangible-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 8px var(--purple-light);
}
.intangible-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.intangible-lead {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.85;
  margin: 0 auto;
  max-width: 720px;
  font-weight: 300;
}
.intangible-lead strong {
  color: var(--text-primary);
  font-weight: 500;
}

.intangible-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.intangible-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.intangible-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 85, 247, 0.25);
  transform: translateY(-2px);
}
.intangible-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(249, 115, 22, 0.1));
  color: var(--purple-light);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.intangible-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: 0;
  line-height: 1.4;
}
.intangible-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  font-weight: 300;
}

.intangible-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 8px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 300;
}
.intangible-footer strong {
  color: var(--orange-light);
  font-weight: 600;
}

@media (max-width: 760px) {
  .intangible-card { padding: 24px 18px 20px; }
  .intangible-title { font-size: 22px; }
  .intangible-lead { font-size: 14px; }
  .intangible-grid { grid-template-columns: 1fr; }
}

/* ========== Actions ========== */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: 0;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -8px rgba(168, 85, 247, 0.5);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* CTA: 業務改善のご相談 */
.btn-cta {
  background: linear-gradient(135deg, #f97316 0%, #a855f7 100%);
  color: #fff;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px -10px rgba(249, 115, 22, 0.5);
  position: relative;
  overflow: hidden;
}
.btn-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fb923c 0%, #c084fc 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: inherit;
}
.btn-cta > * { position: relative; z-index: 1; }
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -8px rgba(249, 115, 22, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.btn-cta:hover::before { opacity: 1; }
.btn-cta .cta-arrow { transition: transform 0.25s ease; }
.btn-cta:hover .cta-arrow { transform: translateX(3px); }
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 12px 28px -10px rgba(249, 115, 22, 0.5); }
  50% { box-shadow: 0 16px 36px -10px rgba(249, 115, 22, 0.7), 0 0 0 4px rgba(249, 115, 22, 0.08); }
}
.btn-cta { animation: ctaGlow 3s ease-in-out infinite; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}
.btn-icon { font-size: 14px; line-height: 1; }
.action-note {
  font-size: 14px;
  color: #4ade80;
  font-weight: 500;
}

/* ========== Footer ========== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  margin-top: 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-brand {
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.footer-text {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.delay-1 { animation-delay: 0.05s; opacity: 0; }
.delay-2 { animation-delay: 0.10s; opacity: 0; }
.delay-3 { animation-delay: 0.15s; opacity: 0; }
.delay-4 { animation-delay: 0.20s; opacity: 0; }
.delay-5 { animation-delay: 0.25s; opacity: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* Selection */
::selection { background: rgba(168, 85, 247, 0.4); color: #fff; }

/* ========== Responsive ========== */
@media (max-width: 760px) {
  .top-nav { padding: 14px 16px; }
  .logo-img { height: 36px; }
  .nav-tool-label { font-size: 12px; }
  .page { padding: 4px 14px 48px; }
  .site-header { margin-bottom: 24px; padding-top: 8px; }
  .site-lead { font-size: 14px; }
  .feature-badges { gap: 14px; font-size: 13px; }
  .card { padding: 20px; border-radius: 18px; }
  .input-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-wide { grid-column: span 1; }
  /* モバイルでは数値入力もある程度伸びる */
  .input-with-unit.size-money,
  .input-with-unit.size-money-lg { width: auto; flex: 1 1 auto; min-width: 140px; }
  .select.size-period,
  .select.size-wage { flex: 0 0 auto; }
  .readonly-result.inline { margin-left: 0; flex-basis: 100%; }
  .summary-grid { grid-template-columns: 1fr; gap: 12px; }
  .summary-card { padding: 20px 22px; border-radius: 18px; }
  .summary-value { font-size: 28px; }
  .chart-wrap { height: 320px; }
  .chart-header { flex-direction: column; gap: 8px; }
  .legend-note { gap: 12px; font-size: 11px; }
  .actions .btn { flex: 1 1 calc(50% - 6px); justify-content: center; padding: 13px 20px; }
  .period-row { flex-direction: column; align-items: stretch; }
  .period-row .input-with-unit { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .summary-value { font-size: 26px; }
  .tabs { width: 100%; align-self: stretch; }
  .tab { flex: 1; text-align: center; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { flex: none; }
}
