:root {
  --color-navy: #1c2b45;
  --color-primary: #2451c9;
  --color-primary-dark: #16337f;
  --color-accent: #c9821b;
  --color-bg: #ffffff;
  --color-card: #ffffff;
  --color-border: #c3c9d4;
  --color-border-soft: #e3e7ee;
  --color-text: #2c313a;
  --color-muted: #838a97;
  --color-danger: #d3273f;
  --color-good: #2451c9;
  --color-soft-bg: #f4f6fa;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(28, 43, 69, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

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

/* ---- アプリシェル(左サイドバー + 上部バー) ---- */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.app-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  padding: 20px 0 16px;
}

.app-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-navy);
  text-decoration: none;
}

.app-sidebar .logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
}

.app-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 7px;
  border-left: 3px solid transparent;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
}

.app-sidebar nav a:hover { background: var(--color-soft-bg); }
.app-sidebar nav a.active {
  background: var(--color-soft-bg);
  color: var(--color-primary);
  font-weight: 700;
  border-left-color: var(--color-primary);
}

.app-sidebar .nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.app-sidebar .nav-icon svg { width: 100%; height: 100%; display: block; }

.app-sidebar .sidebar-user {
  margin-top: auto;
  padding: 14px 20px 0;
  border-top: 1px solid var(--color-border-soft);
  font-size: 12px;
  color: var(--color-muted);
}
.app-sidebar .sidebar-user .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--color-border-soft);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.app-topbar .topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--color-navy);
}

.app-topbar .title-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-topbar .title-icon svg { width: 18px; height: 18px; display: block; }

.app-topbar .topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-muted);
  font-size: 13px;
}

