/*
 * 画像リプライのスタイル（→ docs/plan.md §6.2・D22）。デザインは C 案「ネタ・ステッカー」:
 * 黄色と墨、2px の縁取りとくっきりした影。色・縁取り・影は :root の変数にまとめている。
 * ダークモードは未対応（変数を足せば対応できる形にしている）。
 */

/* ---------- トークン ---------- */

:root {
    color-scheme: light;
    --accent: #ffd23f;
    --accent-hover: #ffc619;
    --accent-ink: #161616; /* アクセント色の上の文字 */
    --accent-text: #161616; /* 白地に置くアクセント色の文字（黄色は文字に使えないので墨） */
    --accent-soft: #fff1b8;
    --new-bg: #d81b60; /* NEW バッジ・お気に入り済み。白い文字とのコントラスト 4.5 以上（#ff4f8b は 3.1） */
    --new-ink: #ffffff;
    --bg: #fffcf0;
    --surface: #ffffff;
    --surface-2: #fff6d4; /* 入力欄・画像の台 */
    --ink: #161616;
    --ink-2: #4f4b40;
    --ink-3: #736d5c; /* 小さい補足の文字。紙・台の上でコントラスト 4.5 以上 */
    --line: #ebe2c3;
    --edge: 2px solid var(--ink); /* カード・枠の縁取り */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 3px 3px 0 var(--ink); /* くっきりした影（ステッカー風） */
    --shadow-hover: 5px 5px 0 var(--ink);
    --btn-edge: 2px solid var(--ink);
    --btn-shadow: 2px 2px 0 var(--ink);
    --title-weight: 800;
    --font:
        -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
        "Noto Sans CJK JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
    --header-h: 64px;
    --tabbar-h: 58px;
}

/* ---------- 基本 ---------- */ *,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* SP の画面を広い画面で見たとき（?view=sp・横向き）は中央の列にする */

html[data-device="sp"] body {
    background: color-mix(in srgb, var(--bg) 82%, var(--ink) 18%);
}
a {
    color: inherit;
}
img {
    max-width: 100%;
}
h1,
h2,
h3 {
    line-height: 1.35;
}
button,
input {
    font: inherit;
    color: inherit;
}
:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 70%, var(--ink));
    outline-offset: 2px;
}
.logo {
    display: inline-flex;
    flex: none;
}
.logo img {
    display: block;
    width: auto;
}

/* ---------- ボタン ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: var(--btn-edge);
    background: var(--surface);
    box-shadow: var(--btn-shadow);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.15s,
        transform 0.1s;
}
.btn:hover {
    background: var(--surface-2);
}
.btn:active {
    transform: translateY(1px);
}
.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--ink);
}

.btn--primary:hover {
    background: var(--accent-hover);
}
.btn--ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--ink-2);
}
.btn--lg {
    height: 48px;
    padding: 0 22px;
    font-size: 15px;
}
.btn--sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}
.btn--block {
    width: 100%;
}
.btn--on-dark {
    background: rgb(255 255 255 / 12%);
    border-color: rgb(255 255 255 / 20%);
    color: #fff;
    box-shadow: none;
}
.btn--on-dark:hover {
    background: rgb(255 255 255 / 20%);
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- 検索欄 ---------- */

.search {
    position: relative;
    display: flex;
    align-items: center;
}
.search > svg {
    position: absolute;
    left: 15px;
    color: var(--ink-3);
    pointer-events: none;
}
.search input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: var(--surface);
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

.search input:focus {
    border-color: var(--accent);
    background: var(--surface);
}
.search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* ---------- PC レイアウト ---------- */

.pc-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 2px solid var(--ink);
}

