/* =========================================================================
 * AstroReader — style.css
 * ダーク／グラスモーフィズムのデザインシステム
 * ========================================================================= */

:root {
  --bg-0: #070917;
  --bg-1: #101433;
  --accent-color: #f2c879;
  --accent-dim: rgba(242, 200, 121, 0.15);
  --violet: #a78bfa;
  --text-primary: #eef1f8;
  --text-secondary: #9aa4c0;
  --text-muted: #6f7a9c;
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.10);
  --fire: #f87171;
  --earth: #7ee2a8;
  --air: #93c5fd;
  --water: #a78bfa;
  --harmony: #7ee2a8;
  --tension: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { font-size: 17px; }

body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont,
    'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  color: var(--text-primary);
  background: var(--bg-0);
  background-image:
    radial-gradient(1000px 620px at 12% -8%, rgba(167, 139, 250, 0.20), transparent 62%),
    radial-gradient(860px 560px at 92% 4%, rgba(242, 200, 121, 0.12), transparent 60%),
    radial-gradient(1100px 700px at 50% 108%, rgba(59, 130, 246, 0.13), transparent 62%),
    linear-gradient(175deg, var(--bg-0) 0%, var(--bg-1) 55%, var(--bg-0) 100%);
  background-attachment: fixed;
  line-height: 1.8;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 22%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.2px 1.2px at 72% 14%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.6px 1.6px at 41% 68%, rgba(255,255,255,.32), transparent),
    radial-gradient(1.2px 1.2px at 88% 52%, rgba(255,255,255,.36), transparent),
    radial-gradient(1.3px 1.3px at 8% 78%, rgba(255,255,255,.28), transparent);
}

.app-wrapper {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding: 18px 18px calc(var(--nav-h) + 40px);
}

h1, h2, h3, h4 { line-height: 1.5; margin: 0; font-weight: 700; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--text-secondary); }
.tiny { font-size: .88rem; line-height: 1.75; }
.center { text-align: center; }
b, strong { font-weight: 700; }

/* -------------------------------------------------------------------------
 * ヘッダー
 * ---------------------------------------------------------------------- */
.app-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; padding: 18px 2px 22px;
}
.brand {
  grid-column: 2; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 5px;
}
.brand .brand-title {
  display: flex; align-items: center; gap: 9px;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); font-weight: 800; letter-spacing: -.01em;
}
.brand .glyph {
  color: var(--accent-color); width: .82em; height: .82em;
  display: inline-block; flex: none; vertical-align: -.1em;
}
.brand small {
  display: block; font-size: .72rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase;
}
.tiny-btn { grid-column: 3; justify-self: end; padding: 6px 12px !important; font-size: .72rem !important; }

/* -------------------------------------------------------------------------
 * 共通ブロック
 * ---------------------------------------------------------------------- */
.glass-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.glass-container + .glass-container { margin-top: 14px; }

.hero-intro { text-align: center; }
.hero-intro h1 {
  font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem);
  line-height: 1.5; margin-bottom: 12px; letter-spacing: -.01em;
}
.hero-intro p { font-size: .95rem; line-height: 1.8; }

/* 章ヘッダー */
.chapter-head {
  border: 1px solid rgba(242,200,121,.32);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(242,200,121,.10), rgba(167,139,250,.07));
  padding: 20px; margin-bottom: 16px;
}
.chapter-head .kicker {
  display: inline-block; font-size: .68rem; letter-spacing: .16em; font-weight: 700;
  color: var(--accent-color); border: 1px solid rgba(242,200,121,.4);
  border-radius: 5px; padding: 2px 9px; margin-bottom: 10px;
}
.chapter-head h2 { font-size: 1.24rem; margin-bottom: 8px; }
.chapter-head p { font-size: .86rem; color: var(--text-secondary); margin: 0; }

