/* 経営計算ツールポータル 共通スタイル
   各アプリは <link rel="stylesheet" href="../../common/style.css"> で読み込む。
   色・フォント・基本レイアウトなどサイト全体で共有するものだけをここに置き、
   入力フォームや結果カードなどアプリ固有のスタイルは各アプリ側で定義する。 */

:root {
  --bg: #0A0E1A;
  --bg-card: #141A2B;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text-primary: #F1F5F9;
  --text-secondary: #C2CBDA;
  --text-muted: #B5BECE;
  --track: #232B42;
  --blue: #5BC3A4;
  --blue-soft: rgba(91,195,164,0.15);
  --orange: #FB923C;
  --orange-soft: rgba(251,146,60,0.15);
  --indigo: #818CF8;
  --indigo-soft: rgba(129,140,248,0.15);
  --violet: #C084FC;
  --violet-soft: rgba(192,132,252,0.15);
  --green: #22C55E;
  --green-soft: rgba(34,197,94,0.15);
  --red: #F87171;
  --red-soft: rgba(248,113,113,0.15);
  --amber: #FBBF24;
  --amber-soft: rgba(251,191,36,0.15);
  --card-hover-bg: #17213A;
  --value-input-bg: rgba(0,0,0,0.16);
  --value-input-shadow: inset 0 2px 4px rgba(0,0,0,0.24), inset 0 -1px 0 rgba(255,255,255,0.05);
  --body-gradient: linear-gradient(165deg, #05070B 0%, #0A0E1A 45%, #1B222E 100%);
  --radius: 16px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ライトモード(既定値。common/theme.jsが明示的に「dark」を保存していない限りこちらを適用する。
   leonowa.tokyo本体(アクセシビリティ診断ページ等)とトンマナを統一するため、teal系のアクセントカラーは
   そちら側で検証済みの値(#2A7560、白背景に対して5.51:1でAA適合)にそろえてある) */
:root[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: rgba(15,23,42,0.10);
  --border-strong: rgba(15,23,42,0.18);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #47536B;
  --track: #E2E8F0;
  --card-hover-bg: #F1F5F9;
  --value-input-bg: rgba(15,23,42,0.02);
  --value-input-shadow: inset 0 1px 2px rgba(15,23,42,0.05), inset 0 -1px 0 rgba(255,255,255,0.6);
  --body-gradient: linear-gradient(165deg, #FFFFFF 0%, #F8FAFC 45%, #EDF1F6 100%);
  --blue: #2A7560;
  --blue-soft: rgba(42,117,96,0.10);
  --orange: #EA580C;
  --orange-soft: rgba(234,88,12,0.10);
  --indigo: #4F46E5;
  --indigo-soft: rgba(79,70,229,0.10);
  --violet: #9333EA;
  --violet-soft: rgba(147,51,234,0.10);
  --green: #16A34A;
  --green-soft: rgba(22,163,74,0.10);
  --red: #DC2626;
  --red-soft: rgba(220,38,38,0.10);
  --amber: #D97706;
  --amber-soft: rgba(217,119,6,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--body-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "palt";
}

a { color: var(--blue); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ページ上部の名乗り(サイト名 / ツール名) */
.site-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.site-crumb a { color: var(--text-muted); text-decoration: none; }
.site-crumb a:hover { color: var(--text-primary); text-decoration: underline; }
@media (max-width: 640px) {
  .site-crumb { font-size: 11px; gap: 3px 6px; }
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.hero-text {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: stretch; }
  .hero-actions { flex-wrap: wrap; }
}
.eyebrow, .hero-text .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.hero-text h1 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.hero-text .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
/* タイトル直下の一言サブタイトル(「これは何をしてくれるか」を一言で伝えるキャッチコピー)。
   下の.subtitleとは役割が別: subtitleは計算内容の正式な説明、taglineは一目で伝わる言い換え */
.hero-text .tagline {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 8px;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.ghost-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.section-title-lg {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* カード型グリッド(ツール一覧・カテゴリ一覧で共通利用) */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.app-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.app-card:hover {
  border-color: var(--blue);
  background: var(--card-hover-bg);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .app-card { transition: border-color 0.2s ease, background 0.2s ease; }
  .app-card:hover { transform: none; }
}
.app-card .app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 14px;
}
.app-card h2, .app-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
/* タイトル直下の一言サブタイトル。下の.app-card pとは役割が別: pは正式な説明文、taglineは一目で伝わる言い換え */
.app-card .app-tagline {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.6;
  flex-grow: 1;
}
.app-card .app-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}
.app-card .app-link .arrow { transition: transform 0.2s ease; }
.app-card:hover .app-link .arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .app-card:hover .app-link .arrow { transform: none; }
}
.app-card.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.app-card .app-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 9px;
  margin-top: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 20px;
}

.disclaimer {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 20px;
  line-height: 1.7;
}

.site-footer {
  text-align: left;
  padding: 0;
  margin-top: 48px;
}
.footer-band {
  max-width: 900px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 36px 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-main { flex: 1 1 320px; min-width: 0; }
.footer-brand { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 12px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.footer-links a { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }
.footer-copyright { font-size: 12px; color: var(--text-muted); margin: 0; }
.footer-banner {
  flex: 0 0 auto;
  display: block;
  width: 280px;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.footer-banner:hover { transform: translateY(-2px); border-color: var(--blue); }
.footer-banner img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) {
  .footer-banner { transition: border-color 0.2s ease; }
  .footer-banner:hover { transform: none; }
}
@media (max-width: 720px) {
  .footer-band { flex-direction: column; align-items: stretch; }
  .footer-banner { width: 100%; max-width: 360px; margin: 0 auto; }
}

/* 「経営上の読み取り」ボックス(結果の下に出す一言解説)。太字強調は白文字+やや大きめにして目立たせる。
   上下の余白を広めにとって、他の要素から視覚的に独立させ目立たせる */
.insight-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 32px 0;
}
.insight-icon { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.insight-box p { margin: 0; font-size: 14px; color: var(--text-primary); line-height: 1.7; }
.insight-box b { color: var(--text-primary); font-weight: 700; }

/* 「〜とは？」解説セクション＋FAQ(結果カードの下に置く読み物コンテンツ)。
   全アプリ共通で使うため、各アプリ側の<style>には複製せずここに置く。
   FAQは<details>のネイティブ・アコーディオンでJS不要。FAQPage構造化データと
   表示内容を必ず一致させること(質問文・回答文とも一字一句) */
.explainer-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.explainer-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}
.faq-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item summary {
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
}
.faq-item p { margin: 10px 0 0; font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

@media print {
  .explainer-section, .faq-item { break-inside: avoid; }
  .explainer-section p { color: #4B5563 !important; }
  .explainer-section { background: #FFFFFF !important; border: 1px solid #D1D5DB !important; box-shadow: none !important; }
  .faq-item summary, .faq-item p { color: #111827 !important; }
  .faq-item summary::after { display: none !important; }
  .faq-item p { display: block !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .result-value, .value-input { transition: color 0.3s ease; }
}

/* ダークモード/ライトモード切り替えボタン(common/theme.jsが全ページに自動挿入する) */
.theme-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.theme-toggle-btn:hover { border-color: var(--blue); }
@media print {
  .theme-toggle-btn { display: none !important; }
}

/* 「TOPへ戻る」ボタン(common/theme.jsが全ページに自動挿入する)。
   一定量スクロールすると右下にふわっと現れる、半透明のフローティングボタン */
.to-top-btn {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(20,26,43,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
}
:root[data-theme="light"] .to-top-btn { background: rgba(255,255,255,0.7); }
.to-top-btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top-btn:hover { border-color: var(--blue); }
@media (prefers-reduced-motion: reduce) {
  .to-top-btn { transition: opacity 0.25s ease; }
}
@media print {
  .to-top-btn { display: none !important; }
}
