/* ===== Variables ===== */
:root {
  --color-bg:           #F7F7F5;
  --color-surface:      #FFFFFF;
  --color-main:         #111111;
  --color-border:       #E8E8E6;
  --color-accent:       #10B981;
  --color-accent-light: #D1FAE5;
  --color-accent-dark:  #059669;
  --color-muted:        #6B7280;
  --color-warn:         #F59E0B;
  --color-warn-light:   #FEF3C7;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --header-h:    52px;
  --sticky-bar-h:64px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: "Noto Sans JP", sans-serif;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, rgba(0,0,0,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--color-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.header-logo {
  font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em;
  color: inherit; text-decoration: none;
}
a.header-logo:hover { opacity: 0.7; transition: opacity 0.15s; }
.header-badge {
  font-size: 0.7rem; color: var(--color-accent);
  border: 1px solid var(--color-accent); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 56px 24px 48px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700; line-height: 1.4; letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 0.9rem; color: var(--color-muted); margin-bottom: 20px;
}
.hero-checks {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  justify-content: center;
  margin-bottom: 28px;
}
.hero-checks li {
  font-size: 0.85rem; color: var(--color-muted);
  display: flex; align-items: center; gap: 6px;
}
.check-icon {
  color: var(--color-accent); font-weight: 700; font-size: 0.95rem;
}
.btn-primary {
  display: inline-block;
  background: var(--color-accent); color: #fff;
  font-size: 1rem; font-weight: 700;
  padding: 14px 36px; border-radius: 999px; border: none;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}
.btn-primary:hover  { background: var(--color-accent-dark); }
.btn-primary:active { transform: scale(0.98); }

/* ===== STEP バー ===== */
.steps-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  gap: 0;
}
.step-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 0 18px;
}
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-border); color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.step-item.active .step-num { background: var(--color-accent); color: #fff; }
.step-label { font-size: 0.7rem; color: var(--color-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--color-main); font-weight: 700; }
.step-arrow {
  color: var(--color-border); font-size: 1.1rem; flex-shrink: 0;
  padding-bottom: 18px; /* align with number */
}

/* ===== Main Layout ===== */
.main-container {
  max-width: 1100px; margin: 0 auto;
  padding: 28px 20px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start;
}

/* ===== Filter Bar ===== */
.filter-bar { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }

.search-wrap { position: relative; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: 0.45; pointer-events: none;
}
.search-input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  font-size: 0.88rem; font-family: inherit;
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
  color: var(--color-main);
}
.search-input::placeholder { color: var(--color-muted); }
.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

/* Category tabs */
.category-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  min-width: 0;
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: 0.78rem; color: var(--color-muted); white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn:hover { border-color: var(--color-main); color: var(--color-main); }
.tab-btn.active {
  background: var(--color-main); color: #fff; border-color: var(--color-main);
}
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--color-accent); color: #fff;
  border-radius: 999px; font-size: 0.62rem; font-weight: 700;
}
.tab-btn.active .tab-badge { background: #fff; color: var(--color-main); }

/* ===== Accordion ===== */
.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; background: none; border: none;
  text-align: left; cursor: pointer;
  transition: background 0.12s;
}
.accordion-header:hover { background: rgba(0,0,0,0.025); }

.acc-arrow {
  font-size: 0.7rem; color: var(--color-muted); flex-shrink: 0;
  transition: transform 0.2s ease;
  display: inline-block;
}
.accordion-header[aria-expanded="true"] .acc-arrow { transform: rotate(90deg); }

.acc-label { font-size: 0.9rem; font-weight: 700; flex: 1; }