.pc-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: 1240px;
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 24px;
}
.pc-header .search {
    flex: 1;
    max-width: 520px;
}
.pc-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.pc-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}
.pc-nav__link:hover {
    background: var(--surface-2);
    color: var(--ink);
}
.pc-nav__link[aria-current="page"] {
    color: var(--accent-text);
}
.pc-nav .btn {
    margin-left: 8px;
}
.pc-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 36px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 24px 0;
}
.pc-main {
    min-width: 0;
}
.pc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pc-sidebar__sticky {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pc-footer {
    margin-top: 56px;
    padding: 24px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    text-align: center;
}

/* サイドバーの部品 */

.side-block {
    padding: 16px 14px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.side-block h2 {
    margin: 0 0 8px 6px;
    color: var(--ink-2);
    font-size: 12px;
    letter-spacing: 0.08em;
}
.situation-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.situation-list a {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}
.situation-list a:hover {
    background: var(--accent-soft);
}
.situation-list a[aria-current] {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}
.situation-list__count {
    color: var(--ink-3);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}
.situation-list a[aria-current] .situation-list__count {
    color: inherit;
    opacity: 0.8;
}
.post-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--accent-soft);
    box-shadow: var(--btn-shadow);
    text-decoration: none;
}
.post-cta:hover {
    filter: brightness(0.98);
}
.post-cta__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
}
.post-cta strong,
.post-cta small {
    display: block;
}
.post-cta small {
    color: var(--ink-2);
    font-size: 12px;
}
.lh-banner {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.lh-banner img {
    display: block;
    width: 100%;
    height: auto;
}
.side-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0;
    padding: 0 4px;
    list-style: none;
    font-size: 12px;
}
.side-links a {
    color: var(--ink-2);
    text-decoration: none;
}
.side-links a:hover {
    text-decoration: underline;
}

/* ---------- 見出し ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-bottom: 20px;
}
.page-head h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.page-head__count {
    color: var(--ink-2);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.page-head__lead {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: var(--ink-2);
    font-size: 13.5px;
}
.page-head__action {
    margin-left: auto;
}
.page-head--sp {
    margin: 4px 14px 14px;
}
.page-head--sp h1 {
    font-size: 19px;
}
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.section-head h2 {
    margin: 0;
    font-size: 18px;
}
.section-head__more {
    display: inline-flex;
    align-items: center;
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- カードのグリッド ---------- */

.grid {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}
.grid--pc {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 18px;
}
.grid--sp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 0 12px;
}
.grid__ad {
    grid-column: 1 / -1;
}
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    transition:
        transform 0.15s,
        box-shadow 0.15s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.card__thumb {
    display: block;
    aspect-ratio: 1;
    background: var(--surface-2);
    overflow: hidden;
    border-bottom: 2px solid var(--ink);
}

.card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}
.card:hover .card__thumb img {
    transform: scale(1.03);
}
.card__title {
    display: -webkit-box;
    margin: 10px 12px 12px;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: var(--title-weight);
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.grid--sp .card__title {
    margin: 8px 10px 10px;
    font-size: 13px;
}
.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--new-bg);
    color: var(--new-ink);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: none;
    border: 2px solid var(--ink);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: var(--edge);
    box-shadow: var(--shadow);
    color: var(--ink-2);
    text-align: center;
}
.empty p {
    margin: 0;
}

.empty--loading {
    min-height: 200px;
    justify-content: center;
    color: var(--ink-3);
}
.empty__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
}

/* ---------- 広告枠（プレースホルダ） ---------- */

.ad {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ad__label {
    color: var(--ink-3);
    font-size: 10px;
    letter-spacing: 0.1em;
}
.ad__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    border: 1.5px dashed var(--ink-3);
    border-radius: var(--radius-sm);
    background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, transparent 8px 16px);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
}
.ad__placeholder small {
    color: var(--ink-3);
    font-weight: 400;
}
.ad--pc-sidebar {
    width: 300px;
    height: 268px; /* 表記「広告」+ 300×250 */
}
.ad--pc-list {
    height: 130px;
}
.ad--pc-article {
    height: 130px;
    margin: 28px 0 8px;
}
.ad--sp-list {
    height: 300px;
}
.ad--sp-article {
    height: 300px;
    margin: 20px 12px 4px;
}

