@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Noto+Serif+JP:wght@400;500&display=swap');

/* 共通設定：配色・余白などのデザイントークン */
:root {
  --bg: #f6f4ef;
  --home-bg: #fbf5e8;
  --ink: #303b33;
  --muted: #888b80;
  --line: #dedfd5;
  --accent: #ae654f;
}
/* 基本スタイル */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
a {
  color: inherit;
  text-decoration: none;
}
/* 一覧画面 */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 84px 40px 0;
}
/* 作品一覧・検索・フィルター */
.collection {
  padding-top: 31px;
}
.collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 21px;
}
h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
#count {
  font-family: Georgia, serif;
  font-size: 14px;
  color: #89917e;
  margin-left: 12px;
}
.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
}
.view-toggle button {
  width: 31px;
  height: 26px;
  color: #8c9283;
}
.view-toggle .selected {
  background: #e0e5d8;
  border-radius: 2px;
  color: var(--ink);
}
.search-row {
  display: flex;
  gap: 15px;
}
.search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: 1;
  background: #faf9f5;
  padding: 0 14px;
  gap: 12px;
}
.search span {
  font-size: 25px;
  color: #88907e;
}
.search input {
  border: 0;
  outline: 0;
  background: none;
  width: 100%;
  font-size: 11px;
  height: 43px;
}
.search kbd {
  border: 1px solid var(--line);
  padding: 0 6px;
  color: #a0a498;
}
select {
  background: #f6f4ef;
  border: 1px solid var(--line);
  padding: 11px 28px 11px 12px;
  border-radius: 4px;
  font-size: 11px;
  max-width: 100%;
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.filter-row select {
  padding-top: 8px;
  padding-bottom: 8px;
  flex: 1;
  min-width: 100px;
}
.filter-row button {
  font-size: 10px;
  color: #888d7f;
}
.demo-note {
  font-size: 10px;
  color: #929486;
  line-height: 1.8;
  margin-bottom: 22px;
}
.demo-note span {
  font-size: 8px;
  letter-spacing: 1px;
  border: 1px solid #d9dccf;
  padding: 3px 5px;
  margin-right: 8px;
}
/* 作品カード */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
}
.card {
  min-width: 0;
}
.art-button {
  display: block;
  width: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: #e3e4da;
  aspect-ratio: 3/4;
}
.art-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.art-button:hover img {
  transform: scale(1.035);
}
.art-button .tier-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #f7f5eee8;
  padding: 5px 9px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.3px;
}
.card-info {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding-top: 12px;
}
.card h3 {
  font-size: 12px;
  margin: 0 0 5px;
  font-weight: 500;
}
.card p {
  font-size: 10px;
  color: #96998c;
  margin: 0;
}
.favorite {
  font-size: 23px;
  line-height: 1;
  color: #8d947f;
}
.favorite.on {
  color: var(--accent);
}
.tags {
  margin-top: 9px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag {
  font-size: 9px;
  color: #7e8974;
  padding: 3px 7px;
  background: #e9ece2;
  border-radius: 3px;
}
/* 縦スクロール表示 */
.gallery.stream {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.stream .art-button {
  aspect-ratio: auto;
}
.stream .art-button img {
  height: auto;
  display: block;
  max-height: 85vh;
  object-fit: contain;
}
.empty {
  text-align: center;
  padding: 65px 10px;
  font-size: 15px;
}
.empty p {
  font-size: 12px;
  color: var(--muted);
}
/* フッター */
footer {
  margin-top: 55px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #949989;
  letter-spacing: 1px;
}
/* ダイアログ・画像追加フォーム */
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  padding: 28px;
  width: min(600px, 94vw);
  max-height: 92dvh;
}
dialog::backdrop {
  background: #152018c9;
  backdrop-filter: blur(8px);
}
body:has(dialog[open]) {
  overflow: hidden;
}
.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-heading button {
  font-size: 18px;
}
.muted {
  font-size: 11px;
  color: #8a8e80;
  line-height: 1.9;
}
form label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  margin: 15px 0;
}
form input {
  width: 100%;
  padding: 11px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 0;
}
.dropzone {
  border: 1px dashed #a8b198;
  text-align: center;
  padding: 24px;
  border-radius: 5px;
  background: #ecefe5;
  cursor: pointer;
}
.dropzone input {
  border: 0;
  font-size: 11px;
}
.dropzone span {
  color: #8a927f;
  font-size: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.primary {
  background: var(--ink);
  color: #fff;
  width: 100%;
  padding: 13px;
  border-radius: 4px;
}
#uploadError {
  color: #ad4938;
  font-size: 12px;
}
/* 拡大ビューアー */
#viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #151a17;
  color: #eceee6;
  padding: 16px 28px;
}
.viewer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 42px;
  font-size: 11px;
  color: #abb2a5;
}
.viewer-top button {
  color: #eceee6;
  font-size: 23px;
  margin-left: 15px;
}
.image-stage {
  height: calc(100dvh - 190px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.image-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
.image-stage button {
  position: absolute;
  top: 45%;
  font-size: 38px;
  color: #fff;
  background: #15201890;
  border-radius: 50%;
  width: 45px;
  height: 55px;
  z-index: 1;
}
.prev {
  left: 0;
}
.next {
  right: 0;
}
.viewer-info {
  max-width: 950px;
  margin: 18px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.viewer-info h2 {
  font-size: 14px;
}
.viewer-info p {
  font-size: 10px;
  color: #9da594;
  margin: 8px 0;
}
.viewer-info .tag {
  background: #30382c;
  color: #c1cbb5;
  margin: 3px;
  display: inline-block;
}
.viewer-hint {
  text-align: center;
  font-size: 9px;
  color: #7f8979;
}
/* 操作結果の通知 */
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 22px;
  border-radius: 5px;
  z-index: 5;
  display: none;
  font-size: 12px;
}
/* ワイド画面 */
@media (min-width: 1500px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* スマートフォン */
@media (max-width: 720px) {
  main {
    padding: 76px 20px 0;
  }
  .collection {
    padding-top: 24px;
  }
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }
  .filter-row select {
    min-width: 90px;
  }
  .search-row {
    gap: 8px;
  }
  .search {
    padding: 0 9px;
    gap: 6px;
  }
  .search kbd {
    display: none;
  }
  .search input {
    font-size: 10px;
  }
  #sort {
    width: 100px;
    padding-right: 10px;
  }
  .demo-note {
    font-size: 9px;
  }
  .card h3 {
    font-size: 11px;
  }
  .card p {
    font-size: 9px;
  }
  .tier-badge {
    font-size: 8px !important;
    left: 8px !important;
    top: 8px !important;
  }
  .tags {
    gap: 3px;
  }
  .tag {
    font-size: 8px;
  }
  .form-grid {
    gap: 0 12px;
  }
  #viewer {
    padding: 10px 14px;
  }
  .viewer-info {
    display: block;
  }
  .image-stage {
    height: calc(100dvh - 215px);
  }
  .viewer-hint {
    font-size: 8px;
  }
  footer {
    font-size: 8px;
    letter-spacing: 0;
  }
}

