:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #181a1f;
  --muted: #666d78;
  --line: #dedfd8;
  --accent: #b3262f;
  --accent-strong: #8f1d25;
  --teal: #1d6f73;
  --gold: #b7791f;
  --shadow: 0 12px 32px rgba(24, 26, 31, .08);

  /* サークルページ用ダークパレット（2026-06-13改訂: 紫基調＋ピンクアクセント） */
  --dk-bg: #161220;
  --dk-surface: #201a2e;
  --dk-surface2: #2a2240;
  --dk-ink: #ece8f4;
  --dk-muted: #9c93b2;
  --dk-line: rgba(200,180,255,.10);
  --dk-accent: #f25c8a;
  --dk-accent-strong: #d13e6f;
  --dk-teal: #3db8be;
  --dk-gold: #e0a835;
  --dk-shadow: 0 16px 40px rgba(22,10,40,.5);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
}

a { color: inherit; }
img { max-width: 100%; }

.site-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 20px;
  background: rgba(247, 247, 244, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand-link,
.back-link {
  text-decoration: none;
  font-weight: 700;
}

.brand-link { letter-spacing: 0; }
.back-link { color: var(--muted); font-size: .92rem; }

/* ステマ規制対応のPR帯（ヘッダー直下に常時表示・購入導線では手を止めない） */
.pr-bar {
  margin: 0;
  padding: 5px 20px;
  font-size: .72rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.work-page .pr-bar,
.circle-page .pr-bar {
  color: var(--dk-muted);
  background: var(--dk-surface);
  border-bottom: 1px solid var(--dk-line);
}

.page-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 28px 18px 64px;
}

/* eyebrow: 読者向けページでは使用しない。ポータル/admin で残す */
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* platform 表示ラベル（作品ページ） */
.platform-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.home-hero,
.circle-hero {
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--line);
}

.home-hero h1,
.circle-hero h1,
.work-summary h1 {
  margin: 0;
  font-feature-settings: "palt" 1;
  line-height: 1.16;
  letter-spacing: 0;
}

.home-hero h1 { font-size: clamp(2rem, 7vw, 4.4rem); }
.home-hero p { max-width: 640px; margin: 12px 0 0; color: var(--muted); }

.circle-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

/* コンパクトなサークル名ヘッダー（ヒーローより小さく上品に） */
.circle-hero h1 { font-size: 3.2rem; }
.circle-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.profile {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
}

.circle-hero-content {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  gap: 42px;
  align-items: start;
  min-width: 0;
}

.circle-logo + .circle-hero-content {
  grid-column: 2;
}

.circle-intro {
  min-width: 0;
}

.circle-link-groups {
  display: grid;
  gap: 10px;
  justify-self: end;
  width: min(390px, 100%);
  min-width: 0;
}

.circle-link-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)),
    rgba(255, 255, 255, .02);
}

.circle-link-heading {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.circle-link-list,
.circle-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.circle-social-link,
.circle-shop-link {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-height: 36px;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(10, 8, 18, .16);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  letter-spacing: 0;
  overflow: hidden;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.circle-shop-link {
  min-width: 92px;
}

.circle-social-link:hover,
.circle-shop-link:hover {
  border-color: rgba(255, 255, 255, .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .055)),
    rgba(255, 255, 255, .06);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 30px rgba(10, 8, 18, .22);
  transform: translateY(-2px);
}

.circle-social-link:focus-visible,
.circle-shop-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.circle-social-icon {
  flex: 0 0 auto;
}

.social-brand-icon {
  --brand-bg: rgba(179, 38, 47, .12);
  --brand-fg: var(--accent-strong);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand-bg);
  color: var(--brand-fg);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  font-size: .62rem;
  font-weight: 900;
  line-height: 1;
}

.social-brand-icon::before {
  content: "Web";
  transform: translateY(-.5px);
}

.social-brand-icon img {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.social-brand-icon--has-image {
  background: #fff;
  color: #111;
  border-color: rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 12px rgba(0, 0, 0, .18);
}

.social-brand-icon--has-image::before {
  content: none;
}

.social-brand-icon--x::before,
.social-brand-icon--pixiv::before,
.social-brand-icon--instagram::before,
.social-brand-icon--facebook::before {
  content: "";
  width: 13px;
  height: 13px;
  background: currentColor;
  mask: var(--brand-mask) center / contain no-repeat;
  -webkit-mask: var(--brand-mask) center / contain no-repeat;
  transform: none;
}

.social-brand-icon--x {
  --brand-bg: #111;
  --brand-fg: #fff;
  --brand-mask: url("/assets/icons/social/x.svg");
}

.social-brand-icon--pixiv {
  --brand-bg: #2f8cff;
  --brand-fg: #fff;
  --brand-mask: url("/assets/icons/social/pixiv.svg");
}

.social-brand-icon--youtube {
  --brand-image: url("/assets/icons/social/youtube.svg");
  --brand-bg: #f15a24;
  --brand-fg: #fff;
}
.social-brand-icon--youtube::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  margin-left: 2px;
}

.social-brand-icon--instagram {
  --brand-bg: linear-gradient(135deg, #f58529, #dd2a7b 48%, #8134af);
  --brand-fg: #fff;
  --brand-mask: url("/assets/icons/social/instagram.svg");
}

.social-brand-icon--facebook {
  --brand-bg: #1877f2;
  --brand-fg: #fff;
  --brand-mask: url("/assets/icons/social/facebook.svg");
}

.social-brand-icon.social-brand-icon--has-image::before {
  content: none;
  display: none;
}

.social-brand-icon--ci-en {
  --brand-bg: #00a4de;
  --brand-fg: #fff;
}
.social-brand-icon--ci-en::before { content: "Ci"; }

.social-brand-icon--fantia {
  --brand-bg: #ef6a8a;
  --brand-fg: #fff;
}
.social-brand-icon--fantia::before { content: "F"; font-size: .88rem; }

.social-brand-icon--fanbox {
  --brand-bg: #f7b500;
  --brand-fg: #2c2c2c;
}
.social-brand-icon--fanbox::before { content: "Fb"; }

.social-brand-icon--skeb {
  --brand-bg: #28b7a6;
  --brand-fg: #fff;
}
.social-brand-icon--skeb::before { content: "S"; font-size: .88rem; }

.social-brand-icon--website::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 4px 0 0 -3px currentColor, inset -4px 0 0 -3px currentColor;
}

