/* =========================================================
   公開側テーマ — 白 × ピンク (Claude Design の PoC を実装したもの)
   ---------------------------------------------------------
   トークンは PoC の :root をそのまま写している。旧テーマ (黒×金) の
   --color-* 名は互換のため残してあり、新トークンへ向け直してある。
   管理画面 (body.admin-body 配下) はこの下の独立ブロックで上書きする。
   ========================================================= */
:root {
  --font-sans: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  /* 見出しも本文と同じサンセリフ。旧テーマの明朝は使わない (変数は互換のため残す) */
  --font-serif: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* アクセント */
  --pink: #ff4d8d;
  --pink-hover: #f03c7c;
  --pink-deep: #c0155c;
  --tint: #fff4f8;
  --tint2: #ffeaf1;

  /* 無彩色 (わずかにピンク寄り)。2行1組で、1行目は oklch 非対応ブラウザ用の近似値 */
  --ink: #281e25;
  --ink: oklch(0.25 0.02 340);
  --muted: #7c7178;
  --muted: oklch(0.56 0.018 340);
  --line: #eae2e7;
  --line: oklch(0.92 0.012 340);
  --surface: #fdf9fb;
  --surface: oklch(0.985 0.006 340);

  --radius-card: 12px;
  --radius-panel: 18px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(40, 30, 37, 0.05);
  --shadow-raise: 0 14px 32px -16px rgba(192, 21, 92, 0.35);
  --shadow-cta: 0 8px 20px -8px rgba(255, 77, 141, 0.6);

  /* --- 旧トークン名の互換 (取りこぼしても破綻しないようにするため) --- */
  --color-bg: #fff;
  --color-bg-soft: var(--surface);
  --color-surface: #fff;
  --color-surface-raised: var(--tint);
  --color-border: var(--line);
  --color-border-strong: var(--pink);
  --color-text: var(--ink);
  --color-text-soft: var(--muted);
  --color-muted: var(--muted);
  --color-gold: var(--pink);
  --color-gold-bright: var(--pink-deep);
  --color-gold-deep: var(--pink-hover);
  --color-wine: var(--pink-deep);
  --color-wine-bright: var(--pink);

  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.8;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pink-deep); text-decoration: none; }
a:hover { color: var(--pink); }
img { display: block; max-width: 100%; }

/* --- 年齢確認 --- */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 244, 248, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.age-gate-box {
  position: relative;
  background: linear-gradient(180deg, var(--tint) 0%, #fff 55%);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 2.5rem 2rem 2rem;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 24px 60px -20px rgba(192, 21, 92, 0.35);
}
.age-gate-box::before {
  content: "AGE VERIFICATION";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pink);
  margin-bottom: 1rem;
}
.age-gate-box p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  margin: 0;
}
.age-gate-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.age-gate-noscript {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #fff;
  color: var(--ink);
  padding: 2rem;
  text-align: center;
}

/* --- 広告表記 (ステマ規制対策。全ページ共通の一括表記) --- */
.ad-disclosure {
  background: var(--tint2);
  color: var(--pink-deep);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--line);
}

/* --- ヘッダー --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--pink-deep); }
.site-badge {
  font-family: var(--font-mono);
  background: var(--pink);
  border: none;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  flex: none;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--pink);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.site-nav a:hover { color: var(--pink); }
.site-nav a:hover::after { transform: scaleX(1); }

/* 検索は PoC のピル型フィールド。form 自体を枠にして、中身は枠なしで並べる */
.search-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 40px;
  padding: 0 0.25rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  flex: 1 1 220px;
  max-width: 340px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.search-form:focus-within { border-color: var(--pink); background: #fff; }
.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0;
  border: none;
  outline: none;
}
.search-form input::placeholder { color: var(--muted); }
/* type="search" の既定装飾 (Safariの丸枠・内側の余白) を消して枠は form 側に任せる */
.search-form input[type="search"] { -webkit-appearance: none; appearance: none; }
.search-form input::-webkit-search-decoration { -webkit-appearance: none; }
.search-form button {
  flex: none;
  height: 32px;
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--pink);
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.search-form button:hover { background: var(--pink-hover); }

/* --- 本文 --- */
.site-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem;
}
.section { margin-bottom: 3.5rem; }

/* --- パンくず (SEO: 内部リンク構造 + BreadcrumbList構造化データと対) --- */
.breadcrumb {
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--line); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--pink); }
.breadcrumb span[aria-current] {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26em;
}