/* 先頭・末尾では移動ボタンを薄く表示 */
.image-stage button:disabled {
  opacity: 0.2;
  cursor: default;
}

/* トップページ：大きな写真を画面の外まで重ねる */
[hidden] {
  display: none !important;
}
body:has(#home:not([hidden])) {
  background: var(--home-bg);
}
.home {
  position: relative;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: var(--home-bg);
}
.home-stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y pinch-zoom;
  outline-offset: -4px;
}
/* 白い写真用紙と影。3枚をずらし、次のイラストを背面に見せる。 */
.home-stack {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(102vw, 85dvh, 900px);
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  isolation: isolate;
  pointer-events: none;
}
.polaroid {
  --card-angle: 0deg;
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(10px, 2vw, 16px);
  padding-bottom: clamp(38px, 7vw, 64px);
  background: #fffefa;
  border: 1px solid #e6dfd566;
  box-shadow:
    0 3px 6px #54412615,
    0 18px 40px #54412624;
  transition:
    transform 600ms cubic-bezier(0.22, 0.7, 0.2, 1),
    opacity 500ms ease;
  will-change: transform;
}
.polaroid[data-depth='0'] {
  z-index: 3;
  transform: translate(-2%, 1%) rotate(var(--card-angle));
}
.polaroid[data-depth='1'] {
  z-index: 2;
  transform: translate(9%, -4%) rotate(calc(var(--card-angle) + 7deg));
}
.polaroid[data-depth='2'] {
  z-index: 1;
  transform: translate(-8%, -5%) rotate(calc(var(--card-angle) - 9deg));
}
/* 下の白枠にキャラ名を添える。長い名前は2行まで表示。 */
.polaroid-caption {
  position: absolute;
  bottom: 0;
  left: clamp(10px, 2vw, 16px);
  right: clamp(10px, 2vw, 16px);
  height: clamp(38px, 7vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  text-align: center;
  font-family: 'Noto Serif JP', Georgia, serif;
  font-size: clamp(12px, 2.6vw, 19px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #575548;
}
.polaroid-window {
  flex: 1;
  min-height: 0;
  background: #f3f1ed;
  overflow: hidden;
}
.polaroid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.polaroid.is-leaving {
  z-index: 4;
  transform: translate(calc(var(--exit-direction) * -80%), 10%)
    rotate(calc(var(--exit-direction) * -18deg));
  opacity: 0;
}
.home-empty {
  position: absolute;
  inset: 45% 20px auto;
  text-align: center;
  color: #77796d;
  font-size: 12px;
}
.menu-toggle {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 4;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #303b3326;
  border-radius: 50%;
  background: #fbf5e8d9;
  color: var(--ink);
  backdrop-filter: blur(12px);
}
.menu-toggle span {
  width: 19px;
  height: 1px;
  background: currentColor;
  transition:
    transform 350ms ease,
    opacity 220ms ease;
}
/* キャラ名と重ならないよう、サイト紹介は右下へ独立配置。 */
.home-footer {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(86px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.home-footer button {
  background: #fbf5e8e8;
  border-radius: 24px;
  padding: 12px 18px;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 2px;
  pointer-events: auto;
  text-shadow: 0 1px 5px var(--home-bg);
}
.home-footer span {
  margin-left: 12px;
}
/* ボタンの下へゆっくり現れるコンパクトなメニュー */
.site-menu {
  position: fixed;
  inset: max(82px, calc(env(safe-area-inset-top) + 64px)) max(20px, env(safe-area-inset-right)) auto
    auto;
  margin: 0;
  height: auto;
  max-height: calc(100dvh - 112px);
  width: min(320px, calc(100vw - 40px));
  border-radius: 18px;
  padding: 24px 20px;
  overflow: visible;
  background: #fbf5e8f5;
  box-shadow: 0 18px 60px #493b2326;
  transform-origin: top right;
}
.site-menu::backdrop {
  background: #322b2026;
  backdrop-filter: blur(3px);
}
.site-menu .modal-heading {
  padding: 0 12px 12px;
}
/* 三本線と同じボタンが×になるため、別の閉じるボタンは視覚的に省略 */
#closeMenu {
  display: none;
}
.site-menu .menu-toggle {
  position: absolute;
  top: -64px;
  right: 0;
}
.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.site-menu[open] nav .nav {
  animation: menu-item-enter 500ms both;
}
.site-menu[open] nav .nav:nth-child(2) {
  animation-delay: 50ms;
}
.site-menu[open] nav .nav:nth-child(3) {
  animation-delay: 100ms;
}
.site-menu[open] nav .nav:nth-child(4) {
  animation-delay: 150ms;
}
@keyframes menu-item-enter {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-height: 550px) {
  .site-menu {
    overflow-y: auto;
  }
  #closeMenu {
    display: block;
  }
  .site-menu .menu-toggle {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-toggle span {
    transition: none;
  }
  .site-menu[open] nav .nav {
    animation: none;
  }
}
.site-menu nav {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.site-menu .nav {
  text-align: left;
  padding: 16px;
  border-radius: 5px;
  font-size: 13px;
}
.site-menu .nav.active {
  background: #dde2d6;
}
.autoplay-toggle {
  text-align: left;
  padding: 16px;
  margin-top: 25px;
  font-size: 11px;
  color: #6f7969;
}
.about-copy {
  line-height: 2.2;
  margin-top: 28px;
}
@media (prefers-reduced-motion: reduce) {
  .polaroid {
    transition: none;
  }
}

/* 分類メニュー：開いた項目の中に名前と作品数を表示。 */
.menu-content {
  max-height: calc(100dvh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.menu-category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}
.menu-category summary::-webkit-details-marker {
  display: none;
}
.menu-category summary > span {
  transition: transform 250ms ease;
}
.menu-category[open] summary > span {
  transform: rotate(180deg);
}
.menu-category[open] summary {
  background: #e8e9dc;
}
.category-options {
  display: grid;
  gap: 3px;
  padding: 6px 0 8px 12px;
  border-left: 1px solid #dcdccc;
  margin: 5px 0 3px 16px;
}
.category-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.6;
}
.category-option:hover {
  background: #e8e9dc;
}
.category-option small {
  color: #929581;
  font-size: 10px;
  flex-shrink: 0;
}
.category-empty {
  padding-left: 12px;
  font-size: 11px;
  color: var(--muted);
}
.favorite-heart {
  color: var(--accent);
  margin-left: 5px;
}
.archive-actions {
  display: flex;
  justify-content: flex-end;
}
.add-button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
}
@media (prefers-reduced-motion: reduce) {
  .menu-category summary > span {
    transition: none;
  }
}

/* 投稿の表紙・投稿内一覧 */
.post-cover {
  box-shadow:
    5px 5px 0 #e6e4da,
    9px 9px 0 #eeece4;
  margin-bottom: 8px;
}
.image-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 4px;
  padding: 5px 10px;
  background: #fbf5e8eb;
  color: var(--ink);
  font-size: 11px;
}
.back-to-posts {
  padding: 12px 0;
  margin-bottom: 18px;
  font-size: 12px;
}
.post-details {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.post-details h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  margin: 0 0 16px;
}
.post-details .tag {
  font-size: 11px;
  padding: 7px 10px;
}

/* 拡大時もクリーム色。画像の全体と分類情報を同じ画面に収める。 */
#viewer {
  background: var(--home-bg);
  color: var(--ink);
}
#viewer[open] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#viewer .viewer-top {
  flex-shrink: 0;
  color: #737b69;
}
#viewer .viewer-top button {
  color: var(--ink);
}
#viewer .image-stage {
  height: auto;
  flex: 1;
  min-height: 0;
}
#viewer .image-stage button {
  background: #fbf5e8d9;
  color: var(--ink);
}
#viewer .viewer-info {
  width: 100%;
  margin: 8px auto 0;
  flex-shrink: 0;
}
#viewer .viewer-info p {
  color: #7c8372;
}
#viewer .viewer-info .tag {
  background: #e9ecdf;
  color: #56624b;
}
#viewer .viewer-hint {
  flex-shrink: 0;
  margin: 4px 0;
  color: #7b826f;
}
@media (max-width: 720px) {
  #viewer .viewer-info .tag {
    font-size: 9px;
  }
  .post-details {
    margin-bottom: 20px;
  }
}