.acc-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--color-muted);
}
.acc-count {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 999px; padding: 1px 8px;
  font-size: 0.72rem; font-variant-numeric: tabular-nums;
}
.acc-selected {
  background: var(--color-accent-light); color: var(--color-accent-dark);
  border-radius: 999px; padding: 1px 8px;
  font-size: 0.72rem; font-weight: 700;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.accordion-body.is-open {
  max-height: 2000px; /* longest category */
  border-top: 1px solid var(--color-border);
  padding: 8px;
}

/* ===== Service / Plan ===== */
.section-heading { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }

/* サービス単位のカード */
.service-group,
.service-single {
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  overflow: hidden;
}

/* バンドルサービス 含まれるサービス一覧 */
.service-includes {
  margin: 0;
  padding: 8px 12px 10px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
}
.service-includes-label {
  font-size: 0.68rem; font-weight: 700;
  color: var(--color-accent); letter-spacing: 0.04em;
  margin-bottom: 5px; text-transform: uppercase;
}
.service-includes-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.service-includes-list li {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 0.75rem; line-height: 1.4;
}
.inc-name {
  font-weight: 700; color: var(--color-text); white-space: nowrap;
}
.inc-note {
  color: var(--color-muted); font-size: 0.7rem;
}

.service-header {
  padding: 6px 10px 5px;
  background: rgba(0,0,0,0.025);
  border-bottom: 1px solid var(--color-border);
}
.service-link {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  color: var(--color-muted); font-weight: 700; font-size: 0.78rem;
  transition: color 0.12s; word-break: break-word; overflow-wrap: break-word;
}
.service-link:hover { color: var(--color-accent); }
.ext-icon { font-size: 0.7em; opacity: 0.65; }

.plan-list { display: flex; flex-direction: column; }

.plan-row {
  border-top: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  transition: background 0.18s, border-left-color 0.18s;
}
.plan-row:first-child { border-top: none; }
.plan-row.is-selected {
  background: var(--color-accent-light);
  border-left-color: var(--color-accent);
}

.sub-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 12px;
  cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.plan-row:not(.is-selected) .sub-item:hover {
  background: rgba(0,0,0,0.035);
}

.sub-checkbox {
  width: 20px; height: 20px; min-width: 20px;
  accent-color: var(--color-accent); cursor: pointer;
}
.sub-name { flex: 1; font-size: 0.88rem; line-height: 1.35; }
.sub-price {
  font-size: 0.78rem; color: var(--color-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
  text-align: right;
}
.price-hint { font-size: 0.68rem; opacity: 0.6; display: block; }

/* Billing toggle */
.billing-toggle {
  display: flex; gap: 6px; padding: 4px 12px 10px 42px;
}
.billing-toggle.is-hidden { display: none; }
.billing-btn {
  flex: 1; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.76rem; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-muted);
  transition: all 0.15s; white-space: nowrap;
}
.billing-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.billing-btn.active {
  background: var(--color-accent); color: #fff;
  border-color: var(--color-accent); font-weight: 700;
}

.empty-msg { font-size: 0.83rem; color: var(--color-muted); padding: 8px 0; }

/* ===== Results Panel ===== */
.results-panel { position: sticky; top: calc(var(--header-h) + 14px); }
.results-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-md);
}
.results-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.results-card-title {
  font-size: 0.7rem; font-weight: 700; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.btn-reset {
  font-size: 0.72rem; color: var(--color-muted); background: none;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 4px 10px; transition: all 0.12s;
}
.btn-reset:hover { border-color: var(--color-main); color: var(--color-main); }

/* 金額（インパクト強め） */
.monthly-total {
  font-size: 2.2rem; font-weight: 700; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.yearly-total {
  font-size: 1.05rem; font-weight: 700; color: var(--color-accent);
  margin-top: 6px; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.selected-count { font-size: 0.72rem; color: var(--color-muted); margin-bottom: 14px; }

.divider { border: none; border-top: 1px solid var(--color-border); margin: 12px 0; }
.breakdown-label {
  font-size: 0.68rem; font-weight: 700; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px;
}
.breakdown-row {
  display: flex; justify-content: space-between;
  font-size: 0.83rem; padding: 4px 0;
}
.breakdown-amount { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Action buttons */
.result-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.btn-action {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 700; width: 100%;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-muted); transition: all 0.12s;
}
.btn-action:hover:not(:disabled) { border-color: var(--color-main); color: var(--color-main); }
.btn-action:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-action.btn-report {
  background: var(--color-main); color: #fff; border-color: var(--color-main);
  text-decoration: none;
}
.btn-action.btn-report:hover { opacity: 0.85; }
#report-link { display: flex; }
.btn-action.btn-report[aria-disabled="true"] {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
  background: var(--color-muted); border-color: var(--color-muted);
}
.report-hint {
  font-size: 0.78rem; color: var(--color-muted); text-align: center;
  margin-top: -2px; display: none;
}
.report-hint.is-visible { display: block; }
.load-error {
  font-size: 0.85rem; color: var(--color-muted);
  padding: 32px 0; text-align: center; line-height: 1.8;
}
.empty-report { text-align: center; padding: 60px 20px; }
.empty-report-msg {
  color: var(--color-muted); margin-bottom: 24px;
  line-height: 1.9; font-size: 0.9rem;
}
.btn-select-services {
  display: inline-block; padding: 10px 28px;
  background: var(--color-main); color: #fff;
  border-radius: var(--radius-sm); text-decoration: none;
  font-weight: 700; font-size: 0.9rem;
}

/* ===== Main recommendations ===== */
.recommendations-section {
  max-width: 1100px; margin: 0 auto; padding: 0 20px 48px;
}
.recs-section-heading {
  font-size: 1rem; font-weight: 700; margin-bottom: 14px;
  color: var(--color-warn);
}
.recommend-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-warn);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 14px;
}
.recommend-card-body { flex: 1; }
.recommend-card h3, .recommend-card h4 {
  font-size: 0.87rem; font-weight: 700; margin-bottom: 4px; line-height: 1.4;
}
.recommend-card p { font-size: 0.8rem; color: var(--color-muted); line-height: 1.6; }
.btn-compare {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.76rem; font-weight: 700;
  border: 1px solid var(--color-warn); color: var(--color-warn);
  background: var(--color-warn-light);
  white-space: nowrap; transition: all 0.12s;
}
.btn-compare:hover { background: var(--color-warn); color: #fff; }

/* ===== Sticky Mobile Bar ===== */
.sticky-bar {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--color-main); color: #fff;
  height: var(--sticky-bar-h);
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-direction: row; align-items: center; justify-content: space-between;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.18);
}
.sticky-bar-left { display: flex; flex-direction: column; gap: 1px; }
.sticky-bar-label  { font-size: 0.65rem; opacity: 0.55; letter-spacing: 0.04em; }
.sticky-bar-amount { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sticky-expand-btn {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm); padding: 8px 14px;
  color: #fff; font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  transition: background 0.12s;
}
.sticky-expand-btn:hover { background: rgba(255,255,255,0.2); }
#expand-icon { font-size: 0.9rem; }

