/* コマポスの見た目。「小説家になろう」のような、飾りの少ない投稿サイトの作り：
   白い箱と細い線、文字の一覧が中心で、情報が詰まっている。色はポスト（アイコン）のコーラルを差し色にする */
:root {
  --bg: #f7f5f1; /* ページの地 */
  --surface: #ffffff; /* 箱の中 */
  --soft: #faf6ef; /* 淡い面 */
  --line: #e3ddd3; /* 境界線 */
  --text: #333333;
  --muted: #6c655d;
  --brand: #e9785e; /* 差し色（アイコンのポストの色） */
  --brand-deep: #c2503a; /* ボタン・強調の文字 */
  --brand-pale: #fdf1ec;
  --link: #1b62ad;
  --gold: #f1c75b;
  --silver: #cfcbc4;
  --bronze: #dba57d;
  --ok: #23785a;
  --ok-pale: #e6f4ec;
  --warn: #96600f;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1 {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 1.2rem 0 0.8rem;
}
h1 small {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.2rem;
}
/* 見出しは、左に差し色の棒 */
h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 2rem 0 0.8rem;
  padding-left: 10px;
  border-left: 5px solid var(--brand);
}
h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.2rem 0 0.3rem;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 14px;
}
.muted {
  color: var(--muted);
  font-size: 0.87rem;
}
.lead {
  color: var(--muted);
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.more {
  font-size: 0.87rem;
  white-space: nowrap;
}
.more::after {
  content: ' ›';
}

/* ---- ヘッダー：上段に題字と案内、下段にメニュー ---- */
.site-header {
  background: var(--surface);
  border-top: 4px solid var(--brand);
}
.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: block;
}
.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 0.85rem;
}
.sub-nav a {
  color: var(--text);
}
.global-nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.global-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin-right: auto;
}
.main-nav a {
  padding: 5px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
}
.main-nav a:hover {
  background: var(--surface);
  text-decoration: none;
}
.search {
  flex: 1 1 150px;
  max-width: 240px;
}
.search input,
.search-page input {
  width: 100%;
}
.global-nav .search input {
  min-height: 36px;
  padding: 4px 10px;
}
.global-nav .button {
  min-height: 36px;
  padding: 4px 14px;
  font-size: 0.9rem;
}
@media (max-width: 560px) {
  .brand-sub {
    display: none;
  }
  .search {
    max-width: none;
  }
}