/* 閲覧状況：全画像を実際に開いた投稿だけ「閲覧済み」にする */
.seen-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #e9eedeea;
  color: #506044;
}
.post-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0;
}
.reading-status {
  font-size: 10px;
  color: #61734f;
}
.reading-status.unread {
  color: #949783;
}
.resume-post {
  font-size: 11px;
  color: #68784f;
  padding: 7px 0;
  text-align: left;
}
.menu-resume {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  background: #e6eadb;
  font-size: 11px;
  line-height: 1.7;
}
.category-options {
  overflow: hidden;
}
/* サイト紹介・投稿フォームも穏やかに下へ現れる */
dialog[open]:not(.site-menu):not(#viewer) {
  animation: panel-enter 350ms ease both;
}
@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open]:not(.site-menu):not(#viewer) {
    animation: none;
  }
}

/* 検索欄のプルダウンも同じ速度で下へ展開 */
.custom-select {
  position: relative;
  min-width: 100px;
}
.filter-row > .custom-select {
  flex: 1;
}
.dropdown-trigger {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: left;
  font-size: 11px;
  background: var(--bg);
}
.dropdown-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  width: max-content;
  min-width: 100%;
  max-width: min(300px, calc(100vw - 40px));
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: #fbf8ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px #42371b1c;
}
.dropdown-options button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 4px;
  font-size: 12px;
}
.dropdown-options button:hover,
.dropdown-options button[aria-selected='true'] {
  background: #e5e9da;
}
.search-row > .custom-select {
  flex: 0 0 120px;
}
@media (max-width: 720px) {
  .custom-select {
    min-width: 90px;
  }
  .search-row > .custom-select {
    flex-basis: 100px;
  }
  .dropdown-options {
    width: 100%;
    min-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* 表紙の後ろに白い用紙を重ねる。追加の画像リクエストは不要。 */
.post-cover {
  box-shadow: none;
  margin-bottom: 8px;
}
.post-cover.is-stack {
  overflow: visible;
  background: #fffefa;
  border: 7px solid #fffefa;
  isolation: isolate;
}
.post-cover.is-stack::before,
.post-cover.is-stack::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fffefa;
  border: 1px solid #ded9cd;
  border-radius: 5px;
  z-index: -1;
  pointer-events: none;
  box-shadow: 0 3px 7px #493d241a;
}
.post-cover.is-stack::before {
  transform: translate(7px, 0) rotate(3deg);
}
.post-cover.is-stack::after {
  transform: translate(-5px, -2px) rotate(-2deg);
}
.post-cover.is-stack > img {
  position: relative;
  z-index: 0;
  border-radius: 2px;
}
.post-cover.is-stack .image-count {
  z-index: 1;
}
.post-card {
  margin: 4px 8px 0;
}
.image-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  pointer-events: none;
}
.image-status span {
  padding: 5px 8px;
  border-radius: 4px;
  background: #eff1e4eb;
  color: #536447;
  font-size: 10px;
}
.download-progress {
  font-size: 10px;
  color: #7c836e;
  margin-top: 10px;
}
.account-menu {
  margin-top: 16px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.account-menu p {
  font-size: 10px;
  color: #7b8271;
  overflow-wrap: anywhere;
}
.account-menu button {
  font-size: 11px;
  padding: 8px 0;
}
.account-tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.account-tabs button {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 12px;
}
.account-tabs button[aria-pressed='true'] {
  background: #e1e7d4;
}
#accountError {
  color: #a74535;
  font-size: 12px;
}
#viewer .viewer-top .download-button {
  font-size: 11px;
  border: 1px solid #cdd2bf;
  border-radius: 5px;
  padding: 8px 12px;
}
@media (max-width: 720px) {
  #viewer .viewer-top .download-button {
    font-size: 9px;
    margin-left: 4px;
    padding: 8px;
  }
}