/* Mobile sheet */
.mobile-sheet {
  display: none; position: fixed;
  left: 0; right: 0; bottom: var(--sticky-bar-h);
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.14);
  z-index: 190;
  max-height: 68vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}
.mobile-sheet.is-open { transform: translateY(0); }
.mobile-sheet-inner { padding: 0 20px 28px; position: relative; }
.sheet-handle {
  width: 36px; height: 4px; background: var(--color-border);
  border-radius: 2px; margin: 12px auto 0;
}
.sheet-close-btn {
  position: absolute; top: 10px; right: 0;
  background: none; border: none; padding: 6px;
  font-size: 1rem; color: var(--color-muted); cursor: pointer; line-height: 1;
}
.sheet-close-btn:hover { color: var(--color-text); }
.sheet-monthly { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: 20px; }
.sheet-yearly  { font-size: 1rem; font-weight: 700; color: var(--color-accent); margin-top: 4px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.sheet-report-link {
  display: flex; align-items: center; justify-content: center;
  margin-top: 14px; padding: 11px;
  background: var(--color-main); color: #fff;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 700;
  text-decoration: none; transition: opacity 0.12s;
}
.sheet-report-link:hover { opacity: 0.85; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 32px 24px 40px;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start;
}
.footer-brand { }
.footer-logo  { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.footer-desc  { font-size: 0.75rem; color: var(--color-muted); line-height: 1.6; margin: 4px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-links a {
  font-size: 0.75rem; color: var(--color-muted); transition: color 0.12s;
}
.footer-links a:hover { color: var(--color-main); }
.footer-operator  { font-size: 0.75rem; color: var(--color-muted); opacity: 0.7; }
.footer-no-contact { font-size: 0.72rem; color: var(--color-muted); opacity: 0.6; }
.footer-copy {
  max-width: 900px; margin: 20px auto 0;
  font-size: 0.7rem; color: var(--color-muted); opacity: 0.7;
}
.disclaimer {
  max-width: 900px; margin: 16px auto 0;
  font-size: 0.72rem; color: var(--color-muted); line-height: 1.6;
}
.data-updated-date {
  font-size: 0.7rem; color: var(--color-muted); opacity: 0.75;
}
.data-updated-date:not(:empty)::before { content: '（'; }
.data-updated-date:not(:empty)::after  { content: '）'; }

/* ===== Policy pages ===== */
.policy-container {
  max-width: 740px; margin: 0 auto; padding: 40px 24px 80px;
}
.policy-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 32px; letter-spacing: -0.02em; }
.policy-section { margin-bottom: 28px; }
.policy-section h2 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; margin-top: 0; }
.policy-section h3 { font-size: 0.88rem; font-weight: 700; margin: 14px 0 6px; }
.policy-section p, .policy-section li { font-size: 0.88rem; color: var(--color-muted); line-height: 1.8; }
.policy-section ul { padding-left: 1.2em; margin: 6px 0; }
.policy-section a { color: var(--color-main); }
.policy-updated { font-size: 0.75rem; color: var(--color-muted); margin-bottom: 28px; }

/* ===== Report Page ===== */
.report-header {
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  padding: 16px 24px; display: flex; align-items: center; gap: 14px;
}
.btn-back {
  font-size: 0.8rem; color: var(--color-muted); background: none;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 6px 12px; transition: all 0.12s; flex-shrink: 0;
}
.btn-back:hover { border-color: var(--color-main); color: var(--color-main); }
.report-title { font-size: 1rem; font-weight: 700; flex: 1; }
.report-date  { font-size: 0.75rem; color: var(--color-muted); }
.report-container { max-width: 820px; margin: 0 auto; padding: 28px 20px 80px; }
.report-summary {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 28px;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 16px;
  box-shadow: var(--shadow);
}
.summary-item { text-align: center; }
.summary-label { font-size: 0.68rem; color: var(--color-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.summary-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.summary-value.accent { color: var(--color-accent); }
.report-section { margin-bottom: 28px; }
.report-section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.rpt-breakdown { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 18px; }
.rpt-table { background: var(--color-surface); font-size: 0.83rem; }
.rpt-table thead { background: var(--color-bg); }
.rpt-table th, .rpt-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--color-border); }
.rpt-table th { font-weight: 700; font-size: 0.75rem; color: var(--color-muted); }
.rpt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-table tbody tr:hover { background: var(--color-bg); }
.subtotal-row td { font-weight: 700; background: var(--color-bg); font-size: 0.8rem; }
.rpt-table tbody tr:last-child td { border-bottom: none; }
.rpt-total-row {
  display: flex; align-items: center; gap: 16px; justify-content: flex-end;
  padding: 14px 0; border-top: 2px solid var(--color-main); font-weight: 700;
}
.rpt-total-monthly { font-size: 1rem; }
.rpt-total-yearly  { font-size: 1.4rem; color: var(--color-accent); letter-spacing: -0.02em; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.btn-rpt {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 700;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-muted); transition: all 0.12s;
}
.btn-rpt:hover { border-color: var(--color-main); color: var(--color-main); }
.btn-rpt.btn-print { background: var(--color-main); color: #fff; border-color: var(--color-main); }
.btn-rpt.btn-print:hover { opacity: 0.85; }

/* ===== Focus ===== */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ===== rpt-table wrap ===== */
.rpt-table-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden;
  width: 100%; max-width: 100%;
}
.rpt-table { width: 100%; }

/* ===== Guide section (記事SEO用) ===== */
.guide-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 48px 20px;
  text-align: center;
}
.guide-inner { max-width: 600px; margin: 0 auto; }
.guide-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 8px;
  color: var(--color-main);
}
.guide-desc { font-size: 0.85rem; color: var(--color-muted); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* レイアウト */
  .main-container {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 0 calc(var(--sticky-bar-h) + 32px);
    gap: 0;
  }
  #selector-section {
    order: 1;
    padding: 0 14px;
  }
  .results-panel { order: 2; position: static; }
  .sticky-bar    { display: flex; }
  .mobile-sheet  { display: block; }

  /* Hero */
  .hero { padding: 36px 16px 28px; }
  .hero h1 { font-size: 1.3rem; }
  .hero-sub { font-size: 0.82rem; }
  .hero-checks { gap: 8px 14px; }
  .btn-primary { font-size: 0.95rem; padding: 13px 32px; }

  /* STEP バー */
  .steps-bar { padding: 10px 8px; }
  .step-item { padding: 0 8px; }
  .step-label { font-size: 0.6rem; }

  /* フィルターバー: スクロール中も見えるようスティッキー */
  .filter-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    background: var(--color-bg);
    margin: 0 -14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
  }

  /* セクション見出し */
  .section-heading { font-size: 0.95rem; margin-top: 16px; }

  /* 見直しカード: 縦積み */
  .recommend-card { flex-direction: column; gap: 10px; align-items: flex-start; }
  .btn-compare { width: 100%; justify-content: center; }
  .recommendations-section { padding: 0 0 80px; }

  /* 結果パネル */
  .results-card {
    border-radius: 0;
    border-left: none; border-right: none;
    margin: 0 0 0;
  }

  /* レポートページ */
  .report-summary { grid-template-columns: 1fr; gap: 12px; }
  .report-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .report-date { width: 100%; }
  .rpt-total-row { flex-direction: column; align-items: flex-end; gap: 4px; }
  .report-actions { flex-direction: column; }
  .report-container { padding: 20px 14px 80px; }

  /* フッター */
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .footer-links {
    text-align: left; flex-direction: row;
    flex-wrap: wrap; gap: 6px 14px;
  }
  .site-footer { padding: 24px 16px 32px; }
}

