/* 手描きイラストに合わせた、やわらかい配色と丸ゴシック */
:root {
  --bg: #fbf8f1;
  --surface: #ffffff;
  --text: #17375e;
  --muted: #5d6b7e;
  --line: #e6e0d3;
  --brand: #3b82d6;
  --brand-dark: #2766b5;
  --marker: #fde68a;
  --blob-blue: #d9ecfa;
  --blob-mint: #e1f0e6;
  --pass: #2f9e5b;
  --warn: #d49a00;
  --fail: #d6453f;
  --na: #8a94a3;
  --radius: 20px;
  --shadow: 0 2px 4px rgba(23, 55, 94, .04), 0 8px 24px rgba(23, 55, 94, .06);
  /* 見出し・ボタンは丸ゴシック、本文は読みやすい標準のゴシック */
  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.9 var(--font);
  letter-spacing: .02em;
  line-break: strict;
}
h1, h2, h3, .logo, .eyebrow, .scan-form button, .primary, .rank, .score-text, .badge,
.faq summary, .menu h3, .menu-free, .column-cta-title, .stats b, .accent, .item-title, .cat-score {
  font-family: var(--font-head);
}
/* 短い文は区切り位置（<wbr>）以外で折り返さない。入りきらないときだけ途中で折る */
h1, h2, h3, .eyebrow, .lead, .note, .faq summary, .checklist li, .column-list b, .menu-list li,
.menu-free, .column-cta-title, .primary, .scan-form button, .item-title, .rank-msg {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
/* <wbr> を入れていない文は通常どおり折り返す（auto-phrase は Safari で改行されなくなるため使わない） */
.faq summary, .checklist li, .menu-list li, .item-title, .rank-msg, .column article h2 { word-break: normal; overflow-wrap: normal; }
html, body { overflow-x: clip; }
h1, h2, h3, strong, b { font-weight: 700; }
[hidden] { display: none !important; }
a { color: var(--brand-dark); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp { display: none; }
@media (max-width: 600px) { .sp { display: inline; } }
.accent { color: var(--brand); font-size: 1.15em; } /* 強調は色と大きさだけ（枠で囲むと入力欄のように見える） */

.site-header { position: relative; z-index: 1; }
.site-header .wrap { height: 64px; display: flex; align-items: center; }
.logo { font-weight: 900; color: var(--text); text-decoration: none; font-size: 17px; }
.logo .by { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }

/* ---- hero（左上・右下に水色の模様） */
.hero { position: relative; padding: 8px 0 56px; text-align: center; isolation: isolate; overflow: hidden; } /* 飾りの模様を枠内で切る（iPhoneでページが横に広がるのを防ぐ） */
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero::before { width: 420px; height: 320px; left: -180px; top: -140px; background: var(--blob-blue); border-radius: 46% 54% 62% 38% / 50% 42% 58% 50%; }
.hero::after { width: 380px; height: 300px; right: -170px; bottom: 40px; background: var(--blob-mint); border-radius: 58% 42% 40% 60% / 52% 60% 40% 48%; }
.eyebrow { display: inline-block; font-size: 15px; font-weight: 700; color: var(--brand-dark); background: var(--surface); border: 2px solid var(--blob-blue); border-radius: 999px; padding: 4px 16px; margin: 0 0 8px; }
.hero h1 { margin: 0 auto; max-width: 720px; }
.hero h1 img { width: 100%; border-radius: 28px; }
.lead { color: var(--muted); margin: 16px 0 24px; }

/* ---- 入力欄（カプセル形） */
.scan-form { display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto; background: var(--surface); border: 3px solid #9cc6f0; border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.scan-form:focus-within { border-color: var(--brand); }
.scan-form .globe { flex: none; width: 26px; height: 26px; color: var(--brand); }
.scan-form input { flex: 1; min-width: 0; font: 500 18px var(--font); color: var(--text); border: 0; background: transparent; padding: 10px 4px; outline: none; }
.scan-form input::placeholder { color: #9aa6b5; }
button { font: inherit; cursor: pointer; }
.scan-form button, .primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff;
  font-weight: 700; padding: 14px 24px; white-space: nowrap; text-decoration: none;
  box-shadow: 0 4px 0 var(--brand-dark); transition: transform .1s, box-shadow .1s, background .15s;
}
.scan-form button svg, .primary svg { width: 20px; height: 20px; }
.scan-form button:hover, .primary:hover { background: var(--brand-dark); }
.scan-form button:active, .primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-dark); }
.scan-form button:focus-visible, .primary:focus-visible, .ghost:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: wait; }
.ghost { border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; }
@media (max-width: 520px) {
  .scan-form { flex-wrap: wrap; border-radius: 28px; padding: 8px 8px 8px 16px; }
  .scan-form input { flex-basis: calc(100% - 40px); }
  .scan-form button { flex-basis: 100%; }
}
.note { font-size: 13px; color: var(--muted); }
.form-error { color: var(--fail); font-weight: 700; }