.section-title {
  display: flex; align-items: center; gap: 9px;
  font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  color: var(--text-muted); margin: 28px 2px 12px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

hr.sep { border: 0; border-top: 1px solid rgba(255,255,255,.07); margin: 18px 0; }

/* -------------------------------------------------------------------------
 * フォーム
 * ---------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
select, input[type="time"] {
  width: 100%; padding: 11px 12px;
  background: rgba(0,0,0,.34); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: .95rem;
}
select:focus, input:focus { outline: none; border-color: var(--accent-color); }
select option { background: #14182e; color: var(--text-primary); }
.row { display: flex; gap: 9px; }
.row > * { flex: 1; min-width: 0; }
.checkbox-row {
  display: flex; align-items: center; gap: 9px; margin-top: 9px;
  font-size: .85rem; color: var(--text-secondary); cursor: pointer;
}
.checkbox-row input { width: auto; accent-color: var(--accent-color); }
.note { margin-top: 7px !important; }

button.primary {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent-color), #e0a94f);
  color: #1a1509; border: 0; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(242,200,121,.2);
  transition: transform .15s;
}
button.primary:hover { transform: translateY(-1px); }
button.ghost {
  padding: 10px 20px; background: transparent;
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: inherit; font-size: .86rem; cursor: pointer;
  transition: background .2s;
}
button.ghost:hover { background: var(--glass-bg-strong); }

/* 次の章へ */
.next-chapter {
  margin-top: 26px; padding: 20px; text-align: center;
  border: 1px dashed rgba(242,200,121,.36); border-radius: var(--radius);
  background: rgba(242,200,121,.05);
}
.next-chapter .nc-label { font-size: .72rem; letter-spacing: .1em; color: var(--text-muted); }
.next-chapter .nc-title { font-size: 1.02rem; font-weight: 700; margin: 4px 0 14px; }

/* -------------------------------------------------------------------------
 * チャート
 * ---------------------------------------------------------------------- */
.wheel-wrap { width: 100%; max-width: 480px; margin: 0 auto; }
.wheel-wrap svg { width: 100%; height: auto; display: block; }

.pillars { display: flex; gap: 10px; flex-wrap: wrap; }
.pillar {
  flex: 1 1 100px; text-align: center; padding: 14px 8px;
  border-radius: var(--radius-sm); background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
}
.pillar .p-glyph { font-size: 1.5rem; line-height: 1.2; }
.pillar .p-role { font-size: .66rem; color: var(--text-muted); }
.pillar .p-name { font-size: .74rem; color: var(--text-secondary); }
.pillar .p-sign { font-size: .95rem; font-weight: 700; color: var(--accent-color); }

.placement {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.placement:last-child { border-bottom: 0; }
.placement .p-sym { flex: 0 0 28px; font-size: 1.15rem; text-align: center; }
.placement .p-nm { flex: 0 0 92px; font-size: .84rem; font-weight: 600; }
.placement .p-pos { flex: 1; font-size: .84rem; color: var(--text-secondary); }
.placement .p-h { font-size: .72rem; color: var(--text-muted); flex: 0 0 auto; }
.retro-mark { color: var(--tension); font-size: .68rem; margin-left: 4px; font-weight: 700; }

/* 読みブロック */
.read-block { margin-bottom: 18px; }
.read-block > h3 {
  font-size: 1rem; margin-bottom: 4px; color: var(--accent-color);
}
.read-block .rb-lead { font-size: .78rem; color: var(--text-muted); margin-bottom: 14px; }
.read-block .rb-text {
  font-size: .92rem; background: rgba(0,0,0,.24);
  border-left: 3px solid var(--accent-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
}
.read-summary {
  border: 1px solid rgba(242,200,121,.4);
  background: var(--accent-dim);
  border-radius: var(--radius-sm); padding: 18px;
  font-size: .96rem; font-weight: 600; line-height: 1.9;
}

/* バランスバー */
.bal-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bal-row .bl-name { flex: 0 0 62px; font-size: .78rem; color: var(--text-secondary); }
.bal-row .bl-track { flex: 1; height: 9px; background: rgba(255,255,255,.07); border-radius: 5px; overflow: hidden; }
.bal-row .bl-track i { display: block; height: 100%; border-radius: 5px; }
.bal-row .bl-num { flex: 0 0 22px; font-size: .78rem; text-align: right; font-weight: 700; }

/* 天体の行（読み内） */
.mini-row {
  display: flex; gap: 11px; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .mr-sym { flex: 0 0 32px; font-size: 1.3rem; text-align: center; }
.mini-row .mr-body { flex: 1; min-width: 0; }
.mini-row .mr-title { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 2px; }
.mini-row .mr-text { display: block; font-size: .84rem; color: var(--text-secondary); white-space: pre-line; }

/* クリックして項目ページへ飛ぶ行 */
button.mini-row.term-link {
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.06);
  font: inherit; color: inherit; cursor: pointer; align-items: center; border-radius: var(--radius-sm);
  transition: background .15s;
}
button.mini-row.term-link .mr-title { color: var(--text-primary); }
button.mini-row.term-link:last-child { border-bottom: 0; }
button.mini-row.term-link:hover, button.mini-row.term-link:focus-visible { background: rgba(255,255,255,.05); }
.mini-row.term-link .mr-arrow { flex: 0 0 auto; color: var(--text-muted); font-size: .9rem; align-self: center; }

/* -------------------------------------------------------------------------
 * 図説
 * ---------------------------------------------------------------------- */
.diagram { width: 100%; margin: 0 auto 6px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram-caption { font-size: .76rem; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* 学習カード（アコーディオン） */
.card {
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); margin-bottom: 8px; overflow: hidden;
}
.card > summary {
  padding: 13px 15px; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 12px;
}
.card > summary::-webkit-details-marker { display: none; }
.card > summary::after { content: '＋'; margin-left: auto; color: var(--text-muted); font-size: .9rem; }
.card[open] > summary::after { content: '−'; }
.card[open] > summary { border-bottom: 1px solid var(--glass-border); }
.card .c-sym {
  flex: 0 0 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: rgba(0,0,0,.32); border: 1px solid var(--glass-border);
}
.card .c-head { flex: 1; min-width: 0; }
.card .c-name { display: block; font-size: .94rem; font-weight: 700; }
.card .c-sub { display: block; font-size: .74rem; color: var(--text-muted); }
.card .c-body { padding: 15px; font-size: .88rem; }
.card .c-body .kv { margin-bottom: 9px; }
.card .c-body .kv b {
  display: inline-block; font-size: .68rem; letter-spacing: .1em; color: var(--accent-color);
  border: 1px solid rgba(242,200,121,.36); border-radius: 4px; padding: 1px 7px; margin-right: 7px;
}
.keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.keywords span {
  font-size: .73rem; padding: 2px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); color: var(--text-secondary);
}

/* エレメント色分け */
.el-火 { color: var(--fire); }
.el-地 { color: var(--earth); }
.el-風 { color: var(--air); }
.el-水 { color: var(--water); }
.card.s-火 .c-sym { border-color: rgba(248,113,113,.45); color: var(--fire); }
.card.s-地 .c-sym { border-color: rgba(126,226,168,.45); color: var(--earth); }
.card.s-風 .c-sym { border-color: rgba(147,197,253,.45); color: var(--air); }
.card.s-水 .c-sym { border-color: rgba(167,139,250,.5);  color: var(--water); }

/* 用語の要点ボックス */
.keypoint {
  border: 1px solid rgba(167,139,250,.3); background: rgba(167,139,250,.08);
  border-radius: var(--radius-sm); padding: 15px 17px; margin-bottom: 16px;
}
.keypoint .kp-label {
  display: inline-block; font-size: .68rem; letter-spacing: .12em; font-weight: 700;
  color: var(--violet); border: 1px solid rgba(167,139,250,.4);
  border-radius: 5px; padding: 2px 8px; margin-bottom: 8px;
}
.keypoint p { font-size: .88rem; margin: 0; }

/* 文法の式 */
.grammar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; justify-content: center;
  margin: 4px 0 6px;
}
.grammar .g-item {
  flex: 1 1 130px; text-align: center; padding: 12px 8px;
  border-radius: var(--radius-sm); background: rgba(0,0,0,.28);
  border: 1px solid var(--glass-border);
}
.grammar .g-item b { display: block; font-size: .92rem; color: var(--accent-color); }
.grammar .g-item span { font-size: .74rem; color: var(--text-secondary); }

/* アスペクト図のグリッド */
.aspect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.aspect-cell {
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); padding: 12px; text-align: center;
}
.aspect-cell svg { width: 84px; height: 84px; display: block; margin: 0 auto 6px; }
.aspect-cell .ac-name { font-size: .84rem; font-weight: 700; }
.aspect-cell .ac-deg { font-size: .72rem; color: var(--text-muted); }
.aspect-cell .ac-tone { font-size: .7rem; font-weight: 700; margin-top: 3px; }

/* 組み合わせシミュレータ */
.combo-picker { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.combo-picker .cp-full { grid-column: 1 / -1; }
.combo-out {
  margin-top: 14px; padding: 16px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.28); border: 1px solid var(--glass-border); font-size: .9rem;
}
.combo-out .co-title { font-size: 1rem; font-weight: 700; color: var(--accent-color); margin-bottom: 8px; }

/* -------------------------------------------------------------------------
 * クイズ
 * ---------------------------------------------------------------------- */
.quiz-box { border-color: rgba(167,139,250,.32); }
.quiz-progress {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .76rem; color: var(--text-muted); margin-bottom: 10px;
}
.quiz-track { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.quiz-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--accent-color)); transition: width .3s; }
.quiz-q { font-size: 1.02rem; font-weight: 700; margin-bottom: 14px; line-height: 1.65; }
.quiz-options { display: grid; gap: 9px; }
.quiz-opt {
  text-align: left; padding: 13px 15px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: .9rem; cursor: pointer; transition: all .16s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent-color); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct { border-color: var(--harmony); background: rgba(126,226,168,.14); color: var(--harmony); font-weight: 700; }
