/* どんちゃんと学ぶAIセキュリティ — 落ち着いた青緑×黄土色。紙のような温かみと、ペン画の線を意識 */
:root {
  --teal: #1f6b66;
  --teal-dk: #154c48;
  --teal-lt: #e3f0ee;
  --ochre: #d4972b;
  --ochre-dk: #a8721a;
  --ochre-lt: #fbf0d9;
  --cream: #faf7f1;
  --paper: #ffffff;
  --ink: #2a2a2a;
  --muted: #666;
  --line: #e4dccd;
  --red: #b8442f;
  --story: #1f6b66;
  --news: #b8442f;
  --category: #a8721a;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(42, 42, 42, .08), 0 6px 18px rgba(42, 42, 42, .06);
  --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --round: "Zen Maru Gothic", var(--font);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.85; letter-spacing: .02em; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
a { color: var(--teal); }
a:hover { color: var(--ochre-dk); }
h1, h2, h3, .sec-title, .logo { font-family: var(--round); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: #fff; padding: 8px 14px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
.empty { color: var(--muted); background: var(--paper); border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }

/* ---------- header */
.site-header { background: var(--paper); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 50; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.25rem; line-height: 1.3; }
.logo img { border-radius: 50%; border: 2px solid var(--ink); }
.logo small { display: block; font-size: .7rem; color: var(--teal); font-weight: 500; letter-spacing: .08em; }
.gnav > ul { display: flex; list-style: none; margin: 0; padding: 0; }
.gnav > ul > li { position: relative; }
.gnav > ul > li + li::before { content: "｜"; color: var(--line); position: absolute; left: -.5em; top: 50%; transform: translateY(-50%); }
.gnav > ul > li > a { display: block; padding: 22px 20px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1rem; }
.gnav > ul > li > a:hover, .gnav > ul > li.is-active > a { color: var(--teal); box-shadow: inset 0 -5px 0 var(--ochre); }
.has-mega > a::after { content: " ▾"; font-size: .75em; color: var(--muted); }
.mega { display: none; position: absolute; right: 0; top: 100%; background: var(--paper); border: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); width: min(900px, 90vw); padding: 20px 24px; }
.has-mega:hover .mega, .has-mega:focus-within .mega { display: block; }
.mega-inner { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.mega-h { font-weight: 700; color: var(--teal-dk); text-decoration: none; display: block; border-bottom: 2px solid var(--ochre); margin-bottom: 6px; font-size: .95rem; }
.mega ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.mega li a { color: var(--ink); text-decoration: none; display: block; padding: 3px 0; }
.mega li a:hover { color: var(--teal); }
.gnav-sp, .menu-btn { display: none; }
.subbar { background: var(--teal); color: #fff; }
.subbar-inner { max-width: 1200px; margin: 0 auto; padding: 6px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: .88rem; }
.subbar p { margin: 0; letter-spacing: .1em; }
.subbar .search { max-width: 420px; flex: 1; }
.subbar .search input { padding: 6px 12px; font-size: .88rem; }
.subbar .search button { padding: 0 14px; }

/* ---------- search */
.search { display: flex; align-items: stretch; height: 52px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.subbar .search, .side-box .search { height: 40px; }
.search input { flex: 1; min-width: 0; border: 0; padding: 0 18px; height: 100%; font: inherit; font-size: 1rem; outline: none; background: transparent; }
.search button { border: 0; background: var(--ochre); color: #fff; font-weight: 700; padding: 0 22px; cursor: pointer; font: inherit; display: flex; align-items: center; gap: 4px; line-height: 1; white-space: nowrap; }
.search button span { font-size: .9rem; }
.search button:hover { background: var(--ochre-dk); }
.subbar .search button span { display: none; }
.top-search { background: var(--teal-lt); padding: 20px 0; border-bottom: 2px solid var(--line); }
.top-search .search { max-width: 720px; margin: 0 auto; box-shadow: var(--shadow); }

/* ---------- hero slider */
.hero { position: relative; overflow: hidden; background: var(--teal-dk); }
.slides { display: flex; transition: transform .6s ease; }
.slide { flex: 0 0 100%; position: relative; display: block; color: inherit; text-decoration: none; aspect-ratio: 16 / 6; max-height: 600px; overflow: hidden; }
.slide picture, .slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 6% 28px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; }
.slide-cap p { margin: 6px 0 0; font-family: var(--round); font-weight: 700; font-size: clamp(1.1rem, 2.4vw, 1.8rem); line-height: 1.4; }
.slide-notice { background: var(--ochre-lt); background-image: repeating-linear-gradient(-45deg, transparent 0 18px, rgba(212, 151, 43, .08) 18px 36px); display: flex; align-items: center; justify-content: center; gap: 4%; padding: 0 6%; }
.slide-notice .notice-inner { max-width: 760px; }
.notice-label { display: inline-block; background: var(--red); color: #fff; font-weight: 700; padding: 4px 14px; border-radius: 6px; }
.notice-title { font-family: var(--round); font-weight: 700; font-size: clamp(1.2rem, 2.8vw, 2.1rem); line-height: 1.4; margin: 12px 0 8px; }
.notice-text { margin: 0 0 16px; color: #444; }
.slide-notice .notice-char { width: min(22%, 220px); height: auto; border-radius: 50%; border: 3px solid var(--ink); background: #fff; }
.sl-prev, .sl-next { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); background: rgba(255, 255, 255, .9); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.sl-prev { left: 16px; } .sl-next { right: 16px; }
.sl-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.sl-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.sl-dots button.on { background: var(--ochre); border-color: var(--ochre); }

/* ---------- sections */
.top { padding-bottom: 40px; }
.sec { margin: 56px 0; }
.sec-title { font-size: 1.6rem; margin: 0 0 22px; display: flex; align-items: baseline; gap: 14px; padding-bottom: 10px; border-bottom: 3px solid var(--ink); position: relative; }
.sec-title::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 120px; height: 3px; background: var(--ochre); }
.sec-title .en { font-family: var(--font); font-size: .78rem; letter-spacing: .2em; color: var(--ochre-dk); font-weight: 700; order: 2; }
.sec-title.sm { font-size: 1.3rem; }
.sec-lead { margin: -8px 0 20px; color: var(--muted); }

/* ---------- tabs & cards */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button { font: inherit; font-weight: 700; font-size: .95rem; padding: 6px 18px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; cursor: pointer; }
.tabs button.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; box-shadow: 4px 4px 0 var(--line); }
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ochre-lt); }
.card[hidden] { display: none; }
.card-link { text-decoration: none; color: var(--ink); flex: 1; }
.card-thumb { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--ochre-lt); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .badge { position: absolute; right: 10px; top: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.card-body { padding: 12px 16px 4px; }
.card-body time { font-size: .8rem; color: var(--muted); margin: 0 8px; }
.card h3 { font-size: 1.05rem; line-height: 1.55; margin: 4px 0 8px; }
.card-big h3 { font-size: 1.12rem; }
.excerpt { font-size: .9rem; color: #555; margin: 0 0 8px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { padding: 0 16px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; color: #fff; padding: 2px 10px; border-radius: 6px; line-height: 1.6; background: var(--teal); }
.badge-story { background: var(--story); }
.badge-news { background: var(--news); }
.badge-category { background: var(--category); }
.cat-label { font-size: .8rem; color: var(--ochre-dk); font-weight: 700; }
.chip { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--teal-lt); color: var(--teal-dk); text-decoration: none; border: 1px solid #c4dedb; }
.chip:hover { background: var(--ochre-lt); color: var(--ochre-dk); }
.more-wrap { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.link-all { font-weight: 700; text-decoration: none; }
.btn { display: inline-block; background: var(--teal); color: #fff; font-weight: 700; text-decoration: none; padding: 10px 26px; border-radius: 999px; border: 2px solid var(--ink); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.btn:hover { background: var(--teal-dk); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { background: var(--ochre-lt); color: var(--ink); }
.btn-lg { padding: 14px 48px; font-size: 1.1rem; }

/* ---------- troubles */
.troubles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trouble { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; box-shadow: 4px 4px 0 var(--ochre-lt); transition: transform .15s; }
.trouble:hover { transform: translateY(-3px); background: var(--ochre-lt); color: var(--ink); }
.trouble-ico { font-size: 1.8rem; line-height: 1; }
.trouble-q { font-family: var(--round); font-weight: 700; font-size: 1.05rem; line-height: 1.5; flex: 1; }
.trouble-l { font-size: .85rem; color: var(--teal-dk); font-weight: 700; display: flex; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 6px; }
.trouble-l em { font-style: normal; color: var(--muted); font-weight: 400; }

/* ---------- characters */
.chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.char { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: left; }
.char img { width: 140px; height: 140px; border-radius: 50%; border: 3px solid var(--ink); object-fit: cover; margin-bottom: 8px; }
.char h3 { margin: 0; font-size: 1.3rem; }
.char h3 small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.char-role { margin: 0; font-size: .82rem; font-weight: 700; color: #fff; background: var(--teal); display: inline-block; padding: 0 10px; border-radius: 6px; }
.char-kiyota .char-role { background: var(--ochre-dk); }
.char-dondo .char-role { background: #3f8f88; }
.char-nick { margin: 0 0 6px; font-size: .9rem; color: var(--ochre-dk); font-weight: 700; }
.char p:last-child { font-size: .92rem; margin: 0; line-height: 1.75; }
.char > div { width: 100%; }

/* ---------- categories */
.cat-tree { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-block { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.cat-block h3 { margin: 0; font-size: 1.1rem; background: var(--teal); }
.cat-block h3 a { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 12px 16px; }
.cat-block h3 em, .cat-block li em { margin-left: auto; font-style: normal; font-size: .8rem; opacity: .8; }
.cat-block ul { list-style: none; margin: 0; padding: 8px 0; }
.cat-block li a { display: flex; padding: 6px 16px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.cat-block li a::before { content: "›"; color: var(--ochre); margin-right: 8px; font-weight: 700; }
.cat-block li a:hover { background: var(--ochre-lt); }
.sub-chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.sub-chips .chip { font-size: .95rem; padding: 4px 14px; }

/* ---------- ranking */
.rank-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rank-cols-4 { grid-template-columns: repeat(4, 1fr); }
.rank-col { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.rank-col h3 { margin: 0 0 10px; font-size: 1.05rem; }
.rank-col .link-all { margin-top: auto; padding-top: 8px; font-size: .9rem; text-align: right; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li + li { border-top: 1px dashed var(--line); }
.rank a { display: grid; grid-template-columns: 28px 84px 1fr; gap: 10px; align-items: center; padding: 8px 0; text-decoration: none; color: var(--ink); font-size: .9rem; line-height: 1.5; }
.rank img { width: 84px; aspect-ratio: 1200/630; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.rank-n { width: 28px; height: 28px; border-radius: 50%; background: #999; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.rank-1 { background: #c9a227; } .rank-2 { background: #9aa4ab; } .rank-3 { background: #b07a4f; }
.rank-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- layout with sidebar */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; margin-bottom: 60px; }
.layout .grid { grid-template-columns: repeat(2, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
.side-box { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; }
.side-box .search input { padding: 10px 12px; font-size: .9rem; }
.side-box .search button span { display: none; }
.side-title { font-size: 1.05rem; margin: 0 0 10px; padding-left: 10px; border-left: 5px solid var(--ochre); }
.side-troubles, .side-cats { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.side-troubles li a, .side-cats a { display: block; padding: 5px 0; color: var(--ink); text-decoration: none; }
.side-troubles li + li { border-top: 1px dashed var(--line); }
.side-cats > li > a { font-weight: 700; color: var(--teal-dk); }
.side-cats ul { list-style: none; padding-left: 1.4em; margin: 0 0 6px; font-size: .88rem; }
.side-cta { text-align: center; background: var(--ochre-lt); }
.side-cta img { margin: 0 auto 6px; border-radius: 50%; border: 2px solid var(--ink); }
.side-cta p { font-weight: 700; margin: 0 0 10px; font-family: var(--round); }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 16px 0 20px; padding: 0; font-size: .82rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; }
.crumbs a { color: var(--muted); }
.list-head { margin-bottom: 24px; }
.list-head h1 { font-size: 1.9rem; margin: 0 0 8px; }
.list-head p { margin: 0; color: #555; }
.list-head .count { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- article */
.post { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 36px 44px 40px; }
.post-head h1 { font-size: 1.9rem; line-height: 1.5; margin: 10px 0 8px; }
.post-meta { display: flex; gap: 10px; align-items: center; }
.post-dates { font-size: .85rem; color: var(--muted); display: flex; gap: 14px; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.post-thumb { margin: 24px 0 0; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--ink); }
.manga { margin: 28px auto 8px; max-width: 680px; }
.manga img { border: 3px solid var(--ink); border-radius: 6px; width: 100%; }
.manga figcaption { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 8px; }
.post-body { margin-top: 28px; }
.post-body h2 { font-size: 1.5rem; line-height: 1.5; margin: 56px 0 20px; padding: 12px 18px; background: var(--teal); color: #fff; border-radius: 10px; scroll-margin-top: 100px; }
.post-body h3 { font-size: 1.22rem; margin: 36px 0 14px; padding: 4px 0 6px 14px; border-left: 6px solid var(--ochre); border-bottom: 2px dashed var(--line); scroll-margin-top: 100px; }
.post-body h4 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--teal-dk); }
.post-body p { margin: 0 0 1.3em; }
.post-body mark { background: linear-gradient(transparent 55%, #f8dc8f 55%); color: inherit; padding: 0 2px; }
.post-body strong { color: var(--teal-dk); }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0 0 1.4em; }
.post-body li { margin: 4px 0; }
.post-body li.check { list-style: none; position: relative; }
.post-body li.check::before { content: "☐"; position: absolute; left: -1.4em; color: var(--teal); font-weight: 700; }
.post-body li.check.done::before { content: "☑"; }
.post-body blockquote { margin: 0 0 1.4em; padding: 14px 20px; background: var(--cream); border-left: 5px solid var(--line); color: #444; }
.post-body code { background: #f1ede4; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.code { background: #23302f; color: #e8efe9; padding: 18px 20px; border-radius: 10px; overflow-x: auto; font-size: .88rem; line-height: 1.7; margin: 0 0 1.5em; position: relative; }
.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 0; right: 0; font-size: .7rem; background: var(--ochre); color: #fff; padding: 2px 10px; border-radius: 0 10px 0 8px; }
.code code { background: none; padding: 0; color: inherit; }
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; }
.post-body table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 480px; }
.post-body th, .post-body td { border: 1px solid #cfc6b4; padding: 10px 12px; text-align: left; vertical-align: top; }
.post-body th { background: var(--teal-lt); color: var(--teal-dk); }
.post-body tr:nth-child(even) td { background: #fcfaf5; }
.fig { margin: 28px 0; text-align: center; }
.fig img { border: 2px solid var(--ink); border-radius: 10px; margin: 0 auto; }
.fig figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.post-body hr { border: 0; border-top: 2px dashed var(--line); margin: 36px 0; }

/* boxes */
.box { border: 2px solid var(--ink); border-radius: var(--radius); margin: 28px 0; background: #fff; overflow: hidden; display: block; }
.box-title { font-family: var(--round); font-weight: 700; padding: 8px 18px; background: var(--ink); color: #fff; }
.box-body { display: block; padding: 16px 22px 4px; }
.box-body > :last-child { margin-bottom: 1em; }
.box-summary { background: var(--teal-lt); border-color: var(--teal); }
.box-summary .box-title { background: var(--teal); }
.box-summary .box-title::before { content: "📝 "; }
.box-matome { background: var(--ochre-lt); border-color: var(--ochre-dk); }
.box-matome .box-title { background: var(--ochre-dk); }
.box-matome .box-title::before { content: "✅ "; }
.box-point .box-title { background: var(--teal-dk); }
.box-point .box-title::before { content: "💡 "; }
.box-warn { border-color: var(--red); background: #fdf2ef; }
.box-warn .box-title { background: var(--red); }
.box-warn .box-title::before { content: "⚠ "; }
.box-check .box-title { background: #3f8f88; }
.box-note .box-title { background: #777; }
.box-break { background: var(--cream, #fbf7ec); border-style: dashed; border-color: var(--ochre-dk); }
.box-break .box-title { background: var(--ochre); color: var(--ink); }
.box-break .box-title::before { content: "☕ "; }
.contact-form .box-warn { padding: 0; }

/* TOC */
.toc { border: 2px solid var(--ink); border-radius: var(--radius); background: var(--cream); padding: 16px 24px; margin: 28px 0; }
.toc-title { font-family: var(--round); font-weight: 700; font-size: 1.1rem; text-align: center; margin-bottom: 8px; }
.toc-title::before { content: "≡ "; color: var(--ochre); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { color: var(--ink); text-decoration: none; display: flex; gap: 10px; padding: 5px 0; }
.toc a:hover { color: var(--teal); }
.toc-h2 { border-top: 1px dashed var(--line); font-weight: 700; }
.toc-h2:first-child { border-top: 0; }
.toc-h3 { padding-left: 38px; font-size: .9rem; }
.toc-h3 a::before { content: "–"; color: var(--ochre); }
.toc-n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--teal); color: #fff; font-size: .8rem; display: grid; place-items: center; margin-top: 3px; }

/* talk (speech bubbles) */
.talk { display: flex; gap: 16px; margin: 22px 0; align-items: flex-start; }
.talk-right { flex-direction: row-reverse; }
.talk-face { flex: none; width: 84px; text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); }
.talk-face img { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; background: #fff; margin: 0 auto 2px; }
.talk-bubble { position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 14px 20px; max-width: calc(100% - 100px); line-height: 1.8; }
.talk-bubble::before { content: ""; position: absolute; top: 24px; width: 14px; height: 14px; background: inherit; border: inherit; border-width: 0 0 2px 2px; }
.talk-left .talk-bubble::before { left: -9px; transform: rotate(45deg); }
.talk-right .talk-bubble::before { right: -9px; transform: rotate(-135deg); }
.talk-hara .talk-bubble { background: #eef5f4; }
.talk-kiyota .talk-bubble { background: #fdf4e3; }
.talk-dondo .talk-bubble { background: #fff; border-color: var(--teal); }
.talk-dondo .talk-face img { border-color: var(--teal); }

/* share & pager */
.share { margin-top: 40px; padding-top: 20px; border-top: 2px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share span { font-weight: 700; margin-right: 6px; font-size: .9rem; }
.share a, .share button { font: inherit; font-size: .85rem; font-weight: 700; color: #fff; text-decoration: none; padding: 6px 16px; border-radius: 999px; border: 0; cursor: pointer; }
.sh-x { background: #111; } .sh-line { background: #06c755; } .sh-fb { background: #1877f2; } .sh-copy { background: #777; }
.share a:hover { color: #fff; opacity: .85; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.pager a { border: 2px solid var(--ink); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; font-weight: 700; color: var(--teal); }
.pager a span { display: block; color: var(--ink); font-weight: 400; font-size: .9rem; }
.pager .next { text-align: right; }

/* contact */
.contact-form { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 60px; display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 4px; font-weight: 700; font-size: .95rem; }
.contact-form label b { display: inline-block; margin-left: 6px; font-size: .7rem; background: var(--red); color: #fff; padding: 0 6px; border-radius: 4px; vertical-align: middle; width: fit-content; }
.contact-form input:not([type=checkbox]), .contact-form textarea, .contact-form select { font: inherit; font-weight: 400; padding: 10px 12px; border: 2px solid #cfc6b4; border-radius: 8px; background: #fff; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: none; border-color: var(--teal); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form fieldset { border: 2px solid #cfc6b4; border-radius: 8px; padding: 10px 16px; }
.contact-form legend { font-weight: 700; font-size: .95rem; padding: 0 6px; }
.f-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
.f-checks label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.f-note { font-size: .85rem; color: var(--muted); margin: 0; }
.contact-form .btn { justify-self: center; }
.form-done { text-align: center; padding: 40px; }

/* misc */
.search-status { color: var(--muted); }
.search-results { margin-top: 12px; }
.notfound { text-align: center; padding: 60px 0; }
.notfound img { margin: 0 auto; border-radius: 50%; border: 3px solid var(--ink); }
.notfound .search { max-width: 520px; margin: 20px auto; }

/* ---------- footer */
.site-footer { background: var(--teal-dk); color: #e8f0ee; margin-top: 40px; border-top: 4px solid var(--ochre); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 44px 20px 24px; display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.site-footer .logo { color: #fff; }
.footer-brand p { font-size: .88rem; opacity: .85; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fh { font-weight: 700; color: var(--ochre); margin: 0 0 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.footer-cols a { color: #e8f0ee; text-decoration: none; line-height: 2; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.copy { text-align: center; font-size: .8rem; opacity: .7; margin: 0; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.totop { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: var(--ochre); color: #fff; border: 2px solid var(--ink); display: grid; place-items: center; text-decoration: none; font-size: .8rem; line-height: 1; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.totop span { font-size: .65rem; font-weight: 700; }
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { color: #fff; background: var(--ochre-dk); }

/* ---------- responsive */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .content { min-width: 0; }
  .sidebar { position: static; }
  .rank-cols-4, .cat-tree { grid-template-columns: repeat(2, 1fr); }
  .troubles { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; padding: 10px; cursor: pointer; }
  .menu-btn span { display: block; height: 3px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .menu-btn[aria-expanded=true] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .menu-btn[aria-expanded=true] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded=true] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  .gnav { display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: var(--cream); overflow-y: auto; padding: 16px 20px 40px; border-top: 3px solid var(--ink); }
  .gnav.open { display: block; }
  .gnav > ul { flex-direction: column; }
  .gnav > ul > li + li::before { display: none; }
  .gnav > ul > li > a { padding: 14px 6px; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .has-mega > a::after { content: ""; }
  .mega { display: block; position: static; width: auto; border: 0; box-shadow: none; background: transparent; padding: 8px 0 8px 12px; }
  .mega-inner { grid-template-columns: 1fr 1fr; }
  .gnav-sp { display: block; margin-top: 20px; }
  .gnav-sp-h { font-weight: 700; margin: 20px 0 6px; }
  .gnav-sp-troubles { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .gnav-sp-troubles a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .88rem; color: var(--ink); text-decoration: none; }
  .subbar p { display: none; }
  .subbar .search { max-width: none; }
  .chars { grid-template-columns: 1fr; }
  .char { flex-direction: row; gap: 16px; align-items: flex-start; }
  .char img { width: 96px; height: 96px; flex: none; }
  .rank-cols { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
/* ---------- mobile (スマホ) */
@media (max-width: 767px) {
  body { font-size: 16px; line-height: 1.8; }
  .wrap { padding: 0 16px; }

  /* header */
  .header-inner { height: 60px; padding: 0 12px; gap: 8px; }
  .logo { font-size: .98rem; gap: 8px; min-width: 0; }
  .logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo small { font-size: .62rem; }
  .logo img { width: 36px; height: 36px; flex: none; }
  .menu-btn { width: 44px; height: 44px; flex: none; }
  .gnav { top: 60px; height: calc(100dvh - 60px); bottom: auto; padding-bottom: calc(40px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .gnav > ul > li > a { padding: 14px 4px; min-height: 48px; }
  .mega-inner { grid-template-columns: 1fr; gap: 8px; }
  .mega li a { padding: 8px 0; font-size: .95rem; }
  .mega > .mega-inner > div:last-child { display: none; } /* 困りごとは下の一覧と重複 */
  .subbar-inner { padding: 8px 12px; }

  /* 入力欄は16px以上（iPhoneで画面が拡大されるのを防ぐ） */
  .search, .subbar .search, .side-box .search { height: 46px; }
  .search input, .subbar .search input, .side-box .search input { font-size: 16px; padding: 0 14px; }
  .search button { padding: 0 16px; }
  .search button span { display: none; }
  .contact-form input:not([type=checkbox]), .contact-form textarea, .contact-form select { font-size: 16px; }
  .top-search { display: none; } /* ヘッダー下の検索と重複するため */

  /* hero slider */
  .slide { aspect-ratio: 1145 / 1374; max-height: none; }
  .slide-article { aspect-ratio: 750 / 900; }
  .slide-cap { padding: 32px 16px 34px; }
  .slide-cap p { font-size: 1.05rem; }
  .sl-dots { bottom: 8px; gap: 4px; }
  .sl-dots button { width: 28px; height: 28px; border: 0; background: transparent; position: relative; }
  .sl-dots button::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
  .sl-dots button.on::after { background: var(--ochre); border-color: var(--ochre); }
  .sl-dots button::after { box-shadow: 0 0 0 2px rgba(255,255,255,.8); }

  /* sections */
  .sec { margin: 36px 0; }
  .sec-title { font-size: 1.3rem; flex-wrap: wrap; gap: 4px 10px; }
  .sec-title .en { font-size: .7rem; }
  .sec-lead { font-size: .92rem; }

  /* tabs: 折り返さず横スクロール */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; min-height: 40px; }

  /* cards */
  .grid, .layout .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { box-shadow: 3px 3px 0 var(--line); }
  .card h3, .card-big h3 { font-size: 1.02rem; }
  .card-tags { padding: 0 14px 12px; }
  .chip { padding: 4px 12px; font-size: .82rem; }
  .more-wrap { flex-direction: column; gap: 14px; }
  .more-btn { width: 100%; min-height: 48px; }

  /* troubles */
  .troubles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .trouble { padding: 12px; box-shadow: 3px 3px 0 var(--ochre-lt); }
  .trouble-ico { font-size: 1.5rem; }
  .trouble-q { font-size: .9rem; line-height: 1.45; }
  .trouble-l { font-size: .75rem; flex-wrap: wrap; }

  /* characters */
  .char { padding: 14px; gap: 12px; }
  .char img { width: 84px; height: 84px; }
  .char h3 { font-size: 1.12rem; }
  .char p:last-child { font-size: .88rem; }

  /* category / ranking */
  .cat-tree, .rank-cols-4 { grid-template-columns: 1fr; }
  .cat-block li a { padding: 10px 16px; }
  .rank a { grid-template-columns: 26px 72px 1fr; padding: 10px 0; }
  .rank img { width: 72px; }

  /* sidebar: 本文の下では重複する検索とカテゴリーを省く */
  .sidebar .side-box:first-child, .sidebar .side-cats { display: none; }
  .side-box:has(.side-cats) { display: none; }

  /* article */
  .post { padding: 20px 16px 28px; border-width: 0; border-radius: 0; margin: 0 -16px; }
  .post-head h1, .list-head h1 { font-size: 1.4rem; line-height: 1.5; }
  .post-dates { flex-wrap: wrap; gap: 4px 12px; }
  .manga { margin: 20px -16px 8px; }
  .manga img { border-width: 0; border-radius: 0; }
  .post-thumb { margin: 18px -16px 0; border-radius: 0; border-width: 2px 0; }
  .post-body { overflow-wrap: anywhere; }
  .post-body h2 { font-size: 1.2rem; margin: 40px -4px 16px; padding: 10px 14px; }
  .post-body h3 { font-size: 1.08rem; }
  .box-body { padding: 14px 16px 2px; }
  .toc { padding: 14px 16px; }
  .toc-h3 { padding-left: 30px; }
  .fig { margin: 22px -16px; }
  .fig img { border-width: 2px 0; border-radius: 0; }
  .fig figcaption { padding: 0 16px; }
  .code { margin: 0 -16px 1.5em; border-radius: 0; font-size: .82rem; }
  .table-wrap { margin: 0 -16px 1.5em; padding: 0 16px; }
  .talk { gap: 10px; }
  .talk-face { width: 58px; font-size: .68rem; }
  .talk-face img { width: 56px; height: 56px; }
  .talk-bubble { padding: 10px 14px; max-width: calc(100% - 68px); font-size: .95rem; }
  .talk-bubble::before { top: 18px; }
  .share a, .share button { min-height: 40px; display: inline-flex; align-items: center; }
  .pager { grid-template-columns: 1fr; }

  /* contact / footer */
  .contact-form { padding: 20px 16px; }
  .f-row, .f-checks { grid-template-columns: 1fr; }
  .f-checks label { min-height: 40px; }
  .footer-inner { padding: 32px 16px 20px; gap: 24px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols a { display: inline-block; padding: 4px 0; }
  .copy { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .totop { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 48px; height: 48px; }
}
/* タッチ操作の端末ではスライドの矢印を出さない（スワイプで操作） */
@media (hover: none) and (max-width: 1080px) {
  .sl-prev, .sl-next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
a, button { -webkit-tap-highlight-color: rgba(212, 151, 43, .25); }

/* TOPタイトル画像（縦長）：PCでは背景色の帯の中央に収める */
.slide-title { background: #FEF8EE; }
@media (min-width: 768px) {
  .slide-title img { object-fit: contain; }
}

/* manga text version & sources */
.manga-text { max-width: 680px; margin: 4px auto 24px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--cream); }
.manga-text summary { cursor: pointer; padding: 10px 16px; font-weight: 700; color: var(--teal-dk); font-size: .95rem; }
.manga-text-body { padding: 0 20px 8px; font-size: .95rem; }
.box-sources { border-color: #999; background: #fafafa; font-size: .92rem; }
.box-sources .box-title { background: #666; }
.box-sources .box-title::before { content: "📚 "; }
.post-dates span::before { content: "／"; margin-right: 8px; color: var(--line); }

.badge-draft { background: #888; margin-left: 4px; }

/* カテゴリー一覧：本文（サイドバーあり）の中では2列で見やすく */
.content .cat-tree { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.content .cat-block h3 { font-size: 1.15rem; }
.content .cat-block h3 a { padding: 14px 18px; }
.content .cat-block ul { display: grid; grid-template-columns: 1fr; padding: 6px 0 10px; }
.content .cat-block li a { padding: 9px 18px; font-size: .98rem; }
@media (max-width: 767px) {
  .content .cat-tree { grid-template-columns: 1fr; }
}

/* キャラクターカード（リンク化）とプロフィールページ */
a.char { color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; box-shadow: 4px 4px 0 var(--line); }
a.char:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ochre-lt); color: var(--ink); }
.char-more { display: inline-block; margin-top: 8px; font-size: .88rem; font-weight: 700; color: var(--teal); }
.profile-head { display: flex; gap: 24px; align-items: center; margin-bottom: 20px; }
.profile-head img { width: 180px; height: 180px; border-radius: 50%; border: 3px solid var(--ink); object-fit: cover; flex: none; background: #fff; }
.profile-head h1 { font-size: 1.8rem; margin: 6px 0; }
.profile-head h1 small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.profile-meta { display: flex; gap: 20px; margin: 0; font-size: .95rem; }
.profile-meta div { display: flex; gap: 6px; }
.profile-meta dt { font-weight: 700; color: var(--teal-dk); }
.profile-meta dd { margin: 0; }
.profile-kiyota .char-role { background: var(--ochre-dk); }
.profile-dondo .char-role { background: #3f8f88; }
.expr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 20px; }
.expr-grid figure { margin: 0; text-align: center; }
.expr-grid img { width: 100%; height: auto; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.expr-grid figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.profile-others { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; padding-top: 18px; border-top: 2px dashed var(--line); font-size: .95rem; }
.profile-others a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.profile-others img { border-radius: 50%; border: 2px solid var(--ink); }
.relations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.relation { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; }
.relation h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--teal-dk); }
.relation p { margin: 0; font-size: .93rem; }
.note-fiction { font-size: .85rem; color: var(--muted); margin: 24px 0 40px; }
/* お問合せ：ボット除けの欄は画面外へ */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 767px) {
  .profile-head { flex-direction: column; text-align: center; }
  .profile-head img { width: 140px; height: 140px; }
  .profile-meta { justify-content: center; }
  .expr-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .relations { grid-template-columns: 1fr; }
}

/* ---------- 伴走支援・相談への導線 ---------- */
.support-cta { display: flex; align-items: flex-start; gap: 24px; margin: 32px 0; padding: 28px; background: var(--teal-lt); border: 2px solid var(--teal); border-radius: var(--radius); color: var(--ink); }
.support-cta > img { width: 96px; height: 96px; flex: none; border-radius: 50%; }
.support-cta-copy { min-width: 0; }
.support-cta-label { color: var(--teal-dk); font-size: .875rem; font-weight: 700; margin: 0 0 8px; }
.support-cta h2 { font-size: 1.35rem; line-height: 1.6; margin: 0 0 10px; }
.support-cta p { margin: 0 0 12px; }
.support-cta .support-cta-area { font-size: .875rem; }
.support-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.support-cta-actions .btn { font-size: 1rem; text-align: center; line-height: 1.6; padding: 12px 18px; min-height: 48px; white-space: normal; }
.support-cta a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.support-cta-sidebar { display: block; padding: 22px 18px; margin: 0 0 28px; }
.support-cta-sidebar > img { width: 76px; height: 76px; margin-bottom: 12px; }
.support-cta-sidebar h2 { font-size: 1.15rem; }
.support-cta-sidebar .support-cta-actions { display: grid; }
@media (max-width: 767px) {
  .support-cta { display: block; padding: 22px 18px; margin: 24px 0; }
  .support-cta > img { width: 72px; height: 72px; margin-bottom: 12px; }
  .support-cta h2 { font-size: 1.15rem; }
  .support-cta-actions { display: grid; }
}