/* 投稿の詳細：イラスト、文章、コメントがひとつのページに続く */
body.is-post-open #archive {
  max-width: 1040px;
}
.post-details {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.post-media {
  border-radius: 10px;
  overflow: hidden;
  background: #ece8de;
}
.post-hero {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  height: min(65dvh, 650px);
  background: #ece8de;
}
.post-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-hero > span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: #fbf5e8e8;
  padding: 7px 11px;
  border-radius: 5px;
  font-size: 10px;
}
.post-thumbnails {
  display: flex;
  gap: 7px;
  padding: 10px;
  overflow-x: auto;
  overscroll-behavior: contain;
}
.post-thumbnails button {
  flex: 0 0 90px;
  height: 110px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #f8f6ef;
}
.post-thumbnails button[aria-pressed='true'] {
  border-color: #7d8f69;
}
.post-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-media-count {
  margin: 0;
  padding: 2px 14px 12px;
  text-align: right;
  color: #7e8575;
  font-size: 10px;
}
.post-writing {
  padding: 32px 10px;
}
.post-writing h1 {
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.post-date {
  color: #858b7b;
  font-size: 11px;
  margin: 8px 0 16px;
}
.post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 2.1;
  font-size: 14px;
  margin: 30px 0;
}
.post-writing-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.edit-post-button {
  border: 1px solid var(--line);
  padding: 9px 14px;
  font-size: 11px;
  border-radius: 4px;
}
.post-comments {
  border-top: 1px solid var(--line);
  padding: 28px 10px;
  margin-bottom: 20px;
}
#commentsList {
  margin: 24px 0;
}
.comment {
  display: flex;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #e3e3d8;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e2e7d7;
  font-size: 12px;
}
.comment-content {
  min-width: 0;
  flex: 1;
}
.comment-content header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}
.comment-content strong {
  font-size: 12px;
}
.comment-content time {
  color: #8d9383;
  font-size: 10px;
}
.comment-content p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 0;
}
.comments-empty {
  color: #8a917d;
  font-size: 12px;
}
#commentLogin {
  color: #62734f;
  padding-left: 12px;
}
#commentForm {
  max-width: 650px;
}
#commentError,
#postEditorError {
  color: #a74535;
  font-size: 12px;
}
textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfaf7;
  padding: 12px;
  border-radius: 5px;
  resize: vertical;
  line-height: 1.8;
}
.post-image-list > summary {
  cursor: pointer;
  font-size: 12px;
  padding: 18px 10px;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}
