:root {
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dce7e4;
  --text: #15242c;
  --text-muted: #556a75;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sp-only { display: none; }

.site-header {
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff; display: grid; place-items: center; font-size: 15px;
}
.header-nav { display: flex; gap: 16px; }
.header-nav a { text-decoration: none; color: var(--text-muted); font-size: 13.5px; font-weight: 700; }
.header-nav a:hover { color: var(--primary); }

.hero {
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 55%, #0284c7 100%);
  color: #ffffff;
  padding: 38px 0 42px;
  text-align: center;
}
.hero-pill {
  display: inline-block; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35);
  padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; margin-bottom: 12px;
}
.hero h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.3; font-weight: 900; }
.hero-sub { max-width: 680px; margin: 0 auto; font-size: 14.5px; opacity: 0.95; }

.main-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
  padding: 20px 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.card h3 { margin: 0; font-size: 15px; font-weight: 800; }

.btn-text { background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-text:hover { color: var(--danger); }

.form-block { margin-bottom: 16px; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.field-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.value-badge { background: #ccfbf1; color: #115e59; padding: 2px 11px; border-radius: 999px; font-size: 15px; }

.range-input { width: 100%; accent-color: var(--primary); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }

.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick-btn {
  border: 1.5px solid var(--border); background: var(--surface-soft); color: var(--text);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0fdfa; }

.radio-group { display: grid; grid-template-columns: 1fr; gap: 8px; }
.radio-card {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; background: var(--surface-soft);
}
.radio-card input { accent-color: var(--primary); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.number-input {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; font-family: inherit; background: var(--surface-soft); color: var(--text);
}
.number-input:focus { outline: none; border-color: var(--primary); background: #fff; }

.toggle-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.toggle-check input { accent-color: var(--primary); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.safety-card {
  background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px; padding: 11px; text-align: center;
}
.safety-label { display: block; font-size: 11.5px; font-weight: 700; color: #115e59; }
.safety-val { display: block; font-size: 20px; font-weight: 900; color: #0f766e; margin: 3px 0; }
.safety-sub { display: block; font-size: 11px; color: var(--text-muted); }

.result-column { position: sticky; top: 72px; }
.result-head { text-align: center; margin-bottom: 14px; }
.zone-badge {
  display: inline-block; font-size: 12.5px; font-weight: 800; padding: 4px 14px;
  border-radius: 999px; margin-bottom: 8px;
}
.zone-badge.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }
.zone-badge.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.zone-badge.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

.zone-title { margin: 0 0 6px; font-size: 18px !important; line-height: 1.4; }
.zone-advice { margin: 0; font-size: 13px; color: var(--text-muted); }

.summary-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.num-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.num-box.highlight { background: #ecfdf5; border-color: #a7f3d0; }
.num-label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }
.num-val { font-size: 17px; font-weight: 900; }
.num-val.deduct { color: var(--danger); }
.num-val.net { color: var(--primary); }

.recovery-box {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; color: #92400e; margin-bottom: 12px;
}

.wall-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.wall-item {
  border-radius: 9px; padding: 9px 11px; font-size: 12.5px;
  border: 1px solid var(--border); background: var(--surface-soft);
}
.wall-item.is-hit { background: #fef2f2; border-color: #fecaca; }
.wall-item.is-clear { background: #f0fdf4; border-color: #bbf7d0; }
.wall-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 2px; }
.wall-desc { margin: 0; font-size: 11.8px; color: var(--text-muted); }

.aff-eyebrow { font-size: 11.5px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.aff-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.aff-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px;
}
.aff-item strong { display: block; font-size: 13.5px; }
.aff-item p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 9px; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--border); font-family: inherit; white-space: nowrap;
}
.btn-secondary { background: #fff; color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.aff-link-wrap { flex-shrink: 0; display: inline-flex; align-items: center; }
.aff-link-wrap a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 13px; border-radius: 9px; background: var(--primary); color: #fff;
  text-decoration: none; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.aff-link-wrap a:hover { background: var(--primary-dark); }
.aff-link-wrap img { width: 1px; height: 1px; border: 0; }

.info-section { padding-bottom: 10px; }
.table-scroll { overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; margin-top: 10px; }
.guide-table th, .guide-table td { border: 1px solid var(--border); padding: 9px 10px; text-align: left; }
.guide-table th { background: #f0fdfa; color: #115e59; font-weight: 800; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.social { background: var(--danger-bg); color: var(--danger); }
.pill.tax { background: #e0f2fe; color: #0369a1; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--surface-soft); }
.faq-item summary { font-weight: 800; font-size: 14px; cursor: pointer; }
.faq-item p { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }

.site-footer { margin-top: 18px; background: #0f172a; color: #cbd5e1; padding: 24px 0; font-size: 12px; }
.disclaimer { margin: 0 0 10px; }
.copyright { margin: 0; text-align: center; color: #64748b; }

.toast {
  position: fixed; bottom: 20px; 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, transform 0.2s; z-index: 60;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .sp-only { display: inline; }
  .hero h1 { font-size: 22px; }
  .header-nav { gap: 10px; }
  .header-nav a { font-size: 12px; }
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .result-column { position: static; }
  .two-col, .safety-grid, .summary-numbers { grid-template-columns: 1fr; }
  .aff-item { flex-direction: column; align-items: flex-start; }
}