/* ---- ボタン・入力 ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 7px 18px;
  border: 1px solid #cfc7ba;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover {
  background: var(--soft);
  text-decoration: none;
}
.button.primary {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #ffffff;
}
.button.primary:hover {
  background: #ad4531;
}
.button.large {
  min-height: 48px;
  padding: 9px 24px;
  font-size: 1rem;
}
.button.danger {
  color: var(--brand-deep);
}
.button.like[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand-pale);
  color: var(--brand-deep);
}
input[type='text'],
input[type='search'],
input[type='url'],
input[type='email'],
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #cfc7ba;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea {
  resize: vertical;
}
.form {
  display: grid;
  gap: 16px;
  max-width: 680px;
}
.form label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}
.form label.choice,
label.choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 400;
}
label.choice input {
  margin-top: 0.45em;
  flex: none;
  width: 17px;
  height: 17px;
  accent-color: var(--brand-deep);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px 14px;
  margin: 0;
  display: grid;
  gap: 8px;
  background: var(--surface);
}
legend {
  font-weight: 700;
  padding: 0 6px;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 12px;
}
.form.compact {
  gap: 8px;
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.inline-actions input[type='text'] {
  flex: 1 1 220px;
  width: auto;
}
.search-page {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin-bottom: 1.5rem;
}
.notice {
  border: 1px solid #b9dcc8;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--ok-pale);
  color: var(--ok);
  font-weight: 700;
}
.notice.error {
  border-color: #f0c4b8;
  background: var(--brand-pale);
  color: var(--brand-deep);
}
.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.badge.ok {
  border-color: #b9dcc8;
  background: var(--ok-pale);
  color: var(--ok);
}
.badge.warn {
  border-color: #ecd3a4;
  background: #fdf3de;
  color: var(--warn);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--brand);
}
.tabs a {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--soft);
  color: var(--text);
  font-weight: 700;
}
.tabs a[aria-current='page'] {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}
.empty {
  border: 1px dashed #cfc7ba;
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  text-align: center;
  background: var(--soft);
  color: var(--muted);
}
.empty p {
  margin: 0 0 0.6rem;
}
.empty strong {
  color: var(--text);
}

/* ---- 箱（トップや横の欄のまとまり） ---- */
.box {
  margin: 16px 0 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.box > h2,
.box .section-head h2 {
  margin: 0;
}
.box > h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}
.box > p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* ---- トップ ---- */
.intro {
  margin: 16px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  gap: 12px 24px;
  align-items: center;
}
.intro h1 {
  margin: 0 0 0.5rem;
}
.hero-name {
  display: block;
  font-size: clamp(1.9rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.25;
}
.marker {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-deep);
}
.intro p {
  margin: 0 0 0.6rem;
}
.site-stats {
  font-size: 0.9rem;
  color: var(--muted);
}
.site-stats strong {
  font-size: 1.15rem;
  color: var(--brand-deep);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0.8rem 0 0 !important;
}
/* はじめての方へ：投稿の流れ */
.guide-box {
  margin: 12px 0 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  display: grid;
  gap: 6px 20px;
  align-items: center;
}
.guide-box h2 {
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px 18px;
  counter-reset: step;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 30px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}
.steps strong {
  display: block;
  color: var(--text);
}
@media (min-width: 860px) {
  .guide-box {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 本文と横の欄（パソコン幅で 2 段） */
.portal {
  display: grid;
  gap: 0 16px;
}
.portal-main {
  min-width: 0;
}
@media (min-width: 900px) {
  .portal {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}
.post-box {
  border-color: #f0c9bd;
  background: var(--brand-pale);
}
.post-box ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 0.87rem;
}
.post-box .button {
  width: 100%;
}
.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  font-size: 0.9rem;
}
.link-list li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--line);
}
.link-list.single {
  grid-template-columns: 1fr;
}
.link-list .count {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---- ランキング ---- */
.rank-cols {
  display: grid;
  gap: 4px 24px;
}
.rank-cols h3 {
  margin: 4px 0 2px;
  color: var(--muted);
}
@media (min-width: 640px) {
  .rank-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: rank;
}
.rank-list li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 24px 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
}
.rank-list li:last-child {
  border-bottom: 0;
}
.rank-list li::before {
  content: counter(rank);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.rank-list li:nth-child(1)::before {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--text);
}
.rank-list li:nth-child(2)::before {
  background: var(--silver);
  border-color: var(--silver);
  color: var(--text);
}
.rank-list li:nth-child(3)::before {
  background: var(--bronze);
  border-color: var(--bronze);
  color: var(--text);
}
.rank-count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- 行の一覧（更新された作品など） ---- */
.work-rows {
  list-style: none;
  padding: 0;
  margin: 0;
}
.work-rows li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.work-rows li:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.row-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
}
.row-body {
  min-width: 0;
}
.row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}
.rank-list .row-title {
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.row-meta a {
  color: var(--muted);
}
.row-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.row-tags a {
  color: var(--link);
}
.row-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.new-mark {
  margin-left: 8px;
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* ---- 表紙が並ぶ一覧（新着・人気・タグ・ツール別のページ） ---- */
.work-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 20px 14px;
}
.work-card {
  display: grid;
  gap: 1px;
  align-content: start;
  min-width: 0;
}
.work-card-link {
  position: relative;
  color: var(--link);
  display: grid;
  gap: 6px;
}
.work-thumb,
.cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  display: block;
}
.work-card-link:hover .work-thumb {
  opacity: 0.88;
}
.new-badge {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  padding: 0 7px;
  border-radius: 3px;
  background: var(--brand-deep);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.8;
}
.work-title {
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-meta {
  font-size: 0.8rem;
  line-height: 1.5;
}
.work-meta a {
  color: var(--muted);
}
.chips {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 1px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--link);
  font-size: 0.85rem;
}
.chip:hover {
  background: var(--brand-pale);
  text-decoration: none;
}
.chip .count {
  color: var(--muted);
  font-size: 0.75rem;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0;
}
.tool-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.tool-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.tool-list a:hover {
  background: var(--brand-pale);
  text-decoration: none;
}