/* 本物のユニット（本番）は高さを最小値で予約し、届いた広告の高さに合わせて伸びてよい */
.ad--live {
    height: auto;
}

.ad--live.ad--pc-list,
.ad--live.ad--pc-article {
    min-height: 120px;
}

.ad--live.ad--sp-list,
.ad--live.ad--sp-article {
    min-height: 280px;
}

.ad--live.ad--pc-sidebar {
    min-height: 268px;
}

/* ---------- ページ送り ---------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 36px 0 8px;
    padding: 0 12px;
}
.pager__pages {
    display: flex;
    gap: 4px;
}
.pager a,
.pager span[aria-current],
.pager__gap {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}
.pager a:hover {
    background: var(--surface);
}
.pager span[aria-current] {
    background: var(--ink);
    color: var(--surface);
    font-weight: 700;
}
.pager__gap {
    min-width: 20px;
    color: var(--ink-3);
}
.pager .pager__step {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: var(--btn-edge);
    background: var(--surface);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.pager .pager__step[aria-disabled] {
    opacity: 0.4;
}
[data-device="sp"] .pager__pages a:not([rel]),
[data-device="sp"] .pager__gap {
    display: none;
}

/* ---------- 続きの読み込み（island） ---------- */

.grid--more {
    margin-top: 22px;
}

.grid--sp.grid--more {
    margin-top: 14px;
}

.more__status {
    display: flex;
    justify-content: center;
    min-height: 1px;
    margin-top: 24px;
    color: var(--ink-3);
    font-size: 13px;
}

/* 続きを 1 ページでも足したら、ページ送りは隠す（JS が無いときとクローラーはページ送りで辿る） */
.list:has(.more[data-loaded]) .pager {
    display: none;
}

/* ---------- チップ ---------- */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: var(--surface);
    font-size: 13px;
    text-decoration: none;
}

.chip:hover {
    background: var(--surface-2);
}
.chip svg {
    color: var(--ink-3);
}
.chip--situation {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 700;
}
.chip__count {
    margin-left: 4px;
    color: var(--ink-3);
    font-size: 11px;
}

/* ---------- 個別ページ（PC） ---------- */

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    color: var(--ink-2);
    font-size: 12.5px;
}
.crumbs a {
    text-decoration: none;
}
.crumbs a:hover {
    text-decoration: underline;
}
.crumbs svg {
    color: var(--ink-3);
}
.crumbs [aria-current] {
    overflow: hidden;
    max-width: 24em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article__title {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 800;
}
.article .chips {
    margin-bottom: 18px;
}
.stage {
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface-2);
}
/* 幅: 画像の幅（--w）・枠の幅・縦 70vh に収まる幅のうち最小。--w / --ar は lib/images の imageBoxStyle */
.stage__link {
    display: block;
    width: min(100%, var(--w), calc(70vh * var(--ar)));
    cursor: zoom-in;
}
.stage img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 14px;
}
.actions .btn--ghost {
    margin-left: auto;
}
.fav-button[aria-pressed="true"] {
    background: var(--new-bg);
    color: #ffffff;
}

.fav-button[aria-pressed="true"] svg {
    fill: currentColor;
}

.related {
    margin-top: 40px;
}

/* ---------- 共有リンク ---------- */

.share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.share__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 6px;
    border-radius: 999px;
    border: var(--btn-edge);
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.share__link:hover {
    background: var(--surface-2);
}
.share__icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #fff;
}
.share__link--line .share__icon {
    background: #06c755;
}
.share__link--x .share__icon {
    background: #000;
}
.share__link--facebook .share__icon {
    background: #1877f2;
}
.share__link--hatena .share__icon {
    background: #0078a8; /* はてなの #00a4de だと白い「B!」のコントラストが 2.85 で足りない */
}
.share__link--mail .share__icon {
    background: var(--ink-2);
}
.share__hatena {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

/* SP は丸いボタン + 下にラベル（共有シート風） */

.share--sp {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
    margin-top: 18px;
}
.share--sp .share__link {
    flex-direction: column;
    gap: 4px;
    height: auto;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-2);
}
.share--sp .share__icon {
    width: 48px;
    height: 48px;
}
.share--sp .share__icon svg {
    width: 24px;
    height: 24px;
}
.share--sp .share__hatena {
    font-size: 15px;
}

