/* tool: 費用の結果表示(S0)。色は index.html の data-level に応じ、hcs-app.js が HCSData.COLORS から当てる */
#result-summary { border: 1px solid transparent; }
#budget-frame { border: 1px solid transparent; }
#result-next ol { margin: 4px 0 0; padding-left: 1.4em; list-style: decimal; font-size: 0.875rem; }
#result-next li { margin-bottom: 2px; }

/* a11y: アクセシビリティ(S3 が書く) */

/* 文字は14px以上(small・.note は13pxまで)。index.html のインライン style の値は書き換えず、値ごとに属性セレクタで引き上げる */
[style*="font-size:11px"], [style*="font-size:12px"], [style*="font-size:13px"],
[style*="font-size:.72rem"], [style*="font-size:.75rem"], [style*="font-size:0.75rem"], [style*="font-size:.78rem"],
[style*="font-size:.8rem"], [style*="font-size:.83rem"], [style*="font-size:.84rem"], [style*="font-size:.85rem"],
[style*="font-size:0.85rem"], [style*="font-size:.86rem"], [style*="font-size:.87rem"],
.text-xs, .hx-nav a, .hx-gallery figcaption, .hx-pcard-body p, .hx-hero-chips span { font-size: 14px !important; }
/* index.html の480px以下の規則が [flex-direction:column] の枠に .85rem !important を当てるので、強さを上げて14pxにする */
html [style*="flex-direction:column"] { font-size: 14px !important; }

/* 説明文(見える文字。title だけに頼らない) */
.hcs-help { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: #475569; }
.term-help { font-size: 14px; line-height: 1.4; color: #475569; margin-bottom: 2px; }

/* タップ対象は44px以上 */
.hx-logo, .hx-nav a, nav[aria-label="パンくずリスト"] a, body > div[style*="#4338ca"] a,
a[href][style*="font-size:11px"], div[style*="font-size:11px"] > a, a[href^="/blog"] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; box-sizing: border-box;
}
.hx-logo { white-space: normal !important; }
#hobbySearch, #frequency { min-height: 44px; }
#budgetSlider { height: 44px; }
#budgetSlider, .style-btn, .exp-btn, .cat-btn, .hobby-card, summary { touch-action: manipulation; }
.cat-btn, .style-btn, .exp-btn, .hobby-card, #selectedHobby button { min-height: 44px; min-width: 44px; }
#selectedHobby button { padding: 10px 12px; }

/* フォーカス枠(2px以上、背景との比が3:1以上) */
:focus-visible { outline: 3px solid #1d4ed8 !important; outline-offset: 2px; }
select:focus-visible, input:focus-visible { outline: 3px solid #1d4ed8 !important; }

/* 濃い青の帯の中は、白の枠にする(背景との比が3:1以上) */
.hx-ctaband :focus-visible { outline-color: #fff !important; }

/* 結果の見出し: 固定ヘッダーに隠れない */
#result-heading { scroll-margin-top: 72px; }
#result-heading:focus { outline: none; }
#result-heading:focus-visible { outline: 3px solid #1d4ed8 !important; }

/* 最初の画面: PC でもヒーロー・信頼の帯を畳んで、検索が最初の画面に入るようにする(文言は消さない) */
@media (min-width: 641px) {
  [style*="background:linear-gradient(90deg"] { padding: 6px 0 !important; border-bottom-width: 2px !important; }
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"] { gap: 8px !important; }
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"] > span { flex-direction: row !important; flex-wrap: wrap; padding: 4px 10px !important; gap: 4px 8px !important; border-width: 1px !important; border-radius: 999px !important; font-size: 14px !important; line-height: 1.4 !important; box-shadow: none !important; }
  .hx-hero-in { padding: 14px 18px 10px !important; }
  .hx-hero h1 { margin: 0 0 6px !important; font-size: 1.5rem !important; line-height: 1.35 !important; }
  .hx-hero h1 br { display: none; }
  .hx-hero-sub { margin: 0 0 8px !important; line-height: 1.6 !important; }
  .hx-hero-ctas, .hx-hero-ctas + div { display: none !important; }
  .hx-hero-chips { margin-top: 6px !important; }
  .hx-wrap { padding-top: 14px !important; }
}

/* 幅が狭い(150%拡大相当 260px など)ときも横にあふれさせない */
@media (max-width: 400px) {
  .hx-header-in { gap: 8px !important; }
  .hx-nav { margin-left: 0 !important; }
  img, canvas, table, pre { max-width: 100%; }
  .hx-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .hx-grid > * { min-width: 0; }
  .hx-btn-primary, .hx-btn-ghost, .hx-cta { white-space: normal !important; max-width: 100% !important; box-sizing: border-box !important; text-align: center; }
  .hx-ctaband { padding-left: 10px !important; padding-right: 10px !important; }
  #budgetDisplay { min-width: 0 !important; padding-left: 8px !important; padding-right: 8px !important; }
  #budgetSlider { min-width: 0; }
  .hx-wrap, .hx-section { padding-left: 10px !important; padding-right: 10px !important; }
}

/* ads: 広告の枠(S4 が書く) */
.hcs-ads { margin: 1.5rem auto; max-width: 760px; padding: 16px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; }
.hcs-ads-title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: #334155; }
.hcs-ads-note { margin: 0 0 12px; font-size: 0.875rem; line-height: 1.6; color: #475569; }
.hcs-ads-list { display: grid; gap: 8px; }
.hcs-ad-item { display: block; }
.hcs-ad-item[hidden] { display: none; }
.hcs-ad-link { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; box-sizing: border-box; font-size: 0.9375rem; line-height: 1.5; font-weight: 600; color: #1e3a8a; background: #fff; border: 1px solid #94a3b8; border-radius: 8px; text-decoration: none; }
.hcs-ad-link:hover { background: #eff6ff; }
.hcs-ad-link:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.hcs-ad-caption { margin: 4px 0 0; font-size: 0.875rem; color: #475569; }
.hcs-ad-hobby { margin-top: 8px; }
.hcs-ad-hobby:empty, #ads-hobby:empty { display: none; }
.hcs-ad-hobby-title { margin: 8px 0 0; font-size: 0.875rem; color: #475569; }