/* ---- 作品ページ ---- */
.work-head {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.work-head .cover {
  max-width: 220px;
}
.work-info h1 {
  margin-top: 0;
  font-size: clamp(1.3rem, 4.6vw, 1.7rem);
}
.work-info p {
  margin: 0.35rem 0;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.work-actions,
.share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.9rem 0;
}
.share .button {
  min-height: 34px;
  font-size: 0.82rem;
  font-weight: 400;
  padding: 3px 12px;
}
@media (min-width: 640px) {
  .work-head {
    grid-template-columns: 220px 1fr;
  }
}
.made-with {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.made-with h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.made-with .chip {
  background: var(--surface);
}
.ai-note {
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
.episode-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.episode-list li + li {
  border-top: 1px solid var(--line);
}
.episode-list a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 11px 16px;
  font-weight: 700;
}
.episode-list a:hover {
  background: var(--soft);
  text-decoration: none;
}
.episode-list .muted {
  font-weight: 400;
}
.report-link {
  margin: 2.5rem 0 1rem;
  font-size: 0.85rem;
  text-align: right;
}
.report-link a {
  color: var(--muted);
}

/* ---- 読むページ ---- */
.crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reader h1 {
  font-size: 1.2rem;
  margin-top: 0.6rem;
}
.pages {
  max-width: 800px;
  margin: 1rem auto;
  display: grid;
  gap: 6px;
}
.pages img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}
@media (max-width: 828px) {
  .reader .pages {
    margin-left: -14px;
    margin-right: -14px;
  }
  .reader .pages img {
    border-left: 0;
    border-right: 0;
  }
}
.afterword,
.transcript {
  max-width: 800px;
  margin: 1.2rem auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.afterword h2 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}
.afterword p,
.transcript p {
  margin: 0.3rem 0 0;
}
.transcript summary {
  cursor: pointer;
  font-weight: 700;
}
.ep-nav {
  max-width: 800px;
  margin: 1.5rem auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
}
.ep-nav > :last-child {
  justify-self: end;
}
.ep-nav > :first-child {
  justify-self: start;
}
.after-read {
  max-width: 800px;
  margin: 1rem auto;
}

/* ---- 広告・紹介リンク ---- */
.ad-slot {
  display: grid;
  gap: 10px;
  margin: 16px auto 0;
  max-width: 800px;
}
.ad {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px 12px 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.ad img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
}
.ad-text {
  display: grid;
  font-size: 0.9rem;
}
.ad-label {
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--muted);
  color: var(--muted);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 1.6;
}
.ad .ad-label {
  position: absolute;
  left: 12px;
  top: 12px;
}