.post-image-list[open] > summary {
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .post-writing {
    padding: 24px 0;
  }
  .post-thumbnails button {
    flex-basis: 70px;
    height: 85px;
  }
  .post-body {
    font-size: 13px;
  }
  .post-hero {
    height: 55dvh;
  }
}

/* 写真の前面だけクリック可能にし、背面はスワイプの装飾として扱う */
.polaroid[data-depth='0']:not(.is-leaving) {
  pointer-events: auto;
  cursor: pointer;
}
.polaroid[data-depth='0']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.home-new-posts {
  position: absolute;
  top: max(21px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid #303b331a;
  background: #fbf5e8e8;
  color: var(--ink);
  font-size: 11px;
  backdrop-filter: blur(12px);
}
.home-new-posts > span:first-child,
.nav-new-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #9d674e;
}
.nav-new-label {
  margin-right: 10px;
}
@media (max-width: 720px) {
  .home-new-posts {
    gap: 8px;
    padding: 12px;
    font-size: 10px;
  }
}

/* スマホでは作品を先に見せ、検索は親指で届く下部から開く */
.filter-dock {
  display: none;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
}
.active-filters:empty {
  margin: 0;
}
.active-filter {
  background: #e8ecde;
  border-radius: 20px;
  padding: 7px 11px;
  font-size: 11px;
  color: #5d6e4f;
}
.active-filter span {
  margin-left: 8px;
}
.filter-sheet {
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, 650px);
  max-width: 100%;
  max-height: 86dvh;
  border-radius: 22px 22px 0 0;
  padding: 12px 22px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: #c9cdbf;
  margin: 0 auto 20px;
}
.filter-sheet .modal-heading {
  margin-bottom: 24px;
}
.filter-sheet .demo-note {
  display: none;
}
.filter-sheet .dropdown-options {
  position: relative;
  top: 0;
  margin-top: 5px;
  max-height: 190px;
}
.filter-sheet #applyFilters {
  margin-top: 20px;
  position: sticky;
  bottom: 0;
}
.filter-sheet[open] {
  animation: sheet-rise 350ms cubic-bezier(0.2, 0.7, 0.2, 1) !important;
}
@keyframes sheet-rise {
  from {
    opacity: 0;
    transform: translateY(45px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 720px) {
  #archive {
    padding-bottom: 100px;
  }
  .gallery:not(.stream) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery.stream {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }
  .gallery.stream .card h3 {
    font-size: 15px;
    line-height: 1.7;
  }
  .gallery.stream .card p {
    font-size: 11px;
  }
  .gallery.stream .tag {
    font-size: 10px;
    padding: 5px 8px;
  }
  .gallery.stream .reading-status,
  .gallery.stream .download-progress {
    font-size: 11px;
  }
  .filter-dock:not([hidden]) {
    display: flex;
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
  }
  .filter-dock button {
    background: #34452f;
    color: #fffef6;
    border-radius: 28px;
    padding: 15px 26px;
    box-shadow: 0 6px 22px #27362130;
    font-size: 12px;
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .filter-sheet[open] {
    animation: none !important;
  }
}

/* 投稿の管理画面 */
.composer-dialog,
.composer-preview {
  width: min(920px, calc(100% - 24px));
  max-width: 920px;
}
.composer-dialog form {
  display: grid;
  gap: 18px;
}
.composer-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 14px;
}
.composer-image {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fffdf8;
  border: 1px solid #deded1;
  border-radius: 10px;
}
.composer-image img {
  width: 100%;
  height: 170px;
  object-fit: contain;
}
.composer-image button {
  padding: 8px;
  font-size: 13px;
}
.composer-image [aria-pressed='true'] {
  background: #e1e7d9;
}
.composer-image > div {
  display: flex;
  gap: 8px;
}
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: #f7f5ef;
}
.preview-cover {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
.managed-post {
  display: grid;
  text-align: left;
  gap: 8px;
  width: 100%;
  margin: 10px 0;
  padding: 16px;
}
.managed-post span {
  color: #737b70;
  font-size: 14px;
}
.locked-label {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #faf7edee;
  color: #3c4439;
  font-size: 13px;
}
#relatedPosts {
  margin: 50px 0;
}
#relatedPosts h2 {
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .composer-dialog,
  .composer-preview {
    padding: 18px;
  }
  .composer-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.manager-actions button {
  min-height: 44px;
  padding: 10px 14px;
}
.managed-post-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.export-post {
  min-height: 44px;
  padding: 8px 12px;
}
.month-heading {
  grid-column: 1 / -1;
  margin: 22px 0 0;
}
.month-heading small {
  font-size: 13px;
  color: var(--muted);
}