.circle-social-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circle-shop-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  font-size: .64rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 12px rgba(0, 0, 0, .16);
}

.circle-shop-icon img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.circle-shop-icon--has-image {
  background: #fff;
}

.circle-shop-link--dmm .circle-shop-icon,
.circle-shop-icon--dmm {
  background: #d94b40;
}

.circle-shop-link--dlsite .circle-shop-icon,
.circle-shop-icon--dlsite {
  background: #1f78d1;
}

.circle-shop-link--booth .circle-shop-icon,
.circle-shop-icon--booth {
  background: #e35f16;
}

.circle-shop-link--xtoon .circle-shop-icon,
.circle-shop-icon--xtoon {
  background: #fff;
}

.circle-shop-link--xtoon .circle-shop-icon,
.circle-shop-icon--xtoon {
  width: 34px;
  border-radius: 999px;
}

.circle-shop-link--xtoon .circle-shop-icon img,
.circle-shop-icon--xtoon img {
  width: 25px;
}

.circle-shop-link--melonbooks .circle-shop-icon,
.circle-shop-icon--melonbooks {
  background: #21a366;
}

.circle-shop-link--toranoana .circle-shop-icon,
.circle-shop-icon--toranoana {
  background: #f0a000;
}

.circle-shop-link--shop .circle-shop-icon,
.circle-shop-icon--shop {
  background: #6f5ca8;
}

.circle-shop-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-feature-settings: "palt" 1;
  line-height: 1.25;
}

.count {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.works-grid {
  display: grid;
  /* 横長サムネ(4:3)に合わせて列をやや広く取る */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  margin-top: 20px;
}

.work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(24, 26, 31, .04);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.work-card:hover {
  transform: translateY(-2px);
  border-color: rgba(179, 38, 47, .35);
  box-shadow: var(--shadow);
}

.work-card:active { transform: scale(.98); }

.work-card:focus-visible,
.work-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.work-link {
  display: grid;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.thumb-frame {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3; /* FANZA/DLsiteのパッケージは560x420の横長 */
  overflow: hidden;
  background: #ece8dd;
}

/* 作品ページ: サンプル画像のインライン一覧（クリックでリーダー起動） */
.samples-section { margin-top: 36px; }
.samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.sample-thumb {
  display: block;
  padding: 0;
  border: 1px solid var(--dk-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--dk-surface);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease;
}
.sample-thumb img { display: block; width: 100%; height: auto; }
.sample-thumb:hover { transform: translateY(-2px); border-color: var(--dk-accent); }
.sample-thumb:active { transform: scale(.98); }
.sample-thumb:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .sample-thumb { transition: none; }
}

.work-description {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.work-description h2 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  line-height: 1.4;
}

.work-description-body {
  position: relative;
  max-width: 820px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 2;
  overflow-wrap: anywhere;
}

.work-description-body p {
  margin: 0 0 1.05em;
}

.work-description-body p:last-child {
  margin-bottom: 0;
}

.work-description-body.is-collapsed {
  max-height: 22.8em;
  overflow: hidden;
}

.work-description-body.is-collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg));
  pointer-events: none;
}

.description-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-missing,
.media-missing {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-size: .72rem;
  font-weight: 800;
}

.work-body {
  display: grid;
  gap: 5px;
  padding: 11px 12px 12px;
}

.circle-name {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.work-title {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .8rem;
}

.sale-price {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* カード価格（通常） */
.work-meta span:not(.price-orig-sm) {
  font-variant-numeric: tabular-nums;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.tag-row a,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
  text-decoration: none;
  transition: color 200ms ease, border-color 200ms ease;
}

.tag-row a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tag-row a.is-active,
.tag-row a:hover {
  color: var(--accent-strong);
  border-color: rgba(179, 38, 47, .35);
}

.tag-row span,
.tag-cloud b {
  color: var(--muted);
  font-weight: 800;
}

.tag-row.compact {
  margin-top: 16px;
}

/* ジャンル折りたたみ（details/summary・JS不要。デフォルト閉・?tag=絞り込み中はopenで描画） */
.genre-fold {
  margin-top: 18px;
}

.genre-fold summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
  cursor: pointer;
  user-select: none;
  list-style: none; /* デフォルトの三角マーカーを消す（矢印は::afterで統一） */
  transition: color 200ms ease, border-color 200ms ease;
}

.genre-fold summary::-webkit-details-marker { display: none; }
.genre-fold summary::after { content: "▾"; }
.genre-fold[open] summary::after { content: "▴"; }

.genre-fold summary:hover {
  color: var(--accent-strong);
  border-color: rgba(179, 38, 47, .35);
}

.genre-fold summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.genre-fold .tag-row {
  margin-top: 12px;
}

.circle-list {
  display: grid;
  gap: 10px;
}

.circle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 200ms ease;
}

.circle-row:hover { border-color: rgba(179, 38, 47, .35); }
.circle-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.circle-row span { display: grid; gap: 3px; min-width: 0; }
.circle-row strong { font-size: 1rem; }
.circle-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.circle-row em {
  color: var(--muted);
  font-size: .86rem;
  font-style: normal;
  white-space: nowrap;
}

