:root {
  --primary: #FF6B35;
  --primary-dark: #e05520;
  --primary-light: #fff3ee;
  --secondary: #2D3748;
  --accent: #F6AD55;
  --success: #48BB78;
  --bg: #F7F8FC;
  --card-bg: #ffffff;
  --text: #1A202C;
  --text-muted: #718096;
  --border: #E2E8F0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(255,107,53,0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  color: white;
  padding: 40px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,107,53,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(246,173,85,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.header-badge {
  display: inline-block;
  background: rgba(255,107,53,0.2);
  border: 1px solid rgba(255,107,53,0.4);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

header h1 {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

header h1 span {
  color: var(--primary);
}

header p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  margin: 0 auto 24px;
}

/* ===== PLAN SELECTOR ===== */
.plan-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.plan-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  backdrop-filter: blur(4px);
}

.plan-btn:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  color: white;
  transform: translateY(-2px);
}

.plan-btn.active {
  border-color: var(--accent);
  background: rgba(246,173,85,0.2);
  color: white;
  box-shadow: 0 0 0 3px rgba(246,173,85,0.3);
}

.plan-btn .plan-emoji {
  font-size: 28px;
  line-height: 1;
}

.plan-btn .plan-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plan-btn .plan-price {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

.plan-btn.active .plan-price {
  opacity: 1;
  color: var(--accent);
}

/* ===== SUMMARY CARD ===== */
.summary-wrapper {
  max-width: 900px;
  margin: -40px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.summary-item {
  text-align: center;
}

.summary-item .label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.summary-item .value {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.summary-item.total .value {
  color: var(--success);
}

.summary-item.fee .value {
  color: var(--primary);
}

.summary-item.ratio .value {
  color: var(--secondary);
}

.comparison-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comparison-item {
  min-width: 0;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.comparison-item span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.comparison-item strong {
  display: block;
  font-size: 16px;
  color: var(--secondary);
  line-height: 1.2;
  word-break: keep-all;
}

.summary-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
}

.summary-arrow {
  font-size: 24px;
  color: var(--text-muted);
}

.savings-bar {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.savings-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.savings-bar-track {
  height: 10px;
  background: #EDF2F7;
  border-radius: 99px;
  overflow: hidden;
}

.savings-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
}

/* ===== USAGE / ASSUMPTIONS ===== */
.usage-panel,
.assumption-panel {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 5;
}

.usage-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.usage-copy {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.usage-kicker {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.usage-copy p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.usage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.usage-action {
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.usage-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.usage-action.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.usage-action.primary:hover {
  background: var(--primary-dark);
  color: white;
}

.assumption-panel {
  background: #fffaf6;
  border: 1px solid rgba(255,107,53,0.22);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.assumption-panel h2 {
  font-size: 15px;
  color: var(--secondary);
  margin-bottom: 8px;
}

.assumption-panel ul {
  padding-left: 18px;
}

.assumption-panel li {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 16px 60px;
}

/* ===== FILTERS ===== */
.filter-section {
  margin-bottom: 32px;
}

.filter-section h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--secondary);
}

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

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 99px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.filter-tab .count {
  background: rgba(255,255,255,0.25);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

.filter-tab:not(.active) .count {
  background: var(--border);
  color: var(--text-muted);
}

/* ===== SECTION HEADER ===== */
.section-header {
  grid-column: 1 / -1;
  font-size: 17px;
  font-weight: 800;
  color: var(--secondary);
  padding: 8px 4px 4px;
  margin-top: 8px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ===== FEATURE CARD ===== */
.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  animation: fadeIn 0.3s ease forwards;
}

.feature-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(255,107,53,0.2);
  transform: translateY(-3px);
}

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

.card-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-value-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.card-body {
  padding: 16px 20px 20px;
}

.equivalents-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.equivalent-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.equivalent-item:last-child {
  margin-bottom: 0;
}

.equiv-left {
  flex: 1;
  min-width: 0;
}

.equiv-service {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.equiv-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.equiv-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
}

.equiv-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.equiv-meta .equiv-tag {
  margin-top: 0;
}

.equiv-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-muted);
}

.equiv-source a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.equiv-source a:hover {
  text-decoration: underline;
}

.equiv-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
}

.equiv-price.free {
  color: var(--success);
}

.equiv-price.commission {
  color: #E53E3E;
}

/* ===== CARD TOGGLE (チェックボックス) ===== */
.card-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.card-toggle-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.feature-card.disabled {
  opacity: 0.58;
  filter: grayscale(0.6);
}

.feature-card.disabled:hover {
  box-shadow: var(--shadow);
  border-color: transparent;
  transform: none;
}

.feature-card.disabled .card-body {
  opacity: 0.72;
}

.feature-card.disabled .card-value-badge {
  background: var(--text-muted);
}

/* ===== USER INPUT SECTION ===== */
.card-input-section {
  margin: 12px 0 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #FFF8F4, #FFFBF0);
  border: 1.5px dashed rgba(255,107,53,0.35);
  border-radius: var(--radius-sm);
}

.card-input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-input-row .prefix {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.card-input-row input[type="number"] {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.card-input-row input.compact-number {
  flex: 0 0 80px;
  width: 80px;
}

.card-input-row input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}

.card-input-row input[type="number"]:disabled {
  cursor: not-allowed;
  background: #F1F5F9;
  color: var(--text-muted);
}

.card-input-row .suffix {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-input-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.commission-result {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #E53E3E;
  display: none;
}

.commission-result.visible {
  display: block;
}

.equiv-price.calculated {
  color: #E53E3E;
  font-size: 12px;
}

.equiv-price.calculated .calc-detail {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ===== DISCLAIMER ===== */
.disclaimer {
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 16px;
}

.disclaimer p {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  line-height: 1.7;
}

.disclaimer p::before {
  content: "📌 ";
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .usage-panel {
    grid-template-columns: 1fr;
  }

  .usage-actions {
    justify-content: stretch;
  }

  .usage-action {
    flex: 1;
    min-width: 0;
  }

  .comparison-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .summary-divider {
    display: none;
  }

  .summary-arrow {
    display: none;
  }

  .summary-item .value {
    font-size: 22px;
  }

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

  header {
    padding: 32px 16px 52px;
  }
}

/* ===== NO RESULTS ===== */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results .emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== STICKY MINI SUMMARY ===== */
.sticky-summary {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(26, 26, 46, 0.96);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transform: translateY(-100%);
  transition: transform 0.25s ease;
  cursor: pointer;
  font-size: 0.9rem;
}
.sticky-summary.visible {
  transform: translateY(0);
}
.sticky-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.sticky-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
}
.sticky-item strong {
  font-weight: 700;
}
.sticky-item.ratio strong {
  color: var(--accent);
  font-size: 1.05rem;
}
.sticky-vs {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}
.comparison-item.annual strong {
  color: var(--success);
}
@media (max-width: 640px) {
  .sticky-summary {
    gap: 10px;
    font-size: 0.8rem;
    padding: 8px 10px;
  }
  .sticky-item.ratio strong {
    font-size: 0.95rem;
  }
}