/* --- トップのリード (h1を1つ持たせる。PoC のヒーローカード) --- */
.page-intro {
  margin: 0 0 3rem;
  padding: 2.75rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--tint) 0%, #fff 100%);
}
.page-intro-title {
  font-size: clamp(1.65rem, 1.1rem + 2vw, 2.375rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.75rem;
  text-wrap: pretty;
}
.page-intro-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.9;
  max-width: 44em;
  text-wrap: pretty;
}

/* --- 見出し ---
   data-eyebrow を付けると PoC の英字ラベル (RANKING 等) が上に出る。
   付けなければ見出しだけになるので、既存ページはそのままでも壊れない */
.section-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1.35rem;
}
.section-title[data-eyebrow]::before {
  content: attr(data-eyebrow);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pink);
}
.empty-message, .search-count { color: var(--muted); font-size: 0.875rem; }
.search-count { margin: -0.75rem 0 1.25rem; }

/* --- カードグリッド ---
   PoC のカードは枠も影も持たず、サムネイルだけが角丸+1px枠。
   並びは サムネ / タイトル(2行) / メタ / タグ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.75rem 1.25rem;
}
.video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s ease;
}
.video-card:hover { transform: none; color: var(--pink-deep); }
.video-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.video-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.video-card:hover .video-card-media {
  border-color: var(--pink);
  box-shadow: var(--shadow-raise);
}
.video-card:hover .video-card-media img { transform: scale(1.05); }
.video-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
  border-top: none;
}
.video-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-creator {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-card-tags {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  padding: 0;
  border-top: none;
  background: none;
}

/* --- タグチップ --- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  font-size: 0.6875rem;
  line-height: 1.7;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
a.tag-chip:hover { background: var(--tint); color: var(--pink); border-color: var(--pink); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list .tag-chip { padding: 0.4rem 0.9rem; font-size: 0.8125rem; }
.tag-count { margin-left: 0; font-family: var(--font-mono); color: var(--muted); font-size: 0.6875rem; }
a.tag-chip:hover .tag-count { color: inherit; }
.tag-search-form { max-width: 420px; margin-bottom: 1.5rem; }

.section-more { margin: 1.5rem 0 0; }
.section-more a {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pink-deep);
}
.section-more a:hover { color: var(--pink); }

/* --- 詳細ページ (item.php / work.php) ---
   PoC の作品詳細に合わせ、左に本体・右に追従するCTAパネルを置く2カラム。
   マークアップは thumb / panel / body の3ブロックで、狭い画面ではそのまま縦に積む */
