﻿/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff7ed;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────── */
header {
  background: #ea580c;
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(234,88,12,.35);
}
.header-inner { max-width: 900px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 900px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ─── Hero ───────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 1.5rem; }
.hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.hero h1 { font-size: 1.75rem; font-weight: 800; color: #ea580c; margin-bottom: .5rem; }
.description { color: #57534e; font-size: .95rem; line-height: 1.7; }

/* ─── Input Card ─────────────────────────────────── */
.input-card {
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}

/* ─── Params Grid ────────────────────────────────── */
.params-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 2rem;
  margin-bottom: 1.25rem;
}

.param-item { display: flex; flex-direction: column; gap: .4rem; }

.param-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.param-label { font-size: .875rem; font-weight: 600; color: #57534e; }

.param-val-wrap { display: flex; align-items: baseline; gap: .25rem; }
.param-numbox {
  width: 110px;
  text-align: right;
  border: none;
  border-bottom: 2px solid #e7e5e4;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ea580c;
  background: transparent;
  outline: none;
  padding: 0 2px 2px;
  transition: border-color .15s;
  /* Chrome の矢印を非表示 */
  -moz-appearance: textfield;
}
.param-numbox::-webkit-inner-spin-button,
.param-numbox::-webkit-outer-spin-button { -webkit-appearance: none; }
.param-numbox:focus { border-bottom-color: #ea580c; }
.param-numbox-sm { width: 68px; }

.param-unit { font-size: .875rem; color: #78716c; font-weight: 600; }

/* Range slider */
.param-slider {
  width: 100%;
  accent-color: #ea580c;
  cursor: pointer;
  height: 4px;
}

.param-hint { font-size: .72rem; color: #a8a29e; }

/* ─── NISA Row ───────────────────────────────────── */
.nisa-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .9rem 1.1rem;
  background: #fff7ed;
  border-radius: 10px;
  border: 1px solid #fed7aa;
}

.nisa-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: #1c1917;
  user-select: none;
}
.nisa-label input[type="checkbox"] {
  accent-color: #ea580c;
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.nisa-note { font-size: .8rem; color: #78716c; }

/* ─── Summary Cards ──────────────────────────────── */
.summary-cards {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1.1rem;
}

.summary-card {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.main-card {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
  box-shadow: 0 4px 16px rgba(234,88,12,.1);
}

.sc-label {
  font-size: .8rem;
  font-weight: 600;
  color: #78716c;
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sc-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1c1917;
  line-height: 1.15;
  margin-bottom: .25rem;
}
.main-card .sc-value { font-size: 1.9rem; color: #ea580c; }
.sc-orange { color: #ea580c; }
.sc-green  { color: #16a34a; }

.sc-sub { font-size: .8rem; color: #a8a29e; }
.sc-tax { font-size: .75rem; color: #b45309; margin-top: .2rem; }

.sc-bar-wrap {
  height: 5px;
  background: #f5f5f4;
  border-radius: 999px;
  overflow: hidden;
  margin: .6rem 0 .3rem;
}
.sc-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.sc-bar-orange { background: #ea580c; }
.sc-bar-green  { background: #22c55e; }
.sc-pct { font-size: .78rem; color: #a8a29e; }

/* ─── Chart Card ─────────────────────────────────── */
.chart-card {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: .85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.chart-title {
  font-size: .88rem;
  font-weight: 700;
  color: #57534e;
  margin-bottom: 1rem;
}
.chart-wrap { position: relative; width: 100%; }

/* ─── Table Toggle ───────────────────────────────── */
.btn-toggle-table {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  text-align: left;
  background: #fafaf9;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  color: #57534e;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: .5rem;
}
.btn-toggle-table:hover { background: #f5f5f4; }

.year-table-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.year-table-wrap.open { max-height: 520px; }

.year-table-scroll { overflow-y: auto; max-height: 500px; border-radius: 10px; border: 1.5px solid #e7e5e4; }

.year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
}
.year-table th {
  background: #ea580c;
  color: #fff;
  padding: .5rem .75rem;
  text-align: right;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.year-table th:first-child { text-align: center; }
.year-table td {
  padding: .42rem .75rem;
  border-bottom: 1px solid #f0efed;
  text-align: right;
  color: #44403c;
}
.year-table td:first-child { text-align: center; color: #78716c; font-weight: 600; }
.year-table tr:nth-child(even) td { background: #fafaf9; }
.year-table tr:hover td { background: #fff7ed; }
.year-table .pos { color: #16a34a; font-weight: 700; }
.year-table .neg { color: #b91c1c; font-weight: 700; }

/* ─── Disclaimer ─────────────────────────────────── */
.disclaimer {
  font-size: .8rem;
  color: #a8a29e;
  line-height: 1.7;
  padding: .85rem 1rem;
  background: #f5f5f4;
  border-radius: 8px;
  margin: 1rem 0;
}

/* ─── Info Card ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}
.card h2 { font-size: 1.1rem; font-weight: 700; color: #ea580c; margin-bottom: .75rem; }
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item  { display: flex; gap: .75rem; }
.tip-icon  { font-size: 1.5rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .2rem; font-size: .9rem; }
.tip-text p { font-size: .82rem; color: #78716c; line-height: 1.5; }

/* ─── Footer ─────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .82rem;
  color: #a8a29e;
  border-top: 1px solid #e7e5e4;
  margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 680px) {
  .params-grid     { grid-template-columns: 1fr; gap: 1rem; }
  .summary-cards   { grid-template-columns: 1fr; }
  .main-card .sc-value { font-size: 1.6rem; }
  .tips-grid       { grid-template-columns: 1fr; }
  .input-card      { padding: 1.1rem 1rem; }
}

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ 比較テーブル共通 ━━━ */
.table-wrap { overflow-x: auto; }
.table-note-top { font-size: .82rem; color: #a8a29e; margin-bottom: .75rem; }
.table-note     { font-size: .76rem; color: #a8a29e; margin-top: .6rem; }

.sim-table, .rule72-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 480px;
}
.sim-table th, .rule72-table th {
  background: #ea580c;
  color: #fff;
  padding: .55rem .75rem;
  text-align: center;
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
}
.sim-table td, .rule72-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid #f5f0ec;
  text-align: center;
}
.sim-table tr:nth-child(even) td,
.rule72-table tr:nth-child(even) td { background: #fdf8f5; }
.sim-table tr:hover td,
.rule72-table tr:hover td { background: #fff7ed; }
.hl-row td { background: #fff7ed !important; font-weight: 600; }
.asset-val  { color: #ea580c; font-weight: 700; }
.profit-val { color: #16a34a; font-weight: 600; }

/* ━━━ 関連ツール ━━━ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #ea580c; box-shadow: 0 2px 8px rgba(234,88,12,.12); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #ea580c; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #78716c; line-height: 1.5; margin: 0; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #fff7ed;
  color: #ea580c;
  border: 1.5px solid #fed7aa;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.scene-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #ea580c; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #78716c; line-height: 1.55; margin: 0; }

@media (max-width: 600px) {
  .scene-grid { grid-template-columns: 1fr; }
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0efed; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #ea580c; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #57534e; line-height: 1.75; }