.context-bar {
  background: var(--color-soft-bg);
  border-bottom: 1px solid var(--color-border-soft);
  padding: 8px 24px;
  font-size: 13px;
  color: var(--color-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.context-bar strong { color: var(--color-text); }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 4px;
  color: var(--color-navy);
}
.page-sub {
  color: var(--color-muted);
  font-size: 13px;
  margin: 0 0 20px;
}

/* ---- カード ---- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 16px;
  margin: 0 0 14px;
  color: var(--color-navy);
  border-left: 4px solid var(--color-primary);
  padding-left: 10px;
}
.card h3 {
  font-size: 14px;
  margin: 18px 0 8px;
  color: var(--color-primary-dark);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---- フォーム ---- */
label { display: block; font-size: 13px; color: var(--color-muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--color-primary-dark); }
.btn.secondary { background: #fff; color: var(--color-primary); }
.btn.secondary:hover { background: var(--color-soft-bg); }
.btn.danger { background: #fff; color: var(--color-danger); border-color: var(--color-danger); }
.btn.danger:hover { background: #fff0eb; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- テーブル ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--color-border-soft); text-align: left; vertical-align: top; }
th { color: var(--color-muted); font-weight: 600; background: var(--color-soft-bg); }
tr:hover td { background: #fafafa; }

/* ---- バッジ・ランク ---- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-soft-bg);
  color: var(--color-muted);
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: var(--color-muted);
}
/* ランクA(良)〜E(要改善)を青→グレー→赤のグラデーションで表現 */
.rank-S { background: #2451c9; }
.rank-A { background: #2451c9; }
.rank-B { background: #5c7cd6; }
.rank-C { background: #3d4a5c; }
.rank-D { background: #e0293f; }
.rank-E { background: #d3273f; }

.priority-高 { color: #d3273f; font-weight: 700; }
.priority-中 { color: #d9647a; font-weight: 700; }
.priority-低 { color: #5c7cd6; font-weight: 700; }
.priority-継続 { color: #2451c9; font-weight: 700; }

.gap-neg { color: var(--color-danger); font-weight: 700; }
.gap-pos { color: var(--color-good); font-weight: 700; }

.muted { color: var(--color-muted); }
.small { font-size: 12px; }
.empty-msg { color: var(--color-muted); padding: 24px; text-align: center; }

/* ---- スコアサマリー ---- */
.score-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.score-hero .score-num { font-size: 48px; font-weight: 800; color: var(--color-navy); }
.score-hero .score-num small { font-size: 16px; color: var(--color-muted); font-weight: 400; }

/* ---- 進捗バー ---- */
.progress-bar {
  height: 8px;
  background: var(--color-soft-bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  background: var(--color-primary);
}

/* ---- 5段階評価 ---- */
.scale-question { padding: 14px 0; border-bottom: 1px solid var(--color-border-soft); }
.scale-question .qtext { font-size: 14px; margin-bottom: 8px; }
.scale-options { display: flex; gap: 8px; flex-wrap: wrap; }
.scale-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border-soft);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  margin: 0;
}
.scale-options input { margin: 0; }
.scale-options label.checked { border-color: var(--color-primary); background: #e6e6ff; color: var(--color-primary-dark); }

/* WHY(対極言葉ペア)設問用のスライダー */
.spectrum-slider-row { display: flex; align-items: center; gap: 12px; }
.spectrum-pole { font-size: 14px; font-weight: 700; color: var(--color-navy); flex-shrink: 0; white-space: nowrap; }
.spectrum-pole-left { text-align: right; }
.spectrum-slider-row input[type=range] { flex: 1; accent-color: var(--color-primary); height: 6px; }
.spectrum-value-label { margin-top: 6px; font-size: 12px; color: var(--color-muted); text-align: center; }
.spectrum-value-label span { font-weight: 700; color: var(--color-primary-dark); }

.cat-heading {
  margin: 26px 0 4px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-navy);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
}
.sub-heading { color: var(--color-muted); font-size: 12px; margin: 12px 0 -4px; }

/* ---- 棒グラフ(部署別・カテゴリ別ランキング等) ---- */
.bar-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.bar-row .bar-label { width: 190px; font-size: 14px; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; height: 16px; background: var(--color-soft-bg); border-radius: 999px; overflow: hidden; position: relative; }
.bar-row .bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; }
.bar-row .bar-value { width: 52px; text-align: right; font-size: 15px; font-weight: 700; flex-shrink: 0; }

/* 5点満点バーの1〜4の目盛り線(値の目測用)。塗り部分の上にも透過線で重ねて表示する */
.bar-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45); z-index: 2; }

/* ダッシュボードのWHY/HOW/WHAT(3列並び)は横幅が狭く、固定190pxのラベル幅だとバー本体がほぼ0pxまで
   潰れて目盛り線だけが密集して見えてしまう。ラベル幅を可変にしてバー本体の表示幅を確保する。 */
#whw-detail .bar-row { gap: 6px; margin: 6px 0; }
#whw-detail .bar-row .bar-label { width: auto; flex: 0 1 84px; font-size: 12px; }
#whw-detail .bar-row .bar-value { width: 28px; font-size: 13px; }

.report-page-body .bar-row { margin: 6px 0; }
.report-page-body .bar-row .bar-label { font-size: 13px; width: 170px; }

/* 幅の狭いカード内(サマリーページの「とくに弱い項目」等)用: ラベルを上、バー+数値を下に積む */
.bar-row-compact { margin: 2px 0; line-height: 1.15; }
.bar-row-compact .bcr-label { font-size: 12px; color: var(--color-text); margin-bottom: 2px; line-height: 1.15; }
.bar-row-compact .bcr-track-row { display: flex; align-items: center; gap: 8px; line-height: 1; }
.bar-row-compact .bcr-track-row .bar-track { flex: 1; height: 11px; background: var(--color-soft-bg); border-radius: 999px; overflow: hidden; min-width: 0; position: relative; }
.bar-row-compact .bcr-track-row .bar-fill { height: 100%; border-radius: 999px; }
.bar-row-compact .bcr-value { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--color-text); line-height: 1; }
.bar-row-compact .bcr-value small { font-size: 11px; font-weight: 400; color: var(--color-muted); }

.gap-table td.gap-cell { font-weight: 700; text-align: center; }

footer.app-footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 12px;
  padding: 24px;
}

.no-print { }

/* ==================== 診断レポート (A4横1ページ完結レイアウト) ==================== */
@page {
  size: A4 landscape;
  margin: 10mm;
}

#report-container {
  max-width: 1180px;
  margin: 0 auto;
}

.report-page {
  background: #fff;
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 297 / 210;
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-page-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 18px 34px 12px;
  border-bottom: 3px solid var(--color-navy);
}
.report-page-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--color-navy);
  white-space: nowrap;
}
.report-page-head .rp-sub {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--color-navy);
  padding: 3px 12px;
  border-radius: 999px;
  margin-top: 5px;
  line-height: 1.5;
  max-width: 660px;
}
.report-page-head .rp-meta {
  font-size: 13px;
  color: var(--color-muted);
  text-align: right;
  white-space: nowrap;
  line-height: 1.5;
}

.report-page-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 34px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.6;
}
.report-page-body h3 { font-size: 15px; margin: 0 0 9px; font-weight: 700; }
.report-page-body table { font-size: 14px; }
.report-page-body th, .report-page-body td { padding: 8px 10px; }
.report-page-body ul, .report-page-body ol { margin: 6px 0; padding-left: 20px; }
.report-page-body li { margin-bottom: 5px; }
.report-page-body .empty-msg { padding: 10px; font-size: 14px; }

/* サマリーページ以外(詳細ページ)は内容量が少なく余白が目立つため、文字を大きめ・行間広めにして紙面を活かす。
   項目数が多いページ(WHY/HOW詳細)は控えめに、項目数が少なく余白が大きいページはさらに拡大する(loose-fill-xl)。 */
.report-page-body.loose-fill { font-size: 16px; line-height: 1.75; letter-spacing: 0.01em; }
.report-page-body.loose-fill h3 { font-size: 16px; margin: 0 0 10px; }
.report-page-body.loose-fill table { font-size: 15px; }
.report-page-body.loose-fill th, .report-page-body.loose-fill td { padding: 10px 12px; }
.report-page-body.loose-fill ul, .report-page-body.loose-fill ol { margin: 8px 0; }
.report-page-body.loose-fill li { margin-bottom: 7px; }
.report-page-body.loose-fill .empty-msg { font-size: 15px; padding: 12px; }
.report-page-body.loose-fill .small { font-size: 14px; }
.report-page-body.loose-fill .report-mini-card h3 { font-size: 15px; }
.report-page-body.loose-fill .report-mini-card { padding: 14px 16px; }
.report-page-body.loose-fill .bar-row { margin: 10px 0; }
.report-page-body.loose-fill .bar-row .bar-label { font-size: 15px; width: 195px; }
.report-page-body.loose-fill .bar-row .bar-track { height: 17px; }
.report-page-body.loose-fill .bar-row .bar-value { font-size: 16px; width: 54px; }

.report-page-body.loose-fill-xl { font-size: 18px; line-height: 2; letter-spacing: 0.02em; }
.report-page-body.loose-fill-xl h3 { font-size: 18px; margin: 0 0 14px; }
.report-page-body.loose-fill-xl table { font-size: 17px; }
.report-page-body.loose-fill-xl th, .report-page-body.loose-fill-xl td { padding: 14px 16px; }
.report-page-body.loose-fill-xl li { margin-bottom: 11px; }
.report-page-body.loose-fill-xl .empty-msg { font-size: 17px; padding: 16px; }
.report-page-body.loose-fill-xl .small { font-size: 16px; }
.report-page-body.loose-fill-xl .report-mini-card h3 { font-size: 17px; }
.report-page-body.loose-fill-xl .report-mini-card { padding: 18px 20px; }
.report-page-body.loose-fill-xl .bar-row { margin: 14px 0; }
.report-page-body.loose-fill-xl .bar-row .bar-label { font-size: 17px; width: 230px; }
.report-page-body.loose-fill-xl .bar-row .bar-track { height: 21px; }
.report-page-body.loose-fill-xl .bar-row .bar-value { font-size: 19px; width: 64px; }

/* 個別設問一覧ページ(136問の詳細)用: 行数が多いため密度高めで、それでもバーの到達度がはっきりわかるサイズにする。
   1列あたりの行数はページごとに異なるため、行の高さは --bcr-* カスタムプロパティで動的に指定し、
   ページ内の余白ができるだけ均等に(埋まるように)なるよう調整する。 */
.report-page-body.qdense { font-size: 14px; line-height: 1.35; }
.report-page-body.qdense h3 { font-size: 15px; margin: 0 0 8px; }
.report-page-body.qdense .small { font-size: 13px; }
.report-page-body.qdense li { margin-bottom: 3px; }
.report-page-body.qdense .report-mini-card { padding: 10px 12px; }
.report-page-body.qdense .report-mini-card h3 { font-size: 14px; margin-bottom: 6px; }
.report-page-body.qdense .bar-row-compact { margin: 0; padding: var(--bcr-margin, 4px) 0; line-height: 1.15; }
.report-page-body.qdense .bar-row-compact .bcr-label { font-size: var(--bcr-label-size, 13px); margin-bottom: 2px; }
.report-page-body.qdense .bar-row-compact .bcr-track-row .bar-track { height: var(--bcr-track-h, 12px); }
.report-page-body.qdense .bar-row-compact .bcr-value { font-size: var(--bcr-label-size, 13px); }

.report-page-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 34px 14px;
  font-size: 12px;
  color: var(--color-muted);
}

.report-cover .report-page-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: visible;
}

/* WHATクラスター型ビュー: 中分類ヘッダー+個別設問バーのブロック(1ページに多数のブロックを詰めるため、行の高さを直接固定値で圧縮する) */
.what-cluster-block { padding: 2px 0; border-bottom: 1px solid var(--color-border-soft); }
.what-cluster-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1px; }
.what-cluster-name { font-size: 12px; font-weight: 700; color: var(--color-navy); }
.what-cluster-score { font-size: 13px; font-weight: 800; color: var(--color-navy); }
.what-cluster-score small { font-size: 9px; font-weight: 400; color: var(--color-muted); }
.report-page-body.qdense .what-cluster-block .bar-row-compact { margin: 0; padding: 1px 0; line-height: 1.1; }
.report-page-body.qdense .what-cluster-block .bar-row-compact .bcr-label { font-size: 10px; margin-bottom: 1px; }
.report-page-body.qdense .what-cluster-block .bar-row-compact .bcr-track-row .bar-track { height: 7px; }
.report-page-body.qdense .what-cluster-block .bar-row-compact .bcr-value { font-size: 10px; }

/* HOW詳細ページ: 理念の統一/行動の統一/視覚の統一の3グループブロック */
.how-group-block { margin-bottom: 2px; padding-bottom: 1px; border-bottom: 1px solid var(--color-border-soft); }
.how-group-block table { font-size: 11px; }
.how-group-block th, .how-group-block td { padding: 0 6px; line-height: 1.2; }
.how-group-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.how-group-name { font-size: 13px; font-weight: 700; color: var(--color-navy); }
.how-group-score { font-size: 15px; font-weight: 800; color: var(--color-navy); }
.how-group-score small { font-size: 9px; font-weight: 400; color: var(--color-muted); }

.grid-report-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-report-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.report-mini-card {
  border: none;
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--color-soft-bg);
}
.report-mini-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-navy);
  border-bottom: 1px solid var(--color-border-soft);
  padding-bottom: 5px;
}