.control-page {
  width: min(620px, calc(100% - 40px));
  margin: 60px auto;
  padding-bottom: 60px;
}
.control-page h1 {
  font-size: clamp(24px, 5vw, 34px);
  margin: 20px 0;
}
.control-page form {
  margin: 24px 0;
}
.control-page p {
  line-height: 1.9;
}
.auth-secret {
  display: block;
  padding: 18px;
  overflow-wrap: anywhere;
  background: #e6eadf;
  font-size: 18px;
  user-select: all;
}
#recoveryCodes {
  padding: 20px;
  background: #e6eadf;
  line-height: 1.9;
}
#controlMessage {
  color: #72523c;
}

/* Creator profile and quiet, compact collection controls */
.creator-header {
  margin: 4px 0 18px;
}
.creator-banner {
  position: relative;
  height: clamp(150px, 22vw, 285px);
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(120deg, #e6e8d8, #ede0c9 55%, #d6ddcd);
}
.creator-banner img,
.creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-wordmark {
  position: absolute;
  top: 32%;
  left: 6%;
  max-width: 75%;
  font-family: Georgia, serif;
  letter-spacing: 0.16em;
  font-size: clamp(18px, 3vw, 42px);
  color: #68725d;
}
.has-image .banner-wordmark,
.creator-avatar.has-image > span {
  display: none;
}
.creator-profile {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px 20px;
}
.creator-avatar {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  overflow: hidden;
  border-radius: 50%;
  background: #e6eadf;
  border: 6px solid var(--bg);
  display: grid;
  place-items: center;
  margin-top: -34px;
}
.creator-avatar > span {
  font-family: Georgia, serif;
  font-size: 44px;
  color: #697660;
}
.creator-avatar img {
  position: absolute;
  inset: 0;
}
.creator-profile h1 {
  margin: 5px 0;
  font-size: 28px;
}
.creator-profile p {
  margin: 5px 0;
  font-size: 13px;
  color: #7b8272;
}
.creator-profile .eyebrow {
  letter-spacing: 0.2em;
  font-size: 10px;
}
.profile-edit {
  margin-left: auto;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 12px;
}
#browseControls {
  padding: 20px;
  border: 1px solid #e2e1d7;
  border-radius: 18px;
  background: #fffdf8a6;
}
.search {
  border-radius: 12px;
  background: #fffefa;
  min-height: 52px;
}
.search input {
  font-size: 14px;
}
.dropdown-trigger {
  border-radius: 10px;
  background: #f9f8f2;
  min-height: 44px;
  font-size: 13px;
}
.dropdown-options {
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 42px #38403012;
}
.dropdown-options button {
  min-height: 44px;
  border-radius: 7px;
}
.filter-row {
  gap: 10px;
  margin-bottom: 5px;
}
.filter-row > .custom-select {
  min-width: 120px;
}
.browse-hint {
  margin: 14px 0 0;
  font-size: 11px;
  color: #89917f;
  letter-spacing: 0.03em;
}
.collection-heading h2 {
  font-family: Georgia, serif;
  font-size: 25px;
}
.collection-heading #count {
  font-family: inherit;
  font-size: 12px;
  margin-left: 10px;
}
.creator-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 60px;
  padding: 36px 0;
}
.creator-footer p {
  margin-top: 8px;
  color: #8a907f;
  font-size: 12px;
}
#socialLinks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.social-link {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #546049;
  text-decoration: none;
  min-width: 48px;
  font-size: 10px;
}
.social-link svg {
  width: 25px;
  height: 25px;
}
.social-link.unset {
  opacity: 0.4;
}
.social-link:hover {
  color: #25351d;
}
.composer-actions .action-button {
  flex: 1 1 160px;
  width: auto;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
}
.action-publish {
  background: #42523c;
  color: #fff;
}
.action-draft {
  background: #e3e9de;
  color: #45573e;
}
.action-preview {
  background: #eee3d3;
  color: #725d40;
}
.tag-field {
  grid-column: 1 / -1;
}
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.editable-tag {
  display: inline-flex;
  align-items: center;
  background: #e7ebdf;
  border-radius: 20px;
  padding: 3px 6px;
}
.editable-tag button {
  padding: 7px 8px;
  font-size: 12px;
}
.tag-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.tag-input-row input {
  flex: 1;
  min-width: 0;
}
.tag-input-row button,
.taxonomy-tools button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
}
.tag-field small {
  color: #8a907f;
  font-size: 11px;
}
.taxonomy-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.branding-preview {
  margin: 20px 0;
}
.branding-preview .creator-banner {
  height: 180px;
}
.branding-preview .creator-avatar {
  margin-left: 20px;
  width: 86px;
  height: 86px;
}
#siteSettingsForm fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
#siteSettingsForm input[type='range'] {
  padding: 0;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-label input[type='checkbox'] {
  width: 18px;
  margin: 0;
}
.reader-mode-bar {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 12px 18px;
  background: #394b33;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px #29372324;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
}
.reader-mode-bar button {
  color: #fff;
  text-decoration: underline;
}
.renovation-label {
  background: #ede7d9f2;
  color: #746446;
}
@media (max-width: 720px) {
  main {
    padding-top: 72px;
  }
  .creator-banner {
    height: 150px;
    border-radius: 12px;
  }
  .creator-profile {
    padding: 0 8px 14px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .creator-avatar {
    width: 78px;
    height: 78px;
    margin-top: -22px;
    border-width: 4px;
  }
  .creator-profile h1 {
    font-size: 23px;
  }
  .creator-profile p {
    font-size: 11px;
  }
  .profile-edit {
    font-size: 11px;
    padding: 8px 12px;
  }
  #browseControls {
    padding: 12px;
  }
  .creator-footer {
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }
  #socialLinks {
    gap: 22px;
  }
  .composer-actions .action-button {
    flex-basis: 30%;
    min-width: 0;
    font-size: 12px;
    padding: 10px 5px;
  }
  .branding-preview .creator-banner {
    height: 125px;
  }
  #siteSettingsForm > .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ホームの外部リンクと、10投稿ずつの出会い */
