/* ブランド健康診断 — カルテ風の紙面。対象のブランド色は --brand / --brand-accent に入る */
:root {
  --ink: #1c1d1f;
  --ink-2: #4b4e53;
  --ink-3: #85898f;
  --line: #e3e1dc;
  --paper: #ffffff;
  --bg: #f3f2ee;
  --soft: #f8f7f4;
  --brand: #1c1d1f;
  --brand-accent: #2f6fd6;
  --measured: #1f7a4d;
  --estimated: #b26a00;
  --self: #5a4bc2;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.02em;
}
a { color: var(--brand-accent); }
p { margin: 0 0 0.6em; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0; letter-spacing: 0.03em; }

.page {
  max-width: 920px;
  margin: 24px auto 64px;
  padding: 40px 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* landing */
.landing { padding: 48px 0; max-width: 34rem; }
.landing h1 { font-size: 2rem; margin: 4px 0 16px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 600;
}

/* header */
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ink-3); }
.doc-head { border-bottom: 2px solid var(--brand); padding-bottom: 20px; }
.doc-meta { display: flex; gap: 8px; align-items: center; }
.status { font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 4px; background: #fdecc8; color: #7a4b00; }
.status.sample { background: #e8e6f8; color: #43369c; }
.doc-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 6px 0 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 0 0 14px; font-size: 0.88rem; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.toc { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; }
.toc a { text-decoration: none; }

.scope { margin: 20px 0 8px; padding: 14px 16px; background: var(--soft); border-radius: var(--radius); font-size: 0.86rem; color: var(--ink-2); }
.legend { margin: 0; line-height: 2.1; }

/* chips / grades */
.chip { display: inline-block; font-size: 0.68rem; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 4px; border: 1px solid currentColor; vertical-align: middle; white-space: nowrap; }
.b-measured { color: var(--measured); }
.b-estimated { color: var(--estimated); }
.b-self { color: var(--self); }
.unmeasured { display: inline-block; white-space: nowrap; font-size: 0.72rem; font-weight: 700; color: var(--ink-3); border: 1px dashed var(--ink-3); border-radius: 4px; padding: 2px 7px; line-height: 1.4; }
.grade { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-size: 1.35rem; font-weight: 800; color: #fff; }
.g-S { background: #1f7a4d; } .g-A { background: #3a9a6a; } .g-B { background: #8a9a3a; }
.g-C { background: #c88a1a; } .g-D { background: #c0493a; }
.g-none { background: #fff; color: var(--ink-3); border: 1px dashed var(--ink-3); }

/* parts & sections */
.part { margin-top: 44px; }
.part > h2 { font-size: 1.45rem; display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.part-no { font-size: 0.8rem; font-weight: 800; color: #fff; background: var(--brand); padding: 2px 10px; border-radius: 999px; }
.sec { margin-top: 32px; }
.sec h3 { font-size: 1.08rem; display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; }
.num { font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.label { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); letter-spacing: 0.06em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--ink-3); }
.small { font-size: 0.82rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--paper); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.76rem; color: var(--ink-3); font-weight: 700; }
td.val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.src { color: var(--ink-3); font-size: 0.8rem; }
.photos td:first-child { white-space: nowrap; font-weight: 700; }

/* checks */
.checks { display: grid; gap: 14px; }
.check { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.check header { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.check header > div { flex: 1; }
.check-no { font-size: 0.72rem; color: var(--ink-3); margin: 0; font-weight: 700; }
.check h4 { font-size: 1rem; }
.check-q { font-size: 0.82rem; color: var(--ink-3); }
.gap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.gap > div { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 0.88rem; }
.gap p { margin: 0; }
.gap .gap-h { font-size: 0.72rem; font-weight: 700; color: var(--ink-3); }
.evidence { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.82rem; color: var(--ink-2); }

/* persona */
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.archetype { font-size: 1.5rem; font-weight: 800; margin: 4px 0 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.archetype .x { color: var(--ink-3); font-weight: 400; }
.archetype .sub { color: var(--ink-2); }
.radar { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.radar .grid { fill: none; stroke: var(--line); }
.radar .axis { stroke: var(--line); }
.radar .shape { fill: color-mix(in srgb, var(--brand-accent) 22%, transparent); stroke: var(--brand-accent); stroke-width: 2; }
.radar .dot { fill: var(--brand-accent); }
.radar .r-label { font-size: 11px; fill: var(--ink-2); }
.bars { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 0.84rem; }
.bars li { display: grid; grid-template-columns: 5.5em 1fr auto auto; gap: 8px; align-items: center; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.fill { display: block; height: 100%; background: var(--brand-accent); }
.bar-val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bar-note { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ink-3); margin-top: -4px; }

/* concept */
.statement { margin: 0 0 18px; padding: 18px 20px; border-left: 4px solid var(--brand-accent); background: var(--soft); font-size: 1.1rem; font-weight: 700; line-height: 1.8; border-radius: 0 var(--radius) var(--radius) 0; }
.copies { margin: 0 0 14px; padding-left: 1.4em; font-size: 1.05rem; font-weight: 700; }
.copies li { margin-bottom: 4px; }
.lead { color: var(--ink-2); }
.persona-card { margin-bottom: 12px; }
.psycho { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ladder */
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rung { border-radius: var(--radius); padding: 14px 18px; border: 1px solid var(--line); }
.rung.r2 { margin-left: 4%; }
.rung.r3 { margin-left: 8%; border-color: var(--brand-accent); }
.rung-h { font-weight: 800; margin-bottom: 4px; }
.rung-h span { font-weight: 400; font-size: 0.8rem; color: var(--ink-3); margin-left: 8px; }

/* diagrams */
.diagram { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.diagram figcaption { font-weight: 800; margin-bottom: 12px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; counter-reset: f; }
.flow li { position: relative; padding: 10px 14px 10px 44px; background: var(--soft); border-radius: 8px; counter-increment: f; }
.flow li::before { content: counter(f); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); color: #fff; font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 22px; bottom: -18px; border: 6px solid transparent; border-top: 8px solid var(--ink-3); }
.flow li.last { background: color-mix(in srgb, var(--brand-accent) 12%, #fff); font-weight: 700; }
.flow li.last::before { background: var(--brand-accent); }
.stairs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.stairs li { border: 1px solid var(--line); border-top: 4px solid var(--brand-accent); border-radius: 8px; padding: 12px 14px; }
.stairs li:nth-child(2) { margin-bottom: 14px; }
.stairs li:nth-child(3) { margin-bottom: 28px; }
.stairs li:nth-child(4) { margin-bottom: 42px; }
.stair-no { display: block; font-size: 0.7rem; font-weight: 800; color: var(--brand-accent); }
.stairs p { font-size: 0.84rem; color: var(--ink-2); margin: 4px 0 0; }
.matrix { width: 100%; max-width: 520px; display: block; margin: 0 auto; }
.m-frame { fill: var(--soft); stroke: var(--line); }
.m-axis { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.m-label { font-size: 10.5px; fill: var(--ink-3); font-weight: 700; }
.m-dot { fill: var(--ink-3); }
.m-self { fill: var(--brand-accent); }
.m-name { font-size: 10.5px; fill: var(--ink-2); }
.m-name.self { font-weight: 800; fill: var(--ink); font-size: 12px; }

/* tone */
.tone { display: grid; gap: 18px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: 0.88rem; }
.swatches { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.swatches li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; }
.sw { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: repeating-linear-gradient(45deg, #fff 0 4px, #eee 4px 8px); }
.ratio { display: flex; height: 30px; border-radius: 6px; overflow: hidden; font-size: 0.76rem; font-weight: 700; margin-bottom: 6px; }
.seg { display: grid; place-items: center; color: #fff; white-space: nowrap; overflow: hidden; }
.seg.s0 { background: var(--brand); } .seg.s1 { background: var(--brand-accent); } .seg.s2 { background: var(--ink-3); }

.doc-foot { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-3); }

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .page { margin: 0; padding: 24px 16px 40px; border: 0; border-radius: 0; }
  .two, .persona-grid, .psycho, .gap { grid-template-columns: 1fr; }
  .rung.r2, .rung.r3 { margin-left: 0; }
  .stairs li:nth-child(n) { margin-bottom: 0; }
}

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; }
  .page { margin: 0; padding: 0; border: 0; max-width: none; }
  .toc { display: none; }
  .part#sheet { break-before: page; }
  .check, .card, .diagram, .rung, tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