.item-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas:
    "thumb panel"
    "body  panel";
  gap: 1.75rem 2.25rem;
  align-items: start;
  margin-bottom: 3.5rem;
}
.item-detail-thumb {
  grid-area: thumb;
  margin: 0;
  border-radius: var(--radius-panel);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
/* aspect-ratio で先に領域を確保する。指定が無いと画像読み込み時に本文が下へずれ、
   Core Web Vitals の CLS が悪化する (カード側は .video-card-media で既に確保済み) */
.item-detail-thumb img { width: 100%; display: block; aspect-ratio: 1 / 1; object-fit: cover; }
.item-detail-body { grid-area: body; min-width: 0; }
.item-detail-panel {
  grid-area: panel;
  position: sticky;
  top: 5.5rem;
  margin: 0;
  background: linear-gradient(180deg, var(--tint) 0%, #fff 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 1.5rem;
}
.item-detail-title {
  font-size: 1.3rem;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: pretty;
}
.item-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.78125rem;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}
.item-detail-meta span { margin-right: 0; }
.item-detail-meta a { color: var(--pink-deep); font-weight: 500; }
.item-detail-meta a:hover { color: var(--pink); }
.item-detail-tags { margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.item-detail-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.pr-label {
  background: var(--pink);
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  flex: none;
  align-self: center;
}
.item-detail-note {
  display: block;
  margin: 0.9rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--muted);
}
.item-detail-description {
  margin: 0 0 2rem;
  white-space: pre-line;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.95;
  text-wrap: pretty;
}
.share-buttons {
  display: flex;
  gap: 0.6rem;
  margin: 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

/* --- クリエイタープロフィール (creator.php / work.php) --- */
.creator-profile {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem 2rem;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 1.75rem;
}
.creator-profile-thumb {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}
.creator-profile-thumb img { width: 100%; display: block; aspect-ratio: 1 / 1; object-fit: cover; }
.creator-profile-body .section-title { margin-top: 0; margin-bottom: 0.4rem; }
.creator-profile-body .item-detail-description { margin-bottom: 1.5rem; }
.creator-profile-body .item-detail-cta { margin-bottom: 0; }

/* --- ボタン --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: var(--font-sans);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-primary, .btn-cta {
  background: var(--pink);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover, .btn-cta:hover { background: var(--pink-hover); color: #fff; transform: translateY(-1px); }
.btn-cta {
  flex: 1;
  min-height: 56px;
  font-size: 1.0625rem;
  padding: 0.9rem 1.5rem;
  border-radius: 14px;
  animation: cta-glow 2.8s ease-in-out infinite;
}
@keyframes cta-glow {
  0%, 100% { box-shadow: 0 8px 20px -8px rgba(255, 77, 141, 0.6); }
  50% { box-shadow: 0 10px 30px -6px rgba(255, 77, 141, 0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-cta { animation: none; }
  .video-card-media img, .video-card, .btn { transition: none; }
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--pink); color: var(--pink); background: var(--tint); }
.btn-share {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.55rem 1.2rem;
}
.btn-share:hover { border-color: var(--pink); color: var(--pink); background: var(--tint); }

/* --- ページング --- */
.pagination {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 2.75rem;
}
.pagination-link {
  height: 38px;
  padding: 0 1.1rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.pagination-link:hover { border-color: var(--pink); color: var(--pink); background: var(--tint); }
.pagination-current { color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; }

/* --- フッター --- */
.site-footer {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1.5rem 2.25rem;
  font-size: 0.8125rem;
  line-height: 1.9;
}
.site-footer a { color: var(--pink-deep); font-weight: 500; }
.site-footer a:hover { color: var(--pink); }
.site-footer-adult { color: var(--pink-deep); font-weight: 700; margin: 0; }
.site-footer-links { margin: 1rem 0; }
.site-footer-copy { color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono); margin: 0; }

/* --- 404 --- */
.not-found { text-align: center; padding: 3.5rem 0; }
.not-found .section-title { align-items: center; }

/* --- 静的ページ (運営者情報など) --- */
.static-page { max-width: 760px; }
.static-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.7rem 1.75rem;
  margin: 0 0 2.25rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.static-dl dt { color: var(--muted); font-size: 0.8125rem; }
.static-dl dd { margin: 0; font-size: 0.9375rem; }
.static-content h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.6rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--pink);
  line-height: 1.6;
}
.static-content p, .static-content div { color: var(--ink); font-size: 0.9375rem; }

/* --- お問い合わせフォーム --- */
.contact-form { max-width: 560px; margin-top: 1.5rem; }
.contact-form label { display: block; font-weight: 700; font-size: 0.875rem; margin: 1.25rem 0 0.4rem; color: var(--ink); }
.contact-form label small { font-weight: normal; color: var(--muted); }
.contact-form input[type=text], .contact-form input[type=email], .contact-form input[type=url],
.contact-form textarea, .contact-form select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--tint2);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  background: var(--tint2);
  color: var(--pink-deep);
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(192, 21, 92, 0.25);
  font-size: 0.875rem;
}
.form-success {
  background: var(--tint);
  color: var(--pink-deep);
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--pink);
  font-size: 0.9375rem;
}

/* --- 本文 + 右サイドバーの2カラム (TOPページ) --- */
.page-with-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}
/* grid の子は既定で min-width:auto のため、カードグリッドの最小幅に押されて
   カラムがはみ出す。minmax(0,1fr) と対で min-width:0 を明示しておく */
.page-main { min-width: 0; }
.side-column { min-width: 0; }

.side-widget {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 1.25rem 1.25rem 1.35rem;
  margin-bottom: 1.75rem;
}
.side-widget-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.side-widget-note { margin: 0.5rem 0 0; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); }
.side-widget-more { margin: 1rem 0 0; font-size: 0.8125rem; }

