:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dfe5f0;
  --text: #162032;
  --text-muted: #5a677d;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --teal: #0f766e;
  --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.65;
  font-size: 15px;
  overflow-x: hidden;
}

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

.sp-only {
  display: none;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  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: 16px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.header-nav {
  display: flex;
  gap: 18px;
}

.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 */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0d9488 100%);
  color: #ffffff;
  padding: 44px 0 48px;
  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: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.3;
  font-weight: 900;
}

.hero-sub {
  max-width: 680px;
  margin: 0 auto 22px;
  font-size: 15px;
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  font-family: inherit;
  transition: transform 0.08s, background-color 0.15s, opacity 0.15s;
}

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

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn-primary {
  background: #ffffff;
  color: #1e3a8a;
}

.card .btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.card .btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border);
}

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

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

.btn-text:hover {
  color: var(--danger);
}

.btn-chip {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-chip:hover {
  background: #dbeafe;
}

/* Ad Slot */
.ad-slot {
  margin: 18px 0 6px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  min-height: 64px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
  align-items: start;
  padding-top: 14px;
  padding-bottom: 24px;
}

.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: 14px;
}

.card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

/* Form Elements */
.form-block {
  margin-bottom: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.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;
}

.value-badge {
  background: #eff6ff;
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
}

.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);
  margin-top: 2px;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.select-input,
.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);
}

.select-input:focus,
.number-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 7px;
  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);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.item-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.item-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.yen-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.yen-input {
  width: 112px;
  text-align: right;
  font-weight: 700;
  background: #ffffff;
}

.sub-check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.sub-check input {
  margin-top: 3px;
  accent-color: var(--primary);
}

/* Result Column */
.result-column {
  position: sticky;
  top: 74px;
}

.result-head {
  text-align: center;
  margin-bottom: 16px;
}

.verdict-badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.verdict-badge.neutral { background: #e2e8f0; color: #334155; }
.verdict-badge.high { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.verdict-badge.mid { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.verdict-badge.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }

.verdict-title {
  margin: 0;
  font-size: 18px !important;
  line-height: 1.4;
}

.summary-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.num-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.num-box.highlight {
  background: #fef2f2;
  border-color: #fecaca;
}

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

.num-val {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}

.num-val.fair { color: var(--teal); }
.num-val.savings { color: var(--danger); }

.deposit-bar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 14px;
}

.bar-wrap {
  margin-bottom: 14px;
}

.bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
}

.bar-fair {
  background: #0d9488;
  transition: width 0.25s ease;
}

.bar-over {
  background: #ef4444;
  transition: width 0.25s ease;
}

.breakdown-wrap h3 {
  margin-bottom: 8px;
}

.breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-item {
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.breakdown-item.is-over {
  background: #fef2f2;
  border-color: #fecaca;
}

.breakdown-item.is-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.bd-head {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 3px;
}

.bd-reason {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* Mail Card */
.mail-textarea {
  width: 100%;
  min-height: 215px;
  margin-top: 8px;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

/* Affiliate Card */
.affiliate-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.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: 12px;
}

.aff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  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);
}

.aff-item .btn,
.aff-link-wrap {
  flex-shrink: 0;
}

.aff-link-wrap {
  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: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.aff-link-wrap a:hover {
  background: var(--primary-dark);
}

.aff-link-wrap img {
  width: 1px;
  height: 1px;
  border: 0;
}

.aff-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

/* Info Sections */
.info-section {
  padding-bottom: 10px;
}

.section-lead {
  margin: 8px 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.table-scroll {
  overflow-x: auto;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 600px;
}

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

.guide-table th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 800;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill.landlord { background: var(--ok-bg); color: var(--ok); }
.pill.tenant { background: var(--danger-bg); color: var(--danger); }
.pill.depends { background: var(--warn-bg); color: var(--warn); }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
}

.faq-item summary {
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.faq-item p {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: 20px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 28px 0 32px;
  font-size: 12.5px;
}

.disclaimer {
  line-height: 1.7;
  margin-bottom: 14px;
}

.copyright {
  margin: 0;
  color: #64748b;
  text-align: center;
}

.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;
}

/* Mobile Responsive */
@media (max-width: 860px) {
  .sp-only { display: inline; }
  .container { padding: 0 14px; }
  .header-nav { gap: 10px; }
  .header-nav a { font-size: 12px; }
  .logo-text { font-size: 14px; }
  .hero { padding: 30px 0 34px; }
  .hero h1 { font-size: 22px; }
  .hero-sub { font-size: 13.5px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .card { padding: 15px; }
  .card-header { flex-wrap: wrap; }
  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .result-column {
    position: static;
  }
  .two-col,
  .radio-group {
    grid-template-columns: 1fr;
  }
  .item-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .yen-wrap {
    width: 100%;
  }
  .yen-input {
    width: 100%;
  }
  .summary-numbers {
    grid-template-columns: 1fr;
  }
  .aff-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