/* ---------- SP レイアウト ---------- */

.sp {
    position: relative;
    max-width: 560px;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    background: var(--bg);
}
.sp-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 2px solid var(--ink);
}
.search--sp {
    flex: 1;
    min-width: 0;
}
.search--sp > svg {
    left: 12px;
}
.search--sp input {
    height: 38px;
    padding-left: 34px;
    font-size: 16px; /* iOS の自動ズームを避ける */
}
.sp-main {
    padding-top: 4px;
}
.sp-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    padding: 20px 16px 24px;
    color: var(--ink-3);
    font-size: 12px;
}
.sp-footer a {
    color: var(--ink-2);
}
.situation-scroller {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    overflow-x: auto;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.situation-scroller::-webkit-scrollbar {
    display: none;
}
.situation-scroller a {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: var(--btn-edge);
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 32px;
    text-decoration: none;
    scroll-snap-align: start;
}
.situation-scroller a[aria-current="page"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--surface);
}
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    max-width: 560px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 2px solid var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    transform: translateX(-50%);
}

.tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tabbar-h);
    color: var(--ink-2);
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
}
.tabbar__item[aria-current="page"] {
    color: var(--accent-text);
}
.tabbar__item[aria-current="page"] .tabbar__icon {
    border-radius: 999px;
    background: var(--accent);
}
.tabbar__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 28px;
}
.tabbar__item--post .tabbar__icon {
    width: 44px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 2px solid var(--ink);
}

/* ---------- 個別ページ（SP） ---------- */

.sp-stage {
    display: grid;
    place-items: center;
    margin: 0;
    background: var(--surface-2);
    border-bottom: 2px solid var(--ink);
}

/* 幅: 画面の幅いっぱい（縦長の画像は縦 75vh に収まる幅）。--ar は lib/images の imageBoxStyle */
.sp-stage a {
    display: block;
    width: min(100%, calc(75vh * var(--ar)));
}
.sp-stage img {
    display: block;
    width: 100%;
    height: auto;
}
.sp-article__body {
    padding: 16px 14px 0;
}
.article__title--sp {
    font-size: 20px;
    margin-bottom: 10px;
}
.sp-article .chips {
    margin-bottom: 18px;
}
.sp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.sp-actions .btn {
    height: 44px;
}
.related--sp {
    margin-top: 32px;
}
.related--sp .section-head {
    padding: 0 14px;
}
.related--sp .section-head h2 {
    font-size: 16px;
}
.sp-article__crumbs {
    margin-top: 24px;
    padding: 0 14px;
}

/* ---------- フルスクリーン ---------- */

.fs {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100dvh;
    background: #121212;
    color: #fff;
}
.fs__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
}
.fs__stage {
    display: grid;
    place-items: center;
    padding: 8px;
}
/* 幅: 画像の幅（--w）・画面の幅・縦に収まる幅のうち最小。--w / --ar は lib/images の imageBoxStyle */
.fs__stage img {
    display: block;
    width: min(100%, var(--w), calc((100dvh - 140px) * var(--ar)));
    height: auto;
}
.fs__foot {
    display: flex;
    justify-content: center;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}

/* ---------- 投稿 ---------- */

