/*
 * アナライズギアの公式サイトの共通の見た目 (2026-11-28)。上の帯・関連サービスのカード・フッター・トップの部品・中のページ。
 * 元は mini-basketball-scoresheet の packages/ag-site/src/site.css。ここを直して、写すスクリプト (scripts/ag-site.mjs) で
 * 5 つのサイト (ミニバスコア・スタッツギアは deploy/scripts/lp-chrome.mjs、ほかは各リポジトリの vendor/ag-site) に配る。
 *
 * - サービスごとの色は <html data-site="..."> で切り替える (下の :root[data-site])。色は services.json と同じにする
 * - 各サイトのページの CSS と一緒に読むので、ここの決まりはすべて ag- で始まる名前の中だけに効くようにする
 *   (body や a に直接書かない。例外は body.ag-doc = 中のページ)
 */
:root {
  --ag-navy: #0f172a;
  --ag-navy-2: #1e293b;
  --ag-ink: #0f172a;
  --ag-muted: #475569;
  --ag-line: #e2e8f0;
  --ag-bg: #f8fafc;
  --ag-card: #ffffff;
  /* サービスの色 (既定はスタッツギアの空色) */
  --ag-brand: #0284c7;
  --ag-brand-dark: #0369a1;
  --ag-brand-soft: #e0f2fe;
  --ag-brand-on-dark: #7dd3fc;
}
:root[data-site="minibascore"] {
  --ag-brand: #2563eb;
  --ag-brand-dark: #1d4ed8;
  --ag-brand-soft: #dbeafe;
  --ag-brand-on-dark: #93c5fd;
}
:root[data-site="tactics"] {
  --ag-brand: #047857;
  --ag-brand-dark: #065f46;
  --ag-brand-soft: #d1fae5;
  --ag-brand-on-dark: #6ee7b7;
}
:root[data-site="clip"] {
  --ag-brand: #ea580c;
  --ag-brand-dark: #c2410c;
  --ag-brand-soft: #ffedd5;
  --ag-brand-on-dark: #fdba74;
}
:root[data-site="clock"] {
  --ag-brand: #7c3aed;
  --ag-brand-dark: #6d28d9;
  --ag-brand-soft: #ede9fe;
  --ag-brand-on-dark: #c4b5fd;
}
:root[data-site="replay"] {
  --ag-brand: #f97316;
  --ag-brand-dark: #c2410c;
  --ag-brand-soft: #ffedd5;
  --ag-brand-on-dark: #fdba74;
}

/* ---- ページ全体 (トップなど、site.css だけで組むページ) ---- */
.ag-page {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--ag-ink);
  background: var(--ag-bg);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
.ag-page *, .ag-header *, .ag-footer * { box-sizing: border-box; }
.ag-page a { color: var(--ag-brand-dark); }
.ag-page img { max-width: 100%; height: auto; display: block; }
.ag-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---- ボタン ---- */
.ag-btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--ag-brand); color: #fff !important;
  font-weight: 700; text-decoration: none !important; text-align: center; line-height: 1.4; border: 0;
}
.ag-btn:hover { background: var(--ag-brand-dark); }
.ag-btn-small { padding: 8px 16px; font-size: 14px; }
.ag-btn-big { padding: 16px 30px; font-size: 18px; }
.ag-btn-ghost { background: transparent; border: 2px solid var(--ag-brand); color: var(--ag-brand-dark) !important; }
.ag-btn-ghost:hover { background: var(--ag-brand-soft); }