.quiz-opt.wrong { border-color: var(--tension); background: rgba(248,113,113,.12); color: var(--tension); }
.quiz-explain {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.28); border-left: 3px solid var(--violet); font-size: .86rem;
}
.quiz-explain .qe-verdict { font-weight: 700; display: block; margin-bottom: 5px; }
.quiz-explain .qe-verdict.ok { color: var(--harmony); }
.quiz-explain .qe-verdict.ng { color: var(--tension); }
.quiz-result { text-align: center; padding: 12px 0; }
.quiz-result .qr-score { font-size: 2.6rem; font-weight: 700; color: var(--accent-color); line-height: 1.2; }
.quiz-result .qr-label { font-size: .8rem; color: var(--text-muted); margin-bottom: 14px; }
.quiz-result .qr-msg { font-size: .9rem; margin-bottom: 18px; }

/* -------------------------------------------------------------------------
 * 第④章 読む順序
 * ---------------------------------------------------------------------- */
.order-step {
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  background: var(--glass-bg); margin-bottom: 12px; overflow: hidden;
}
.order-step .o-head {
  padding: 15px 17px; display: flex; align-items: center; gap: 13px;
  border-bottom: 1px solid var(--glass-border);
}
.order-step .o-num {
  flex: 0 0 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); border: 1px solid rgba(242,200,121,.45);
  color: var(--accent-color); font-weight: 700; font-size: .88rem;
}
.order-step .o-title { font-size: .98rem; font-weight: 700; flex: 1; }
.order-body { padding: 16px 17px; }
.order-body .ob-sec { margin-bottom: 14px; }
.order-body .ob-sec:last-child { margin-bottom: 0; }
.order-body .ob-label {
  display: inline-block; font-size: .68rem; letter-spacing: .1em; font-weight: 700;
  border-radius: 4px; padding: 2px 8px; margin-bottom: 6px;
}
.ob-label.point { color: var(--accent-color); border: 1px solid rgba(242,200,121,.4); }
.ob-label.why   { color: var(--violet);      border: 1px solid rgba(167,139,250,.4); }
.ob-label.yours { color: var(--harmony);     border: 1px solid rgba(126,226,168,.4); }
.order-body p { font-size: .88rem; margin: 0; }
.order-body .yours-text {
  background: rgba(126,226,168,.08); border-left: 3px solid var(--harmony);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 13px 15px;
}