.post__head h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
}
.post__head p {
    margin: 0 0 16px;
    color: var(--ink-2);
    font-size: 13.5px;
}
.steps {
    display: flex;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 700;
}
.steps li span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12px;
}
.steps li[aria-current] {
    background: var(--accent-soft);
    color: var(--accent-text);
}
.steps li[aria-current] span {
    background: var(--accent);
    color: var(--accent-ink);
}
.post__form {
    display: grid;
    gap: 28px;
}
.post--pc .post__form {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
}
.post--pc .post__image {
    position: sticky;
    top: calc(var(--header-h) + 20px);
}
.post--sp {
    padding: 8px 14px 0;
}
.post--sp .post__head h1 {
    font-size: 20px;
}
.post--sp .steps li {
    padding: 6px 8px;
    font-size: 11.5px;
}
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 1;
    padding: 24px;
    border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-2);
    text-align: center;
    cursor: pointer;
}
.post--sp .dropzone {
    aspect-ratio: 4 / 3;
}
.dropzone:hover {
    background: var(--accent-soft);
}
.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.dropzone strong {
    color: var(--ink);
    font-size: 16px;
}
.dropzone small {
    color: var(--ink-3);
}
.dropzone__icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 4px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
}
.dropzone--filled {
    padding: 12px;
    border-style: solid;
    border-color: var(--line);
    background: var(--surface-2);
    cursor: default;
}
.dropzone--filled img {
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
}
.dropzone__clear {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: rgb(0 0 0 / 60%);
    color: #fff;
    cursor: pointer;
}
.post__note {
    margin: 10px 2px 0;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.6;
}
.post__fields {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
}
.field label,
.field legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
}
.field legend {
    margin-bottom: 8px;
}
.field__req,
.field__opt {
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
}
.field__req {
    background: var(--accent);
    color: var(--accent-ink);
}
.field__opt {
    background: var(--surface-2);
    color: var(--ink-2);
}
.field__sub {
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 400;
}
.field > input {
    height: 46px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--ink);
    background: var(--surface);
    font-size: 16px;
    outline: none;
}

.field > input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field__hint {
    display: flex;
    justify-content: space-between;
    color: var(--ink-3);
    font-size: 12px;
}
.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.choice span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: var(--btn-edge);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
}
.choice svg {
    display: none;
}
.choice input:checked + span {
    border-color: var(--ink);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}

.choice input:checked + span svg {
    display: block;
}
.choice input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--accent) 70%, var(--ink));
    outline-offset: 2px;
}
.tag-input__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tag-input__chips li {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 30px;
    padding: 0 4px 0 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
}
.tag-input__chips button {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: none;
    color: inherit;
    cursor: pointer;
}
.post__rules {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12.5px;
}
.post__rules h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 13px;
}
.post__rules ul {
    margin: 0;
    padding-left: 1.2em;
}

.post__alert {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid #c62828;
    background: #fff1f0;
    color: #a31515;
    font-size: 14px;
    font-weight: 700;
}

.field__error {
    margin: 0;
    color: #c62828;
    font-size: 12.5px;
    font-weight: 700;
}

.field > input[aria-invalid] {
    border-color: #c62828;
}

.dropzone--over {
    background: var(--accent-soft);
    border-style: solid;
}

.dropzone[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.choice input:disabled + span {
    opacity: 0.4;
    cursor: not-allowed;
}

.tag-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tag-suggest button {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px dashed var(--ink-3);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
}

.tag-suggest button:hover {
    background: var(--accent-soft);
}

.tag-suggest span {
    color: var(--ink-3);
    font-size: 11px;
}

.post-confirm {
    display: grid;
    gap: 20px;
    padding: 20px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.post--pc .post-confirm {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
}

.post-confirm__image {
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.post-confirm__image img {
    display: block;
    max-height: 60vh;
    border-radius: 6px;
}

.post-confirm__list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    margin: 0;
    font-size: 14px;
}

.post-confirm__list dt {
    color: var(--ink-2);
    font-weight: 700;
}

.post-confirm__list dd {
    margin: 0;
}

.post-confirm__title {
    font-size: 18px;
    font-weight: 800;
}

.post-confirm__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    grid-column: 1 / -1;
}

.post--sp .post-confirm__actions .btn {
    flex: 1;
}

.delete-post {
    margin-top: 20px;
}

.delete-post__confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: #fff1f0;
    font-size: 13px;
}

