/* ============================================================
   DESIGN TOKENS — rakusiru-finance 準拠
   ============================================================ */
:root {
  --red:        #e05a00;
  --red-dk:     #b84400;
  --orange:     #ff6600;
  --bg:         #f4f4f0;
  --surface:    #ffffff;
  --gray-50:    #fafafa;
  --gray-100:   #f0f0f0;
  --border:     #dddddd;
  --text:       #1a1a1a;
  --text-sub:   #555555;
  --text-muted: #999999;
  --link:       #0066cc;
  --font: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --shadow:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --r:    3px;
  --r-md: 6px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 8px;
}
@media (min-width: 640px) { .container { padding: 0 16px; } }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--red);
  border-bottom: 3px solid var(--red-dk);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
}
.logo {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: rgba(255,255,255,0.9); }
.logo span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,0.8);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 5px 12px;
  border-radius: var(--r);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.header-btn:hover { background: rgba(255,255,255,0.25); }
.header-btn.primary { background: #fff; color: var(--red); font-weight: 700; }
.header-btn.primary:hover { background: #f5f5f5; }

.search-bar { background: #b84400; padding: 8px 16px 10px; }
.search-inner { display: flex; gap: 6px; max-width: 600px; }
.search-inner input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--r) 0 0 var(--r);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}
.search-inner button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background 0.15s;
}
.search-inner button:hover { background: #e55a00; }

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
.nav-bar {
  background: #222;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-item {
  color: #ddd;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  border-right: 1px solid #333;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
}
.nav-item:hover { background: #333; color: #fff; text-decoration: none; }
.nav-item.active { color: var(--orange); font-weight: 700; }
.nav-item-btn { background: none; border: none; font-family: var(--font); cursor: pointer; }
.nav-item-caret { font-size: 9px; margin-left: 3px; opacity: 0.7; }
.nav-dropdown-wrap { position: relative; display: flex; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #2a2a2a;
  border: 1px solid #444;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  z-index: 200;
}
.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap:focus-within .nav-dropdown { display: block; }
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #3a3a3a;
  white-space: nowrap;
  text-decoration: none;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #3a3a3a; color: #fff; text-decoration: none; }
.nav-dropdown-label {
  font-size: 10px;
  color: var(--orange);
  font-weight: 700;
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--orange);
  border-radius: 2px;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1a3a6b 0%, #0d2244 100%);
  color: #fff;
  padding: 28px 0;
}
.hero-inner { max-width: 700px; }
.hero-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  max-width: 600px;
}
@media (max-width: 479px) {
  .hero { padding: 20px 0; }
  .hero-title { font-size: 22px; }
  .hero-desc { font-size: 12px; }
}

/* ============================================================
   LAYOUT: 2-COLUMN
   ============================================================ */
.layout {
  padding: 12px 0 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
@media (min-width: 768px) {
  .layout { grid-template-columns: 1fr 260px; }
}
.layout-main { display: flex; flex-direction: column; gap: 12px; }
.layout-side  { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid var(--red);
  background: var(--gray-50);
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  margin: 0;
  line-height: inherit;
}
.update-date { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   INTRO / 本文ブロック
   ============================================================ */
.intro-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-sub);
}
.intro-body p + p { margin-top: 10px; }
.intro-body strong { color: var(--text); font-weight: 700; }
.intro-body .marker { background: linear-gradient(transparent 65%, #ffe8b0 65%); font-weight: 700; color: var(--text); }

/* ============================================================
   MILE TOTAL（月1万マイルの目標ビジュアル）
   ============================================================ */
.mile-total {
  padding: 18px 14px;
  text-align: center;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.mile-total .mile-num {
  font-size: 34px;
  font-weight: 700;
  color: var(--red);
  line-height: 1.1;
}
.mile-total .mile-num span { font-size: 16px; margin-left: 2px; }
.mile-total .mile-cap {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
  line-height: 1.6;
}

/* ============================================================
   BREAKDOWN（マイルの内訳）
   ============================================================ */
.breakdown-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.breakdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.breakdown-label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.breakdown-label span { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; margin-top: 1px; }
.breakdown-value { font-size: 14px; font-weight: 700; color: var(--red); white-space: nowrap; }
.breakdown-bar {
  height: 7px;
  background: var(--gray-100);
  border-radius: 20px;
  overflow: hidden;
}
.breakdown-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff9a52, var(--orange));
  border-radius: 20px;
}

/* ============================================================
   NEEDS / 3本柱グリッド
   ============================================================ */
.needs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 12px 14px;
}
.need-item {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}
.need-icon { font-size: 22px; margin-bottom: 4px; }
.need-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.need-desc { font-size: 10.5px; color: var(--text-muted); line-height: 1.45; }

