:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --ai-primary: #7c3aed;
  --ai-dark: #6d28d9;
  --success: #059669;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* PR Topbar (ステマ規制対応) */
.pr-topbar {
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.pr-badge {
  background: #f59e0b;
  color: #111827;
  font-weight: 800;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Header & Mode Tabs */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.header-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.main-content {
  padding-top: 18px;
  padding-bottom: 36px;
}

/* Hero Cards */
.hero-card {
  border-radius: var(--radius);
  padding: 22px 20px;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero-vpn {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0284c7 100%);
}

.hero-ai {
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #2563eb 100%);
}

.hero-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-heading {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 800;
}

.hero-desc {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.92);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
}

/* Quiz UI */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#vpn-step-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

.quiz-step {
  display: none;
}

.quiz-step.is-visible {
  display: block;
}

.quiz-question {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.option-item:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
}

.option-item input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--primary);
  transform: scale(1.15);
}

.option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-body strong {
  font-size: 14px;
}

.option-body small {
  font-size: 12px;
  color: var(--text-muted);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  flex: 1;
}

.btn-accent {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  flex: 1;
}

.btn-ai {
  background: linear-gradient(135deg, var(--ai-primary), var(--primary));
  color: #fff;
  width: 100%;
}

.btn-ghost {
  background: var(--bg);
  color: var(--text-muted);
}

.btn-cta-large {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  background: linear-gradient(135deg, #ea580c, #f59e0b);
  color: #fff;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.25);
}

.btn-link {
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* Result Cards */
.result-container {
  margin-bottom: 16px;
}

.result-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  color: #065f46;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 12px;
}

.winner-card {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.runner-up-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.offer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.offer-name {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.offer-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.offer-badge.rank-1 {
  background: #fef3c7;
  color: #92400e;
}

.match-reason {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
}

.feature-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13.5px;
}

.feature-list li {
  margin-bottom: 4px;
}

.offer-price-note {
  font-size: 12px;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 12px;
}

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  overflow: hidden;
}

.accordion-trigger {
  list-style: none;
  padding: 14px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.accordion-trigger::-webkit-details-marker {
  display: none;
}

.accordion-item[open] .chevron {
  transform: rotate(45deg);
}

.chevron {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.accordion-body {
  padding: 0 14px 14px;
  font-size: 13.5px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.step-list,
.bullet-list {
  padding-left: 20px;
  margin: 12px 0;
}

.step-list li,
.bullet-list li {
  margin-bottom: 8px;
}

code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 700;
}

.note-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  margin: 10px 0 0;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.compare-table th {
  background: var(--bg);
}

.mini-cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini-cta-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  color: var(--primary);
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

/* AI Panel */
.ai-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.ai-goal-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s ease;
}

.ai-goal-btn.is-selected {
  border-color: var(--ai-primary);
  background: #f5f3ff;
}

.ai-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.ai-result-box {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

/* Prompt Library */
.library-sub {
  margin: -8px 0 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.prompt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--ai-primary);
  color: #fff;
  border-color: var(--ai-primary);
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-alt);
}

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

.prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.prompt-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ai-primary);
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.prompt-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.btn-copy {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  border-color: var(--ai-primary);
}

.prompt-code {
  margin: 0;
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0 36px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-policy-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
}

.footer-policy-box p {
  margin: 0 0 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 600px) {
  .ai-selector-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-heading {
    font-size: 24px;
  }
}