.gap-visual {
  display: inline-block;
  width: 70px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-soft-bg);
  position: relative;
  vertical-align: middle;
  margin-right: 6px;
}
.gap-visual .gap-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
}
/* ギャップがマイナス(左)かプラス(右)かを判断する基準の0の位置を示すマーク */
.gap-visual .gap-zero-tick {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--color-text);
  transform: translateX(-1px);
}

/* 余白に余裕があるページ用: 0の位置に「0」の文字ラベルを直接表示する */
.gap-visual.gap-visual-lg {
  width: 92px;
  height: 15px;
  display: inline-flex;
  align-items: center;
}
.gap-visual .gap-zero-label {
  position: relative;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  background: #fff;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px var(--color-border-soft);
}

/* WHY(対極言葉ペア)の理想・現実 蝶々型(butterfly)比較チャート:
   中央0を基準に理想(紺)・現実(青)の棒を左右へ伸ばし、中央の破線+矢印は測定器の目盛りを模す。 */
.spectrum-pair { margin: 3px 0; }
.spectrum-pair-poles { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--color-navy); margin-bottom: 3px; }
.spectrum-bfly-track { position: relative; height: 13px; background: var(--color-soft-bg); border-radius: 2px; margin: 1px 0; }
.spectrum-bfly-center {
  position: absolute;
  left: 50%; top: -3px; bottom: -3px;
  width: 0;
  border-left: 1px dashed var(--color-muted);
  transform: translateX(-0.5px);
}
.spectrum-bfly-center::before, .spectrum-bfly-center::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}
.spectrum-bfly-center::before { top: -4px; border-bottom: 4px solid var(--color-muted); }
.spectrum-bfly-center::after { bottom: -4px; border-top: 4px solid var(--color-muted); }
.spectrum-bfly-bar { position: absolute; height: 5px; border-radius: 1px; }
.spectrum-bfly-bar-ideal { top: 1px; background: var(--color-navy); }
.spectrum-bfly-bar-real { top: 7px; background: var(--color-primary); }
.spectrum-bfly-scale { display: flex; justify-content: space-between; font-size: 9px; color: var(--color-muted); margin-bottom: 2px; }
.spectrum-bfly-scale-zero { font-weight: 700; color: var(--color-text); }
.spectrum-pair-legend { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; }
.spectrum-pair-legend .spectrum-legend-ideal { color: var(--color-navy); }
.spectrum-pair-legend .spectrum-legend-real { color: var(--color-primary); }

