/* ===== Theme tokens override ===== */
:root{
  --brand: #2F5D8A;
  --brand-ink: #173A5E;
  --accent-yellow: #FFC94A;
  --accent-gold: #E8A73B;
  --bg-off: #FAF7EF;
  --text-main: #1D2A33;
  --text-sub: #556270;
  --card-radius: 18px;
}

[hidden]{ display:none !important; }

*{ box-sizing: border-box; }

body{
  background: var(--bg-off);
  color: var(--text-main);
  font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden{
  position:absolute; width:1px;height:1px; overflow:hidden; clip:rect(0,0,0,0);
}

/* ===== Header ===== */
.site-header{
  background: #fff;
  border-bottom: 1px solid #e9e3d3;
  padding: 14px 0;
  position: sticky;
  top:0;
  z-index: 50;
}
.site-header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.logo{
  font-weight: 800;
  font-size: 18px;
  color: var(--brand-ink);
}
.badge-tiny{
  font-size: 12px;
  background: var(--accent-yellow);
  color: #6B4A00;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

/* ===== Hero ===== */
.hero{
  position: relative;
  overflow: hidden;
  padding: 48px 0 40px;
}
.hero-bg{
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,201,74,.35), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(47,93,138,.25), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(232,167,59,.2), transparent 55%),
    linear-gradient(135deg, #FDFBF3 0%, #F3EEDD 60%, #EAF2FA 100%);
  z-index: 0;
}
.hero-inner{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero-copy h1{
  font-size: 26px;
  line-height: 1.4;
  color: var(--brand-ink);
  font-weight: 900;
  margin: 0 0 14px;
}
.hero-lead{
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.8;
  margin: 0 0 16px;
}
.badge-chips{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom: 4px;
}
.chip{
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.hero-illust{
  display:flex;
  justify-content:center;
}
.hero-illust svg{
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 12px 20px rgba(23,58,94,.18));
}

/* ===== Tool section ===== */
.tool-section{
  padding: 8px 0 40px;
}
.tool-grid{
  display:flex;
  flex-direction: column;
  gap: 24px;
}

.wizard{
  background: #fff;
  border-radius: var(--card-radius);
  padding: 22px;
  box-shadow: 0 6px 24px rgba(23,58,94,.08);
  border: 1px solid #EDE7D6;
}
.step{ margin-bottom: 22px; }
.step-label{
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-ink);
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom: 10px;
}
.step-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 24px; height:24px;
  background: var(--brand);
  color:#fff;
  border-radius: 50%;
  font-size: 13px;
}

.input-yen{
  display:flex;
  align-items:center;
  background: #F6F3E9;
  border: 2px solid #E3DCC5;
  border-radius: 14px;
  padding: 4px 14px;
  transition: border-color .15s;
}
.input-yen:focus-within{ border-color: var(--brand); }
.input-yen input{
  flex:1;
  border:none;
  background:transparent;
  font-size: 20px;
  font-weight: 800;
  padding: 12px 4px;
  color: var(--brand-ink);
  min-height: 44px;
}
.input-yen input:focus{ outline:none; }
.yen-suffix{
  font-weight:700;
  color: var(--text-sub);
}
.input-note{
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 6px;
}
.input-note--tight{ margin-top: 6px; }

.segment{
  display:grid;
  grid-template-columns: repeat(2,1fr);
  gap: 8px;
}
.seg-btn{
  min-height: 46px;
  border-radius: 12px;
  border: 2px solid #E3DCC5;
  background: #fff;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-sub);
  cursor:pointer;
  transition: all .15s;
}
.seg-btn.is-active{
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.custom-days{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap: 8px;
  background: #F6F3E9;
  border: 2px solid #E3DCC5;
  border-radius: 14px;
  padding: 4px 14px;
}
.custom-days input{
  flex:1;
  border:none;
  background:transparent;
  font-size: 16px;
  padding: 10px 4px;
  min-height: 44px;
}
.custom-days input:focus{ outline:none; }

.select-wrap select{
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 2px solid #E3DCC5;
  background: #fff;
  font-size: 16px;
  padding: 8px 12px;
  color: var(--text-main);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(1.1em), calc(100% - 14px) calc(1.1em);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.check-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 12px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--text-sub);
  cursor:pointer;
}
.check-row input{
  width: 24px; height:24px;
  accent-color: var(--brand);
  flex-shrink:0;
}