.home-social-links {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  z-index: 5;
  padding: 10px 20px;
  border-radius: 20px;
  background: #fbf5e8e8;
}
.home-social-links .social-link {
  min-width: 38px;
}
.home-social-links .social-link svg {
  width: 22px;
  height: 22px;
}
.load-more-wrap {
  text-align: center;
  margin: 32px 0;
}
#loadMorePosts {
  padding: 15px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #e7ebdf;
  color: #48563e;
  min-height: 48px;
}
#pageProgress {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}
#browseControls select#series,
#browseControls select#character {
  min-height: 44px;
  border-radius: 10px;
  background: #f9f8f2;
  font-size: 13px;
}
@media (max-width: 720px) {
  .home-stack {
    top: 44%;
  }
  .home-social-links {
    gap: 18px;
  }
  .home-footer button {
    padding: 9px 14px;
  }
}

.atelier-home {
  padding: 0;
  font: inherit;
  letter-spacing: 0.1em;
  text-align: left;
  min-height: 44px;
}
.atelier-home span {
  font-size: 13px;
  margin-left: 10px;
}
.account-menu > button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  min-height: 40px;
}
#homeSocialLinks {
  position: absolute;
  top: auto;
  bottom: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 24px);
}
#taxonomyDialog {
  width: min(560px, calc(100% - 24px));
}

/* 管理者の下書き・予約と、表紙で探せる投稿管理 */
.draft-card .post-cover img {
  filter: grayscale(0.65);
  opacity: 0.6;
}
.post-state-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  background: #e5e4dbee;
  color: #5d6357;
  font-size: 12px;
  border-radius: 8px;
  z-index: 2;
}
.scheduled-card .post-state-badge,
.status-scheduled .manager-status {
  background: #e8dfc8;
  color: #755d35;
}
.action-schedule {
  background: #e0d7ec;
  color: #68517f;
}
.schedule-field {
  margin: 20px 0;
}
.schedule-field small {
  color: var(--muted);
  font-size: 12px;
}
.editor-secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}
.danger {
  color: #a95048;
  border: 1px solid #dcb9b0;
  border-radius: 10px;
  padding: 10px 16px;
}
#postManager {
  width: min(1000px, calc(100% - 24px));
}
#managerSearch {
  margin: 12px 0;
}
.manager-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 22px;
}
.manager-tabs button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-size: 13px;
}
.manager-tabs button[aria-pressed='true'] {
  background: #e1e8d8;
  color: #45563b;
}
.manager-tabs small {
  margin-left: 5px;
}
#managedPosts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.managed-card {
  display: flex;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fffcf7;
  min-width: 0;
}
.managed-cover {
  width: 98px;
  height: 140px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ece7dd;
}
.managed-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.managed-card-info {
  min-width: 0;
  flex: 1;
}
.managed-title {
  display: block;
  text-align: left;
  padding: 9px 0;
  line-height: 1.5;
  font-size: 14px;
}
.managed-card p {
  font-size: 11px;
  line-height: 1.5;
  margin: 4px 0;
  color: var(--muted);
}
.manager-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e3eadb;
  color: #526445;
  font-size: 11px;
}
.status-draft .manager-status,
.status-trash .manager-status {
  background: #e7e5e0;
  color: #75766d;
}
.status-draft .managed-cover img,
.status-trash .managed-cover img {
  filter: grayscale(0.7);
  opacity: 0.65;
}
.managed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.managed-card-actions button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}
@media (max-width: 720px) {
  #managedPosts {
    grid-template-columns: 1fr;
  }
  .managed-cover {
    width: 82px;
    height: 120px;
  }
  .composer-actions .action-button {
    flex-basis: 40%;
  }
}