/* ---- 投稿の管理 ---- */
.my-works,
.admin-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}
.my-works li,
.admin-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.my-works strong {
  font-size: 1.02rem;
}
.admin-list li {
  display: block;
}
.admin-list p {
  margin: 0.2rem 0;
}
.quote {
  border-left: 3px solid var(--line);
  padding-left: 12px;
  color: var(--muted);
}
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 12px;
  border: 2px dashed var(--brand);
  border-radius: 10px;
  background: var(--brand-pale);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.over {
  background: #fbe3da;
}
.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone:focus-within {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.upload-status {
  min-height: 1.75em;
  font-weight: 700;
}
.upload-status.error {
  color: var(--brand-deep);
}
.page-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  counter-reset: page;
}
.page-list li {
  counter-increment: page;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.page-list li::before {
  content: counter(page);
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 26px;
  border-radius: 4px;
  background: var(--brand-deep);
  color: #ffffff;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.page-list img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}
.page-tools {
  display: flex;
}
.page-tools button {
  flex: 1;
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
}
.page-tools button:hover {
  background: var(--soft);
}
.page-tools button:last-child {
  border-right: 0;
}
.cover-uploader {
  display: grid;
  gap: 12px;
  max-width: 320px;
}
.cover-uploader .cover {
  max-width: 180px;
}
.danger-zone {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  justify-items: start;
}
.announce {
  margin: 1rem 0;
  padding: 12px 16px 4px;
  border: 1px solid #f0c9bd;
  border-radius: var(--radius);
  background: var(--brand-pale);
}
.stack {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.dev-login {
  margin-top: 2rem;
  padding: 14px;
  border: 2px dashed var(--warn);
  border-radius: var(--radius);
}
.admin-pages {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.admin-pages img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  display: block;
  border: 1px solid var(--line);
}

/* 数字の表 */
.table-wrap {
  overflow-x: auto;
}
table.data {
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.87rem;
}
table.data th,
table.data td {
  padding: 6px 12px;
  border: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
table.data thead th {
  background: var(--soft);
  text-align: center;
}
table.data tbody th {
  text-align: left;
  font-weight: 400;
}

/* ---- 文章のページ ---- */
.plain,
.doc,
.profile {
  max-width: 760px;
  margin-top: 16px;
  padding: 6px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.doc li {
  margin: 0.3rem 0;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
}
.facts dt {
  font-weight: 700;
}
.facts dd {
  margin: 0;
}
.links {
  display: flex;
  gap: 16px;
}
/* 自動送信よけの欄。人には見せない */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- フッター：リンクをまとまりごとに ---- */
.site-footer {
  margin-top: 3rem;
  padding: 1.6rem 0 2.4rem;
  background: #3b352f;
  color: #e9e3da;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px 24px;
  margin-bottom: 1.2rem;
}
.footer-cols nav {
  display: grid;
  gap: 4px;
  align-content: start;
  font-size: 0.87rem;
}
.footer-cols h2 {
  margin: 0 0 4px;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid #5a524a;
  font-size: 0.87rem;
  color: #ffffff;
}
.site-footer a {
  color: #e9e3da;
}
/* サイトからのお願い（小さく、下の方に） */
.footer-pledge {
  margin: 1.1rem 0 0.6rem;
  padding: 0.7rem 0 0 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #cfc7bb;
}
.footer-pledge li {
  margin: 0.15rem 0;
}
.footer-note {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: #b9b0a4;
}

/* 読み終わりの、ホームへ戻るリンク */
.ep-home {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

/* スマホの幅では、メニュー 5 つ（ホーム・ランキング・新着・ツール別・投稿の管理）を 1 段に収める */
@media (max-width: 560px) {
  .main-nav {
    gap: 0;
  }
  .main-nav a {
    padding: 5px 5px;
    font-size: 0.9rem;
  }
}

/* 公式 AI 作者 */
.official-ai-badge { display:inline-block; padding:2px 7px; border:1px solid var(--accent, #bb5147); border-radius:4px; color:#9a3d35; background:#fff5f2; font-size:12px; font-weight:700; vertical-align:middle; white-space:nowrap; }
.author-icon { width:80px; height:80px; border-radius:16px; object-fit:cover; }
.author-initial { display:flex; align-items:center; justify-content:center; background:#fff0eb; color:#9a3d35; border:1px solid #eed6d0; font-size:36px; font-weight:700; }
.ai-author-profile h1 { margin-bottom:10px; }