.work-detail {
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

.work-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.work-media img {
  display: block;
  width: 100%;
}

@media (min-width: 860px) {
  .work-page .work-media {
    position: sticky;
    top: 96px;
  }
}

.work-summary {
  display: grid;
  gap: 14px;
}

.work-actions {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-top: 4px;
}

.work-summary h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-feature-settings: "palt" 1;
  line-height: 1.35;
}
.byline { margin: 0; color: var(--muted); }
.byline a { color: var(--muted); font-weight: 700; text-decoration: none; }

.meta-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
  font-size: .84rem;
}

.meta-list dd { margin: 0; }

.price-box {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
}

.price-box strong {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-box span {
  color: var(--muted);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.price-box em {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(224, 69, 78, .12);
  color: var(--accent);
  font-size: .82rem;
  font-style: normal;
  font-weight: 800;
}

/* work-page: price-box 内クラス別スタイル */
.price-box .price-orig {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.price-box .price-now {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-box .off-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(224, 69, 78, .12);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
}

.purchase-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: min(100%, 360px);
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.purchase-button:hover {
  background: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 12px rgba(24,26,31,.18);
  transform: translateY(-2px);
}

.purchase-button:active {
  transform: translateY(0) scale(.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.purchase-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.sample-grid img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.related-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.empty-state {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.age-gate,
.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.gate,
.notice {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate h1,
.notice h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.gate p,
.notice p {
  margin: 0;
  color: var(--muted);
}

.gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.btn-yes { background: var(--accent); color: #fff; }
.btn-no { background: #ececea; color: var(--muted); }

.admin-shell {
  max-width: 1180px;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.admin-head h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-head p:last-child {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.admin-section {
  margin-top: 28px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-table code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .86em;
}

.compact-table {
  min-width: 860px;
}

@media (max-width: 920px) {
  .circle-hero-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .circle-link-groups {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-bar { padding: 0 14px; }
  .page-shell { padding: 22px 14px 48px; }
  .circle-hero { grid-template-columns: 1fr; }
  .circle-hero h1 { font-size: 1.8rem; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .work-detail { grid-template-columns: 1fr; }
  .work-title { font-size: .86rem; }
  .circle-row { align-items: start; }
  .circle-row small { white-space: normal; }
  .admin-head {
    align-items: start;
    flex-direction: column;
  }
  .admin-head p:last-child {
    text-align: left;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .works-grid { grid-template-columns: 1fr; }
  .gate-actions { flex-direction: column; }
}

/* ================================================================
   サークルページ ダーク基調
   .circle-page ボディに適用。ポータル/admin/ゲートには影響しない。
   ================================================================ */
.circle-page {
  color: var(--dk-ink);
  background: var(--dk-bg);
}

.circle-page .site-bar {
  background: rgba(22, 18, 32, .92);
  border-bottom-color: var(--dk-line);
}

.circle-page .brand-link,
.circle-page .back-link {
  color: var(--dk-ink);
}

.circle-page .back-link { color: var(--dk-muted); }

/* --- ヒーローセクション（最新作大表示） --- */
.latest-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 480px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 36px 0 40px;
  border-bottom: 1px solid var(--dk-line);
}

/* [#4] ヒーロー表紙: 4:3固定 + 最大幅 480px */
.latest-hero-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--dk-surface);
  box-shadow: var(--dk-shadow);
  max-width: 480px;
}

.latest-hero-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.latest-hero-thumb .discount-badge {
  top: 10px;
  left: 10px;
  font-size: .8rem;
  padding: 5px 9px;
  background: var(--dk-accent);
}

.latest-hero-info {
  display: grid;
  gap: 16px;
  align-content: center;
}

.latest-hero-title {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-feature-settings: "palt" 1;
  line-height: 1.2;
  color: var(--dk-ink);
}

.latest-hero-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.latest-hero-price .price-now {
  color: var(--dk-accent);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.latest-hero-price .price-orig {
  color: var(--dk-muted);
  text-decoration: line-through;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.latest-hero-price .off-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(242, 92, 138, .15);
  color: var(--dk-accent);
  font-size: .8rem;
  font-weight: 800;
}

.latest-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 6px;
  background: var(--dk-surface2);
  border: 1px solid var(--dk-line);
  color: var(--dk-ink);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.btn-preview:hover {
  border-color: var(--dk-accent);
  background: rgba(242, 92, 138, .08);
  box-shadow: 0 4px 12px rgba(22,10,40,.4);
  transform: translateY(-2px);
}

.btn-preview:active {
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

.btn-preview:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

.btn-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 6px;
  background: var(--dk-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.btn-detail:hover {
  background: var(--dk-accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 12px rgba(22,10,40,.4);
  transform: translateY(-2px);
}

.btn-detail:active {
  transform: translateY(0) scale(.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.btn-detail:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

/* --- サークルプロフィール小ヘッダー --- */
.circle-page .circle-hero {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--dk-line);
}

.circle-page .circle-hero h1 { color: var(--dk-ink); }
.circle-page .profile { color: var(--dk-muted); }
.circle-page .circle-logo { border-color: var(--dk-line); background: var(--dk-surface); }
.circle-page .circle-link-group {
  border-color: rgba(255, 255, 255, .14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)),
    rgba(255, 255, 255, .018);
}
.circle-page .circle-link-heading { color: var(--dk-muted); }
.circle-page .circle-social-link,
.circle-page .circle-shop-link {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .13);
  color: var(--dk-ink);
}
.circle-page .circle-social-link:hover,
.circle-page .circle-shop-link:hover {
  border-color: rgba(255, 255, 255, .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .055)),
    rgba(255, 255, 255, .055);
  color: var(--dk-ink);
}
.circle-page .circle-social-link:focus-visible,
.circle-page .circle-shop-link:focus-visible {
  outline-color: var(--dk-accent);
}
.circle-page .circle-social-icon {
  background: rgba(242, 92, 138, .14);
  color: var(--dk-accent);
}
.circle-page .circle-social-icon.social-brand-icon {
  background: var(--brand-bg);
  color: var(--brand-fg);
}
.circle-page .circle-social-icon.social-brand-icon--has-image {
  background: #fff;
  color: #111;
}

/* --- タグナビ --- */
.circle-page .tag-row a {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

.circle-page .tag-row a.is-active,
.circle-page .tag-row a:hover {
  color: var(--dk-accent);
  border-color: rgba(242, 92, 138, .4);
}

.circle-page .genre-fold summary {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

.circle-page .genre-fold summary:hover {
  color: var(--dk-accent);
  border-color: rgba(242, 92, 138, .4);
}

.circle-page .genre-fold summary:focus-visible {
  outline-color: var(--dk-accent);
}

/* --- セクションヘッド --- */
.circle-page .section-head { border-bottom: none; }
.circle-page .section-head h2 { color: var(--dk-ink); }
.circle-page .count { color: var(--dk-muted); }

/* --- 作品グリッド（ダーク） --- */
.circle-page .work-card {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.circle-page .work-card:hover {
  border-color: rgba(242, 92, 138, .4);
  box-shadow: 0 8px 24px rgba(22,10,40,.5);
}

.circle-page .work-title { color: var(--dk-ink); }
.circle-page .circle-name { color: var(--dk-muted); }
.circle-page .work-meta { color: var(--dk-muted); }
.circle-page .sale-price { color: var(--dk-accent); }
.circle-page .thumb-missing { color: var(--dk-muted); background: var(--dk-surface2); }
.circle-page .thumb-frame { background: var(--dk-surface2); }
.circle-page .discount-badge { background: var(--dk-accent); }
.circle-page .empty-state {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

/* work-card 内の価格（定価打ち消し）ダーク対応 */
.circle-page .price-orig-sm {
  color: var(--dk-muted);
  text-decoration: line-through;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .latest-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .latest-hero-thumb { max-width: 100%; }

  /* [#7] モバイルのタグ行: 右端見切れ防止 */
  .tag-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 14px;
    scrollbar-width: none;
  }
  .tag-row::-webkit-scrollbar { display: none; }
  /* nowrap時にチップがmin-content（1文字幅）まで潰れて縦書き化するのを防ぐ */
  .tag-row a { flex: 0 0 auto; }
}

/* ================================================================
   試し読みリーダー（オーバーレイ）
   work-page で使用。circle-page からも呼び出し可能。
   開閉: visibility+opacity で display:flex を維持しつつフェード+scaleを実現。
   ================================================================ */
.reader-overlay {
  display: flex;
  visibility: hidden;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10,11,16,.96);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.98);
  transition: opacity 250ms ease-out, transform 250ms ease-out, visibility 0ms 250ms;
}

.reader-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 250ms ease-out, transform 250ms ease-out, visibility 0ms 0ms;
}

@media (prefers-reduced-motion: reduce) {
  .reader-overlay {
    transition: none;
    transform: none;
  }
  .reader-overlay.is-open {
    transition: none;
    transform: none;
  }
}

.reader-close {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 200ms ease;
}
.reader-close:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); }
.reader-close:active { transform: scale(.98); }
.reader-close:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

.reader-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 860px;
  padding: 0 56px;
}

/* 画像ラッパー（スピナーと画像を重ねる） */
.reader-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-img {
  max-width: 100%;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

.reader-img.is-loaded,
.reader-img.reader-img-visible {
  opacity: 1;
}

/* スピナー（CSSのみ実装） */
.reader-spinner {
  display: none;
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--dk-accent);
  border-radius: 50%;
  animation: reader-spin 600ms linear infinite;
}

@keyframes reader-spin {
  to { transform: rotate(360deg); }
}

/* prefers-reduced-motion: フェードとスピナーアニメーションを無効化 */
@media (prefers-reduced-motion: reduce) {
  .reader-img {
    opacity: 1;
    transition: none;
  }
  .reader-img.is-loaded,
  .reader-img.reader-img-visible {
    opacity: 1;
  }
  .reader-spinner {
    animation: none;
  }
}

.reader-cta-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 320px;
  text-align: center;
  color: #e8eaf0;
}

.reader-cta-slide p {
  margin: 0;
  font-size: 1.1rem;
  opacity: .85;
}

.reader-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 6px;
  background: var(--dk-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.reader-cta-btn:hover {
  background: var(--dk-accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 12px rgba(22,10,40,.4);
  transform: translateY(-2px);
}

.reader-cta-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.reader-cta-btn:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

.reader-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.reader-nav:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-50%) translateY(-1px);
}

.reader-nav:active { transform: translateY(-50%) scale(.98); }

.reader-nav:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

.reader-nav.prev { left: 6px; }
.reader-nav.next { right: 6px; }
.reader-nav:disabled { opacity: .25; cursor: default; }

.reader-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  color: rgba(255,255,255,.6);
  font-size: .88rem;
}

/* ================================================================
   作品ページ 価格3点・アフィリ明記
   ================================================================ */
.affiliate-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.reader-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.reader-open-btn:hover {
  border-color: var(--accent);
  background: rgba(179, 38, 47, .04);
  box-shadow: 0 4px 10px rgba(24,26,31,.12);
  transform: translateY(-2px);
}

.reader-open-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

.reader-open-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ================================================================
   [#2] リーダー hidden 要素の強制非表示
   display 指定が [hidden] 属性に勝るケースを防ぐ
   ================================================================ */
.reader-cta-slide[hidden],
.reader-img[hidden] {
  display: none !important;
}

/* ================================================================
   [#3] off-badge の打ち消し線継承を禁止
   price-box 内・ヒーロー内とも適用
   ================================================================ */
.off-badge {
  text-decoration: none;
}

/* ================================================================
   [#5] 画像リンク切れフォールバック
   .thumb-frame / .latest-hero-thumb / .work-media 内の img が
   読み込み失敗したとき、JS で親要素に is-broken クラスを付与。
   CSS 側は面色背景 + 中央「画像準備中」表示。
   ================================================================ */
.is-broken {
  display: grid;
  place-items: center;
  background: var(--surface);
}

.circle-page .is-broken,
.work-page .is-broken {
  background: var(--dk-surface);
}

.is-broken::after {
  content: "画像準備中";
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
  padding: 12px;
}

.circle-page .is-broken::after,
.work-page .is-broken::after {
  color: var(--dk-muted);
}

/* バッジが .is-broken 親と重ならないようにバッジの z-index を明示 */
.discount-badge { position: absolute; z-index: 1; }

/* ================================================================
   ポータル（.portal-page）ダークテーマ
   ホーム（portal.php）・サークル向けLP（for-circles.php）に適用。
   admin/ゲート/suspended には影響しない。
   ================================================================ */
.portal-page {
  color: var(--dk-ink);
  background: var(--dk-bg);
}

/* サイトバー */
.portal-page .site-bar {
  background: rgba(22, 18, 32, .92);
  border-bottom-color: var(--dk-line);
}

.portal-page .brand-link {
  color: var(--dk-ink);
}

/* ヒーロー・汎用ボーダー */
.portal-page .home-hero {
  border-bottom-color: var(--dk-line);
}

.portal-page .home-hero p {
  color: var(--dk-muted);
}

/* eyebrow */
.portal-page .eyebrow {
  color: var(--dk-muted);
}

/* セクションヘッド */
.portal-page .section-head h2 {
  color: var(--dk-ink);
}

.portal-page .count {
  color: var(--dk-muted);
}

.portal-section-head {
  margin-top: 28px;
}

/* ポータル: 折りたたみサークル一覧 */
.portal-disclosure {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.portal-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.portal-disclosure-summary::-webkit-details-marker {
  display: none;
}

.portal-disclosure-summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}

.portal-disclosure[open] .portal-disclosure-summary::after {
  content: "-";
}

.portal-disclosure-summary span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-disclosure-summary strong {
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.25;
}

.portal-disclosure .portal-circle-grid {
  padding: 0 18px 18px;
}

/* 作品グリッド（ポータル・新着） */
.portal-page .work-card {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.portal-page .work-card:hover {
  border-color: rgba(242, 92, 138, .4);
  box-shadow: 0 8px 24px rgba(22,10,40,.5);
}

.portal-page .work-title { color: var(--dk-ink); }
.portal-page .circle-name { color: var(--dk-muted); }
.portal-page .work-meta { color: var(--dk-muted); }
.portal-page .sale-price { color: var(--dk-accent); }
.portal-page .thumb-missing { color: var(--dk-muted); background: var(--dk-surface2); }
.portal-page .thumb-frame { background: var(--dk-surface2); }
.portal-page .discount-badge { background: var(--dk-accent); }
.portal-page .empty-state {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

/* ポータル: 横スクロール作品一覧 */
.portal-work-rail {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(164px, 190px);
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  margin-inline: -2px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.portal-work-rail .work-card {
  min-width: 0;
  scroll-snap-align: start;
}

.portal-work-rail .work-title {
  min-height: 4.1em;
  -webkit-line-clamp: 3;
}

.portal-work-rail .work-body {
  min-height: 138px;
}

/* 定価打ち消し */
.portal-page .price-orig-sm {
  color: var(--dk-muted);
  text-decoration: line-through;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

/* タグクラウド */
.portal-page .tag-cloud span {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

.portal-page .tag-cloud b {
  color: var(--dk-muted);
}

/* サークル一覧 */
.portal-page .circle-list .circle-row {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.portal-page .circle-list .circle-row:hover {
  border-color: rgba(242, 92, 138, .4);
}

.portal-page .circle-row strong { color: var(--dk-ink); }
.portal-page .circle-row small  { color: var(--dk-muted); }
.portal-page .circle-row em     { color: var(--dk-muted); }

.portal-page .portal-disclosure {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.portal-page .portal-disclosure-summary::after {
  border-color: var(--dk-line);
  color: var(--dk-muted);
  background: var(--dk-surface2);
}

.portal-page .portal-disclosure-summary strong {
  color: var(--dk-ink);
}

/* フッター */
.portal-page footer {
  color: var(--dk-muted) !important;
}

.portal-page footer a {
  color: var(--dk-muted) !important;
}

/* --- for-circles.php 専用コンポーネント（.portal-page 内） --- */

/* FC ヒーロー */
.portal-page .fc-hero {
  border-bottom-color: var(--dk-line);
}

.portal-page .fc-hero p {
  color: var(--dk-muted);
}

/* FC テーブル */
.portal-page .fc-table {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.portal-page .fc-table th {
  background: var(--dk-bg);
  color: var(--dk-muted);
}

.portal-page .fc-table th,
.portal-page .fc-table td {
  border-bottom-color: var(--dk-line);
}

.portal-page .fc-table td {
  color: var(--dk-ink);
}

.portal-page .fc-table strong {
  color: var(--dk-accent);
}

/* テーブルラッパー */
.portal-page .table-wrap {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

/* FC ステップ */
.portal-page .fc-steps li {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.portal-page .fc-steps li strong {
  color: var(--dk-ink);
}

.portal-page .fc-steps li small {
  color: var(--dk-muted);
}

/* 手順番号バッジ: teal → ピンクアクセント（LPはダークでも単色ルール維持） */
.portal-page .fc-step-num {
  background: var(--dk-accent);
}

/* 準備中ボタン */
.portal-page .fc-cta-pending {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

/* Discord申込ボタン: ピンク塗り */
.portal-page .btn-yes {
  background: var(--dk-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.portal-page .btn-yes:hover {
  background: var(--dk-accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 12px rgba(22,10,40,.4);
  transform: translateY(-2px);
}

.portal-page .btn-yes:active {
  transform: translateY(0) scale(.98);
}

.portal-page .btn-yes:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

/* FC 注記 */
.portal-page .fc-notice {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

/* FC フッター */
.portal-page .fc-footer {
  border-top-color: var(--dk-line);
  color: var(--dk-muted);
}

.portal-page .fc-footer a {
  color: var(--dk-muted);
}

/* FC can-do リスト（.circle-list/.circle-row 流用分） */
.portal-page .fc-section .circle-row[style*="cursor:default"] strong {
  color: var(--dk-ink);
}

/* ================================================================
   [#1][#6] 作品ページ（.work-page）ダークテーマ
   circle-page と同じパレットを work-page スコープで適用。
   ポータル/admin/ゲート/for-circles には影響しない。
   ================================================================ */
.work-page {
  color: var(--dk-ink);
  background: var(--dk-bg);
}

/* サイトバー */
.work-page .site-bar {
  background: rgba(22, 18, 32, .92);
  border-bottom-color: var(--dk-line);
}

.work-page .brand-link {
  color: var(--dk-ink);
}

.work-page .back-link {
  color: var(--dk-muted);
}

/* 作品詳細エリア */
.work-page .work-media {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.work-page .platform-label {
  color: var(--dk-muted);
}

.work-page .byline,
.work-page .byline a {
  color: var(--dk-muted);
}

/* メタリスト */
.work-page .meta-list div {
  border-bottom-color: var(--dk-line);
}

.work-page .meta-list dt {
  color: var(--dk-muted);
}

/* 価格ボックス */
.work-page .price-box .price-orig {
  color: var(--dk-muted);
}

.work-page .price-box .price-now,
.work-page .price-box strong {
  color: var(--dk-accent);
}

.work-page .price-box .off-badge {
  background: rgba(242, 92, 138, .15);
  color: var(--dk-accent);
  text-decoration: none;
}

.work-page .price-box span {
  color: var(--dk-muted);
}

/* タグ行 */
.work-page .tag-row a {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}

.work-page .tag-row a:hover {
  color: var(--dk-accent);
  border-color: rgba(242, 92, 138, .4);
}

.work-page .tag-row a:focus-visible {
  outline-color: var(--dk-accent);
}

/* 試し読みボタン（アウトライン） */
.work-page .reader-open-btn {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-ink);
}

.work-page .reader-open-btn:hover {
  border-color: rgba(242, 92, 138, .5);
  background: rgba(242, 92, 138, .08);
}

.work-page .reader-open-btn:focus-visible {
  outline-color: var(--dk-accent);
}

/* 購入ボタン（主ストア: 塗りつぶし） */
.work-page .purchase-button {
  background: var(--dk-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.work-page .purchase-button:hover {
  background: var(--dk-accent-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 12px rgba(22,10,40,.4);
}

.work-page .purchase-button:focus-visible {
  outline-color: var(--dk-accent);
}

.work-page .purchase-button__label,
.work-page .purchase-button__price {
  display: block;
}

.work-page .purchase-button__price {
  margin-top: 3px;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
}

.work-page .purchase-button__orig {
  margin-right: 6px;
  text-decoration: line-through;
  opacity: .72;
}

.work-page .purchase-button__now {
  margin-right: 6px;
}

.work-page .purchase-button__off {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: .7rem;
}

.work-page .purchase-button--platform-dmm .purchase-button__off {
  background: rgba(215, 25, 32, .1);
}

/* 副ストアボタン（platform別classがない場合のフォールバック） */
.work-page .purchase-button--sub {
  background: transparent;
  border: 2px solid var(--dk-accent);
  color: var(--dk-accent);
  box-shadow: none;
  margin-top: 8px;
}

.work-page .purchase-button--sub:hover {
  background: var(--dk-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,10,40,.4);
}

.work-page .purchase-button--sub:focus-visible {
  outline-color: var(--dk-accent);
}

.work-page .purchase-button--platform-dmm {
  background: #fff;
  border: 2px solid #d71920;
  color: #d71920;
  box-shadow: none;
}

.work-page .purchase-button--platform-dmm:hover {
  background: #fff5f5;
  color: #d71920;
  box-shadow: 0 4px 12px rgba(215, 25, 32, .18);
}

.work-page .purchase-button--platform-dmm:focus-visible {
  outline-color: #d71920;
}

.work-page .purchase-button--platform-dlsite {
  background: #0052a5;
  border: 2px solid #0052a5;
  color: #fff;
  box-shadow: none;
}

.work-page .purchase-button--platform-dlsite:hover {
  background: #00468c;
  border-color: #00468c;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 82, 165, .28);
}

.work-page .purchase-button--platform-dlsite:focus-visible {
  outline-color: #0052a5;
}

.work-page .purchase-button--platform-booth {
  background: #f36c21;
  border: 2px solid #f36c21;
  color: #fff;
  box-shadow: none;
}

.work-page .purchase-button--platform-booth:hover {
  background: #df5f18;
  border-color: #df5f18;
  color: #fff;
  box-shadow: 0 4px 12px rgba(243, 108, 33, .24);
}

.work-page .purchase-button--platform-booth:focus-visible {
  outline-color: #f36c21;
}

.dash-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-link-list a,
.dash-field-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.dash-link-list a:hover,
.dash-field-link:hover {
  border-color: rgba(179, 38, 47, .35);
  background: rgba(179, 38, 47, .05);
  color: var(--accent);
}

.dash-link-list a:focus-visible,
.dash-field-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dash-field-link {
  align-self: flex-start;
  margin-top: 6px;
}

.dash-link-list a[hidden],
.dash-field-link[hidden] {
  display: none !important;
}

/* 体験版ボタン（アウトライン・アクセント色） */
.work-page .trial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  background: transparent;
  border: 2px solid var(--dk-accent);
  color: var(--dk-accent);
  box-shadow: none;
  margin-top: 8px;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.work-page .trial-button:hover {
  background: var(--dk-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,10,40,.4);
  transform: translateY(-2px);
}

.work-page .trial-button:active {
  transform: translateY(0) scale(.98);
}

.work-page .trial-button:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

/* 作品紹介 */
.work-page .work-description {
  border-top-color: var(--dk-line);
}

.work-page .work-description h2 {
  color: var(--dk-ink);
}

.work-page .work-description-body {
  color: var(--dk-ink);
}

.work-page .work-description-body.is-collapsed::after {
  background: linear-gradient(to bottom, rgba(14, 12, 22, 0), var(--dk-bg));
}

.work-page .description-toggle {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-ink);
}

.work-page .description-toggle:hover {
  border-color: rgba(242, 92, 138, .5);
  background: rgba(242, 92, 138, .08);
}

.work-page .description-toggle:focus-visible {
  outline: 2px solid var(--dk-accent);
  outline-offset: 2px;
}

/* アフィリ注記 */
.work-page .affiliate-note {
  color: var(--dk-muted);
}

/* 関連作品セクション */
.work-page .section-head h2 {
  color: var(--dk-ink);
}

/* 関連作品カード（work-card）ダーク化 [#6] */
.work-page .work-card {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}

.work-page .work-card:hover {
  border-color: rgba(242, 92, 138, .4);
  box-shadow: 0 8px 24px rgba(22,10,40,.5);
}

.work-page .work-title { color: var(--dk-ink); }
.work-page .circle-name { color: var(--dk-muted); }
.work-page .work-meta { color: var(--dk-muted); }
.work-page .sale-price { color: var(--dk-accent); }
.work-page .thumb-missing { color: var(--dk-muted); background: var(--dk-surface2); }
.work-page .thumb-frame { background: var(--dk-surface2); }
.work-page .discount-badge { background: var(--dk-accent); }

/* work-card の定価打ち消しダーク */
.work-page .price-orig-sm {
  color: var(--dk-muted);
  text-decoration: line-through;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   §2c d. ヒーロー表紙 初回浮き上がりアニメーション（400ms・1回のみ）
   スクロール連動・ループ禁止。prefers-reduced-motion で無効化。
   ================================================================ */
@keyframes hero-rise {
  from {
    opacity: .85;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.latest-hero-thumb {
  animation: hero-rise 400ms ease-out 1 both;
}

@media (prefers-reduced-motion: reduce) {
  .latest-hero-thumb {
    animation: none;
  }
}

/* ================================================================
   §2c a. リーダー開閉 prefers-reduced-motion 追加（上の
   .reader-overlay ブロックとは別に visibility を確実に制御）
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .reader-overlay {
    opacity: 0;
    transform: none;
    transition: opacity 1ms, visibility 0ms 1ms;
  }
  .reader-overlay.is-open {
    opacity: 1;
    transition: opacity 1ms, visibility 0ms 0ms;
  }
}

/* ================================================================
   管理ダッシュボード（.admin-page 専用・フェーズ1）
   .circle-page / .work-page（読者向けダーク）には一切影響しない。
   ================================================================ */

/* ヘッダーアクション群 */
.dash-header-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--muted);
  flex: 1;
  padding-left: 18px;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 共通ボタン（ライトテーマ） */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.dash-btn--primary {
  background: var(--accent);
  color: #fff;
}
.dash-btn--primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(24,26,31,.15);
}

.dash-btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.dash-btn--ghost:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.dash-btn--warn {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  color: #b91c1c;
}
.dash-btn--warn:hover {
  background: #fee2e2;
}

.dash-btn--sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: .8rem;
}

/* 操作結果バナー */
.dash-banner {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .92rem;
}
.dash-banner--ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.dash-banner--ng {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* KPIカードグリッド */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.dash-kpi-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  align-content: center;
}

.dash-kpi-card.kpi--alert {
  border-color: #fca5a5;
  background: #fef2f2;
}

.dash-kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dash-kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi--alert .dash-kpi-value {
  color: #b91c1c;
}

/* 要対応バッジ */
.dash-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #b91c1c;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  vertical-align: middle;
}

.dash-badge--muted {
  background: #64748b;
}

.dash-badge--danger {
  background: #dc2626;
}

/* サークル一覧テーブル */
.dash-table-wrap {
  margin-top: 12px;
}

.dash-table {
  min-width: 1040px;
}

.dash-sort-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.dash-sort-form select {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.dash-sort-form noscript {
  display: inline-flex;
}

/* 状態色付き行 */
.dash-table tr.row--grace td {
  background: #fffbeb;
}
.dash-table tr.row--suspended td {
  background: #fef2f2;
}
.dash-table tr.row--overdue td {
  background: #fff1f2;
}
.dash-table tr.row--free td {
  background: #f0f9ff;
}
.dash-table tr.row--attention td {
  background: #fff7ed;
}

.dash-deadline--overdue {
  color: #991b1b;
  font-weight: 800;
}

/* 状態ラベル */
.dash-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
}
.dash-status--active  { background: #ecfdf5; color: #065f46; }
.dash-status--grace   { background: #fef3c7; color: #92400e; }
.dash-status--suspended { background: #fef2f2; color: #991b1b; }
.dash-status--free { background: #e0f2fe; color: #075985; }

/* テーブル操作セル */
.dash-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  padding: 8px 12px !important;
  align-items: center;
}

/* 折りたたみ直近イベント */
.dash-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
}
.dash-details > summary::-webkit-details-marker { display: none; }
.dash-details > summary::before {
  content: "▶";
  font-size: .7rem;
  color: var(--muted);
  margin-right: 8px;
  transition: transform 200ms ease;
}
.dash-details[open] > summary::before {
  transform: rotate(90deg);
}

/* ── モーダル（admin専用 .dash-modal-overlay） ──────────────────── */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(24, 26, 31, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(48px, 6vh) 16px 24px;
  padding: min(48px, 6dvh) 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dash-modal-overlay[hidden] {
  display: none !important;
}

.dash-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dash-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.dash-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 150ms ease, color 150ms ease;
}
.dash-modal-close:hover {
  background: var(--bg);
  color: var(--ink);
}

.dash-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dash-modal-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.dash-modal-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dash-modal-section h3 {
  margin: 0 0 14px;
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0;
}

/* モーダル内 dl */
.dash-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: .9rem;
}
.dash-dl dt {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.dash-dl dd {
  margin: 0;
}

/* モーダル内フォーム共通 */
.dash-modal-body label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}
.dash-modal-body label input,
.dash-modal-body label select,
.dash-modal-body label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: .9rem;
  box-sizing: border-box;
}
.dash-modal-body label textarea {
  resize: vertical;
}

.dash-form-group {
  margin: 0 0 12px;
}

.dash-form-group-title {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 800;
}

.dash-field-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.dash-settings-form {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.dash-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.dash-settings-form input {
  width: 100%;
}

.dash-social-link-fields {
  display: grid;
  gap: 8px;
}

.dash-social-link-row {
  display: grid;
  grid-template-columns: minmax(124px, auto) minmax(140px, .45fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: end;
}

.dash-social-link-row label {
  display: block;
  min-width: 0;
  margin-bottom: 0;
}

.dash-social-link-row input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.dash-input-label {
  display: block;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
}

.dash-social-platform-field {
  min-width: 0;
}

.dash-social-platform {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 42px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  width: 100%;
}

.dash-social-platform-label {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .dash-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-header-title {
    display: none;
  }
  .dash-modal-overlay {
    padding: 14px 10px;
  }
  .dash-modal {
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }
  .dash-social-link-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   ポータル: タグリンク（.tag-cloud a）
   .portal-page .tag-cloud span と同等スタイル + リンク化
   ================================================================ */
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .82rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 150ms ease, background 150ms ease;
}
.tag-cloud a:hover {
  border-color: var(--accent);
  background: #fef5f5;
}

.portal-page .tag-cloud a {
  background: var(--dk-surface);
  border-color: var(--dk-line);
  color: var(--dk-muted);
}
.portal-page .tag-cloud a:hover {
  border-color: var(--dk-accent);
  background: var(--dk-surface2);
  color: var(--dk-ink);
}
.portal-page .tag-cloud a b {
  color: var(--dk-muted);
}

/* ================================================================
   ポータル: コンパクトサークルグリッド（.portal-circle-grid）
   ================================================================ */
.portal-circle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.portal-circle-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.portal-circle-card:hover {
  border-color: rgba(179, 38, 47, .35);
  box-shadow: 0 4px 14px rgba(24,26,31,.08);
}
.portal-circle-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.portal-circle-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 4px;
}

.portal-circle-name {
  font-size: .95rem;
  line-height: 1.3;
}

.portal-circle-profile {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .78rem;
  color: var(--muted);
}

.portal-circle-count {
  font-size: .8rem;
  font-style: normal;
  color: var(--muted);
  margin-top: 4px;
}

/* ダークテーマ対応 */
.portal-page .portal-circle-card {
  background: var(--dk-surface);
  border-color: var(--dk-line);
}
.portal-page .portal-circle-card:hover {
  border-color: rgba(242, 92, 138, .4);
  box-shadow: 0 8px 24px rgba(22,10,40,.5);
}
.portal-page .portal-circle-logo {
  border-color: var(--dk-line);
}
.portal-page .portal-circle-name {
  color: var(--dk-ink);
}
.portal-page .portal-circle-profile {
  color: var(--dk-muted);
}
.portal-page .portal-circle-count {
  color: var(--dk-muted);
}

/* ポータル: サークルカード寸法固定 */
.portal-circle-grid {
  grid-auto-rows: 128px;
}

.portal-circle-card {
  height: 100%;
  min-height: 0;
}

.portal-circle-name {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.portal-circle-profile {
  min-height: 1.4em;
}

.portal-circle-count {
  margin-top: auto;
}

/* ================================================================
   管理ダッシュボード: 危険操作ゾーン（削除フォーム）
   ================================================================ */
.dash-danger-zone {
  border: 1px solid #f5c6c6;
  border-radius: 8px;
  padding: 16px;
  background: #fff8f8;
  margin-top: 8px;
}

.dash-danger-title {
  margin: 0 0 8px;
  font-size: .95rem;
  color: #b91c1c;
}

.dash-danger-desc {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

.dash-danger-label {
  display: block;
  font-size: .86rem;
  margin-bottom: 10px;
}
.dash-danger-label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: .45rem .7rem;
  border-radius: 6px;
  border: 1px solid #f5c6c6;
  background: #fff;
  color: var(--ink);
  font-size: .92rem;
  box-sizing: border-box;
}

.dash-btn--danger {
  background: #b91c1c;
  color: #fff;
  border: none;
}
.dash-btn--danger:hover:not(:disabled) {
  background: #991b1b;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(180,30,30,.3);
}
.dash-btn--danger:disabled {
  opacity: .38;
  cursor: not-allowed;
}