.emoji-toolbar {
  position: relative;
  margin: 7px 0 12px;
  grid-column: 1/-1;
}
.emoji-toggle {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  color: #6a755f;
  min-height: 36px;
}
.emoji-panel {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  width: min(100%, 410px);
  max-height: 360px;
  overflow: auto;
  box-shadow: 0 8px 24px #35402610;
}
.emoji-panel input {
  font-size: 13px;
  min-height: 42px;
}
.emoji-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0;
}
.emoji-tabs button {
  padding: 6px 9px;
  border-radius: 18px;
  font-size: 11px;
  min-height: 32px;
}
.emoji-tabs button[aria-pressed='true'] {
  background: #e5ebdc;
  color: #43563a;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.emoji-grid button {
  padding: 6px 2px;
  min-height: 40px;
  font-size: 23px;
  border-radius: 8px;
}
.emoji-grid button:hover,
.emoji-grid button:focus-visible {
  background: #eee9dc;
}
.emoji-grid.kaomoji-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kaomoji-grid button {
  font-size: 14px;
}
.emoji-message {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 10px 0 0;
}

.language-switch {
  display: flex;
  gap: 8px;
  padding: 0 12px 16px;
}
.language-switch button {
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  font-size: 12px;
}
.language-switch button[aria-pressed='true'] {
  background: #e2e9d9;
  color: #42573b;
}
#registrationNickname small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
#nicknameEditor {
  width: min(500px, calc(100% - 24px));
}

/* 最下部に言語切替と案内。スマホはSNSを一段上へ。 */
.home-footer {
  bottom: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 6;
}
.home-footer button {
  letter-spacing: 0.06em;
  font-size: 12px;
}
#homeLanguageToggle {
  border: 1px solid var(--line);
  pointer-events: auto;
  min-height: 40px;
}
.translation-field small {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.preview-language {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.preview-language button {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
}
.preview-language button[aria-pressed='true'] {
  background: #e2e9d9;
}
@media (max-width: 720px) {
  #homeSocialLinks {
    bottom: 78px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .home-footer {
    left: 12px;
    right: 12px;
    justify-content: center;
  }
  .home-footer button {
    padding: 9px 13px;
  }
}

/* 写真の積み重なりや幅の縮小に埋もれない、画面端のホーム操作。 */
.home-footer {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100% - 24px);
  flex-wrap: nowrap;
}
.home-footer button {
  flex-shrink: 0;
  white-space: nowrap;
}
#homeLanguageToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  order: 2;
  background: #fbf5e8;
  border: 1px solid #c5ccbb;
  color: #34452c;
}
@media (max-width: 1000px) {
  #homeSocialLinks {
    bottom: 78px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .home-footer {
    left: 12px;
    right: 12px;
    justify-content: center;
  }
}

.post-tier-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 8px;
  background: #e8eddfed;
  color: #405638;
  font-size: 12px;
  max-width: 42%;
  line-height: 1.5;
  text-align: center;
}
.image-count {
  max-width: calc(100% - 24px);
  line-height: 1.6;
  text-align: right;
}
.publication-label {
  font-size: 10px;
}
.post-access-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  align-items: center;
}
.tier-chip,
.publication-chip {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 20px;
  background: #e3e9da;
  color: #43553b;
  font-size: 13px;
  line-height: 1.4;
}
.publication-chip {
  background: #eee7db;
  color: #77664e;
}
@media (max-width: 720px) {
  #upload,
  #composerPreview {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #uploadForm {
    min-width: 0;
    gap: 14px;
  }
  #uploadForm .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  #uploadForm label {
    min-width: 0;
    margin: 0;
  }
  #uploadForm input,
  #uploadForm select,
  #uploadForm textarea {
    font-size: 16px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  #uploadForm input,
  #uploadForm select {
    min-height: 46px;
  }
  #uploadForm textarea {
    min-height: 130px;
    line-height: 1.7;
  }
  #uploadForm .modal-heading {
    position: sticky;
    top: -16px;
    z-index: 10;
    background: var(--bg);
    padding: 12px 0;
    margin: 0;
    align-items: center;
  }
  #uploadForm .modal-heading h2 {
    font-size: 21px;
    line-height: 1.4;
  }
  #closeUpload {
    min-width: 44px;
    min-height: 44px;
  }
  #uploadForm .composer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    z-index: 5;
    bottom: -16px;
    padding: 12px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  #uploadForm .composer-actions .action-button {
    font-size: 13px;
    min-height: 46px;
    padding: 10px 8px;
    width: 100%;
  }
  .editor-secondary-actions {
    flex-wrap: wrap;
  }
  .translation-field small {
    font-size: 12px;
  }
  .post-tier-badge {
    font-size: 11px;
    padding: 6px 9px;
  }
}

.post-cover .locked-label {
  max-width: calc(54% - 24px);
  box-sizing: border-box;
  line-height: 1.5;
}
.draft-card .locked-label,
.scheduled-card .locked-label {
  display: none;
}