/* -------------------------------------------------------------------------
 * 図を固定表示しながら読む
 * ---------------------------------------------------------------------- */
.read-with-chart { position: relative; }

.chart-sticky {
  position: sticky; top: 0; z-index: 8;
  margin: 0 -18px 14px; padding: 10px 18px 10px;
  background: rgba(8, 10, 24, .96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(242, 200, 121, .28);
}
.chart-sticky .cs-figure { display: flex; justify-content: center; }
.chart-sticky .cs-caption {
  font-size: .78rem; line-height: 1.6; color: var(--text-secondary);
  text-align: center; margin-top: 7px;
}
.chart-sticky .cs-caption b { color: var(--accent-color); margin-right: 4px; }
.chart-sticky .cs-chips { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.chart-sticky .cs-chips .chip {
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-muted); font-family: inherit; font-size: .78rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .18s;
}
.chart-sticky .cs-chips .chip.on {
  background: var(--accent-color); border-color: var(--accent-color); color: #16130a; font-weight: 700;
}

/* 図と吹き出し */
.chart-figure { position: relative; width: 100%; max-width: 300px; }
.chart-figure svg { width: 100%; height: auto; display: block; }
.chart-figure .cal {
  position: absolute; transform: translate(-50%, -50%);
  white-space: nowrap; pointer-events: none;
  font-size: .62rem; font-weight: 700; line-height: 1.5;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(10, 12, 28, .95);
  border: 1px solid rgba(242, 200, 121, .75);
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.chart-figure .cal.wide { font-size: .58rem; }
.chart-figure .cal.soft {
  border-color: rgba(255, 255, 255, .3); color: var(--text-secondary);
  background: rgba(10, 12, 28, .8);
}

/* 固定パネル内では図を小さめに */
.chart-sticky .chart-figure { max-width: 244px; }

/* いま読んでいるブロック */
.read-flow > .read-block,
.read-flow > .order-step { transition: border-color .25s, opacity .25s; }
.read-flow > .read-block { margin-bottom: 14px; }
.read-flow > .read-block.current { border-color: rgba(242, 200, 121, .5); }
.read-flow > .order-step.current { border-color: rgba(242, 200, 121, .5); }

@media (min-width: 700px) {
  .chart-sticky { display: flex; align-items: center; gap: 20px; }
  .chart-sticky .cs-figure { flex: 0 0 232px; }
  .chart-sticky .cs-caption { flex: 1; text-align: left; margin-top: 0; }
  .chart-sticky .cs-chips { position: absolute; right: 18px; bottom: 12px; margin: 0; }
}

/* 大きい画面（PC）ではホロスコープを大きく表示する */
@media (min-width: 1000px) {
  .app-wrapper { max-width: 900px; }
  .chart-sticky .cs-figure { flex: 0 0 320px; }
  .chart-sticky .chart-figure { max-width: 320px; }
  .wheel-wrap { max-width: 560px; }
}

/* 「読む順序（全体の地図）」「①チャート」の図は表示範囲の半分ほどまで大きく表示する */
#read-sync .chart-figure,
#chart-sync .chart-figure { max-width: 340px; }
@media (min-width: 700px) {
  #read-sync .chart-sticky,
  #chart-sync .chart-sticky { gap: 24px; }
  #read-sync .cs-figure,
  #chart-sync .cs-figure { flex: 1 1 50%; }
  #read-sync .chart-figure,
  #chart-sync .chart-figure { max-width: 400px; }
}
@media (min-width: 1000px) {
  #read-sync .cs-figure,
  #chart-sync .cs-figure { flex: 1 1 50%; }
  #read-sync .chart-figure,
  #chart-sync .chart-figure { max-width: 460px; }
}

/* -------------------------------------------------------------------------
 * ボトムナビ
 * ---------------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(8,10,24,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: transparent; border: 0; cursor: pointer;
  color: var(--text-muted); font-family: inherit; font-size: .64rem; font-weight: 600; padding: 0;
  transition: color .18s;
}
.tabbar button .t-glyph { font-size: 1.1rem; line-height: 1; }
.tabbar button.active { color: var(--accent-color); }

/* -------------------------------------------------------------------------
 * その他
 * ---------------------------------------------------------------------- */
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.disclaimer {
  margin-top: 24px; padding: 15px;
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm);
  background: rgba(0,0,0,.24); font-size: .74rem; line-height: 1.75; color: var(--text-muted);
}
.home-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05); border: 1px solid var(--glass-border);
  color: var(--text-primary); text-decoration: none; font-weight: 600; font-size: .86rem;
}
.home-link:hover { background: rgba(255,255,255,.13); }

@media (max-width: 420px) {
  .app-wrapper { padding: 15px 13px calc(var(--nav-h) + 34px); }
  .glass-container { padding: 17px; }
  .combo-picker { grid-template-columns: 1fr; }
}
