/* =========================================================
   AI検索・SEO 診断 — 「診断票」をメタファーにした画面設計
   色は dataviz の検証済みパレット（categorical / status）を使用
   ========================================================= */

:root {
  /* 面と文字 */
  --ink: #0b1b2b;
  --ink-2: #35485c;
  --muted: #6b7c8d;
  --paper: #edf1f5;
  --card: #ffffff;
  --rule: #d8e0e8;
  --rule-2: #eef2f6;

  /* データ色（検証済み・順序固定） */
  --self: #1b5cc4;
  --comp-1: #0e8f6e;
  --comp-2: #8e4ec6;
  --comp-3: #d4622a;
  --neutral: #94a3b4;

  /* 状態色（必ずマーク・ラベルと併記する） */
  --ok: #157f4f;
  --warn: #c9a227;
  --ng: #c0392b;

  /* アクセント（指摘・行動） */
  --accent: #d4622a;
  --accent-dark: #b34e1d;

  --shell: 1120px;
  --radius: 4px;

  --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-data: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.4; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow--light { color: #7f9ec4; }

.br-sp { display: none; }

/* ---------- topbar ---------- */
.topbar { background: var(--ink); color: #fff; }
.topbar__inner {
  max-width: var(--shell); margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 10px;
}
.topbar__mark { color: var(--accent); font-size: 13px; }
.topbar__name { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.topbar__meta {
  margin-left: auto; font-family: var(--font-data);
  font-size: 11px; letter-spacing: .1em; color: #7f9ec4;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
/* 方眼 = 計測のメタファー。控えめに */
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; padding: 72px 24px 76px; max-width: 860px; }
.hero__title {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.hero__title em {
  font-style: normal;
  white-space: nowrap;
  color: var(--accent);
  border-bottom: 3px solid rgba(212,98,42,.45);
  padding-bottom: 2px;
}
.hero__lead { margin: 0 0 34px; max-width: 620px; color: #b9c8d8; font-size: 15px; }

/* ---------- form ---------- */
.form__main { display: flex; gap: 12px; align-items: flex-end; }
.form__field { display: block; flex: 1; min-width: 0; }
.form__field--inline { flex: 0 0 auto; }
.form__caption {
  display: block; margin-bottom: 6px;
  font-family: var(--font-data); font-size: 10px; letter-spacing: .18em;
  color: #7f9ec4; text-transform: uppercase;
}
.form__input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-family: var(--font-data);
  font-size: 16px;
}
.form__input::placeholder { color: #6f88a3; }
.form__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: rgba(255,255,255,.1); }
.form__input--sm { padding: 10px 12px; font-size: 14px; }

.btn {
  display: inline-block;
  border: 0; border-radius: var(--radius);
  padding: 15px 32px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, transform .15s;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn:disabled { background: #3a4d61; cursor: progress; }
.form__submit { flex: 0 0 auto; }

.form__extra { display: flex; align-items: flex-end; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.form__select {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-family: var(--font-body); font-size: 14px;
}
.form__select option { color: var(--ink); }
.form__details { padding-bottom: 4px; }
.form__summary { font-size: 13px; color: #9fc0e4; cursor: pointer; }
.form__summary:hover { color: #fff; }
.form__competitors { display: grid; gap: 8px; margin-top: 12px; max-width: 420px; }
.form__note { margin: 22px 0 0; font-size: 12px; color: #7f92a6; line-height: 1.9; }

/* ---------- scan（進行中） ---------- */
.scan { padding: 56px 0 64px; }
.scan__list { list-style: none; margin: 0 auto; padding: 0; max-width: 460px; }
.scan__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  font-size: 14px; color: var(--muted);
  border-bottom: 1px solid var(--rule-2);
}
.scan__item--done { color: var(--ink); }
.scan__item--active { color: var(--ink); font-weight: 700; }
.scan__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--rule);
}
.scan__item--done .scan__dot { background: var(--ok); }
.scan__item--active .scan__dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }

.error {
  margin: 32px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--ng);
  background: #fff;
  color: var(--ng);
  font-size: 14px;
}

/* ---------- report ---------- */
.report { padding: 40px 0 72px; }

.slip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
  background: var(--card);
  margin-bottom: 20px;
}
.slip__item { padding: 12px 16px; border-right: 1px solid var(--rule); min-width: 0; }
.slip__item:last-child { border-right: 0; }
.slip__key {
  display: block; font-family: var(--font-data);
  font-size: 10px; letter-spacing: .18em; color: var(--muted);
}
.slip__val {
  display: block; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
}
.card__head { margin-bottom: 26px; }
.card__title { margin: 0 0 8px; font-size: 21px; font-weight: 900; }
.card__lead { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 720px; }
.card__note { margin: 18px 0 0; font-size: 12px; color: var(--muted); line-height: 1.9; }

/* ---------- verdict ---------- */
.verdict { display: flex; gap: 44px; align-items: center; flex-wrap: wrap; }
.verdict__gauge { flex: none; }
.verdict__body { flex: 1; min-width: 280px; }
.verdict__grade { margin: 0 0 8px; font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
.verdict__comment { margin: 0 0 24px; font-size: 15px; color: var(--ink-2); }
.verdict__subs { display: grid; gap: 18px; }

.submeter__head { display: flex; align-items: baseline; gap: 10px; }
.submeter__name { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.submeter__desc { font-size: 12px; color: var(--muted); }
.submeter__val { margin-left: auto; font-family: var(--font-data); font-weight: 700; font-size: 20px; }
.submeter__val small { font-size: 11px; color: var(--muted); font-weight: 400; }
.submeter__track { height: 10px; background: var(--rule-2); margin-top: 8px; border-radius: 2px; overflow: hidden; }
.submeter__fill { height: 100%; border-radius: 0 2px 2px 0; transition: width 1s cubic-bezier(.2,.7,.3,1); }

.gauge__value { font-family: var(--font-data); font-weight: 700; font-size: 52px; fill: var(--ink); }
.gauge__unit { font-family: var(--font-data); font-size: 12px; fill: var(--muted); }

/* ---------- radar ---------- */
.radar { display: grid; grid-template-columns: minmax(300px, 460px) 1fr; gap: 40px; align-items: center; }
.radar__chart { min-width: 0; }
.radar__side { min-width: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.legend__item { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }

.axislist { list-style: none; margin: 0; padding: 0; }
.axislist__item {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--rule-2);
  font-size: 13px;
}
.axislist__item:last-child { border-bottom: 0; }
.axislist__name { color: var(--ink-2); }
.axislist__area { font-family: var(--font-data); font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.axislist__score { font-family: var(--font-data); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- bars ---------- */
.bars { display: grid; gap: 2px; }
.bar {
  display: grid; grid-template-columns: 190px 1fr 54px;
  gap: 16px; align-items: center;
  padding: 9px 0;
}
.bar--self .bar__name { font-weight: 700; }
.bar__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__sub { display: block; font-family: var(--font-data); font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.bar__track { height: 14px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 0 3px 3px 0; transition: width .9s cubic-bezier(.2,.7,.3,1); }
.bar__val { font-family: var(--font-data); font-weight: 700; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.bar--fail .bar__val { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------- kpi ---------- */
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 32px; }
.kpi__card { background: var(--card); padding: 20px 22px; }
.kpi__label { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.kpi__value { margin: 0; font-family: var(--font-data); font-weight: 700; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__value small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi__note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.kpi__card--gain .kpi__value { color: var(--accent); }

/* ---------- forecast chart ---------- */
.fcgroup { margin-bottom: 22px; }
.fcgroup__label { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; font-weight: 500; }
.fcgroup__unit { color: var(--muted); font-size: 11px; font-weight: 400; }
.fcrow { display: grid; grid-template-columns: 92px 1fr 132px; gap: 14px; align-items: center; padding: 5px 0; }
.fcrow__key { font-size: 12px; color: var(--muted); }
.fcrow__track { height: 18px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.fcrow__fill { height: 100%; border-radius: 0 3px 3px 0; transition: width .9s cubic-bezier(.2,.7,.3,1); }
.fcrow__val { font-family: var(--font-data); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fcrow__val strong { font-weight: 700; }
.fcrow__val span { color: var(--muted); font-size: 11px; }

/* ---------- keyword table ---------- */
.table-wrap { overflow-x: auto; }
.kw { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
.kw th {
  text-align: left; padding: 0 12px 10px; border-bottom: 1px solid var(--ink);
  font-family: var(--font-data); font-size: 10px; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap; font-weight: 500;
}
.kw td { padding: 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.kw tbody tr:hover { background: #f7fafc; }
.kw__query { font-weight: 700; }
.kw__vol { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.kw__volbar { width: 58px; height: 7px; background: #e6ecf3; border-radius: 2px; overflow: hidden; flex: none; }
.kw__volfill { height: 100%; background: var(--self); border-radius: 0 2px 2px 0; opacity: .72; }
.num { text-align: right; white-space: nowrap; font-family: var(--font-data); font-variant-numeric: tabular-nums; }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; white-space: nowrap; border: 1px solid;
}
.chip--intent { border-color: var(--rule); color: var(--ink-2); }
.chip--ok { border-color: rgba(21,127,79,.35); color: var(--ok); background: rgba(21,127,79,.06); }
.chip--warn { border-color: rgba(201,162,39,.4); color: #8a6f14; background: rgba(201,162,39,.08); }
.chip--ng { border-color: rgba(192,57,43,.3); color: var(--ng); background: rgba(192,57,43,.05); }

.delta { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.delta__now { color: var(--muted); }
.delta__arrow { color: var(--rule); margin: 0 5px; }
.delta__after { font-weight: 700; }

/* ---------- categories ---------- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.catgroup__title {
  margin: 0 0 4px; font-size: 15px; font-weight: 900;
  display: flex; align-items: baseline; gap: 10px;
}
.catgroup__score { margin-left: auto; font-family: var(--font-data); font-size: 15px; }
.catgroup__desc { margin: 0 0 18px; font-size: 12px; color: var(--muted); }

.cat { padding: 12px 0; border-top: 1px solid var(--rule-2); }
.cat__head { display: flex; align-items: baseline; gap: 10px; }
.cat__name { font-size: 13px; font-weight: 500; }
.cat__score { margin-left: auto; font-family: var(--font-data); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cat__score small { color: var(--muted); font-weight: 400; }
.cat__track { height: 6px; background: var(--rule-2); margin-top: 7px; border-radius: 2px; overflow: hidden; }
.cat__fill { height: 100%; border-radius: 0 2px 2px 0; transition: width .9s cubic-bezier(.2,.7,.3,1); }
.cat__toggle {
  margin-top: 8px; font-family: var(--font-data); font-size: 11px;
  letter-spacing: .1em; color: var(--self); cursor: pointer;
}
.cat__toggle:hover { color: var(--accent); }

.checks { list-style: none; margin: 10px 0 4px; padding: 0; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); font-size: 12px; }
.check:last-child { border-bottom: 0; }
.check__mark { font-weight: 700; line-height: 1.7; }
.check__mark--ok { color: var(--ok); }
.check__mark--warn { color: var(--warn); }
.check__mark--ng { color: var(--ng); }
.check__mark--ref { color: var(--muted); }
.check__label { font-weight: 500; }
.check__detail { color: var(--muted); }
.check__fix { color: var(--accent-dark); }

/* ---------- fixes ---------- */
.fixes { list-style: none; margin: 0; padding: 0; counter-reset: fix; }
.fix {
  counter-increment: fix;
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 18px; align-items: start;
  padding: 20px 0; border-top: 1px solid var(--rule-2);
}
.fix:first-child { border-top: 0; padding-top: 4px; }
.fix::before {
  content: counter(fix, decimal-leading-zero);
  font-family: var(--font-data); font-size: 20px; font-weight: 700;
  color: var(--rule); line-height: 1.2;
}
.fix__label { margin: 0 0 4px; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.fix__meta { margin: 0 0 8px; font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.fix__action { margin: 0; font-size: 14px; color: var(--ink-2); }
.fix__lost {
  font-family: var(--font-data); font-weight: 700; font-size: 15px;
  color: var(--ng); white-space: nowrap;
}

/* ---------- cta ---------- */
.cta {
  background: var(--ink); color: #fff;
  padding: 52px 40px; text-align: center;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.cta__title { margin: 0 0 12px; font-size: 24px; font-weight: 900; }
.cta__lead { margin: 0 auto 28px; max-width: 560px; color: #b9c8d8; font-size: 14px; }

.disclaimer { font-size: 11px; color: var(--muted); line-height: 2; margin: 0; }

/* ---------- foot ---------- */
.foot { border-top: 1px solid var(--rule); padding: 22px 0; background: var(--card); }
.foot__inner { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--ink); color: #fff;
  padding: 8px 11px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.6;
  box-shadow: 0 6px 20px rgba(11,27,43,.25);
  max-width: 240px;
}
.tip__key { font-family: var(--font-data); font-size: 10px; letter-spacing: .1em; color: #8fb0d6; display: block; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); }
.reveal--in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .radar { grid-template-columns: 1fr; gap: 28px; }
  .cats { grid-template-columns: 1fr; gap: 28px; }
  .slip { grid-template-columns: 1fr 1fr; }
  .slip__item:nth-child(2) { border-right: 0; }
  .slip__item:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .br-sp { display: inline; }
  .hero__inner { padding: 52px 24px 56px; }
  .form__main { display: block; }
  .form__submit { width: 100%; margin-top: 14px; }
  .card { padding: 22px 18px; }
  .kpi { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 120px 1fr 44px; gap: 10px; }
  .fcrow { grid-template-columns: 74px 1fr 96px; gap: 8px; }
  .verdict { gap: 24px; }
  .fix { grid-template-columns: 32px 1fr; }
  .fix__lost { grid-column: 2; }
  .cta { padding: 36px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .hero, .topbar, .foot, .cta { display: none; }
  .card { break-inside: avoid; border-color: #999; }
}

/* ---------- Core Web Vitals ---------- */
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.vital { background: var(--card); padding: 20px 22px; }
.vital__name { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.vital__value { margin: 0; font-family: var(--font-data); font-size: 28px; font-weight: 700; line-height: 1.1; }
.vital__value small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.vital__judge { display: inline-block; margin-top: 8px; font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid; }
.vital__bar { height: 5px; background: var(--rule-2); border-radius: 2px; margin-top: 12px; position: relative; overflow: hidden; }
.vital__marker { position: absolute; top: -3px; width: 3px; height: 11px; background: var(--ink); border-radius: 1px; }
.vital__note { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.vitals--none { display: block; padding: 18px 20px; background: #fbfcfd; border: 1px dashed var(--rule); font-size: 13px; color: var(--ink-2); }

/* ---------- 診断ページ一覧 ---------- */
.pages { list-style: none; margin: 0; padding: 0; }
.page { display: grid; grid-template-columns: 92px 1fr 110px; gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule-2); }
.page:last-child { border-bottom: 0; }
.page__type { font-family: var(--font-data); font-size: 10px; letter-spacing: .1em; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; padding: 2px 0; text-align: center; }
.page__type--top { color: var(--self); border-color: rgba(27,92,196,.35); }
.page__body { min-width: 0; }
.page__title { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page__url { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page__len { font-family: var(--font-data); font-size: 12px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.page__len--empty { color: var(--ng); }

/* ---------- データソースのバッジ ---------- */
.src { display: inline-block; font-family: var(--font-data); font-size: 9px; letter-spacing: .08em; padding: 1px 6px; border-radius: 2px; margin-left: 6px; vertical-align: 1px; }
.src--measured { background: rgba(21,127,79,.1); color: var(--ok); }
.src--estimate { background: var(--rule-2); color: var(--muted); }

@media (max-width: 640px) {
  .vitals { grid-template-columns: 1fr; }
  .page { grid-template-columns: 70px 1fr; gap: 10px; }
  .page__len { grid-column: 2; text-align: left; }
}

/* ---------- 結果の保存・共有 ---------- */
.keep { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.keep__body { min-width: 0; }
.keep__form { display: flex; gap: 10px; margin: 20px 0 0; max-width: 460px; }
.keep__input {
  flex: 1; min-width: 0; padding: 13px 14px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-data); font-size: 15px; color: var(--ink); background: #fff;
}
.keep__input:focus { outline: 2px solid var(--self); outline-offset: 1px; }
.keep__note { margin: 12px 0 0; font-size: 11px; color: var(--muted); }
.keep__note--done { color: var(--ok); }
.keep__note--error { color: var(--ng); }
.keep__side { display: grid; gap: 10px; }
.btn--ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--rule);
  padding: 12px 22px; font-size: 14px;
}
.btn--ghost:hover { border-color: var(--ink); background: #fbfcfd; }

/* 共有リンクから開いたときは入力フォームを隠す */
body.is-shared .hero__inner .form,
body.is-shared #keepBlock { display: none; }
body.is-shared .hero__inner { padding-bottom: 44px; }

@media (max-width: 720px) {
  .keep { grid-template-columns: 1fr; gap: 20px; }
  .keep__form { flex-direction: column; }
  .keep__side { grid-template-columns: 1fr 1fr; }
}

/* ---------- 印刷（PDF保存） ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }

  html, body { background: #fff !important; font-size: 10.5pt; }
  .topbar, .hero, .scan, .foot, .cta, .keep, .tip, .cat__toggle { display: none !important; }
  .report { padding: 0 !important; }
  .shell { max-width: none; padding: 0; }

  /* 印刷では折りたたみを開いた状態で出す */
  .checks[hidden] { display: block !important; }

  .card, .slip {
    border: 1px solid #c8d2dc !important;
    box-shadow: none !important;
    margin-bottom: 10px !important;
    padding: 14px 16px !important;
    break-inside: auto;
  }
  /* 短いカードは途中で切らない。長い一覧は切れてよい */
  .verdict, .slip, .vitals, #competitorBlock { break-inside: avoid; }
  .card__head { break-after: avoid; }

  /* 横スクロールしていた表を、紙幅に収める */
  .table-wrap { overflow: visible !important; }
  .kw { min-width: 0 !important; font-size: 8pt; table-layout: fixed; width: 100%; }
  .kw th, .kw td { padding: 6px 4px; }
  .kw th { white-space: normal; font-size: 7pt; }
  .kw th:nth-child(1) { width: 27%; }
  .kw th:nth-child(2) { width: 9%; }
  .kw th:nth-child(3) { width: 14%; }
  .kw th:nth-child(4) { width: 12%; }
  .kw th:nth-child(5) { width: 16%; }
  .kw th:nth-child(6) { width: 22%; }
  .kw__volbar { display: none; }
  .kw__vol { justify-content: flex-end; }
  .chip { font-size: 8pt; padding: 1px 6px; }
  .card__title { font-size: 13pt; }
  .card__head { margin-bottom: 12px; }
  .verdict { gap: 20px; }
  .radar { grid-template-columns: 1fr 1fr; gap: 16px; }
  .cats { gap: 16px; }
  .reveal { opacity: 1 !important; transform: none !important; }

  /* 表と長い一覧はページをまたぐことを許す */
  .kw, .pages, .fixes { break-inside: auto; }
  .kw tr, .page, .fix { break-inside: avoid; }

  .disclaimer { font-size: 8pt; }
  a[href]::after { content: ""; }
}