/* WHYレポートページ: 対極言葉ペア20軸を1項目ずつカード表示する */
.why-axis-card { padding: 3px 0; border-bottom: 1px solid var(--color-border-soft); }
.why-axis-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.why-axis-num { font-size: 11px; color: var(--color-muted); font-weight: 700; flex-shrink: 0; }
.why-axis-name { font-size: 13px; font-weight: 700; color: var(--color-navy); flex: 1; }
.why-axis-score { font-size: 15px; font-weight: 800; color: var(--color-navy); flex-shrink: 0; }
.why-axis-score small { font-size: 10px; font-weight: 400; color: var(--color-muted); }

.truncate-note { color: var(--color-muted); font-size: 11px; font-style: italic; }

/* 前回比バッジ(BRAND SCORE/WHY/HOW/WHATの大きい数字の下・横に添える差分表示)。
   薄い色背景+太字数値のピル形状で、改善/悪化を色とアイコンの両方で示す。 */
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.trend-chip-up { background: #e7edfa; color: var(--color-primary); }
.trend-chip-down { background: #fbe9ec; color: var(--color-danger); }
.trend-chip-flat { background: var(--color-soft-bg); color: var(--color-muted); }

/* 順位バッジ(強み・課題・弱点リストの上位N件に付ける丸数字)。青=好調(強み上位) / 赤=不調(課題・弱点上位) */
.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-right: 4px;
}
.rank-chip-good { background: var(--color-primary); }
.rank-chip-bad { background: var(--color-danger); }

/* ==================== 印刷 (PDFレポート出力) ==================== */
@media print {
  .app-sidebar, .app-topbar, .context-bar, .no-print, footer.app-footer { display: none !important; }
  .app-shell { display: block; }
  .app-content { display: block; }
  body { background: #fff; }
  main { max-width: none; padding: 0; margin: 0; }
  #report-container { max-width: none; }
  .report-page {
    box-shadow: none;
    border: none;
    aspect-ratio: auto;
    height: 186mm;
    page-break-after: always;
    page-break-inside: avoid;
  }
  .report-page:last-child { page-break-after: auto; }
  a { color: inherit; text-decoration: none; }
}