/* ============================================================
   STEP LIST（貯め方の手順）
   ============================================================ */
.step-list { display: flex; flex-direction: column; }
.step-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.step-body p { font-size: 12.5px; color: var(--text-sub); line-height: 1.75; }
.step-points { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.step-points li {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}
.step-points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  font-weight: 700;
}

/* ============================================================
   ALERT BOX（注意喚起）
   ============================================================ */
.alert-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 14px;
  padding: 10px 12px;
  background: #fff7ec;
  border: 1px solid #ffd9a8;
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--r) var(--r) 0;
}
.alert-box .alert-icon { font-size: 17px; flex-shrink: 0; line-height: 1.4; }
.alert-box p { font-size: 12px; color: var(--text-sub); line-height: 1.7; }
.alert-box strong { color: #c84f14; }

/* ============================================================
   COMPARISON TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 560px;
}
.compare-table caption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
  padding: 6px 10px 4px;
  caption-side: top;
}
.compare-table th {
  background: #f0f0f0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  color: var(--text);
}
.compare-table td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.compare-table tr.recommended td { background: #fff9e6; }
.compare-table tr:hover td { background: var(--gray-50); }
.compare-table .highlight { color: var(--red); font-weight: 700; }

/* ============================================================
   TIPS
   ============================================================ */
.tips-body { padding: 4px 0; }
.tip-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
}
.tip-item:last-child { border-bottom: none; }
.tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tip-content h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.tip-content p { font-size: 12px; color: var(--text-sub); line-height: 1.65; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { padding: 4px 0; }
.faq-item { border-bottom: 1px solid var(--gray-100); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  transition: background 0.15s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: 'Q';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-q::after {
  content: '▼';
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
details[open] .faq-q::after { transform: rotate(-180deg); }
.faq-item:hover .faq-q { background: var(--gray-50); }
.faq-a {
  padding: 10px 14px 14px 44px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.75;
  background: var(--gray-50);
}

/* ============================================================
   DISCLAIMER
   ============================================================ */
.disclaimer-box {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.sidebar-widget-head {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--gray-50);
  border-bottom: 2px solid var(--red);
  border-left: 3px solid var(--red);
}
.sidebar-widget-head--warn { border-color: #c84f14; }
.sidebar-widget-body { padding: 10px 12px; }

/* 目次的サイドリンク */
.toc-list { display: flex; flex-direction: column; gap: 1px; }
.toc-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  transition: color 0.15s;
}
.toc-list .toc-link:last-child { border-bottom: none; }
.toc-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.toc-link:hover { color: var(--red); text-decoration: none; }
.toc-link:hover::before { background: var(--red); }

/* Related list */
.related-list { display: flex; flex-direction: column; }
.related-list li { border-bottom: 1px solid var(--gray-100); }
.related-list li:last-child { border-bottom: none; }
.related-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  font-size: 12px;
  color: var(--text);
  transition: color 0.15s;
}
.related-list a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.related-list a:hover { color: var(--link); text-decoration: none; }

.sidebar-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  margin-top: 16px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.footer-links a { color: #aaa; text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .layout-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
@media (max-width: 479px) {
  .layout-side { grid-template-columns: 1fr; }
  .compare-table { font-size: 11px; }
}

/* ============================================================
   RESPONSIVE SAFETY — モバイル横はみ出し防止（自動追加）
   グリッド/フレックス項目は min-width:auto のため内部のワイド要素
   （比較テーブル等）で縮まず横スクロールが発生する。min-width:0 で解消。
   ============================================================ */
.layout > *,
.layout__inner > *,
.left-col, .right-col,
.left-col > *, .right-col > *,
.layout-main, .layout-side {
  min-width: 0;
}
.table-wrap { max-width: 100%; }