.rank-list { list-style: none; margin: 0.5rem 0 0; padding: 0; counter-reset: rank; }
.rank-item + .rank-item { border-top: 1px solid var(--line); }
.rank-link {
  display: grid;
  grid-template-columns: 24px 52px minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  color: var(--ink);
  transition: color 0.2s ease;
}
.rank-link:hover { color: var(--pink-deep); }
.rank-no {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}
/* 上位3件だけ塗って、順位が一目で分かるようにする */
.rank-no-1 { background: var(--pink); border-color: var(--pink); color: #fff; }
.rank-no-2, .rank-no-3 { background: var(--tint2); border-color: var(--tint2); color: var(--pink-deep); }
.rank-thumb {
  display: block;
  width: 52px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.rank-thumb-round { border-radius: 50%; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank-body { min-width: 0; }
.rank-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
}
.rank-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 詳細ページは、右カラムが入るだけの幅が無くなったら縦積みにする */
@media (max-width: 1000px) {
  .item-detail {
    grid-template-columns: 1fr;
    grid-template-areas: "thumb" "panel" "body";
    gap: 1.5rem;
  }
  .item-detail-thumb { width: 100%; max-width: 620px; margin: 0 auto; }
  .item-detail-panel { position: static; top: auto; }
}

/* サイドバーを本文の下に回す。回した先では横に広がりすぎないよう2列にする */
@media (max-width: 900px) {
  .page-with-side { grid-template-columns: 1fr; gap: 0; }
  .side-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.5rem; }
}

@media (max-width: 760px) {
  .site-main { padding-left: 1.1rem; padding-right: 1.1rem; }
  .page-intro { padding: 1.75rem 1.4rem; }
  .creator-profile { grid-template-columns: 1fr; padding: 1.4rem 1.25rem 1.6rem; }
  .creator-profile-thumb { max-width: 180px; }
  .item-detail-panel { padding: 1.25rem; }
}

@media (max-width: 600px) {
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 1.4rem 0.9rem; }
  .section { margin-bottom: 2.5rem; }
  .section-title { font-size: 1.2rem; }

  /* --- モバイルのヘッダーは2段に圧縮する ---
     1段目に「タイトル + 検索」、2段目に「ナビ」を置いて高さを抑える。
     (以前 flex-direction:column にしたら sticky ヘッダーだけで画面の1/3を占めた) */
  .ad-disclosure {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.75rem;
  }
  .site-header-inner {
    padding: 0.5rem 0.9rem 0.45rem;
    gap: 0.45rem 0.6rem;
    align-items: center;
  }
  /* サイト名が長い場合は検索を潰さずタイトル側をクリップする (min-width:0 + overflow) */
  .site-title {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 1.05rem;
    gap: 0.35rem;
  }
  .site-badge { font-size: 0.55rem; padding: 0.1rem 0.35rem; }
  /* 検索はタイトルと同じ行に置き、余った幅だけを使う */
  .search-form {
    order: 2;
    flex: 1 1 6rem;
    min-width: 0;
    max-width: none;
    height: 34px;
    padding: 0 0.2rem 0 0.75rem;
    margin-left: auto;
  }
  .search-form input { font-size: 0.8rem; }
  .search-form button { height: 26px; font-size: 0.72rem; padding: 0 0.7rem; }
  /* ナビは折り返さず横スクロールにする。折り返すと端末幅でヘッダーの高さが変わるため */
  .site-nav {
    order: 3;
    flex: 0 0 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  /* 横スクロール時は下線ではなくチップにする (タップ領域を確保するため) */
  .site-nav a {
    font-size: 0.75rem;
    padding: 0.28rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: #fff;
  }
  .site-nav a::after { display: none; }
  .site-nav a:hover { border-color: var(--pink); background: var(--tint); }

  /* ヘッダーが縮んだぶん本文の上余白も詰める */
  .site-main { padding-top: 1.25rem; }
  .item-detail-title { font-size: 1.15rem; }
  .btn-cta { font-size: 1rem; min-height: 52px; }
}
.age-gate-overlay[hidden] { display: none !important; }



/* =========================================================
   管理画面 (admin) — 公開側の白/ピンクテーマとは独立した
   実務向けの落ち着いたライトテーマ。body.admin-body 配下のみに適用する。
   ========================================================= */
body.admin-body {
  background: #f4f2ef;
  color: #2a2320;
  font-family: var(--font-sans);
  line-height: 1.6;
  letter-spacing: normal;
}
body.admin-body a { color: #8a5a25; }
body.admin-body a:hover { color: #6b4419; }

/* --- レイアウト: 左サイドバー + 本文 --------------------------------- */
.admin-layout { display: flex; min-height: 100vh; align-items: stretch; }

.admin-sidebar {
  flex: 0 0 220px;
  width: 220px;
  background: #2f2823;
  color: #e6ded4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.admin-brand {
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 700;
  letter-spacing: 0.04em;
}
body.admin-body .admin-brand a { color: #f0e2cd; text-decoration: none; }
body.admin-body .admin-brand a:hover { color: #fff; }

.admin-nav { flex: 1 1 auto; padding: 0.75rem 0 1.25rem; }
.admin-nav-group { margin-bottom: 0.35rem; }
.admin-nav-title {
  margin: 0;
  padding: 0.7rem 1.15rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #a2917f;
}
.admin-nav-list { list-style: none; margin: 0; padding: 0; }
body.admin-body .admin-nav-link {
  display: block;
  padding: 0.45rem 1.15rem 0.45rem 1.7rem;
  font-size: 0.88rem;
  color: #ded4c8;
  text-decoration: none;
  border-left: 3px solid transparent;
}
body.admin-body .admin-nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
body.admin-body .admin-nav-link.is-active {
  background: rgba(182,144,90,0.22);
  border-left-color: #c99f63;
  color: #fff;
  font-weight: 700;
}

.admin-sidebar-foot {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
}
body.admin-body .admin-sidebar-foot a { color: #c9b79f; text-decoration: none; }
body.admin-body .admin-sidebar-foot a:hover { color: #fff; }

.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  padding: 0.9rem 1.75rem;
  background: #fff;
  border-bottom: 1px solid #e5ddd3;
}
.admin-header h1 { font-size: 1.2rem; margin: 0; }
.admin-user { font-size: 0.85rem; color: #6f625a; }
.admin-content { padding: 1.5rem 1.75rem 3rem; max-width: 1200px; }

/* 本文中の見出し。公開側のセリフ体見出しとは別に、控えめなセクション見出しにする */
.admin-content h2 {
  font-size: 1.02rem; margin: 1.75rem 0 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid #e0d5c6; color: #3a2f28;
}
.admin-content > h2:first-child { margin-top: 0; }
.admin-content h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; color: #3a2f28; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.admin-table th, .admin-table td { border: 1px solid #e5ddd3; padding: 0.55rem 0.75rem; text-align: left; font-size: 0.9rem; }
.admin-table th { background: #efe6da; font-weight: 700; white-space: nowrap; }
.admin-table tr:hover td { background: #faf6f0; }
/* 「公開 / 注目」「生成済」など短い値が縦積みになるのを防ぐ */
.admin-table td.nowrap, .admin-table td.status-cell { white-space: nowrap; }
/* 操作列。ボタンが縦積みにならないようにする */
.admin-table td.admin-cell-actions { white-space: nowrap; }
/* 編集中の行。一覧のどれを編集しているのか一目で分かるようにする */
.admin-table tr.is-editing td { background: #fbf1de; box-shadow: inset 3px 0 0 #b6905a; }
.admin-table tr.is-editing:hover td { background: #f8ead0; }

/* 一覧の「編集」を押すとページ上部のフォームが編集モードに変わる。
   追加フォームと見分けが付かず「押しても反応が無い」ように見えるため、枠で囲って明示する。 */
.admin-edit-panel {
  background: #fffdf8;
  border: 1px solid #e0d5c6;
  border-left: 4px solid #b6905a;
  border-radius: 4px;
  padding: 0.25rem 1.25rem 1.25rem;
  margin-bottom: 1.75rem;
}
.admin-edit-panel h2 { border-bottom-color: #ece2d2; }
.admin-edit-target { font-size: 0.85rem; font-weight: normal; color: #8a7d72; margin-left: 0.5rem; }

.admin-form label { display: block; font-weight: 700; margin: 1.1rem 0 0.35rem; color: #3a2f28; }
.admin-form label small { font-weight: normal; color: #8a7d72; }
.admin-form input[type=text], .admin-form input[type=url], .admin-form input[type=password],
.admin-form input[type=datetime-local], .admin-form input[type=number],
.admin-form textarea, .admin-form select {
  width: 100%; max-width: 520px; padding: 0.55rem 0.7rem;
  border: 1px solid #ddd3c8; border-radius: 4px; background: #fff; color: #2a2320;
  font-family: var(--font-sans); vertical-align: middle;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
  outline: none; border-color: #b6905a; box-shadow: 0 0 0 2px rgba(182, 144, 90, 0.2);
}
.admin-form textarea { min-height: 120px; }
.admin-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.admin-error { background: #fdecea; color: #8a1f11; padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; border: 1px solid #f3c6c0; }
.admin-success { background: #e9f7ef; color: #1e6b3c; padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; border: 1px solid #bfe6cf; }
.thumb-preview img { max-width: 220px; border-radius: 4px; margin-top: 0.5rem; border: 1px solid #ddd3c8; }

body.admin-body .btn {
  font-family: var(--font-sans); border-radius: 4px; letter-spacing: normal; font-weight: 600;
  padding: 0.45rem 1rem; font-size: 0.85rem; vertical-align: middle;
}
body.admin-body .btn-primary { background: #b6905a; color: #fff; box-shadow: none; }
body.admin-body .btn-primary:hover { background: #a17c48; filter: none; transform: none; }
body.admin-body .btn-secondary { background: #e7e0d6; color: #3a2f28; border-color: transparent; }
body.admin-body .btn-secondary:hover { background: #ddd3c4; }
/* 管理画面では btn-cta を「削除」等の危険操作ボタンとして使っている。
   公開側の巨大な光るCTAスタイルを打ち消し、赤系の小さなボタンにする。 */
body.admin-body .btn-cta {
  flex: none; animation: none; box-shadow: none;
  background: #fff; color: #a5301f; border-color: #e2b7b0; font-weight: 600;
}
body.admin-body .btn-cta:hover { background: #b5382a; color: #fff; border-color: #b5382a; filter: none; transform: none; }
/* 一覧の操作列に並べる小さいボタン */
body.admin-body .btn-cta { animation: none; }
body.admin-body .btn-sm { padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.admin-table td .btn + .btn, .admin-table td .btn + form { margin-left: 0.35rem; }
body.admin-body .pagination-link { border-color: #ddd3c8; color: #8a5a25; border-radius: 4px; }
body.admin-body .pagination-link:hover { background: #b6905a; color: #fff; }

.pickup-cell { text-align: center; }
.pickup-cell input[type=checkbox] { width: 1.1rem; height: 1.1rem; cursor: pointer; }
/* 注目のワンクリック切り替え (creators.php)。1クリック = 1 POST なので見た目だけ星のトグルにする。
   コンテンツ一覧 (index.php) 側はチェックボックス + 一括更新なので、そちらは上のルールを使う */
body.admin-body .btn-pickup {
  padding: 0.15rem 0.5rem; font-size: 1.05rem; line-height: 1.2;
  background: #fff; border-color: #ddd3c8; color: #b9b0a5;
}
body.admin-body .btn-pickup:hover { border-color: #b6905a; color: #b6905a; background: #fdf7ec; }
body.admin-body .btn-pickup.is-on { color: #c9973f; border-color: #d9c3a1; background: #fdf7ec; }

/* 編集パネル内の削除ブロック。一覧に置くと誤操作しやすいので編集画面へ集約している */
.admin-danger-zone {
  margin-top: 1.75rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid #e2b7b0;
  border-radius: 4px;
  background: #fdf6f5;
}
.admin-danger-zone h3 { margin: 0 0 0.5rem; font-size: 0.9rem; color: #8a1f11; }
.admin-danger-zone p { margin: 0 0 0.6rem; font-size: 0.88rem; }

/* --- アクセス解析 (analytics.php) -------------------------------------
   外部JSライブラリを使わない方針のため、グラフはすべてCSSの棒で描いている。
   ------------------------------------------------------------------- */

/* 期間切り替え */
.analytics-periods { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; align-items: center; }
.analytics-periods .is-current { background: #b6905a; color: #fff; }

/* サマリーのタイル */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.stat-tile {
  background: #fff;
  border: 1px solid #e5ddd3;
  border-radius: 4px;
  padding: 0.8rem 0.95rem;
}
.stat-label { display: block; font-size: 0.78rem; color: #8a7d72; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: #3a2f28; }
.stat-sub { display: block; font-size: 0.75rem; color: #8a7d72; }

/* 日別推移。棒の高さは PHP 側でパーセントを算出して style に埋める */
.chart {
  background: #fff;
  border: 1px solid #e5ddd3;
  border-radius: 4px;
  padding: 1rem 1.1rem 0.75rem;
  margin-bottom: 1.75rem;
}
.chart-legend { display: flex; gap: 1rem; font-size: 0.78rem; color: #6f625a; margin-bottom: 0.6rem; }
.chart-legend span::before {
  content: ''; display: inline-block; width: 10px; height: 10px;
  margin-right: 0.35rem; border-radius: 2px; vertical-align: baseline;
}
.chart-legend .legend-pv::before { background: #b6905a; }
.chart-legend .legend-uu::before { background: #d8c4a3; }
.chart-plot { display: flex; align-items: flex-end; gap: 2px; height: 170px; }
/* 1日 = 1カラム。中にPVとUUの2本を並べる */
.chart-col { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; gap: 1px; height: 100%; min-width: 2px; }
.chart-bar { flex: 1 1 0; min-height: 1px; border-radius: 2px 2px 0 0; background: #b6905a; }
.chart-bar-uu { background: #d8c4a3; }
.chart-col:hover .chart-bar { background: #8a6a35; }
.chart-col:hover .chart-bar-uu { background: #bfa77e; }
.chart-axis { display: flex; gap: 2px; margin-top: 0.3rem; }
.chart-tick {
  flex: 1 1 0; min-width: 0; text-align: center;
  font-size: 0.62rem; color: #8a7d72; white-space: nowrap; overflow: hidden;
}

/* 内訳の横棒 (流入チャネル・デバイスなど)。表の中に置いて割合を目で見せる */
.bar-cell { width: 120px; }
.bar-track { display: block; height: 8px; background: #efe6da; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #b6905a; border-radius: 4px; }

/* 表を2枚横に並べる。狭い画面では自動で1列になる */
.analytics-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.analytics-cols > section { min-width: 0; }
.analytics-cols h2 { margin-top: 0; }
/* 長いURLやUAで表が横に伸びないようにする */
.admin-table td.cell-clip {
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-table td.num, .admin-table th.num { text-align: right; white-space: nowrap; }
.admin-note { font-size: 0.82rem; color: #6f625a; margin: 0.35rem 0 1rem; }
.admin-note-warn {
  font-size: 0.82rem; color: #6b4419; margin: 0.35rem 0 1rem;
  background: #fdf7ec; border: 1px solid #e6d5b8; border-radius: 4px; padding: 0.6rem 0.8rem;
}

/* 狭い画面ではサイドバーを本文の上に積む (親項目ごとに横並び) */
@media (max-width: 860px) {
  .admin-layout { display: block; }
  .admin-sidebar {
    width: auto; height: auto; position: static;
    flex-direction: column;
  }
  .admin-nav {
    display: flex; flex-wrap: wrap; gap: 0 1.5rem;
    padding: 0.5rem 1.15rem 0.9rem;
  }
  .admin-nav-group { margin-bottom: 0; }
  .admin-nav-title { padding: 0.6rem 0 0.25rem; }
  .admin-nav-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
  body.admin-body .admin-nav-link {
    padding: 0.3rem 0.7rem; border-left: none;
    border-radius: 999px; background: rgba(255,255,255,0.08);
  }
  body.admin-body .admin-nav-link.is-active { border-left: none; }
  .admin-header { padding: 0.8rem 1rem; }
  .admin-content { padding: 1.15rem 1rem 2.5rem; }
}

@media (max-width: 600px) {
  body.admin-body .admin-table { font-size: 0.8rem; }
}

/* --- 広告枠 (公開側 / lib/ads.php) ------------------------------------
   端末の出し分けはここのメディアクエリだけで行う。サーバー側でUAを見ないのは、
   このホストが応答に Cache-Control: s-maxage=10 を付けて前段nginxが共有キャッシュ
   するため、UAで出力を変えるとPC向けHTMLがスマホに配られる事故が起きるから。
   境界の 768px は lib/ads.php の AD_SP_BREAKPOINT と必ず揃えること。
   -------------------------------------------------------------------- */
.ad-slot-group { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.ad-slot-group:not(:empty) { margin: 1.75rem 0; }

/* 枠は inline-block にして広告の実寸に吸い付かせる。
   枠側に固定幅やパディングを持たせると広告の実サイズとずれ、左右や下に半端な余白が出たり
   逆に切れたりする (実際にそうなったので直した)。サイズ指定は .ad-slot-body の min-* に入る */
.ad-slot {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-align: left;
}
/* 「広告」表記。ステマ規制対策としてヘッダーの一括表記とは別に枠ごとにも出す。
   絶対配置にすると上だけ余白を空ける必要が出てバランスが崩れるので、通常のブロックで積む */
.ad-slot-label {
  display: block;
  padding: 0.1rem 0.5rem;
  font-size: 0.62rem;
  line-height: 1.6;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--tint);
}
/* line-height:0 と iframe/img の display:block は、インライン要素の
   ベースライン下に出る数pxの隙間 (広告の下だけ余白が空く原因) を消すため */
.ad-slot-body { max-width: 100%; line-height: 0; }
.ad-slot-body iframe,
.ad-slot-body img { display: block; max-width: 100%; border: 0; }
/* 一覧の途中に差し込む枠。カードグリッドの1行をまるごと使う */
.ad-slot-inline { grid-column: 1 / -1; justify-self: center; }
/* サイドバーは幅がちょうど300pxなので、枠線やパディングを付けると
   300pxの広告が入りきらず端が切れる。ここだけ枠を外して実寸を優先する */
.side-column .ad-slot { display: block; border: none; background: none; border-radius: 0; }
.side-column .ad-slot-label { padding-left: 0; background: none; }
.side-column .ad-slot-body { min-width: 0 !important; }
.side-column .ad-slot-group:not(:empty) { margin: 0 0 1.75rem; }

@media (max-width: 768px) {
  .ad-only-pc { display: none !important; }
  /* スマホでは指定幅より画面が狭いことがあるので最小幅の指定を無効化する */
  .ad-slot-body { min-width: 0 !important; }
}
@media (min-width: 769px) {
  .ad-only-sp { display: none !important; }
}

/* --- 広告枠の管理画面 (ads.php / ad_edit.php) -------------------------
   サイズ選択は FANZAアフィリエイトのウィジェット生成画面に合わせたカード選択。
   外部JSライブラリ禁止の方針に従い、選択状態は input:checked + label のCSSだけで表現する。
   -------------------------------------------------------------------- */
.ad-edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
.ad-edit-form { min-width: 0; }
.ad-preview-column { min-width: 0; position: sticky; top: 1rem; }
.ad-preview-column h2 { margin-top: 0; }
.ad-preview-box {
  max-width: 100%;
  min-height: 140px;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #ddd3c8;
  border-radius: 4px;
  overflow: auto;
}
.ad-preview-empty {
  display: flex; align-items: center; justify-content: center;
  background: #f3ede4; color: #9a8d81; font-size: 0.85rem;
}
body.admin-body .ad-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.6; max-width: none;
}

.ad-size-legend { font-weight: normal; font-size: 0.78rem; color: #8a7d72; margin-left: 0.5rem; }
.ad-size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 0.6rem; max-width: 560px; }
.ad-size-input { position: absolute; opacity: 0; width: 0; height: 0; }
.ad-size-card {
  /* .admin-form label { display:block; font-weight:700; margin:1.1rem 0 .35rem } のほうが
     詳細度が高いため、打ち消す3つには !important が要る */
  display: flex !important; margin: 0 !important; font-weight: normal !important;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 0.1rem;
  padding: 0.7rem 0.4rem;
  min-height: 62px;
  background: #fff; border: 1px solid #ddd3c8; border-radius: 4px;
  cursor: pointer; text-align: center; line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ad-size-card:hover { border-color: #b6905a; background: #fdf7ec; }
.ad-size-dim { font-size: 0.92rem; font-weight: 700; color: #3a2f28; }
.ad-size-name { font-size: 0.74rem; color: #8a7d72; }
.ad-size-sp { font-size: 0.8rem; }
.ad-size-input:checked + .ad-size-card {
  background: #b6905a; border-color: #a17c48;
}
.ad-size-input:checked + .ad-size-card .ad-size-dim,
.ad-size-input:checked + .ad-size-card .ad-size-name { color: #fff; }
/* キーボード操作でどれを選んでいるか分かるようにする (ラジオ本体は視覚的に隠しているため) */
.ad-size-input:focus-visible + .ad-size-card { box-shadow: 0 0 0 2px rgba(182, 144, 90, 0.5); }

.ad-custom-size { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ad-custom-size label { display: inline-block !important; margin: 0 !important; font-size: 0.85rem; }
.ad-custom-size input[type=number] { width: 110px !important; }
.ad-radio-inline { display: inline-block !important; margin: 0 1.25rem 0 0 !important; font-weight: normal !important; }

@media (max-width: 900px) {
  .ad-edit-layout { grid-template-columns: 1fr; }
  .ad-preview-column { position: static; }
}