.delete-post__error {
    margin: 6px 0 0;
    color: #c62828;
    font-size: 12.5px;
}

.btn--danger {
    background: #c62828;
    border-color: #8e1b1b;
    color: #ffffff;
}

.btn--danger:hover {
    background: #b71c1c;
}

.toast {
    position: fixed;
    top: calc(var(--header-h) + 16px);
    left: 50%;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    border: var(--edge);
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: var(--shadow);
    font-weight: 800;
    transform: translateX(-50%);
    animation: toast-in 0.25s ease-out;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
}

/* ---------- お気に入り・最近見た画像 ---------- */

.segmented {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 18px;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface-2);
}
.segmented a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}
.segmented a[aria-current="page"] {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}
.saved--sp {
    padding-top: 10px;
}
.saved--sp .segmented {
    display: flex;
    margin: 0 12px 14px;
}
.saved--sp .segmented a {
    flex: 1;
    justify-content: center;
}
.saved--sp .page-head {
    margin: 0 14px 14px;
}
.saved--sp .page-head h1 {
    font-size: 19px;
}
.saved--sp .empty {
    margin: 0 12px;
}
.saved__item {
    position: relative;
}
.saved__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgb(0 0 0 / 55%);
    color: #fff;
    cursor: pointer;
}

/* ---------- 検索ページ ---------- */

.search-home h1 {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 800;
}
.search-home h2 {
    margin: 28px 0 12px;
    font-size: 16px;
}
.search--hero input {
    height: 52px;
    padding-right: 96px;
    font-size: 16px;
    background: var(--surface);
}
.search--hero > svg {
    left: 18px;
}
.search--hero input {
    padding-left: 48px;
}
.search--hero .btn {
    position: absolute;
    right: 6px;
    height: 40px;
}
.situation-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.search-home--sp {
    padding: 14px 14px 0;
}
.search-home--sp h1 {
    font-size: 20px;
}
.search-home--sp .situation-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.search-home--sp .situation-tiles a {
    font-size: 13px;
    line-height: 1.35;
}
.situation-tiles a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 48px;
    height: 100%;
    padding: 8px 12px 8px 14px;
    border-radius: var(--radius-sm);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.situation-tiles a:hover {
    background: var(--accent-soft);
}
.situation-tiles span {
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 400;
}

/* ---------- 文書・案内ページ（運営について・404・エラー） ---------- */

.doc {
    max-width: 720px;
    padding: 28px 32px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.doc h1 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 800;
}

.doc p {
    margin: 0 0 12px;
    line-height: 1.9;
}

.message-page {
    max-width: 560px;
    margin: 24px auto;
    padding: 36px 28px;
    border-radius: var(--radius);
    border: var(--edge);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.message-page h1 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
}

.message-page p {
    margin: 0 0 16px;
    color: var(--ink-2);
}

[data-device="sp"] .doc,
[data-device="sp"] .message-page {
    margin: 16px 12px;
    padding: 22px 18px;
}

/* ---------- dev 専用（Phase 3 のレビュー用） ---------- */

.dev-toolbar {
    position: fixed;
    right: 12px;
    bottom: calc(var(--tabbar-h) + 16px);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font:
        600 12px / 1 system-ui,
        sans-serif;
    box-shadow: 0 6px 20px rgb(0 0 0 / 30%);
}
[data-device="pc"] .dev-toolbar {
    bottom: 16px;
}
.dev-toolbar a {
    color: #ccc;
    text-decoration: none;
}
.dev-toolbar span {
    display: flex;
    gap: 2px;
}
.dev-toolbar span a {
    padding: 5px 8px;
    border-radius: 999px;
}
.dev-toolbar a[aria-current] {
    background: #fff;
    color: #111;
}