/* ---- 紹介・FAQ（トップページのみ） */
.about { display: grid; gap: 56px; padding-bottom: 72px; }
.about h2 { font-size: 24px; margin: 0 0 14px; text-wrap: balance; }
.about p { margin: 0; max-width: 46em; }
.features { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.features li { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.features h3 { font-size: 17px; margin: 0 0 4px; }
.features p { font-size: 14px; color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .35em; width: 22px; height: 22px; border-radius: 50%; background: var(--blob-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='%232766b5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; }
.try { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; background: var(--surface); border-radius: 28px; padding: 20px; box-shadow: var(--shadow); }
.try img { border-radius: 20px; }
.try h2 { margin-bottom: 8px; }
.try p { color: var(--muted); margin-bottom: 18px; }
@media (max-width: 640px) { .try { grid-template-columns: 1fr; text-align: center; } }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border-radius: 16px; padding: 0 20px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; display: grid; place-items: center; margin-top: 1px; }
.faq details p { padding: 0 0 16px 36px; color: var(--muted); }

/* ---- progress */
.progress { padding: 48px 16px; }
.progress h2 { font-size: 20px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 12px 0 12px 36px; border-bottom: 2px dashed var(--line); position: relative; }
.steps li::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; border: 3px solid var(--line);
}
.steps li.running::before { border-color: var(--brand); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done::before { border-color: var(--pass); background: var(--pass); }
.steps li.failed::before { border-color: var(--na); background: var(--na); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.running::before { animation: none; } }

/* ---- result */
.result { padding: 16px 16px 48px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.summary { display: flex; gap: 28px; align-items: center; }
@media (max-width: 600px) { .summary { flex-direction: column; text-align: center; } }
.score-ring { position: relative; width: 150px; height: 150px; flex: none; --c: var(--brand); }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 11; }
.score-ring .track { stroke: #efeadf; }
.score-ring .bar { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.score-text { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 46px; }
.score-text span { font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.score-text small { color: var(--muted); margin-left: 2px; }
.rank-A { --c: var(--pass); } .rank-B { --c: #62a83a; } .rank-C { --c: var(--warn); }
.rank-D { --c: #e0702e; } .rank-E { --c: var(--fail); }
.target { margin: 0; color: var(--muted); word-break: break-all; }
.rank-line { margin: 4px 0; font-size: 18px; font-weight: 700; }
.rank { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-left: 6px;
  border-radius: 50%; background: var(--c); color: #fff; font-size: 26px; font-weight: 900; vertical-align: middle; }
.rank-msg { margin: 8px 0 4px; }
.counts { margin: 0; font-size: 14px; color: var(--muted); }

.top-issues h2, .category h2, .cta h2, .contact h2 { font-size: 19px; margin: 0 0 12px; }
.top-issues ol { margin: 0; padding-left: 1.4em; }
.top-issues li { margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 14px; }

.category h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cat-score { font-size: 14px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.item { border-top: 2px dashed var(--line); }
.item summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.item summary::-webkit-details-marker { display: none; }
.item summary::after { content: "＋"; color: var(--muted); margin-left: 4px; }
.item[open] summary::after { content: "－"; }
.item-title { flex: 1; font-weight: 700; }
.pts { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-body { padding: 0 0 14px; font-size: 15px; }
.item-body p { margin: 0 0 8px; }
.item-body .detail { background: var(--bg); border-radius: 12px; padding: 8px 12px; word-break: break-all; }
.item-body .fix { background: #eef6fd; border-radius: 12px; padding: 8px 12px; }
.level { font-size: 13px; color: var(--muted); }

.badge { display: inline-block; min-width: 68px; text-align: center; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--na); white-space: nowrap; }
.badge.pass { background: var(--pass); } .badge.warn { background: var(--warn); } .badge.fail { background: var(--fail); }
.badge.info { background: #7484a0; }

.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; margin: 4px 0 24px; }
.share input { flex: 1; min-width: 200px; font: inherit; padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); }

.cta { text-align: center; background: linear-gradient(135deg, #e9f3fc, #fffaf0); }
.cta p { margin: 0 0 18px; }

.contact form { display: grid; gap: 14px; }
.contact label { display: grid; gap: 4px; font-weight: 700; font-size: 15px; }
.contact input, .contact textarea, .contact select {
  font: 500 16px var(--font); color: var(--text); padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); width: 100%;
}
.contact input:focus, .contact textarea:focus, .contact select:focus { outline: none; border-color: var(--brand); }
.contact label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.contact label.check input { width: auto; }
.req { justify-self: start; font-size: 11px; color: #fff; background: var(--fail); padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.thanks { text-align: center; }
.again { text-align: center; }

.site-footer { border-top: 2px dashed var(--line); padding: 24px 0; font-size: 13px; color: var(--muted); }
.simple-page { padding: 56px 16px; } .simple-page.center { text-align: center; }

/* ---- 自分でチェック */
.selfcheck h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.selfcheck-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.selfcheck-list li { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.selfcheck-list input { flex: none; width: 22px; height: 22px; margin-top: 3px; accent-color: var(--brand); }
.selfcheck-list label { display: grid; gap: 2px; cursor: pointer; }

/* ---- 修正メニュー */
.menu { background: var(--surface); border-radius: 16px; padding: 16px 20px; margin: 0 auto 20px; max-width: 520px; text-align: left; }
.menu h3 { font-size: 16px; margin: 0 0 8px; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { position: relative; padding: 8px 0 8px 30px; border-bottom: 2px dashed var(--line); font-weight: 700; }
.menu-list li::before { content: ""; position: absolute; left: 0; top: 13px; width: 20px; height: 20px; border-radius: 50%; background: var(--blob-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.2L4 16.8V20h3.2l5.3-5.3a4 4 0 0 0 5.2-5.4l-2.4 2.4-2.6-.6-.6-2.6z' fill='%232766b5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.menu-free { margin: 14px 0 0; padding: 10px 14px; border: 2px dashed #9cc6f0; border-radius: 12px; background: #f4f9fe; font-weight: 700; color: var(--brand-dark); text-align: center; }

/* ---- 管理ページ */
.admin { padding: 24px 16px 64px; }
.admin-login { max-width: 360px; display: grid; gap: 10px; }
.admin-login input { font: 500 16px var(--font); padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 16px 0; }
.stats div { background: var(--surface); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.admin table { border-collapse: collapse; width: 100%; font-size: 14px; }
.admin th, .admin td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin .rank { width: 30px; height: 30px; font-size: 15px; margin: 0; }

/* ---- お役立ちコラム */
.column { padding: 8px 16px 64px; max-width: 760px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.column h1 { font-size: clamp(24px, 4.5vw, 32px); line-height: 1.45; margin: 0 0 8px; text-wrap: balance; }
.column-date { font-size: 13px; color: var(--muted); margin: 0 0 20px; font-variant-numeric: tabular-nums; }
.column-lead { font-size: 17px; margin: 0 0 28px; }
.column article h2 { font-size: 20px; margin: 40px 0 14px; padding: 10px 16px; background: var(--blob-blue); border-radius: 12px; }
.column article p, .column article li { max-width: 40em; }
.column article ul, .column article ol { padding-left: 1.4em; display: grid; gap: 8px; }
.column code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 14px; }
.column-cta { margin: 48px 0; background: linear-gradient(135deg, #e9f3fc, #fffaf0); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.column-cta-title { font-size: 19px; font-weight: 900; margin: 0 0 4px; }
.column-cta p { margin: 0 0 16px; }
.column-more h2 { font-size: 18px; }
.column-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.column-list a { display: grid; gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.column-list span { font-size: 14px; color: var(--muted); }

/* ---- 結果画面の「修正を依頼する」 */
.summary-body .primary { margin-top: 12px; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 248, 241, .94); box-shadow: 0 -4px 16px rgba(23, 55, 94, .08); text-align: center; }
.sticky-cta[hidden] { display: none; }
.sticky-cta .primary { width: 100%; max-width: 420px; }
body.has-sticky-cta { padding-bottom: 76px; }