/* ---- 上の帯 (全ページ共通) ---- */
.ag-header {
  background: var(--ag-navy); color: #fff;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.5;
}
.ag-header .ag-wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding-top: 12px; padding-bottom: 12px;
}
.ag-logo { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none !important; font-weight: 700; font-size: 17px; }
.ag-logo img { width: 32px; height: 32px; border-radius: 8px; display: block; }
/* ミニバスコアのアイコンは背景が透明なので、白い下地を付けてスタッツギアのアイコンとそろえる */
:root[data-site="minibascore"] .ag-logo img { background: #fff; padding: 3px; }
/* 狭い画面では 2 段目に、広い画面ではロゴとボタンの間に */
.ag-gnav { order: 3; width: 100%; display: flex; gap: 4px 18px; font-size: 14px; overflow-x: auto; }
.ag-gnav a { color: #cbd5e1 !important; text-decoration: none !important; white-space: nowrap; padding: 4px 0; }
.ag-gnav a:hover, .ag-gnav a[aria-current="page"] { color: #fff !important; }
@media (min-width: 720px) { .ag-gnav { order: 0; width: auto; margin-left: auto; } }

/* ---- フッター (全ページ共通) ---- */
.ag-footer {
  background: var(--ag-navy); color: #94a3b8; font-size: 14px; padding: 36px 0 28px; line-height: 1.6;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
.ag-footer a { color: #cbd5e1 !important; text-decoration: none; }
.ag-footer a:hover { text-decoration: underline; }
.ag-fnav { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ag-fnav div { display: grid; gap: 6px; align-content: start; }
.ag-fnav-title { margin: 0 0 4px; color: #fff; font-weight: 700; }
.ag-copy {
  margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--ag-navy-2);
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between;
}

/* ---- 関連サービス (フッターのすぐ上、全ページ共通。docs/saas/platform.md §7.4) ---- */
.ag-related {
  background: var(--ag-bg); border-top: 1px solid var(--ag-line); padding: 36px 0 40px; margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.5; color: var(--ag-ink); text-align: left;
}
.ag-related * { box-sizing: border-box; }
.ag-related .ag-related-title {
  margin: 0 0 16px; padding: 0; border: 0; font-size: 18px; font-weight: 700; color: var(--ag-ink); text-align: left;
}
.ag-related-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.ag-related-list li { margin: 0; padding: 0; min-width: 0; }
.ag-related-card {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 16px;
  background: var(--ag-card); border: 1px solid var(--ag-line); border-radius: 14px;
  color: var(--ag-ink) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s;
}
.ag-related-card:hover { border-color: var(--ag-brand); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.ag-related-card img { flex: none; width: 48px; height: 48px; border-radius: 12px; background: #fff; display: block; }
/* ミニバスコア・スタッツギアのアイコンは枠が無いので、ほかのアイコンと同じく枠を付ける */
.ag-related-card img[src$="/minibascore.svg"], .ag-related-card img[src$="/statsgear.svg"] { border: 1px solid var(--ag-line); }
.ag-related-card img[src$="/minibascore.svg"] { padding: 5px; }
.ag-related-text { display: grid; gap: 2px; min-width: 0; }
.ag-related-name { font-weight: 700; font-size: 15px; }
.ag-related-desc { font-size: 13px; color: var(--ag-muted); }

/* ---- トップ: 最初の画面 ---- */
.ag-hero { background: var(--ag-navy); color: #fff; padding: 40px 0 56px; }
.ag-hero .ag-wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 820px) { .ag-hero .ag-wrap { grid-template-columns: 1.1fr 0.9fr; } }
.ag-eyebrow { margin: 0 0 12px; color: var(--ag-brand-on-dark); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.ag-hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.3; margin: 0 0 12px; }
.ag-lead { font-size: 18px; color: #cbd5e1; margin: 0 0 24px; }
.ag-badges { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.ag-badges li { border: 1px solid #334155; border-radius: 999px; padding: 4px 12px; font-size: 14px; color: #e2e8f0; }
.ag-note { font-size: 13px; color: #94a3b8; margin: 12px 0 0; }
.ag-hero h1, .ag-section h2 { word-break: keep-all; overflow-wrap: anywhere; }

/* アプリの画面の写真: スマホの枠で囲み「アプリの画面（例）」の札を付けて、押せるボタンと間違えないようにする */
.ag-device {
  position: relative; display: block; width: fit-content; max-width: 100%; margin: 14px 0; padding: 10px;
  background: var(--ag-navy-2); border-radius: 30px; box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
}
.ag-device img { display: block; border-radius: 20px; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ag-device::before {
  content: "アプリの画面（例）"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; background: #fff; color: #334155; border: 1px solid var(--ag-line);
  font-size: 12px; font-weight: 700; line-height: 1.5;
}
.ag-hero .ag-device { margin: 14px auto 0; max-width: 340px; }
.ag-paper { margin: 0; }
.ag-paper img { border: 1px solid var(--ag-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }

/* ---- トップ: 欄 ---- */
.ag-section { padding: 56px 0; }
.ag-section.ag-alt { background: #fff; }
.ag-section h2 { font-size: clamp(22px, 4.5vw, 30px); line-height: 1.4; margin: 0 0 24px; }
.ag-section-lead { margin: -12px 0 24px; color: var(--ag-muted); }
.ag-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ag-card { background: var(--ag-card); border: 1px solid var(--ag-line); border-radius: 16px; padding: 20px; }
.ag-alt .ag-card { background: var(--ag-bg); }
.ag-card h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.5; }
.ag-card p { margin: 0; color: var(--ag-muted); font-size: 15px; }
.ag-card ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--ag-muted); font-size: 15px; }
.ag-card li + li { margin-top: 4px; }

/* 3 つの手順 */
.ag-flow { list-style: none; padding: 0; margin: 0; counter-reset: ag-flow; display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ag-flow li { counter-increment: ag-flow; }
.ag-flow .ag-device { max-width: 280px; margin: 14px 0 16px; }
.ag-flow h3 { margin: 0 0 6px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.ag-flow h3::before {
  content: counter(ag-flow); display: inline-flex; width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--ag-brand); color: #fff; font-size: 15px; align-items: center; justify-content: center;
}
.ag-flow p { margin: 0; color: var(--ag-muted); font-size: 15px; }

/* 画面写真を並べる */
.ag-shots { display: grid; gap: 28px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.ag-shots figure { margin: 0; }
.ag-shots .ag-device { max-width: 260px; }
.ag-shots figcaption { font-size: 15px; color: var(--ag-muted); margin-top: 4px; }
.ag-shots figcaption strong { display: block; color: var(--ag-ink); font-size: 16px; }

.ag-more { font-weight: 700; text-decoration: none; }
.ag-more:hover { text-decoration: underline; }
.ag-center { text-align: center; margin-top: 28px; }

/* アカウントなし / ログイン後 */
.ag-two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ag-card.ag-brand-card { border-color: var(--ag-brand); }
.ag-tag {
  display: inline-block; background: var(--ag-brand-soft); color: var(--ag-brand-dark); border-radius: 999px;
  padding: 1px 10px; font-size: 12px; font-weight: 700; margin-bottom: 6px;
}

/* 料金 */
.ag-price { max-width: 520px; margin: 0 auto; text-align: center; }
.ag-card p.ag-price-main { font-size: 40px; font-weight: 800; color: var(--ag-brand); margin: 0 0 4px; line-height: 1.3; }

/* よくある質問 */
dl.ag-faq { margin: 0; }
dl.ag-faq dt { font-weight: 700; margin-top: 18px; }
dl.ag-faq dt:first-child { margin-top: 0; }
dl.ag-faq dd { margin: 4px 0 0; color: var(--ag-muted); }

/* お知らせ */
ul.ag-news { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ag-line); }
ul.ag-news li { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--ag-line); }
ul.ag-news time { color: var(--ag-muted); font-size: 14px; min-width: 9em; }

/* お知らせ (ミニバスコアのトップ。中身は announcements.js が API から取って書く。取れなければ欄ごと隠れる) */
.ag-page section[hidden] { display: none; }
.ag-page .lp-announcements-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ag-line); }
.ag-page .lp-announce-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'title chevron' 'date date' 'body body';
  column-gap: 12px; row-gap: 4px; padding: 14px 4px; border-bottom: 1px solid var(--ag-line); cursor: pointer;
}
.ag-page .lp-announce-item:hover { background: var(--ag-bg); }
.ag-page .lp-announce-title {
  grid-area: title; width: 100%; background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ag-ink); line-height: 1.5;
}
.ag-page .lp-announce-title:hover { color: var(--ag-brand-dark); }
.ag-page .lp-announce-chevron { grid-area: chevron; align-self: center; color: var(--ag-muted); transition: transform .2s; pointer-events: none; }
.ag-page .lp-announce-item:has(.lp-announce-title[aria-expanded='true']) .lp-announce-chevron { transform: rotate(180deg); color: var(--ag-brand); }
.ag-page .lp-announce-date { grid-area: date; font-size: 13px; color: var(--ag-muted); }
.ag-page .lp-announce-summary, .ag-page .lp-announce-body { grid-area: body; margin: 0; font-size: 14px; color: var(--ag-muted); }

/* 最後のボタン */
.ag-cta { background: var(--ag-brand-soft); text-align: center; }
.ag-cta p { color: var(--ag-muted); }

/* 表 (集計のサンプルなど) */
.ag-table-wrap { overflow-x: auto; }
table.ag-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; min-width: 560px; }
table.ag-table th, table.ag-table td { padding: 8px 10px; border-bottom: 1px solid var(--ag-line); text-align: center; white-space: nowrap; }
table.ag-table thead th { background: #f1f5f9; color: var(--ag-muted); font-size: 13px; }
table.ag-table td:nth-child(2) { text-align: left; }
table.ag-table tr.ag-total td { font-weight: 700; background: #f8fafc; }
.ag-kpis { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin: 0 0 20px; }
.ag-kpi { background: #fff; border: 1px solid var(--ag-line); border-radius: 14px; padding: 12px; text-align: center; }
.ag-kpi b { display: block; font-size: 28px; color: var(--ag-brand-dark); line-height: 1.3; }
.ag-kpi span { font-size: 13px; color: var(--ag-muted); }
.ag-small { font-size: 13px; color: var(--ag-muted); }

/* ---- 中のページ (マニュアル・よくある質問・規約など。lp-chrome.mjs が <body class="ag-doc"> を付ける) ----
 * 本文の HTML と lp.css / legal.css / manual.css はそのままにして、それらが使う色の変数をトップと同じ色に置き換え、
 * 見出し・目次・表・フォーム・ボタンの形をタクティクスギアなどの中のページに合わせる。トップと同じく明るい見た目だけにする */
body.ag-doc {
  --fg: var(--ag-ink); --fg-muted: var(--ag-muted); --muted: var(--ag-bg);
  --bg: #fff; --bg-alt: var(--ag-bg); --card: #fff; --border: var(--ag-line); --code-bg: #f1f5f9;
  --accent: var(--ag-brand-dark); --accent-dark: var(--ag-brand-dark); --accent-fg: #fff; --primary: var(--ag-brand-dark);
  --success-bg: #ecfdf5; --success-fg: #047857; --error-bg: #fef2f2; --error-fg: #b91c1c;
  color-scheme: light; background: #fff; color: var(--ag-ink); line-height: 1.75;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
/* 本文が短いページでも、フッターを画面の下に付ける */
body.ag-doc { min-height: 100vh; display: flex; flex-direction: column; }
body.ag-doc > * { width: 100%; flex-shrink: 0; }
/* 本文が短いページでも、関連サービスとフッターを画面のいちばん下に */
body.ag-doc > .ag-related { margin-top: auto; }
body.ag-doc > :has(+ .ag-related) { margin-bottom: 48px; }
.ag-doc .breadcrumb { font-size: 14px; }
.ag-doc .breadcrumb a { text-decoration: none; }
.ag-doc main h1, .ag-doc .manual-content h1, .ag-doc .contact-hero h1 { font-size: clamp(24px, 5vw, 30px); line-height: 1.4; }
/* 見出しの区切りは、下の色の線ではなく上の細い線に */
.ag-doc main h2, .ag-doc .manual-content h2 {
  font-size: 20px; line-height: 1.5; margin: 36px 0 12px; padding: 16px 0 0; border-bottom: 0; border-top: 1px solid var(--ag-line);
  text-align: left;
}
/* パンくずを本文 (幅 760px) の左端にそろえる */
.ag-doc .breadcrumb { max-width: 760px; margin-left: auto; margin-right: auto; }
/* 章の一覧のページ (使い方・学習ガイド) は、タイトルと一覧の間を詰める */
.ag-doc .hero { padding: 56px 0 0; }
.ag-doc .hero + section:not(.ag-related) { padding-top: 8px; }
.ag-doc .manual-content nav[aria-label="目次"] { border: 1px solid var(--ag-line); border-radius: 14px !important; padding: 12px 20px !important; }
.ag-doc .manual-content .callout { border-radius: 0 12px 12px 0; font-size: 14px; }
.ag-doc main table, .ag-doc .manual-content table { border-radius: 12px; }
.ag-doc main th, .ag-doc .manual-content th { background: #f1f5f9; }
/* ボタン・入力欄 */
.ag-doc .form-submit, .ag-doc .cta-primary { background: var(--ag-brand); color: #fff; }
.ag-doc .form-submit:hover, .ag-doc .cta-primary:hover { background: var(--ag-brand-dark); }
.ag-doc .cta-secondary { border-color: var(--ag-brand); color: var(--ag-brand-dark); }
.ag-doc .form-row input, .ag-doc .form-row select, .ag-doc .form-row textarea { border-radius: 10px; }

/* 縦に長い画面写真は、上の部分だけを見せる (スマホの画面に近い比率にする) */
.ag-crop img { aspect-ratio: 390 / 700; object-fit: cover; object-position: top; width: 100%; }