@media (max-width: 480px) {
  .step-arrow { display: none; }
  .steps-bar { justify-content: space-around; }
  .hero h1 { font-size: 1.15rem; }

  /* 小画面: 文字サイズ調整 */
  .monthly-total { font-size: 1.9rem; }
  .sub-name { font-size: 0.84rem; }
  .billing-toggle { padding-left: 34px; }
  .summary-value { font-size: 1.25rem; }

  /* レポートテーブル: ブロック表示に変換して横幅超過を根本解決 */
  .rpt-table, .rpt-table tbody, .rpt-table tr { display: block; }
  .rpt-table thead { display: none; }
  .rpt-table tr { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
  .rpt-table th, .rpt-table td { display: none; border-bottom: none; padding: 0; }
  /* サービス名（th[scope=row] または 小計行の td:first-child） */
  .rpt-table th:first-child, .rpt-table td:first-child {
    display: block; font-size: 0.84rem; font-weight: 700; margin-bottom: 2px;
  }
  /* プラン名 */
  .rpt-table td:nth-child(2) { display: block; font-size: 0.73rem; color: var(--color-muted); }
  /* 年間実支払 */
  .rpt-table td:nth-child(5) {
    display: block; font-size: 0.82rem; font-weight: 700;
    font-variant-numeric: tabular-nums; margin-top: 2px;
  }
  /* 小計行 */
  .subtotal-row { background: var(--color-bg); }
  .subtotal-row td:first-child { font-size: 0.78rem; color: var(--color-muted); }
  .subtotal-row td:nth-child(2) { display: none; }
}

/* ===== Print ===== */
@media print {
  .site-header, .sticky-bar, .mobile-sheet, .report-actions,
  .btn-back, .btn-rpt, .filter-bar, .result-actions { display: none !important; }
  body { background: white; background-image: none; }
  .report-container { padding: 0; }
  .rpt-table { break-inside: avoid; }
  .results-panel { position: static; }
}