.calc-btn{
  width:100%;
  min-height: 52px;
  background: linear-gradient(120deg, var(--brand), var(--brand-ink));
  color:#fff;
  font-size: 16px;
  font-weight: 800;
  border:none;
  border-radius: 14px;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(23,58,94,.25);
  transition: transform .1s;
}
.calc-btn:active{ transform: scale(.98); }
.disclaimer-mini{
  font-size: 11.5px;
  color: var(--text-sub);
  text-align:center;
  margin-top: 10px;
}

/* ===== Result Zone ===== */
.result-col{ min-height: 60px; }
.placeholder-zone{
  background: #fff;
  border: 2px dashed #E3DCC5;
  border-radius: var(--card-radius);
  padding: 30px 20px;
  text-align:center;
  color: var(--text-sub);
  font-size: 14px;
}

.result-zone{ display:flex; flex-direction:column; gap: 20px; }

.cred-badge{
  font-size: 12px;
  color: var(--brand-ink);
  background: #EAF2FA;
  border: 1px solid #CADCEC;
  border-radius: 999px;
  padding: 6px 14px;
  display:inline-block;
  width: fit-content;
  font-weight: 700;
}

.card-pair{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.card{
  border-radius: 20px;
  padding: 24px 22px;
  position: relative;
  overflow:hidden;
}
.card-monthly{
  background: linear-gradient(145deg, var(--brand-ink), #0F2A45);
  color:#fff;
  box-shadow: 0 10px 30px rgba(23,58,94,.35), inset 0 1px 0 rgba(255,255,255,.08);
}
.card-total{
  background: #fff;
  border: 3px solid var(--accent-yellow);
  box-shadow: 0 10px 24px rgba(232,167,59,.18);
  color: var(--brand-ink);
}
.card-label{
  font-size: 13px;
  font-weight: 700;
  opacity: .85;
  margin: 0 0 8px;
}
.card-value{
  font-family: 'Hiragino Mincho ProN', serif;
  font-weight: 900;
  font-size: 32px;
  margin: 0 0 6px;
  display:flex;
  align-items:baseline;
  gap: 6px;
  line-height: 1.2;
}
.card-monthly .card-value{
  background: linear-gradient(90deg, #FFF, #BFD9F0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card-total .card-value{
  background: linear-gradient(90deg, var(--brand-ink), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card-unit{
  font-size: 14px;
  font-weight: 700;
  opacity: .8;
}
.card-sub{
  font-size: 12.5px;
  font-weight: 700;
  opacity: .8;
}
.card-note{
  font-size: 11.5px;
  color: #FFD873;
  margin-top: 8px;
  font-weight: 700;
}
.monthly-second{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: 14px;
  font-weight: 800;
  color: #FFEBB0;
}
.ms-tag{
  display:inline-block;
  background: rgba(255,201,74,.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  margin-right: 6px;
  font-weight: 700;
}
.bonus-badge{
  margin-top: 12px;
  display:inline-block;
  background: linear-gradient(120deg, #FFD873, var(--accent-gold));
  color: #6B4A00;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  animation: pop .3s ease-out;
}
@keyframes pop{
  from{ transform: scale(.7); opacity:0; }
  to{ transform: scale(1); opacity:1; }
}

/* ===== Timeline ===== */
.timeline-section{
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 6px 20px rgba(23,58,94,.06);
}
.timeline-section h3{
  font-size: 15px;
  color: var(--brand-ink);
  margin: 0 0 12px;
}
.timeline-wrap{
  position: relative;
  border-radius: 14px;
  overflow:hidden;
  background: #fff;
}
.timeline-bg{
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 10% 20%, rgba(47,93,138,.08), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255,201,74,.12), transparent 45%);
  opacity: .8;
}
#timelineChart{
  position: relative;
  width: 100%;
  height: 180px;
  display:block;
}
.timeline-caption{
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
  text-align:center;
}

/* ===== Accordion ===== */
.accordion{
  background:#fff;
  border-radius: 14px;
  border: 1px solid #EDE7D6;
  padding: 4px 18px;
}
.accordion summary{
  cursor:pointer;
  font-weight: 700;
  font-size: 14.5px;
  padding: 14px 0;
  color: var(--brand-ink);
  list-style: none;
}
.accordion summary::-webkit-details-marker{ display:none; }
.accordion summary::after{
  content: '+';
  float:right;
  font-size: 18px;
}
.accordion[open] summary::after{ content: '−'; }
.accordion-body{
  padding: 0 0 16px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}
.accordion-body table{
  width:100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 8px;
}
.accordion-body td{
  padding: 6px 4px;
  border-bottom: 1px solid #F0EBDD;
}

/* ===== Take home ===== */
.takehome-box{
  background: #EAF2FA;
  border-radius: 16px;
  padding: 20px;
}
.takehome-compare{
  display:flex;
  align-items:center;
  gap: 12px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.th-col{ flex: 1; min-width: 130px; }
.th-label{
  font-size: 12px;
  color: var(--text-sub);
  margin: 0 0 4px;
  font-weight: 700;
}
.th-value{
  font-size: 20px;
  font-weight: 900;
  margin: 0;
}
.th-value--sub{ color: var(--text-sub); }
.th-value--main{
  background: linear-gradient(90deg, var(--brand-ink), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.th-arrow{
  font-size: 20px;
  color: var(--brand);
  font-weight: 700;
}
.th-ratio{
  font-size: 14px;
  color: var(--brand-ink);
  margin: 4px 0 10px;
}

/* ===== Promo / Ad ===== */
.promo-card{
  background: #FFF7E6;
  border: 1px solid #F4E1AE;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14px;
  position: relative;
  margin: 20px 0;
}
.promo-card a{
  color: var(--brand-ink);
  font-weight: 700;
}
.pr-tag{
  display:inline-block;
  background: var(--brand-ink);
  color:#fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.promo-card--wide{ margin: 24px 0; }
.ad-slot{
  background: #F1EFE6;
  border: 1px dashed #CFC8B0;
  border-radius: 12px;
  text-align:center;
  padding: 30px 10px;
  color: #A39F8F;
  font-size: 13px;
  margin: 24px 0;
}

/* ===== Article section ===== */
.article-section{
  padding: 20px 0 60px;
}
.article-section h2{
  font-size: 19px;
  color: var(--brand-ink);
  margin: 40px 0 14px;
}
.article-section p{
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text-main);
}
.article-section a{ color: var(--brand); font-weight: 700; }
.faq-list{ display:flex; flex-direction:column; gap: 10px; }
.disclaimer-full{
  background: #F6F3E9;
  padding: 16px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-sub);
}

/* ===== Footer ===== */
.site-footer{
  background: var(--brand-ink);
  color: #cfe0ef;
  padding: 26px 0;
  font-size: 13px;
}
.site-footer .wrap{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:center;
  text-align:center;
}
.site-footer nav{ display:flex; gap: 16px; }
.site-footer a{ color: #cfe0ef; }

/* ===== Desktop layout ===== */
@media (min-width: 900px){
  .hero-inner{
    flex-direction: row;
    align-items:center;
    padding: 30px 0;
  }
  .hero-copy{ flex: 0 0 52%; }
  .hero-copy h1{ font-size: 34px; }
  .hero-illust{ flex:1; }

  .tool-grid{
    flex-direction: row;
    align-items: flex-start;
  }
  .wizard{
    flex: 0 0 38%;
    position: sticky;
    top: 90px;
  }
  .result-col{ flex:1; }

  .card-pair{
    grid-template-columns: 1fr 1fr;
  }
  .card-value{ font-size: 38px; }

  .article-section .promo-card,
  .article-section .ad-slot{
    max-width: 720px;
  }
  .faq-list{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

@media (max-width: 380px){
  .card-value{ font-size: 28px; }
  .hero-copy h1{ font-size: 22px; }
}
